/external/linux-kselftest/tools/testing/selftests/net/ |
D | ip_defrag.c | 28 #define IP4_HLEN (sizeof(struct iphdr)) 99 static uint16_t udp_checksum(struct ip *iphdr, struct udphdr *udphdr) in udp_checksum() argument 104 sum = raw_checksum((uint8_t *)&iphdr->ip_src, 2 * sizeof(iphdr->ip_src), in udp_checksum() 115 static uint16_t udp6_checksum(struct ip6_hdr *iphdr, struct udphdr *udphdr) in udp6_checksum() argument 120 sum = raw_checksum((uint8_t *)&iphdr->ip6_src, 2 * sizeof(iphdr->ip6_src), in udp6_checksum() 174 struct ip *iphdr = (struct ip *)ip_frame; in send_fragment() local 178 iphdr->ip_off = htons(offset / 8); in send_fragment() 181 iphdr->ip_off = htons(offset / 8 | IP4_MF); in send_fragment() 183 iphdr->ip_len = htons(frag_len); in send_fragment() 204 struct ip *iphdr = (struct ip *)ip_frame; in send_udp_frags() local [all …]
|
D | psock_snd.c | 80 vh->hdr_len = ETH_HLEN + sizeof(struct iphdr) + sizeof(struct udphdr); in build_vnet_header() 84 vh->csum_start = ETH_HLEN + sizeof(struct iphdr); in build_vnet_header() 95 vh->gso_size = cfg_mtu - sizeof(struct iphdr); in build_vnet_header() 119 struct iphdr *iph = header; in build_ipv4_header()
|
D | msg_zerocopy.c | 257 static int setup_iph(struct iphdr *iph, uint16_t payload_len) in setup_iph() 490 struct iphdr iph; in do_tx() 635 off += sizeof(struct iphdr); in do_flush_datagram() 636 ret -= sizeof(struct iphdr); in do_flush_datagram()
|
/external/android-clat/ |
D | translate.h | 47 void fill_ip_header(struct iphdr *ip_targ, uint16_t payload_len, uint8_t protocol, 50 const struct iphdr *old_header); 61 const struct iphdr *old_header); 62 uint8_t parse_frag_header(const struct ip6_frag *frag_hdr, struct iphdr *ip_targ); 66 const struct iphdr *old_header); 67 uint8_t parse_frag_header(const struct ip6_frag *frag_hdr, struct iphdr *ip_targ);
|
D | dump.h | 29 void dump_ip(struct iphdr *header); 31 void dump_udp(const struct udphdr *udp, const struct iphdr *ip, const uint8_t *payload, 33 void dump_tcp(const struct tcphdr *tcp, const struct iphdr *ip, const uint8_t *payload,
|
D | translate.c | 125 void fill_ip_header(struct iphdr *ip, uint16_t payload_len, uint8_t protocol, in fill_ip_header() 128 memset(ip, 0, sizeof(struct iphdr)); in fill_ip_header() 133 ip->tot_len = htons(sizeof(struct iphdr) + payload_len); in fill_ip_header() 160 const struct iphdr *old_header) { in fill_ip6_header() 181 const struct iphdr *old_header) { in maybe_fill_frag_header() 209 uint8_t parse_frag_header(const struct ip6_frag *frag_hdr, struct iphdr *ip_targ) { in parse_frag_header() 498 char iphdr[sizeof(struct ip6_hdr)]; in translate_packet() local 508 { iphdr, 0 }, // IP header. in translate_packet()
|
D | ipv6.c | 81 struct iphdr *ip_targ = (struct iphdr *)out[pos].iov_base; in ipv6_packet() 124 out[pos].iov_len = sizeof(struct iphdr); in ipv6_packet() 178 ip_targ->check = ip_checksum(ip_targ, sizeof(struct iphdr)); in ipv6_packet()
|
D | clatd_test.cpp | 188 int is_ipv4_fragment(struct iphdr *ip) { in is_ipv4_fragment() 202 int ipv4_fragment_offset(struct iphdr *ip) { in ipv4_fragment_offset() 218 struct iphdr *ip = (struct iphdr *)packet; in check_packet() 297 struct iphdr *ip = nullptr; in reassemble_packet() 313 struct iphdr *ip_orig = (struct iphdr *)packet; in reassemble_packet() 323 ip = (struct iphdr *)reassembled; in reassemble_packet() 410 struct iphdr *ip = (struct iphdr *)packet; in fix_udp_checksum() 526 struct iphdr *ip; in get_transport_checksum() 534 ip = (struct iphdr *)packet; in get_transport_checksum() 827 ASSERT_EQ(sizeof(struct iphdr), sizeof(v4_header)) << "Test IPv4 header: incorrect length\n"; in TEST_F() [all …]
|
D | ipv4.c | 59 const struct iphdr *header = (struct iphdr *)packet; in ipv4_packet() 69 if (len < sizeof(struct iphdr)) { in ipv4_packet()
|
D | dump.c | 41 void dump_ip(struct iphdr *header) { in dump_ip() 150 void dump_udp(const struct udphdr *udp, const struct iphdr *ip, const uint8_t *payload, in dump_udp() 208 void dump_tcp(const struct tcphdr *tcp, const struct iphdr *ip, const uint8_t *payload, in dump_tcp()
|
D | clatd_microbenchmark.c | 50 #define PAYLOADSIZE (1280 - sizeof(struct iphdr) - sizeof(struct udphdr)) 95 struct iphdr ip = { in send_packet()
|
/external/linux-kselftest/tools/testing/selftests/bpf/ |
D | test_xdp_noinline.c | 235 off += sizeof(struct iphdr); in calc_offset() 237 off += sizeof(struct icmphdr) + sizeof(struct iphdr); in calc_offset() 341 struct iphdr *iph; in encap_v4() 348 if (bpf_xdp_adjust_head(xdp, 0 - (int)sizeof(struct iphdr))) in encap_v4() 354 old_eth = data + sizeof(struct iphdr); in encap_v4() 367 iph->tot_len = __builtin_bswap16(pkt_bytes + sizeof(struct iphdr)); in encap_v4() 377 for (int i = 0; i < sizeof(struct iphdr) >> 1; i++) in encap_v4() 380 if (bpf_xdp_adjust_head(xdp, (int)sizeof(struct iphdr))) in encap_v4() 413 new_eth = *data + sizeof(struct iphdr); in decap_v4() 417 if (bpf_xdp_adjust_head(xdp, (int)sizeof(struct iphdr))) in decap_v4() [all …]
|
D | test_queue_stack_map.h | 41 struct iphdr *iph = (struct iphdr *)(eth + 1); in _test()
|
D | test_pkt_access.c | 37 struct iphdr *iph = (struct iphdr *)(eth + 1); in process()
|
D | test_sk_lookup_kern.c | 31 struct iphdr *iph = (struct iphdr *)(data + nh_off); in get_tuple()
|
D | test_flow_dissector.c | 171 struct iphdr *iph = header; in build_ipv4_header() 212 static uint16_t build_udp_v4_csum(const struct iphdr *iph, in build_udp_v4_csum() 249 udph->check = build_udp_v4_csum(header - sizeof(struct iphdr), in build_udp_header() 273 return sizeof(struct iphdr); in l3_length()
|
D | test_xdp.c | 87 struct iphdr *iph = data + sizeof(struct ethhdr); in handle_ipv4() 113 if (bpf_xdp_adjust_head(xdp, 0 - (int)sizeof(struct iphdr))) in handle_ipv4()
|
/external/iputils/ |
D | ping.c | 100 static void pr_iph(struct iphdr *ip); 788 struct iphdr *ip; in parse_reply() 797 ip = (struct iphdr *)buf; in parse_reply() 807 opts = buf + sizeof(struct iphdr); in parse_reply() 808 optlen = hlen - sizeof(struct iphdr); in parse_reply() 856 struct iphdr * iph = (struct iphdr *)(&icp[1]); in parse_reply() 859 if (cc < 8+sizeof(struct iphdr)+8 || in parse_reply() 929 pr_options(opts, optlen + sizeof(struct iphdr)); in parse_reply() 1049 pr_iph((struct iphdr*)(icp + 1)); in pr_icmph() 1054 pr_iph((struct iphdr*)(icp + 1)); in pr_icmph() [all …]
|
D | clockdiff.c | 139 struct iphdr *ip = (struct iphdr *) packet; in measure() 316 struct iphdr *ip = (struct iphdr *) packet; in measure_opt()
|
/external/iptables/iptables/ |
D | nft-ipv4.c | 48 add_proto(r, offsetof(struct iphdr, protocol), 1, in nft_ipv4_add() 54 add_addr(r, offsetof(struct iphdr, saddr), in nft_ipv4_add() 60 add_addr(r, offsetof(struct iphdr, daddr), in nft_ipv4_add() 65 add_payload(r, offsetof(struct iphdr, frag_off), 2, in nft_ipv4_add() 190 case offsetof(struct iphdr, saddr): in nft_ipv4_parse_payload() 203 case offsetof(struct iphdr, daddr): in nft_ipv4_parse_payload() 216 case offsetof(struct iphdr, protocol): in nft_ipv4_parse_payload() 222 case offsetof(struct iphdr, frag_off): in nft_ipv4_parse_payload()
|
/external/iptables/extensions/ |
D | libxt_TCPMSS.c | 32 __TCPMSS_help(sizeof(struct iphdr)); in TCPMSS_help() 42 .min = 0, .max = UINT16_MAX - sizeof(struct iphdr),
|
/external/ltp/testcases/network/stress/ns-tools/ |
D | ns-icmpv4_sender.c | 359 pkt_size = sizeof(struct iphdr) /* IP header */ in create_clean_packet() 367 pkt.hdr.ihl = sizeof(struct iphdr) / 4; in create_clean_packet() 390 sizeof(struct iphdr)); in create_clean_packet() 523 calc_checksum((u_int16_t *) & (pkt->hdr), sizeof(struct iphdr)); in thrust_fakes()
|
/external/u-boot/net/ |
D | bootp.c | 711 uchar *pkt, *iphdr; in bootp_request() local 764 iphdr = pkt; /* We need this later for net_set_udp_header() */ in bootp_request() 813 net_set_udp_header(iphdr, bcast_ip, PORT_BOOTPS, PORT_BOOTPC, iplen); in bootp_request() 970 uchar *pkt, *iphdr; in dhcp_send_request_packet() local 985 iphdr = pkt; /* We'll need this later to set proper pkt size */ in dhcp_send_request_packet() 1025 net_set_udp_header(iphdr, bcast_ip, PORT_BOOTPS, PORT_BOOTPC, iplen); in dhcp_send_request_packet()
|
/external/wpa_supplicant_8/src/ap/ |
D | fils_hlp.c | 161 struct iphdr *iph; in fils_dhcp_handler() 482 const struct iphdr *iph; in fils_process_hlp_udp() 488 iph = (const struct iphdr *) pos; in fils_process_hlp_udp() 513 const struct iphdr *iph; in fils_process_hlp_ip() 518 iph = (const struct iphdr *) pos; in fils_process_hlp_ip()
|
/external/u-boot/arch/sandbox/cpu/ |
D | eth-raw-os.c | 157 struct udphdr *udph = packet + sizeof(struct iphdr); in sandbox_eth_raw_os_send() 177 struct iphdr *iph = packet; in sandbox_eth_raw_os_send()
|