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