espintcp.h 966 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _NET_ESPINTCP_H
  3. #define _NET_ESPINTCP_H
  4. #include <net/strparser.h>
  5. #include <linux/skmsg.h>
  6. void __init espintcp_init(void);
  7. int espintcp_push_skb(struct sock *sk, struct sk_buff *skb);
  8. int espintcp_queue_out(struct sock *sk, struct sk_buff *skb);
  9. bool tcp_is_ulp_esp(struct sock *sk);
  10. struct espintcp_msg {
  11. struct sk_buff *skb;
  12. struct sk_msg skmsg;
  13. int offset;
  14. int len;
  15. };
  16. struct espintcp_ctx {
  17. struct strparser strp;
  18. struct sk_buff_head ike_queue;
  19. struct sk_buff_head out_queue;
  20. struct espintcp_msg partial;
  21. void (*saved_data_ready)(struct sock *sk);
  22. void (*saved_write_space)(struct sock *sk);
  23. void (*saved_destruct)(struct sock *sk);
  24. struct work_struct work;
  25. bool tx_running;
  26. };
  27. static inline struct espintcp_ctx *espintcp_getctx(const struct sock *sk)
  28. {
  29. struct inet_connection_sock *icsk = inet_csk(sk);
  30. /* RCU is only needed for diag */
  31. return (__force void *)icsk->icsk_ulp_data;
  32. }
  33. #endif