Add xdp-synproxy to bpf-examples

this code is from kernel bpf selftests xdp synproxy, removed the
tc part for simplicity, shows an exmaple of using libxdp
to attach xdp synproxy program on network interface.

if port is not in allowed ports, the packet will be dropped
by xdp synproxy by default, this would break tcp connections
to ports that user does not want to do synproxy, change the
default to allow connection pass through.

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
This commit is contained in:
Vincent Li
2023-10-04 16:15:00 +00:00
parent c726367fb4
commit fed8da5072
7 changed files with 1244 additions and 0 deletions

View File

@ -135,4 +135,13 @@ struct sk_buff {
struct skb_ext *extensions;
};
struct nf_conn {
unsigned long status;
};
enum ip_conntrack_status {
/* Connection is confirmed: originating packet has left box */
IPS_CONFIRMED_BIT = 3,
};
#endif /* __VMLINUX_NET_H__ */