diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 04:24:34 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 04:24:34 +0000 |
commit | 137ce8dd46d313f15ee93ddbb5428d702aa61ed8 (patch) | |
tree | a49f76849019651842962dff2197b705e33831e7 /lib/affinitymap_cli.c | |
parent | Releasing progress-linux version 9.1-0.1~progress7.99u1. (diff) | |
download | frr-137ce8dd46d313f15ee93ddbb5428d702aa61ed8.tar.xz frr-137ce8dd46d313f15ee93ddbb5428d702aa61ed8.zip |
Merging upstream version 10.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | lib/affinitymap_cli.c | 44 |
1 files changed, 17 insertions, 27 deletions
diff --git a/lib/affinitymap_cli.c b/lib/affinitymap_cli.c index a2d5e8e..73b91e7 100644 --- a/lib/affinitymap_cli.c +++ b/lib/affinitymap_cli.c @@ -30,15 +30,6 @@ #include "lib/affinitymap.h" #include "lib/affinitymap_cli_clippy.c" -/* Route map node structure. */ -static int affinity_map_config_write(struct vty *vty); -static struct cmd_node affinitymap_node = { - .name = "affinity-map", - .node = AFFMAP_NODE, - .prompt = "", - .config_write = affinity_map_config_write, -}; - /* max value is EXT_ADMIN_GROUP_MAX_POSITIONS - 1 */ DEFPY_YANG_NOSH(affinity_map, affinity_map_cmd, "affinity-map NAME$name bit-position (0-1023)$position", @@ -75,33 +66,32 @@ DEFPY_YANG_NOSH(no_affinity_map, no_affinity_map_cmd, return nb_cli_apply_changes(vty, NULL); } -static int affinity_map_config_write(struct vty *vty) -{ - const struct lyd_node *dnode; - int written = 0; - - dnode = yang_dnode_get(running_config->dnode, "/frr-affinity-map:lib"); - if (dnode) { - nb_cli_show_dnode_cmds(vty, dnode, false); - written = 1; - } - - return written; -} - -void cli_show_affinity_map(struct vty *vty, const struct lyd_node *dnode, +static void cli_show_affinity_map(struct vty *vty, const struct lyd_node *dnode, bool show_defaults __attribute__((__unused__))) { vty_out(vty, "affinity-map %s bit-position %u\n", - yang_dnode_get_string(dnode, "./name"), - yang_dnode_get_uint16(dnode, "./value")); + yang_dnode_get_string(dnode, "name"), + yang_dnode_get_uint16(dnode, "value")); } +const struct frr_yang_module_info frr_affinity_map_cli_info = { + .name = "frr-affinity-map", + .ignore_cfg_cbs = true, + .nodes = { + { + .xpath = "/frr-affinity-map:lib/affinity-maps/affinity-map", + .cbs.cli_show = cli_show_affinity_map, + }, + { + .xpath = NULL, + }, + } +}; + /* Initialization of affinity map vector. */ void affinity_map_init(void) { /* CLI commands. */ - install_node(&affinitymap_node); install_element(CONFIG_NODE, &affinity_map_cmd); install_element(CONFIG_NODE, &no_affinity_map_cmd); } |