]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
move EAP-AKA-SIM magic to the protocol library
authorAlan T. DeKok <aland@freeradius.org>
Thu, 7 Nov 2019 20:08:13 +0000 (15:08 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 7 Nov 2019 20:08:13 +0000 (15:08 -0500)
src/lib/eap_aka_sim/base.c
src/lib/util/dict_util.c

index b8edbce1668ad431834d2a7155582bcb1e863365..da08948f67677d72cdaa31685af64a319f39c77d 100644 (file)
@@ -257,3 +257,15 @@ void fr_aka_sim_free(void)
        fr_dict_autofree(libfreeradius_aka_sim_dict);
 }
 
+static fr_table_num_ordered_t const subtype_table[] = {
+       { "encrypt=aes-cbc",            1 }, /* any non-zero value will do */
+};
+
+extern fr_dict_protocol_t libfreeradius_eap_aka_sim_dict_protocol;
+fr_dict_protocol_t libfreeradius_eap_aka_sim_dict_protocol = {
+       .name = "eap_aka_sim",
+       .default_type_size = 1,
+       .default_type_length = 1,
+       .subtype_table = subtype_table,
+       .subtype_table_len = NUM_ELEMENTS(subtype_table),
+};
index 2f56f1555f94c69ca1764f88d1279024c508207d..46bfd6ec4898a7d7b10c3940f387dd8b76f87877 100644 (file)
@@ -55,10 +55,6 @@ fr_table_num_ordered_t const date_precision_table[] = {
 };
 size_t date_precision_table_len = NUM_ELEMENTS(date_precision_table);
 
-static fr_table_num_ordered_t const eap_aka_sim_subtype_table[] = {
-       { "encrypt=aes-cbc",            1 }, /* any non-zero value will do */
-};
-static size_t eap_aka_sim_subtype_table_len = NUM_ELEMENTS(eap_aka_sim_subtype_table);
 
 /** Map data types to min / max data sizes
  */
@@ -508,19 +504,6 @@ int dict_protocol_add(fr_dict_t *dict)
        }
        dict->in_protocol_by_num = true;
 
-       /*
-        *      Set the subtype flags and other necessary things.
-        */
-       switch (dict->root->attr) {
-       case FR_PROTOCOL_EAP_AKA_SIM:
-               dict->subtype_table = eap_aka_sim_subtype_table;
-               dict->subtype_table_len = eap_aka_sim_subtype_table_len;
-               break;
-
-       default:
-               break;
-       }
-
        return 0;
 }