strlcpy(type_str, value, (p - value) + 1);
- type = fr_dict_enum_by_alias(attr_freeradius_snmp_type, type_str, -1);
+ type = fr_dict_enum_by_name(attr_freeradius_snmp_type, type_str, -1);
if (!type) {
ERROR("Unknown type \"%s\"", type_str);
RESPOND_STATIC("NONE");
{
fr_dict_enum_t *dv;
- dv = fr_dict_enum_by_alias(attr_eap_type, name, -1);
+ dv = fr_dict_enum_by_name(attr_eap_type, name, -1);
if (!dv) return FR_EAP_METHOD_INVALID;
if (dv->value->vb_uint32 >= FR_EAP_METHOD_MAX) return FR_EAP_METHOD_INVALID;
fr_dict_enum_t *dv;
dv = fr_dict_enum_by_value(attr_eap_type, fr_box_uint32(method));
- if (dv) return dv->alias;
+ if (dv) return dv->name;
return "unknown";
}
return 0;
case AKA_SIM_METHOD_HINT_SIM:
- method = fr_dict_enum_alias_by_value(attr_eap_aka_sim_method_hint,
+ method = fr_dict_enum_name_by_value(attr_eap_aka_sim_method_hint,
fr_box_uint32(FR_METHOD_HINT_VALUE_SIM));
break;
case AKA_SIM_METHOD_HINT_AKA:
- method = fr_dict_enum_alias_by_value(attr_eap_aka_sim_method_hint,
+ method = fr_dict_enum_name_by_value(attr_eap_aka_sim_method_hint,
fr_box_uint32(FR_METHOD_HINT_VALUE_AKA));
break;
case AKA_SIM_METHOD_HINT_AKA_PRIME:
- method = fr_dict_enum_alias_by_value(attr_eap_aka_sim_method_hint,
+ method = fr_dict_enum_name_by_value(attr_eap_aka_sim_method_hint,
fr_box_uint32(FR_METHOD_HINT_VALUE_AKA_PRIME));
break;
}
return 0;
case AKA_SIM_ID_TYPE_PERMANENT:
- type = fr_dict_enum_alias_by_value(attr_eap_aka_sim_identity_type,
+ type = fr_dict_enum_name_by_value(attr_eap_aka_sim_identity_type,
fr_box_uint32(FR_IDENTITY_TYPE_VALUE_PERMANENT));
break;
case AKA_SIM_ID_TYPE_PSEUDONYM:
- type = fr_dict_enum_alias_by_value(attr_eap_aka_sim_identity_type,
+ type = fr_dict_enum_name_by_value(attr_eap_aka_sim_identity_type,
fr_box_uint32(FR_IDENTITY_TYPE_VALUE_PSEUDONYM));
break;
case AKA_SIM_ID_TYPE_FASTAUTH:
- type = fr_dict_enum_alias_by_value(attr_eap_aka_sim_identity_type,
+ type = fr_dict_enum_name_by_value(attr_eap_aka_sim_identity_type,
fr_box_uint32(FR_IDENTITY_TYPE_VALUE_FASTAUTH));
break;
}
/*
* If an alias exists, use that value instead
*/
- found = fr_dict_enum_by_alias(enumv, value, len);
+ found = fr_dict_enum_by_name(enumv, value, len);
if (found) {
if (fr_value_box_copy(ctx, out, found->value) < 0) return -1;
return 0;
fr_dict_enum_t *enumv;
enumv = fr_dict_enum_by_value(data->enumv, data);
- if (enumv) return json_object_new_string(enumv->alias);
+ if (enumv) return json_object_new_string(enumv->name);
}
switch (data->type) {
return true;
case 1:
- RDEBUG2("&control:%s already set. Not setting to %s", vp->da->name, enumv->alias);
+ RDEBUG2("&control:%s already set. Not setting to %s", vp->da->name, enumv->name);
return false;
default:
* If the value already exists, don't
* create it again.
*/
- dv = fr_dict_enum_by_alias(da, name2, -1);
+ dv = fr_dict_enum_by_name(da, name2, -1);
if (dv) continue;
cf_log_debug(subcs, "Creating %s = %s", da->name, name2);
* this code, so it doesn't matter. The only
* requirement is that it's unique.
*/
- if (fr_dict_enum_add_alias_next(da, name2) < 0) {
+ if (fr_dict_enum_add_name_next(da, name2) < 0) {
PERROR("Failed adding section value");
return -1;
}
dv = fr_dict_enum_by_value(da, fr_box_uint32((uint32_t) auth_type));
if (!dv) return RLM_MODULE_FAIL;
- subcs = cf_section_find(cs, da->name, dv->alias);
+ subcs = cf_section_find(cs, da->name, dv->name);
if (!subcs) {
RDEBUG2("%s %s sub-section not found. Using default return values.",
- da->name, dv->alias);
+ da->name, dv->name);
return RLM_MODULE_REJECT;
}
RDEBUG("Running %s %s from file %s",
- da->name, dv->alias, cf_filename(subcs));
+ da->name, dv->name, cf_filename(subcs));
cs = subcs;
/*
return unlang_module_yield_to_section(request, NULL, RLM_MODULE_FAIL, resume, signal, rctx);
}
- auth_name = fr_dict_enum_alias_by_value(attr_auth_type, &vp->data);
+ auth_name = fr_dict_enum_name_by_value(attr_auth_type, &vp->data);
if (!auth_name) {
REDEBUG2("Invalid %pP value", vp);
goto fail;
code = enumv->value->vb_uint32;
if (code >= code_max) {
- cf_log_err(conf, "Invalid type code \"%s\" for \"%s\"", enumv->alias, app_process->name);
+ cf_log_err(conf, "Invalid type code \"%s\" for \"%s\"", enumv->name, app_process->name);
return -1;
}
return UNLANG_ACTION_CALCULATE_RESULT;
}
- process_p = (fr_io_process_t *) cf_data_value(cf_data_find(g->server_cs, fr_io_process_t, type_enum->alias));
+ process_p = (fr_io_process_t *) cf_data_value(cf_data_find(g->server_cs, fr_io_process_t, type_enum->name));
if (!process_p) {
REDEBUG("No such packet type '%s' in server '%s'",
- type_enum->alias, cf_section_name2(g->server_cs));
+ type_enum->name, cf_section_name2(g->server_cs));
*presult = RLM_MODULE_FAIL;
return UNLANG_ACTION_CALCULATE_RESULT;
}
* We MUST use _cd_data_find() so that we don't try to
* find the "value" with talloc type "CF_IDENT_ANY".
*/
- process_inst = cf_data_value(_cf_data_find(cf_section_to_item(g->server_cs), CF_IDENT_ANY, type_enum->alias));
+ process_inst = cf_data_value(_cf_data_find(cf_section_to_item(g->server_cs), CF_IDENT_ANY, type_enum->name));
/* can be NULL */
child = unlang_io_subrequest_alloc(request, dict, UNLANG_NORMAL_CHILD);
* Where "foo" is dynamically defined.
*/
if (c->pass2_fixup == PASS2_FIXUP_TYPE) {
- if (!fr_dict_enum_by_alias(map->lhs->tmpl_da, map->rhs->name, -1)) {
+ if (!fr_dict_enum_by_name(map->lhs->tmpl_da, map->rhs->name, -1)) {
cf_log_err(map->ci, "Invalid reference to non-existent %s %s { ... }",
map->lhs->tmpl_da->name,
map->rhs->name);
}
}
- type_enum = fr_dict_enum_by_alias(da, packet_name, -1);
+ type_enum = fr_dict_enum_by_name(da, packet_name, -1);
if (!type_enum) {
cf_log_err(cs, "No such value '%s' for attribute 'Packet-Type' in namespace '%s'",
packet_name, namespace);
*/
typedef struct {
fr_dict_attr_t const *da; //!< Dictionary attribute enum is associated with.
- char const *alias; //!< Enum name.
- size_t alias_len; //!< Allows for efficient alias lookups when operating
+ char const *name; //!< Enum name.
+ size_t name_len; //!< Allows for efficient name lookups when operating
///< on partial buffers.
fr_value_box_t const *value; //!< Enum value (what name maps to).
} fr_dict_enum_t;
int fr_dict_attr_add(fr_dict_t *dict, fr_dict_attr_t const *parent, char const *name, int attr,
fr_type_t type, fr_dict_attr_flags_t const *flags) CC_HINT(nonnull(1,2,3));
-int fr_dict_enum_add_alias(fr_dict_attr_t const *da, char const *alias,
+int fr_dict_enum_add_name(fr_dict_attr_t const *da, char const *name,
fr_value_box_t const *value, bool coerce, bool replace);
-int fr_dict_enum_add_alias_next(fr_dict_attr_t const *da, char const *alias) CC_HINT(nonnull);
+int fr_dict_enum_add_name_next(fr_dict_attr_t const *da, char const *name) CC_HINT(nonnull);
int fr_dict_str_to_argv(char *str, char **argv, int max_argc);
/** @} */
fr_dict_enum_t *fr_dict_enum_by_value(fr_dict_attr_t const *da, fr_value_box_t const *value);
-char const *fr_dict_enum_alias_by_value(fr_dict_attr_t const *da, fr_value_box_t const *value);
+char const *fr_dict_enum_name_by_value(fr_dict_attr_t const *da, fr_value_box_t const *value);
-fr_dict_enum_t *fr_dict_enum_by_alias(fr_dict_attr_t const *da, char const *alias, ssize_t len);
+fr_dict_enum_t *fr_dict_enum_by_name(fr_dict_attr_t const *da, char const *name, ssize_t len);
/** @} */
/** @name Dictionary and protocol loading
fr_hash_table_t *attributes_combo; //!< Lookup variants of polymorphic attributes.
fr_hash_table_t *values_by_da; //!< Lookup an attribute enum by its value.
- fr_hash_table_t *values_by_alias; //!< Lookup an attribute enum by its alias name.
+ fr_hash_table_t *values_by_name; //!< Lookup an attribute enum by its name name.
fr_dict_attr_t *root; //!< Root attribute of this dictionary.
char *filename; //!< where the "enum" was defined
int line; //!< ditto
char *attribute; //!< we couldn't find (and will need to resolve later).
- char *alias; //!< Raw enum name.
+ char *name; //!< Raw enum name.
char *value; //!< Raw enum value. We can't do anything with this until
//!< we know the attribute type, which we only find out later.
fixup->attribute = talloc_strdup(fixup, argv[0]);
if (!fixup->attribute) goto oom;
- fixup->alias = talloc_strdup(fixup, argv[1]);
- if (!fixup->alias) goto oom;
+ fixup->name = talloc_strdup(fixup, argv[1]);
+ if (!fixup->name) goto oom;
fixup->value = talloc_strdup(fixup, argv[2]);
if (!fixup->value) goto oom;
}
}
- if (fr_dict_enum_add_alias(da, argv[1], &value, false, true) < 0) {
+ if (fr_dict_enum_add_name(da, argv[1], &value, false, true) < 0) {
fr_value_box_clear(&value);
return -1;
}
da = fr_dict_attr_by_name(ctx->dict, this->attribute);
if (!da) {
fr_strerror_printf("No ATTRIBUTE '%s' defined for VALUE '%s' at %s[%d]",
- this->attribute, this->alias, this->filename, this->line);
+ this->attribute, this->name, this->filename, this->line);
return -1;
}
type = da->type;
return -1;
}
- ret = fr_dict_enum_add_alias(da, this->alias, &value, false, false);
+ ret = fr_dict_enum_add_name(da, this->name, &value, false, false);
fr_value_box_clear(&value);
if (ret < 0) return -1;
fr_hash_table_walk(ctx->dict->vendors_by_num, hash_null_callback, NULL);
fr_hash_table_walk(ctx->dict->values_by_da, hash_null_callback, NULL);
- fr_hash_table_walk(ctx->dict->values_by_alias, hash_null_callback, NULL);
+ fr_hash_table_walk(ctx->dict->values_by_name, hash_null_callback, NULL);
ctx->value_attr = NULL;
ctx->relative_attr = NULL;
/** Hash a dictionary name
*
*/
-static uint32_t dict_enum_alias_hash(void const *data)
+static uint32_t dict_enum_name_hash(void const *data)
{
uint32_t hash;
fr_dict_enum_t const *enumv = data;
- hash = dict_hash_name((void const *)enumv->alias, enumv->alias_len);
+ hash = dict_hash_name((void const *)enumv->name, enumv->name_len);
return fr_hash_update(&enumv->da, sizeof(enumv->da), hash); //-V568
}
/** Compare two dictionary attribute enum values
*
*/
-static int dict_enum_alias_cmp(void const *one, void const *two)
+static int dict_enum_name_cmp(void const *one, void const *two)
{
int rcode;
fr_dict_enum_t const *a = one;
rcode = a->da - b->da;
if (rcode != 0) return rcode;
- return strcasecmp(a->alias, b->alias);
+ return strcasecmp(a->name, b->name);
}
/** Hash a dictionary enum value
return 0;
}
-/** Add a value alias
+/** Add a value name
*
- * Aliases are textual (string) aliases for a given value.
+ * Aliases are textual (string) names for a given value.
*
- * Value aliases are not limited to integers, and may be added for any non-structural
+ * Value names are not limited to integers, and may be added for any non-structural
* attribute type.
*
* @param[in] da to add enumeration value to.
- * @param[in] alias Name of value alias.
- * @param[in] value to associate with alias.
+ * @param[in] name Name of value name.
+ * @param[in] value to associate with name.
* @param[in] coerce if the type of the value does not match the
* type of the da, attempt to cast it to match
* the type of the da. If this is false and there's
* a type mismatch, we fail.
* We also fail if the value cannot be coerced to
* the attribute type.
- * @param[in] takes_precedence This alias should take precedence over previous
- * aliases for the same value, when resolving value
- * to alias.
+ * @param[in] takes_precedence This name should take precedence over previous
+ * names for the same value, when resolving value
+ * to name.
* @return
* - 0 on success.
* - -1 on failure.
*/
-int fr_dict_enum_add_alias(fr_dict_attr_t const *da, char const *alias,
+int fr_dict_enum_add_name(fr_dict_attr_t const *da, char const *name,
fr_value_box_t const *value,
bool coerce, bool takes_precedence)
{
return -1;
}
- if (!*alias) {
+ if (!*name) {
fr_strerror_printf("%s: Empty names are not permitted", __FUNCTION__);
return -1;
}
- len = strlen(alias);
+ len = strlen(name);
if (len >= FR_DICT_ENUM_MAX_NAME_LEN) {
fr_strerror_printf("%s: Value name too long", __FUNCTION__);
return -1;
fr_strerror_printf("%s: Out of memory", __FUNCTION__);
return -1;
}
- enumv->alias = talloc_typed_strdup(enumv, alias);
- enumv->alias_len = strlen(alias);
+ enumv->name = talloc_typed_strdup(enumv, name);
+ enumv->name_len = strlen(name);
enum_value = fr_value_box_alloc(enumv, da->type, NULL, false);
if (!enum_value) goto oom;
fr_dict_attr_t *tmp;
memcpy(&tmp, &enumv, sizeof(tmp));
- if (!fr_hash_table_insert(dict->values_by_alias, tmp)) {
+ if (!fr_hash_table_insert(dict->values_by_name, tmp)) {
fr_dict_enum_t *old;
/*
* name and value. There are lots in
* dictionary.ascend.
*/
- old = fr_dict_enum_by_alias(da, alias, -1);
+ old = fr_dict_enum_by_name(da, name, -1);
if (!fr_cond_assert(old)) return -1;
if (fr_value_box_cmp(old->value, enumv->value) == 0) {
return 0;
}
- fr_strerror_printf("Duplicate VALUE alias \"%s\" for attribute \"%s\". "
- "Old value was \"%pV\", new value was \"%pV\"", alias, da->name,
+ fr_strerror_printf("Duplicate VALUE name \"%s\" for attribute \"%s\". "
+ "Old value was \"%pV\", new value was \"%pV\"", name, da->name,
old->value, enumv->value);
talloc_free(enumv);
return -1;
*/
if (takes_precedence) {
if (!fr_hash_table_replace(dict->values_by_da, enumv)) {
- fr_strerror_printf("%s: Failed inserting value %s", __FUNCTION__, alias);
+ fr_strerror_printf("%s: Failed inserting value %s", __FUNCTION__, name);
return -1;
}
} else {
return 0;
}
-/** Add an alias to an integer attribute hashing the alias for the integer value
+/** Add an name to an integer attribute hashing the name for the integer value
*
*/
-int fr_dict_enum_add_alias_next(fr_dict_attr_t const *da, char const *alias)
+int fr_dict_enum_add_name_next(fr_dict_attr_t const *da, char const *name)
{
fr_value_box_t v = {
.type = da->type
.type = da->type
};
- if (fr_dict_enum_by_alias(da, alias, -1)) return 0;
+ if (fr_dict_enum_by_name(da, name, -1)) return 0;
switch (da->type) {
case FR_TYPE_INT8:
- v.vb_int8 = s.vb_int8 = fr_hash_string(alias) & INT8_MAX;
+ v.vb_int8 = s.vb_int8 = fr_hash_string(name) & INT8_MAX;
break;
case FR_TYPE_INT16:
- v.vb_int16 = s.vb_int16 = fr_hash_string(alias) & INT16_MAX;
+ v.vb_int16 = s.vb_int16 = fr_hash_string(name) & INT16_MAX;
break;
case FR_TYPE_INT32:
- v.vb_int32 = s.vb_int32 = fr_hash_string(alias) & INT32_MAX;
+ v.vb_int32 = s.vb_int32 = fr_hash_string(name) & INT32_MAX;
break;
case FR_TYPE_INT64:
- v.vb_int64 = s.vb_int64 = fr_hash_string(alias) & INT64_MAX;
+ v.vb_int64 = s.vb_int64 = fr_hash_string(name) & INT64_MAX;
break;
case FR_TYPE_UINT8:
- v.vb_uint8 = s.vb_uint8 = fr_hash_string(alias) & UINT8_MAX;
+ v.vb_uint8 = s.vb_uint8 = fr_hash_string(name) & UINT8_MAX;
break;
case FR_TYPE_UINT16:
- v.vb_uint16 = s.vb_uint16 = fr_hash_string(alias) & UINT16_MAX;
+ v.vb_uint16 = s.vb_uint16 = fr_hash_string(name) & UINT16_MAX;
break;
case FR_TYPE_UINT32:
- v.vb_uint32 = s.vb_uint32 = fr_hash_string(alias) & UINT32_MAX;
+ v.vb_uint32 = s.vb_uint32 = fr_hash_string(name) & UINT32_MAX;
break;
case FR_TYPE_UINT64:
- v.vb_uint64 = s.vb_uint64 = fr_hash_string(alias) & UINT64_MAX;
+ v.vb_uint64 = s.vb_uint64 = fr_hash_string(name) & UINT64_MAX;
break;
default:
/*
* If there's no existing value, add an enum
- * with the hash value of the alias.
+ * with the hash value of the name.
*
* This helps with debugging as the values
* are consistent.
*/
if (!fr_dict_enum_by_value(da, &v)) {
add:
- return fr_dict_enum_add_alias(da, alias, &v, false, false);
+ return fr_dict_enum_add_name(da, name, &v, false, false);
}
for (;;) {
if (value->type != da->type) return NULL;
/*
- * First, look up aliases.
+ * First, look up names.
*/
enumv.da = da;
- enumv.alias = "";
- enumv.alias_len = 0;
+ enumv.name = "";
+ enumv.name_len = 0;
/*
- * Look up the attribute alias target, and use
+ * Look up the attribute name target, and use
* the correct attribute number if found.
*/
- dv = fr_hash_table_finddata(dict->values_by_alias, &enumv);
+ dv = fr_hash_table_finddata(dict->values_by_name, &enumv);
if (dv) enumv.da = dv->da;
enumv.value = value;
* - Name of value.
* - NULL if no matching value could be found.
*/
-char const *fr_dict_enum_alias_by_value(fr_dict_attr_t const *da, fr_value_box_t const *value)
+char const *fr_dict_enum_name_by_value(fr_dict_attr_t const *da, fr_value_box_t const *value)
{
fr_dict_enum_t *dv;
fr_dict_t *dict;
dv = fr_dict_enum_by_value(da, value);
if (!dv) return "";
- return dv->alias;
+ return dv->name;
}
/*
* Get a value by its name, keyed off of an attribute.
*/
-fr_dict_enum_t *fr_dict_enum_by_alias(fr_dict_attr_t const *da, char const *alias, ssize_t len)
+fr_dict_enum_t *fr_dict_enum_by_name(fr_dict_attr_t const *da, char const *name, ssize_t len)
{
fr_dict_enum_t *found;
fr_dict_enum_t find = {
.da = da,
- .alias = alias
+ .name = name
};
fr_dict_t *dict;
- if (!alias) return NULL;
+ if (!name) return NULL;
dict = fr_dict_by_da(da);
if (!dict) {
return NULL;
}
- if (len < 0) len = strlen(alias);
- find.alias_len = (size_t)len;
+ if (len < 0) len = strlen(name);
+ find.name_len = (size_t)len;
/*
- * Look up the attribute alias target, and use
+ * Look up the attribute name target, and use
* the correct attribute number if found.
*/
- found = fr_hash_table_finddata(dict->values_by_alias, &find);
+ found = fr_hash_table_finddata(dict->values_by_name, &find);
if (found) find.da = found->da;
- return fr_hash_table_finddata(dict->values_by_alias, &find);
+ return fr_hash_table_finddata(dict->values_by_name, &find);
}
int dict_dlopen(fr_dict_t *dict, char const *name)
dict->attributes_combo = fr_hash_table_create(dict, dict_attr_combo_hash, dict_attr_combo_cmp, hash_pool_free);
if (!dict->attributes_combo) goto error;
- dict->values_by_alias = fr_hash_table_create(dict, dict_enum_alias_hash, dict_enum_alias_cmp, hash_pool_free);
- if (!dict->values_by_alias) goto error;
+ dict->values_by_name = fr_hash_table_create(dict, dict_enum_name_hash, dict_enum_name_cmp, hash_pool_free);
+ if (!dict->values_by_name) goto error;
dict->values_by_da = fr_hash_table_create(dict, dict_enum_value_hash, dict_enum_value_cmp, hash_pool_free);
if (!dict->values_by_da) goto error;
fr_pair_value_snprint(buff, 20, vp, '\0');
str = buff;
} else {
- str = enumv->alias;
+ str = enumv->name;
}
return str;
* @param dst_type to cast to.
* @param dst_enumv Aliases for values contained within this fr_value_box_t.
* If #fr_value_box_t is passed to #fr_value_box_asprint
- * aliases will be printed instead of actual value.
+ * names will be printed instead of actual value.
* @param src Input data.
* @return
* - 0 on success.
*
* The theory here is that the attribute value isn't
* being converted into its presentation format and
- * re-parsed, and the enumv aliases only get applied
+ * re-parsed, and the enumv names only get applied
* when converting internal values to/from strings,
* so it's OK just to swap out the enumv.
*
* @param dst_type to cast to.
* @param dst_enumv Aliases for values contained within this fr_value_box_t.
* If #fr_value_box_t is passed to #fr_value_box_asprint
- * aliases will be printed instead of actual value.
+ * names will be printed instead of actual value.
* @return
* - 0 on success.
* - -1 on failure.
* @param[in] ctx to alloc strings in.
* @param[out] dst where to write parsed value.
* @param[in,out] dst_type of value data to create/dst_type of value created.
- * @param[in] dst_enumv fr_dict_attr_t with string aliases for uint32 values.
+ * @param[in] dst_enumv fr_dict_attr_t with string names for uint32 values.
* @param[in] in String to convert. Binary safe for variable length values
* if len is provided.
* @param[in] inlen may be < 0 in which case strlen(len) is used to determine
ret = dict_attr_sizes[*dst_type][1]; /* Max length */
/*
- * Lookup any aliases before continuing
+ * Lookup any names before continuing
*/
if (dst_enumv) {
char *tmp = NULL;
- char *alias;
- size_t alias_len;
+ char *name;
+ size_t name_len;
fr_dict_enum_t *enumv;
if (len > (sizeof(buffer) - 1)) {
tmp = talloc_array(NULL, char, len + 1);
if (!tmp) return -1;
- alias_len = fr_value_str_unescape((uint8_t *)tmp, in, len, quote);
- alias = tmp;
+ name_len = fr_value_str_unescape((uint8_t *)tmp, in, len, quote);
+ name = tmp;
} else {
- alias_len = fr_value_str_unescape((uint8_t *)buffer, in, len, quote);
- alias = buffer;
+ name_len = fr_value_str_unescape((uint8_t *)buffer, in, len, quote);
+ name = buffer;
}
- alias[alias_len] = '\0';
+ name[name_len] = '\0';
/*
- * Check the alias name is valid first before bothering
+ * Check the name name is valid first before bothering
* to look it up.
*
* Catches any embedded \0 bytes that might cause
* incorrect results.
*/
- if (fr_dict_valid_name(alias, alias_len) <= 0) {
+ if (fr_dict_valid_name(name, name_len) <= 0) {
if (tmp) talloc_free(tmp);
goto parse;
}
- enumv = fr_dict_enum_by_alias(dst_enumv, alias, alias_len);
+ enumv = fr_dict_enum_by_name(dst_enumv, name, name_len);
if (tmp) talloc_free(tmp);
if (!enumv) goto parse;
fr_dict_enum_t const *dv;
dv = fr_dict_enum_by_value(data->enumv, data);
- if (dv) return talloc_typed_strdup(ctx, dv->alias);
+ if (dv) return talloc_typed_strdup(ctx, dv->name);
}
switch (data->type) {
fr_dict_enum_t const *dv;
dv = fr_dict_enum_by_value(data->enumv, data);
- if (dv) return strlcpy(out, dv->alias, outlen);
+ if (dv) return strlcpy(out, dv->name, outlen);
}
switch (data->type) {
* Allow the process module to be specified by
* packet type.
*/
- type_enum = fr_dict_enum_by_alias(attr_packet_type, type_str, -1);
+ type_enum = fr_dict_enum_by_name(attr_packet_type, type_str, -1);
if (!type_enum) {
cf_log_err(ci, "Invalid type \"%s\"", type_str);
return -1;
switch (request->request_state) {
case REQUEST_INIT:
RDEBUG("Received %s ID %i",
- fr_dict_enum_alias_by_value(inst->attr_packet_type, fr_box_uint32(request->packet->code)),
+ fr_dict_enum_name_by_value(inst->attr_packet_type, fr_box_uint32(request->packet->code)),
request->packet->id);
log_request_pair_list(L_DBG_LVL_1, request, request->packet->vps, "");
REDEBUG("Failed ID %i", request->reply->id);
} else {
RDEBUG("Sent %s ID %i",
- fr_dict_enum_alias_by_value(inst->attr_packet_type, fr_box_uint32(request->reply->code)),
+ fr_dict_enum_name_by_value(inst->attr_packet_type, fr_box_uint32(request->reply->code)),
request->reply->id);
}
* Allow the process module to be specified by
* packet type.
*/
- type_enum = fr_dict_enum_by_alias(attr_message_type, type_str, -1);
+ type_enum = fr_dict_enum_by_name(attr_message_type, type_str, -1);
if (!type_enum) {
cf_log_err(ci, "Invalid type \"%s\"", type_str);
return -1;
* Setting 'type = foo' means you MUST have at least a
* 'recv foo' section.
*/
- if (!cf_section_find(server, "recv", type_enum->alias)) {
+ if (!cf_section_find(server, "recv", type_enum->name)) {
cf_log_err(ci, "Failed finding 'recv %s {...} section of virtual server %s",
- type_enum->alias, cf_section_name2(server));
+ type_enum->name, cf_section_name2(server));
return -1;
}
inst = talloc_get_type_abort(parent_inst->data, proto_dhcpv4_t);
inst->code_allowed[code] = true;
- process_app_cs = cf_section_find(listen_cs, type_enum->alias, NULL);
+ process_app_cs = cf_section_find(listen_cs, type_enum->name, NULL);
/*
* Allocate an empty section if one doesn't exist
* this is so defaults get parsed.
*/
if (!process_app_cs) {
- MEM(process_app_cs = cf_section_alloc(listen_cs, listen_cs, type_enum->alias, NULL));
+ MEM(process_app_cs = cf_section_alloc(listen_cs, listen_cs, type_enum->name, NULL));
}
/*
return RLM_MODULE_FAIL;
}
- unlang = cf_section_find(request->server_cs, "recv", dv->alias);
+ unlang = cf_section_find(request->server_cs, "recv", dv->name);
if (!unlang) {
- RWDEBUG("Failed to find 'recv %s' section", dv->alias);
+ RWDEBUG("Failed to find 'recv %s' section", dv->name);
request->reply->code = FR_DHCP_MESSAGE_TYPE_VALUE_DHCP_DO_NOT_RESPOND;
goto send_reply;
}
dv = fr_dict_enum_by_value(da, fr_box_uint8(request->reply->code));
unlang = NULL;
- if (dv) unlang = cf_section_find(request->server_cs, "send", dv->alias);
+ if (dv) unlang = cf_section_find(request->server_cs, "send", dv->name);
if (!unlang) goto send_reply;
*/
if (request->reply->code != FR_DHCP_MESSAGE_TYPE_VALUE_DHCP_DO_NOT_RESPOND) {
dv = fr_dict_enum_by_value(attr_message_type, fr_box_uint8(request->reply->code));
- RWDEBUG("Failed running 'send %s', trying 'send Do-Not-Respond'", dv->alias);
+ RWDEBUG("Failed running 'send %s', trying 'send Do-Not-Respond'", dv->name);
request->reply->code = FR_DHCP_MESSAGE_TYPE_VALUE_DHCP_DO_NOT_RESPOND;
unlang = NULL;
if (!dv) goto send_reply;
- unlang = cf_section_find(request->server_cs, "send", dv->alias);
+ unlang = cf_section_find(request->server_cs, "send", dv->name);
if (unlang) goto rerun_nak;
- RWDEBUG("Not running 'send %s' section as it does not exist", dv->alias);
+ RWDEBUG("Not running 'send %s' section as it does not exist", dv->name);
}
break;
}
for (p = table; p->name; p++) {
value.vb_int32 = p->value;
- if (fr_dict_enum_add_alias(da, p->name, &value, true, false) < 0) return -1;
+ if (fr_dict_enum_add_name(da, p->name, &value, true, false) < 0) return -1;
}
return 0;
* Allow the process module to be specified by
* packet type.
*/
- type_enum = fr_dict_enum_by_alias(attr_packet_type, type_str, -1);
+ type_enum = fr_dict_enum_by_name(attr_packet_type, type_str, -1);
if (!type_enum) {
size_t i;
* Setting 'type = foo' means you MUST have at least a
* 'recv foo' section.
*/
- if (!cf_section_find(server, "recv", type_enum->alias)) {
+ if (!cf_section_find(server, "recv", type_enum->name)) {
cf_log_err(ci, "Failed finding 'recv %s {...} section of virtual server %s",
- type_enum->alias, cf_section_name2(server));
+ type_enum->name, cf_section_name2(server));
return -1;
}
inst->code_allowed[FR_CODE_DISCONNECT_REQUEST] = true;
}
- process_app_cs = cf_section_find(listen_cs, type_enum->alias, NULL);
+ process_app_cs = cf_section_find(listen_cs, type_enum->name, NULL);
/*
* Allocate an empty section if one doesn't exist
* this is so defaults get parsed.
*/
if (!process_app_cs) {
- MEM(process_app_cs = cf_section_alloc(listen_cs, listen_cs, type_enum->alias, NULL));
+ MEM(process_app_cs = cf_section_alloc(listen_cs, listen_cs, type_enum->name, NULL));
}
/*
dv = fr_dict_enum_by_value(vp->da, &vp->data);
if (!dv) goto setup_send;
- unlang = cf_section_find(request->server_cs, "accounting", dv->alias);
+ unlang = cf_section_find(request->server_cs, "accounting", dv->name);
if (!unlang) {
- REDEBUG2("No 'accounting %s' section found: Ignoring it.", dv->alias);
+ REDEBUG2("No 'accounting %s' section found: Ignoring it.", dv->name);
goto setup_send;
}
dv = fr_dict_enum_by_value(attr_packet_type, fr_box_uint32(request->reply->code));
unlang = NULL;
- if (dv) unlang = cf_section_find(request->server_cs, "send", dv->alias);
+ if (dv) unlang = cf_section_find(request->server_cs, "send", dv->name);
if (!unlang) goto send_reply;
auth_type = fr_pair_find_by_da(request->control, attr_auth_type, TAG_ANY);
if (auth_type) {
snprintf(password_buff, sizeof(password_buff), "<via Auth-Type = %s>",
- fr_dict_enum_alias_by_value(auth_type->da, &auth_type->data));
+ fr_dict_enum_name_by_value(auth_type->da, &auth_type->data));
password_str = password_buff;
} else {
password_str = "<no User-Password attribute>";
goto setup_send;
}
- unlang = cf_section_find(request->server_cs, "authenticate", dv->alias);
+ unlang = cf_section_find(request->server_cs, "authenticate", dv->name);
if (!unlang) {
- REDEBUG2("No 'authenticate %s' section found: rejecting the user", dv->alias);
+ REDEBUG2("No 'authenticate %s' section found: rejecting the user", dv->name);
request->reply->code = FR_CODE_ACCESS_REJECT;
goto setup_send;
}
dv = fr_dict_enum_by_value(attr_packet_type, fr_box_uint32(request->reply->code));
unlang = NULL;
- if (dv) unlang = cf_section_find(request->server_cs, "send", dv->alias);
+ if (dv) unlang = cf_section_find(request->server_cs, "send", dv->name);
if (!unlang) goto send_reply;
if (request->reply->code != FR_CODE_ACCESS_REJECT) {
dv = fr_dict_enum_by_value(attr_packet_type, fr_box_uint32(request->reply->code));
- RWDEBUG("Failed running 'send %s', trying 'send Access-Reject'", dv ? dv->alias : "???" );
+ RWDEBUG("Failed running 'send %s', trying 'send Access-Reject'", dv ? dv->name : "???" );
request->reply->code = FR_CODE_ACCESS_REJECT;
unlang = NULL;
if (!dv) goto send_reply;
- unlang = cf_section_find(request->server_cs, "send", dv->alias);
+ unlang = cf_section_find(request->server_cs, "send", dv->name);
if (unlang) goto rerun_nak;
- RWDEBUG("Not running 'send %s' section as it does not exist", dv->alias);
+ RWDEBUG("Not running 'send %s' section as it does not exist", dv->name);
}
/*
}
}
- unlang = cf_section_find(request->server_cs, "recv", dv->alias);
+ unlang = cf_section_find(request->server_cs, "recv", dv->name);
if (!unlang) {
- REDEBUG("Failed to find 'recv %s' section", dv->alias);
+ REDEBUG("Failed to find 'recv %s' section", dv->name);
return RLM_MODULE_FAIL;
}
- RDEBUG("Running 'recv %s' from file %s", dv->alias, cf_filename(unlang));
+ RDEBUG("Running 'recv %s' from file %s", dv->name, cf_filename(unlang));
unlang_interpret_push_section(request, unlang, RLM_MODULE_NOOP, UNLANG_TOP_FRAME);
request->request_state = REQUEST_RECV;
nak:
dv = fr_dict_enum_by_value(attr_packet_type, fr_box_uint32(request->reply->code));
unlang = NULL;
- if (dv) unlang = cf_section_find(request->server_cs, "send", dv->alias);
+ if (dv) unlang = cf_section_find(request->server_cs, "send", dv->name);
if (!unlang) goto send_reply;
*/
if (request->reply->code == request->packet->code + 1) {
dv = fr_dict_enum_by_value(attr_packet_type, fr_box_uint32(request->reply->code));
- RWDEBUG("Failed running 'send %s', trying corresponding NAK section.", dv->alias);
+ RWDEBUG("Failed running 'send %s', trying corresponding NAK section.", dv->name);
request->reply->code = request->packet->code + 2;
unlang = NULL;
if (!dv) goto send_reply;
- unlang = cf_section_find(request->server_cs, "send", dv->alias);
+ unlang = cf_section_find(request->server_cs, "send", dv->name);
if (unlang) goto rerun_nak;
- RWDEBUG("Not running 'send %s' section as it does not exist", dv->alias);
+ RWDEBUG("Not running 'send %s' section as it does not exist", dv->name);
}
/*
* Else it was already a NAK or something else.
dv = fr_dict_enum_by_value(attr_packet_type, fr_box_uint32(request->reply->code));
unlang = NULL;
- if (dv) unlang = cf_section_find(request->server_cs, "send", dv->alias);
+ if (dv) unlang = cf_section_find(request->server_cs, "send", dv->name);
if (!unlang) goto send_reply;
*/
if (request->reply->code != FR_CODE_ACCESS_REJECT) {
dv = fr_dict_enum_by_value(attr_packet_type, fr_box_uint32(request->reply->code));
- if (dv) RWDEBUG("Failed running 'send %s', trying 'send Access-Reject'", dv->alias);
+ if (dv) RWDEBUG("Failed running 'send %s', trying 'send Access-Reject'", dv->name);
request->reply->code = FR_CODE_ACCESS_REJECT;
unlang = NULL;
if (!dv) goto send_reply;
- unlang = cf_section_find(request->server_cs, "send", dv->alias);
+ unlang = cf_section_find(request->server_cs, "send", dv->name);
if (unlang) goto rerun_nak;
- RWDEBUG("Not running 'send %s' section as it does not exist", dv->alias);
+ RWDEBUG("Not running 'send %s' section as it does not exist", dv->name);
}
break;
}
}
RWDEBUG("Ignoring extra Auth-Type = %s",
- fr_dict_enum_alias_by_value(auth_type->da, &vp->data));
+ fr_dict_enum_name_by_value(auth_type->da, &vp->data));
}
/*
goto setup_send;
}
- unlang = cf_section_find(request->server_cs, "process", dv->alias);
+ unlang = cf_section_find(request->server_cs, "process", dv->name);
if (!unlang) {
- REDEBUG2("No 'process %s' section found: rejecting the user.", dv->alias);
+ REDEBUG2("No 'process %s' section found: rejecting the user.", dv->name);
tacacs_status(request, RLM_MODULE_FAIL);
goto setup_send;
}
* Allow the process module to be specified by
* packet type.
*/
- type_enum = fr_dict_enum_by_alias(attr_packet_type, type_str, -1);
+ type_enum = fr_dict_enum_by_name(attr_packet_type, type_str, -1);
if (!type_enum) {
cf_log_err(ci, "Invalid type \"%s\"", type_str);
return -1;
* Setting 'type = foo' means you MUST have at least a
* 'recv foo' section.
*/
- if (!cf_section_find(server, "recv", type_enum->alias)) {
+ if (!cf_section_find(server, "recv", type_enum->name)) {
cf_log_err(ci, "Failed finding 'recv %s {...} section of virtual server %s",
- type_enum->alias, cf_section_name2(server));
+ type_enum->name, cf_section_name2(server));
return -1;
}
inst->code_allowed[code] = true;
- process_app_cs = cf_section_find(listen_cs, type_enum->alias, NULL);
+ process_app_cs = cf_section_find(listen_cs, type_enum->name, NULL);
/*
* Allocate an empty section if one doesn't exist
* this is so defaults get parsed.
*/
if (!process_app_cs) {
- MEM(process_app_cs = cf_section_alloc(listen_cs, listen_cs, type_enum->alias, NULL));
+ MEM(process_app_cs = cf_section_alloc(listen_cs, listen_cs, type_enum->name, NULL));
}
/*
return RLM_MODULE_FAIL;
}
- unlang = cf_section_find(request->server_cs, "recv", dv->alias);
+ unlang = cf_section_find(request->server_cs, "recv", dv->name);
if (!unlang) {
- RWDEBUG("Failed to find 'recv %s' section", dv->alias);
+ RWDEBUG("Failed to find 'recv %s' section", dv->name);
request->reply->code = FR_PACKET_TYPE_VALUE_DO_NOT_RESPOND;
goto send_reply;
}
dv = fr_dict_enum_by_value(attr_packet_type, fr_box_uint32(request->reply->code));
unlang = NULL;
- if (dv) unlang = cf_section_find(request->server_cs, "send", dv->alias);
+ if (dv) unlang = cf_section_find(request->server_cs, "send", dv->name);
if (!unlang) goto send_reply;
if (request->reply->code != FR_PACKET_TYPE_VALUE_DO_NOT_RESPOND) {
dv = fr_dict_enum_by_value(attr_packet_type,
fr_box_uint32(request->reply->code));
- RWDEBUG("Failed running 'send %s', trying 'send Do-Not-Respond'.", dv->alias);
+ RWDEBUG("Failed running 'send %s', trying 'send Do-Not-Respond'.", dv->name);
request->reply->code = FR_PACKET_TYPE_VALUE_DO_NOT_RESPOND;
unlang = NULL;
if (!dv) goto send_reply;
- unlang = cf_section_find(request->server_cs, "send", dv->alias);
+ unlang = cf_section_find(request->server_cs, "send", dv->name);
if (unlang) goto rerun_nak;
- RWDEBUG("Not running 'send %s' section as it does not exist", dv->alias);
+ RWDEBUG("Not running 'send %s' section as it does not exist", dv->name);
}
break;
}
inst->name = cf_section_name2(conf);
if (!inst->name) inst->name = cf_section_name1(conf);
- if (fr_dict_enum_add_alias_next(attr_auth_type, inst->name) < 0) {
+ if (fr_dict_enum_add_name_next(attr_auth_type, inst->name) < 0) {
PERROR("Failed adding %s alias", attr_auth_type->name);
return -1;
}
- inst->auth_type = fr_dict_enum_by_alias(attr_auth_type, inst->name, -1);
+ inst->auth_type = fr_dict_enum_by_name(attr_auth_type, inst->name, -1);
rad_assert(inst->auth_type);
return 0;
*/
if (is_radius_code(packet->code)) {
WRITE("\tPacket-Type = %s\n",
- fr_dict_enum_alias_by_value(attr_packet_type, fr_box_uint32(packet->code)));
+ fr_dict_enum_name_by_value(attr_packet_type, fr_box_uint32(packet->code)));
} else {
WRITE("\tPacket-Type = %u\n", packet->code);
}
if (!name) name = cf_section_name1(conf);
inst->name = name;
- if (fr_dict_enum_add_alias_next(attr_auth_type, inst->name) < 0) {
+ if (fr_dict_enum_add_name_next(attr_auth_type, inst->name) < 0) {
PERROR("Failed adding %s alias", attr_auth_type->name);
return -1;
}
- inst->auth_type = fr_dict_enum_by_alias(attr_auth_type, inst->name, -1);
+ inst->auth_type = fr_dict_enum_by_name(attr_auth_type, inst->name, -1);
rad_assert(inst->auth_type);
return 0;
inst->name = cf_section_name2(cs);
if (!inst->name) inst->name = "eap";
- if (fr_dict_enum_add_alias_next(attr_auth_type, inst->name) < 0) {
+ if (fr_dict_enum_add_name_next(attr_auth_type, inst->name) < 0) {
PERROR("Failed adding %s alias", inst->name);
return -1;
}
- inst->auth_type = fr_dict_enum_by_alias(attr_auth_type, inst->name, -1);
+ inst->auth_type = fr_dict_enum_by_name(attr_auth_type, inst->name, -1);
rad_assert(inst->name);
/*
{
char const *auth_type = cf_pair_value(cf_item_to_pair(ci));
- if (fr_dict_enum_add_alias_next(attr_auth_type, auth_type) < 0) {
+ if (fr_dict_enum_add_name_next(attr_auth_type, auth_type) < 0) {
cf_log_err(ci, "Failed adding %s alias", attr_auth_type->name);
return -1;
}
- *((fr_dict_enum_t **)out) = fr_dict_enum_by_alias(attr_auth_type, auth_type, -1);
+ *((fr_dict_enum_t **)out) = fr_dict_enum_by_name(attr_auth_type, auth_type, -1);
return 0;
}
fr_pair_value_bstrncpy(vp, eap_round->response->type.data, eap_round->response->type.length);
vp->vp_tainted = true;
- unlang = cf_section_find(request->server_cs, "authenticate", inst->auth_type->alias);
+ unlang = cf_section_find(request->server_cs, "authenticate", inst->auth_type->name);
if (!unlang) {
/*
* Call the authenticate section of the *current* virtual server.
{
char const *auth_type = cf_pair_value(cf_item_to_pair(ci));
- if (fr_dict_enum_add_alias_next(attr_auth_type, auth_type) < 0) {
+ if (fr_dict_enum_add_name_next(attr_auth_type, auth_type) < 0) {
cf_log_err(ci, "Failed adding %s alias", attr_auth_type->name);
return -1;
}
- *((fr_dict_enum_t **)out) = fr_dict_enum_by_alias(attr_auth_type, auth_type, -1);
+ *((fr_dict_enum_t **)out) = fr_dict_enum_by_name(attr_auth_type, auth_type, -1);
return 0;
}
/*
* This is a wild & crazy hack.
*/
- unlang = cf_section_find(request->server_cs, "authenticate", inst->auth_type->alias);
+ unlang = cf_section_find(request->server_cs, "authenticate", inst->auth_type->name);
if (!unlang) {
rcode = process_authenticate(inst->auth_type->value->vb_uint32, request);
} else {
if (!name) name = cf_section_name1(conf);
inst->name = name;
- if (fr_dict_enum_add_alias_next(attr_auth_type, inst->name) < 0) {
+ if (fr_dict_enum_add_name_next(attr_auth_type, inst->name) < 0) {
PERROR("Failed adding %s alias", attr_auth_type->name);
return -1;
}
- inst->auth_type = fr_dict_enum_by_alias(attr_auth_type, inst->name, -1);
+ inst->auth_type = fr_dict_enum_by_name(attr_auth_type, inst->name, -1);
rad_assert(inst->auth_type);
xlat_register(inst, inst->name, mschap_xlat, NULL, NULL, 0, XLAT_DEFAULT_BUF_LEN, true);
inst->name = cf_section_name2(conf);
if (!inst->name) inst->name = cf_section_name1(conf);
- if (fr_dict_enum_add_alias_next(attr_auth_type, inst->name) < 0) {
+ if (fr_dict_enum_add_name_next(attr_auth_type, inst->name) < 0) {
PERROR("Failed adding %s alias", attr_auth_type->name);
return -1;
}
- inst->auth_type = fr_dict_enum_by_alias(attr_auth_type, inst->name, -1);
+ inst->auth_type = fr_dict_enum_by_name(attr_auth_type, inst->name, -1);
rad_assert(inst->auth_type);
return 0;
if (!name) name = cf_section_name1(conf);
inst->name = name;
- if (fr_dict_enum_add_alias_next(attr_auth_type, inst->name) < 0) {
+ if (fr_dict_enum_add_name_next(attr_auth_type, inst->name) < 0) {
PERROR("Failed adding %s alias", attr_auth_type->name);
return -1;
}
- inst->auth_type = fr_dict_enum_by_alias(attr_auth_type, inst->name, -1);
+ inst->auth_type = fr_dict_enum_by_name(attr_auth_type, inst->name, -1);
rad_assert(inst->auth_type);
return 0;
* Allow the process module to be specified by
* packet type.
*/
- type_enum = fr_dict_enum_by_alias(attr_packet_type, type_str, -1);
+ type_enum = fr_dict_enum_by_name(attr_packet_type, type_str, -1);
if (!type_enum) {
invalid_code:
cf_log_err(ci, "Unknown or invalid RADIUS packet type '%s'", type_str);
* Allow the process module to be specified by
* packet type.
*/
- type_enum = fr_dict_enum_by_alias(attr_packet_type, type_str, -1);
+ type_enum = fr_dict_enum_by_name(attr_packet_type, type_str, -1);
if (!type_enum) {
invalid_code:
cf_log_err(ci, "Unknown or invalid RADIUS packet type '%s'", type_str);
return RLM_MODULE_NOOP;
}
- cs = cf_section_find(inst->cs, dv->alias, NULL);
+ cs = cf_section_find(inst->cs, dv->name, NULL);
if (!cs) {
- RDEBUG2("No subsection %s", dv->alias);
+ RDEBUG2("No subsection %s", dv->name);
return RLM_MODULE_NOOP;
}
inst->name = cf_section_name2(conf);
if (!inst->name) inst->name = cf_section_name1(conf);
- if (fr_dict_enum_add_alias_next(attr_auth_type, inst->name) < 0) {
+ if (fr_dict_enum_add_name_next(attr_auth_type, inst->name) < 0) {
PERROR("Failed adding %s alias", inst->name);
return -1;
}
- inst->auth_type = fr_dict_enum_by_alias(attr_auth_type, inst->name, -1);
+ inst->auth_type = fr_dict_enum_by_name(attr_auth_type, inst->name, -1);
if (inst->group_attribute) {
group_attribute = inst->group_attribute;
}
#endif
- if (fr_dict_enum_add_alias_next(attr_auth_type, inst->name) < 0) {
+ if (fr_dict_enum_add_name_next(attr_auth_type, inst->name) < 0) {
PERROR("Failed adding %s alias", inst->name);
return -1;
}
- inst->auth_type = fr_dict_enum_by_alias(attr_auth_type, inst->name, -1);
+ inst->auth_type = fr_dict_enum_by_name(attr_auth_type, inst->name, -1);
if (!cf_section_name2(conf)) return 0;
}
value.vb_uint8 = i;
- if (fr_dict_enum_add_alias(attr_dhcp_parameter_request_list, attr->name, &value, true, false) < 0) {
+ if (fr_dict_enum_add_name(attr_dhcp_parameter_request_list, attr->name, &value, true, false) < 0) {
return -1;
}
}
value.vb_uint16 = child->attr;
- if (fr_dict_enum_add_alias(attr_option_request, child->name, &value, true, false) < 0) {
+ if (fr_dict_enum_add_name(attr_option_request, child->name, &value, true, false) < 0) {
fr_dict_autofree(libfreeradius_dhcpv6_dict);
return -1;
}
dv = fr_dict_enum_by_value(attr_tacacs_packet_type, fr_box_uint32(type));
if (!dv) return NULL;
- return dv->alias;
+ return dv->name;
}
uint32_t tacacs_session_id(RADIUS_PACKET const * const packet)