Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef _NET_ESPINTCP_H
0003 #define _NET_ESPINTCP_H
0004 
0005 #include <net/strparser.h>
0006 #include <linux/skmsg.h>
0007 
0008 void __init espintcp_init(void);
0009 
0010 int espintcp_push_skb(struct sock *sk, struct sk_buff *skb);
0011 int espintcp_queue_out(struct sock *sk, struct sk_buff *skb);
0012 bool tcp_is_ulp_esp(struct sock *sk);
0013 
0014 struct espintcp_msg {
0015     struct sk_buff *skb;
0016     struct sk_msg skmsg;
0017     int offset;
0018     int len;
0019 };
0020 
0021 struct espintcp_ctx {
0022     struct strparser strp;
0023     struct sk_buff_head ike_queue;
0024     struct sk_buff_head out_queue;
0025     struct espintcp_msg partial;
0026     void (*saved_data_ready)(struct sock *sk);
0027     void (*saved_write_space)(struct sock *sk);
0028     void (*saved_destruct)(struct sock *sk);
0029     struct work_struct work;
0030     bool tx_running;
0031 };
0032 
0033 static inline struct espintcp_ctx *espintcp_getctx(const struct sock *sk)
0034 {
0035     struct inet_connection_sock *icsk = inet_csk(sk);
0036 
0037     /* RCU is only needed for diag */
0038     return (__force void *)icsk->icsk_ulp_data;
0039 }
0040 #endif