linux/include/uapi/linux/pfkeyv2.h

/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
/* PF_KEY user interface, this is defined by rfc2367 so
 * do not make arbitrary modifications or else this header
 * file will not be compliant.
 */

#ifndef _LINUX_PFKEY2_H
#define _LINUX_PFKEY2_H

#include <linux/types.h>

#define PF_KEY_V2
#define PFKEYV2_REVISION

struct sadb_msg {} __attribute__((packed));
/* sizeof(struct sadb_msg) == 16 */

struct sadb_ext {} __attribute__((packed));
/* sizeof(struct sadb_ext) == 4 */

struct sadb_sa {} __attribute__((packed));
/* sizeof(struct sadb_sa) == 16 */

struct sadb_lifetime {} __attribute__((packed));
/* sizeof(struct sadb_lifetime) == 32 */

struct sadb_address {} __attribute__((packed));
/* sizeof(struct sadb_address) == 8 */

struct sadb_key {} __attribute__((packed));
/* sizeof(struct sadb_key) == 8 */

struct sadb_ident {} __attribute__((packed));
/* sizeof(struct sadb_ident) == 16 */

struct sadb_sens {} __attribute__((packed));
/* sizeof(struct sadb_sens) == 16 */

/* followed by:
	__u64	sadb_sens_bitmap[sens_len];
	__u64	sadb_integ_bitmap[integ_len];  */

struct sadb_prop {} __attribute__((packed));
/* sizeof(struct sadb_prop) == 8 */

/* followed by:
	struct sadb_comb sadb_combs[(sadb_prop_len +
		sizeof(__u64) - sizeof(struct sadb_prop)) /
		sizeof(struct sadb_comb)]; */

struct sadb_comb {} __attribute__((packed));
/* sizeof(struct sadb_comb) == 72 */

struct sadb_supported {} __attribute__((packed));
/* sizeof(struct sadb_supported) == 8 */

/* followed by:
	struct sadb_alg sadb_algs[(sadb_supported_len +
		sizeof(__u64) - sizeof(struct sadb_supported)) /
		sizeof(struct sadb_alg)]; */

struct sadb_alg {} __attribute__((packed));
/* sizeof(struct sadb_alg) == 8 */

struct sadb_spirange {} __attribute__((packed));
/* sizeof(struct sadb_spirange) == 16 */

struct sadb_x_kmprivate {} __attribute__((packed));
/* sizeof(struct sadb_x_kmprivate) == 8 */

struct sadb_x_sa2 {} __attribute__((packed));
/* sizeof(struct sadb_x_sa2) == 16 */

struct sadb_x_policy {} __attribute__((packed));
/* sizeof(struct sadb_x_policy) == 16 */

struct sadb_x_ipsecrequest {} __attribute__((packed));
/* sizeof(struct sadb_x_ipsecrequest) == 16 */

/* This defines the TYPE of Nat Traversal in use.  Currently only one
 * type of NAT-T is supported, draft-ietf-ipsec-udp-encaps-06
 */
struct sadb_x_nat_t_type {} __attribute__((packed));
/* sizeof(struct sadb_x_nat_t_type) == 8 */

/* Pass a NAT Traversal port (Source or Dest port) */
struct sadb_x_nat_t_port {} __attribute__((packed));
/* sizeof(struct sadb_x_nat_t_port) == 8 */

/* Generic LSM security context */
struct sadb_x_sec_ctx {} __attribute__((packed));
/* sizeof(struct sadb_sec_ctx) = 8 */

/* Used by MIGRATE to pass addresses IKE will use to perform
 * negotiation with the peer */
struct sadb_x_kmaddress {} __attribute__((packed));
/* sizeof(struct sadb_x_kmaddress) == 8 */

/* To specify the SA dump filter */
struct sadb_x_filter {} __attribute__((packed));
/* sizeof(struct sadb_x_filter) == 40 */

/* Message types */
#define SADB_RESERVED
#define SADB_GETSPI
#define SADB_UPDATE
#define SADB_ADD
#define SADB_DELETE
#define SADB_GET
#define SADB_ACQUIRE
#define SADB_REGISTER
#define SADB_EXPIRE
#define SADB_FLUSH
#define SADB_DUMP
#define SADB_X_PROMISC
#define SADB_X_PCHANGE
#define SADB_X_SPDUPDATE
#define SADB_X_SPDADD
#define SADB_X_SPDDELETE
#define SADB_X_SPDGET
#define SADB_X_SPDACQUIRE
#define SADB_X_SPDDUMP
#define SADB_X_SPDFLUSH
#define SADB_X_SPDSETIDX
#define SADB_X_SPDEXPIRE
#define SADB_X_SPDDELETE2
#define SADB_X_NAT_T_NEW_MAPPING
#define SADB_X_MIGRATE
#define SADB_MAX

