#include <netinet6/ipsec.h>

netinet6/ipsec.h Kernel.framework

$FreeBSD: src/sys/netinet6/ipsec.h,v 1.4.2.2 2001/07/03 11:01:54 ume Exp $
includes: sys/cdefs.h, sys/appleapiopts.h, Kernel/net/pfkeyv2.h, uuid/uuid.h
26 macros · 3 structs

macroIPSEC_PORT_ANY

according to IANA assignment, port 0x0000 and proto 0xff are reserved.
#define IPSEC_PORT_ANY 0

macroIPSEC_ULPROTO_ANY

#define IPSEC_ULPROTO_ANY 255

macroIPSEC_PROTO_ANY

#define IPSEC_PROTO_ANY 255

macroIPSEC_MODE_ANY

mode of security protocol NOTE: DON'T use IPSEC_MODE_ANY at SPD. It's only use in SAD
#define IPSEC_MODE_ANY 0
i.e. wildcard.

macroIPSEC_MODE_TRANSPORT

#define IPSEC_MODE_TRANSPORT 1

macroIPSEC_MODE_TUNNEL

#define IPSEC_MODE_TUNNEL 2

macroIPSEC_DIR_ANY

Direction of security policy. NOTE: Since INVALID is used just as flag. The other are used for loop counter too.
#define IPSEC_DIR_ANY 0

macroIPSEC_DIR_INBOUND

#define IPSEC_DIR_INBOUND 1

macroIPSEC_DIR_OUTBOUND

#define IPSEC_DIR_OUTBOUND 2

macroIPSEC_DIR_MAX

#define IPSEC_DIR_MAX 3

macroIPSEC_DIR_INVALID

#define IPSEC_DIR_INVALID 4

macroIPSEC_POLICY_DISCARD

Policy level IPSEC, ENTRUST and BYPASS are allowed for setsockopt() in PCB, DISCARD, IPSEC and NONE are allowed for setkey() in SPD. DISCARD and NONE are allowed for system default.
#define IPSEC_POLICY_DISCARD 0
discarding packet

macroIPSEC_POLICY_NONE

#define IPSEC_POLICY_NONE 1
through IPsec engine

macroIPSEC_POLICY_IPSEC

#define IPSEC_POLICY_IPSEC 2
do IPsec

macroIPSEC_POLICY_ENTRUST

#define IPSEC_POLICY_ENTRUST 3
consulting SPD if present.

macroIPSEC_POLICY_BYPASS

#define IPSEC_POLICY_BYPASS 4
only for privileged socket.

macroIPSEC_POLICY_GENERATE

#define IPSEC_POLICY_GENERATE 5
same as discard - IKE daemon can override with generated policy

macroIPSEC_LEVEL_DEFAULT

Security protocol level
#define IPSEC_LEVEL_DEFAULT 0
reference to system default

macroIPSEC_LEVEL_USE

#define IPSEC_LEVEL_USE 1
use SA if present.

macroIPSEC_LEVEL_REQUIRE

#define IPSEC_LEVEL_REQUIRE 2
require SA.

macroIPSEC_LEVEL_UNIQUE

#define IPSEC_LEVEL_UNIQUE 3
unique SA.

macroIPSEC_MANUAL_REQID_MAX

#define IPSEC_MANUAL_REQID_MAX 0x3fff

macroIPSEC_REPLAYWSIZE

if security policy level == unique, this id indicate to a relative SA for use, else is zero. 1 - 0x3fff are reserved for manual keying. 0 are reserved for above reason. Others is for kernel use. Note that this id doesn't identify SA by only itself.
#define IPSEC_REPLAYWSIZE 32

macroIPSEC_KEY_AUTH_MAX_BYTES

Maximum key sizes in bytes expected to be passed from userspace. These values are based on the NULL algorithms for AH and ESP, which both specify a keymax of 2048 bits.
#define IPSEC_KEY_AUTH_MAX_BYTES 256

macroIPSEC_KEY_ENCRYPT_MAX_BYTES

#define IPSEC_KEY_ENCRYPT_MAX_BYTES 256

structipsecstat

statistics for ipsec processing
size 12432, align 8
u_quad_tin_successsucceeded inbound process
u_quad_tin_polvio
u_quad_tin_nosasecurity policy violation for inbound process inbound SA is unavailable
u_quad_tin_invalinbound processing failed due to EINVAL
u_quad_tin_nomeminbound processing failed due to ENOBUFS
u_quad_tin_badspifailed getting a SPI
u_quad_tin_ahreplayAH replay check failed
u_quad_tin_espreplayESP replay check failed
u_quad_tin_ahauthsuccAH authentication success
u_quad_tin_ahauthfailAH authentication failure
u_quad_tin_espauthsuccESP authentication success
u_quad_tin_espauthfailESP authentication failure
u_quad_t[256]in_esphist
u_quad_t[256]in_ahhist
u_quad_t[256]in_comphist
u_quad_tout_successsucceeded outbound process
u_quad_tout_polvio
u_quad_tout_nosasecurity policy violation for outbound process outbound SA is unavailable
u_quad_tout_invaloutbound process failed due to EINVAL
u_quad_tout_nomemoutbound processing failed due to ENOBUFS
u_quad_tout_noroutethere is no route
u_quad_t[256]out_esphist
u_quad_t[256]out_ahhist
u_quad_t[256]out_comphist

macroIPSEC_MAX_WAKE_PKT_LEN

#define IPSEC_MAX_WAKE_PKT_LEN 100

structipsec_wake_pkt_info

size 152, align 4
u_int8_t[100]wake_pkt
uuid_string_twake_uuid
u_int32_twake_pkt_spi
u_int32_twake_pkt_seq
u_int16_twake_pkt_len

structipsec_wake_pkt_event_data

size 37, align 1
uuid_string_twake_uuid