diff options
author | Igor Ryzhov <iryzhov@nfware.com> | 2021-02-16 10:57:30 +0100 |
---|---|---|
committer | Igor Ryzhov <iryzhov@nfware.com> | 2021-02-22 16:53:24 +0100 |
commit | 09b150ef2a20948947981fedcc86c82fcfa51a75 (patch) | |
tree | 8920894979b4987c94fe45fdc58ce5c0d8a6fe16 /lib | |
parent | bgpd: don't rely on northbound control plane protocol vrf pointer (diff) | |
download | frr-09b150ef2a20948947981fedcc86c82fcfa51a75.tar.xz frr-09b150ef2a20948947981fedcc86c82fcfa51a75.zip |
lib: add definitions for vrf xpaths
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/vrf.c | 7 | ||||
-rw-r--r-- | lib/vrf.h | 3 |
2 files changed, 6 insertions, 4 deletions
@@ -686,8 +686,8 @@ int vrf_handler_create(struct vty *vty, const char *vrfname, } if (vty) { - snprintf(xpath_list, sizeof(xpath_list), - "/frr-vrf:lib/vrf[name='%s']", vrfname); + snprintf(xpath_list, sizeof(xpath_list), FRR_VRF_KEY_XPATH, + vrfname); nb_cli_enqueue_change(vty, xpath_list, NB_OP_CREATE, NULL); ret = nb_cli_apply_changes(vty, xpath_list); @@ -821,8 +821,7 @@ DEFUN_YANG (no_vrf, return CMD_WARNING_CONFIG_FAILED; } - snprintf(xpath_list, sizeof(xpath_list), "/frr-vrf:lib/vrf[name='%s']", - vrfname); + snprintf(xpath_list, sizeof(xpath_list), FRR_VRF_KEY_XPATH, vrfname); nb_cli_enqueue_change(vty, xpath_list, NB_OP_DESTROY, NULL); return nb_cli_apply_changes(vty, xpath_list); @@ -52,6 +52,9 @@ enum { IFLA_VRF_UNSPEC, IFLA_VRF_TABLE, __IFLA_VRF_MAX }; #define VRF_ALL_CMD_HELP_STR "Specify the VRF\nAll VRFs\n" #define VRF_FULL_CMD_HELP_STR "Specify the VRF\nThe VRF name\nAll VRFs\n" +#define FRR_VRF_XPATH "/frr-vrf:lib/vrf" +#define FRR_VRF_KEY_XPATH "/frr-vrf:lib/vrf[name='%s']" + /* * Pass some OS specific data up through * to the daemons |