rbtree_insert(values_fixup, dval);
return 0;
}
-
+
/*
* Add the value into the dictionary.
*/
flags.has_tag = 1;
}
else if (strncmp(s, "len+=", 5) == 0 ||
- strncmp(s, "len-=", 5) == 0) {
+ strncmp(s, "len-=", 5) == 0) {
/* Length difference, to accomodate
braindead NASes & their vendors */
flags.len_disp = strtol(s + 5, &c, 0);
/* Encryption method, defaults to 0 (none).
Currently valid is just type 2,
Tunnel-Password style, which can only
- be applied to strings. */
+ be applied to strings. */
flags.encrypt = strtol(s + 8, &c, 0);
if (*c) {
librad_log( "dict_init: %s[%d] invalid option %s",
/* Must be a vendor 'flag'... */
if (strncmp(s, "vendor=", 5) == 0) {
/* New format */
- s += 5;
+ s += 5;
}
-
+
vendor = dict_vendorbyname(s);
if (!vendor) {
librad_log( "dict_init: %s[%d]: unknown vendor %s",
sscanf(valstr, "%i", &value);
if (dict_addvalue(namestr, attrstr, value) < 0) {
- librad_log("dict_init: %s[%d]: %s",
+ librad_log("dict_init: %s[%d]: %s",
fn, line, librad_errstr);
return -1;
}
*/
static int attrvalue_cmp(const void *a, const void *b)
{
- return (((const DICT_ATTR *)a)->attr -
+ return (((const DICT_ATTR *)a)->attr -
((const DICT_ATTR *)b)->attr);
}
static int valuename_cmp(const void *a, const void *b)
{
int rcode;
- rcode = (((const DICT_VALUE *)a)->attr -
+ rcode = (((const DICT_VALUE *)a)->attr -
((const DICT_VALUE *)b)->attr);
if (rcode != 0) return rcode;
static int valuevalue_cmp(const void *a, const void *b)
{
int rcode;
- rcode = (((const DICT_VALUE *)a)->attr -
+ rcode = (((const DICT_VALUE *)a)->attr -
((const DICT_VALUE *)b)->attr);
if (rcode != 0) return rcode;
- return (((const DICT_VALUE *)a)->value -
+ return (((const DICT_VALUE *)a)->value -
((const DICT_VALUE *)b)->value);
}
(const char *) ((const DICT_VALUE *)b)->attr);
if (rcode != 0) return rcode;
- return (((const DICT_VALUE *)a)->value -
+ return (((const DICT_VALUE *)a)->value -
((const DICT_VALUE *)b)->value);
}
} else {
DICT_ATTR myattr;
-
+
myattr.attr = val;
- return rbtree_finddata(attributes_byvalue, &myattr);
+ return rbtree_finddata(attributes_byvalue, &myattr);
}
return NULL; /* never reached, but useful */
DICT_ATTR *dict_attrbyname(const char *name)
{
DICT_ATTR myattr;
-
+
strNcpy(myattr.name, name, sizeof(myattr.name));
-
- return rbtree_finddata(attributes_byname, &myattr);
+
+ return rbtree_finddata(attributes_byname, &myattr);
}
/*