diff options
Diffstat (limited to 'lib/lib_vty.c')
| -rw-r--r-- | lib/lib_vty.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/lib/lib_vty.c b/lib/lib_vty.c index 9c927ca4af..7a8f85b2c9 100644 --- a/lib/lib_vty.c +++ b/lib/lib_vty.c @@ -212,6 +212,41 @@ DEFUN (frr_version, return CMD_SUCCESS; } +static struct call_back { + void (*start_config)(void); + void (*end_config)(void); +} callback; + +DEFUN_HIDDEN (start_config, + start_config_cmd, + "start_configuration", + "The Beginning of Configuration\n") +{ + if (callback.start_config) + (*callback.start_config)(); + + return CMD_SUCCESS; +} + +DEFUN_HIDDEN (end_config, + end_config_cmd, + "end_configuration", + "The End of Configuration\n") +{ + if (callback.end_config) + (*callback.end_config)(); + + return CMD_SUCCESS; +} + +void cmd_init_config_callbacks(void (*start_config)(void), + void (*end_config)(void)) +{ + callback.start_config = start_config; + callback.end_config = end_config; +} + + static void defaults_autocomplete(vector comps, struct cmd_token *token) { const char **p; @@ -234,6 +269,9 @@ void lib_cmd_init(void) install_element(VIEW_NODE, &show_memory_cmd); install_element(VIEW_NODE, &show_modules_cmd); + + install_element(CONFIG_NODE, &start_config_cmd); + install_element(CONFIG_NODE, &end_config_cmd); } /* Stats querying from users */ |
