Lines Matching full:tuple
42 /* Fill 'tuple' with L3 info, and attempt to find L4. On fail, return NULL. */
91 handle_udp(struct __sk_buff *skb, struct bpf_sock_tuple *tuple, bool ipv4) in handle_udp() argument
100 tuple_len = ipv4 ? sizeof(tuple->ipv4) : sizeof(tuple->ipv6); in handle_udp()
101 if ((void *)tuple + tuple_len > (void *)(long)skb->data_end) in handle_udp()
104 sk = bpf_sk_lookup_udp(skb, tuple, tuple_len, BPF_F_CURRENT_NETNS, 0); in handle_udp()
108 dport = ipv4 ? tuple->ipv4.dport : tuple->ipv6.dport; in handle_udp()
123 handle_tcp(struct __sk_buff *skb, struct bpf_sock_tuple *tuple, bool ipv4) in handle_tcp() argument
132 tuple_len = ipv4 ? sizeof(tuple->ipv4) : sizeof(tuple->ipv6); in handle_tcp()
133 if ((void *)tuple + tuple_len > (void *)(long)skb->data_end) in handle_tcp()
136 sk = bpf_skc_lookup_tcp(skb, tuple, tuple_len, BPF_F_CURRENT_NETNS, 0); in handle_tcp()
143 dport = ipv4 ? tuple->ipv4.dport : tuple->ipv6.dport; in handle_tcp()
165 struct bpf_sock_tuple *tuple, ln = {0}; in bpf_sk_assign_test() local
171 tuple = get_tuple(skb, &ipv4, &tcp); in bpf_sk_assign_test()
172 if (!tuple) in bpf_sk_assign_test()
181 ret = handle_tcp(skb, tuple, ipv4); in bpf_sk_assign_test()
183 ret = handle_udp(skb, tuple, ipv4); in bpf_sk_assign_test()