]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Add logging functions for sections and pairs
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 14 May 2024 00:24:01 +0000 (18:24 -0600)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 14 May 2024 00:24:01 +0000 (18:24 -0600)
src/lib/server/cf_parse.c
src/lib/server/cf_parse.h
src/lib/server/cf_util.c
src/lib/server/cf_util.h

index c603b47cdaef84dbfccae514da694cafdc2b82a4..c8661de2b3ab09af71acd1e897a57df872bf1b34 100644 (file)
@@ -46,7 +46,7 @@ static char const parse_spaces[] = "
 #define PAIR_SPACE(_cs) ((_cs->depth + 1) * 2)
 #define SECTION_SPACE(_cs) (_cs->depth * 2)
 
-void cf_pair_debug(CONF_SECTION const *cs, CONF_PAIR *cp, conf_parser_t const *rule)
+void cf_pair_debug_log(CONF_SECTION const *cs, CONF_PAIR *cp, conf_parser_t const *rule)
 {
        char const      *value;
        char            *tmp = NULL;
@@ -567,7 +567,7 @@ static int CC_HINT(nonnull(4,5)) cf_pair_parse_internal(TALLOC_CTX *ctx, void *o
                         *      Switch between custom parsing function
                         *      and the standard value parsing function.
                         */
-                       cf_pair_debug(cs, cp, rule);
+                       cf_pair_debug_log(cs, cp, rule);
 
                        if (cf_pair_is_parsed(cp)) continue;
                        ret = func(value_ctx, entry, base, cf_pair_to_item(cp), rule);
@@ -616,7 +616,7 @@ static int CC_HINT(nonnull(4,5)) cf_pair_parse_internal(TALLOC_CTX *ctx, void *o
                }
                if (deprecated) goto deprecated;
 
-               cf_pair_debug(cs, cp, rule);
+               cf_pair_debug_log(cs, cp, rule);
 
                if (cf_pair_is_parsed(cp)) return 0;
                ret = func(ctx, out, base, cf_pair_to_item(cp), rule);
index 4f43843c4762c64109a2138cd33d3975ddc4160c..5720ce50fe2b9c53debd8478e1c8e3e063ed321b 100644 (file)
@@ -634,7 +634,7 @@ typedef struct {
 #define CF_FILE_CONFIG (1 << 2)
 #define CF_FILE_MODULE (1 << 3)
 
-void           cf_pair_debug(CONF_SECTION const *cs, CONF_PAIR *cp, conf_parser_t const *rule);
+void           cf_pair_debug_log(CONF_SECTION const *cs, CONF_PAIR *cp, conf_parser_t const *rule);
 
 /*
  *     Type validation and conversion
index d8757fa6af2e6ca3e2002b09bf62d81dd2372bff..2dfc5a8e6d36bb0d815c0166d69565a44a4a33be 100644 (file)
@@ -2314,6 +2314,20 @@ void _cf_debug(CONF_ITEM const *ci)
        }
 }
 
+/** Ease of use from debugger
+ */
+void cf_pair_debug(CONF_SECTION *cp)
+{
+       cf_debug(cp);
+}
+
+/** Ease of use from debugger
+ */
+void cf_section_debug(CONF_SECTION *cs)
+{
+       cf_debug(cs);
+}
+
 /*
  *     Used when we don't need the children any more, as with
  *
index 6a31fb06dc2140d299017d2591d00b54f967d18d..087278c95d10f01089977316ed6a7f145779f8c3 100644 (file)
@@ -337,6 +337,9 @@ void                _cf_log_perr_by_child(fr_log_type_t type, CONF_SECTION const *parent, char
 #define                cf_debug(_cf) _cf_debug(CF_TO_ITEM(_cf))
 void           _cf_debug(CONF_ITEM const *ci);
 
+void           cf_pair_debug(CONF_SECTION *cp);
+void           cf_section_debug(CONF_SECTION *cs);
+
 #define                cf_canonicalize_error(_ci, _slen, _msg, _str) _cf_canonicalize_error(CF_TO_ITEM(_ci), _slen, _msg, _str)
 void           _cf_canonicalize_error(CONF_ITEM *ci, ssize_t slen, char const *msg, char const *str);