RADIUS integer constants
RADIUS dictionaries used by freeRADIUS client library define attributes (ATTRIBUTE
keyword) with attribute name, type code point (unfortunately not limited to 8 bits) and content type (including date), and integer constants (VALUE
keyword, enum in IANA attribute registry which defines symbolic names for possible attribute values) with attribute name (one IANA registry per attribute), name and value (32 bits but usually a small unsigned integer).
Other keywords as $INCLUDE
or VENDOR
is parsed but not used so we choose to not support them, nor the capability to specify more than one dictionary.
In freeRADIUS client library dictionaries are implemented as lists and new items are pushed in front. The dictionary for values provides two functions: rc_dict_findval which returns an entry by value name, and rc_dict_getval which returns an entry by value and attribute names. findval is used by the from text attribute function, getval by the to text attribute function.
There are some possible choices here:
- check or not check when reading a dictionary if the attribute name is for an already defined attribute
- check or not check if a value was already defined with a different value
- consider that the use of findval in the from text function is a bug and use getval instead: this is far more consistent but not compatible with freeRADIUS client library (i.e. should we be "bug compatible" or just compatible with a note in the ARM? we already have some points where the second option was taken)
So my proposal is:
- check if the attribute name was already defined (this allows to use the type in value data structure and also to verify the attribute is an integer attribute)
- allows a different value for another attribute
- use the equivalent of getval in from text method so allows only symbolic values for the current attribute
- consider to return symbolic values in the to text method
A related point is to check (i.e. throw) or not (i.e. silently skip) if an attribute code point is greater than 255 (i.e. the attribute is a 'not protocol' one as the protocol field is on 8 bits).