Loading...
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _NET_ESP_H
3#define _NET_ESP_H
4
5#include <linux/skbuff.h>
6
7struct 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
14struct 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);
30int 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);
33#endif
1#ifndef _NET_ESP_H
2#define _NET_ESP_H
3
4#include <linux/skbuff.h>
5
6struct crypto_aead;
7
8struct esp_data {
9 /* 0..255 */
10 int padlen;
11
12 /* Confidentiality & Integrity */
13 struct crypto_aead *aead;
14};
15
16extern void *pskb_put(struct sk_buff *skb, struct sk_buff *tail, int len);
17
18struct ip_esp_hdr;
19
20static inline struct ip_esp_hdr *ip_esp_hdr(const struct sk_buff *skb)
21{
22 return (struct ip_esp_hdr *)skb_transport_header(skb);
23}
24
25#endif