]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
clone structs
authorAlan T. DeKok <aland@freeradius.org>
Fri, 4 Dec 2020 20:25:05 +0000 (15:25 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Sun, 6 Dec 2020 02:48:06 +0000 (21:48 -0500)
add structs to WiMAX. And add tests

share/dictionary/radius/dictionary.wimax
src/lib/util/dict_util.c
src/tests/unit/protocols/radius/wimax.txt

index 41e56e710be252319f8035a67f460aeb39d26f67..a89e57b204d2d117d17c375299656ee1ef70fa85 100644 (file)
@@ -208,7 +208,10 @@ ATTRIBUTE  IP-Address-Range                        .2      octets
 ATTRIBUTE      IP-Address-Mask                         .3      octets
 ATTRIBUTE      Port                                    .4      short
 # Really "uint16 start, end"
-ATTRIBUTE      Port-Range                              .5      integer
+ATTRIBUTE      Port-Range                              .5      struct
+MEMBER         Start                                           uint16
+MEMBER         End                                             uint16
+
 ATTRIBUTE      Inverted                                .6      byte
 ATTRIBUTE      Assigned                                .7      byte
 VALUE  Assigned                        Src-Assigned            1
index 9fb4e07c4af341d3d4304179fbe70ef8c93e65d4..7e63d9119189e5c78de1500232d55b42fafaee90 100644 (file)
@@ -728,7 +728,7 @@ int dict_attr_acopy_children(fr_dict_t *dict, fr_dict_attr_t *dst, fr_dict_attr_
        fr_dict_attr_t const *child = NULL;
        fr_dict_attr_t *copy;
 
-       if (dst->type != FR_TYPE_TLV) return -1;
+       if ((dst->type != FR_TYPE_TLV) && (dst->type != FR_TYPE_STRUCT)) return -1;
 
        fr_assert(fr_dict_attr_has_ext(dst, FR_DICT_ATTR_EXT_CHILDREN));
 
index b32b43443b41f07184e287432c372cee97f4adc8..cd79ff26c1d4aa6bc40bc200ed39af28c0a2db50 100644 (file)
@@ -231,5 +231,17 @@ match 1a 17 00 00 60 b5 1c 11 00 01 04 00 20 02 04 00 20 03 06 00 00 00 20 1b 06
 # decode-pair -
 # data Vendor-Specific.WiMAX.Packet-Flow-Descriptor.Release = "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE", Vendor-Specific.WiMAX.Packet-Flow-Descriptor.Idle-Mode-Notification-Cap = Supported
 
+#
+#  Port ranges
+#
+encode-pair Vendor-Specific.WiMAX.Packet-Flow-Descriptor.Classifier.Src-Spec.IP-Address = 127.0.0.1, Vendor-Specific.WiMAX.Packet-Flow-Descriptor.Classifier.Src-Spec.Port = 2112, Vendor-Specific.WiMAX.Packet-Flow-Descriptor.Classifier.Src-Spec.Port-Range = { Start = 2112, End = 6809 }
+match 1a 1d 00 00 60 b5 1c 17 00 0b 14 05 12 01 06 7f 00 00 01 04 04 08 40 05 06 08 40 1a 99
+
+#
+#  Structs not yet decoded into sub-groups
+#
+decode-pair -
+match Vendor-Specific.WiMAX.Packet-Flow-Descriptor.Classifier.Src-Spec.IP-Address = 127.0.0.1, Vendor-Specific.WiMAX.Packet-Flow-Descriptor.Classifier.Src-Spec.Port = 2112, Vendor-Specific.WiMAX.Packet-Flow-Descriptor.Classifier.Src-Spec.Port-Range.Start = 2112, Vendor-Specific.WiMAX.Packet-Flow-Descriptor.Classifier.Src-Spec.Port-Range.End = 6809
+
 count
-match 108
+match 112