OUR SITES NetworkRADIUS FreeRADIUS

The ENUM keyword

Syntax
ENUM <name> <type>
Description

The ENUM keyword defines a name for set of VALUEs.

<name>

The name of the enum.

These names are in the same namespace as ATTRIBUTEs, and must follow the same name format.

<type>

A data type

The list of allowed data types are the same as for VALUE.

Once an ENUM is defined, it can have VALUEs associated with it, just like with ATTRIBUTEs.

The main purpose of ENUM is to define commonly used values in one place, and then refer to those values from multiple places. This reuse simplifies the dictionaries, and helps to avoid errors.

In the following example, Ethernet-Type is defined as an ENUM and given VALUEs. We then define two ATTRIBUTEs, and copy those VALUEs from the ENUM to the ATTRIBUTE.

After these definitions, when the server will allow Some-Protocol to be assigned the value IPv4, which will get encoded into a packet as the 16-bit field `0x0800.

Example
ENUM Ethernet-Type uint16
VALUE Ethernet-Type IPv4 0x0800
VALUE Ethernet-Type IPv6 0x86DD

ATTRIBUTE Some-Protocol 2112 uint16 enum=Ethernet-Type
ATTRIBUTE Other-Thing  6809 uint16 enum=Ethernet-Type