-typedef enum nr_attr_type_t {
- NR_TYPE_INVALID = 0, /**< Invalid data type */
- NR_TYPE_STRING, /**< printable-text */
- NR_TYPE_INTEGER, /**< a 32-bit unsigned integer */
- NR_TYPE_IPADDR, /**< an IPv4 address */
- NR_TYPE_DATE, /**< a 32-bit date, of seconds since January 1, 1970 */
- NR_TYPE_OCTETS, /**< a sequence of binary octets */
- NR_TYPE_IFID, /**< an Interface Id */
- NR_TYPE_IPV6ADDR, /**< an IPv6 address */
- NR_TYPE_IPV6PREFIX, /**< an IPv6 prefix */
- NR_TYPE_BYTE, /**< an 8-bit integer */
- NR_TYPE_SHORT, /**< a 16-bit integer */
-} nr_attr_type_t;
-
-#define PW_ACCESS_REQUEST 1
-#define PW_ACCESS_ACCEPT 2
-#define PW_ACCESS_REJECT 3
-#define PW_ACCOUNTING_REQUEST 4
-#define PW_ACCOUNTING_RESPONSE 5
-#define PW_ACCOUNTING_STATUS 6
-#define PW_PASSWORD_REQUEST 7
-#define PW_PASSWORD_ACK 8
-#define PW_PASSWORD_REJECT 9
-#define PW_ACCOUNTING_MESSAGE 10
-#define PW_ACCESS_CHALLENGE 11
-#define PW_STATUS_SERVER 12
-#define PW_STATUS_CLIENT 13
-#define PW_DISCONNECT_REQUEST 40
-#define PW_DISCONNECT_ACK 41
-#define PW_DISCONNECT_NAK 42
-#define PW_COA_REQUEST 43
-#define PW_COA_ACK 44
-#define PW_COA_NAK 45
-
-/** Error codes \ingroup error
- *
- * The numerical value of these definitions may change from version
- * to version of the library.
- */
-typedef enum nr_error_t {
- /** Invalid argument */
- NR_ERR_INVALID_ARG = 1,
- /** Insufficient data to decode the packet */
- NR_ERR_PACKET_TOO_SMALL,
- /** The packet header says it is larger than the received data */
- NR_ERR_PACKET_TOO_LARGE,
- /** the attribute overflows the packet */
- NR_ERR_ATTR_OVERFLOW,
- /** the attribute header "length" field is too small */
- NR_ERR_ATTR_TOO_SMALL,
- /** the attribute is more than 256 octets long */
- NR_ERR_ATTR_TOO_LARGE,
- /** the attribute is unknown */
- NR_ERR_ATTR_UNKNOWN,
- /** the attribute name is improperly formatted */
- NR_ERR_ATTR_BAD_NAME,
- /** the attribute value could not be parsed */
- NR_ERR_ATTR_VALUE_MALFORMED,
- /** the attribute "type" is invalid */
- NR_ERR_ATTR_INVALID,
- /** the packet has too many attributes */
- NR_ERR_TOO_MANY_ATTRS,
- /** the attribute has an unsupported data type */
- NR_ERR_ATTR_TYPE_UNKNOWN,
- /** the Message-Authenticator has the wrong length */
- NR_ERR_MSG_AUTH_LEN,
- /** the Message-Authenticator is wrong */
- NR_ERR_MSG_AUTH_WRONG,
- /** we need a request packet to calculate something in the response */
- NR_ERR_REQUEST_REQUIRED,
- /** the request code is unsupported */
- NR_ERR_REQUEST_CODE_INVALID,
- /** the Authentication Vector is wrong */
- NR_ERR_AUTH_VECTOR_WRONG,
- /** the response code is unsupported */
- NR_ERR_RESPONSE_CODE_INVALID,
- /** the response ID field is invalid */
- NR_ERR_RESPONSE_ID_INVALID,
- /** the response is not from the correct source IP/port */
- NR_ERR_RESPONSE_SRC_INVALID,
- /** Look at "errno" for the error */
- NR_ERR_SYSTEM,
- /** We cannot encode the packet because of invalid arguments */
- NR_ERR_NO_PACKET_DATA,
- /** the vendor is unknown */
- NR_ERR_VENDOR_UNKNOWN,
- /** an internal sanity check failed */
- NR_ERR_INTERNAL_FAILURE,
- /** the caller requested an unsupported featuer */
- NR_ERR_UNSUPPORTED,
- /** we were unable to allocate memory */
- NR_ERR_NO_MEM,
- /** Resource is in use */
- NR_ERR_IN_USE,
-} nr_error_t;
-