/* Security Association flags */
#define SADB_SAFLAGS_PFS
#define SADB_SAFLAGS_NOPMTUDISC
#define SADB_SAFLAGS_DECAP_DSCP
#define SADB_SAFLAGS_NOECN

/* Security Association states */
#define SADB_SASTATE_LARVAL
#define SADB_SASTATE_MATURE
#define SADB_SASTATE_DYING
#define SADB_SASTATE_DEAD
#define SADB_SASTATE_MAX

/* Security Association types */
#define SADB_SATYPE_UNSPEC
#define SADB_SATYPE_AH
#define SADB_SATYPE_ESP
#define SADB_SATYPE_RSVP
#define SADB_SATYPE_OSPFV2
#define SADB_SATYPE_RIPV2
#define SADB_SATYPE_MIP
#define SADB_X_SATYPE_IPCOMP
#define SADB_SATYPE_MAX

/* Authentication algorithms */
#define SADB_AALG_NONE
#define SADB_AALG_MD5HMAC
#define SADB_AALG_SHA1HMAC
#define SADB_X_AALG_SHA2_256HMAC
#define SADB_X_AALG_SHA2_384HMAC
#define SADB_X_AALG_SHA2_512HMAC
#define SADB_X_AALG_RIPEMD160HMAC
#define SADB_X_AALG_AES_XCBC_MAC
#define SADB_X_AALG_SM3_256HMAC
#define SADB_X_AALG_NULL
#define SADB_AALG_MAX

/* Encryption algorithms */
#define SADB_EALG_NONE
#define SADB_EALG_DESCBC
#define SADB_EALG_3DESCBC
#define SADB_X_EALG_CASTCBC
#define SADB_X_EALG_BLOWFISHCBC
#define SADB_EALG_NULL
#define SADB_X_EALG_AESCBC
#define SADB_X_EALG_AESCTR
#define SADB_X_EALG_AES_CCM_ICV8
#define SADB_X_EALG_AES_CCM_ICV12
#define SADB_X_EALG_AES_CCM_ICV16
#define SADB_X_EALG_AES_GCM_ICV8
#define SADB_X_EALG_AES_GCM_ICV12
#define SADB_X_EALG_AES_GCM_ICV16
#define SADB_X_EALG_CAMELLIACBC
#define SADB_X_EALG_NULL_AES_GMAC
#define SADB_X_EALG_SM4CBC
#define SADB_EALG_MAX
/* private allocations should use 249-255 (RFC2407) */
#define SADB_X_EALG_SERPENTCBC
#define SADB_X_EALG_TWOFISHCBC

/* Compression algorithms */
#define SADB_X_CALG_NONE
#define SADB_X_CALG_OUI
#define SADB_X_CALG_DEFLATE
#define SADB_X_CALG_LZS
#define SADB_X_CALG_LZJH
#define SADB_X_CALG_MAX

/* Extension Header values */
#define SADB_EXT_RESERVED
#define SADB_EXT_SA
#define SADB_EXT_LIFETIME_CURRENT
#define SADB_EXT_LIFETIME_HARD
#define SADB_EXT_LIFETIME_SOFT
#define SADB_EXT_ADDRESS_SRC
#define SADB_EXT_ADDRESS_DST
#define SADB_EXT_ADDRESS_PROXY
#define SADB_EXT_KEY_AUTH
#define SADB_EXT_KEY_ENCRYPT
#define SADB_EXT_IDENTITY_SRC
#define SADB_EXT_IDENTITY_DST
#define SADB_EXT_SENSITIVITY
#define SADB_EXT_PROPOSAL
#define SADB_EXT_SUPPORTED_AUTH
#define SADB_EXT_SUPPORTED_ENCRYPT
#define SADB_EXT_SPIRANGE
#define SADB_X_EXT_KMPRIVATE
#define SADB_X_EXT_POLICY
#define SADB_X_EXT_SA2
/* The next four entries are for setting up NAT Traversal */
#define SADB_X_EXT_NAT_T_TYPE
#define SADB_X_EXT_NAT_T_SPORT
#define SADB_X_EXT_NAT_T_DPORT
#define SADB_X_EXT_NAT_T_OA
#define SADB_X_EXT_SEC_CTX
/* Used with MIGRATE to pass @ to IKE for negotiation */
#define SADB_X_EXT_KMADDRESS
#define SADB_X_EXT_FILTER
#define SADB_EXT_MAX

/* Identity Extension values */
#define SADB_IDENTTYPE_RESERVED
#define SADB_IDENTTYPE_PREFIX
#define SADB_IDENTTYPE_FQDN
#define SADB_IDENTTYPE_USERFQDN
#define SADB_IDENTTYPE_MAX

#endif /* !(_LINUX_PFKEY2_H) */