diff options
| author | Sharath Ramamurthy <sramamurthy@nvidia.com> | 2021-07-27 13:14:15 +0530 | 
|---|---|---|
| committer | Stephen Worley <sworley@nvidia.com> | 2023-02-13 18:12:04 -0500 | 
| commit | 8d30ff3b5ef815ad5cab092f2ce6dc28ab5e3421 (patch) | |
| tree | dba0c94cddbbb5cf0303e16e5a8fa208ba20feea /zebra/zebra_nb_state.c | |
| parent | 7809df20643ab9f731930dcef9661a70ef261e5b (diff) | |
zebra: data structure changes for single vxlan device
This changeset introduces the data structure changes needed for
single vxlan device functionality. A new struct zebra_vxlan_vni_info
encodes the iftype and vni information for vxlan device.
The change addresses related access changes of the new data structure
fields from different files
zebra_vty is modified to take care of the vni dump information according
to the new vni data structure for vxlan devices.
Signed-off-by: Sharath Ramamurthy <sramamurthy@nvidia.com>
Diffstat (limited to 'zebra/zebra_nb_state.c')
| -rw-r--r-- | zebra/zebra_nb_state.c | 19 | 
1 files changed, 13 insertions, 6 deletions
diff --git a/zebra/zebra_nb_state.c b/zebra/zebra_nb_state.c index 0f3d56f214..0c0bd56383 100644 --- a/zebra/zebra_nb_state.c +++ b/zebra/zebra_nb_state.c @@ -25,6 +25,7 @@  #include "zebra/zebra_router.h"  #include "zebra/debug.h"  #include "printfrr.h" +#include "zebra/zebra_vxlan.h"  /*   * XPath: /frr-interface:lib/interface/frr-zebra:zebra/state/up-count @@ -101,15 +102,18 @@ lib_interface_zebra_state_vni_id_get_elem(struct nb_cb_get_elem_args *args)  {  	const struct interface *ifp = args->list_entry;  	struct zebra_if *zebra_if; -	struct zebra_l2info_vxlan *vxlan_info; +	struct zebra_vxlan_vni *vni;  	if (!IS_ZEBRA_IF_VXLAN(ifp))  		return NULL;  	zebra_if = ifp->info; -	vxlan_info = &zebra_if->l2info.vxl; -	return yang_data_new_uint32(args->xpath, vxlan_info->vni); +	if (!IS_ZEBRA_VXLAN_IF_VNI(zebra_if)) +		return NULL; + +	vni = zebra_vxlan_if_vni_find(zebra_if, 0); +	return yang_data_new_uint32(args->xpath, vni->vni);  }  /* @@ -139,15 +143,18 @@ lib_interface_zebra_state_mcast_group_get_elem(struct nb_cb_get_elem_args *args)  {  	const struct interface *ifp = args->list_entry;  	struct zebra_if *zebra_if; -	struct zebra_l2info_vxlan *vxlan_info; +	struct zebra_vxlan_vni *vni;  	if (!IS_ZEBRA_IF_VXLAN(ifp))  		return NULL;  	zebra_if = ifp->info; -	vxlan_info = &zebra_if->l2info.vxl; -	return yang_data_new_ipv4(args->xpath, &vxlan_info->mcast_grp); +	if (!IS_ZEBRA_VXLAN_IF_VNI(zebra_if)) +		return NULL; + +	vni = zebra_vxlan_if_vni_find(zebra_if, 0); +	return yang_data_new_ipv4(args->xpath, &vni->mcast_grp);  }  const void *lib_vrf_zebra_ribs_rib_get_next(struct nb_cb_get_next_args *args)  | 
