]> git.proxmox.com Git - mirror_frr.git/blobdiff - zebra/zebra_nb_state.c
Merge pull request #13395 from LabNConsulting/chopps/mgmtd-debug-flags
[mirror_frr.git] / zebra / zebra_nb_state.c
index a9cb096aee75fc6cad318f1b88ba670475495247..acf0b80aca685d72ed8aeb0e6d3fa79911e786b1 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020  Cumulus Networks, Inc.
  * Chirag Shah
- *
- * 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>
@@ -25,6 +12,8 @@
 #include "zebra/zebra_router.h"
 #include "zebra/debug.h"
 #include "printfrr.h"
+#include "zebra/zebra_vxlan.h"
+#include "zebra/zebra_vxlan_if.h"
 
 /*
  * XPath: /frr-interface:lib/interface/frr-zebra:zebra/state/up-count
@@ -101,15 +90,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 +131,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)
@@ -248,7 +243,7 @@ lib_vrf_zebra_ribs_rib_route_get_next(struct nb_cb_get_next_args *args)
        if (args->list_entry == NULL)
                rn = route_top(zrt->table);
        else
-               rn = srcdest_route_next((struct route_node *)rn);
+               rn = srcdest_route_next(rn);
        /* Optimization: skip empty route nodes. */
        while (rn && rn->info == NULL)
                rn = route_next(rn);
@@ -706,7 +701,7 @@ lib_vrf_zebra_ribs_rib_route_route_entry_nexthop_group_nexthop_nh_type_get_elem(
        case NEXTHOP_TYPE_IPV6_IFINDEX:
                return yang_data_new_string(args->xpath, "ip6-ifindex");
                break;
-       default:
+       case NEXTHOP_TYPE_BLACKHOLE:
                break;
        }