template_names should really be tmpl_names and should be in tmpl.c
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 25 Nov 2014 21:59:20 +0000 (16:59 -0500)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 25 Nov 2014 21:59:20 +0000 (16:59 -0500)
src/include/radiusd.h
src/include/tmpl.h
src/main/evaluate.c
src/main/map.c
src/main/tmpl.c
src/modules/rlm_cache/rlm_cache.c
src/modules/rlm_ldap/attrmap.c

index 61355a6..38edcc4 100644 (file)
@@ -177,7 +177,6 @@ typedef enum rlm_rcodes {
        RLM_MODULE_UNKNOWN      //!< Error resolving rcode (should not be
                                //!< returned by modules).
 } rlm_rcode_t;
-extern const FR_NAME_NUMBER template_names[];
 extern const FR_NAME_NUMBER modreturn_table[];
 
 /*
index 501058c..3a93717 100644 (file)
@@ -84,7 +84,7 @@ typedef enum tmpl_type {
        TMPL_TYPE_NULL                  //!< VPT has no value
 } tmpl_type_t;
 
-extern const FR_NAME_NUMBER template_names[];
+extern const FR_NAME_NUMBER tmpl_names[];
 
 typedef struct xlat_exp xlat_exp_t;
 
index ccc15d0..69efce8 100644 (file)
@@ -37,21 +37,6 @@ RCSID("$Id$")
 #  define EVAL_DEBUG(...)
 #endif
 
-FR_NAME_NUMBER const template_names[] = {
-       { "literal",            TMPL_TYPE_LITERAL       },
-       { "xlat",               TMPL_TYPE_XLAT          },
-       { "attr",               TMPL_TYPE_ATTR          },
-       { "unknown attr",       TMPL_TYPE_ATTR_UNDEFINED        },
-       { "list",               TMPL_TYPE_LIST          },
-       { "regex",              TMPL_TYPE_REGEX         },
-       { "exec",               TMPL_TYPE_EXEC          },
-       { "data",               TMPL_TYPE_DATA          },
-       { "parsed xlat",        TMPL_TYPE_XLAT_STRUCT   },
-       { "parsed regex",       TMPL_TYPE_REGEX_STRUCT  },
-       { "null",               TMPL_TYPE_NULL          },
-       { NULL, 0 }
-};
-
 FR_NAME_NUMBER const modreturn_table[] = {
        { "reject",             RLM_MODULE_REJECT       },
        { "fail",               RLM_MODULE_FAIL         },
@@ -646,8 +631,8 @@ int radius_evaluate_map(REQUEST *request, UNUSED int modreturn, UNUSED int depth
        value_pair_map_t const *map = c->data.map;
 
        EVAL_DEBUG(">>> MAP TYPES LHS: %s, RHS: %s",
-                  fr_int2str(template_names, map->lhs->type, "???"),
-                  fr_int2str(template_names, map->rhs->type, "???"));
+                  fr_int2str(tmpl_names, map->lhs->type, "???"),
+                  fr_int2str(tmpl_names, map->rhs->type, "???"));
 
        switch (map->lhs->type) {
        /*
index 0e87569..4f0ab3e 100644 (file)
@@ -830,7 +830,7 @@ int map_to_request(REQUEST *request, value_pair_map_t const *map, radius_map_get
        if ((map->lhs->type != TMPL_TYPE_LIST) &&
            (map->lhs->type != TMPL_TYPE_ATTR)) {
                REDEBUG("Mapping LHS should be an attr or list but is an %s",
-                       fr_int2str(template_names, map->lhs->type, "<INVALID>"));
+                       fr_int2str(tmpl_names, map->lhs->type, "<INVALID>"));
                return -2;
        }
 
index eb42f31..a16a6a0 100644 (file)
@@ -31,6 +31,21 @@ RCSID("$Id$")
 
 #include <ctype.h>
 
+FR_NAME_NUMBER const tmpl_names[] = {
+       { "literal",            TMPL_TYPE_LITERAL       },
+       { "xlat",               TMPL_TYPE_XLAT          },
+       { "attr",               TMPL_TYPE_ATTR          },
+       { "unknown attr",       TMPL_TYPE_ATTR_UNDEFINED        },
+       { "list",               TMPL_TYPE_LIST          },
+       { "regex",              TMPL_TYPE_REGEX         },
+       { "exec",               TMPL_TYPE_EXEC          },
+       { "data",               TMPL_TYPE_DATA          },
+       { "parsed xlat",        TMPL_TYPE_XLAT_STRUCT   },
+       { "parsed regex",       TMPL_TYPE_REGEX_STRUCT  },
+       { "null",               TMPL_TYPE_NULL          },
+       { NULL, 0 }
+};
+
 const FR_NAME_NUMBER pair_lists[] = {
        { "request",            PAIR_LIST_REQUEST },
        { "reply",              PAIR_LIST_REPLY },
@@ -436,7 +451,7 @@ void tmpl_verify(char const *file, int line, value_pair_tmpl_t const *vpt)
 
        if (vpt->type > TMPL_TYPE_NULL) {
                FR_FAULT_LOG("CONSISTENCY CHECK FAILED %s[%u]: value_pair_tmpl_t type was %i "
-                            "(outside range of template_names)", file, line, vpt->type);
+                            "(outside range of tmpl_names)", file, line, vpt->type);
                fr_assert(0);
                fr_exit_now(1);
        }
index a165025..c779669 100644 (file)
@@ -386,7 +386,7 @@ static int cache_verify(value_pair_map_t *map, UNUSED void *ctx)
                default:
                        cf_log_err(map->ci, "Operator \"%s\" not allowed for %s values",
                                   fr_int2str(fr_tokens, map->op, "<INVALID>"),
-                                  fr_int2str(template_names, map->rhs->type, "<INVALID>"));
+                                  fr_int2str(tmpl_names, map->rhs->type, "<INVALID>"));
                        return -1;
                }
        default:
index 7c0f58d..2dd61bb 100644 (file)
@@ -142,7 +142,7 @@ int rlm_ldap_map_verify(value_pair_map_t *map, void *instance)
 
        default:
                cf_log_err(map->ci, "Left hand side of map must be an attribute or list, not a %s",
-                          fr_int2str(template_names, map->lhs->type, "<INVALID>"));
+                          fr_int2str(tmpl_names, map->lhs->type, "<INVALID>"));
                return -1;
        }
 
@@ -159,7 +159,7 @@ int rlm_ldap_map_verify(value_pair_map_t *map, void *instance)
 
        default:
                cf_log_err(map->ci, "Right hand side of map must be an xlat, attribute, exec, or literal, not a %s",
-                          fr_int2str(template_names, map->rhs->type, "<INVALID>"));
+                          fr_int2str(tmpl_names, map->rhs->type, "<INVALID>"));
                return -1;
        }