/external/honggfuzz/examples/linux_kernel_ip/ |
D | linux-kernel-4.10.0.patch | 13 skb_reset_network_header(skb); 14 skb_probe_transport_header(skb, 0); 16 + skb->ip_summed = CHECKSUM_UNNECESSARY; 17 + skb->csum_level = SKB_MAX_CSUM_LEVEL; 19 rxhash = skb_get_hash(skb); 21 tun_rx_batched(tun, tfile, skb, more); 26 @@ -764,7 +764,7 @@ int skb_copy_and_csum_datagram_msg(struct sk_buff *skb, 27 if (skb_copy_and_csum_datagram(skb, hlen, &msg->msg_iter, 31 + if (csum_fold(csum) && skb == NULL) 33 if (unlikely(skb->ip_summed == CHECKSUM_COMPLETE)) [all …]
|
/external/linux-kselftest/tools/testing/selftests/bpf/ |
D | bpf_flow.c | 67 static __always_inline void *bpf_flow_dissect_get_header(struct __sk_buff *skb, in bpf_flow_dissect_get_header() argument 71 void *data_end = (void *)(long)skb->data_end; in bpf_flow_dissect_get_header() 72 void *data = (void *)(long)skb->data; in bpf_flow_dissect_get_header() 73 __u16 thoff = skb->flow_keys->thoff; in bpf_flow_dissect_get_header() 84 if (bpf_skb_load_bytes(skb, thoff, buffer, hdr_size)) in bpf_flow_dissect_get_header() 91 static __always_inline int parse_eth_proto(struct __sk_buff *skb, __be16 proto) in parse_eth_proto() argument 93 struct bpf_flow_keys *keys = skb->flow_keys; in parse_eth_proto() 98 bpf_tail_call(skb, &jmp_table, IP); in parse_eth_proto() 101 bpf_tail_call(skb, &jmp_table, IPV6); in parse_eth_proto() 105 bpf_tail_call(skb, &jmp_table, MPLS); in parse_eth_proto() [all …]
|
D | test_tunnel_kern.c | 47 int _gre_set_tunnel(struct __sk_buff *skb) in _gre_set_tunnel() argument 58 ret = bpf_skb_set_tunnel_key(skb, &key, sizeof(key), in _gre_set_tunnel() 69 int _gre_get_tunnel(struct __sk_buff *skb) in _gre_get_tunnel() argument 75 ret = bpf_skb_get_tunnel_key(skb, &key, sizeof(key), 0); in _gre_get_tunnel() 86 int _ip6gretap_set_tunnel(struct __sk_buff *skb) in _ip6gretap_set_tunnel() argument 98 ret = bpf_skb_set_tunnel_key(skb, &key, sizeof(key), in _ip6gretap_set_tunnel() 110 int _ip6gretap_get_tunnel(struct __sk_buff *skb) in _ip6gretap_get_tunnel() argument 116 ret = bpf_skb_get_tunnel_key(skb, &key, sizeof(key), in _ip6gretap_get_tunnel() 130 int _erspan_set_tunnel(struct __sk_buff *skb) in _erspan_set_tunnel() argument 142 ret = bpf_skb_set_tunnel_key(skb, &key, sizeof(key), in _erspan_set_tunnel() [all …]
|
D | test_lwt_seg6local.c | 64 __attribute__((always_inline)) struct ip6_srh_t *get_srh(struct __sk_buff *skb) in get_srh() argument 71 data_end = (void *)(long)skb->data_end; in get_srh() 72 cursor = (void *)(long)skb->data; in get_srh() 99 int update_tlv_pad(struct __sk_buff *skb, uint32_t new_pad, in update_tlv_pad() argument 105 err = bpf_lwt_seg6_adjust_srh(skb, pad_off, in update_tlv_pad() 119 err = bpf_lwt_seg6_store_bytes(skb, pad_off, in update_tlv_pad() 129 int is_valid_tlv_boundary(struct __sk_buff *skb, struct ip6_srh_t *srh, in is_valid_tlv_boundary() argument 137 srh_off = (char *)srh - (char *)(long)skb->data; in is_valid_tlv_boundary() 155 err = bpf_skb_load_bytes(skb, cur_off, &tlv, sizeof(tlv)); in is_valid_tlv_boundary() 188 int add_tlv(struct __sk_buff *skb, struct ip6_srh_t *srh, uint32_t tlv_off, in add_tlv() argument [all …]
|
D | test_sk_lookup_kern.c | 57 int bpf_sk_lookup_test0(struct __sk_buff *skb) in bpf_sk_lookup_test0() argument 59 void *data_end = (void *)(long)skb->data_end; in bpf_sk_lookup_test0() 60 void *data = (void *)(long)skb->data; in bpf_sk_lookup_test0() 75 sk = bpf_sk_lookup_tcp(skb, tuple, tuple_len, BPF_F_CURRENT_NETNS, 0); in bpf_sk_lookup_test0() 82 int bpf_sk_lookup_test1(struct __sk_buff *skb) in bpf_sk_lookup_test1() argument 87 sk = bpf_sk_lookup_tcp(skb, &tuple, sizeof(tuple), BPF_F_CURRENT_NETNS, 0); in bpf_sk_lookup_test1() 94 int bpf_sk_lookup_uaf(struct __sk_buff *skb) in bpf_sk_lookup_uaf() argument 100 sk = bpf_sk_lookup_tcp(skb, &tuple, sizeof(tuple), BPF_F_CURRENT_NETNS, 0); in bpf_sk_lookup_uaf() 109 int bpf_sk_lookup_modptr(struct __sk_buff *skb) in bpf_sk_lookup_modptr() argument 115 sk = bpf_sk_lookup_tcp(skb, &tuple, sizeof(tuple), BPF_F_CURRENT_NETNS, 0); in bpf_sk_lookup_modptr() [all …]
|
D | sockmap_parse_prog.c | 16 int bpf_prog1(struct __sk_buff *skb) in bpf_prog1() argument 18 void *data_end = (void *)(long) skb->data_end; in bpf_prog1() 19 void *data = (void *)(long) skb->data; in bpf_prog1() 20 __u32 lport = skb->local_port; in bpf_prog1() 21 __u32 rport = skb->remote_port; in bpf_prog1() 27 err = bpf_skb_pull_data(skb, 10); in bpf_prog1() 31 data_end = (void *)(long)skb->data_end; in bpf_prog1() 32 data = (void *)(long)skb->data; in bpf_prog1() 43 return skb->len; in bpf_prog1()
|
D | test_skb_cgroup_id_kern.c | 20 static __always_inline void log_nth_level(struct __sk_buff *skb, __u32 level) in log_nth_level() argument 27 id = bpf_skb_ancestor_cgroup_id(skb, level); in log_nth_level() 32 int log_cgroup_id(struct __sk_buff *skb) in log_cgroup_id() argument 37 log_nth_level(skb, 0); in log_cgroup_id() 38 log_nth_level(skb, 1); in log_cgroup_id() 39 log_nth_level(skb, 2); in log_cgroup_id() 40 log_nth_level(skb, 3); in log_cgroup_id()
|
D | sockmap_verdict_prog.c | 44 int bpf_prog2(struct __sk_buff *skb) in bpf_prog2() argument 46 void *data_end = (void *)(long) skb->data_end; in bpf_prog2() 47 void *data = (void *)(long) skb->data; in bpf_prog2() 48 __u32 lport = skb->local_port; in bpf_prog2() 49 __u32 rport = skb->remote_port; in bpf_prog2() 69 return bpf_sk_redirect_map(skb, &sock_map_rx, sk, 0); in bpf_prog2() 70 return bpf_sk_redirect_map(skb, &sock_map_tx, sk, 0); in bpf_prog2()
|
D | test_pkt_md_access.c | 18 TYPE tmp = *(volatile TYPE *)&skb->FIELD; \ 19 if (tmp != ((*(volatile __u32 *)&skb->FIELD) & MASK)) \ 26 TYPE tmp = *((volatile TYPE *)&skb->FIELD + \ 27 TEST_FIELD_OFFSET(skb->FIELD, TYPE)); \ 28 if (tmp != ((*(volatile __u32 *)&skb->FIELD) & MASK)) \ 34 int process(struct __sk_buff *skb) in process() argument
|
/external/bcc/tests/python/ |
D | test_brb.c | 57 int pem(struct __sk_buff *skb) { in pem() argument 67 if (skb->tc_index == 0) { in pem() 68 skb->tc_index = 1; in pem() 69 skb->cb[0] = skb->cb[1] = 0; in pem() 72 meta.prog_id = skb->cb[0]; in pem() 74 meta.rx_port_id = skb->cb[1]; in pem() 78 ifindex = skb->ingress_ifindex; in pem() 84 skb->cb[0] = dest_p->prog_id; in pem() 85 skb->cb[1] = dest_p->port_id; in pem() 86 jump.call(skb, dest_p->prog_id); in pem() [all …]
|
D | test_call1.c | 14 int parse_ether(struct __sk_buff *skb) { in parse_ether() argument 22 switch (bpf_dext_pkt(skb, cur + 12, 0, 16)) { in parse_ether() 23 case 0x0800: jump.call(skb, S_IP); in parse_ether() 24 case 0x0806: jump.call(skb, S_ARP); in parse_ether() 26 jump.call(skb, S_EOP); in parse_ether() 30 int parse_arp(struct __sk_buff *skb) { in parse_arp() argument 38 jump.call(skb, S_EOP); in parse_arp() 42 int parse_ip(struct __sk_buff *skb) { in parse_ip() argument 50 jump.call(skb, S_EOP); in parse_ip() 54 int eop(struct __sk_buff *skb) { in eop() argument
|
/external/bcc/src/lua/bpf/spec/ |
D | codegen_spec.lua | 183 input = function (skb) 194 input = function (skb) 211 input = function (skb) 230 input = function (skb) 250 input = function (skb) 251 return skb.len 262 input = function (skb) 263 local ptr = skb.data + 5 277 input = function (skb) 278 local ptr = skb.data + 5 [all …]
|
/external/bcc/examples/networking/tunnel_monitor/ |
D | monitor.c | 47 int handle_ingress(struct __sk_buff *skb) { in handle_ingress() argument 48 skb->cb[CB_FLAGS] = IS_INGRESS; in handle_ingress() 49 parser.call(skb, 1); // jump to generic packet parser in handle_ingress() 54 int handle_egress(struct __sk_buff *skb) { in handle_egress() argument 55 skb->cb[CB_FLAGS] = 0; in handle_egress() 56 parser.call(skb, 1); // jump to generic packet parser in handle_egress() 61 int handle_outer(struct __sk_buff *skb) { in handle_outer() argument 77 skb->cb[CB_SIP] = ip->src; in handle_outer() 78 skb->cb[CB_DIP] = ip->dst; in handle_outer() 94 skb->cb[CB_VNI] = vxlan->key; in handle_outer() [all …]
|
/external/iputils/Modules/ |
D | pg3.c | 241 struct sk_buff *skb; in fill_packet() local 247 skb = alloc_skb(pkt_size+64+16, GFP_ATOMIC); in fill_packet() 248 if (!skb) { in fill_packet() 253 skb_reserve(skb, 16); in fill_packet() 256 eth = (__u8 *) skb_push(skb, 14); in fill_packet() 257 iph = (struct iphdr*)skb_put(skb, sizeof( struct iphdr)); in fill_packet() 258 udph = (struct udphdr*)skb_put(skb, sizeof( struct udphdr)); in fill_packet() 284 skb->protocol = __constant_htons(ETH_P_IP); in fill_packet() 285 skb->mac.raw = ((u8*)iph) - 14; in fill_packet() 286 skb->dev = odev; in fill_packet() [all …]
|
/external/iproute2/include/ |
D | bpf_api.h | 160 static void BPF_FUNC(tail_call, struct __sk_buff *skb, void *map, 168 static uint32_t BPF_FUNC(get_cgroup_classid, struct __sk_buff *skb); 171 static uint32_t BPF_FUNC(get_route_realm, struct __sk_buff *skb); 172 static uint32_t BPF_FUNC(get_hash_recalc, struct __sk_buff *skb); 173 static uint32_t BPF_FUNC(set_hash_invalid, struct __sk_buff *skb); 177 static int BPF_FUNC(clone_redirect, struct __sk_buff *skb, int ifindex, 181 static int BPF_FUNC(skb_load_bytes, struct __sk_buff *skb, uint32_t off, 183 static int BPF_FUNC(skb_store_bytes, struct __sk_buff *skb, uint32_t off, 186 static int BPF_FUNC(l3_csum_replace, struct __sk_buff *skb, uint32_t off, 188 static int BPF_FUNC(l4_csum_replace, struct __sk_buff *skb, uint32_t off, [all …]
|
/external/iproute2/examples/bpf/ |
D | bpf_tailcall.c | 56 int cls_case1(struct __sk_buff *skb) in __section_tail() 62 printt("case1: map-val: %d from:%u\n", *val, skb->cb[0]); in __section_tail() 64 skb->cb[0] = ENTRY_0; in __section_tail() 65 tail_call(skb, &jmp_ex, ENTRY_0); in __section_tail() 71 int cls_case2(struct __sk_buff *skb) in __section_tail() 77 printt("case2: map-val: %d from:%u\n", *val, skb->cb[0]); in __section_tail() 79 skb->cb[0] = ENTRY_1; in __section_tail() 80 tail_call(skb, &jmp_tc, ENTRY_0); in __section_tail() 86 int cls_exit(struct __sk_buff *skb) in __section_tail() 92 printt("exit: map-val: %d from:%u\n", *val, skb->cb[0]); in __section_tail() [all …]
|
D | bpf_cyclic.c | 19 int cls_loop(struct __sk_buff *skb) in cls_loop() argument 21 printt("cb: %u\n", skb->cb[0]++); in cls_loop() 22 tail_call(skb, &jmp_tc, 0); in cls_loop() 24 skb->tc_classid = TC_H_MAKE(1, 42); in cls_loop() 29 int cls_entry(struct __sk_buff *skb) in cls_entry() argument 31 tail_call(skb, &jmp_tc, 0); in cls_entry()
|
/external/bcc/examples/networking/vlan_learning/ |
D | vlan_learning.c | 20 int handle_phys2virt(struct __sk_buff *skb) { in handle_phys2virt() argument 22 if (!skb->vlan_present) in handle_phys2virt() 31 lock_xadd(&leaf->tx_bytes, skb->len); in handle_phys2virt() 37 out_leaf->out_ifindex = skb->ifindex; in handle_phys2virt() 38 out_leaf->vlan_tci = skb->vlan_tci; in handle_phys2virt() 39 out_leaf->vlan_proto = skb->vlan_proto; in handle_phys2virt() 41 bpf_skb_vlan_pop(skb); in handle_phys2virt() 42 bpf_clone_redirect(skb, leaf->out_ifindex, 0); in handle_phys2virt() 48 int handle_virt2phys(struct __sk_buff *skb) { in handle_virt2phys() argument 52 int src_ifindex = skb->ifindex; in handle_virt2phys() [all …]
|
/external/swiftshader/third_party/llvm-7.0/llvm/test/CodeGen/BPF/ |
D | remove_truncate_4.ll | 6 ;load_byte(void *skb, unsigned long long off) asm("llvm.bpf.load.byte"); 8 ;load_half(void *skb, unsigned long long off) asm("llvm.bpf.load.half"); 12 ;int func_b(struct __sk_buff *skb) 14 ; uint8_t t = load_byte(skb, 0); 18 ;int func_h(struct __sk_buff *skb) 20 ; uint16_t t = load_half(skb, 0); 24 ;int func_w(struct __sk_buff *skb) 26 ; uint32_t t = load_word(skb, 0); 33 define i32 @func_b(%struct.__sk_buff* %skb) local_unnamed_addr #0 { 35 %0 = bitcast %struct.__sk_buff* %skb to i8* [all …]
|
D | objdump_intrinsics.ll | 17 ; CHECK-EL: r0 = *(u8 *)skb[123] 18 ; CHECK-EL: r0 = *(u8 *)skb[r 19 ; CHECK-EB: r0 = *(u8 *)skb[123] 20 ; CHECK-EB: r0 = *(u8 *)skb[r 34 ; CHECK-EL: r0 = *(u16 *)skb[r 35 ; CHECK-EL: r0 = *(u16 *)skb[123] 36 ; CHECK-EB: r0 = *(u16 *)skb[r 37 ; CHECK-EB: r0 = *(u16 *)skb[123] 51 ; CHECK-EL: r0 = *(u32 *)skb[r 52 ; CHECK-EL: r0 = *(u32 *)skb[123] [all …]
|
/external/bcc/examples/networking/distributed_bridge/ |
D | tunnel_mesh.c | 19 int handle_ingress(struct __sk_buff *skb) { in handle_ingress() argument 22 bpf_skb_get_tunnel_key(skb, &tkey, in handle_ingress() 32 skb->tc_index = 1; in handle_ingress() 33 bpf_clone_redirect(skb, *ifindex, 1/*ingress*/); in handle_ingress() 42 int handle_egress(struct __sk_buff *skb) { in handle_egress() argument 43 int ifindex = skb->ifindex; in handle_egress() 51 if (skb->tc_index) { in handle_egress() 61 bpf_skb_set_tunnel_key(skb, &tkey, in handle_egress() 63 bpf_clone_redirect(skb, cfg->tunnel_ifindex, 0/*egress*/); in handle_egress()
|
D | tunnel.c | 26 int handle_ingress(struct __sk_buff *skb) { in handle_ingress() argument 32 bpf_skb_get_tunnel_key(skb, &tkey, in handle_ingress() 42 bpf_clone_redirect(skb, *ifindex, 1/*ingress*/); in handle_ingress() 51 int handle_egress(struct __sk_buff *skb) { in handle_egress() argument 60 struct vni_key vk = {ethernet->dst, skb->ifindex, 0}; in handle_egress() 67 bpf_skb_set_tunnel_key(skb, &tkey, in handle_egress() 78 bpf_skb_set_tunnel_key(skb, &tkey, in handle_egress() 81 bpf_clone_redirect(skb, cfg->tunnel_ifindex, 0/*egress*/); in handle_egress()
|
/external/libnfnetlink/include/libnfnetlink/ |
D | linux_nfnetlink_compat.h | 44 #define NFA_NEST(skb, type) \ argument 45 ({ struct nfattr *__start = (struct nfattr *)skb_tail_pointer(skb); \ 46 NFA_PUT(skb, (NFNL_NFA_NEST | type), 0, NULL); \ 48 #define NFA_NEST_END(skb, start) \ argument 49 ({ (start)->nfa_len = skb_tail_pointer(skb) - (unsigned char *)(start); \ 50 (skb)->len; }) 51 #define NFA_NEST_CANCEL(skb, start) \ argument 53 skb_trim(skb, (unsigned char *) (start) - (skb)->data); \
|
/external/libnl/include/linux-private/linux/netfilter/ |
D | nfnetlink_compat.h | 46 #define NFA_NEST(skb, type) \ argument 47 ({ struct nfattr *__start = (struct nfattr *)skb_tail_pointer(skb); \ 48 NFA_PUT(skb, (NFNL_NFA_NEST | type), 0, NULL); \ 50 #define NFA_NEST_END(skb, start) \ argument 51 ({ (start)->nfa_len = skb_tail_pointer(skb) - (unsigned char *)(start); \ 52 (skb)->len; }) 53 #define NFA_NEST_CANCEL(skb, start) \ argument 55 skb_trim(skb, (unsigned char *) (start) - (skb)->data); \
|
/external/kernel-headers/original/uapi/linux/netfilter/ |
D | nfnetlink_compat.h | 47 #define NFA_NEST(skb, type) \ argument 48 ({ struct nfattr *__start = (struct nfattr *)skb_tail_pointer(skb); \ 49 NFA_PUT(skb, (NFNL_NFA_NEST | type), 0, NULL); \ 51 #define NFA_NEST_END(skb, start) \ argument 52 ({ (start)->nfa_len = skb_tail_pointer(skb) - (unsigned char *)(start); \ 53 (skb)->len; }) 54 #define NFA_NEST_CANCEL(skb, start) \ argument 56 skb_trim(skb, (unsigned char *) (start) - (skb)->data); \
|