Changeset View
Changeset View
Standalone View
Standalone View
head/sys/netipsec/keydb.h
Show All 29 Lines | |||||
* SUCH DAMAGE. | * SUCH DAMAGE. | ||||
*/ | */ | ||||
#ifndef _NETIPSEC_KEYDB_H_ | #ifndef _NETIPSEC_KEYDB_H_ | ||||
#define _NETIPSEC_KEYDB_H_ | #define _NETIPSEC_KEYDB_H_ | ||||
#ifdef _KERNEL | #ifdef _KERNEL | ||||
#include <sys/mutex.h> | |||||
#include <netipsec/key_var.h> | #include <netipsec/key_var.h> | ||||
#ifndef _SOCKADDR_UNION_DEFINED | #ifndef _SOCKADDR_UNION_DEFINED | ||||
#define _SOCKADDR_UNION_DEFINED | #define _SOCKADDR_UNION_DEFINED | ||||
/* | /* | ||||
* The union of all possible address formats we handle. | * The union of all possible address formats we handle. | ||||
*/ | */ | ||||
union sockaddr_union { | union sockaddr_union { | ||||
▲ Show 20 Lines • Show All 119 Lines • ▼ Show 20 Lines | |||||
#define SECASVAR_LOCK_ASSERT(_sav) mtx_assert(&(_sav)->lock, MA_OWNED) | #define SECASVAR_LOCK_ASSERT(_sav) mtx_assert(&(_sav)->lock, MA_OWNED) | ||||
#define SAV_ISGCM(_sav) \ | #define SAV_ISGCM(_sav) \ | ||||
((_sav)->alg_enc == SADB_X_EALG_AESGCM8 || \ | ((_sav)->alg_enc == SADB_X_EALG_AESGCM8 || \ | ||||
(_sav)->alg_enc == SADB_X_EALG_AESGCM12 || \ | (_sav)->alg_enc == SADB_X_EALG_AESGCM12 || \ | ||||
(_sav)->alg_enc == SADB_X_EALG_AESGCM16) | (_sav)->alg_enc == SADB_X_EALG_AESGCM16) | ||||
#define SAV_ISCTR(_sav) ((_sav)->alg_enc == SADB_X_EALG_AESCTR) | #define SAV_ISCTR(_sav) ((_sav)->alg_enc == SADB_X_EALG_AESCTR) | ||||
#define SAV_ISCTRORGCM(_sav) (SAV_ISCTR((_sav)) || SAV_ISGCM((_sav))) | #define SAV_ISCTRORGCM(_sav) (SAV_ISCTR((_sav)) || SAV_ISGCM((_sav))) | ||||
/* replay prevention */ | /* Replay prevention, protected by SECASVAR_LOCK: | ||||
* (m) locked by mtx | |||||
* (c) read only except during creation / free | |||||
*/ | |||||
struct secreplay { | struct secreplay { | ||||
u_int32_t count; | u_int32_t count; /* (m) */ | ||||
u_int wsize; /* window size, i.g. 4 bytes */ | u_int wsize; /* (c) window size, i.g. 4 bytes */ | ||||
u_int32_t seq; /* used by sender */ | u_int32_t seq; /* (m) used by sender */ | ||||
u_int32_t lastseq; /* used by receiver */ | u_int32_t lastseq; /* (m) used by receiver */ | ||||
caddr_t bitmap; /* used by receiver */ | u_int32_t *bitmap; /* (m) used by receiver */ | ||||
int overflow; /* overflow flag */ | u_int bitmap_size; /* (c) size of the bitmap array */ | ||||
int overflow; /* (m) overflow flag */ | |||||
}; | }; | ||||
/* socket table due to send PF_KEY messages. */ | /* socket table due to send PF_KEY messages. */ | ||||
struct secreg { | struct secreg { | ||||
LIST_ENTRY(secreg) chain; | LIST_ENTRY(secreg) chain; | ||||
struct socket *so; | struct socket *so; | ||||
}; | }; | ||||
Show All 37 Lines |