summaryrefslogtreecommitdiffstats
path: root/sys/netkey/key.h
diff options
context:
space:
mode:
authoritojun <itojun@FreeBSD.org>1998-02-27 11:10:18 +0000
committeritojun <itojun@FreeBSD.org>1998-02-27 11:10:18 +0000
commit674a989231d3b1520f00c5e3c17e0e389d38c3f7 (patch)
treebf9ca89426d5540732bd53ed9911acff3be6be41 /sys/netkey/key.h
parent74e335fcf267f7e61d607cd06a428f6046b70006 (diff)
downloadFreeBSD-src-674a989231d3b1520f00c5e3c17e0e389d38c3f7.zip
FreeBSD-src-674a989231d3b1520f00c5e3c17e0e389d38c3f7.tar.gz
polish the code.
use tradictional decls. tabify. remove bogus #defines. prototypes.
Diffstat (limited to 'sys/netkey/key.h')
-rw-r--r--sys/netkey/key.h189
1 files changed, 94 insertions, 95 deletions
diff --git a/sys/netkey/key.h b/sys/netkey/key.h
index 5eb9bba..ccd2fc7 100644
--- a/sys/netkey/key.h
+++ b/sys/netkey/key.h
@@ -79,42 +79,42 @@ Research Laboratory (NRL).
* PF_KEY messages
*/
-#define KEY_ADD 1
-#define KEY_DELETE 2
-#define KEY_UPDATE 3
-#define KEY_GET 4
-#define KEY_ACQUIRE 5
-#define KEY_GETSPI 6
-#define KEY_REGISTER 7
-#define KEY_EXPIRE 8
-#define KEY_DUMP 9
-#define KEY_FLUSH 10
-
-#define KEY_VERSION 1
-#define POLICY_VERSION 1
-
-#define SECURITY_TYPE_NONE 0
-
-#define KEY_TYPE_AH 1
-#define KEY_TYPE_ESP 2
-#define KEY_TYPE_RSVP 3
-#define KEY_TYPE_OSPF 4
-#define KEY_TYPE_RIPV2 5
-#define KEY_TYPE_MIPV4 6
-#define KEY_TYPE_MIPV6 7
-#define KEY_TYPE_MAX 7
+#define KEY_ADD 1
+#define KEY_DELETE 2
+#define KEY_UPDATE 3
+#define KEY_GET 4
+#define KEY_ACQUIRE 5
+#define KEY_GETSPI 6
+#define KEY_REGISTER 7
+#define KEY_EXPIRE 8
+#define KEY_DUMP 9
+#define KEY_FLUSH 10
+
+#define KEY_VERSION 1
+#define POLICY_VERSION 1
+
+#define SECURITY_TYPE_NONE 0
+
+#define KEY_TYPE_AH 1
+#define KEY_TYPE_ESP 2
+#define KEY_TYPE_RSVP 3
+#define KEY_TYPE_OSPF 4
+#define KEY_TYPE_RIPV2 5
+#define KEY_TYPE_MIPV4 6
+#define KEY_TYPE_MIPV6 7
+#define KEY_TYPE_MAX 7
/*
* Security association state
*/
-#define K_USED 0x1 /* Key used/not used */
-#define K_UNIQUE 0x2 /* Key unique/reusable */
-#define K_LARVAL 0x4 /* SPI assigned, but sa incomplete */
-#define K_ZOMBIE 0x8 /* sa expired but still useable */
-#define K_DEAD 0x10 /* sa marked for deletion, ready for reaping */
-#define K_INBOUND 0x20 /* sa for inbound packets, ie. dst=myhost */
-#define K_OUTBOUND 0x40 /* sa for outbound packets, ie. src=myhost */
+#define K_USED 0x1 /* Key used/not used */
+#define K_UNIQUE 0x2 /* Key unique/reusable */
+#define K_LARVAL 0x4 /* SPI assigned, but sa incomplete */
+#define K_ZOMBIE 0x8 /* sa expired but still useable */
+#define K_DEAD 0x10 /* sa marked for deletion, ready for reaping */
+#define K_INBOUND 0x20 /* sa for inbound packets, ie. dst=myhost */
+#define K_OUTBOUND 0x40 /* sa for outbound packets, ie. src=myhost */
#ifndef MAX_SOCKADDR_SZ
@@ -135,25 +135,25 @@ Research Laboratory (NRL).
/* Security association data for IP Security */
struct key_secassoc {
- u_int8_t len; /* Length of the data (for radix) */
- u_int8_t type; /* Type of association */
- u_int8_t vers; /* Version of association (AH/ESP) */
- u_int8_t state; /* State of the association */
- u_int8_t label; /* Sensitivity label (unused) */
- u_int32_t spi; /* SPI */
- u_int8_t keylen; /* Key length */
- u_int8_t ekeylen;/* Extra key length */
- u_int8_t ivlen; /* Initialization vector length */
- u_int8_t algorithm; /* Algorithm switch index */
- u_int8_t lifetype; /* Type of lifetime */
- caddr_t iv; /* Initialization vector */
- caddr_t key; /* Key */
- caddr_t ekey; /* Extra key */
- u_int32_t lifetime1; /* Lifetime value 1 */
- u_int32_t lifetime2; /* Lifetime value 2 */
- struct sockaddr *src; /* Source host address */
- struct sockaddr *dst; /* Destination host address */
- struct sockaddr *from; /* Originator of association */
+ u_int8_t len; /* Length of the data (for radix) */
+ u_int8_t type; /* Type of association */
+ u_int8_t vers; /* Version of association (AH/ESP) */
+ u_int8_t state; /* State of the association */
+ u_int8_t label; /* Sensitivity label (unused) */
+ u_int32_t spi; /* SPI */
+ u_int8_t keylen; /* Key length */
+ u_int8_t ekeylen; /* Extra key length */
+ u_int8_t ivlen; /* Initialization vector length */
+ u_int8_t algorithm; /* Algorithm switch index */
+ u_int8_t lifetype; /* Type of lifetime */
+ caddr_t iv; /* Initialization vector */
+ caddr_t key; /* Key */
+ caddr_t ekey; /* Extra key */
+ u_int32_t lifetime1; /* Lifetime value 1 */
+ u_int32_t lifetime2; /* Lifetime value 2 */
+ struct sockaddr *src; /* Source host address */
+ struct sockaddr *dst; /* Destination host address */
+ struct sockaddr *from; /* Originator of association */
int antireplay; /*anti replay flag*/
u_int32_t sequence; /*send: sequence number*/
@@ -168,48 +168,48 @@ struct key_secassoc {
*/
struct key_msghdr {
- u_short key_msglen; /* length of message including
+ u_short key_msglen; /* length of message including
* src/dst/from/key/iv */
- u_char key_msgvers; /* key version number */
- u_char key_msgtype; /* key message type, eg. KEY_ADD */
- pid_t key_pid;/* process id of message sender */
- int key_seq;/* message sequence number */
- int key_errno; /* error code */
- u_int8_t type; /* type of security association */
- u_int8_t vers; /* version of security association (AH/ESP) */
- u_int8_t state; /* state of security association */
- u_int8_t label; /* sensitivity level */
- u_int8_t pad; /* padding for allignment */
- u_int32_t spi; /* spi value */
- u_int8_t keylen; /* key length */
- u_int8_t ekeylen;/* extra key length */
- u_int8_t ivlen; /* iv length */
- u_int8_t algorithm; /* algorithm identifier */
- u_int8_t lifetype; /* type of lifetime */
- u_int32_t lifetime1; /* lifetime value 1 */
- u_int32_t lifetime2; /* lifetime value 2 */
+ u_char key_msgvers; /* key version number */
+ u_char key_msgtype; /* key message type, eg. KEY_ADD */
+ pid_t key_pid; /* process id of message sender */
+ int key_seq; /* message sequence number */
+ int key_errno; /* error code */
+ u_int8_t type; /* type of security association */
+ u_int8_t vers; /* version of sassoc (AH/ESP) */
+ u_int8_t state; /* state of security association */
+ u_int8_t label; /* sensitivity level */
+ u_int8_t pad; /* padding for allignment */
+ u_int32_t spi; /* spi value */
+ u_int8_t keylen; /* key length */
+ u_int8_t ekeylen; /* extra key length */
+ u_int8_t ivlen; /* iv length */
+ u_int8_t algorithm; /* algorithm identifier */
+ u_int8_t lifetype; /* type of lifetime */
+ u_int32_t lifetime1; /* lifetime value 1 */
+ u_int32_t lifetime2; /* lifetime value 2 */
int antireplay; /* anti replay flag */
};
struct key_msgdata {
- struct sockaddr *src; /* source host address */
- struct sockaddr *dst; /* destination host address */
- struct sockaddr *from; /* originator of security association */
- caddr_t iv; /* initialization vector */
- caddr_t key; /* key */
- caddr_t ekey; /* extra key */
- int ivlen; /* key length */
- int keylen; /* iv length */
- int ekeylen; /* extra key length */
+ struct sockaddr *src; /* source host address */
+ struct sockaddr *dst; /* destination host address */
+ struct sockaddr *from; /* originator of security association */
+ caddr_t iv; /* initialization vector */
+ caddr_t key; /* key */
+ caddr_t ekey; /* extra key */
+ int ivlen; /* key length */
+ int keylen; /* iv length */
+ int ekeylen; /* extra key length */
};
struct policy_msghdr {
- u_short policy_msglen; /* message length */
- u_char policy_msgvers; /* message version */
- u_char policy_msgtype; /* message type */
- int policy_seq; /* message sequence number */
- int policy_errno; /* error code */
+ u_short policy_msglen; /* message length */
+ u_char policy_msgvers; /* message version */
+ u_char policy_msgtype; /* message type */
+ int policy_seq; /* message sequence number */
+ int policy_errno; /* error code */
};
/*
@@ -217,14 +217,14 @@ struct policy_msghdr {
*/
struct socketlist {
- struct socket *socket; /* pointer to socket */
- struct socketlist *next;/* next */
+ struct socket *socket; /* pointer to socket */
+ struct socketlist *next; /* next */
};
struct key_tblnode {
- int alloc_count; /* number of sockets allocated to
+ int alloc_count; /* number of sockets allocated to
* secassoc */
- int ref_count; /* number of sockets referencing
+ int ref_count; /* number of sockets referencing
* secassoc */
struct socketlist *solist; /* list of sockets allocated to
* secassoc */
@@ -238,7 +238,7 @@ struct key_allocnode {
};
struct key_so2spinode {
- struct socket *socket; /* socket pointer */
+ struct socket *socket; /* socket pointer */
struct key_tblnode *keynode; /* pointer to tblnode containing
* secassoc */
/* info for socket */
@@ -246,18 +246,17 @@ struct key_so2spinode {
};
struct key_registry {
- u_int8_t type; /* secassoc type that key mgnt. daemon can
+ u_int8_t type; /* secassoc type that key mgnt. daemon can
* acquire */
- struct socket *socket; /* key management daemon socket pointer */
+ struct socket *socket; /* key management daemon socket pointer */
struct key_registry *next;
};
struct key_acquirelist {
- u_int8_t type; /* secassoc type to acquire */
- struct sockaddr *target;/* destination address of secassoc */
- u_int32_t count; /* number of acquire messages sent */
- u_long expiretime; /* expiration time for acquire
- * message */
+ u_int8_t type; /* secassoc type to acquire */
+ struct sockaddr *target; /* destination address of secassoc */
+ u_int32_t count; /* number of acquire messages sent */
+ u_long expiretime; /* expiration time for acquire message */
struct key_acquirelist *next;
};
OpenPOWER on IntegriCloud