Lines Matching full:tuple
53 /* Fill 'tuple' with L3 info, and attempt to find L4. On fail, return NULL. */
102 handle_udp(struct __sk_buff *skb, struct bpf_sock_tuple *tuple, bool ipv4) in handle_udp() argument
110 tuple_len = ipv4 ? sizeof(tuple->ipv4) : sizeof(tuple->ipv6); in handle_udp()
111 if ((void *)tuple + tuple_len > (void *)(long)skb->data_end) in handle_udp()
114 sk = bpf_sk_lookup_udp(skb, tuple, tuple_len, BPF_F_CURRENT_NETNS, 0); in handle_udp()
118 dport = ipv4 ? tuple->ipv4.dport : tuple->ipv6.dport; in handle_udp()
133 handle_tcp(struct __sk_buff *skb, struct bpf_sock_tuple *tuple, bool ipv4) in handle_tcp() argument
141 tuple_len = ipv4 ? sizeof(tuple->ipv4) : sizeof(tuple->ipv6); in handle_tcp()
142 if ((void *)tuple + tuple_len > (void *)(long)skb->data_end) in handle_tcp()
145 sk = bpf_skc_lookup_tcp(skb, tuple, tuple_len, BPF_F_CURRENT_NETNS, 0); in handle_tcp()
152 dport = ipv4 ? tuple->ipv4.dport : tuple->ipv6.dport; in handle_tcp()
174 struct bpf_sock_tuple *tuple; in bpf_sk_assign_test() local
179 tuple = get_tuple(skb, &ipv4, &tcp); in bpf_sk_assign_test()
180 if (!tuple) in bpf_sk_assign_test()
189 ret = handle_tcp(skb, tuple, ipv4); in bpf_sk_assign_test()
191 ret = handle_udp(skb, tuple, ipv4); in bpf_sk_assign_test()