]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Make dict_attr_types available from libradius.h so we can do integer to string type...
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 28 Oct 2011 14:10:06 +0000 (16:10 +0200)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 28 Oct 2011 14:10:06 +0000 (16:10 +0200)
src/include/libradius.h
src/lib/dict.c

index 7dd6b44c731953d464e08339962f1325c91b16a7..b81205c63c8291de5bf2a453d4b4172192ea0c24 100644 (file)
@@ -116,6 +116,8 @@ typedef struct attr_flags {
 #define FLAG_ENCRYPT_TUNNEL_PASSWORD (2)
 #define FLAG_ENCRYPT_ASCEND_SECRET   (3)
 
+extern const FR_NAME_NUMBER dict_attr_types[];
+
 typedef struct dict_attr {
        unsigned int            attr;
        int                     type;
index 72ac60e81f249cd43dec1090540e7cfce622e6af..30803ee14fc269510861c18c94f972c839ff85d7 100644 (file)
@@ -78,7 +78,7 @@ typedef struct value_fixup_t {
  */
 static value_fixup_t *value_fixup = NULL;
 
-static const FR_NAME_NUMBER type_table[] = {
+extern const FR_NAME_NUMBER dict_attr_types[] = {
        { "integer",    PW_TYPE_INTEGER },
        { "string",     PW_TYPE_STRING },
        { "ipaddr",     PW_TYPE_IPADDR },
@@ -763,7 +763,7 @@ int dict_addvalue(const char *namestr, const char *attrstr, int value)
                        default:
                                fr_pool_free(dval);
                                fr_strerror_printf("dict_addvalue: VALUEs cannot be defined for attributes of type '%s'",
-                                          fr_int2str(type_table, dattr->type, "?Unknown?"));
+                                          fr_int2str(dict_attr_types, dattr->type, "?Unknown?"));
                                return -1;
                }
 
@@ -887,7 +887,7 @@ static int process_attribute(const char* fn, const int line,
        /*
         *      find the type of the attribute.
         */
-       type = fr_str2int(type_table, argv[2], -1);
+       type = fr_str2int(dict_attr_types, argv[2], -1);
        if (type < 0) {
                fr_strerror_printf("dict_init: %s[%d]: invalid type \"%s\"",
                        fn, line, argv[2]);
@@ -986,7 +986,7 @@ static int process_attribute(const char* fn, const int line,
                default:
                        fr_strerror_printf("dict_init: %s[%d]: Attributes of type %s cannot be tagged.",
                                   fn, line,
-                                  fr_int2str(type_table, type, "?Unknown?"));
+                                  fr_int2str(dict_attr_types, type, "?Unknown?"));
                        return -1;
 
                }