WIP FPC-III support
[linux/fpc-iii.git] / include / net / esp.h
blob9c5637d41d95168052686caf7b3ff51b517e6b9b
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _NET_ESP_H
3 #define _NET_ESP_H
5 #include <linux/skbuff.h>
7 struct ip_esp_hdr;
9 static inline struct ip_esp_hdr *ip_esp_hdr(const struct sk_buff *skb)
11 return (struct ip_esp_hdr *)skb_transport_header(skb);
14 static inline void esp_output_fill_trailer(u8 *tail, int tfclen, int plen, __u8 proto)
16 /* Fill padding... */
17 if (tfclen) {
18 memset(tail, 0, tfclen);
19 tail += tfclen;
21 do {
22 int i;
23 for (i = 0; i < plen - 2; i++)
24 tail[i] = i + 1;
25 } while (0);
26 tail[plen - 2] = plen - 2;
27 tail[plen - 1] = proto;
30 struct esp_info {
31 struct ip_esp_hdr *esph;
32 __be64 seqno;
33 int tfclen;
34 int tailen;
35 int plen;
36 int clen;
37 int len;
38 int nfrags;
39 __u8 proto;
40 bool inplace;
43 int esp_output_head(struct xfrm_state *x, struct sk_buff *skb, struct esp_info *esp);
44 int esp_output_tail(struct xfrm_state *x, struct sk_buff *skb, struct esp_info *esp);
45 int esp_input_done2(struct sk_buff *skb, int err);
46 int esp6_output_head(struct xfrm_state *x, struct sk_buff *skb, struct esp_info *esp);
47 int esp6_output_tail(struct xfrm_state *x, struct sk_buff *skb, struct esp_info *esp);
48 int esp6_input_done2(struct sk_buff *skb, int err);
49 #endif