diff options
author | Quentin Young <qlyoung@cumulusnetworks.com> | 2019-09-11 22:59:46 +0200 |
---|---|---|
committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2019-12-09 20:39:18 +0100 |
commit | f495425b64b50c32c5db29a30224f1b15d5b3a3b (patch) | |
tree | 390589d6858a8c2f2f1aa620f3e720445bcd8a77 /vrrpd/vrrp_northbound.c | |
parent | yang: add opderdata & slight reorg for vrrp (diff) | |
download | frr-f495425b64b50c32c5db29a30224f1b15d5b3a3b.tar.xz frr-f495425b64b50c32c5db29a30224f1b15d5b3a3b.zip |
vrrpd: northbound conversion
Convert VRRPD to use the northbound API.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'vrrpd/vrrp_northbound.c')
-rw-r--r-- | vrrpd/vrrp_northbound.c | 814 |
1 files changed, 814 insertions, 0 deletions
diff --git a/vrrpd/vrrp_northbound.c b/vrrpd/vrrp_northbound.c new file mode 100644 index 000000000..71fe6f1e4 --- /dev/null +++ b/vrrpd/vrrp_northbound.c @@ -0,0 +1,814 @@ +/* + * VRRP northbound bindings. + * Copyright (C) 2019 Cumulus Networks, Inc. + * Quentin Young + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation; either version 2 of the License, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; see the file COPYING; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include <zebra.h> + +#include "if.h" +#include "log.h" +#include "prefix.h" +#include "table.h" +#include "command.h" +#include "northbound.h" +#include "libfrr.h" +#include "vrrp.h" +#include "vrrp_vty.h" + +/* + * XPath: /frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group + */ +static int lib_interface_vrrp_vrrp_group_create(enum nb_event event, + const struct lyd_node *dnode, + union nb_resource *resource) +{ + struct interface *ifp; + uint8_t vrid; + uint8_t version = 3; + struct vrrp_vrouter *vr; + + if (event != NB_EV_APPLY) + return NB_OK; + + ifp = nb_running_get_entry(dnode, NULL, true); + vrid = yang_dnode_get_uint8(dnode, "./virtual-router-id"); + version = yang_dnode_get_enum(dnode, "./version"); + vr = vrrp_vrouter_create(ifp, vrid, version); + nb_running_set_entry(dnode, vr); + + return NB_OK; +} + +static int lib_interface_vrrp_vrrp_group_destroy(enum nb_event event, + const struct lyd_node *dnode) +{ + struct vrrp_vrouter *vr; + + if (event != NB_EV_APPLY) + return NB_OK; + + vr = nb_running_unset_entry(dnode); + vrrp_vrouter_destroy(vr); + + return NB_OK; +} + +static const void * +lib_interface_vrrp_vrrp_group_get_next(const void *parent_list_entry, + const void *list_entry) +{ + struct list *l = hash_to_list(vrrp_vrouters_hash); + struct listnode *ln; + const struct vrrp_vrouter *vr, *prev, *curr; + const struct interface *ifp = parent_list_entry; + + prev = curr = NULL; + vr = list_entry; + + /* + * If list_entry is null, we return the first vrrp instance with a + * matching interface + */ + bool nextone = list_entry ? false : true; + + for (ALL_LIST_ELEMENTS_RO(l, ln, curr)) { + if (curr == list_entry) { + nextone = true; + continue; + } + + if (nextone && curr->ifp == ifp) + goto done; + + prev = curr; + } + + curr = NULL; + +done: + list_delete(&l); + return curr; +} + +static int lib_interface_vrrp_vrrp_group_get_keys(const void *list_entry, + struct yang_list_keys *keys) +{ + const struct vrrp_vrouter *vr = list_entry; + + keys->num = 1; + snprintf(keys->key[0], sizeof(keys->key[0]), "%" PRIu32, vr->vrid); + + return NB_OK; +} + +static const void * +lib_interface_vrrp_vrrp_group_lookup_entry(const void *parent_list_entry, + const struct yang_list_keys *keys) +{ + uint32_t vrid = strtoul(keys->key[0], NULL, 10); + const struct interface *ifp = parent_list_entry; + + vrrp_lookup(ifp, vrid); + + return NULL; +} + +/* + * XPath: /frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/version + */ +static int +lib_interface_vrrp_vrrp_group_version_modify(enum nb_event event, + const struct lyd_node *dnode, + union nb_resource *resource) +{ + if (event != NB_EV_APPLY) + return NB_OK; + + struct vrrp_vrouter *vr; + uint8_t version; + + vr = nb_running_get_entry(dnode, NULL, true); + vrrp_event(vr->v4, VRRP_EVENT_SHUTDOWN); + vrrp_event(vr->v6, VRRP_EVENT_SHUTDOWN); + version = yang_dnode_get_enum(dnode, NULL); + vr->version = version; + + vrrp_check_start(vr); + + return NB_OK; +} + +static void vrrp_yang_add_del_virtual_address(const struct lyd_node *dnode, + bool add) +{ + struct vrrp_vrouter *vr; + struct ipaddr ip; + + vr = nb_running_get_entry(dnode, NULL, true); + yang_dnode_get_ip(&ip, dnode, NULL); + if (add) + vrrp_add_ip(vr, &ip); + else + vrrp_del_ip(vr, &ip); + + vrrp_check_start(vr); +} + + +//----------- + +/* + * XPath: + * /frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/v4/virtual-address + */ +static int lib_interface_vrrp_vrrp_group_v4_virtual_address_create( + enum nb_event event, const struct lyd_node *dnode, + union nb_resource *resource) +{ + if (event != NB_EV_APPLY) + return NB_OK; + + vrrp_yang_add_del_virtual_address(dnode, true); + + return NB_OK; +} + +static int lib_interface_vrrp_vrrp_group_v4_virtual_address_destroy( + enum nb_event event, const struct lyd_node *dnode) +{ + if (event != NB_EV_APPLY) + return NB_OK; + + vrrp_yang_add_del_virtual_address(dnode, false); + + return NB_OK; +} + +/* + * XPath: + * /frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/v4/current-priority + */ +static struct yang_data * +lib_interface_vrrp_vrrp_group_v4_current_priority_get_elem( + const char *xpath, const void *list_entry) +{ + const struct vrrp_vrouter *vr = list_entry; + + return yang_data_new_uint8(xpath, vr->v4->priority); +} + +/* + * XPath: + * /frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/v4/vrrp-interface + */ +static struct yang_data * +lib_interface_vrrp_vrrp_group_v4_vrrp_interface_get_elem(const char *xpath, + const void *list_entry) +{ + const struct vrrp_vrouter *vr = list_entry; + + struct yang_data *val = NULL; + + if (vr->v4->mvl_ifp) + val = yang_data_new_string(xpath, vr->v4->mvl_ifp->name); + + return val; +} + +/* + * XPath: + * /frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/v4/source-address + */ +static struct yang_data * +lib_interface_vrrp_vrrp_group_v4_source_address_get_elem(const char *xpath, + const void *list_entry) +{ + const struct vrrp_vrouter *vr = list_entry; + struct yang_data *val = NULL; + struct ipaddr ip; + + memset(&ip, 0x00, sizeof(ip)); + + if (memcmp(&vr->v4->src.ipaddr_v4, &ip.ipaddr_v4, sizeof(ip.ipaddr_v4))) + val = yang_data_new_ip(xpath, &vr->v4->src); + + return val; +} + +/* + * XPath: /frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/v4/state + */ +static struct yang_data * +lib_interface_vrrp_vrrp_group_v4_state_get_elem(const char *xpath, + const void *list_entry) +{ + const struct vrrp_vrouter *vr = list_entry; + + return yang_data_new_enum(xpath, vr->v4->fsm.state); +} + +/* + * XPath: + * /frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/v4/master-advertisement-interval + */ +static struct yang_data * +lib_interface_vrrp_vrrp_group_v4_master_advertisement_interval_get_elem( + const char *xpath, const void *list_entry) +{ + const struct vrrp_vrouter *vr = list_entry; + + return yang_data_new_uint16(xpath, vr->v4->master_adver_interval); +} + +/* + * XPath: /frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/v4/skew-time + */ +static struct yang_data * +lib_interface_vrrp_vrrp_group_v4_skew_time_get_elem(const char *xpath, + const void *list_entry) +{ + const struct vrrp_vrouter *vr = list_entry; + + return yang_data_new_uint16(xpath, vr->v4->skew_time); +} + +/* + * XPath: + * /frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/v4/counter/state-transition + */ +static struct yang_data * +lib_interface_vrrp_vrrp_group_v4_counter_state_transition_get_elem( + const char *xpath, const void *list_entry) +{ + const struct vrrp_vrouter *vr = list_entry; + + return yang_data_new_uint32(xpath, vr->v4->stats.trans_cnt); +} + +/* + * XPath: + * /frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/v4/counter/tx/advertisement + */ +static struct yang_data * +lib_interface_vrrp_vrrp_group_v4_counter_tx_advertisement_get_elem( + const char *xpath, const void *list_entry) +{ + const struct vrrp_vrouter *vr = list_entry; + + return yang_data_new_uint32(xpath, vr->v4->stats.adver_tx_cnt); +} + +/* + * XPath: + * /frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/v4/counter/tx/gratuitous-arp + */ +static struct yang_data * +lib_interface_vrrp_vrrp_group_v4_counter_tx_gratuitous_arp_get_elem( + const char *xpath, const void *list_entry) +{ + const struct vrrp_vrouter *vr = list_entry; + + return yang_data_new_uint32(xpath, vr->v4->stats.garp_tx_cnt); +} + +/* + * XPath: + * /frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/v4/counter/rx/advertisement + */ +static struct yang_data * +lib_interface_vrrp_vrrp_group_v4_counter_rx_advertisement_get_elem( + const char *xpath, const void *list_entry) +{ + const struct vrrp_vrouter *vr = list_entry; + + return yang_data_new_uint32(xpath, vr->v4->stats.adver_rx_cnt); +} + +/* + * XPath: + * /frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/v6/virtual-address + */ +static int lib_interface_vrrp_vrrp_group_v6_virtual_address_create( + enum nb_event event, const struct lyd_node *dnode, + union nb_resource *resource) +{ + if (event != NB_EV_APPLY) + return NB_OK; + + vrrp_yang_add_del_virtual_address(dnode, true); + + return NB_OK; +} + +static int lib_interface_vrrp_vrrp_group_v6_virtual_address_destroy( + enum nb_event event, const struct lyd_node *dnode) +{ + if (event != NB_EV_APPLY) + return NB_OK; + + vrrp_yang_add_del_virtual_address(dnode, false); + + return NB_OK; +} + +/* + * XPath: + * /frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/v6/current-priority + */ +static struct yang_data * +lib_interface_vrrp_vrrp_group_v6_current_priority_get_elem( + const char *xpath, const void *list_entry) +{ + const struct vrrp_vrouter *vr = list_entry; + + return yang_data_new_uint8(xpath, vr->v6->priority); +} + +/* + * XPath: + * /frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/v6/vrrp-interface + */ +static struct yang_data * +lib_interface_vrrp_vrrp_group_v6_vrrp_interface_get_elem(const char *xpath, + const void *list_entry) +{ + const struct vrrp_vrouter *vr = list_entry; + struct yang_data *val = NULL; + + if (vr->v6->mvl_ifp) + val = yang_data_new_string(xpath, vr->v6->mvl_ifp->name); + + return val; +} + +/* + * XPath: + * /frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/v6/source-address + */ +static struct yang_data * +lib_interface_vrrp_vrrp_group_v6_source_address_get_elem(const char *xpath, + const void *list_entry) +{ + const struct vrrp_vrouter *vr = list_entry; + struct yang_data *val = NULL; + struct ipaddr ip; + + memset(&ip, 0x00, sizeof(ip)); + + if (memcmp(&vr->v6->src.ipaddr_v6, &ip.ipaddr_v6, sizeof(ip.ipaddr_v6))) + val = yang_data_new_ip(xpath, &vr->v6->src); + + return val; +} + +/* + * XPath: /frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/v6/state + */ +static struct yang_data * +lib_interface_vrrp_vrrp_group_v6_state_get_elem(const char *xpath, + const void *list_entry) +{ + const struct vrrp_vrouter *vr = list_entry; + + return yang_data_new_enum(xpath, vr->v6->fsm.state); +} + +/* + * XPath: + * /frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/v6/master-advertisement-interval + */ +static struct yang_data * +lib_interface_vrrp_vrrp_group_v6_master_advertisement_interval_get_elem( + const char *xpath, const void *list_entry) +{ + const struct vrrp_vrouter *vr = list_entry; + + return yang_data_new_uint16(xpath, vr->v6->master_adver_interval); +} + +/* + * XPath: /frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/v6/skew-time + */ +static struct yang_data * +lib_interface_vrrp_vrrp_group_v6_skew_time_get_elem(const char *xpath, + const void *list_entry) +{ + const struct vrrp_vrouter *vr = list_entry; + + return yang_data_new_uint16(xpath, vr->v6->skew_time); +} + +/* + * XPath: + * /frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/v6/counter/state-transition + */ +static struct yang_data * +lib_interface_vrrp_vrrp_group_v6_counter_state_transition_get_elem( + const char *xpath, const void *list_entry) +{ + const struct vrrp_vrouter *vr = list_entry; + + return yang_data_new_uint32(xpath, vr->v6->stats.trans_cnt); +} + +/* + * XPath: + * /frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/v6/counter/tx/advertisement + */ +static struct yang_data * +lib_interface_vrrp_vrrp_group_v6_counter_tx_advertisement_get_elem( + const char *xpath, const void *list_entry) +{ + const struct vrrp_vrouter *vr = list_entry; + + return yang_data_new_uint32(xpath, vr->v6->stats.adver_tx_cnt); +} + +/* + * XPath: + * /frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/v6/counter/tx/neighbor-advertisement + */ +static struct yang_data * +lib_interface_vrrp_vrrp_group_v6_counter_tx_neighbor_advertisement_get_elem( + const char *xpath, const void *list_entry) +{ + /* TODO: implement me. */ + return NULL; +} + +/* + * XPath: + * /frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/v6/counter/rx/advertisement + */ +static struct yang_data * +lib_interface_vrrp_vrrp_group_v6_counter_rx_advertisement_get_elem( + const char *xpath, const void *list_entry) +{ + /* TODO: implement me. */ + return NULL; +} + +/* + * XPath: /frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/priority + */ +static int +lib_interface_vrrp_vrrp_group_priority_modify(enum nb_event event, + const struct lyd_node *dnode, + union nb_resource *resource) +{ + if (event != NB_EV_APPLY) + return NB_OK; + + struct vrrp_vrouter *vr; + uint8_t priority; + + vr = nb_running_get_entry(dnode, NULL, true); + priority = yang_dnode_get_uint8(dnode, NULL); + vrrp_set_priority(vr, priority); + + return NB_OK; +} + +/* + * XPath: /frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/preempt + */ +static int +lib_interface_vrrp_vrrp_group_preempt_modify(enum nb_event event, + const struct lyd_node *dnode, + union nb_resource *resource) +{ + if (event != NB_EV_APPLY) + return NB_OK; + + struct vrrp_vrouter *vr; + bool preempt; + + vr = nb_running_get_entry(dnode, NULL, true); + preempt = yang_dnode_get_bool(dnode, NULL); + vr->preempt_mode = preempt; + + return NB_OK; +} + +/* + * XPath: /frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/accept-mode + */ +static int +lib_interface_vrrp_vrrp_group_accept_mode_modify(enum nb_event event, + const struct lyd_node *dnode, + union nb_resource *resource) +{ + if (event != NB_EV_APPLY) + return NB_OK; + + struct vrrp_vrouter *vr; + bool accept; + + vr = nb_running_get_entry(dnode, NULL, true); + accept = yang_dnode_get_bool(dnode, NULL); + vr->accept_mode = accept; + + return NB_OK; +} + +/* + * XPath: + * /frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/advertisement-interval + */ +static int lib_interface_vrrp_vrrp_group_advertisement_interval_modify( + enum nb_event event, const struct lyd_node *dnode, + union nb_resource *resource) +{ + if (event != NB_EV_APPLY) + return NB_OK; + + struct vrrp_vrouter *vr; + uint16_t advert_int; + + vr = nb_running_get_entry(dnode, NULL, true); + advert_int = yang_dnode_get_uint16(dnode, NULL); + vrrp_set_advertisement_interval(vr, advert_int); + + return NB_OK; +} + +/* + * XPath: /frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/shutdown + */ +static int +lib_interface_vrrp_vrrp_group_shutdown_modify(enum nb_event event, + const struct lyd_node *dnode, + union nb_resource *resource) +{ + if (event != NB_EV_APPLY) + return NB_OK; + + struct vrrp_vrouter *vr; + bool shutdown; + + vr = nb_running_get_entry(dnode, NULL, true); + shutdown = yang_dnode_get_bool(dnode, NULL); + + vr->shutdown = shutdown; + + if (shutdown) { + vrrp_event(vr->v4, VRRP_EVENT_SHUTDOWN); + vrrp_event(vr->v6, VRRP_EVENT_SHUTDOWN); + } else { + vrrp_check_start(vr); + } + + return NB_OK; +} + +/* clang-format off */ +const struct frr_yang_module_info frr_vrrpd_info = { + .name = "frr-vrrpd", + .nodes = { + { + .xpath = "/frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group", + .cbs = { + .create = lib_interface_vrrp_vrrp_group_create, + .destroy = lib_interface_vrrp_vrrp_group_destroy, + .get_next = lib_interface_vrrp_vrrp_group_get_next, + .get_keys = lib_interface_vrrp_vrrp_group_get_keys, + .lookup_entry = lib_interface_vrrp_vrrp_group_lookup_entry, + .cli_show = cli_show_vrrp, + } + }, + { + .xpath = "/frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/version", + .cbs = { + .modify = lib_interface_vrrp_vrrp_group_version_modify, + } + }, + { + .xpath = "/frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/priority", + .cbs = { + .modify = lib_interface_vrrp_vrrp_group_priority_modify, + .cli_show = cli_show_priority, + } + }, + { + .xpath = "/frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/preempt", + .cbs = { + .modify = lib_interface_vrrp_vrrp_group_preempt_modify, + .cli_show = cli_show_preempt, + } + }, + { + .xpath = "/frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/accept-mode", + .cbs = { + .modify = lib_interface_vrrp_vrrp_group_accept_mode_modify, + } + }, + { + .xpath = "/frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/advertisement-interval", + .cbs = { + .modify = lib_interface_vrrp_vrrp_group_advertisement_interval_modify, + .cli_show = cli_show_advertisement_interval, + } + }, + { + .xpath = "/frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/shutdown", + .cbs = { + .modify = lib_interface_vrrp_vrrp_group_shutdown_modify, + .cli_show = cli_show_shutdown, + } + }, + { + .xpath = "/frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/v4/virtual-address", + .cbs = { + .create = lib_interface_vrrp_vrrp_group_v4_virtual_address_create, + .destroy = lib_interface_vrrp_vrrp_group_v4_virtual_address_destroy, + .cli_show = cli_show_ip, + } + }, + { + .xpath = "/frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/v4/current-priority", + .cbs = { + .get_elem = lib_interface_vrrp_vrrp_group_v4_current_priority_get_elem, + } + }, + { + .xpath = "/frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/v4/vrrp-interface", + .cbs = { + .get_elem = lib_interface_vrrp_vrrp_group_v4_vrrp_interface_get_elem, + } + }, + { + .xpath = "/frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/v4/source-address", + .cbs = { + .get_elem = lib_interface_vrrp_vrrp_group_v4_source_address_get_elem, + } + }, + { + .xpath = "/frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/v4/state", + .cbs = { + .get_elem = lib_interface_vrrp_vrrp_group_v4_state_get_elem, + } + }, + { + .xpath = "/frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/v4/master-advertisement-interval", + .cbs = { + .get_elem = lib_interface_vrrp_vrrp_group_v4_master_advertisement_interval_get_elem, + } + }, + { + .xpath = "/frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/v4/skew-time", + .cbs = { + .get_elem = lib_interface_vrrp_vrrp_group_v4_skew_time_get_elem, + } + }, + { + .xpath = "/frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/v4/counter/state-transition", + .cbs = { + .get_elem = lib_interface_vrrp_vrrp_group_v4_counter_state_transition_get_elem, + } + }, + { + .xpath = "/frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/v4/counter/tx/advertisement", + .cbs = { + .get_elem = lib_interface_vrrp_vrrp_group_v4_counter_tx_advertisement_get_elem, + } + }, + { + .xpath = "/frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/v4/counter/tx/gratuitous-arp", + .cbs = { + .get_elem = lib_interface_vrrp_vrrp_group_v4_counter_tx_gratuitous_arp_get_elem, + } + }, + { + .xpath = "/frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/v4/counter/rx/advertisement", + .cbs = { + .get_elem = lib_interface_vrrp_vrrp_group_v4_counter_rx_advertisement_get_elem, + } + }, + { + .xpath = "/frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/v6/virtual-address", + .cbs = { + .create = lib_interface_vrrp_vrrp_group_v6_virtual_address_create, + .destroy = lib_interface_vrrp_vrrp_group_v6_virtual_address_destroy, + .cli_show = cli_show_ipv6, + } + }, + { + .xpath = "/frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/v6/current-priority", + .cbs = { + .get_elem = lib_interface_vrrp_vrrp_group_v6_current_priority_get_elem, + } + }, + { + .xpath = "/frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/v6/vrrp-interface", + .cbs = { + .get_elem = lib_interface_vrrp_vrrp_group_v6_vrrp_interface_get_elem, + } + }, + { + .xpath = "/frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/v6/source-address", + .cbs = { + .get_elem = lib_interface_vrrp_vrrp_group_v6_source_address_get_elem, + } + }, + { + .xpath = "/frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/v6/state", + .cbs = { + .get_elem = lib_interface_vrrp_vrrp_group_v6_state_get_elem, + } + }, + { + .xpath = "/frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/v6/master-advertisement-interval", + .cbs = { + .get_elem = lib_interface_vrrp_vrrp_group_v6_master_advertisement_interval_get_elem, + } + }, + { + .xpath = "/frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/v6/skew-time", + .cbs = { + .get_elem = lib_interface_vrrp_vrrp_group_v6_skew_time_get_elem, + } + }, + { + .xpath = "/frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/v6/counter/state-transition", + .cbs = { + .get_elem = lib_interface_vrrp_vrrp_group_v6_counter_state_transition_get_elem, + } + }, + { + .xpath = "/frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/v6/counter/tx/advertisement", + .cbs = { + .get_elem = lib_interface_vrrp_vrrp_group_v6_counter_tx_advertisement_get_elem, + } + }, + { + .xpath = "/frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/v6/counter/tx/neighbor-advertisement", + .cbs = { + .get_elem = lib_interface_vrrp_vrrp_group_v6_counter_tx_neighbor_advertisement_get_elem, + } + }, + { + .xpath = "/frr-interface:lib/interface/frr-vrrpd:vrrp/vrrp-group/v6/counter/rx/advertisement", + .cbs = { + .get_elem = lib_interface_vrrp_vrrp_group_v6_counter_rx_advertisement_get_elem, + } + }, + { + .xpath = NULL, + }, + } +}; |