]> git.puffer.fish Git - matthieu/frr.git/commitdiff
*: Move distance related defines into their own header
authorDonald Sharp <sharpd@nvidia.com>
Sat, 4 Nov 2023 08:47:46 +0000 (08:47 +0000)
committerDonald Sharp <sharpd@nvidia.com>
Tue, 7 Nov 2023 11:47:51 +0000 (06:47 -0500)
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
17 files changed:
bgpd/bgp_route.c
bgpd/bgp_zebra.c
lib/frrdistance.h [new file with mode: 0644]
lib/subdir.am
lib/zebra.h
ospf6d/ospf6_top.c
ospfd/ospf_vty.c
pimd/pim_upstream.c
ripd/rip_peer.c
ripd/rip_zebra.c
ripd/ripd.c
ripngd/ripng_peer.c
staticd/static_vty.c
zebra/redistribute.c
zebra/zapi_msg.c
zebra/zebra_rib.c
zebra/zebra_vty.c

index b627487e7c2063b4b2dbcecfc95ceebafb3414e0..4ced565d5298c57f547fbb257ccbc367c8c8c7c9 100644 (file)
@@ -28,6 +28,8 @@
 #include "lib/json.h"
 #include "lib_errors.h"
 #include "zclient.h"
+#include "frrdistance.h"
+
 #include "bgpd/bgpd.h"
 #include "bgpd/bgp_table.h"
 #include "bgpd/bgp_route.h"
index 381acd803e047c723c8d2822502fc9533cbf936a..65ac92ef0566f077c3650796e9bfb9aa2941d77a 100644 (file)
@@ -24,6 +24,7 @@
 #include "mpls.h"
 #include "vxlan.h"
 #include "pbr.h"
+#include "frrdistance.h"
 
 #include "bgpd/bgpd.h"
 #include "bgpd/bgp_route.h"
diff --git a/lib/frrdistance.h b/lib/frrdistance.h
new file mode 100644 (file)
index 0000000..d2fa76e
--- /dev/null
@@ -0,0 +1,35 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Zebra distance header
+ * Copyright (C) 2023 NVIDIA Corporation
+ * Donald Sharp
+ *
+ * Distance related defines.  FRR needs a common set
+ * of values for distance.
+ */
+#ifndef __FRRDISTANCE_H__
+#define __FRRDISTANCE_H__
+
+/* Default Administrative Distance of each protocol. */
+#define ZEBRA_KERNEL_DISTANCE_DEFAULT       0
+#define ZEBRA_CONNECT_DISTANCE_DEFAULT      0
+#define ZEBRA_STATIC_DISTANCE_DEFAULT       1
+#define ZEBRA_RIP_DISTANCE_DEFAULT        120
+#define ZEBRA_RIPNG_DISTANCE_DEFAULT      120
+#define ZEBRA_OSPF_DISTANCE_DEFAULT       110
+#define ZEBRA_OSPF6_DISTANCE_DEFAULT      110
+#define ZEBRA_ISIS_DISTANCE_DEFAULT       115
+#define ZEBRA_IBGP_DISTANCE_DEFAULT       200
+#define ZEBRA_EBGP_DISTANCE_DEFAULT        20
+#define ZEBRA_TABLE_DISTANCE_DEFAULT       15
+#define ZEBRA_TABLEDIRECT_DISTANCE_DEFAULT 14
+#define ZEBRA_EIGRP_DISTANCE_DEFAULT       90
+#define ZEBRA_NHRP_DISTANCE_DEFAULT        10
+#define ZEBRA_LDP_DISTANCE_DEFAULT        150
+#define ZEBRA_BABEL_DISTANCE_DEFAULT      100
+#define ZEBRA_SHARP_DISTANCE_DEFAULT      150
+#define ZEBRA_PBR_DISTANCE_DEFAULT        200
+#define ZEBRA_OPENFABRIC_DISTANCE_DEFAULT 115
+#define ZEBRA_MAX_DISTANCE_DEFAULT        255
+
+#endif
index d7b28ffbd59e457eea2a2bcaed6182451134f48b..0c718d12aa5e72d6c5c09a3754ddd5155da2fbcd 100644 (file)
@@ -219,6 +219,7 @@ pkginclude_HEADERS += \
        lib/filter.h \
        lib/flex_algo.h \
        lib/freebsd-queue.h \
+       lib/frrdistance.h \
        lib/frrlua.h \
        lib/frrscript.h \
        lib/frr_pthread.h \
index 378ccd84d011cab34ab8a91e641e6ba30a84f86a..e5021df22b0df05bf7d3c10668577e1dc289cabc 100644 (file)
@@ -350,28 +350,6 @@ typedef enum {
        for (afi = AFI_IP; afi < AFI_MAX; afi++)                               \
                for (safi = SAFI_UNICAST; safi <= SAFI_MPLS_VPN; safi++)
 
-/* Default Administrative Distance of each protocol. */
-#define ZEBRA_KERNEL_DISTANCE_DEFAULT       0
-#define ZEBRA_CONNECT_DISTANCE_DEFAULT      0
-#define ZEBRA_STATIC_DISTANCE_DEFAULT       1
-#define ZEBRA_RIP_DISTANCE_DEFAULT        120
-#define ZEBRA_RIPNG_DISTANCE_DEFAULT      120
-#define ZEBRA_OSPF_DISTANCE_DEFAULT       110
-#define ZEBRA_OSPF6_DISTANCE_DEFAULT      110
-#define ZEBRA_ISIS_DISTANCE_DEFAULT       115
-#define ZEBRA_IBGP_DISTANCE_DEFAULT       200
-#define ZEBRA_EBGP_DISTANCE_DEFAULT        20
-#define ZEBRA_TABLE_DISTANCE_DEFAULT       15
-#define ZEBRA_TABLEDIRECT_DISTANCE_DEFAULT 14
-#define ZEBRA_EIGRP_DISTANCE_DEFAULT       90
-#define ZEBRA_NHRP_DISTANCE_DEFAULT        10
-#define ZEBRA_LDP_DISTANCE_DEFAULT        150
-#define ZEBRA_BABEL_DISTANCE_DEFAULT      100
-#define ZEBRA_SHARP_DISTANCE_DEFAULT      150
-#define ZEBRA_PBR_DISTANCE_DEFAULT        200
-#define ZEBRA_OPENFABRIC_DISTANCE_DEFAULT 115
-#define ZEBRA_MAX_DISTANCE_DEFAULT        255
-
 /* Flag manipulation macros. */
 #define CHECK_FLAG(V,F)      ((V) & (F))
 #define SET_FLAG(V,F)        (V) |= (F)
index 216837d8a5c203104b842bf091264ee4f6dd705d..aa0625814c7c711313074ab7e14e808c7a317dbe 100644 (file)
@@ -16,6 +16,7 @@
 #include "defaults.h"
 #include "lib/json.h"
 #include "lib_errors.h"
+#include "frrdistance.h"
 
 #include "ospf6_proto.h"
 #include "ospf6_message.h"
index ab412e360619198788cad7962356000d013d09fc..f6ea5c6ef980141b8b52e1474c918f65ddc775ad 100644 (file)
@@ -22,6 +22,7 @@
 #include "defaults.h"
 #include "lib/printfrr.h"
 #include "keychain.h"
+#include "frrdistance.h"
 
 #include "ospfd/ospfd.h"
 #include "ospfd/ospf_asbr.h"
index e36bd82ac6e1e2210ea49024e3d1a770c5ffd02b..335c8a454bd5bab43b960669dceba9877905d15b 100644 (file)
@@ -17,6 +17,7 @@
 #include "jhash.h"
 #include "wheel.h"
 #include "network.h"
+#include "frrdistance.h"
 
 #include "pimd.h"
 #include "pim_pim.h"
index 3e8ddeccf2679b02db9f0ff84e23875f0a37b7df..7e848bee474520ad3889160473a54f3224bba292 100644 (file)
@@ -12,6 +12,7 @@
 #include "frrevent.h"
 #include "memory.h"
 #include "table.h"
+#include "frrdistance.h"
 
 #include "ripd/ripd.h"
 #include "ripd/rip_bfd.h"
index 36b58cb20be168cae44a149f41e679f88c61bc8f..ce94e8e7545f1658ba8f003dc25212f2aff203d8 100644 (file)
@@ -14,6 +14,8 @@
 #include "log.h"
 #include "vrf.h"
 #include "bfd.h"
+#include "frrdistance.h"
+
 #include "ripd/ripd.h"
 #include "ripd/rip_debug.h"
 #include "ripd/rip_interface.h"
index 7bfcaadc74cc0fd411a6128173954dfc2f3c1197..f197e389b261347579986e8281a7f44e162ed653 100644 (file)
@@ -31,6 +31,7 @@
 #include "northbound_cli.h"
 #include "network.h"
 #include "lib/printfrr.h"
+#include "frrdistance.h"
 
 #include "ripd/ripd.h"
 #include "ripd/rip_nb.h"
index 901b548a42a152cfbfa7c178b1cdbc18cc147e05..247bac46971bfcff83279b8153f4efab5edd164e 100644 (file)
@@ -15,6 +15,7 @@
 #include "linklist.h"
 #include "frrevent.h"
 #include "memory.h"
+#include "frrdistance.h"
 
 #include "ripngd/ripngd.h"
 #include "ripngd/ripng_nexthop.h"
index 0582df88abadde6f70a3bb2fb4ee7988501e0ead..4ca3c2e9210f0b2f007070563ba9716a85fd2bc7 100644 (file)
@@ -19,6 +19,7 @@
 #include "libfrr.h"
 #include "routing_nb.h"
 #include "northbound_cli.h"
+#include "frrdistance.h"
 
 #include "static_vrf.h"
 #include "static_vty.h"
index 6121949cedddcfbde135fd0f692ad731d8d3a28e..b0681bb09f2fd22331fff7558b7ee6e33a80ab48 100644 (file)
@@ -16,6 +16,7 @@
 #include "log.h"
 #include "vrf.h"
 #include "srcdest_table.h"
+#include "frrdistance.h"
 
 #include "zebra/rib.h"
 #include "zebra/zebra_router.h"
index 856c906bdcb2f7e609249320987e6c1ca23b3067..34977a914347f10b31cd2934a565a32a300cacfb 100644 (file)
@@ -24,6 +24,7 @@
 #include "lib/vrf.h"
 #include "lib/libfrr.h"
 #include "lib/lib_errors.h"
+#include "lib/frrdistance.h"
 
 #include "zebra/zebra_router.h"
 #include "zebra/rib.h"
index a4af3a43ffcc20efdb4ad4abb730c583281ef15b..05ac3f3d8e61a57551e47a976e3066d24565c2f6 100644 (file)
@@ -29,6 +29,7 @@
 #include "frr_pthread.h"
 #include "printfrr.h"
 #include "frrscript.h"
+#include "frrdistance.h"
 
 #include "zebra/zebra_router.h"
 #include "zebra/connected.h"
index 8c972487372823f186e75064d06e089b8e0f5955..a584cf638d710d9035d292a3b579d00eddaf6ce4 100644 (file)
@@ -20,6 +20,7 @@
 #include "vxlan.h"
 #include "termtable.h"
 #include "affinitymap.h"
+#include "frrdistance.h"
 
 #include "zebra/zebra_router.h"
 #include "zebra/zserv.h"