Skip to content

Commit

Permalink
*: Move distance related defines into their own header
Browse files Browse the repository at this point in the history
Signed-off-by: Donald Sharp <[email protected]>
  • Loading branch information
donaldsharp committed Nov 6, 2023
1 parent 3003c3e commit 6fc9686
Show file tree
Hide file tree
Showing 16 changed files with 51 additions and 22 deletions.
2 changes: 2 additions & 0 deletions bgpd/bgp_route.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions bgpd/bgp_zebra.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
35 changes: 35 additions & 0 deletions lib/frrdistance.h
Original file line number Diff line number Diff line change
@@ -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
22 changes: 0 additions & 22 deletions lib/zebra.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions ospf6d/ospf6_top.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions ospfd/ospf_vty.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions pimd/pim_upstream.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "jhash.h"
#include "wheel.h"
#include "network.h"
#include "frrdistance.h"

#include "pimd.h"
#include "pim_pim.h"
Expand Down
1 change: 1 addition & 0 deletions ripd/rip_peer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions ripd/rip_zebra.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions ripd/ripd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions ripngd/ripng_peer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions staticd/static_vty.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions zebra/redistribute.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions zebra/zapi_msg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions zebra/zebra_rib.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions zebra/zebra_vty.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 6fc9686

Please sign in to comment.