GNU Linux-libre 4.19.242-gnu1
[releases.git] / include / net / esp.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _NET_ESP_H
3 #define _NET_ESP_H
4
5 #include <linux/skbuff.h>
6
7 #define ESP_SKB_FRAG_MAXSIZE (PAGE_SIZE << SKB_FRAG_PAGE_ORDER)
8
9 struct ip_esp_hdr;
10
11 static inline struct ip_esp_hdr *ip_esp_hdr(const struct sk_buff *skb)
12 {
13         return (struct ip_esp_hdr *)skb_transport_header(skb);
14 }
15
16 struct esp_info {
17         struct  ip_esp_hdr *esph;
18         __be64  seqno;
19         int     tfclen;
20         int     tailen;
21         int     plen;
22         int     clen;
23         int     len;
24         int     nfrags;
25         __u8    proto;
26         bool    inplace;
27 };
28
29 int esp_output_head(struct xfrm_state *x, struct sk_buff *skb, struct esp_info *esp);
30 int esp_output_tail(struct xfrm_state *x, struct sk_buff *skb, struct esp_info *esp);
31 int esp_input_done2(struct sk_buff *skb, int err);
32 int esp6_output_head(struct xfrm_state *x, struct sk_buff *skb, struct esp_info *esp);
33 int esp6_output_tail(struct xfrm_state *x, struct sk_buff *skb, struct esp_info *esp);
34 int esp6_input_done2(struct sk_buff *skb, int err);
35 #endif