]> 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:20:51 +0000 (16:20 +0200)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 28 Oct 2011 14:23:34 +0000 (16:23 +0200)
src/include/libradius.h
src/lib/dict.c

index 0a2effdbfcc65b1421ec6513fbfccebd5fc5d8cd..841a204e00bdbd1262cd6f345f5eb93060aff406 100644 (file)
@@ -124,6 +124,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 f1372669fce885873067c3d7aa116bd20b3ca9ac..9bffff323483bd65bc01a9af7e39c8f6768e92a5 100644 (file)
@@ -83,7 +83,7 @@ typedef struct value_fixup_t {
  */
 static value_fixup_t *value_fixup = NULL;
 
-static const FR_NAME_NUMBER type_table[] = {
+const FR_NAME_NUMBER dict_attr_types[] = {
        { "integer",    PW_TYPE_INTEGER },
        { "string",     PW_TYPE_STRING },
        { "ipaddr",     PW_TYPE_IPADDR },
@@ -874,7 +874,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;
                }
 
@@ -1169,7 +1169,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]);
@@ -1385,7 +1385,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;
                }
        }