]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Change PW_TYPE_IP_ADDR to PW_TYPE_COMBO_IP_ADDR
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 30 Oct 2014 19:02:51 +0000 (15:02 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 30 Oct 2014 19:02:51 +0000 (15:02 -0400)
src/include/conffile.h
src/include/radius.h
src/lib/dict.c
src/lib/radius.c
src/lib/value.c
src/main/conffile.c
src/main/listen.c
src/main/parser.c
src/main/realms.c

index 789724b19f1575591643ec74a819612fb0fecfcf..e784a800b55a486772e69ea2edfe90d3c92f70ca 100644 (file)
@@ -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),\
index b72d7aedc6f9fbabf4fb1f16daed04fc1353ba35..40b73d3060862f11a7de35cafee638ad525ba595 100644 (file)
@@ -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.
index ee55f07059b86d16f765658a92013b602e99e202..fcd15f1ebeecd8a9fdd98e85a3f5c05f005ae05f 100644 (file)
@@ -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);
index 067c07ef4feb6b0f71acab72b0a7123ab72125d5..894872a3f976cffbd69c454890c8b5cbd168dfdc 100644 (file)
@@ -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;
index bbb2bb38e3a6694534323df83737556debce036d..551ac520058af0f242470cbb4f060e42dc6dedc2 100644 (file)
@@ -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;
index 7e0161942ae79770b445efd89e1c2939a2ba48a1..2b44c3151019f8f414a79b620b41db410e011f05 100644 (file)
@@ -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;
 
index 8d68cdc3d63bb2a980ceea9813aa772cab24d777..d498f3d26b95c13a6be8a2657474d885c6d78c2b 100644 (file)
@@ -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;
index 93f478af9545a862041ea967fd392c9e833f01fe..ea3dbd05afca950d85a1b5d5839e557f5cacdcfd 100644 (file)
@@ -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:
index e4c034298cdf220849ddc481fce606bd8b6cdbdd..9c00bf5598fa7c4cc34613ffd16dda103f7e7b6a 100644 (file)
@@ -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 },