diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1999-07-02 23:37:34 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1999-07-02 23:37:34 +0000 |
commit | 70a5b5460e0c9e4c7030d1721e5e1ecb1ac6074c (patch) | |
tree | 9988541ac915a5d5939eab373e16688dbdfaed4e /sys/net | |
parent | ec64bf136949bf631bab5f5c707b24bde0914530 (diff) |
rename SADB_foo_X_bar to SADB_X_foo_bar
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/pfkeyv2.c | 72 | ||||
-rw-r--r-- | sys/net/pfkeyv2.h | 46 | ||||
-rw-r--r-- | sys/net/pfkeyv2_parsemessage.c | 36 |
3 files changed, 77 insertions, 77 deletions
diff --git a/sys/net/pfkeyv2.c b/sys/net/pfkeyv2.c index f38c06d9ce4..f9aed42b41c 100644 --- a/sys/net/pfkeyv2.c +++ b/sys/net/pfkeyv2.c @@ -69,15 +69,15 @@ static int npromisc = 0; static struct sadb_alg ealgs[] = { { SADB_EALG_DESCBC, 64, 64, 64 }, { SADB_EALG_3DESCBC, 64, 192, 192 }, - { SADB_EALG_X_BLF, 64, 5, BLF_MAXKEYLEN}, - { SADB_EALG_X_CAST, 64, 5, 16}, - { SADB_EALG_X_SKIPJACK, 64, 10, 10}, + { SADB_X_EALG_BLF, 64, 5, BLF_MAXKEYLEN}, + { SADB_X_EALG_CAST, 64, 5, 16}, + { SADB_X_EALG_SKIPJACK, 64, 10, 10}, }; static struct sadb_alg aalgs[] = { { SADB_AALG_SHA1HMAC96, 0, 160, 160 }, { SADB_AALG_MD5HMAC96, 0, 128, 128 }, -{ SADB_AALG_X_RIPEMD160HMAC96, 0, 160, 160 } +{ SADB_X_AALG_RIPEMD160HMAC96, 0, 160, 160 } }; extern int pfkey_register(struct pfkey_version *version); @@ -177,10 +177,10 @@ import_sa(struct tdb *tdb, struct sadb_sa *sadb_sa, struct ipsecinit *ii) if (sadb_sa->sadb_sa_flags & SADB_SAFLAGS_PFS) tdb->tdb_flags |= TDBF_PFS; - if (sadb_sa->sadb_sa_flags & SADB_SAFLAGS_X_HALFIV) + if (sadb_sa->sadb_sa_flags & SADB_X_SAFLAGS_HALFIV) tdb->tdb_flags |= TDBF_HALFIV; - if (sadb_sa->sadb_sa_flags & SADB_SAFLAGS_X_TUNNEL) + if (sadb_sa->sadb_sa_flags & SADB_X_SAFLAGS_TUNNEL) tdb->tdb_flags |= TDBF_TUNNELING; } @@ -211,10 +211,10 @@ export_sa(void **p, struct tdb *tdb) sadb_sa->sadb_sa_flags |= SADB_SAFLAGS_PFS; if (tdb->tdb_flags & TDBF_HALFIV) - sadb_sa->sadb_sa_flags |= SADB_SAFLAGS_X_HALFIV; + sadb_sa->sadb_sa_flags |= SADB_X_SAFLAGS_HALFIV; if (tdb->tdb_flags & TDBF_TUNNELING) - sadb_sa->sadb_sa_flags |= SADB_SAFLAGS_X_TUNNEL; + sadb_sa->sadb_sa_flags |= SADB_X_SAFLAGS_TUNNEL; *p += sizeof(struct sadb_sa); } @@ -754,7 +754,7 @@ pfkeyv2_send(struct socket *socket, void *message, int len) sa.tdb_sproto = IPPROTO_ESP; break; - case SADB_SATYPE_X_AH_OLD: + case SADB_X_SATYPE_AH_OLD: if (!ah_enable) { rval = EOPNOTSUPP; goto ret; @@ -762,7 +762,7 @@ pfkeyv2_send(struct socket *socket, void *message, int len) sa.tdb_sproto = IPPROTO_AH; break; - case SADB_SATYPE_X_ESP_OLD: + case SADB_X_SATYPE_ESP_OLD: if (!esp_enable) { rval = EOPNOTSUPP; goto ret; @@ -770,7 +770,7 @@ pfkeyv2_send(struct socket *socket, void *message, int len) sa.tdb_sproto = IPPROTO_ESP; break; - case SADB_SATYPE_X_IPIP: + case SADB_X_SATYPE_IPIP: sa.tdb_sproto = IPPROTO_IPIP; break; @@ -839,7 +839,7 @@ pfkeyv2_send(struct socket *socket, void *message, int len) alg = XF_NEW_ESP; break; - case SADB_SATYPE_X_AH_OLD: + case SADB_X_SATYPE_AH_OLD: if (!ah_enable) { rval = EOPNOTSUPP; goto splxret; @@ -848,7 +848,7 @@ pfkeyv2_send(struct socket *socket, void *message, int len) alg = XF_OLD_AH; break; - case SADB_SATYPE_X_ESP_OLD: + case SADB_X_SATYPE_ESP_OLD: if (!esp_enable) { rval = EOPNOTSUPP; goto splxret; @@ -857,7 +857,7 @@ pfkeyv2_send(struct socket *socket, void *message, int len) alg = XF_OLD_ESP; break; - case SADB_SATYPE_X_IPIP: + case SADB_X_SATYPE_IPIP: newsa->tdb_sproto = IPPROTO_IPIP; alg = XF_IP4; break; @@ -965,7 +965,7 @@ pfkeyv2_send(struct socket *socket, void *message, int len) alg = XF_NEW_ESP; break; - case SADB_SATYPE_X_AH_OLD: + case SADB_X_SATYPE_AH_OLD: if (!ah_enable) { rval = EOPNOTSUPP; goto splxret; @@ -974,7 +974,7 @@ pfkeyv2_send(struct socket *socket, void *message, int len) alg = XF_OLD_AH; break; - case SADB_SATYPE_X_ESP_OLD: + case SADB_X_SATYPE_ESP_OLD: if (!esp_enable) { rval = EOPNOTSUPP; goto splxret; @@ -983,7 +983,7 @@ pfkeyv2_send(struct socket *socket, void *message, int len) alg = XF_OLD_ESP; break; - case SADB_SATYPE_X_IPIP: + case SADB_X_SATYPE_IPIP: newsa->tdb_sproto = IPPROTO_IPIP; alg = XF_IP4; break; @@ -1037,7 +1037,7 @@ pfkeyv2_send(struct socket *socket, void *message, int len) goto splxret; } - tdb_delete(sa2, ((struct sadb_sa *)headers[SADB_EXT_SA])->sadb_sa_flags & SADB_SAFLAGS_X_CHAINDEL, TDBEXP_TIMEOUT); + tdb_delete(sa2, ((struct sadb_sa *)headers[SADB_EXT_SA])->sadb_sa_flags & SADB_X_SAFLAGS_CHAINDEL, TDBEXP_TIMEOUT); splx(s); sa2 = NULL; break; @@ -1135,11 +1135,11 @@ pfkeyv2_send(struct socket *socket, void *message, int len) struct rtentry *rt; /* - * SADB_SAFLAGS_X_REPLACEFLOW set means we should remove any + * SADB_X_SAFLAGS_REPLACEFLOW set means we should remove any * potentially conflicting flow while we are adding this new one. */ replace = ((struct sadb_sa *)headers[SADB_EXT_SA])->sadb_sa_flags & - SADB_SAFLAGS_X_REPLACEFLOW; + SADB_X_SAFLAGS_REPLACEFLOW; if (replace && delflag) { rval = EINVAL; goto ret; @@ -1157,20 +1157,20 @@ pfkeyv2_send(struct socket *socket, void *message, int len) } local = ((struct sadb_sa *)headers[SADB_EXT_SA])->sadb_sa_flags & - SADB_SAFLAGS_X_LOCALFLOW; + SADB_X_SAFLAGS_LOCALFLOW; bzero(&encapdst, sizeof(struct sockaddr_encap)); bzero(&encapnetmask, sizeof(struct sockaddr_encap)); bzero(&encapgw, sizeof(struct sockaddr_encap)); bzero(&alts, sizeof(alts)); bzero(&altm, sizeof(altm)); - src = (union sockaddr_union *) (headers[SADB_EXT_X_SRC_FLOW] + sizeof(struct sadb_address)); - dst = (union sockaddr_union *) (headers[SADB_EXT_X_DST_FLOW] + sizeof(struct sadb_address)); - srcmask = (union sockaddr_union *) (headers[SADB_EXT_X_SRC_MASK] + sizeof(struct sadb_address)); - dstmask = (union sockaddr_union *) (headers[SADB_EXT_X_DST_MASK] + sizeof(struct sadb_address)); + src = (union sockaddr_union *) (headers[SADB_X_EXT_SRC_FLOW] + sizeof(struct sadb_address)); + dst = (union sockaddr_union *) (headers[SADB_X_EXT_DST_FLOW] + sizeof(struct sadb_address)); + srcmask = (union sockaddr_union *) (headers[SADB_X_EXT_SRC_MASK] + sizeof(struct sadb_address)); + dstmask = (union sockaddr_union *) (headers[SADB_X_EXT_DST_MASK] + sizeof(struct sadb_address)); - if (headers[SADB_EXT_X_PROTOCOL]) - sproto = ((struct sadb_protocol *) headers[SADB_EXT_X_PROTOCOL])->sadb_protocol_proto; + if (headers[SADB_X_EXT_PROTOCOL]) + sproto = ((struct sadb_protocol *) headers[SADB_X_EXT_PROTOCOL])->sadb_protocol_proto; else sproto = 0; @@ -1458,10 +1458,10 @@ pfkeyv2_send(struct socket *socket, void *message, int len) goto splxret; } - tdb2 = gettdb(((struct sadb_sa *)headers[SADB_EXT_X_SA2])->sadb_sa_spi, - (union sockaddr_union *)(headers[SADB_EXT_X_DST2] + + tdb2 = gettdb(((struct sadb_sa *)headers[SADB_X_EXT_SA2])->sadb_sa_spi, + (union sockaddr_union *)(headers[SADB_X_EXT_DST2] + sizeof(struct sadb_address)), - SADB_GETSPROTO(((struct sadb_protocol *)headers[SADB_EXT_X_PROTOCOL])->sadb_protocol_proto)); + SADB_GETSPROTO(((struct sadb_protocol *)headers[SADB_X_EXT_PROTOCOL])->sadb_protocol_proto)); if (tdb2 == NULL) { rval = ESRCH; @@ -1512,10 +1512,10 @@ pfkeyv2_send(struct socket *socket, void *message, int len) goto splxret; } - tdb2 = gettdb(((struct sadb_sa *)headers[SADB_EXT_X_SA2])->sadb_sa_spi, - (union sockaddr_union *)(headers[SADB_EXT_X_DST2] + + tdb2 = gettdb(((struct sadb_sa *)headers[SADB_X_EXT_SA2])->sadb_sa_spi, + (union sockaddr_union *)(headers[SADB_X_EXT_DST2] + sizeof(struct sadb_address)), - SADB_GETSPROTO(((struct sadb_protocol *)headers[SADB_EXT_X_PROTOCOL])->sadb_protocol_proto)); + SADB_GETSPROTO(((struct sadb_protocol *)headers[SADB_X_EXT_PROTOCOL])->sadb_protocol_proto)); if (tdb2 == NULL) { rval = ESRCH; @@ -1749,13 +1749,13 @@ pfkeyv2_expire(struct tdb *sa, u_int16_t type) switch (sa->tdb_sproto) { case IPPROTO_AH: - satype = sa->tdb_xform->xf_type == XF_OLD_AH ? SADB_SATYPE_X_AH_OLD : SADB_SATYPE_AH; + satype = sa->tdb_xform->xf_type == XF_OLD_AH ? SADB_X_SATYPE_AH_OLD : SADB_SATYPE_AH; break; case IPPROTO_ESP: - satype = sa->tdb_xform->xf_type == XF_OLD_ESP ? SADB_SATYPE_X_ESP_OLD : SADB_SATYPE_ESP; + satype = sa->tdb_xform->xf_type == XF_OLD_ESP ? SADB_X_SATYPE_ESP_OLD : SADB_SATYPE_ESP; break; case IPPROTO_IPIP: - satype = SADB_SATYPE_X_IPIP; + satype = SADB_X_SATYPE_IPIP; break; default: rval = EOPNOTSUPP; diff --git a/sys/net/pfkeyv2.h b/sys/net/pfkeyv2.h index 3e0a1242db8..36f22763df6 100644 --- a/sys/net/pfkeyv2.h +++ b/sys/net/pfkeyv2.h @@ -160,9 +160,9 @@ struct sadb_protocol { }; #define SADB_GETSPROTO(x) ( (x) == SADB_SATYPE_AH ? IPPROTO_AH :\ - (x) == SADB_SATYPE_X_AH_OLD ? IPPROTO_AH :\ + (x) == SADB_X_SATYPE_AH_OLD ? IPPROTO_AH :\ (x) == SADB_SATYPE_ESP ? IPPROTO_ESP :\ - (x) == SADB_SATYPE_X_ESP_OLD ? IPPROTO_ESP :\ + (x) == SADB_X_SATYPE_ESP_OLD ? IPPROTO_ESP :\ IPPROTO_IPIP ) #define SADB_EXT_RESERVED 0 @@ -181,13 +181,13 @@ struct sadb_protocol { #define SADB_EXT_PROPOSAL 13 #define SADB_EXT_SUPPORTED 14 #define SADB_EXT_SPIRANGE 15 -#define SADB_EXT_X_SRC_MASK 16 -#define SADB_EXT_X_DST_MASK 17 -#define SADB_EXT_X_PROTOCOL 18 -#define SADB_EXT_X_SA2 19 -#define SADB_EXT_X_SRC_FLOW 20 -#define SADB_EXT_X_DST_FLOW 21 -#define SADB_EXT_X_DST2 22 +#define SADB_X_EXT_SRC_MASK 16 +#define SADB_X_EXT_DST_MASK 17 +#define SADB_X_EXT_PROTOCOL 18 +#define SADB_X_EXT_SA2 19 +#define SADB_X_EXT_SRC_FLOW 20 +#define SADB_X_EXT_DST_FLOW 21 +#define SADB_X_EXT_DST2 22 #define SADB_EXT_MAX 22 /* Fix pfkeyv2.c struct pfkeyv2_socket if SATYPE_MAX > 31 */ @@ -198,9 +198,9 @@ struct sadb_protocol { #define SADB_SATYPE_OSPFV2 4 #define SADB_SATYPE_RIPV2 5 #define SADB_SATYPE_MIP 6 -#define SADB_SATYPE_X_AH_OLD 7 -#define SADB_SATYPE_X_ESP_OLD 8 -#define SADB_SATYPE_X_IPIP 9 +#define SADB_X_SATYPE_AH_OLD 7 +#define SADB_X_SATYPE_ESP_OLD 8 +#define SADB_X_SATYPE_IPIP 9 #define SADB_SATYPE_MAX 9 #define SADB_SASTATE_LARVAL 0 @@ -214,25 +214,25 @@ struct sadb_protocol { #define SADB_AALG_SHA1HMAC 2 #define SADB_AALG_MD5HMAC96 3 #define SADB_AALG_SHA1HMAC96 4 -#define SADB_AALG_X_RIPEMD160HMAC96 5 -#define SADB_AALG_X_MD5 6 -#define SADB_AALG_X_SHA1 7 +#define SADB_X_AALG_RIPEMD160HMAC96 5 +#define SADB_X_AALG_MD5 6 +#define SADB_X_AALG_SHA1 7 #define SADB_AALG_MAX 7 #define SADB_EALG_NONE 0 #define SADB_EALG_DESCBC 1 #define SADB_EALG_3DESCBC 2 -#define SADB_EALG_X_BLF 3 -#define SADB_EALG_X_CAST 4 -#define SADB_EALG_X_SKIPJACK 5 +#define SADB_X_EALG_BLF 3 +#define SADB_X_EALG_CAST 4 +#define SADB_X_EALG_SKIPJACK 5 #define SADB_EALG_MAX 5 #define SADB_SAFLAGS_PFS 0x01 /* perfect forward secrecy */ -#define SADB_SAFLAGS_X_HALFIV 0x02 /* Used for ESP-old */ -#define SADB_SAFLAGS_X_TUNNEL 0x04 /* Force tunneling */ -#define SADB_SAFLAGS_X_CHAINDEL 0x08 /* Delete whole SA chain */ -#define SADB_SAFLAGS_X_LOCALFLOW 0x10 /* Add flow with src=0.0.0.0 */ -#define SADB_SAFLAGS_X_REPLACEFLOW 0x20 /* Replace existing flow */ +#define SADB_X_SAFLAGS_HALFIV 0x02 /* Used for ESP-old */ +#define SADB_X_SAFLAGS_TUNNEL 0x04 /* Force tunneling */ +#define SADB_X_SAFLAGS_CHAINDEL 0x08 /* Delete whole SA chain */ +#define SADB_X_SAFLAGS_LOCALFLOW 0x10 /* Add flow with src=0.0.0.0 */ +#define SADB_X_SAFLAGS_REPLACEFLOW 0x20 /* Replace existing flow */ #define SADB_IDENTTYPE_RESERVED 0 #define SADB_IDENTTYPE_PREFIX 1 diff --git a/sys/net/pfkeyv2_parsemessage.c b/sys/net/pfkeyv2_parsemessage.c index 46b83dedadf..568e2b0c1ef 100644 --- a/sys/net/pfkeyv2_parsemessage.c +++ b/sys/net/pfkeyv2_parsemessage.c @@ -49,13 +49,13 @@ you didn't get a copy, you may request one from <license@inner.net>. #define BITMAP_KEY (BITMAP_KEY_AUTH | BITMAP_KEY_ENCRYPT) #define BITMAP_IDENTITY (BITMAP_IDENTITY_SRC | BITMAP_IDENTITY_DST) #define BITMAP_MSG 1 -#define BITMAP_X_SRC_MASK (1 << SADB_EXT_X_SRC_MASK) -#define BITMAP_X_DST_MASK (1 << SADB_EXT_X_DST_MASK) -#define BITMAP_X_PROTOCOL (1 << SADB_EXT_X_PROTOCOL) -#define BITMAP_X_SA2 (1 << SADB_EXT_X_SA2) -#define BITMAP_X_SRC_FLOW (1 << SADB_EXT_X_SRC_FLOW) -#define BITMAP_X_DST_FLOW (1 << SADB_EXT_X_DST_FLOW) -#define BITMAP_X_DST2 (1 << SADB_EXT_X_DST2) +#define BITMAP_X_SRC_MASK (1 << SADB_X_EXT_SRC_MASK) +#define BITMAP_X_DST_MASK (1 << SADB_X_EXT_DST_MASK) +#define BITMAP_X_PROTOCOL (1 << SADB_X_EXT_PROTOCOL) +#define BITMAP_X_SA2 (1 << SADB_X_EXT_SA2) +#define BITMAP_X_SRC_FLOW (1 << SADB_X_EXT_SRC_FLOW) +#define BITMAP_X_DST_FLOW (1 << SADB_X_EXT_DST_FLOW) +#define BITMAP_X_DST2 (1 << SADB_X_EXT_DST2) uint32_t sadb_exts_allowed_in[SADB_MAX+1] = { @@ -274,7 +274,7 @@ pfkeyv2_parsemessage(void *p, int len, void **headers) seen |= (1 << sadb_ext->sadb_ext_type); switch (sadb_ext->sadb_ext_type) { - case SADB_EXT_X_SA2: + case SADB_X_EXT_SA2: case SADB_EXT_SA: { struct sadb_sa *sadb_sa = (struct sadb_sa *)p; @@ -298,7 +298,7 @@ pfkeyv2_parsemessage(void *p, int len, void **headers) return EINVAL; } break; - case SADB_EXT_X_PROTOCOL: + case SADB_X_EXT_PROTOCOL: if (i != sizeof(struct sadb_protocol)) return EINVAL; break; @@ -312,11 +312,11 @@ pfkeyv2_parsemessage(void *p, int len, void **headers) break; case SADB_EXT_ADDRESS_SRC: case SADB_EXT_ADDRESS_DST: - case SADB_EXT_X_DST2: - case SADB_EXT_X_SRC_MASK: - case SADB_EXT_X_DST_MASK: - case SADB_EXT_X_SRC_FLOW: - case SADB_EXT_X_DST_FLOW: + case SADB_X_EXT_DST2: + case SADB_X_EXT_SRC_MASK: + case SADB_X_EXT_DST_MASK: + case SADB_X_EXT_SRC_FLOW: + case SADB_X_EXT_DST_FLOW: case SADB_EXT_ADDRESS_PROXY: { struct sadb_address *sadb_address = (struct sadb_address *)p; @@ -346,10 +346,10 @@ pfkeyv2_parsemessage(void *p, int len, void **headers) /* Only check the right pieces */ switch (sadb_ext->sadb_ext_type) { - case SADB_EXT_X_SRC_MASK: - case SADB_EXT_X_DST_MASK: - case SADB_EXT_X_SRC_FLOW: - case SADB_EXT_X_DST_FLOW: + case SADB_X_EXT_SRC_MASK: + case SADB_X_EXT_DST_MASK: + case SADB_X_EXT_SRC_FLOW: + case SADB_X_EXT_DST_FLOW: break; default: |