Home
last modified time | relevance | path

Searched refs:offsetof (Results 1 – 17 of 17) sorted by relevance

/samples/bpf/
Dparse_ldabs.c22 return load_half(ctx, nhoff + offsetof(struct iphdr, frag_off)) in ip_is_fragment()
31 if (load_half(skb, offsetof(struct ethhdr, h_proto)) != ETH_P_IP) in handle_ingress()
33 if (load_byte(skb, ETH_HLEN + offsetof(struct iphdr, protocol)) != IPPROTO_UDP || in handle_ingress()
38 if (load_half(skb, troff + offsetof(struct udphdr, dest)) == DEFAULT_PKTGEN_UDP_PORT) in handle_ingress()
Dsockex2_kern.c47 return load_half(ctx, nhoff + offsetof(struct iphdr, frag_off)) in ip_is_fragment()
69 *ip_proto = load_byte(skb, nhoff + offsetof(struct iphdr, protocol)); in parse_ip()
72 flow->src = load_word(skb, nhoff + offsetof(struct iphdr, saddr)); in parse_ip()
73 flow->dst = load_word(skb, nhoff + offsetof(struct iphdr, daddr)); in parse_ip()
89 nhoff + offsetof(struct ipv6hdr, nexthdr)); in parse_ipv6()
91 nhoff + offsetof(struct ipv6hdr, saddr)); in parse_ipv6()
93 nhoff + offsetof(struct ipv6hdr, daddr)); in parse_ipv6()
108 proto = load_half(skb, nhoff + offsetof(struct vlan_hdr, in flow_dissector()
114 proto = load_half(skb, nhoff + offsetof(struct vlan_hdr, in flow_dissector()
134 nhoff + offsetof(struct gre_hdr, flags)); in flow_dissector()
[all …]
Dtcbpf1_kern.c20 #define IP_CSUM_OFF (ETH_HLEN + offsetof(struct iphdr, check))
21 #define TOS_OFF (ETH_HLEN + offsetof(struct iphdr, tos))
31 #define TCP_CSUM_OFF (ETH_HLEN + sizeof(struct iphdr) + offsetof(struct tcphdr, check))
32 #define IP_SRC_OFF (ETH_HLEN + offsetof(struct iphdr, saddr))
45 #define TCP_DPORT_OFF (ETH_HLEN + sizeof(struct iphdr) + offsetof(struct tcphdr, dest))
57 __u8 proto = load_byte(skb, ETH_HLEN + offsetof(struct iphdr, protocol)); in bpf_prog1()
Dsockex3_kern.c76 return load_half(ctx, nhoff + offsetof(struct iphdr, frag_off)) in ip_is_fragment()
152 nhoff + offsetof(struct gre_hdr, flags)); in parse_ip_proto()
154 nhoff + offsetof(struct gre_hdr, proto)); in parse_ip_proto()
202 ip_proto = load_byte(skb, nhoff + offsetof(struct iphdr, protocol)); in PROG()
205 g->flow.src = load_word(skb, nhoff + offsetof(struct iphdr, saddr)); in PROG()
206 g->flow.dst = load_word(skb, nhoff + offsetof(struct iphdr, daddr)); in PROG()
228 nhoff + offsetof(struct ipv6hdr, nexthdr)); in PROG()
230 nhoff + offsetof(struct ipv6hdr, saddr)); in PROG()
232 nhoff + offsetof(struct ipv6hdr, daddr)); in PROG()
246 proto = load_half(skb, nhoff + offsetof(struct vlan_hdr, in PROG()
Dcookie_uid_helper_example.c33 #define offsetof(type, member) __builtin_offsetof(type, member) macro
119 -32 + (__s16)offsetof(struct stats, uid)), in prog_load()
121 -32 + (__s16)offsetof(struct stats, packets), 1), in prog_load()
127 offsetof(struct __sk_buff, len)), in prog_load()
129 -32 + (__s16)offsetof(struct stats, bytes)), in prog_load()
151 offsetof(struct stats, packets)), in prog_load()
153 offsetof(struct __sk_buff, len)), in prog_load()
155 offsetof(struct stats, bytes)), in prog_load()
157 offsetof(struct __sk_buff, len)), in prog_load()
Dtest_lwt_bpf.c84 #define IP_CSUM_OFF offsetof(struct iphdr, check)
85 #define IP_DST_OFF offsetof(struct iphdr, daddr)
86 #define IP_SRC_OFF offsetof(struct iphdr, saddr)
87 #define IP_PROTO_OFF offsetof(struct iphdr, protocol)
88 #define TCP_CSUM_OFF offsetof(struct tcphdr, check)
89 #define UDP_CSUM_OFF offsetof(struct udphdr, check)
115 off = offsetof(struct icmp6hdr, icmp6_cksum); in rewrite()
Dtest_cgrp2_sock.c44 BPF_MOV64_IMM(BPF_REG_2, offsetof(struct bpf_sock, bound_dev_if)), in prog_load()
45 BPF_STX_MEM(BPF_W, BPF_REG_1, BPF_REG_3, offsetof(struct bpf_sock, bound_dev_if)), in prog_load()
62 BPF_MOV64_IMM(BPF_REG_2, offsetof(struct bpf_sock, mark)), in prog_load()
63 BPF_STX_MEM(BPF_W, BPF_REG_1, BPF_REG_3, offsetof(struct bpf_sock, mark)), in prog_load()
70 BPF_MOV64_IMM(BPF_REG_2, offsetof(struct bpf_sock, priority)), in prog_load()
71 BPF_STX_MEM(BPF_W, BPF_REG_1, BPF_REG_3, offsetof(struct bpf_sock, priority)), in prog_load()
Dsockex1_kern.c17 int index = load_byte(skb, ETH_HLEN + offsetof(struct iphdr, protocol)); in bpf_prog1()
Dsock_example.c49 BPF_LD_ABS(BPF_B, ETH_HLEN + offsetof(struct iphdr, protocol) /* R0 = ip->proto */), in test_sock()
Dtest_lru_dist.c25 #ifndef offsetof
26 # define offsetof(TYPE, MEMBER) ((size_t)&((TYPE *)0)->MEMBER) macro
30 (type *)( (char *)__mptr - offsetof(type,member) );})
Dtest_cgrp2_attach.c66 BPF_LDX_MEM(BPF_W, BPF_REG_1, BPF_REG_6, offsetof(struct __sk_buff, len)), /* r1 = skb->len */ in prog_load()
/samples/qmi/
Dqmi_sample_client.c52 .offset = offsetof(struct test_name_type_v01,
61 .offset = offsetof(struct test_name_type_v01,
81 .offset = offsetof(struct test_ping_req_msg_v01,
90 .offset = offsetof(struct test_ping_req_msg_v01,
99 .offset = offsetof(struct test_ping_req_msg_v01,
123 .offset = offsetof(struct test_ping_resp_msg_v01,
133 .offset = offsetof(struct test_ping_resp_msg_v01,
142 .offset = offsetof(struct test_ping_resp_msg_v01,
151 .offset = offsetof(struct test_ping_resp_msg_v01,
160 .offset = offsetof(struct test_ping_resp_msg_v01,
[all …]
/samples/seccomp/
Ddropper.c32 (offsetof(struct seccomp_data, arch))), in install_filter()
35 (offsetof(struct seccomp_data, nr))), in install_filter()
Dbpf-helper.h66 #define LO_ARG(idx) offsetof(struct seccomp_data, args[(idx)])
68 #define LO_ARG(idx) offsetof(struct seccomp_data, args[(idx)]) + sizeof(__u32)
90 #define HI_ARG(idx) offsetof(struct seccomp_data, args[(idx)]) + sizeof(__u32)
93 #define HI_ARG(idx) offsetof(struct seccomp_data, args[(idx)])
261 offsetof(struct seccomp_data, nr))
Dbpf-direct.c31 #define syscall_arg(_n) (offsetof(struct seccomp_data, args[_n]))
32 #define syscall_nr (offsetof(struct seccomp_data, nr))
Duser-trap.c90 offsetof(struct seccomp_data, nr)), in user_trap_syscall()
/samples/vfio-mdev/
Dmbochs.c414 case offsetof(struct vfio_region_gfx_edid, link_state): in handle_edid_regs()
415 case offsetof(struct vfio_region_gfx_edid, edid_size): in handle_edid_regs()
1060 ext->base.cap_offset = offsetof(typeof(*ext), type); in mbochs_get_region_info()