1 /****************************************************************************
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_PFKEY2_H
20 #define _LINUX_PFKEY2_H
21 #include <linux/types.h>
22 #define PF_KEY_V2 2
23 #define PFKEYV2_REVISION 199806L
24 struct sadb_msg {
25   __u8 sadb_msg_version;
26   __u8 sadb_msg_type;
27   __u8 sadb_msg_errno;
28   __u8 sadb_msg_satype;
29   __u16 sadb_msg_len;
30   __u16 sadb_msg_reserved;
31   __u32 sadb_msg_seq;
32   __u32 sadb_msg_pid;
33 } __attribute__((packed));
34 struct sadb_ext {
35   __u16 sadb_ext_len;
36   __u16 sadb_ext_type;
37 } __attribute__((packed));
38 struct sadb_sa {
39   __u16 sadb_sa_len;
40   __u16 sadb_sa_exttype;
41   __be32 sadb_sa_spi;
42   __u8 sadb_sa_replay;
43   __u8 sadb_sa_state;
44   __u8 sadb_sa_auth;
45   __u8 sadb_sa_encrypt;
46   __u32 sadb_sa_flags;
47 } __attribute__((packed));
48 struct sadb_lifetime {
49   __u16 sadb_lifetime_len;
50   __u16 sadb_lifetime_exttype;
51   __u32 sadb_lifetime_allocations;
52   __u64 sadb_lifetime_bytes;
53   __u64 sadb_lifetime_addtime;
54   __u64 sadb_lifetime_usetime;
55 } __attribute__((packed));
56 struct sadb_address {
57   __u16 sadb_address_len;
58   __u16 sadb_address_exttype;
59   __u8 sadb_address_proto;
60   __u8 sadb_address_prefixlen;
61   __u16 sadb_address_reserved;
62 } __attribute__((packed));
63 struct sadb_key {
64   __u16 sadb_key_len;
65   __u16 sadb_key_exttype;
66   __u16 sadb_key_bits;
67   __u16 sadb_key_reserved;
68 } __attribute__((packed));
69 struct sadb_ident {
70   __u16 sadb_ident_len;
71   __u16 sadb_ident_exttype;
72   __u16 sadb_ident_type;
73   __u16 sadb_ident_reserved;
74   __u64 sadb_ident_id;
75 } __attribute__((packed));
76 struct sadb_sens {
77   __u16 sadb_sens_len;
78   __u16 sadb_sens_exttype;
79   __u32 sadb_sens_dpd;
80   __u8 sadb_sens_sens_level;
81   __u8 sadb_sens_sens_len;
82   __u8 sadb_sens_integ_level;
83   __u8 sadb_sens_integ_len;
84   __u32 sadb_sens_reserved;
85 } __attribute__((packed));
86 struct sadb_prop {
87   __u16 sadb_prop_len;
88   __u16 sadb_prop_exttype;
89   __u8 sadb_prop_replay;
90   __u8 sadb_prop_reserved[3];
91 } __attribute__((packed));
92 struct sadb_comb {
93   __u8 sadb_comb_auth;
94   __u8 sadb_comb_encrypt;
95   __u16 sadb_comb_flags;
96   __u16 sadb_comb_auth_minbits;
97   __u16 sadb_comb_auth_maxbits;
98   __u16 sadb_comb_encrypt_minbits;
99   __u16 sadb_comb_encrypt_maxbits;
100   __u32 sadb_comb_reserved;
101   __u32 sadb_comb_soft_allocations;
102   __u32 sadb_comb_hard_allocations;
103   __u64 sadb_comb_soft_bytes;
104   __u64 sadb_comb_hard_bytes;
105   __u64 sadb_comb_soft_addtime;
106   __u64 sadb_comb_hard_addtime;
107   __u64 sadb_comb_soft_usetime;
108   __u64 sadb_comb_hard_usetime;
109 } __attribute__((packed));
110 struct sadb_supported {
111   __u16 sadb_supported_len;
112   __u16 sadb_supported_exttype;
113   __u32 sadb_supported_reserved;
114 } __attribute__((packed));
115 struct sadb_alg {
116   __u8 sadb_alg_id;
117   __u8 sadb_alg_ivlen;
118   __u16 sadb_alg_minbits;
119   __u16 sadb_alg_maxbits;
120   __u16 sadb_alg_reserved;
121 } __attribute__((packed));
122 struct sadb_spirange {
123   __u16 sadb_spirange_len;
124   __u16 sadb_spirange_exttype;
125   __u32 sadb_spirange_min;
126   __u32 sadb_spirange_max;
127   __u32 sadb_spirange_reserved;
128 } __attribute__((packed));
129 struct sadb_x_kmprivate {
130   __u16 sadb_x_kmprivate_len;
131   __u16 sadb_x_kmprivate_exttype;
132   __u32 sadb_x_kmprivate_reserved;
133 } __attribute__((packed));
134 struct sadb_x_sa2 {
135   __u16 sadb_x_sa2_len;
136   __u16 sadb_x_sa2_exttype;
137   __u8 sadb_x_sa2_mode;
138   __u8 sadb_x_sa2_reserved1;
139   __u16 sadb_x_sa2_reserved2;
140   __u32 sadb_x_sa2_sequence;
141   __u32 sadb_x_sa2_reqid;
142 } __attribute__((packed));
143 struct sadb_x_policy {
144   __u16 sadb_x_policy_len;
145   __u16 sadb_x_policy_exttype;
146   __u16 sadb_x_policy_type;
147   __u8 sadb_x_policy_dir;
148   __u8 sadb_x_policy_reserved;
149   __u32 sadb_x_policy_id;
150   __u32 sadb_x_policy_priority;
151 } __attribute__((packed));
152 struct sadb_x_ipsecrequest {
153   __u16 sadb_x_ipsecrequest_len;
154   __u16 sadb_x_ipsecrequest_proto;
155   __u8 sadb_x_ipsecrequest_mode;
156   __u8 sadb_x_ipsecrequest_level;
157   __u16 sadb_x_ipsecrequest_reserved1;
158   __u32 sadb_x_ipsecrequest_reqid;
159   __u32 sadb_x_ipsecrequest_reserved2;
160 } __attribute__((packed));
161 struct sadb_x_nat_t_type {
162   __u16 sadb_x_nat_t_type_len;
163   __u16 sadb_x_nat_t_type_exttype;
164   __u8 sadb_x_nat_t_type_type;
165   __u8 sadb_x_nat_t_type_reserved[3];
166 } __attribute__((packed));
167 struct sadb_x_nat_t_port {
168   __u16 sadb_x_nat_t_port_len;
169   __u16 sadb_x_nat_t_port_exttype;
170   __be16 sadb_x_nat_t_port_port;
171   __u16 sadb_x_nat_t_port_reserved;
172 } __attribute__((packed));
173 struct sadb_x_sec_ctx {
174   __u16 sadb_x_sec_len;
175   __u16 sadb_x_sec_exttype;
176   __u8 sadb_x_ctx_alg;
177   __u8 sadb_x_ctx_doi;
178   __u16 sadb_x_ctx_len;
179 } __attribute__((packed));
180 struct sadb_x_kmaddress {
181   __u16 sadb_x_kmaddress_len;
182   __u16 sadb_x_kmaddress_exttype;
183   __u32 sadb_x_kmaddress_reserved;
184 } __attribute__((packed));
185 struct sadb_x_filter {
186   __u16 sadb_x_filter_len;
187   __u16 sadb_x_filter_exttype;
188   __u32 sadb_x_filter_saddr[4];
189   __u32 sadb_x_filter_daddr[4];
190   __u16 sadb_x_filter_family;
191   __u8 sadb_x_filter_splen;
192   __u8 sadb_x_filter_dplen;
193 } __attribute__((packed));
194 #define SADB_RESERVED 0
195 #define SADB_GETSPI 1
196 #define SADB_UPDATE 2
197 #define SADB_ADD 3
198 #define SADB_DELETE 4
199 #define SADB_GET 5
200 #define SADB_ACQUIRE 6
201 #define SADB_REGISTER 7
202 #define SADB_EXPIRE 8
203 #define SADB_FLUSH 9
204 #define SADB_DUMP 10
205 #define SADB_X_PROMISC 11
206 #define SADB_X_PCHANGE 12
207 #define SADB_X_SPDUPDATE 13
208 #define SADB_X_SPDADD 14
209 #define SADB_X_SPDDELETE 15
210 #define SADB_X_SPDGET 16
211 #define SADB_X_SPDACQUIRE 17
212 #define SADB_X_SPDDUMP 18
213 #define SADB_X_SPDFLUSH 19
214 #define SADB_X_SPDSETIDX 20
215 #define SADB_X_SPDEXPIRE 21
216 #define SADB_X_SPDDELETE2 22
217 #define SADB_X_NAT_T_NEW_MAPPING 23
218 #define SADB_X_MIGRATE 24
219 #define SADB_MAX 24
220 #define SADB_SAFLAGS_PFS 1
221 #define SADB_SAFLAGS_NOPMTUDISC 0x20000000
222 #define SADB_SAFLAGS_DECAP_DSCP 0x40000000
223 #define SADB_SAFLAGS_NOECN 0x80000000
224 #define SADB_SASTATE_LARVAL 0
225 #define SADB_SASTATE_MATURE 1
226 #define SADB_SASTATE_DYING 2
227 #define SADB_SASTATE_DEAD 3
228 #define SADB_SASTATE_MAX 3
229 #define SADB_SATYPE_UNSPEC 0
230 #define SADB_SATYPE_AH 2
231 #define SADB_SATYPE_ESP 3
232 #define SADB_SATYPE_RSVP 5
233 #define SADB_SATYPE_OSPFV2 6
234 #define SADB_SATYPE_RIPV2 7
235 #define SADB_SATYPE_MIP 8
236 #define SADB_X_SATYPE_IPCOMP 9
237 #define SADB_SATYPE_MAX 9
238 #define SADB_AALG_NONE 0
239 #define SADB_AALG_MD5HMAC 2
240 #define SADB_AALG_SHA1HMAC 3
241 #define SADB_X_AALG_SHA2_256HMAC 5
242 #define SADB_X_AALG_SHA2_384HMAC 6
243 #define SADB_X_AALG_SHA2_512HMAC 7
244 #define SADB_X_AALG_RIPEMD160HMAC 8
245 #define SADB_X_AALG_AES_XCBC_MAC 9
246 #define SADB_X_AALG_NULL 251
247 #define SADB_AALG_MAX 251
248 #define SADB_EALG_NONE 0
249 #define SADB_EALG_DESCBC 2
250 #define SADB_EALG_3DESCBC 3
251 #define SADB_X_EALG_CASTCBC 6
252 #define SADB_X_EALG_BLOWFISHCBC 7
253 #define SADB_EALG_NULL 11
254 #define SADB_X_EALG_AESCBC 12
255 #define SADB_X_EALG_AESCTR 13
256 #define SADB_X_EALG_AES_CCM_ICV8 14
257 #define SADB_X_EALG_AES_CCM_ICV12 15
258 #define SADB_X_EALG_AES_CCM_ICV16 16
259 #define SADB_X_EALG_AES_GCM_ICV8 18
260 #define SADB_X_EALG_AES_GCM_ICV12 19
261 #define SADB_X_EALG_AES_GCM_ICV16 20
262 #define SADB_X_EALG_CAMELLIACBC 22
263 #define SADB_X_EALG_NULL_AES_GMAC 23
264 #define SADB_EALG_MAX 253
265 #define SADB_X_EALG_SERPENTCBC 252
266 #define SADB_X_EALG_TWOFISHCBC 253
267 #define SADB_X_CALG_NONE 0
268 #define SADB_X_CALG_OUI 1
269 #define SADB_X_CALG_DEFLATE 2
270 #define SADB_X_CALG_LZS 3
271 #define SADB_X_CALG_LZJH 4
272 #define SADB_X_CALG_MAX 4
273 #define SADB_EXT_RESERVED 0
274 #define SADB_EXT_SA 1
275 #define SADB_EXT_LIFETIME_CURRENT 2
276 #define SADB_EXT_LIFETIME_HARD 3
277 #define SADB_EXT_LIFETIME_SOFT 4
278 #define SADB_EXT_ADDRESS_SRC 5
279 #define SADB_EXT_ADDRESS_DST 6
280 #define SADB_EXT_ADDRESS_PROXY 7
281 #define SADB_EXT_KEY_AUTH 8
282 #define SADB_EXT_KEY_ENCRYPT 9
283 #define SADB_EXT_IDENTITY_SRC 10
284 #define SADB_EXT_IDENTITY_DST 11
285 #define SADB_EXT_SENSITIVITY 12
286 #define SADB_EXT_PROPOSAL 13
287 #define SADB_EXT_SUPPORTED_AUTH 14
288 #define SADB_EXT_SUPPORTED_ENCRYPT 15
289 #define SADB_EXT_SPIRANGE 16
290 #define SADB_X_EXT_KMPRIVATE 17
291 #define SADB_X_EXT_POLICY 18
292 #define SADB_X_EXT_SA2 19
293 #define SADB_X_EXT_NAT_T_TYPE 20
294 #define SADB_X_EXT_NAT_T_SPORT 21
295 #define SADB_X_EXT_NAT_T_DPORT 22
296 #define SADB_X_EXT_NAT_T_OA 23
297 #define SADB_X_EXT_SEC_CTX 24
298 #define SADB_X_EXT_KMADDRESS 25
299 #define SADB_X_EXT_FILTER 26
300 #define SADB_EXT_MAX 26
301 #define SADB_IDENTTYPE_RESERVED 0
302 #define SADB_IDENTTYPE_PREFIX 1
303 #define SADB_IDENTTYPE_FQDN 2
304 #define SADB_IDENTTYPE_USERFQDN 3
305 #define SADB_IDENTTYPE_MAX 3
306 #endif
307