]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
rename "is_counter" to "counter"
authorAlan T. DeKok <aland@freeradius.org>
Thu, 29 Sep 2022 21:15:41 +0000 (17:15 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 29 Sep 2022 22:09:34 +0000 (18:09 -0400)
and add it to the flags being printed

src/lib/util/dict.h
src/lib/util/dict_print.c
src/lib/util/dict_tokenize.c
src/lib/util/dict_validate.c

index 5b4aa2d3f4cccbfd04306102b1c11e3600770117..eda4c353b213035830d7ffde9e79a90d80fa357b 100644 (file)
@@ -93,7 +93,7 @@ typedef struct {
 
        unsigned int            is_unsigned : 1;                //!< hackity hack for dates and time deltas
 
-       unsigned int            is_counter : 1;                 //!< integer attribute is actually an impulse / counter
+       unsigned int            counter : 1;                    //!< integer attribute is actually an impulse / counter
 
        /*
         *      @todo - if we want to clean these fields up, make
index 3ce871787651374c0443d9fc84e571fb46983320..b7d6b3aaeb426fb08071391a4ce2483ede11f67c 100644 (file)
@@ -40,6 +40,7 @@ ssize_t fr_dict_attr_flags_print(fr_sbuff_t *out, fr_dict_t const *dict, fr_type
        FLAG_SET(array);
        FLAG_SET(has_value);
        FLAG_SET(virtual);
+       FLAG_SET(counter);
 
        if (dict && !flags->extra && flags->subtype) {
                FR_SBUFF_IN_STRCPY_RETURN(&our_out, fr_table_str_by_value(dict->subtype_table, flags->subtype, "?"));
index 7fb0fdb6d6d1539182f9ce2b929a24dd4c4ad0fe..e8d499568e18dbf45f2dbfe68ab91059f555f333 100644 (file)
@@ -372,7 +372,7 @@ static int dict_process_flag_field(dict_tokenize_ctx_t *ctx, char *name, fr_type
                        flags->array = 1;
 
                } else if (strcmp(key, "counter") == 0) {
-                       flags->is_counter = 1;
+                       flags->counter = 1;
 
                } else if (strcmp(key, "virtual") == 0) {
                        flags->virtual = 1;
index 23f5e999f12d6b880e6b5f855dc7a1a361a63368..80b2f483111c0ca5879c0145b02e486b178950fc 100644 (file)
@@ -45,7 +45,7 @@ bool dict_attr_flags_valid(fr_dict_t *dict, fr_dict_attr_t const *parent,
        uint32_t shift_is_root, shift_internal;
        uint32_t shift_array, shift_has_value;
        uint32_t shift_virtual, shift_subtype, shift_extra;
-       uint32_t shift_is_counter;
+       uint32_t shift_counter;
        fr_dict_attr_t const *v;
 
        /*
@@ -62,7 +62,7 @@ bool dict_attr_flags_valid(fr_dict_t *dict, fr_dict_attr_t const *parent,
        SET_FLAG(has_value);
        SET_FLAG(virtual);
        SET_FLAG(extra);
-       SET_FLAG(is_counter);
+       SET_FLAG(counter);
        SET_FLAG(subtype);
 
 #define FORBID_OTHER_FLAGS(_flag) do { if (all_flags & ~shift_ ## _flag) { fr_strerror_printf("The '" STRINGIFY(_flag) "' flag cannot be used with any other flag"); return false; } } while (0)
@@ -493,9 +493,9 @@ bool dict_attr_flags_valid(fr_dict_t *dict, fr_dict_attr_t const *parent,
         *      For other data types, we don't know how to
         *      automatically add two counters.
         */
-       if (flags->is_counter) {
+       if (flags->counter) {
                if ((type == FR_TYPE_TIME_DELTA) || (fr_type_is_integer(type) && !fr_type_is_signed(type))) {
-                       ALLOW_FLAG(is_counter);
+                       ALLOW_FLAG(counter);
                } else {
                        fr_strerror_printf("The 'counter' flag cannot be used with '%s'", fr_type_to_str(type));
                        return false;