From: Alan T. DeKok Date: Mon, 17 Oct 2022 19:12:36 +0000 (-0400) Subject: add "interpret" section with instruction limiting pieces X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fd69acbdb8899604f89edefd52da02b68e3f8eb4;p=thirdparty%2Ffreeradius-server.git add "interpret" section with instruction limiting pieces --- diff --git a/src/lib/server/main_config.c b/src/lib/server/main_config.c index c48a2c7f016..e115fa7cdef 100644 --- a/src/lib/server/main_config.c +++ b/src/lib/server/main_config.c @@ -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 }; diff --git a/src/lib/server/main_config.h b/src/lib/server/main_config.h index 28cbf0179f5..203c4c7d664 100644 --- a/src/lib/server/main_config.h +++ b/src/lib/server/main_config.h @@ -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 */