From: Arran Cudbard-Bell Date: Thu, 30 Oct 2014 19:02:51 +0000 (-0400) Subject: Change PW_TYPE_IP_ADDR to PW_TYPE_COMBO_IP_ADDR X-Git-Tag: branch_3_1_x~4817 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cce8fbbf66a3bb05273c63312840c64a2fdee1a0;p=thirdparty%2Ffreeradius-server.git Change PW_TYPE_IP_ADDR to PW_TYPE_COMBO_IP_ADDR --- diff --git a/src/include/conffile.h b/src/include/conffile.h index 789724b19f1..e784a800b55 100644 --- a/src/include/conffile.h +++ b/src/include/conffile.h @@ -72,7 +72,7 @@ typedef struct timeval _timeval_t; __builtin_choose_expr(__builtin_types_compatible_p(uint8_t[6], _ct), _p, (conf_type_mismatch) 0),\ __builtin_choose_expr((_t == PW_TYPE_SIGNED),\ __builtin_choose_expr(__builtin_types_compatible_p(int32_t *, _ct), _p, (conf_type_mismatch) 0),\ - __builtin_choose_expr((_t == PW_TYPE_IP_ADDR),\ + __builtin_choose_expr((_t == PW_TYPE_COMBO_IP_ADDR),\ __builtin_choose_expr(__builtin_types_compatible_p(fr_ipaddr_t *, _ct), _p, (conf_type_mismatch) 0),\ __builtin_choose_expr((_t == PW_TYPE_INTEGER64),\ __builtin_choose_expr(__builtin_types_compatible_p(uint64_t *, _ct), _p, (conf_type_mismatch) 0),\ diff --git a/src/include/radius.h b/src/include/radius.h index b72d7aedc6f..40b73d30608 100644 --- a/src/include/radius.h +++ b/src/include/radius.h @@ -20,7 +20,7 @@ typedef enum { PW_TYPE_SHORT, //!< 16 Bit unsigned integer. PW_TYPE_ETHERNET, //!< 48 Bit Mac-Address. PW_TYPE_SIGNED, //!< 32 Bit signed integer. - PW_TYPE_IP_ADDR, //!< WiMAX IPv4 or IPv6 address depending on length. + PW_TYPE_COMBO_IP_ADDR, //!< WiMAX IPv4 or IPv6 address depending on length. PW_TYPE_TLV, //!< Contains nested attributes. PW_TYPE_EXTENDED, //!< Extended attribute space attribute. PW_TYPE_LONG_EXTENDED, //!< Long extended attribute space attribute. diff --git a/src/lib/dict.c b/src/lib/dict.c index ee55f07059b..fcd15f1ebee 100644 --- a/src/lib/dict.c +++ b/src/lib/dict.c @@ -87,7 +87,7 @@ const FR_NAME_NUMBER dict_attr_types[] = { { "byte", PW_TYPE_BYTE }, { "short", PW_TYPE_SHORT }, { "ether", PW_TYPE_ETHERNET }, - { "combo-ip", PW_TYPE_IP_ADDR }, + { "combo-ip", PW_TYPE_COMBO_IP_ADDR }, { "tlv", PW_TYPE_TLV }, { "signed", PW_TYPE_SIGNED }, { "extended", PW_TYPE_EXTENDED }, @@ -123,7 +123,7 @@ const size_t dict_attr_sizes[PW_TYPE_MAX][2] = { [PW_TYPE_SHORT] = {2, 2}, [PW_TYPE_ETHERNET] = {6, 6}, [PW_TYPE_SIGNED] = {4, 4}, - [PW_TYPE_IP_ADDR] = {4, 16}, + [PW_TYPE_COMBO_IP_ADDR] = {4, 16}, [PW_TYPE_TLV] = {2, ~0}, [PW_TYPE_EXTENDED] = {2, ~0}, [PW_TYPE_LONG_EXTENDED] = {3, ~0}, @@ -931,7 +931,7 @@ int dict_addattr(char const *name, int attr, unsigned int vendor, PW_TYPE type, /* * Hacks for combo-IP */ - if (n->type == PW_TYPE_IP_ADDR) { + if (n->type == PW_TYPE_COMBO_IP_ADDR) { DICT_ATTR *v4, *v6; v4 = fr_pool_alloc(sizeof(*v4) + namelen); diff --git a/src/lib/radius.c b/src/lib/radius.c index 067c07ef4fe..894872a3f97 100644 --- a/src/lib/radius.c +++ b/src/lib/radius.c @@ -3534,7 +3534,7 @@ ssize_t data2vp(TALLOC_CTX *ctx, if (datalen != 6) goto raw; break; - case PW_TYPE_IP_ADDR: + case PW_TYPE_COMBO_IP_ADDR: if (datalen == 4) { child = dict_attrbytype(da->attr, da->vendor, PW_TYPE_IPV4_ADDR); @@ -3915,7 +3915,7 @@ ssize_t rad_vp2data(uint8_t const **out, VALUE_PAIR const *vp) case PW_TYPE_IPV4_PREFIX: case PW_TYPE_ABINARY: case PW_TYPE_ETHERNET: - case PW_TYPE_IP_ADDR: + case PW_TYPE_COMBO_IP_ADDR: case PW_TYPE_IP_PREFIX: { void const *p = &vp->data; diff --git a/src/lib/value.c b/src/lib/value.c index bbb2bb38e3a..551ac520058 100644 --- a/src/lib/value.c +++ b/src/lib/value.c @@ -146,7 +146,7 @@ int value_data_cmp(PW_TYPE a_type, size_t a_len, value_data_t const *a, * Na of the types below should be in the REQUEST */ case PW_TYPE_INVALID: /* We should never see these */ - case PW_TYPE_IP_ADDR: /* This should have been converted into IPADDR/IPV6ADDR */ + case PW_TYPE_COMBO_IP_ADDR: /* This should have been converted into IPADDR/IPV6ADDR */ case PW_TYPE_IP_PREFIX: /* This should have been converted into IPADDR/IPV6ADDR */ case PW_TYPE_TLV: case PW_TYPE_EXTENDED: @@ -879,11 +879,11 @@ ssize_t value_data_from_str(TALLOC_CTX *ctx, value_data_t *out, * These are not dynamic da, and will have the same vendor * and attribute as the original. */ - case PW_TYPE_IP_ADDR: + case PW_TYPE_COMBO_IP_ADDR: { if (inet_pton(AF_INET6, value, &out->ipv6addr) > 0) { *type = PW_TYPE_IPV6_ADDR; - ret = dict_attr_sizes[PW_TYPE_IP_ADDR][1]; /* size of IPv6 address */ + ret = dict_attr_sizes[PW_TYPE_COMBO_IP_ADDR][1]; /* size of IPv6 address */ } else { fr_ipaddr_t ipaddr; @@ -894,7 +894,7 @@ ssize_t value_data_from_str(TALLOC_CTX *ctx, value_data_t *out, *type = PW_TYPE_IPV4_ADDR; out->ipaddr.s_addr = ipaddr.ipaddr.ip4addr.s_addr; - ret = dict_attr_sizes[PW_TYPE_IP_ADDR][0]; /* size of IPv4 address */ + ret = dict_attr_sizes[PW_TYPE_COMBO_IP_ADDR][0]; /* size of IPv4 address */ } } break; diff --git a/src/main/conffile.c b/src/main/conffile.c index 7e0161942ae..2b44c315101 100644 --- a/src/main/conffile.c +++ b/src/main/conffile.c @@ -943,7 +943,7 @@ static inline int fr_item_validate_ipaddr(CONF_SECTION *cs, char const *name, PW switch (type) { case PW_TYPE_IPV4_ADDR: case PW_TYPE_IPV6_ADDR: - case PW_TYPE_IP_ADDR: + case PW_TYPE_COMBO_IP_ADDR: switch (ipaddr->af) { case AF_INET: if (ipaddr->prefix != 32) { @@ -1195,7 +1195,7 @@ int cf_item_parse(CONF_SECTION *cs, char const *name, int type, void *data, char if (fr_item_validate_ipaddr(cs, name, type, value, ipaddr) < 0) return -1; break; - case PW_TYPE_IP_ADDR: + case PW_TYPE_COMBO_IP_ADDR: case PW_TYPE_IP_PREFIX: ipaddr = data; diff --git a/src/main/listen.c b/src/main/listen.c index 8d68cdc3d63..d498f3d26b9 100644 --- a/src/main/listen.c +++ b/src/main/listen.c @@ -916,7 +916,7 @@ int common_socket_parse(CONF_SECTION *cs, rad_listen_t *this) memset(&ipaddr, 0, sizeof(ipaddr)); ipaddr.ipaddr.ip4addr.s_addr = htonl(INADDR_NONE); - rcode = cf_item_parse(cs, "ipaddr", FR_ITEM_POINTER(PW_TYPE_IP_ADDR, &ipaddr), NULL); + rcode = cf_item_parse(cs, "ipaddr", FR_ITEM_POINTER(PW_TYPE_COMBO_IP_ADDR, &ipaddr), NULL); if (rcode < 0) return -1; if (rcode != 0) rcode = cf_item_parse(cs, "ipv4addr", FR_ITEM_POINTER(PW_TYPE_IPV4_ADDR, &ipaddr), NULL); if (rcode < 0) return -1; diff --git a/src/main/parser.c b/src/main/parser.c index 93f478af954..ea3dbd05afc 100644 --- a/src/main/parser.c +++ b/src/main/parser.c @@ -305,7 +305,7 @@ static ssize_t condition_tokenize_cast(char const *start, DICT_ATTR const **pda, #ifdef WITH_ASCEND_BINARY case PW_TYPE_ABINARY: #endif - case PW_TYPE_IP_ADDR: + case PW_TYPE_COMBO_IP_ADDR: case PW_TYPE_TLV: case PW_TYPE_EXTENDED: case PW_TYPE_LONG_EXTENDED: diff --git a/src/main/realms.c b/src/main/realms.c index e4c034298cd..9c00bf5598f 100644 --- a/src/main/realms.c +++ b/src/main/realms.c @@ -293,7 +293,7 @@ static CONF_PARSER home_server_coa[] = { #endif static CONF_PARSER home_server_config[] = { - { "ipaddr", FR_CONF_POINTER(PW_TYPE_IP_ADDR, &hs_ipaddr), NULL }, + { "ipaddr", FR_CONF_POINTER(PW_TYPE_COMBO_IP_ADDR, &hs_ipaddr), NULL }, { "ipv4addr", FR_CONF_POINTER(PW_TYPE_IPV4_ADDR, &hs_ipaddr), NULL }, { "ipv6addr", FR_CONF_POINTER(PW_TYPE_IPV6_ADDR, &hs_ipaddr), NULL }, { "virtual_server", FR_CONF_POINTER(PW_TYPE_STRING, &hs_virtual_server), NULL },