]> git.proxmox.com Git - mirror_frr.git/blobdiff - zebra/zebra_vrf.h
zebra: On shutdown stop hook calls for fpm rmac updates
[mirror_frr.git] / zebra / zebra_vrf.h
index a24a008b7611850f43552bba284531771dfb849f..b23b7282610bdf5de89129807d010833a191006f 100644 (file)
@@ -1,23 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra Vrf Header
  * Copyright (C) 2016 Cumulus Networks
  *                    Donald Sharp
- *
- * This file is part of Quagga.
- *
- * Quagga 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, or (at your option) any
- * later version.
- *
- * Quagga 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
  */
 #if !defined(__ZEBRA_VRF_H__)
 #define __ZEBRA_VRF_H__
@@ -26,6 +11,7 @@
 
 #include <zebra/zebra_ns.h>
 #include <zebra/zebra_pw.h>
+#include <zebra/rtadv.h>
 #include <lib/vxlan.h>
 
 #ifdef __cplusplus
@@ -177,9 +163,7 @@ struct zebra_vrf {
 
        struct table_manager *tbl_mgr;
 
-#if defined(HAVE_RTADV)
        struct rtadv rtadv;
-#endif /* HAVE_RTADV */
 
        bool zebra_rnh_ip_default_route;
        bool zebra_rnh_ipv6_default_route;
@@ -192,14 +176,10 @@ struct zebra_vrf {
 /*
  * special macro to allow us to get the correct zebra_vrf
  */
-#define ZEBRA_DECLVAR_CONTEXT(A, B)                                            \
-       struct vrf *A;                                                         \
-       if (vty->node == CONFIG_NODE)                                          \
-               A = vrf_lookup_by_id(VRF_DEFAULT);                             \
-       else                                                                   \
-               A = VTY_GET_CONTEXT(vrf);                                      \
-       VTY_CHECK_CONTEXT(A);                                                  \
-       struct zebra_vrf *B = A->info
+#define ZEBRA_DECLVAR_CONTEXT_VRF(vrfptr, zvrfptr)                             \
+       VTY_DECLVAR_CONTEXT_VRF(vrfptr);                                       \
+       struct zebra_vrf *zvrfptr = vrfptr->info;                              \
+       MACRO_REQUIRE_SEMICOLON() /* end */
 
 static inline vrf_id_t zvrf_id(struct zebra_vrf *zvrf)
 {