]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
remove FR_TYPE_EXTENDED
authorAlan T. DeKok <aland@freeradius.org>
Sat, 3 Oct 2020 01:23:02 +0000 (21:23 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Sat, 3 Oct 2020 01:23:02 +0000 (21:23 -0400)
it's now just a TLV with magic flags, and only for RADIUS

16 files changed:
scripts/autoload_defs.sh
src/bin/radsnmp.c
src/lib/server/command.c
src/lib/util/dict_print.c
src/lib/util/dict_unknown.c
src/lib/util/dict_util.c
src/lib/util/dict_validate.c
src/lib/util/types.h
src/lib/util/value.c
src/modules/rlm_radius/rlm_radius_udp.c
src/protocols/dhcpv4/base.c
src/protocols/dhcpv6/base.c
src/protocols/dhcpv6/encode.c
src/protocols/internal/decode.c
src/protocols/internal/encode.c
src/protocols/radius/encode.c

index da2d355ccd67ee55f4bf5443629ce941cd684c36..1a221f00d5ef4348fbd44fefa536ef48077f9fa9 100755 (executable)
@@ -161,10 +161,6 @@ for i in ${RESOLVED[*]}; do
                TYPE="FR_TYPE_DATE"
                ;;
 
-       'extended')
-               TYPE="FR_TYPE_EXTENDED"
-               ;;
-
        'tlv')
                TYPE="FR_TYPE_TLV"
                ;;
