blob: b0e930c94d719b3f3bc5cbfb8036445e41c2e836 [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,
Christopher Ferris9ce28842018-10-25 12:11:39 -0700261 XFRMA_SET_MARK,
262 XFRMA_SET_MARK_MASK,
263 XFRMA_IF_ID,
Tao Baod7db5942015-01-28 10:07:51 -0800264 __XFRMA_MAX
Christopher Ferris9ce28842018-10-25 12:11:39 -0700265#define XFRMA_OUTPUT_MARK XFRMA_SET_MARK
Ben Cheng655a7c02013-10-16 16:09:24 -0700266#define XFRMA_MAX (__XFRMA_MAX - 1)
267};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700268struct xfrm_mark {
Tao Baod7db5942015-01-28 10:07:51 -0800269 __u32 v;
270 __u32 m;
Ben Cheng655a7c02013-10-16 16:09:24 -0700271};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700272enum xfrm_sadattr_type_t {
Tao Baod7db5942015-01-28 10:07:51 -0800273 XFRMA_SAD_UNSPEC,
274 XFRMA_SAD_CNT,
Tao Baod7db5942015-01-28 10:07:51 -0800275 XFRMA_SAD_HINFO,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700276 __XFRMA_SAD_MAX
Ben Cheng655a7c02013-10-16 16:09:24 -0700277#define XFRMA_SAD_MAX (__XFRMA_SAD_MAX - 1)
278};
279struct xfrmu_sadhinfo {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700280 __u32 sadhcnt;
Tao Baod7db5942015-01-28 10:07:51 -0800281 __u32 sadhmcnt;
Ben Cheng655a7c02013-10-16 16:09:24 -0700282};
283enum xfrm_spdattr_type_t {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700284 XFRMA_SPD_UNSPEC,
Tao Baod7db5942015-01-28 10:07:51 -0800285 XFRMA_SPD_INFO,
286 XFRMA_SPD_HINFO,
Tao Baod7db5942015-01-28 10:07:51 -0800287 XFRMA_SPD_IPV4_HTHRESH,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700288 XFRMA_SPD_IPV6_HTHRESH,
Tao Baod7db5942015-01-28 10:07:51 -0800289 __XFRMA_SPD_MAX
Ben Cheng655a7c02013-10-16 16:09:24 -0700290#define XFRMA_SPD_MAX (__XFRMA_SPD_MAX - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700291};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700292struct xfrmu_spdinfo {
Tao Baod7db5942015-01-28 10:07:51 -0800293 __u32 incnt;
294 __u32 outcnt;
Tao Baod7db5942015-01-28 10:07:51 -0800295 __u32 fwdcnt;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700296 __u32 inscnt;
Tao Baod7db5942015-01-28 10:07:51 -0800297 __u32 outscnt;
298 __u32 fwdscnt;
Ben Cheng655a7c02013-10-16 16:09:24 -0700299};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700300struct xfrmu_spdhinfo {
Tao Baod7db5942015-01-28 10:07:51 -0800301 __u32 spdhcnt;
302 __u32 spdhmcnt;
Christopher Ferris82d75042015-01-26 10:57:07 -0800303};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700304struct xfrmu_spdhthresh {
Tao Baod7db5942015-01-28 10:07:51 -0800305 __u8 lbits;
306 __u8 rbits;
Ben Cheng655a7c02013-10-16 16:09:24 -0700307};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700308struct xfrm_usersa_info {
Tao Baod7db5942015-01-28 10:07:51 -0800309 struct xfrm_selector sel;
310 struct xfrm_id id;
Tao Baod7db5942015-01-28 10:07:51 -0800311 xfrm_address_t saddr;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700312 struct xfrm_lifetime_cfg lft;
Tao Baod7db5942015-01-28 10:07:51 -0800313 struct xfrm_lifetime_cur curlft;
314 struct xfrm_stats stats;
Tao Baod7db5942015-01-28 10:07:51 -0800315 __u32 seq;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700316 __u32 reqid;
Tao Baod7db5942015-01-28 10:07:51 -0800317 __u16 family;
318 __u8 mode;
Tao Baod7db5942015-01-28 10:07:51 -0800319 __u8 replay_window;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700320 __u8 flags;
Ben Cheng655a7c02013-10-16 16:09:24 -0700321#define XFRM_STATE_NOECN 1
322#define XFRM_STATE_DECAP_DSCP 2
Ben Cheng655a7c02013-10-16 16:09:24 -0700323#define XFRM_STATE_NOPMTUDISC 4
Christopher Ferris106b3a82016-08-24 12:15:38 -0700324#define XFRM_STATE_WILDRECV 8
Ben Cheng655a7c02013-10-16 16:09:24 -0700325#define XFRM_STATE_ICMP 16
326#define XFRM_STATE_AF_UNSPEC 32
Ben Cheng655a7c02013-10-16 16:09:24 -0700327#define XFRM_STATE_ALIGN4 64
Christopher Ferris106b3a82016-08-24 12:15:38 -0700328#define XFRM_STATE_ESN 128
Ben Cheng655a7c02013-10-16 16:09:24 -0700329};
330#define XFRM_SA_XFLAG_DONT_ENCAP_DSCP 1
Christopher Ferris25c18d42020-10-14 17:42:58 -0700331#define XFRM_SA_XFLAG_OSEQ_MAY_WRAP 2
Ben Cheng655a7c02013-10-16 16:09:24 -0700332struct xfrm_usersa_id {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700333 xfrm_address_t daddr;
Tao Baod7db5942015-01-28 10:07:51 -0800334 __be32 spi;
335 __u16 family;
Tao Baod7db5942015-01-28 10:07:51 -0800336 __u8 proto;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700337};
Ben Cheng655a7c02013-10-16 16:09:24 -0700338struct xfrm_aevent_id {
Tao Baod7db5942015-01-28 10:07:51 -0800339 struct xfrm_usersa_id sa_id;
Tao Baod7db5942015-01-28 10:07:51 -0800340 xfrm_address_t saddr;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700341 __u32 flags;
Tao Baod7db5942015-01-28 10:07:51 -0800342 __u32 reqid;
Ben Cheng655a7c02013-10-16 16:09:24 -0700343};
Ben Cheng655a7c02013-10-16 16:09:24 -0700344struct xfrm_userspi_info {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700345 struct xfrm_usersa_info info;
Tao Baod7db5942015-01-28 10:07:51 -0800346 __u32 min;
347 __u32 max;
Ben Cheng655a7c02013-10-16 16:09:24 -0700348};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700349struct xfrm_userpolicy_info {
Tao Baod7db5942015-01-28 10:07:51 -0800350 struct xfrm_selector sel;
351 struct xfrm_lifetime_cfg lft;
Tao Baod7db5942015-01-28 10:07:51 -0800352 struct xfrm_lifetime_cur curlft;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700353 __u32 priority;
Tao Baod7db5942015-01-28 10:07:51 -0800354 __u32 index;
355 __u8 dir;
Tao Baod7db5942015-01-28 10:07:51 -0800356 __u8 action;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700357#define XFRM_POLICY_ALLOW 0
Ben Cheng655a7c02013-10-16 16:09:24 -0700358#define XFRM_POLICY_BLOCK 1
Tao Baod7db5942015-01-28 10:07:51 -0800359 __u8 flags;
Ben Cheng655a7c02013-10-16 16:09:24 -0700360#define XFRM_POLICY_LOCALOK 1
Christopher Ferris106b3a82016-08-24 12:15:38 -0700361#define XFRM_POLICY_ICMP 2
Tao Baod7db5942015-01-28 10:07:51 -0800362 __u8 share;
Ben Cheng655a7c02013-10-16 16:09:24 -0700363};
Ben Cheng655a7c02013-10-16 16:09:24 -0700364struct xfrm_userpolicy_id {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700365 struct xfrm_selector sel;
Tao Baod7db5942015-01-28 10:07:51 -0800366 __u32 index;
367 __u8 dir;
Ben Cheng655a7c02013-10-16 16:09:24 -0700368};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700369struct xfrm_user_acquire {
Tao Baod7db5942015-01-28 10:07:51 -0800370 struct xfrm_id id;
371 xfrm_address_t saddr;
Tao Baod7db5942015-01-28 10:07:51 -0800372 struct xfrm_selector sel;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700373 struct xfrm_userpolicy_info policy;
Tao Baod7db5942015-01-28 10:07:51 -0800374 __u32 aalgos;
375 __u32 ealgos;
Tao Baod7db5942015-01-28 10:07:51 -0800376 __u32 calgos;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700377 __u32 seq;
Ben Cheng655a7c02013-10-16 16:09:24 -0700378};
379struct xfrm_user_expire {
Tao Baod7db5942015-01-28 10:07:51 -0800380 struct xfrm_usersa_info state;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700381 __u8 hard;
Ben Cheng655a7c02013-10-16 16:09:24 -0700382};
383struct xfrm_user_polexpire {
Tao Baod7db5942015-01-28 10:07:51 -0800384 struct xfrm_userpolicy_info pol;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700385 __u8 hard;
Ben Cheng655a7c02013-10-16 16:09:24 -0700386};
387struct xfrm_usersa_flush {
Tao Baod7db5942015-01-28 10:07:51 -0800388 __u8 proto;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700389};
Ben Cheng655a7c02013-10-16 16:09:24 -0700390struct xfrm_user_report {
Tao Baod7db5942015-01-28 10:07:51 -0800391 __u8 proto;
Tao Baod7db5942015-01-28 10:07:51 -0800392 struct xfrm_selector sel;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700393};
Ben Cheng655a7c02013-10-16 16:09:24 -0700394struct xfrm_user_kmaddress {
Tao Baod7db5942015-01-28 10:07:51 -0800395 xfrm_address_t local;
Tao Baod7db5942015-01-28 10:07:51 -0800396 xfrm_address_t remote;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700397 __u32 reserved;
Tao Baod7db5942015-01-28 10:07:51 -0800398 __u16 family;
Ben Cheng655a7c02013-10-16 16:09:24 -0700399};
Ben Cheng655a7c02013-10-16 16:09:24 -0700400struct xfrm_user_migrate {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700401 xfrm_address_t old_daddr;
Tao Baod7db5942015-01-28 10:07:51 -0800402 xfrm_address_t old_saddr;
403 xfrm_address_t new_daddr;
Tao Baod7db5942015-01-28 10:07:51 -0800404 xfrm_address_t new_saddr;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700405 __u8 proto;
Tao Baod7db5942015-01-28 10:07:51 -0800406 __u8 mode;
407 __u16 reserved;
Tao Baod7db5942015-01-28 10:07:51 -0800408 __u32 reqid;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700409 __u16 old_family;
Tao Baod7db5942015-01-28 10:07:51 -0800410 __u16 new_family;
Ben Cheng655a7c02013-10-16 16:09:24 -0700411};
Ben Cheng655a7c02013-10-16 16:09:24 -0700412struct xfrm_user_mapping {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700413 struct xfrm_usersa_id id;
Tao Baod7db5942015-01-28 10:07:51 -0800414 __u32 reqid;
415 xfrm_address_t old_saddr;
Tao Baod7db5942015-01-28 10:07:51 -0800416 xfrm_address_t new_saddr;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700417 __be16 old_sport;
Tao Baod7db5942015-01-28 10:07:51 -0800418 __be16 new_sport;
Ben Cheng655a7c02013-10-16 16:09:24 -0700419};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700420struct xfrm_address_filter {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700421 xfrm_address_t saddr;
Tao Baod7db5942015-01-28 10:07:51 -0800422 xfrm_address_t daddr;
423 __u16 family;
Tao Baod7db5942015-01-28 10:07:51 -0800424 __u8 splen;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700425 __u8 dplen;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700426};
Christopher Ferris525ce912017-07-26 13:12:53 -0700427struct xfrm_user_offload {
428 int ifindex;
429 __u8 flags;
430};
431#define XFRM_OFFLOAD_IPV6 1
432#define XFRM_OFFLOAD_INBOUND 2
Ben Cheng655a7c02013-10-16 16:09:24 -0700433#define XFRMGRP_ACQUIRE 1
434#define XFRMGRP_EXPIRE 2
Christopher Ferris106b3a82016-08-24 12:15:38 -0700435#define XFRMGRP_SA 4
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700436#define XFRMGRP_POLICY 8
Ben Cheng655a7c02013-10-16 16:09:24 -0700437#define XFRMGRP_REPORT 0x20
438enum xfrm_nlgroups {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700439 XFRMNLGRP_NONE,
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700440#define XFRMNLGRP_NONE XFRMNLGRP_NONE
Tao Baod7db5942015-01-28 10:07:51 -0800441 XFRMNLGRP_ACQUIRE,
Ben Cheng655a7c02013-10-16 16:09:24 -0700442#define XFRMNLGRP_ACQUIRE XFRMNLGRP_ACQUIRE
Christopher Ferris106b3a82016-08-24 12:15:38 -0700443 XFRMNLGRP_EXPIRE,
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700444#define XFRMNLGRP_EXPIRE XFRMNLGRP_EXPIRE
Tao Baod7db5942015-01-28 10:07:51 -0800445 XFRMNLGRP_SA,
Ben Cheng655a7c02013-10-16 16:09:24 -0700446#define XFRMNLGRP_SA XFRMNLGRP_SA
Christopher Ferris106b3a82016-08-24 12:15:38 -0700447 XFRMNLGRP_POLICY,
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700448#define XFRMNLGRP_POLICY XFRMNLGRP_POLICY
Tao Baod7db5942015-01-28 10:07:51 -0800449 XFRMNLGRP_AEVENTS,
Ben Cheng655a7c02013-10-16 16:09:24 -0700450#define XFRMNLGRP_AEVENTS XFRMNLGRP_AEVENTS
Christopher Ferris106b3a82016-08-24 12:15:38 -0700451 XFRMNLGRP_REPORT,
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700452#define XFRMNLGRP_REPORT XFRMNLGRP_REPORT
Tao Baod7db5942015-01-28 10:07:51 -0800453 XFRMNLGRP_MIGRATE,
Ben Cheng655a7c02013-10-16 16:09:24 -0700454#define XFRMNLGRP_MIGRATE XFRMNLGRP_MIGRATE
Christopher Ferris106b3a82016-08-24 12:15:38 -0700455 XFRMNLGRP_MAPPING,
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700456#define XFRMNLGRP_MAPPING XFRMNLGRP_MAPPING
Tao Baod7db5942015-01-28 10:07:51 -0800457 __XFRMNLGRP_MAX
Ben Cheng655a7c02013-10-16 16:09:24 -0700458};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700459#define XFRMNLGRP_MAX (__XFRMNLGRP_MAX - 1)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700460#endif