blob: 4ff9bea8f2e6df49c3e61204e1bea07f82c32cf7 [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef _LINUX_XFRM_H
20#define _LINUX_XFRM_H
Christopher Ferris05d08e92016-02-04 13:16:38 -080021#include <linux/in6.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070022#include <linux/types.h>
Christopher Ferris05d08e92016-02-04 13:16:38 -080023typedef union {
Tao Baod7db5942015-01-28 10:07:51 -080024 __be32 a4;
25 __be32 a6[4];
Christopher Ferris05d08e92016-02-04 13:16:38 -080026 struct in6_addr in6;
Ben Cheng655a7c02013-10-16 16:09:24 -070027} xfrm_address_t;
28struct xfrm_id {
Tao Baod7db5942015-01-28 10:07:51 -080029 xfrm_address_t daddr;
30 __be32 spi;
31 __u8 proto;
Ben Cheng655a7c02013-10-16 16:09:24 -070032};
Ben Cheng655a7c02013-10-16 16:09:24 -070033struct xfrm_sec_ctx {
Tao Baod7db5942015-01-28 10:07:51 -080034 __u8 ctx_doi;
35 __u8 ctx_alg;
36 __u16 ctx_len;
Tao Baod7db5942015-01-28 10:07:51 -080037 __u32 ctx_sid;
38 char ctx_str[0];
Ben Cheng655a7c02013-10-16 16:09:24 -070039};
40#define XFRM_SC_DOI_RESERVED 0
Ben Cheng655a7c02013-10-16 16:09:24 -070041#define XFRM_SC_DOI_LSM 1
42#define XFRM_SC_ALG_RESERVED 0
43#define XFRM_SC_ALG_SELINUX 1
44struct xfrm_selector {
Tao Baod7db5942015-01-28 10:07:51 -080045 xfrm_address_t daddr;
46 xfrm_address_t saddr;
47 __be16 dport;
48 __be16 dport_mask;
Tao Baod7db5942015-01-28 10:07:51 -080049 __be16 sport;
50 __be16 sport_mask;
51 __u16 family;
52 __u8 prefixlen_d;
Tao Baod7db5942015-01-28 10:07:51 -080053 __u8 prefixlen_s;
54 __u8 proto;
55 int ifindex;
56 __kernel_uid32_t user;
Ben Cheng655a7c02013-10-16 16:09:24 -070057};
Tao Baod7db5942015-01-28 10:07:51 -080058#define XFRM_INF (~(__u64) 0)
Ben Cheng655a7c02013-10-16 16:09:24 -070059struct xfrm_lifetime_cfg {
Tao Baod7db5942015-01-28 10:07:51 -080060 __u64 soft_byte_limit;
Tao Baod7db5942015-01-28 10:07:51 -080061 __u64 hard_byte_limit;
62 __u64 soft_packet_limit;
63 __u64 hard_packet_limit;
64 __u64 soft_add_expires_seconds;
Tao Baod7db5942015-01-28 10:07:51 -080065 __u64 hard_add_expires_seconds;
66 __u64 soft_use_expires_seconds;
67 __u64 hard_use_expires_seconds;
Ben Cheng655a7c02013-10-16 16:09:24 -070068};
Ben Cheng655a7c02013-10-16 16:09:24 -070069struct xfrm_lifetime_cur {
Tao Baod7db5942015-01-28 10:07:51 -080070 __u64 bytes;
71 __u64 packets;
72 __u64 add_time;
Tao Baod7db5942015-01-28 10:07:51 -080073 __u64 use_time;
Ben Cheng655a7c02013-10-16 16:09:24 -070074};
75struct xfrm_replay_state {
Tao Baod7db5942015-01-28 10:07:51 -080076 __u32 oseq;
Tao Baod7db5942015-01-28 10:07:51 -080077 __u32 seq;
78 __u32 bitmap;
Ben Cheng655a7c02013-10-16 16:09:24 -070079};
80#define XFRMA_REPLAY_ESN_MAX 4096
Ben Cheng655a7c02013-10-16 16:09:24 -070081struct xfrm_replay_state_esn {
Tao Baod7db5942015-01-28 10:07:51 -080082 unsigned int bmp_len;
83 __u32 oseq;
84 __u32 seq;
Tao Baod7db5942015-01-28 10:07:51 -080085 __u32 oseq_hi;
86 __u32 seq_hi;
87 __u32 replay_window;
88 __u32 bmp[0];
Ben Cheng655a7c02013-10-16 16:09:24 -070089};
90struct xfrm_algo {
Tao Baod7db5942015-01-28 10:07:51 -080091 char alg_name[64];
92 unsigned int alg_key_len;
Tao Baod7db5942015-01-28 10:07:51 -080093 char alg_key[0];
Ben Cheng655a7c02013-10-16 16:09:24 -070094};
95struct xfrm_algo_auth {
Tao Baod7db5942015-01-28 10:07:51 -080096 char alg_name[64];
Tao Baod7db5942015-01-28 10:07:51 -080097 unsigned int alg_key_len;
98 unsigned int alg_trunc_len;
99 char alg_key[0];
Ben Cheng655a7c02013-10-16 16:09:24 -0700100};
Ben Cheng655a7c02013-10-16 16:09:24 -0700101struct xfrm_algo_aead {
Tao Baod7db5942015-01-28 10:07:51 -0800102 char alg_name[64];
103 unsigned int alg_key_len;
104 unsigned int alg_icv_len;
Tao Baod7db5942015-01-28 10:07:51 -0800105 char alg_key[0];
Ben Cheng655a7c02013-10-16 16:09:24 -0700106};
107struct xfrm_stats {
Tao Baod7db5942015-01-28 10:07:51 -0800108 __u32 replay_window;
Tao Baod7db5942015-01-28 10:07:51 -0800109 __u32 replay;
110 __u32 integrity_failed;
Ben Cheng655a7c02013-10-16 16:09:24 -0700111};
112enum {
Tao Baod7db5942015-01-28 10:07:51 -0800113 XFRM_POLICY_TYPE_MAIN = 0,
114 XFRM_POLICY_TYPE_SUB = 1,
115 XFRM_POLICY_TYPE_MAX = 2,
116 XFRM_POLICY_TYPE_ANY = 255
Ben Cheng655a7c02013-10-16 16:09:24 -0700117};
118enum {
Tao Baod7db5942015-01-28 10:07:51 -0800119 XFRM_POLICY_IN = 0,
120 XFRM_POLICY_OUT = 1,
Tao Baod7db5942015-01-28 10:07:51 -0800121 XFRM_POLICY_FWD = 2,
122 XFRM_POLICY_MASK = 3,
123 XFRM_POLICY_MAX = 3
Ben Cheng655a7c02013-10-16 16:09:24 -0700124};
Ben Cheng655a7c02013-10-16 16:09:24 -0700125enum {
Tao Baod7db5942015-01-28 10:07:51 -0800126 XFRM_SHARE_ANY,
127 XFRM_SHARE_SESSION,
128 XFRM_SHARE_USER,
Tao Baod7db5942015-01-28 10:07:51 -0800129 XFRM_SHARE_UNIQUE
Ben Cheng655a7c02013-10-16 16:09:24 -0700130};
131#define XFRM_MODE_TRANSPORT 0
132#define XFRM_MODE_TUNNEL 1
Ben Cheng655a7c02013-10-16 16:09:24 -0700133#define XFRM_MODE_ROUTEOPTIMIZATION 2
134#define XFRM_MODE_IN_TRIGGER 3
135#define XFRM_MODE_BEET 4
136#define XFRM_MODE_MAX 5
Ben Cheng655a7c02013-10-16 16:09:24 -0700137enum {
Tao Baod7db5942015-01-28 10:07:51 -0800138 XFRM_MSG_BASE = 0x10,
139 XFRM_MSG_NEWSA = 0x10,
Ben Cheng655a7c02013-10-16 16:09:24 -0700140#define XFRM_MSG_NEWSA XFRM_MSG_NEWSA
Tao Baod7db5942015-01-28 10:07:51 -0800141 XFRM_MSG_DELSA,
Ben Cheng655a7c02013-10-16 16:09:24 -0700142#define XFRM_MSG_DELSA XFRM_MSG_DELSA
Tao Baod7db5942015-01-28 10:07:51 -0800143 XFRM_MSG_GETSA,
Ben Cheng655a7c02013-10-16 16:09:24 -0700144#define XFRM_MSG_GETSA XFRM_MSG_GETSA
Tao Baod7db5942015-01-28 10:07:51 -0800145 XFRM_MSG_NEWPOLICY,
Ben Cheng655a7c02013-10-16 16:09:24 -0700146#define XFRM_MSG_NEWPOLICY XFRM_MSG_NEWPOLICY
Tao Baod7db5942015-01-28 10:07:51 -0800147 XFRM_MSG_DELPOLICY,
Ben Cheng655a7c02013-10-16 16:09:24 -0700148#define XFRM_MSG_DELPOLICY XFRM_MSG_DELPOLICY
Tao Baod7db5942015-01-28 10:07:51 -0800149 XFRM_MSG_GETPOLICY,
Ben Cheng655a7c02013-10-16 16:09:24 -0700150#define XFRM_MSG_GETPOLICY XFRM_MSG_GETPOLICY
Tao Baod7db5942015-01-28 10:07:51 -0800151 XFRM_MSG_ALLOCSPI,
Ben Cheng655a7c02013-10-16 16:09:24 -0700152#define XFRM_MSG_ALLOCSPI XFRM_MSG_ALLOCSPI
Tao Baod7db5942015-01-28 10:07:51 -0800153 XFRM_MSG_ACQUIRE,
Ben Cheng655a7c02013-10-16 16:09:24 -0700154#define XFRM_MSG_ACQUIRE XFRM_MSG_ACQUIRE
Tao Baod7db5942015-01-28 10:07:51 -0800155 XFRM_MSG_EXPIRE,
Ben Cheng655a7c02013-10-16 16:09:24 -0700156#define XFRM_MSG_EXPIRE XFRM_MSG_EXPIRE
Tao Baod7db5942015-01-28 10:07:51 -0800157 XFRM_MSG_UPDPOLICY,
Ben Cheng655a7c02013-10-16 16:09:24 -0700158#define XFRM_MSG_UPDPOLICY XFRM_MSG_UPDPOLICY
Tao Baod7db5942015-01-28 10:07:51 -0800159 XFRM_MSG_UPDSA,
Ben Cheng655a7c02013-10-16 16:09:24 -0700160#define XFRM_MSG_UPDSA XFRM_MSG_UPDSA
Tao Baod7db5942015-01-28 10:07:51 -0800161 XFRM_MSG_POLEXPIRE,
Ben Cheng655a7c02013-10-16 16:09:24 -0700162#define XFRM_MSG_POLEXPIRE XFRM_MSG_POLEXPIRE
Tao Baod7db5942015-01-28 10:07:51 -0800163 XFRM_MSG_FLUSHSA,
Ben Cheng655a7c02013-10-16 16:09:24 -0700164#define XFRM_MSG_FLUSHSA XFRM_MSG_FLUSHSA
Tao Baod7db5942015-01-28 10:07:51 -0800165 XFRM_MSG_FLUSHPOLICY,
Ben Cheng655a7c02013-10-16 16:09:24 -0700166#define XFRM_MSG_FLUSHPOLICY XFRM_MSG_FLUSHPOLICY
Tao Baod7db5942015-01-28 10:07:51 -0800167 XFRM_MSG_NEWAE,
Ben Cheng655a7c02013-10-16 16:09:24 -0700168#define XFRM_MSG_NEWAE XFRM_MSG_NEWAE
Tao Baod7db5942015-01-28 10:07:51 -0800169 XFRM_MSG_GETAE,
Ben Cheng655a7c02013-10-16 16:09:24 -0700170#define XFRM_MSG_GETAE XFRM_MSG_GETAE
Tao Baod7db5942015-01-28 10:07:51 -0800171 XFRM_MSG_REPORT,
Ben Cheng655a7c02013-10-16 16:09:24 -0700172#define XFRM_MSG_REPORT XFRM_MSG_REPORT
Tao Baod7db5942015-01-28 10:07:51 -0800173 XFRM_MSG_MIGRATE,
Ben Cheng655a7c02013-10-16 16:09:24 -0700174#define XFRM_MSG_MIGRATE XFRM_MSG_MIGRATE
Tao Baod7db5942015-01-28 10:07:51 -0800175 XFRM_MSG_NEWSADINFO,
Ben Cheng655a7c02013-10-16 16:09:24 -0700176#define XFRM_MSG_NEWSADINFO XFRM_MSG_NEWSADINFO
Tao Baod7db5942015-01-28 10:07:51 -0800177 XFRM_MSG_GETSADINFO,
Ben Cheng655a7c02013-10-16 16:09:24 -0700178#define XFRM_MSG_GETSADINFO XFRM_MSG_GETSADINFO
Tao Baod7db5942015-01-28 10:07:51 -0800179 XFRM_MSG_NEWSPDINFO,
Ben Cheng655a7c02013-10-16 16:09:24 -0700180#define XFRM_MSG_NEWSPDINFO XFRM_MSG_NEWSPDINFO
Tao Baod7db5942015-01-28 10:07:51 -0800181 XFRM_MSG_GETSPDINFO,
Ben Cheng655a7c02013-10-16 16:09:24 -0700182#define XFRM_MSG_GETSPDINFO XFRM_MSG_GETSPDINFO
Tao Baod7db5942015-01-28 10:07:51 -0800183 XFRM_MSG_MAPPING,
Ben Cheng655a7c02013-10-16 16:09:24 -0700184#define XFRM_MSG_MAPPING XFRM_MSG_MAPPING
Tao Baod7db5942015-01-28 10:07:51 -0800185 __XFRM_MSG_MAX
Ben Cheng655a7c02013-10-16 16:09:24 -0700186};
187#define XFRM_MSG_MAX (__XFRM_MSG_MAX - 1)
188#define XFRM_NR_MSGTYPES (XFRM_MSG_MAX + 1 - XFRM_MSG_BASE)
Ben Cheng655a7c02013-10-16 16:09:24 -0700189struct xfrm_user_sec_ctx {
Tao Baod7db5942015-01-28 10:07:51 -0800190 __u16 len;
191 __u16 exttype;
192 __u8 ctx_alg;
Tao Baod7db5942015-01-28 10:07:51 -0800193 __u8 ctx_doi;
194 __u16 ctx_len;
Ben Cheng655a7c02013-10-16 16:09:24 -0700195};
196struct xfrm_user_tmpl {
Tao Baod7db5942015-01-28 10:07:51 -0800197 struct xfrm_id id;
198 __u16 family;
199 xfrm_address_t saddr;
200 __u32 reqid;
Tao Baod7db5942015-01-28 10:07:51 -0800201 __u8 mode;
202 __u8 share;
203 __u8 optional;
204 __u32 aalgos;
Tao Baod7db5942015-01-28 10:07:51 -0800205 __u32 ealgos;
206 __u32 calgos;
Ben Cheng655a7c02013-10-16 16:09:24 -0700207};
208struct xfrm_encap_tmpl {
Tao Baod7db5942015-01-28 10:07:51 -0800209 __u16 encap_type;
210 __be16 encap_sport;
211 __be16 encap_dport;
212 xfrm_address_t encap_oa;
Ben Cheng655a7c02013-10-16 16:09:24 -0700213};
214enum xfrm_ae_ftype_t {
Tao Baod7db5942015-01-28 10:07:51 -0800215 XFRM_AE_UNSPEC,
216 XFRM_AE_RTHR = 1,
Tao Baod7db5942015-01-28 10:07:51 -0800217 XFRM_AE_RVAL = 2,
218 XFRM_AE_LVAL = 4,
219 XFRM_AE_ETHR = 8,
220 XFRM_AE_CR = 16,
Tao Baod7db5942015-01-28 10:07:51 -0800221 XFRM_AE_CE = 32,
222 XFRM_AE_CU = 64,
223 __XFRM_AE_MAX
Ben Cheng655a7c02013-10-16 16:09:24 -0700224#define XFRM_AE_MAX (__XFRM_AE_MAX - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700225};
226struct xfrm_userpolicy_type {
Tao Baod7db5942015-01-28 10:07:51 -0800227 __u8 type;
228 __u16 reserved1;
Tao Baod7db5942015-01-28 10:07:51 -0800229 __u8 reserved2;
Ben Cheng655a7c02013-10-16 16:09:24 -0700230};
231enum xfrm_attr_type_t {
Tao Baod7db5942015-01-28 10:07:51 -0800232 XFRMA_UNSPEC,
Tao Baod7db5942015-01-28 10:07:51 -0800233 XFRMA_ALG_AUTH,
234 XFRMA_ALG_CRYPT,
235 XFRMA_ALG_COMP,
236 XFRMA_ENCAP,
Tao Baod7db5942015-01-28 10:07:51 -0800237 XFRMA_TMPL,
238 XFRMA_SA,
239 XFRMA_POLICY,
240 XFRMA_SEC_CTX,
Tao Baod7db5942015-01-28 10:07:51 -0800241 XFRMA_LTIME_VAL,
242 XFRMA_REPLAY_VAL,
243 XFRMA_REPLAY_THRESH,
244 XFRMA_ETIMER_THRESH,
Tao Baod7db5942015-01-28 10:07:51 -0800245 XFRMA_SRCADDR,
246 XFRMA_COADDR,
247 XFRMA_LASTUSED,
248 XFRMA_POLICY_TYPE,
Tao Baod7db5942015-01-28 10:07:51 -0800249 XFRMA_MIGRATE,
250 XFRMA_ALG_AEAD,
251 XFRMA_KMADDRESS,
252 XFRMA_ALG_AUTH_TRUNC,
Tao Baod7db5942015-01-28 10:07:51 -0800253 XFRMA_MARK,
254 XFRMA_TFCPAD,
255 XFRMA_REPLAY_ESN_VAL,
256 XFRMA_SA_EXTRA_FLAGS,
Tao Baod7db5942015-01-28 10:07:51 -0800257 XFRMA_PROTO,
258 XFRMA_ADDRESS_FILTER,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700259 XFRMA_PAD,
Christopher Ferris525ce912017-07-26 13:12:53 -0700260 XFRMA_OFFLOAD_DEV,
Tao Baod7db5942015-01-28 10:07:51 -0800261 __XFRMA_MAX
Ben Cheng655a7c02013-10-16 16:09:24 -0700262#define XFRMA_MAX (__XFRMA_MAX - 1)
263};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700264struct xfrm_mark {
Tao Baod7db5942015-01-28 10:07:51 -0800265 __u32 v;
266 __u32 m;
Ben Cheng655a7c02013-10-16 16:09:24 -0700267};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700268enum xfrm_sadattr_type_t {
Tao Baod7db5942015-01-28 10:07:51 -0800269 XFRMA_SAD_UNSPEC,
270 XFRMA_SAD_CNT,
Tao Baod7db5942015-01-28 10:07:51 -0800271 XFRMA_SAD_HINFO,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700272 __XFRMA_SAD_MAX
Ben Cheng655a7c02013-10-16 16:09:24 -0700273#define XFRMA_SAD_MAX (__XFRMA_SAD_MAX - 1)
274};
275struct xfrmu_sadhinfo {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700276 __u32 sadhcnt;
Tao Baod7db5942015-01-28 10:07:51 -0800277 __u32 sadhmcnt;
Ben Cheng655a7c02013-10-16 16:09:24 -0700278};
279enum xfrm_spdattr_type_t {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700280 XFRMA_SPD_UNSPEC,
Tao Baod7db5942015-01-28 10:07:51 -0800281 XFRMA_SPD_INFO,
282 XFRMA_SPD_HINFO,
Tao Baod7db5942015-01-28 10:07:51 -0800283 XFRMA_SPD_IPV4_HTHRESH,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700284 XFRMA_SPD_IPV6_HTHRESH,
Tao Baod7db5942015-01-28 10:07:51 -0800285 __XFRMA_SPD_MAX
Ben Cheng655a7c02013-10-16 16:09:24 -0700286#define XFRMA_SPD_MAX (__XFRMA_SPD_MAX - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700287};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700288struct xfrmu_spdinfo {
Tao Baod7db5942015-01-28 10:07:51 -0800289 __u32 incnt;
290 __u32 outcnt;
Tao Baod7db5942015-01-28 10:07:51 -0800291 __u32 fwdcnt;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700292 __u32 inscnt;
Tao Baod7db5942015-01-28 10:07:51 -0800293 __u32 outscnt;
294 __u32 fwdscnt;
Ben Cheng655a7c02013-10-16 16:09:24 -0700295};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700296struct xfrmu_spdhinfo {
Tao Baod7db5942015-01-28 10:07:51 -0800297 __u32 spdhcnt;
298 __u32 spdhmcnt;
Christopher Ferris82d75042015-01-26 10:57:07 -0800299};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700300struct xfrmu_spdhthresh {
Tao Baod7db5942015-01-28 10:07:51 -0800301 __u8 lbits;
302 __u8 rbits;
Ben Cheng655a7c02013-10-16 16:09:24 -0700303};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700304struct xfrm_usersa_info {
Tao Baod7db5942015-01-28 10:07:51 -0800305 struct xfrm_selector sel;
306 struct xfrm_id id;
Tao Baod7db5942015-01-28 10:07:51 -0800307 xfrm_address_t saddr;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700308 struct xfrm_lifetime_cfg lft;
Tao Baod7db5942015-01-28 10:07:51 -0800309 struct xfrm_lifetime_cur curlft;
310 struct xfrm_stats stats;
Tao Baod7db5942015-01-28 10:07:51 -0800311 __u32 seq;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700312 __u32 reqid;
Tao Baod7db5942015-01-28 10:07:51 -0800313 __u16 family;
314 __u8 mode;
Tao Baod7db5942015-01-28 10:07:51 -0800315 __u8 replay_window;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700316 __u8 flags;
Ben Cheng655a7c02013-10-16 16:09:24 -0700317#define XFRM_STATE_NOECN 1
318#define XFRM_STATE_DECAP_DSCP 2
Ben Cheng655a7c02013-10-16 16:09:24 -0700319#define XFRM_STATE_NOPMTUDISC 4
Christopher Ferris106b3a82016-08-24 12:15:38 -0700320#define XFRM_STATE_WILDRECV 8
Ben Cheng655a7c02013-10-16 16:09:24 -0700321#define XFRM_STATE_ICMP 16
322#define XFRM_STATE_AF_UNSPEC 32
Ben Cheng655a7c02013-10-16 16:09:24 -0700323#define XFRM_STATE_ALIGN4 64
Christopher Ferris106b3a82016-08-24 12:15:38 -0700324#define XFRM_STATE_ESN 128
Ben Cheng655a7c02013-10-16 16:09:24 -0700325};
326#define XFRM_SA_XFLAG_DONT_ENCAP_DSCP 1
Ben Cheng655a7c02013-10-16 16:09:24 -0700327struct xfrm_usersa_id {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700328 xfrm_address_t daddr;
Tao Baod7db5942015-01-28 10:07:51 -0800329 __be32 spi;
330 __u16 family;
Tao Baod7db5942015-01-28 10:07:51 -0800331 __u8 proto;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700332};
Ben Cheng655a7c02013-10-16 16:09:24 -0700333struct xfrm_aevent_id {
Tao Baod7db5942015-01-28 10:07:51 -0800334 struct xfrm_usersa_id sa_id;
Tao Baod7db5942015-01-28 10:07:51 -0800335 xfrm_address_t saddr;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700336 __u32 flags;
Tao Baod7db5942015-01-28 10:07:51 -0800337 __u32 reqid;
Ben Cheng655a7c02013-10-16 16:09:24 -0700338};
Ben Cheng655a7c02013-10-16 16:09:24 -0700339struct xfrm_userspi_info {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700340 struct xfrm_usersa_info info;
Tao Baod7db5942015-01-28 10:07:51 -0800341 __u32 min;
342 __u32 max;
Ben Cheng655a7c02013-10-16 16:09:24 -0700343};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700344struct xfrm_userpolicy_info {
Tao Baod7db5942015-01-28 10:07:51 -0800345 struct xfrm_selector sel;
346 struct xfrm_lifetime_cfg lft;
Tao Baod7db5942015-01-28 10:07:51 -0800347 struct xfrm_lifetime_cur curlft;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700348 __u32 priority;
Tao Baod7db5942015-01-28 10:07:51 -0800349 __u32 index;
350 __u8 dir;
Tao Baod7db5942015-01-28 10:07:51 -0800351 __u8 action;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700352#define XFRM_POLICY_ALLOW 0
Ben Cheng655a7c02013-10-16 16:09:24 -0700353#define XFRM_POLICY_BLOCK 1
Tao Baod7db5942015-01-28 10:07:51 -0800354 __u8 flags;
Ben Cheng655a7c02013-10-16 16:09:24 -0700355#define XFRM_POLICY_LOCALOK 1
Christopher Ferris106b3a82016-08-24 12:15:38 -0700356#define XFRM_POLICY_ICMP 2
Tao Baod7db5942015-01-28 10:07:51 -0800357 __u8 share;
Ben Cheng655a7c02013-10-16 16:09:24 -0700358};
Ben Cheng655a7c02013-10-16 16:09:24 -0700359struct xfrm_userpolicy_id {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700360 struct xfrm_selector sel;
Tao Baod7db5942015-01-28 10:07:51 -0800361 __u32 index;
362 __u8 dir;
Ben Cheng655a7c02013-10-16 16:09:24 -0700363};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700364struct xfrm_user_acquire {
Tao Baod7db5942015-01-28 10:07:51 -0800365 struct xfrm_id id;
366 xfrm_address_t saddr;
Tao Baod7db5942015-01-28 10:07:51 -0800367 struct xfrm_selector sel;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700368 struct xfrm_userpolicy_info policy;
Tao Baod7db5942015-01-28 10:07:51 -0800369 __u32 aalgos;
370 __u32 ealgos;
Tao Baod7db5942015-01-28 10:07:51 -0800371 __u32 calgos;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700372 __u32 seq;
Ben Cheng655a7c02013-10-16 16:09:24 -0700373};
374struct xfrm_user_expire {
Tao Baod7db5942015-01-28 10:07:51 -0800375 struct xfrm_usersa_info state;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700376 __u8 hard;
Ben Cheng655a7c02013-10-16 16:09:24 -0700377};
378struct xfrm_user_polexpire {
Tao Baod7db5942015-01-28 10:07:51 -0800379 struct xfrm_userpolicy_info pol;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700380 __u8 hard;
Ben Cheng655a7c02013-10-16 16:09:24 -0700381};
382struct xfrm_usersa_flush {
Tao Baod7db5942015-01-28 10:07:51 -0800383 __u8 proto;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700384};
Ben Cheng655a7c02013-10-16 16:09:24 -0700385struct xfrm_user_report {
Tao Baod7db5942015-01-28 10:07:51 -0800386 __u8 proto;
Tao Baod7db5942015-01-28 10:07:51 -0800387 struct xfrm_selector sel;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700388};
Ben Cheng655a7c02013-10-16 16:09:24 -0700389struct xfrm_user_kmaddress {
Tao Baod7db5942015-01-28 10:07:51 -0800390 xfrm_address_t local;
Tao Baod7db5942015-01-28 10:07:51 -0800391 xfrm_address_t remote;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700392 __u32 reserved;
Tao Baod7db5942015-01-28 10:07:51 -0800393 __u16 family;
Ben Cheng655a7c02013-10-16 16:09:24 -0700394};
Ben Cheng655a7c02013-10-16 16:09:24 -0700395struct xfrm_user_migrate {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700396 xfrm_address_t old_daddr;
Tao Baod7db5942015-01-28 10:07:51 -0800397 xfrm_address_t old_saddr;
398 xfrm_address_t new_daddr;
Tao Baod7db5942015-01-28 10:07:51 -0800399 xfrm_address_t new_saddr;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700400 __u8 proto;
Tao Baod7db5942015-01-28 10:07:51 -0800401 __u8 mode;
402 __u16 reserved;
Tao Baod7db5942015-01-28 10:07:51 -0800403 __u32 reqid;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700404 __u16 old_family;
Tao Baod7db5942015-01-28 10:07:51 -0800405 __u16 new_family;
Ben Cheng655a7c02013-10-16 16:09:24 -0700406};
Ben Cheng655a7c02013-10-16 16:09:24 -0700407struct xfrm_user_mapping {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700408 struct xfrm_usersa_id id;
Tao Baod7db5942015-01-28 10:07:51 -0800409 __u32 reqid;
410 xfrm_address_t old_saddr;
Tao Baod7db5942015-01-28 10:07:51 -0800411 xfrm_address_t new_saddr;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700412 __be16 old_sport;
Tao Baod7db5942015-01-28 10:07:51 -0800413 __be16 new_sport;
Ben Cheng655a7c02013-10-16 16:09:24 -0700414};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700415struct xfrm_address_filter {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700416 xfrm_address_t saddr;
Tao Baod7db5942015-01-28 10:07:51 -0800417 xfrm_address_t daddr;
418 __u16 family;
Tao Baod7db5942015-01-28 10:07:51 -0800419 __u8 splen;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700420 __u8 dplen;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700421};
Christopher Ferris525ce912017-07-26 13:12:53 -0700422struct xfrm_user_offload {
423 int ifindex;
424 __u8 flags;
425};
426#define XFRM_OFFLOAD_IPV6 1
427#define XFRM_OFFLOAD_INBOUND 2
Ben Cheng655a7c02013-10-16 16:09:24 -0700428#define XFRMGRP_ACQUIRE 1
429#define XFRMGRP_EXPIRE 2
Christopher Ferris106b3a82016-08-24 12:15:38 -0700430#define XFRMGRP_SA 4
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700431#define XFRMGRP_POLICY 8
Ben Cheng655a7c02013-10-16 16:09:24 -0700432#define XFRMGRP_REPORT 0x20
433enum xfrm_nlgroups {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700434 XFRMNLGRP_NONE,
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700435#define XFRMNLGRP_NONE XFRMNLGRP_NONE
Tao Baod7db5942015-01-28 10:07:51 -0800436 XFRMNLGRP_ACQUIRE,
Ben Cheng655a7c02013-10-16 16:09:24 -0700437#define XFRMNLGRP_ACQUIRE XFRMNLGRP_ACQUIRE
Christopher Ferris106b3a82016-08-24 12:15:38 -0700438 XFRMNLGRP_EXPIRE,
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700439#define XFRMNLGRP_EXPIRE XFRMNLGRP_EXPIRE
Tao Baod7db5942015-01-28 10:07:51 -0800440 XFRMNLGRP_SA,
Ben Cheng655a7c02013-10-16 16:09:24 -0700441#define XFRMNLGRP_SA XFRMNLGRP_SA
Christopher Ferris106b3a82016-08-24 12:15:38 -0700442 XFRMNLGRP_POLICY,
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700443#define XFRMNLGRP_POLICY XFRMNLGRP_POLICY
Tao Baod7db5942015-01-28 10:07:51 -0800444 XFRMNLGRP_AEVENTS,
Ben Cheng655a7c02013-10-16 16:09:24 -0700445#define XFRMNLGRP_AEVENTS XFRMNLGRP_AEVENTS
Christopher Ferris106b3a82016-08-24 12:15:38 -0700446 XFRMNLGRP_REPORT,
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700447#define XFRMNLGRP_REPORT XFRMNLGRP_REPORT
Tao Baod7db5942015-01-28 10:07:51 -0800448 XFRMNLGRP_MIGRATE,
Ben Cheng655a7c02013-10-16 16:09:24 -0700449#define XFRMNLGRP_MIGRATE XFRMNLGRP_MIGRATE
Christopher Ferris106b3a82016-08-24 12:15:38 -0700450 XFRMNLGRP_MAPPING,
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700451#define XFRMNLGRP_MAPPING XFRMNLGRP_MAPPING
Tao Baod7db5942015-01-28 10:07:51 -0800452 __XFRMNLGRP_MAX
Ben Cheng655a7c02013-10-16 16:09:24 -0700453};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700454#define XFRMNLGRP_MAX (__XFRMNLGRP_MAX - 1)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700455#endif