]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
add "interpret" section with instruction limiting pieces
authorAlan T. DeKok <aland@freeradius.org>
Mon, 17 Oct 2022 19:12:36 +0000 (15:12 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 17 Oct 2022 20:15:26 +0000 (16:15 -0400)
src/lib/server/main_config.c
src/lib/server/main_config.h

index c48a2c7f016295b82feb655f1a18d444ba4dcc19..e115fa7cdef3af4496187ba54f2a8fe0401344a9 100644 (file)
@@ -187,6 +187,17 @@ static const CONF_PARSER migrate_config[] = {
        CONF_PARSER_TERMINATOR
 };
 
+#ifndef NDEBUG
+/*
+ *     Migration configuration.
+ */
+static const CONF_PARSER interpret_config[] = {
+       { FR_CONF_OFFSET("countup_instructions", FR_TYPE_BOOL | FR_TYPE_HIDDEN, main_config_t, ins_countup) },
+       { FR_CONF_OFFSET("max_instructions", FR_TYPE_UINT32 | FR_TYPE_HIDDEN, main_config_t, ins_max) },
+       CONF_PARSER_TERMINATOR
+};
+#endif
+
 static const CONF_PARSER server_config[] = {
        /*
         *      FIXME: 'prefix' is the ONLY one which should be
@@ -218,6 +229,10 @@ static const CONF_PARSER server_config[] = {
 
        { FR_CONF_POINTER("migrate", FR_TYPE_SUBSECTION, NULL), .subcs = (void const *) migrate_config, .ident2 = CF_IDENT_ANY },
 
+#ifndef NDEBUG
+       { FR_CONF_POINTER("interpret", FR_TYPE_SUBSECTION, NULL), .subcs = (void const *) interpret_config, .ident2 = CF_IDENT_ANY },
+#endif
+
        CONF_PARSER_TERMINATOR
 };
 
index 28cbf0179f5fc6961799dc037176f2e943c94f22..203c4c7d66462090b1a31e8188a7eee6f00385e5 100644 (file)
@@ -150,6 +150,11 @@ struct main_config_s {
        uint32_t        max_workers;                    //!< for the scheduler
        fr_time_delta_t stats_interval;                 //!< for the scheduler
 
+#ifndef NDEBUG
+       uint32_t        ins_max;                        //!< max instruction count
+       bool            ins_countup;                    //!< count up to "max"
+#endif
+
        /*
         *      Migration tools
         */