| /tools/testing/selftests/net/ |
| A D | ip_defrag.c | 106 sum = raw_checksum((uint8_t *)&iphdr->ip_src, 2 * sizeof(iphdr->ip_src), in udp_checksum() 122 sum = raw_checksum((uint8_t *)&iphdr->ip6_src, 2 * sizeof(iphdr->ip6_src), in udp6_checksum() 232 memset(iphdr, 0, sizeof(*iphdr)); in send_udp_frags() 233 iphdr->ip_hl = 5; in send_udp_frags() 234 iphdr->ip_v = 4; in send_udp_frags() 235 iphdr->ip_tos = 0; in send_udp_frags() 236 iphdr->ip_id = htons(ip_id++); in send_udp_frags() 237 iphdr->ip_ttl = 0x40; in send_udp_frags() 238 iphdr->ip_p = IPPROTO_UDP; in send_udp_frags() 240 iphdr->ip_dst = addr4; in send_udp_frags() [all …]
|
| A D | nat6to4.bpf.c | 77 if (bpf_ntohs(ip6->payload_len) > 0xFFFF - sizeof(struct iphdr)) in sched_cls_ingress6_nat_6_prog() 94 struct iphdr ip = { in sched_cls_ingress6_nat_6_prog() 96 .ihl = sizeof(struct iphdr) / sizeof(__u32), // u4 in sched_cls_ingress6_nat_6_prog() 98 .tot_len = bpf_htons(bpf_ntohs(ip6->payload_len) + sizeof(struct iphdr)), // u16 in sched_cls_ingress6_nat_6_prog() 136 if (data + l2_header_size + sizeof(struct iphdr) > data_end) in sched_cls_ingress6_nat_6_prog() 145 *(struct iphdr *)(new_eth + 1) = ip; in sched_cls_ingress6_nat_6_prog() 156 const struct iphdr *const ip4 = (void *)(eth + 1); in sched_cls_egress4_snat4_prog()
|
| A D | gro.c | 250 struct iphdr *iph = buf; in fill_networklayer() 406 struct iphdr *iph = (struct iphdr *)(buf + ETH_HLEN); in recompute_packet() 584 struct iphdr *iph; in add_ipv4_ts_option() 636 struct iphdr *iph1; in send_flush_id_case() 637 struct iphdr *iph2; in send_flush_id_case() 638 struct iphdr *iph3; in send_flush_id_case() 768 struct iphdr *iph = (struct iphdr *)(buf + ETH_HLEN); in send_fragment4() 794 struct iphdr *iph = (struct iphdr *)(buf + ETH_HLEN); in send_changed_ttl() 811 struct iphdr *iph = (struct iphdr *)(buf + ETH_HLEN); in send_changed_tos() 833 struct iphdr *iph = (struct iphdr *)(buf + ETH_HLEN); in send_changed_ECN() [all …]
|
| A D | tap.c | 266 struct iphdr *iph = (struct iphdr *)buf; in build_ipv4_header() 311 vh->hdr_len = ETH_HLEN + sizeof(struct iphdr) + sizeof(struct udphdr); in build_test_packet_valid_udp_gso() 313 vh->csum_start = ETH_HLEN + sizeof(struct iphdr); in build_test_packet_valid_udp_gso() 316 vh->gso_size = ETH_DATA_LEN - sizeof(struct iphdr); in build_test_packet_valid_udp_gso() 348 vh->hdr_len = ETH_HLEN + sizeof(struct iphdr) + sizeof(struct udphdr); in build_test_packet_crash_tap_invalid_eth_proto() 351 vh->gso_size = ETH_DATA_LEN - sizeof(struct iphdr); in build_test_packet_crash_tap_invalid_eth_proto() 355 cur += sizeof(struct iphdr) + sizeof(struct udphdr); in build_test_packet_crash_tap_invalid_eth_proto()
|
| /tools/testing/selftests/bpf/progs/ |
| A D | skb_pkt_end.c | 13 #define ETH_IPV4_TCP_SIZE (14 + sizeof(struct iphdr) + sizeof(struct tcphdr)) 15 static INLINE struct iphdr *get_iphdr(struct __sk_buff *skb) in get_iphdr() 17 struct iphdr *ip = NULL; in get_iphdr() 33 struct iphdr *ip = NULL; in main_prog() 57 offset = sizeof(struct ethhdr) + offsetof(struct iphdr, protocol); in main_prog()
|
| A D | test_btf_skc_cls_ingress.c | 23 static void test_syncookie_helper(void *iphdr, int iphdr_size, in test_syncookie_helper() argument 43 mss_cookie = bpf_tcp_gen_syncookie(tp, iphdr, iphdr_size, in test_syncookie_helper() 54 int ret = bpf_tcp_check_syncookie(tp, iphdr, iphdr_size, in test_syncookie_helper() 71 void *data_end, *iphdr; in handle_ip_tcp() local 73 struct iphdr *ip4h; in handle_ip_tcp() 81 ip4h = (struct iphdr *)(eth + 1); in handle_ip_tcp() 94 iphdr = ip4h; in handle_ip_tcp() 111 iphdr = ip6h; in handle_ip_tcp() 164 test_syncookie_helper(iphdr, iphdr_size, th, tp, skb); in handle_ip_tcp()
|
| A D | test_tc_change_tail.c | 12 static __always_inline struct iphdr *parse_ip_header(struct __sk_buff *skb, int *ip_proto) in parse_ip_header() 17 struct iphdr *iph; in parse_ip_header() 41 static __always_inline struct udphdr *parse_udp_header(struct __sk_buff *skb, struct iphdr *iph) in parse_udp_header() 63 struct iphdr *iph; in change_tail()
|
| A D | test_lwt_reroute.c | 15 struct iphdr *iph = NULL; in test_lwt_reroute() 26 iph = (struct iphdr *)start; in test_lwt_reroute()
|
| A D | test_cls_redirect_dynptr.c | 125 static int pkt_parse_ipv4(struct bpf_dynptr *dynptr, __u64 *offset, struct iphdr *iphdr) in pkt_parse_ipv4() argument 127 if (bpf_dynptr_read(iphdr, sizeof(*iphdr), dynptr, *offset, 0)) in pkt_parse_ipv4() 130 *offset += sizeof(*iphdr); in pkt_parse_ipv4() 132 if (iphdr->ihl < 5) in pkt_parse_ipv4() 136 *offset += (iphdr->ihl - 5) * 4; in pkt_parse_ipv4() 168 static void pkt_ipv4_checksum(struct iphdr *iph) in pkt_ipv4_checksum() 515 case sizeof(struct iphdr): { in fill_tuple() 516 struct iphdr *ipv4 = (struct iphdr *)iph; in fill_tuple() 556 uint64_t iphlen = sizeof(struct iphdr); in classify_tcp() 609 struct iphdr ipv4; in process_icmpv4() [all …]
|
| A D | test_cls_redirect.c | 216 static __always_inline struct iphdr *pkt_parse_ipv4(buf_t *pkt, struct iphdr *scratch) in pkt_parse_ipv4() 260 static INLINING void pkt_ipv4_checksum(struct iphdr *iph) in pkt_ipv4_checksum() 274 for (size_t i = 0; i < sizeof(struct iphdr) / 2; i++) { in pkt_ipv4_checksum() 453 skb, payload_off + offsetof(struct iphdr, ttl), &ttl, in forward_with_gre() 625 case sizeof(struct iphdr): { in fill_tuple() 626 struct iphdr *ipv4 = (struct iphdr *)iph; in fill_tuple() 667 uint64_t iphlen = sizeof(struct iphdr); in classify_tcp() 741 struct iphdr _ip4; in process_icmpv4() 742 const struct iphdr *ipv4 = pkt_parse_ipv4(pkt, &_ip4); in process_icmpv4() 861 struct iphdr _ip4; in process_ipv4() [all …]
|
| A D | test_queue_stack_map.h | 39 struct iphdr *iph = (struct iphdr *)(eth + 1); in _test()
|
| A D | test_cls_redirect.h | 53 struct iphdr ip; 59 struct iphdr ip;
|
| A D | test_lwt_redirect.c | 29 struct iphdr *iph = NULL; in get_redirect_target() 36 iph = (struct iphdr *)start; in get_redirect_target()
|
| A D | vrf_socket_lookup.c | 23 struct iphdr *iph; in socket_lookup() 32 iph = (struct iphdr *)(eth + 1); in socket_lookup()
|
| A D | test_xdp_noinline.c | 225 off += sizeof(struct iphdr); in calc_offset() 227 off += sizeof(struct icmphdr) + sizeof(struct iphdr); in calc_offset() 339 struct iphdr *iph; in encap_v4() 352 old_eth = data + sizeof(struct iphdr); in encap_v4() 375 for (int i = 0; i < sizeof(struct iphdr) >> 1; i++) in encap_v4() 378 if (bpf_xdp_adjust_head(xdp, (int)sizeof(struct iphdr))) in encap_v4() 406 struct iphdr *iph; in send_icmp_reply() 415 off += sizeof(struct iphdr); in send_icmp_reply() 426 for (int i = 0; i < sizeof(struct iphdr) >> 1; i++) in send_icmp_reply() 486 struct iphdr *iph; in parse_icmp() [all …]
|
| A D | ip_check_defrag.c | 22 static bool is_frag_v4(struct iphdr *iph) in is_frag_v4() 49 struct iphdr *iph; in handle_v4()
|
| A D | xdp_features.c | 78 struct iphdr *ih = (struct iphdr *)(eh + 1); in xdp_process_echo_packet() 84 ih = (struct iphdr *)(eh + 1); in xdp_process_echo_packet() 85 if (ih + 1 > (struct iphdr *)data_end) in xdp_process_echo_packet()
|
| A D | test_tc_bpf.c | 20 struct iphdr *iph = (void *)(long)skb->data + sizeof(struct ethhdr); in pkt_ptr()
|
| A D | test_migrate_reuseport.c | 57 struct iphdr *ip = (struct iphdr *)(eth + 1); in drop_ack()
|
| A D | test_tc_edt.c | 83 struct iphdr *iph; in handle_ipv4() 89 iph = (struct iphdr *)(data + sizeof(struct ethhdr)); in handle_ipv4()
|
| A D | xdping_kern.c | 66 struct iphdr *iph; in icmp_check() 97 struct iphdr *iph; in xdping_client() 159 struct iphdr *iph; in xdping_server()
|
| A D | test_pkt_access.c | 116 struct iphdr *iph = (struct iphdr *)(eth + 1); in test_pkt_access()
|
| A D | test_tc_neigh.c | 44 struct iphdr *ip4h; in is_remote_ep_v4() 49 ip4h = (struct iphdr *)(data + sizeof(struct ethhdr)); in is_remote_ep_v4()
|
| /tools/testing/selftests/bpf/prog_tests/ |
| A D | flow_dissector.c | 20 struct iphdr iph; 26 struct iphdr iph; 27 struct iphdr iph_inner; 35 struct iphdr iph; 74 struct iphdr iph; 76 struct iphdr iph_inner; 370 sizeof(struct iphdr)), 378 sizeof(struct iphdr), 399 sizeof(struct iphdr)), 428 sizeof(struct iphdr)), [all …]
|
| A D | lwt_helpers.h | 44 struct iphdr *ip = (struct iphdr *)buf; in __expect_icmp_ipv4()
|