Create new type PW_TYPE_TIMEVAL
authorAlan T. DeKok <aland@freeradius.org>
Tue, 20 May 2014 14:33:22 +0000 (10:33 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 20 May 2014 14:33:22 +0000 (10:33 -0400)
src/include/radius.h
src/lib/radius.c
src/lib/valuepair.c

index 44a18d7..453e704 100644 (file)
@@ -30,6 +30,7 @@ typedef enum {
        PW_TYPE_INTEGER64,      //!< 64 Bit unsigned integer.
        PW_TYPE_IPV4PREFIX,     //!< IPv4 Prefix.
        PW_TYPE_VSA,            //!< Vendor-Specific, for attribute 26
+       PW_TYPE_TIMEVAL,        //!< "struct timeval", only for config items
        PW_TYPE_MAX             //!< Number of defined data types.
 } PW_TYPE;
 
index 2df5717..8eda456 100644 (file)
@@ -4048,6 +4048,7 @@ ssize_t rad_vp2data(uint8_t const **out, VALUE_PAIR const *vp)
        case PW_TYPE_LONG_EXTENDED:
        case PW_TYPE_EVS:
        case PW_TYPE_VSA:
+       case PW_TYPE_TIMEVAL:
        case PW_TYPE_MAX:
                fr_strerror_printf("Cannot get data for VALUE_PAIR type %i", vp->da->type);
                return -1;
index de29c2e..ceca872 100644 (file)
@@ -2470,13 +2470,14 @@ int8_t paircmp_value(VALUE_PAIR const *one, VALUE_PAIR const *two)
        /*
         *      None of the types below should be in the REQUEST
         */
+       case PW_TYPE_INVALID:           /* We should never see these */
        case PW_TYPE_COMBO_IP:          /* This should of been converted into IPADDR/IPV6ADDR */
        case PW_TYPE_TLV:
        case PW_TYPE_EXTENDED:
        case PW_TYPE_LONG_EXTENDED:
        case PW_TYPE_EVS:
        case PW_TYPE_VSA:
-       case PW_TYPE_INVALID:           /* We should never see these */
+       case PW_TYPE_TIMEVAL:
        case PW_TYPE_MAX:
                fr_assert(0);   /* unknown type */
                return -2;