Home
last modified time | relevance | path

Searched refs:be16toh (Results 1 – 23 of 23) sorted by relevance

/systemd-251/src/resolve/
Dresolved-dns-packet.h105 #define DNS_PACKET_QR(p) ((be16toh(DNS_PACKET_HEADER(p)->flags) >> 15) & 1)
106 #define DNS_PACKET_OPCODE(p) ((be16toh(DNS_PACKET_HEADER(p)->flags) >> 11) & 15)
107 #define DNS_PACKET_AA(p) ((be16toh(DNS_PACKET_HEADER(p)->flags) >> 10) & 1)
108 #define DNS_PACKET_TC(p) ((be16toh(DNS_PACKET_HEADER(p)->flags) >> 9) & 1)
109 #define DNS_PACKET_RD(p) ((be16toh(DNS_PACKET_HEADER(p)->flags) >> 8) & 1)
110 #define DNS_PACKET_RA(p) ((be16toh(DNS_PACKET_HEADER(p)->flags) >> 7) & 1)
111 #define DNS_PACKET_AD(p) ((be16toh(DNS_PACKET_HEADER(p)->flags) >> 5) & 1)
112 #define DNS_PACKET_CD(p) ((be16toh(DNS_PACKET_HEADER(p)->flags) >> 4) & 1)
124 return rcode | (be16toh(DNS_PACKET_HEADER(p)->flags) & 0xF); in DNS_PACKET_RCODE()
169 #define DNS_PACKET_QDCOUNT(p) be16toh(DNS_PACKET_HEADER(p)->qdcount)
[all …]
Dresolved-dns-stream.c290 if (s->n_read < sizeof(s->read_size) + be16toh(s->read_size)) in dns_stream_take_read_packet()
377 if (be16toh(s->read_size) < DNS_PACKET_HEADER_SIZE) in on_stream_io()
380 if (s->n_read < sizeof(s->read_size) + be16toh(s->read_size)) { in on_stream_io()
384 … r = dns_packet_new(&s->read_packet, s->protocol, be16toh(s->read_size), DNS_PACKET_SIZE_MAX); in on_stream_io()
388 s->read_packet->size = be16toh(s->read_size); in on_stream_io()
397 … s->read_packet->sender_port = be16toh(s->peer.in.sin_port); in on_stream_io()
399 … s->read_packet->destination_port = be16toh(s->local.in.sin_port); in on_stream_io()
403 … s->read_packet->sender_port = be16toh(s->peer.in6.sin6_port); in on_stream_io()
405 … s->read_packet->destination_port = be16toh(s->local.in6.sin6_port); in on_stream_io()
416 sizeof(s->read_size) + be16toh(s->read_size) - s->n_read); in on_stream_io()
Dtest-resolved-stream.c138 assert_se(asprintf(&bind_str, "%s:%d", ip_str, be16toh(server_address.in.sin_port)) >= 0); in tls_dns_server()
Dresolved-manager.c798 p->sender_port = be16toh(sa.in.sin_port); in manager_recv()
801 p->sender_port = be16toh(sa.in6.sin6_port); in manager_recv()
Dresolved-dns-stub.c716 … DNS_PACKET_HEADER(c)->flags = htobe16(be16toh(DNS_PACKET_HEADER(c)->flags) | DNS_PACKET_FLAG_TC); in dns_stub_patch_bypass_reply_packet()
/systemd-251/src/libsystemd-network/
Dtest-dhcp6-client.c330 assert_se(sizeof(option1) == sizeof(DHCP6Option) + be16toh(option->len)); in TEST()
332 …r = dhcp6_option_parse_ia(NULL, 0, be16toh(option->code), be16toh(option->len), option->data, &ia); in TEST()
335 …r = dhcp6_option_parse_ia(NULL, iaid, be16toh(option->code), be16toh(option->len), option->data, &… in TEST()
339 …r = dhcp6_option_parse_ia(NULL, iaid, be16toh(option->code), be16toh(option->len), option->data, &… in TEST()
343 …r = dhcp6_option_parse_ia(NULL, iaid, be16toh(option->code), be16toh(option->len), option->data, &… in TEST()
347 assert_se(sizeof(option2) == sizeof(DHCP6Option) + be16toh(option->len)); in TEST()
348 …r = dhcp6_option_parse_ia(NULL, iaid, be16toh(option->code), be16toh(option->len), option->data, &… in TEST()
352 assert_se(sizeof(option3) == sizeof(DHCP6Option) + be16toh(option->len)); in TEST()
353 …r = dhcp6_option_parse_ia(NULL, iaid, be16toh(option->code), be16toh(option->len), option->data, &… in TEST()
360 assert_se(sizeof(option4) == sizeof(DHCP6Option) + be16toh(option->len)); in TEST()
[all …]
Ddhcp-packet.c162 if (len < hdrlen + be16toh(packet->udp.len)) in dhcp_packet_verify_headers()
165 len, hdrlen + be16toh(packet->udp.len)); in dhcp_packet_verify_headers()
167 if (be16toh(packet->udp.dest) != port) in dhcp_packet_verify_headers()
170 be16toh(packet->udp.dest), port); in dhcp_packet_verify_headers()
185 be16toh(packet->udp.len) + 12)) in dhcp_packet_verify_headers()
Dtest-dhcp-client.c135 assert_se(dhcp_packet_checksum((uint8_t*)&buf, 20) == be16toh(0x78ae)); in test_checksum()
202 assert_se(discover->udp.source == be16toh(DHCP_PORT_CLIENT)); in dhcp_network_send_raw_socket()
203 assert_se(discover->udp.dest == be16toh(DHCP_PORT_SERVER)); in dhcp_network_send_raw_socket()
Dsd-dhcp6-client.c259 v = duid_type_to_string(be16toh(client->duid.type)); in sd_dhcp6_client_duid_as_string()
369 return CMP(be16toh(*a), be16toh(*b)); in be16_compare_func()
Dndisc-router.c97 rt->lifetime = be16toh(a->nd_ra_router_lifetime); in ndisc_router_parse()
Dsd-dhcp-client.c211 uint16_t duid_type = be16toh(client_id->ns.duid.type); in sd_dhcp_client_id_to_string()
/systemd-251/src/basic/
Dsparse-endian.h46 #undef be16toh
85 static inline uint16_t be16toh(be16_t value) { return bswap_16_on_le((uint16_t __sd_force)value); } in be16toh() function
Dunaligned.h12 return be16toh(u->x); in unaligned_read_be16()
30 u->x = be16toh(a); in unaligned_write_be16()
Dsocket-util.c368 *ret_port = be16toh(sa->in.sin_port); in sockaddr_port()
372 *ret_port = be16toh(sa->in6.sin6_port); in sockaddr_port()
463 be16toh(sa->in.sin_port)); in sockaddr_pretty()
485 be16toh(sa->in6.sin6_port)); in sockaddr_pretty()
501 be16toh(sa->in6.sin6_port), in sockaddr_pretty()
Dsocket-util.h209 if (be16toh(_sa->sll_hatype) == ARPHRD_ETHER) \
211 if (be16toh(_sa->sll_hatype) == ARPHRD_INFINIBAND) \
/systemd-251/coccinelle/
Dhtonl.cocci21 + be16toh(s)
/systemd-251/src/timesync/
Dtimesyncd-bus.c159 … return be16toh(ts->sec) * USEC_PER_SEC + (be16toh(ts->frac) * USEC_PER_SEC) / (usec_t) 0x10000ULL; in ntp_ts_short_to_usec()
Dtimesyncd-manager.c69 return be16toh(ts->sec) + (be16toh(ts->frac) / 65536.0); in ntp_ts_short_to_d()
/systemd-251/.lgtm/cpp-queries/
DPotentiallyDangerousFunction.ql42 message = "Call to ntohs() is confusing. Use be16toh() instead."
/systemd-251/src/core/
Dsocket.c833 be16toh(local.in.sin_port), in instance_from_socket()
835 be16toh(remote.in.sin_port)) < 0) in instance_from_socket()
856 be16toh(local.in6.sin6_port), in instance_from_socket()
858 be16toh(remote.in6.sin6_port)) < 0) in instance_from_socket()
867 be16toh(local.in6.sin6_port), in instance_from_socket()
869 be16toh(remote.in6.sin6_port)) < 0) in instance_from_socket()
/systemd-251/src/udev/cdrom_id/
Dcdrom_id.c373 … len = be16toh(discinfo.disc_information_length) + sizeof(discinfo.disc_information_length); in cd_profiles_old_mmc()
/systemd-251/src/libsystemd/sd-netlink/
Dnetlink-message.c898 *data = be16toh(*(uint16_t *) attr_data); in sd_netlink_message_read_u16()
/systemd-251/src/network/
Dnetworkctl.c1871 TABLE_UINT16, be16toh(info->vxlan_info.dest_port)); in link_status_one()