* They also specify what behaviour should be used when the attribute is merged into a new list/tree.
*/
typedef struct value_pair {
- const DICT_ATTR *da; //!< Dictionary attribute defines the attribute
+ DICT_ATTR const *da; //!< Dictionary attribute defines the attribute
//!< number, vendor and type of the attribute.
struct value_pair *next;
void dict_free(void);
int dict_read(char const *dir, char const *filename);
void dict_attr_free(DICT_ATTR const **da);
-const DICT_ATTR *dict_attr_copy(DICT_ATTR const *da, int vp_free);
-const DICT_ATTR *dict_attrunknown(unsigned int attr, unsigned int vendor, int vp_free);
-const DICT_ATTR *dict_attrunknownbyname(char const *attribute, int vp_free);
-const DICT_ATTR *dict_attrbyvalue(unsigned int attr, unsigned int vendor);
-const DICT_ATTR *dict_attrbyname(char const *attr);
-const DICT_ATTR *dict_attrbytype(unsigned int attr, unsigned int vendor,
+DICT_ATTR const *dict_attr_copy(DICT_ATTR const *da, int vp_free);
+DICT_ATTR const *dict_attrunknown(unsigned int attr, unsigned int vendor, int vp_free);
+DICT_ATTR const *dict_attrunknownbyname(char const *attribute, int vp_free);
+DICT_ATTR const *dict_attrbyvalue(unsigned int attr, unsigned int vendor);
+DICT_ATTR const *dict_attrbyname(char const *attr);
+DICT_ATTR const *dict_attrbytype(unsigned int attr, unsigned int vendor,
PW_TYPE type);
-const DICT_ATTR *dict_attrbyparent(DICT_ATTR const *parent, unsigned int attr,
+DICT_ATTR const *dict_attrbyparent(DICT_ATTR const *parent, unsigned int attr,
unsigned int vendor);
int dict_attr_child(DICT_ATTR const *parent,
unsigned int *pattr, unsigned int *pvendor);
static int dict_attr_name_cmp(void const *one, void const *two)
{
- const DICT_ATTR *a = one;
- const DICT_ATTR *b = two;
+ DICT_ATTR const *a = one;
+ DICT_ATTR const *b = two;
return strcasecmp(a->name, b->name);
}
static uint32_t dict_attr_value_hash(void const *data)
{
uint32_t hash;
- const DICT_ATTR *attr = data;
+ DICT_ATTR const *attr = data;
hash = fr_hash(&attr->vendor, sizeof(attr->vendor));
return fr_hash_update(&attr->attr, sizeof(attr->attr), hash);
static int dict_attr_value_cmp(void const *one, void const *two)
{
- const DICT_ATTR *a = one;
- const DICT_ATTR *b = two;
+ DICT_ATTR const *a = one;
+ DICT_ATTR const *b = two;
if (a->vendor < b->vendor) return -1;
if (a->vendor > b->vendor) return +1;
static uint32_t dict_attr_combo_hash(void const *data)
{
uint32_t hash;
- const DICT_ATTR *attr = data;
+ DICT_ATTR const *attr = data;
hash = fr_hash(&attr->vendor, sizeof(attr->vendor));
hash = fr_hash_update(&attr->type, sizeof(attr->type), hash);
static int dict_attr_combo_cmp(void const *one, void const *two)
{
- const DICT_ATTR *a = one;
- const DICT_ATTR *b = two;
+ DICT_ATTR const *a = one;
+ DICT_ATTR const *b = two;
if (a->type < b->type) return -1;
if (a->type > b->type) return +1;
size_t namelen;
static int max_attr = 0;
const uint8_t *p;
- const DICT_ATTR *da;
+ DICT_ATTR const *da;
DICT_ATTR *n;
namelen = strlen(name);
int dict_addvalue(char const *namestr, char const *attrstr, int value)
{
size_t length;
- const DICT_ATTR *dattr;
+ DICT_ATTR const *dattr;
DICT_VALUE *dval;
- static const DICT_ATTR *last_attr = NULL;
+ static DICT_ATTR const *last_attr = NULL;
if (!*namestr) {
fr_strerror_printf("dict_addvalue: empty names are not permitted");
{
char const *p;
unsigned int value;
- const DICT_ATTR *da = NULL;
+ DICT_ATTR const *da = NULL;
if (tlv_depth > fr_attr_max_tlv) {
fr_strerror_printf("Too many sub-attributes");
/*
* Bamboo skewers under the fingernails in 5, 4, 3, 2, ...
*/
-static const DICT_ATTR *dict_parent(unsigned int attr, unsigned int vendor)
+static DICT_ATTR const *dict_parent(unsigned int attr, unsigned int vendor)
{
if (vendor < FR_MAX_VENDOR) {
return dict_attrbyvalue(attr & 0xff, vendor);
}
if (oid) {
- const DICT_ATTR *da;
+ DICT_ATTR const *da;
vendor = block_vendor;
static int process_value_alias(char const* fn, int const line, char **argv,
int argc)
{
- const DICT_ATTR *my_da, *da;
+ DICT_ATTR const *my_da, *da;
DICT_VALUE *dval;
if (argc != 2) {
struct stat statbuf;
char *argv[MAX_ARGV];
int argc;
- const DICT_ATTR *da, *block_tlv[MAX_TLV_NEST + 1];
+ DICT_ATTR const *da, *block_tlv[MAX_TLV_NEST + 1];
int which_block_tlv = 0;
block_tlv[0] = NULL;
return -1;
if (value_fixup) {
- const DICT_ATTR *a;
+ DICT_ATTR const *a;
value_fixup_t *this, *next;
for (this = value_fixup; this != NULL; this = next) {
* VALUE_PAIR which contains it.
* @return return a copy of the da.
*/
-const DICT_ATTR *dict_attr_copy(DICT_ATTR const *da, int vp_free)
+DICT_ATTR const *dict_attr_copy(DICT_ATTR const *da, int vp_free)
{
DICT_ATTR *copy;
* @param[in] vp_free if > 0 DICT_ATTR will be freed on VALUE_PAIR free.
* @return new dictionary attribute.
*/
-const DICT_ATTR *dict_attrunknown(unsigned int attr, unsigned int vendor,
+DICT_ATTR const *dict_attrunknown(unsigned int attr, unsigned int vendor,
int vp_free)
{
DICT_ATTR *da;
* @param[in] vp_free if > 0 DICT_ATTR will be freed on VALUE_PAIR free.
* @return new da or NULL on error.
*/
-const DICT_ATTR *dict_attrunknownbyname(char const *attribute, int vp_free)
+DICT_ATTR const *dict_attrunknownbyname(char const *attribute, int vp_free)
{
unsigned int attr, vendor = 0;
unsigned int dv_type = 1; /* The type of vendor field */
char *q;
DICT_VENDOR *dv;
- const DICT_ATTR *da;
+ DICT_ATTR const *da;
/*
* Pull off vendor prefix first.
/*
* Get an attribute by its numerical value.
*/
-const DICT_ATTR *dict_attrbyvalue(unsigned int attr, unsigned int vendor)
+DICT_ATTR const *dict_attrbyvalue(unsigned int attr, unsigned int vendor)
{
DICT_ATTR dattr;
*
* @return The attribute, or NULL if not found
*/
-const DICT_ATTR *dict_attrbytype(unsigned int attr, unsigned int vendor,
+DICT_ATTR const *dict_attrbytype(unsigned int attr, unsigned int vendor,
PW_TYPE type)
{
DICT_ATTR dattr;
/*
* Get an attribute by it's numerical value, and the parent
*/
-const DICT_ATTR *dict_attrbyparent(DICT_ATTR const *parent, unsigned int attr, unsigned int vendor)
+DICT_ATTR const *dict_attrbyparent(DICT_ATTR const *parent, unsigned int attr, unsigned int vendor)
{
unsigned int my_attr, my_vendor;
DICT_ATTR dattr;
/*
* Get an attribute by its name.
*/
-const DICT_ATTR *dict_attrbyname(char const *name)
+DICT_ATTR const *dict_attrbyname(char const *name)
{
DICT_ATTR *da;
uint32_t buffer[(sizeof(*da) + DICT_ATTR_MAX_NAME_LEN + 3)/4];
#ifndef NDEBUG
if ((fr_debug_flag > 3) && fr_log_fp) {
- const DICT_ATTR *da;
+ DICT_ATTR const *da;
da = dict_attrbyvalue(svp->da->attr & ((1 << fr_attr_shift[nest ]) - 1), svp->da->vendor);
if (da) fprintf(fr_log_fp, "\t%s = ...\n", da->name);
VALUE_PAIR **pvp)
{
const uint8_t *data = start;
- const DICT_ATTR *child;
+ DICT_ATTR const *child;
VALUE_PAIR *head, **tail;
if (length < 3) return -1; /* type, length, value */
{
unsigned int attribute;
ssize_t attrlen, my_len;
- const DICT_ATTR *da;
+ DICT_ATTR const *da;
#ifndef NDEBUG
if (length <= (dv->type + dv->length)) {
size_t datalen;
ssize_t rcode;
uint32_t vendor;
- const DICT_ATTR *child;
+ DICT_ATTR const *child;
DICT_VENDOR *dv;
VALUE_PAIR *vp;
const uint8_t *data = start;
{
ssize_t rcode;
- const DICT_ATTR *da;
+ DICT_ATTR const *da;
if ((length < 2) || (data[1] < 2) || (data[1] > length)) {
fr_strerror_printf("rad_attr2vp: Insufficient data");
uint8_t const *data, size_t length,
VALUE_PAIR **pvp)
{
- const DICT_ATTR *da;
+ DICT_ATTR const *da;
if (!data || (length == 0) || !pvp) return -1;
*/
VALUE_PAIR *paircreate(TALLOC_CTX *ctx, unsigned int attr, unsigned int vendor)
{
- const DICT_ATTR *da;
+ DICT_ATTR const *da;
da = dict_attrbyvalue(attr, vendor);
if (!da) {
*/
int pair2unknown(VALUE_PAIR *vp)
{
- const DICT_ATTR *da;
+ DICT_ATTR const *da;
VERIFY_VP(vp);
if (vp->da->flags.is_unknown) {
*/
case PW_TYPE_COMBO_IP:
{
- const DICT_ATTR *da;
+ DICT_ATTR const *da;
if (inet_pton(AF_INET6, value, &vp->vp_ipv6addr) > 0) {
da = dict_attrbytype(vp->da->attr, vp->da->vendor,
FR_TOKEN op)
{
VALUE_PAIR *vp;
- const DICT_ATTR *da;
+ DICT_ATTR const *da;
uint8_t *data;
size_t size;
VALUE_PAIR *pairmake(TALLOC_CTX *ctx, VALUE_PAIR **vps,
char const *attribute, char const *value, FR_TOKEN op)
{
- const DICT_ATTR *da;
+ DICT_ATTR const *da;
VALUE_PAIR *vp;
char *tc, *ts;
int8_t tag;
c->src_ipaddr.af = AF_UNSPEC;
for (i = 0; dynamic_config[i].name != NULL; i++) {
- const DICT_ATTR *da;
+ DICT_ATTR const *da;
VALUE_PAIR *vp;
da = dict_attrbyname(dynamic_config[i].name);
request_refs_t request_def,
pair_lists_t list_def)
{
- const DICT_ATTR *da;
+ DICT_ATTR const *da;
char const *p;
size_t len;
vpt->type = VPT_TYPE_LIST;
} else {
- const DICT_ATTR *da;
+ DICT_ATTR const *da;
da = dict_attrbyname(p);
if (!da) {
vpt->type = VPT_TYPE_LITERAL;
cf_log_err(ci, "Can't copy list into an attribute");
goto error;
}
-
+
/*
* Can't copy an xlat expansion or literal into a list,
* we don't know what type of attribute we'd need
indexed_modcallable *subcomp;
char const *modname;
char const *visiblename;
- const DICT_ATTR *dattr;
+ DICT_ATTR const *dattr;
/*
* Find the attribute used to store VALUEs for this section.
for (comp = 0; comp < RLM_COMPONENT_COUNT; ++comp) {
CONF_SECTION *subcs;
CONF_ITEM *modref;
- const DICT_ATTR *dattr;
+ DICT_ATTR const *dattr;
subcs = cf_section_sub_find(cs,
section_type_value[comp].section);
if (!found) do {
CONF_SECTION *subcs;
#ifdef WITH_DHCP
- const DICT_ATTR *dattr;
+ DICT_ATTR const *dattr;
#endif
subcs = cf_section_sub_find(cs, "vmps");
case PW_DIGEST_USER_NAME:
/* overlapping! */
{
- const DICT_ATTR *da;
+ DICT_ATTR const *da;
uint8_t *p;
p = talloc_array(vp, uint8_t, vp->length + 2);
char const *fmt; //!< The format string.
size_t len; //!< Length of the format string.
- const DICT_ATTR *da; //!< the name of the dictionary attribute
+ DICT_ATTR const *da; //!< the name of the dictionary attribute
int num; //!< attribute number
int tag; //!< attribute tag
pair_lists_t list; //!< list of which attribute
*/
while (next < (data + len)) {
int num_entries, alen;
- const DICT_ATTR *da;
+ DICT_ATTR const *da;
p = next;
{
int ttl;
VALUE_PAIR *vp, *found, **to_req, **to_cache, **from;
- const DICT_ATTR *da;
+ DICT_ATTR const *da;
int merge = true;
REQUEST *context;
rlm_cache_t *inst = instance;
VALUE_PAIR *vp, *vps;
pair_lists_t list;
- const DICT_ATTR *target;
+ DICT_ATTR const *target;
char const *p = fmt;
int ret = 0;
static int mod_instantiate(CONF_SECTION *conf, void *instance)
{
rlm_counter_t *inst = instance;
- const DICT_ATTR *dattr;
+ DICT_ATTR const *dattr;
DICT_VALUE *dval;
ATTR_FLAGS flags;
time_t now;
static uint32_t detail_hash(void const *data)
{
- const DICT_ATTR *da = data;
+ DICT_ATTR const *da = data;
return fr_hash(&da, sizeof(da));
}
static int detail_cmp(void const *a, void const *b)
{
- const DICT_ATTR *one = a;
- const DICT_ATTR *two = b;
+ DICT_ATTR const *one = a;
+ DICT_ATTR const *two = b;
return one - two;
}
ci != NULL;
ci = cf_item_find_next(cs, ci)) {
char const *attr;
- const DICT_ATTR *da;
+ DICT_ATTR const *da;
if (!cf_item_is_pair(ci)) continue;
case PW_TYPE_INTEGER:
case PW_TYPE_DATE:
if (size != vp->length) {
- const DICT_ATTR *da;
+ DICT_ATTR const *da;
/*
* Bad format. Create a "raw"
//!< resolution necessary to determine the DNs of those groups,
//!< then right them to the control list (LDAP-GroupDN).
- const DICT_ATTR *group_da; //!< The DA associated with this specific version of the
+ DICT_ATTR const *group_da; //!< The DA associated with this specific version of the
//!< rlm_ldap module.
/*
/* Attribute IDs for supported password encodings. */
#define SIZEOF_PWATTR (4 * 2)
-const DICT_ATTR *pwattr[SIZEOF_PWATTR];
+DICT_ATTR const *pwattr[SIZEOF_PWATTR];
/* Initialize the pwattr array for supported password encodings. */
void
otp_pwe_init(void)
{
- const DICT_ATTR *da;
+ DICT_ATTR const *da;
/*
* Setup known password types. These are pairs.
int nfields;
int keyfield;
int listable;
- const DICT_ATTR *keyattr;
+ DICT_ATTR const *keyattr;
int ignore_empty;
};
char *lf=NULL; /* destination list flags temporary */
size_t len;
int i;
- const DICT_ATTR * da;
+ DICT_ATTR const * da;
struct passwd_instance *inst = instance;
rad_assert(inst->filename && *inst->filename);
for (vp = paircursor(&cursor, &vp);
vp;
vp = pairnext(&cursor)) {
- const DICT_ATTR *da;
+ DICT_ATTR const *da;
if (vp->da->vendor != 12394) {
continue;
char *expanded = NULL;
- const DICT_ATTR *da;
+ DICT_ATTR const *da;
VALUE_PAIR *vp;
- const DICT_ATTR **current, *processed[REST_BODY_MAX_ATTRS + 1];
+ DICT_ATTR const **current, *processed[REST_BODY_MAX_ATTRS + 1];
pair_lists_t list_name;
request_refs_t request_name;
struct lh_entry *entry;
json_flags_t flags;
- const DICT_ATTR *da;
+ DICT_ATTR const *da;
VALUE_PAIR *vp = NULL;
request_refs_t request_name;
int start;
int end;
char *key;
- const DICT_ATTR *da;
+ DICT_ATTR const *da;
} rlm_sometimes_t;
/*
inst->config->xlat_name = cf_section_name1(conf);
} else {
char *group_name;
- const DICT_ATTR *dattr;
+ DICT_ATTR const *dattr;
ATTR_FLAGS flags;
/*
rlm_sql_config_t *config;
CONF_SECTION *cs;
- const DICT_ATTR *sql_user; //!< Cached pointer to SQL-User-Name
+ DICT_ATTR const *sql_user; //!< Cached pointer to SQL-User-Name
//!< dictionary attribute.
void *handle;
//!< never or user defined.
time_t reset_time;
time_t last_reset;
- const DICT_ATTR *key_attr; //!< Attribute number for key field.
- const DICT_ATTR *dict_attr; //!< Attribute number for the counter.
- const DICT_ATTR *reply_attr; //!< Attribute number for the reply.
+ DICT_ATTR const *key_attr; //!< Attribute number for key field.
+ DICT_ATTR const *dict_attr; //!< Attribute number for the counter.
+ DICT_ATTR const *reply_attr; //!< Attribute number for the reply.
} rlm_sqlcounter_t;
/*
static int mod_instantiate(CONF_SECTION *conf, void *instance)
{
rlm_sqlcounter_t *inst = instance;
- const DICT_ATTR *dattr;
+ DICT_ATTR const *dattr;
ATTR_FLAGS flags;
time_t now;
rlm_sqlcounter_t *inst = instance;
int rcode = RLM_MODULE_NOOP;
unsigned int counter;
- const DICT_ATTR *dattr;
+ DICT_ATTR const *dattr;
VALUE_PAIR *key_vp, *check_vp;
VALUE_PAIR *reply_item;
char msg[128];
uint32_t counter;
yubikey_token_st token;
- const DICT_ATTR *da;
+ DICT_ATTR const *da;
char private_id[(YUBIKEY_UID_SIZE * 2) + 1];
VALUE_PAIR *key, *vp;