summaryrefslogtreecommitdiff
path: root/sys/netinet/ip_esp.h
diff options
context:
space:
mode:
authorNiels Provos <provos@cvs.openbsd.org>1997-06-20 05:41:55 +0000
committerNiels Provos <provos@cvs.openbsd.org>1997-06-20 05:41:55 +0000
commit69c2d5fb5fc72cc18a1a9189104185905b030d12 (patch)
tree8530ff06b232f133f498a1e9076dd4dfcbda1adc /sys/netinet/ip_esp.h
parent5cd04de4e1940c991fd244786e178fb6822b276c (diff)
ah-sha1 + esp-3des + indentation
Diffstat (limited to 'sys/netinet/ip_esp.h')
-rw-r--r--sys/netinet/ip_esp.h170
1 files changed, 96 insertions, 74 deletions
diff --git a/sys/netinet/ip_esp.h b/sys/netinet/ip_esp.h
index 62cd435a62a..10a5b7d3aff 100644
--- a/sys/netinet/ip_esp.h
+++ b/sys/netinet/ip_esp.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_esp.h,v 1.5 1997/03/30 22:05:13 mickey Exp $ */
+/* $OpenBSD: ip_esp.h,v 1.6 1997/06/20 05:41:50 provos Exp $ */
/*
* The author of this code is John Ioannidis, ji@tla.org,
@@ -66,64 +66,85 @@
struct esp
{
- u_int32_t esp_spi; /* Security Parameters Index */
- u_int8_t esp_iv[8]; /* iv[4] may actually be data! */
+ u_int32_t esp_spi; /* Security Parameters Index */
+ u_int8_t esp_iv[8]; /* iv[4] may actually be data! */
};
struct espstat
{
- u_long esps_hdrops; /* packet shorter than header shows */
- u_long esps_notdb;
- u_long esps_badkcr;
- u_long esps_qfull;
- u_long esps_noxform;
- u_long esps_badilen;
- u_long esps_wrap; /* Replay counter wrapped around */
- u_long esps_badauth; /* Only valid for transforms with auth */
- u_long esps_replay; /* Possible packet replay detected */
- u_long esps_input; /* Input ESP packets */
- u_long esps_output; /* Output ESP packets */
+ u_long esps_hdrops; /* packet shorter than header shows */
+ u_long esps_notdb;
+ u_long esps_badkcr;
+ u_long esps_qfull;
+ u_long esps_noxform;
+ u_long esps_badilen;
+ u_long esps_wrap; /* Replay counter wrapped around */
+ u_long esps_badauth; /* Only valid for transforms with auth */
+ u_long esps_replay; /* Possible packet replay detected */
+ u_long esps_input; /* Input ESP packets */
+ u_long esps_output; /* Output ESP packets */
};
struct espdes_xdata
{
- int32_t edx_ivlen; /* 4 or 8 */
- union
- {
- u_int8_t Iv[8]; /* that's enough space */
- u_int32_t Ivl; /* make sure this is 4 bytes */
- u_int64_t Ivq; /* make sure this is 8 bytes! */
- }Iu;
+ int32_t edx_ivlen; /* 4 or 8 */
+ union
+ {
+ u_int8_t Iv[8]; /* that's enough space */
+ u_int32_t Ivl; /* make sure this is 4 bytes */
+ u_int64_t Ivq; /* make sure this is 8 bytes! */
+ }Iu;
#define edx_iv Iu.Iv
#define edx_ivl Iu.Ivl
#define edx_ivq Iu.Ivq
- union
- {
- u_int8_t Rk[8];
- u_int32_t Eks[16][2];
- }Xu;
+ union
+ {
+ u_int8_t Rk[8];
+ u_int32_t Eks[16][2];
+ }Xu;
+#define edx_rk Xu.Rk
+#define edx_eks Xu.Eks
+};
+
+struct esp3des_xdata
+{
+ int32_t edx_ivlen; /* 4 or 8 */
+ union
+ {
+ u_int8_t Iv[8]; /* that's enough space */
+ u_int32_t Ivl; /* make sure this is 4 bytes */
+ u_int64_t Ivq; /* make sure this is 8 bytes! */
+ }Iu;
+#define edx_iv Iu.Iv
+#define edx_ivl Iu.Ivl
+#define edx_ivq Iu.Ivq
+ union
+ {
+ u_int8_t Rk[3][8];
+ u_int32_t Eks[3][16][2];
+ }Xu;
#define edx_rk Xu.Rk
#define edx_eks Xu.Eks
};
struct esp3desmd5_xencap
{
- int8_t edx_ivlen; /* 0 or 8 */
- int8_t edx_initiator; /* 1 if setting an I key */
- u_int16_t edx_keylen;
- u_int32_t edx_wnd;
- u_int8_t edx_ivv[ESP3DESMD5_IVS];
- u_int8_t edx_key[ESP3DESMD5_KEYSZ];
+ int8_t edx_ivlen; /* 0 or 8 */
+ int8_t edx_initiator; /* 1 if setting an I key */
+ u_int16_t edx_keylen;
+ u_int32_t edx_wnd;
+ u_int8_t edx_ivv[ESP3DESMD5_IVS];
+ u_int8_t edx_key[ESP3DESMD5_KEYSZ];
};
struct espdesmd5_xencap
{
- int8_t edx_ivlen; /* 0 or 8 */
- int8_t edx_initiator; /* 1 if setting an I key */
- u_int16_t edx_keylen;
- u_int32_t edx_wnd;
- u_int8_t edx_ivv[ESPDESMD5_IVS];
- u_int8_t edx_key[ESPDESMD5_KEYSZ];
+ int8_t edx_ivlen; /* 0 or 8 */
+ int8_t edx_initiator; /* 1 if setting an I key */
+ u_int16_t edx_keylen;
+ u_int32_t edx_wnd;
+ u_int8_t edx_ivv[ESPDESMD5_IVS];
+ u_int8_t edx_key[ESPDESMD5_KEYSZ];
};
#define ESPDESMD5_ULENGTH 8+ESPDESMD5_IVS+ESPDESMD5_KEYSZ
@@ -131,46 +152,46 @@ struct espdesmd5_xencap
struct espdesmd5_xdata
{
- int32_t edx_ivlen; /* 0 or 8 */
- u_int32_t edx_rpl; /* Replay counter */
- u_int32_t edx_wnd; /* Replay window */
- u_int32_t edx_bitmap;
- u_int32_t edx_initial; /* initial replay value */
- union
- {
- u_int8_t Iv[8]; /* that's enough space */
- u_int32_t Ivl; /* make sure this is 4 bytes */
- u_int64_t Ivq; /* make sure this is 8 bytes! */
- }Iu;
- union
- {
- u_int8_t Rk[8];
- u_int32_t Eks[16][2];
- }Xu;
- MD5_CTX edx_ictx;
- MD5_CTX edx_octx;
+ int32_t edx_ivlen; /* 0 or 8 */
+ u_int32_t edx_rpl; /* Replay counter */
+ u_int32_t edx_wnd; /* Replay window */
+ u_int32_t edx_bitmap;
+ u_int32_t edx_initial; /* initial replay value */
+ union
+ {
+ u_int8_t Iv[8]; /* that's enough space */
+ u_int32_t Ivl; /* make sure this is 4 bytes */
+ u_int64_t Ivq; /* make sure this is 8 bytes! */
+ }Iu;
+ union
+ {
+ u_int8_t Rk[8];
+ u_int32_t Eks[16][2];
+ }Xu;
+ MD5_CTX edx_ictx;
+ MD5_CTX edx_octx;
};
struct esp3desmd5_xdata
{
- int32_t edx_ivlen; /* 0 or 4 or 8 */
- u_int32_t edx_rpl; /* Replay counter */
- u_int32_t edx_wnd; /* Replay window */
- u_int32_t edx_bitmap;
- u_int32_t edx_initial;
- union
- {
- u_int8_t Iv[8]; /* that's enough space */
- u_int32_t Ivl; /* make sure this is 4 bytes */
- u_int64_t Ivq; /* make sure this is 8 bytes! */
- }Iu;
- union
- {
- u_int8_t Rk[3][8];
- u_int32_t Eks[3][16][2];
- }Xu;
- MD5_CTX edx_ictx;
- MD5_CTX edx_octx;
+ int32_t edx_ivlen; /* 0 or 4 or 8 */
+ u_int32_t edx_rpl; /* Replay counter */
+ u_int32_t edx_wnd; /* Replay window */
+ u_int32_t edx_bitmap;
+ u_int32_t edx_initial;
+ union
+ {
+ u_int8_t Iv[8]; /* that's enough space */
+ u_int32_t Ivl; /* make sure this is 4 bytes */
+ u_int64_t Ivq; /* make sure this is 8 bytes! */
+ }Iu;
+ union
+ {
+ u_int8_t Rk[3][8];
+ u_int32_t Eks[3][16][2];
+ }Xu;
+ MD5_CTX edx_ictx;
+ MD5_CTX edx_octx;
};
#define ESP_FLENGTH 12
@@ -181,3 +202,4 @@ struct esp3desmd5_xdata
struct espstat espstat;
#endif
+