1 #ifndef _NF_TPROXY_CORE_H
2 #define _NF_TPROXY_CORE_H
4 #include <linux/types.h>
12 #define NFT_LOOKUP_ANY 0
13 #define NFT_LOOKUP_LISTENER 1
14 #define NFT_LOOKUP_ESTABLISHED 2
66 static inline struct sock *
77 switch (lookup_type) {
80 saddr, sport, daddr, dport,
96 saddr, sport, daddr, dport,
110 int wildcard = (inet_sk(sk)->inet_rcv_saddr == 0);
128 pr_debug(
"tproxy socket lookup: proto %u %08x:%u -> %08x:%u, lookup type: %d, sock %p\n",
134 #if IS_ENABLED(CONFIG_IPV6)
135 static inline struct sock *
146 switch (lookup_type) {
149 saddr, sport, daddr, dport,
165 saddr, sport, daddr,
ntohs(dport),
179 int wildcard = ipv6_addr_any(&inet6_sk(sk)->rcv_saddr);
197 pr_debug(
"tproxy socket lookup: proto %u %pI6:%u -> %pI6:%u, lookup type: %d, sock %p\n",
198 protocol, saddr,
ntohs(sport), daddr,
ntohs(dport), lookup_type, sk);