summaryrefslogtreecommitdiff
path: root/zebra/zebra_nb_state.c
diff options
context:
space:
mode:
authorIgor Ryzhov <iryzhov@nfware.com>2024-02-20 17:37:25 +0200
committerIgor Ryzhov <iryzhov@nfware.com>2024-02-20 17:37:25 +0200
commit7a7bb6bc786db44a5803d214c02541bb1394d15f (patch)
tree52f847115b162abc6304a73150bd4f9a3cb96d7d /zebra/zebra_nb_state.c
parentb02d946db1e2241fc18bdf0a062672324609f2db (diff)
zebra: add interface's bond to oper state
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'zebra/zebra_nb_state.c')
-rw-r--r--zebra/zebra_nb_state.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/zebra/zebra_nb_state.c b/zebra/zebra_nb_state.c
index 00df9bfc55..8f81abc171 100644
--- a/zebra/zebra_nb_state.c
+++ b/zebra/zebra_nb_state.c
@@ -145,6 +145,28 @@ lib_interface_zebra_state_mcast_group_get_elem(struct nb_cb_get_elem_args *args)
return yang_data_new_ipv4(args->xpath, &vni->mcast_grp);
}
+/*
+ * XPath: /frr-interface:lib/interface/frr-zebra:zebra/state/bond
+ */
+struct yang_data *
+lib_interface_zebra_state_bond_get_elem(struct nb_cb_get_elem_args *args)
+{
+ const struct interface *ifp = args->list_entry;
+ struct zebra_if *zebra_if;
+ struct interface *bond;
+
+ if (!IS_ZEBRA_IF_BOND_SLAVE(ifp))
+ return NULL;
+
+ zebra_if = ifp->info;
+ bond = zebra_if->bondslave_info.bond_if;
+
+ if (!bond)
+ return NULL;
+
+ return yang_data_new_string(args->xpath, bond->name);
+}
+
const void *lib_vrf_zebra_ribs_rib_get_next(struct nb_cb_get_next_args *args)
{
struct vrf *vrf = (struct vrf *)args->parent_list_entry;