diff options
Diffstat (limited to 'include/net/tcp.h')
-rw-r--r-- | include/net/tcp.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h index 8f5cef67fd35..3600ae0f25c3 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -858,6 +858,21 @@ static inline void bpf_compute_data_end_sk_skb(struct sk_buff *skb) | |||
858 | TCP_SKB_CB(skb)->bpf.data_end = skb->data + skb_headlen(skb); | 858 | TCP_SKB_CB(skb)->bpf.data_end = skb->data + skb_headlen(skb); |
859 | } | 859 | } |
860 | 860 | ||
861 | static inline bool tcp_skb_bpf_ingress(const struct sk_buff *skb) | ||
862 | { | ||
863 | return TCP_SKB_CB(skb)->bpf.flags & BPF_F_INGRESS; | ||
864 | } | ||
865 | |||
866 | static inline struct sock *tcp_skb_bpf_redirect_fetch(struct sk_buff *skb) | ||
867 | { | ||
868 | return TCP_SKB_CB(skb)->bpf.sk_redir; | ||
869 | } | ||
870 | |||
871 | static inline void tcp_skb_bpf_redirect_clear(struct sk_buff *skb) | ||
872 | { | ||
873 | TCP_SKB_CB(skb)->bpf.sk_redir = NULL; | ||
874 | } | ||
875 | |||
861 | #if IS_ENABLED(CONFIG_IPV6) | 876 | #if IS_ENABLED(CONFIG_IPV6) |
862 | /* This is the variant of inet6_iif() that must be used by TCP, | 877 | /* This is the variant of inet6_iif() that must be used by TCP, |
863 | * as TCP moves IP6CB into a different location in skb->cb[] | 878 | * as TCP moves IP6CB into a different location in skb->cb[] |
@@ -2064,6 +2079,18 @@ void tcp_cleanup_ulp(struct sock *sk); | |||
2064 | __MODULE_INFO(alias, alias_userspace, name); \ | 2079 | __MODULE_INFO(alias, alias_userspace, name); \ |
2065 | __MODULE_INFO(alias, alias_tcp_ulp, "tcp-ulp-" name) | 2080 | __MODULE_INFO(alias, alias_tcp_ulp, "tcp-ulp-" name) |
2066 | 2081 | ||
2082 | struct sk_msg; | ||
2083 | struct sk_psock; | ||
2084 | |||
2085 | int tcp_bpf_init(struct sock *sk); | ||
2086 | void tcp_bpf_reinit(struct sock *sk); | ||
2087 | int tcp_bpf_sendmsg_redir(struct sock *sk, struct sk_msg *msg, u32 bytes, | ||
2088 | int flags); | ||
2089 | int tcp_bpf_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, | ||
2090 | int nonblock, int flags, int *addr_len); | ||
2091 | int __tcp_bpf_recvmsg(struct sock *sk, struct sk_psock *psock, | ||
2092 | struct msghdr *msg, int len); | ||
2093 | |||
2067 | /* Call BPF_SOCK_OPS program that returns an int. If the return value | 2094 | /* Call BPF_SOCK_OPS program that returns an int. If the return value |
2068 | * is < 0, then the BPF op failed (for example if the loaded BPF | 2095 | * is < 0, then the BPF op failed (for example if the loaded BPF |
2069 | * program does not support the chosen operation or there is no BPF | 2096 | * program does not support the chosen operation or there is no BPF |