blob: 117652eb6ea32a836cd269f01e70f0e3c990fbc7 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002#ifndef _NET_ESP_H
3#define _NET_ESP_H
4
Herbert Xu38320c72008-01-28 19:35:05 -08005#include <linux/skbuff.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07006
Herbert Xu87bdc482007-10-10 15:45:25 -07007struct ip_esp_hdr;
8
9static inline struct ip_esp_hdr *ip_esp_hdr(const struct sk_buff *skb)
10{
11 return (struct ip_esp_hdr *)skb_transport_header(skb);
12}
13
Steffen Klassertfca11eb2017-04-14 10:06:33 +020014struct esp_info {
15 struct ip_esp_hdr *esph;
16 __be64 seqno;
17 int tfclen;
18 int tailen;
19 int plen;
20 int clen;
21 int len;
22 int nfrags;
23 __u8 proto;
24 bool inplace;
25};
26
27int esp_output_head(struct xfrm_state *x, struct sk_buff *skb, struct esp_info *esp);
28int esp_output_tail(struct xfrm_state *x, struct sk_buff *skb, struct esp_info *esp);
29int esp_input_done2(struct sk_buff *skb, int err);
Steffen Klassert383d0352017-04-14 10:06:42 +020030int esp6_output_head(struct xfrm_state *x, struct sk_buff *skb, struct esp_info *esp);
31int esp6_output_tail(struct xfrm_state *x, struct sk_buff *skb, struct esp_info *esp);
32int esp6_input_done2(struct sk_buff *skb, int err);
Linus Torvalds1da177e2005-04-16 15:20:36 -070033#endif