index cd3706af12b53401b63a5aaa0c388fc23b10e201..8de8f8467ae69b8ebd2eb0db14f97a2f52f74067 100644 (file)
@@ -111,7 +111,7 @@ static fr_dict_attr_t const *attr_vendor_specific;
 
 extern fr_dict_attr_autoload_t radsnmp_dict_attr[];
 fr_dict_attr_autoload_t radsnmp_dict_attr[] = {
-       { .out = &attr_extended_attribute_1, .name = "Extended-Attribute-1", .type = FR_TYPE_EXTENDED, .dict = &dict_radius },
+       { .out = &attr_extended_attribute_1, .name = "Extended-Attribute-1", .type = FR_TYPE_TLV, .dict = &dict_radius },
        { .out = &attr_freeradius_snmp_failure, .name = "FreeRADIUS-SNMP-Failure", .type = FR_TYPE_UINT8, .dict = &dict_radius },
        { .out = &attr_freeradius_snmp_operation, .name = "FreeRADIUS-SNMP-Operation", .type = FR_TYPE_UINT8, .dict = &dict_radius },
        { .out = &attr_freeradius_snmp_type, .name = "FreeRADIUS-SNMP-Type", .type = FR_TYPE_UINT8, .dict = &dict_radius },
index 09bec4f99df4fa6a0bd5d8640a77fc3132704414..1ed83c5f7db97d3954d083c47a7fc07a55652c5b 100644 (file)
@@ -85,7 +85,7 @@ static int split(char **input, char **output, bool syntax_string);
 
 #define FR_TYPE_VARARGS                FR_TYPE_TLV
 #define FR_TYPE_OPTIONAL       FR_TYPE_STRUCT
-#define FR_TYPE_ALTERNATE      FR_TYPE_EXTENDED
+#define FR_TYPE_ALTERNATE      FR_TYPE_VSA
 #define FR_TYPE_ALTERNATE_CHOICE FR_TYPE_GROUP
 
 /** Find a command
index 72abda538870a3b3120f13edbb75c14f592970f8..d4666777e98b48479c23f5eae5703528eb38ee56 100644 (file)
@@ -171,10 +171,6 @@ void fr_dict_print(fr_dict_t const *dict, fr_dict_attr_t const *da, int depth)
                name = "VSA";
                break;
 
-       case FR_TYPE_EXTENDED:
-               name = "EXTENDED";
-               break;
-
        case FR_TYPE_TLV:
                name = "TLV";
                break;
index fad9568b6a3b3b9910243a574af126582f164542..e3653cde6f4dbef88d5fcd14851e197f037b558a 100644 (file)
@@ -503,7 +503,6 @@ ssize_t fr_dict_unknown_afrom_oid_str(TALLOC_CTX *ctx, fr_dict_attr_t **out,
                                        break;
 
                                case FR_TYPE_TLV:
-                               case FR_TYPE_EXTENDED:
                                is_root:
                                        if (fr_dict_unknown_attr_afrom_num(n, &our_da, our_parent, num) < 0) {
                                                goto error;
index 9635796470b74f07378b42e584a08976ae939fcc..4c089e50e469941df9c8abde67e34b8767974b5e 100644 (file)
@@ -87,8 +87,6 @@ size_t const dict_attr_sizes[FR_TYPE_MAX + 1][2] = {
        [FR_TYPE_TLV]           = {2, ~0},
        [FR_TYPE_STRUCT]        = {1, ~0},
 
-       [FR_TYPE_EXTENDED]      = {1, ~0},
-
        [FR_TYPE_VSA]           = {4, ~0},
 
        [FR_TYPE_MAX]           = {~0, 0}       //!< Ensure array covers all types.
@@ -121,7 +119,6 @@ bool const fr_dict_attr_allowed_chars[UINT8_MAX + 1] = {
 bool const fr_dict_non_data_types[FR_TYPE_MAX + 1] = {
        [FR_TYPE_TLV] = true,
        [FR_TYPE_STRUCT] = true,
-       [FR_TYPE_EXTENDED] = true,
        [FR_TYPE_VSA] = true,
        [FR_TYPE_VENDOR] = true
 };
@@ -633,7 +630,6 @@ int dict_attr_child_add(fr_dict_attr_t *parent, fr_dict_attr_t *child)
        case FR_TYPE_VENDOR:
        case FR_TYPE_VSA:
        case FR_TYPE_STRUCT:
-       case FR_TYPE_EXTENDED:
                break;
 
        case FR_TYPE_UINT8:
index 51aed49f5d6cb540fb55a6348343091e11217e40..7d2389a97f00a7469e1a05ce78b487f40280c13d 100644 (file)
@@ -536,7 +536,6 @@ bool dict_attr_flags_valid(fr_dict_t *dict, fr_dict_attr_t const *parent,
        case FR_TYPE_TLV:
        case FR_TYPE_VSA:
        case FR_TYPE_VENDOR:
-       case FR_TYPE_EXTENDED:
                break;
 
                /*
index 9a7e5837e446a31d51c44beb63c3e7fbc04eb79d..111c3e2d1b8568eae8abe169469b04f453feb105 100644 (file)
@@ -74,8 +74,6 @@ typedef enum {
        FR_TYPE_TLV,                            //!< Contains nested attributes.
        FR_TYPE_STRUCT,                         //!< like TLV, but without T or L, and fixed-width children
 
-       FR_TYPE_EXTENDED,                       //!< Extended attribute space attribute.
-
        FR_TYPE_VSA,                            //!< Vendor-Specific, for RADIUS attribute 26.
        FR_TYPE_VENDOR,                         //!< Attribute that represents a vendor in the attribute tree.
 
@@ -160,8 +158,7 @@ typedef enum {
  *     functions that need to deal with all types representing values
  */
 #define FR_TYPE_STRUCTURAL_EXCEPT_VSA \
-            FR_TYPE_EXTENDED: \
-       case FR_TYPE_GROUP: \
+       FR_TYPE_GROUP: \
        case FR_TYPE_TLV: \
        case FR_TYPE_STRUCT
 
index ce982cf66ce464037c9751b2af0f91b537d36a2e..56cd1f1968cca751f6e5fa8dc618fe56f47001ec 100644 (file)
@@ -140,8 +140,6 @@ fr_table_num_ordered_t const fr_value_box_type_table[] = {
        { L("tlv"),             FR_TYPE_TLV             },
        { L("struct"),          FR_TYPE_STRUCT          },
 
-       { L("extended"),        FR_TYPE_EXTENDED        },
-
        { L("vsa"),             FR_TYPE_VSA             },
        { L("vendor"),          FR_TYPE_VENDOR          },
        { L("group"),           FR_TYPE_GROUP           },
@@ -4822,7 +4820,6 @@ ssize_t fr_value_box_print(fr_sbuff_t *out, fr_value_box_t const *data, fr_sbuff
        case FR_TYPE_STRUCT:            /* Not a box type */
        case FR_TYPE_VSA:               /* Not a box type */
        case FR_TYPE_VENDOR:            /* Not a box type */
-       case FR_TYPE_EXTENDED:          /* Not a box type */
        case FR_TYPE_COMBO_IP_ADDR:
        case FR_TYPE_COMBO_IP_PREFIX:
        case FR_TYPE_VALUE_BOX:
index 33115fbf4ab6b2da5366a54044ca9e5ccb7d0382..b527490be7d17db21496bb63cc58bea55d320b6f 100644 (file)
@@ -211,7 +211,7 @@ fr_dict_attr_autoload_t rlm_radius_udp_dict_attr[] = {
        { .out = &attr_acct_delay_time, .name = "Acct-Delay-Time", .type = FR_TYPE_UINT32, .dict = &dict_radius},
        { .out = &attr_error_cause, .name = "Error-Cause", .type = FR_TYPE_UINT32, .dict = &dict_radius },
        { .out = &attr_event_timestamp, .name = "Event-Timestamp", .type = FR_TYPE_DATE, .dict = &dict_radius},
-       { .out = &attr_extended_attribute_1, .name = "Extended-Attribute-1", .type = FR_TYPE_EXTENDED, .dict = &dict_radius},
+       { .out = &attr_extended_attribute_1, .name = "Extended-Attribute-1", .type = FR_TYPE_TLV, .dict = &dict_radius},
        { .out = &attr_message_authenticator, .name = "Message-Authenticator", .type = FR_TYPE_OCTETS, .dict = &dict_radius},
        { .out = &attr_nas_identifier, .name = "NAS-Identifier", .type = FR_TYPE_STRING, .dict = &dict_radius},
        { .out = &attr_original_packet_code, .name = "Original-Packet-Code", .type = FR_TYPE_UINT32, .dict = &dict_radius},
index 6548fd009b4b3551f9a484c70603a87adce3c381..bb8728560467a1dafab9efe101098b770b96eb07 100644 (file)
@@ -668,11 +668,6 @@ static fr_table_num_ordered_t const subtype_table[] = {
 static bool attr_valid(UNUSED fr_dict_t *dict, UNUSED fr_dict_attr_t const *parent,
                       UNUSED char const *name, UNUSED int attr, fr_type_t type, fr_dict_attr_flags_t *flags)
 {
-       if (type == FR_TYPE_EXTENDED) {
-               fr_strerror_printf("Attributes of type 'extended' cannot be used with DHCP");
-               return false;
-       }
-
        /*
         *      "extra" signifies that subtype is being used by the
         *      dictionaries itself.
index 12961f7f9750345c9c4cb4d0ea65cb0ba214423f..9305da6b80ce00764a25dba24de70fcf7b85a68b 100644 (file)
@@ -866,11 +866,6 @@ static fr_table_num_ordered_t const subtype_table[] = {
 static bool attr_valid(UNUSED fr_dict_t *dict, UNUSED fr_dict_attr_t const *parent,
                       UNUSED char const *name, UNUSED int attr, fr_type_t type, fr_dict_attr_flags_t *flags)
 {
-       if (type == FR_TYPE_EXTENDED) {
-               fr_strerror_printf("Attributes of type 'extended' cannot be used with DHCP");
-               return false;
-       }
-
        /*
         *      "extra" signifies that subtype is being used by the
         *      dictionaries itself.
index 240ec6bb098599f89431dbaa55d190824724ba7b..9134f82bb291db4645fab40c7ef94f86f71eeae2 100644 (file)
@@ -171,7 +171,6 @@ static ssize_t encode_value(uint8_t *out, size_t outlen,
 
        switch (da->type) {
        case FR_TYPE_TLV:
-       case FR_TYPE_EXTENDED:
        case FR_TYPE_VENDOR:
        case FR_TYPE_VSA:
                fr_strerror_printf("%s: Called with structural type %s", __FUNCTION__,
@@ -424,7 +423,6 @@ static ssize_t encode_value(uint8_t *out, size_t outlen,
                break;
 
        case FR_TYPE_INVALID:
-       case FR_TYPE_EXTENDED:
        case FR_TYPE_COMBO_IP_ADDR:     /* Should have been converted to concrete equivalent */
        case FR_TYPE_COMBO_IP_PREFIX:   /* Should have been converted to concrete equivalent */
        case FR_TYPE_VSA:
index c969c3924353dfb9a738e36b2a8734a371a00743..dd6ccf279bd892b5cad8e43b27ea03eb97a613f2 100644 (file)
@@ -300,12 +300,6 @@ static ssize_t internal_decode_pair(TALLOC_CTX *ctx, fr_pair_list_t *head, fr_di
        /*
         *      Structural types
         */
-       case FR_TYPE_EXTENDED:
-               if (unlikely(tainted)) goto bad_tainted;
-               slen = internal_decode_pair(ctx, head, da, p, p + len, decoder_ctx);
-               if (slen <= 0) goto error;
-               break;
-
        case FR_TYPE_TLV:
                if (unlikely(tainted)) goto bad_tainted;
 
index 39ed69eb1088be61e856e950d9f16f83b7193ae5..ee8b253c0be3abd1564853a1c0e6ff232017c40c 100644 (file)
@@ -174,7 +174,6 @@ static ssize_t internal_encode(fr_dbuff_t *dbuff,
         *      Children of TLVs are encoded in the context
         *      of the TLV.
         */
-       case FR_TYPE_EXTENDED:  /* Just another type of TLV */
        case FR_TYPE_TLV:
                /*
                 *      We've done the complete stack.
index b89648bb9cf5fe7a5d0fb553012faa02334c938a..f858450edadd6f582a44468c53d4477b0a10c751 100644 (file)
@@ -603,7 +603,6 @@ static ssize_t encode_value(uint8_t *out, size_t outlen,
        case FR_TYPE_COMBO_IP_PREFIX:   /* Should have been converted to concrete equivalent */
        case FR_TYPE_VSA:
        case FR_TYPE_VENDOR:
-       case FR_TYPE_EXTENDED:
        case FR_TYPE_TLV:
        case FR_TYPE_STRUCT:
        case FR_TYPE_SIZE: