char oid_str[512];
char flags[256];
fr_hash_iter_t iter;
- fr_dict_enum_t *enumv;
+ fr_dict_enum_value_t *enumv;
(void)fr_dict_attr_oid_print(&FR_SBUFF_OUT(oid_str, sizeof(oid_str)), NULL, da, false);
char *value;
char type_str[64];
char *p;
- fr_dict_enum_t *type;
+ fr_dict_enum_value_t *type;
NEXT_LINE(line, buffer); /* Should be the OID */
NEXT_LINE(value, value_buff); /* Should be the value */
{
fr_pair_t *vp;
fr_dcursor_t cursor;
- fr_dict_enum_t *dv;
+ fr_dict_enum_value_t *dv;
if (fr_pair_list_empty(list)) {
fprintf(fp, "\n");
*/
eap_type_t eap_name2type(char const *name)
{
- fr_dict_enum_t *dv;
+ fr_dict_enum_value_t *dv;
dv = fr_dict_enum_by_name(attr_eap_type, name, -1);
if (!dv) return FR_EAP_METHOD_INVALID;
*/
char const *eap_type2name(eap_type_t method)
{
- fr_dict_enum_t *dv;
+ fr_dict_enum_value_t *dv;
dv = fr_dict_enum_by_value(attr_eap_type, fr_box_uint32(method));
if (dv) return dv->name;
* Check for the optional type argument
*/
if (!fr_type_is_null(type_vb->type)) {
- fr_dict_enum_t const *type_enum;
+ fr_dict_enum_value_t const *type_enum;
type_enum = fr_dict_enum_by_name(attr_eap_aka_sim_identity_type,
type_vb->vb_strvalue, type_vb->vb_length);
{
char const *value;
size_t len;
- fr_dict_enum_t *found;
+ fr_dict_enum_value_t *found;
value = json_object_get_string(object);
len = json_object_get_string_len(object);
* should be converted to string types.
*/
if (data->enumv) {
- fr_dict_enum_t *enumv;
+ fr_dict_enum_value_t *enumv;
enumv = fr_dict_enum_by_value(data->enumv, data);
if (enumv) return json_object_new_string(enumv->name);
*/
module_method_id_t module_method_define(module_method_id_t *id_out, char const *name)
{
- fr_dict_enum_t *enumv;
+ fr_dict_enum_value_t *enumv;
fr_assert_msg(attr_module_method, "module method global init must be called first");
*/
char const *module_method_name_by_id(module_method_id_t id)
{
- fr_dict_enum_t *enumv = fr_dict_enum_by_value(attr_module_method, fr_box_uint32(id));
+ fr_dict_enum_value_t *enumv = fr_dict_enum_by_value(attr_module_method, fr_box_uint32(id));
if (!enumv) return NULL;
*/
char const *module_method_name_by_entry(module_method_entry_t const *entry)
{
- fr_dict_enum_t *enumv = fr_dict_enum_by_value(attr_module_method, fr_box_uint32(entry->id));
+ fr_dict_enum_value_t *enumv = fr_dict_enum_by_value(attr_module_method, fr_box_uint32(entry->id));
if (!enumv) return NULL;
* @param[in] type_da to use. Usually attr_auth_type.
* @param[in] enumv Enumeration value of the specified type_da.
*/
-bool module_section_type_set(request_t *request, fr_dict_attr_t const *type_da, fr_dict_enum_t const *enumv)
+bool module_section_type_set(request_t *request, fr_dict_attr_t const *type_da, fr_dict_enum_value_t const *enumv)
{
fr_pair_t *vp;
char const *module_state_method_to_str(module_state_func_table_t const *table,
module_method_t method, char const *def);
-bool module_section_type_set(request_t *request, fr_dict_attr_t const *type_da, fr_dict_enum_t const *enumv);
+bool module_section_type_set(request_t *request, fr_dict_attr_t const *type_da, fr_dict_enum_value_t const *enumv);
/** @} */
/** @name Module and module thread lookup
while ((subcs = cf_section_find_next(server_cs, subcs, subcs_name, CF_IDENT_ANY))) {
char const *name2;
- fr_dict_enum_t *dv;
+ fr_dict_enum_value_t *dv;
name2 = cf_section_name2(subcs);
if (!name2) {
char const *module;
char const *component;
fr_dict_attr_t const *da;
- fr_dict_enum_t const *dv;
+ fr_dict_enum_value_t const *dv;
CONF_SECTION *subcs;
fr_dict_t const *dict_internal;
{
unlang_group_t *g;
unlang_call_t *gext;
- fr_dict_enum_t const *type_enum;
+ fr_dict_enum_value_t const *type_enum;
fr_pair_t *packet_type_vp = NULL;
/*
fr_dict_t const *dict;
fr_dict_attr_t const *da = NULL;
- fr_dict_enum_t const *type_enum = NULL;
+ fr_dict_enum_value_t const *type_enum = NULL;
char const *packet_name = NULL;
char *p, *namespace = NULL;
if (gext->type_enum) {
child->packet->code = vp->vp_uint32 = gext->type_enum->value->vb_uint32;
} else {
- fr_dict_enum_t const *type_enum;
+ fr_dict_enum_value_t const *type_enum;
fr_pair_t *attr;
if (tmpl_find_vp(&attr, request, gext->vpt) < 0) {
fr_dict_t const *dict; //!< Dictionary of the subrequest protocol.
fr_dict_attr_t const *attr_packet_type; //!< Packet-type attribute in the subrequest protocol.
- fr_dict_enum_t const *type_enum; //!< Static enumeration value for attr_packet_type
+ fr_dict_enum_value_t const *type_enum; //!< Static enumeration value for attr_packet_type
///< if the packet-type is static.
} unlang_subrequest_t;
uint8_t ext[FR_DICT_ENUM_EXT_MAX]; //!< Extensions to the dictionary attribute.
fr_dict_attr_t const *child_struct[]; //!< for key fields
-} fr_dict_enum_t CC_HINT(aligned(FR_EXT_ALIGNMENT));
+} fr_dict_enum_value_t CC_HINT(aligned(FR_EXT_ALIGNMENT));
/** Private enterprise
*
fr_dict_attr_t const *fr_dict_attr_child_by_num(fr_dict_attr_t const *parent, unsigned int attr);
-fr_dict_enum_t *fr_dict_enum_by_value(fr_dict_attr_t const *da, fr_value_box_t const *value);
+fr_dict_enum_value_t *fr_dict_enum_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_name(fr_dict_attr_t const *da, char const *name, ssize_t len);
+fr_dict_enum_value_t *fr_dict_enum_by_name(fr_dict_attr_t const *da, char const *name, ssize_t len);
/** @} */
/** @name Dictionary and protocol loading
fr_dict_attr_t *da_dst = talloc_get_type_abort(chunk_dst, fr_dict_attr_t);
fr_dict_attr_ext_enumv_t *src_ext = src_ext_ptr;
fr_hash_iter_t iter;
- fr_dict_enum_t *enumv;
+ fr_dict_enum_value_t *enumv;
bool has_child = fr_dict_attr_is_key_field(da_src);
if (!src_ext->value_by_name) return 0;
*
*/
fr_ext_t const fr_dict_enum_ext_def = {
- .offset_of_exts = offsetof(fr_dict_enum_t, ext),
+ .offset_of_exts = offsetof(fr_dict_enum_value_t, ext),
.name_table = dict_enum_ext_table,
.name_table_len = &dict_enum_ext_table_len,
.max = FR_DICT_ENUM_EXT_MAX,
{
fr_dict_attr_debug_t *our_uctx = uctx;
fr_hash_iter_t iter;
- fr_dict_enum_t const *enumv;
+ fr_dict_enum_value_t const *enumv;
fr_dict_attr_ext_enumv_t *ext;
fr_dict_attr_flags_print(&FR_SBUFF_OUT(our_uctx->flags, sizeof(our_uctx->flags)),
*/
static uint32_t dict_enum_name_hash(void const *data)
{
- fr_dict_enum_t const *enumv = data;
+ fr_dict_enum_value_t const *enumv = data;
return dict_hash_name((void const *)enumv->name, enumv->name_len);
}
*/
static int8_t dict_enum_name_cmp(void const *one, void const *two)
{
- fr_dict_enum_t const *a = one;
- fr_dict_enum_t const *b = two;
+ fr_dict_enum_value_t const *a = one;
+ fr_dict_enum_value_t const *b = two;
int ret;
ret = strcasecmp(a->name, b->name);
*/
static uint32_t dict_enum_value_hash(void const *data)
{
- fr_dict_enum_t const *enumv = data;
+ fr_dict_enum_value_t const *enumv = data;
return fr_value_box_hash(enumv->value);
}
*/
static int8_t dict_enum_value_cmp(void const *one, void const *two)
{
- fr_dict_enum_t const *a = one;
- fr_dict_enum_t const *b = two;
+ fr_dict_enum_value_t const *a = one;
+ fr_dict_enum_value_t const *b = two;
int ret;
ret = fr_value_box_cmp(a->value, b->value); /* not yet int8_t! */
* There is no other place for the sub-structures to go. In the
* future, we may extend the functionality of the `key` field, by
* allowing non-integer data types. That would require storing keys
- * as #fr_dict_enum_t, and then placing the child (i.e. sub)
+ * as #fr_dict_enum_value_t, and then placing the child (i.e. sub)
* structures there. But that would involve adding children to
* enums, which is currently not supported.
*
fr_dict_attr_t const *child_struct)
{
size_t len;
- fr_dict_enum_t *enumv = NULL;
+ fr_dict_enum_value_t *enumv = NULL;
fr_value_box_t *enum_value = NULL;
fr_dict_attr_ext_enumv_t *ext;
* Initialise enumv hash tables
*/
if (!ext->value_by_name || !ext->name_by_value) {
- ext->value_by_name = fr_hash_table_talloc_alloc(da, fr_dict_enum_t, dict_enum_name_hash,
+ ext->value_by_name = fr_hash_table_talloc_alloc(da, fr_dict_enum_value_t, dict_enum_name_hash,
dict_enum_name_cmp, hash_pool_free);
if (!ext->value_by_name) {
fr_strerror_printf("Failed allocating \"value_by_name\" table");
return -1;
}
- ext->name_by_value = fr_hash_table_talloc_alloc(da, fr_dict_enum_t, dict_enum_value_hash,
+ ext->name_by_value = fr_hash_table_talloc_alloc(da, fr_dict_enum_value_t, dict_enum_value_hash,
dict_enum_value_cmp, NULL);
if (!ext->name_by_value) {
fr_strerror_printf("Failed allocating \"name_by_value\" table");
* Allocate a structure to map between
* the name and value.
*/
- enumv = talloc_zero_size(da, sizeof(fr_dict_enum_t) + sizeof(enumv->child_struct[0]) * fr_dict_attr_is_key_field(da));
+ enumv = talloc_zero_size(da, sizeof(fr_dict_enum_value_t) + sizeof(enumv->child_struct[0]) * fr_dict_attr_is_key_field(da));
if (!enumv) {
oom:
fr_strerror_printf("%s: Out of memory", __FUNCTION__);
return -1;
}
- talloc_set_type(enumv, fr_dict_enum_t);
+ talloc_set_type(enumv, fr_dict_enum_value_t);
enumv->name = talloc_typed_strdup(enumv, name);
enumv->name_len = strlen(name);
memcpy(&tmp, &enumv, sizeof(tmp));
if (!fr_hash_table_insert(ext->value_by_name, tmp)) {
- fr_dict_enum_t *old;
+ fr_dict_enum_value_t *old;
/*
* Suppress duplicates with the same
* @param[in] da to search in.
* @param[in] value to search for.
* @return
- * - Matching #fr_dict_enum_t.
- * - NULL if no matching #fr_dict_enum_t could be found.
+ * - Matching #fr_dict_enum_value_t.
+ * - NULL if no matching #fr_dict_enum_value_t could be found.
*/
-fr_dict_enum_t *fr_dict_enum_by_value(fr_dict_attr_t const *da, fr_value_box_t const *value)
+fr_dict_enum_value_t *fr_dict_enum_by_value(fr_dict_attr_t const *da, fr_value_box_t const *value)
{
fr_dict_attr_ext_enumv_t *ext;
*/
if (value->type != da->type) return NULL;
- return fr_hash_table_find(ext->name_by_value, &(fr_dict_enum_t){ .value = value });
+ return fr_hash_table_find(ext->name_by_value, &(fr_dict_enum_value_t){ .value = value });
}
/** Lookup the name of an enum value in a #fr_dict_attr_t
*/
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_enum_value_t *dv;
dv = fr_dict_enum_by_value(da, value);
if (!dv) return NULL;
/*
* Get a value by its name, keyed off of an attribute.
*/
-fr_dict_enum_t *fr_dict_enum_by_name(fr_dict_attr_t const *da, char const *name, ssize_t len)
+fr_dict_enum_value_t *fr_dict_enum_by_name(fr_dict_attr_t const *da, char const *name, ssize_t len)
{
fr_dict_attr_ext_enumv_t *ext;
if (len < 0) len = strlen(name);
- return fr_hash_table_find(ext->value_by_name, &(fr_dict_enum_t){ .name = name, .name_len = len});
+ return fr_hash_table_find(ext->value_by_name, &(fr_dict_enum_value_t){ .name = name, .name_len = len});
}
int dict_dlopen(fr_dict_t *dict, char const *name)
int fr_dict_enum_autoload(fr_dict_enum_autoload_t const *to_load)
{
fr_dict_enum_autoload_t const *p = to_load;
- fr_dict_enum_t const *enumv;
+ fr_dict_enum_value_t const *enumv;
for (p = to_load; p->out; p++) {
if (unlikely(!p->attr)) {
char const *fr_pair_value_enum(fr_pair_t const *vp, char buff[20])
{
char const *str;
- fr_dict_enum_t const *enumv = NULL;
+ fr_dict_enum_value_t const *enumv = NULL;
if (!fr_box_is_numeric(&vp->data)) {
fr_strerror_printf("Pair %s is not numeric", vp->da->name);
*/
int fr_pair_value_enum_box(fr_value_box_t const **out, fr_pair_t *vp)
{
- fr_dict_enum_t const *dv;
+ fr_dict_enum_value_t const *dv;
if (!out || !vp ) return -1;
*/
if (key_vp) {
ssize_t slen;
- fr_dict_enum_t const *enumv;
+ fr_dict_enum_value_t const *enumv;
child = NULL;
FR_PROTO_HEX_DUMP(p, (end - p), "fr_struct_from_network - substruct");
char *tmp = NULL;
char *name;
size_t name_len;
- fr_dict_enum_t *enumv;
+ fr_dict_enum_value_t *enumv;
if (len > (sizeof(buffer) - 1)) {
name_len = fr_value_str_aunescape(NULL, &tmp,
static int type_parse(UNUSED TALLOC_CTX *ctx, void *out, void *parent, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
{
proto_cron_t *inst = talloc_get_type_abort(parent, proto_cron_t);
- fr_dict_enum_t const *type_enum;
+ fr_dict_enum_value_t const *type_enum;
CONF_PAIR *cp = cf_item_to_pair(ci);
char const *value = cf_pair_value(cp);
static int type_parse(UNUSED TALLOC_CTX *ctx, void *out, void *parent, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
{
proto_detail_t *inst = talloc_get_type_abort(parent, proto_detail_t);
- fr_dict_enum_t const *type_enum;
+ fr_dict_enum_value_t const *type_enum;
CONF_PAIR *cp = cf_item_to_pair(ci);
char const *value = cf_pair_value(cp);
CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
{
proto_dhcpv4_t *inst = talloc_get_type_abort(parent, proto_dhcpv4_t);
- fr_dict_enum_t *dv;
+ fr_dict_enum_value_t *dv;
CONF_PAIR *cp;
char const *value;
CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
{
proto_dhcpv6_t *inst = talloc_get_type_abort(parent, proto_dhcpv6_t);
- fr_dict_enum_t *dv;
+ fr_dict_enum_value_t *dv;
CONF_PAIR *cp;
char const *value;
static int type_parse(UNUSED TALLOC_CTX *ctx, void *out, void *parent, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
{
proto_load_t *inst = talloc_get_type_abort(parent, proto_load_t);
- fr_dict_enum_t const *type_enum;
+ fr_dict_enum_value_t const *type_enum;
CONF_PAIR *cp = cf_item_to_pair(ci);
char const *value = cf_pair_value(cp);
static int type_parse(UNUSED TALLOC_CTX *ctx, void *out, void *parent, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
{
proto_radius_t *inst = talloc_get_type_abort(parent, proto_radius_t);
- fr_dict_enum_t *dv;
+ fr_dict_enum_value_t *dv;
CONF_PAIR *cp;
char const *value;
static int type_parse(UNUSED TALLOC_CTX *ctx, void *out, void *parent, CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
{
proto_tacacs_t *inst = talloc_get_type_abort(parent, proto_tacacs_t);
- fr_dict_enum_t *dv;
+ fr_dict_enum_value_t *dv;
CONF_PAIR *cp;
char const *value;
CONF_ITEM *ci, UNUSED CONF_PARSER const *rule)
{
proto_vmps_t *inst = talloc_get_type_abort(parent, proto_vmps_t);
- fr_dict_enum_t *dv;
+ fr_dict_enum_value_t *dv;
CONF_PAIR *cp;
char const *value;
typedef struct {
char const *name; //!< Auth-Type value for this module instance.
- fr_dict_enum_t *auth_type;
+ fr_dict_enum_value_t *auth_type;
} rlm_chap_t;
static fr_dict_t const *dict_freeradius;
typedef struct {
char const *name; //!< Auth-Type value for this module instance.
- fr_dict_enum_t *auth_type;
+ fr_dict_enum_value_t *auth_type;
} rlm_digest_t;
static fr_dict_t const *dict_freeradius;
rlm_eap_require_realm_t require_realm; //!< Whether we require the outer identity
///< to contain a realm.
char const *name; //!< Name of this instance.
- fr_dict_enum_t *auth_type;
+ fr_dict_enum_value_t *auth_type;
fr_randctx rand_pool; //!< Pool of random data.
} rlm_eap_t;
*/
typedef struct {
char const *challenge;
- fr_dict_enum_t const *auth_type;
+ fr_dict_enum_value_t const *auth_type;
} rlm_eap_gtc_t;
static CONF_PARSER submodule_config[] = {
cf_log_err(ci, "Failed adding %s alias", attr_auth_type->name);
return -1;
}
- *((fr_dict_enum_t **)out) = fr_dict_enum_by_name(attr_auth_type, auth_type, -1);
+ *((fr_dict_enum_value_t **)out) = fr_dict_enum_by_name(attr_auth_type, auth_type, -1);
return 0;
}
bool with_ntdomain_hack;
bool send_error;
char const *identity;
- fr_dict_enum_t *auth_type;
+ fr_dict_enum_value_t *auth_type;
} rlm_eap_mschapv2_t;
static CONF_PARSER submodule_config[] = {
cf_log_err(ci, "Failed adding %s alias", attr_auth_type->name);
return -1;
}
- *((fr_dict_enum_t **)out) = fr_dict_enum_by_name(attr_auth_type, auth_type, -1);
+ *((fr_dict_enum_value_t **)out) = fr_dict_enum_by_name(attr_auth_type, auth_type, -1);
return 0;
}
typedef struct {
char const *name;
- fr_dict_enum_t *auth_type;
+ fr_dict_enum_value_t *auth_type;
bool normify;
typedef struct {
char const *name; //!< Auth-Type value for this module instance.
- fr_dict_enum_t *auth_type;
+ fr_dict_enum_value_t *auth_type;
} rlm_opendirectory_t;
#ifndef HAVE_DECL_MBR_CHECK_SERVICE_MEMBERSHIP
*/
typedef struct {
char const *name;
- fr_dict_enum_t *auth_type;
+ fr_dict_enum_value_t *auth_type;
bool normify;
} rlm_pap_t;
{
char const *type_str = cf_pair_value(cf_item_to_pair(ci));
CONF_SECTION *cs = cf_item_to_section(cf_parent(ci));
- fr_dict_enum_t const *type_enum;
+ fr_dict_enum_value_t const *type_enum;
uint32_t code;
/*
{
char const *type_str = cf_pair_value(cf_item_to_pair(ci));
CONF_SECTION *cs = cf_item_to_section(cf_parent(ci));
- fr_dict_enum_t const *type_enum;
+ fr_dict_enum_value_t const *type_enum;
uint32_t code;
/*
rlm_rediswho_t const *inst = talloc_get_type_abort_const(mctx->instance, rlm_rediswho_t);
rlm_rcode_t rcode;
fr_pair_t *vp;
- fr_dict_enum_t *dv;
+ fr_dict_enum_value_t *dv;
CONF_SECTION *cs;
char const *insert, *trim, *expire;
fr_time_delta_t timeout; //!< Timeout for connection and server response
fr_curl_tls_t tls; //!< Used for handled all tls specific curl components
char const *name; //!< Auth-Type value for this module instance.
- fr_dict_enum_t *auth_type;
+ fr_dict_enum_value_t *auth_type;
fr_map_list_t header_maps; //!< Attribute map used to process header elements
CONF_SECTION *cs;
bool set_date;
typedef struct {
char const *name;
fr_pool_t *wb_pool;
- fr_dict_enum_t *auth_type;
+ fr_dict_enum_value_t *auth_type;
/* main config */
tmpl_t *wb_username;
*/
typedef struct {
char const *name; //!< Instance name.
- fr_dict_enum_t *auth_type; //!< Our Auth-Type.
+ fr_dict_enum_value_t *auth_type; //!< Our Auth-Type.
unsigned int id_len; //!< The length of the Public ID portion of the OTP string.
bool split; //!< Split password string into components.
bool decrypt; //!< Decrypt the OTP string using the yubikey library.
rlm_rcode_t rcode = request->rcode;
fr_pair_t *vp;
CONF_SECTION *cs;
- fr_dict_enum_t const *dv;
+ fr_dict_enum_value_t const *dv;
fr_process_state_t const *state;
process_radius_t const *inst = talloc_get_type_abort_const(mctx->instance, process_radius_t);
rlm_rcode_t rcode = request->rcode;
fr_pair_t *vp;
CONF_SECTION *cs;
- fr_dict_enum_t const *dv;
+ fr_dict_enum_value_t const *dv;
fr_process_state_t const *state;
process_radius_t const *inst = talloc_get_type_abort_const(mctx->instance, process_radius_t);
*/
if (state->attr_process) {
fr_pair_t *vp;
- fr_dict_enum_t const *dv;
+ fr_dict_enum_value_t const *dv;
CONF_SECTION *subcs;
vp = fr_pair_find_by_da(&request->request_pairs, *state->attr_process, 0);
rlm_rcode_t rcode = request->rcode;
fr_pair_t *vp;
CONF_SECTION *cs;
- fr_dict_enum_t const *dv;
+ fr_dict_enum_value_t const *dv;
fr_process_state_t const *state;
process_ttls_t const *inst = talloc_get_type_abort_const(mctx->instance, process_ttls_t);