2005-06-28 Paul Jakma <paul.jakma@sun.com>
* (global) The great bgpd extern and static'ification.
* bgp_routemap.c: remove unused ROUTE_MATCH_ASPATH_OLD code
(route_set_metric_compile) fix u_int32_t to ULONG_MAX comparison
warnings.
* bgp_route.h: (bgp_process, bgp_withdraw, bgp_update) export these
used by various files which had their own private declarations,
in the case of mplsvpn - incorrect.
diff --git a/bgpd/bgp_nexthop.c b/bgpd/bgp_nexthop.c
index 20434e1..1f6fef8 100644
--- a/bgpd/bgp_nexthop.c
+++ b/bgpd/bgp_nexthop.c
@@ -66,12 +66,9 @@
/* BGP nexthop lookup query client. */
static struct zclient *zlookup = NULL;
-
-/* BGP process function. */
-int bgp_process (struct bgp *, struct bgp_node *, afi_t, safi_t);
/* Add nexthop to the end of the list. */
-void
+static void
bnc_nexthop_add (struct bgp_nexthop_cache *bnc, struct nexthop *nexthop)
{
struct nexthop *last;
@@ -85,7 +82,7 @@
nexthop->prev = last;
}
-void
+static void
bnc_nexthop_free (struct bgp_nexthop_cache *bnc)
{
struct nexthop *nexthop;
@@ -98,7 +95,7 @@
}
}
-struct bgp_nexthop_cache *
+static struct bgp_nexthop_cache *
bnc_new ()
{
struct bgp_nexthop_cache *new;
@@ -108,14 +105,14 @@
return new;
}
-void
+static void
bnc_free (struct bgp_nexthop_cache *bnc)
{
bnc_nexthop_free (bnc);
XFREE (MTYPE_BGP_NEXTHOP_CACHE, bnc);
}
-int
+static int
bgp_nexthop_same (struct nexthop *next1, struct nexthop *next2)
{
if (next1->type != next2->type)
@@ -152,7 +149,7 @@
return 1;
}
-int
+static int
bgp_nexthop_cache_changed (struct bgp_nexthop_cache *bnc1,
struct bgp_nexthop_cache *bnc2)
{
@@ -221,7 +218,7 @@
#ifdef HAVE_IPV6
/* Check specified next-hop is reachable or not. */
-int
+static int
bgp_nexthop_lookup_ipv6 (struct peer *peer, struct bgp_info *ri, int *changed,
int *metricchanged)
{
@@ -396,7 +393,7 @@
}
/* Reset and free all BGP nexthop cache. */
-void
+static void
bgp_nexthop_cache_reset (struct bgp_table *table)
{
struct bgp_node *rn;
@@ -411,7 +408,7 @@
}
}
-void
+static void
bgp_scan (afi_t afi, safi_t safi)
{
struct bgp_node *rn;
@@ -518,7 +515,7 @@
}
/* BGP scan thread. This thread check nexthop reachability. */
-int
+static int
bgp_scan_timer (struct thread *t)
{
bgp_scan_thread =
@@ -737,7 +734,7 @@
return 0;
}
-struct bgp_nexthop_cache *
+static struct bgp_nexthop_cache *
zlookup_read ()
{
struct stream *s;
@@ -833,7 +830,7 @@
}
#ifdef HAVE_IPV6
-struct bgp_nexthop_cache *
+static struct bgp_nexthop_cache *
zlookup_read_ipv6 ()
{
struct stream *s;
@@ -936,8 +933,9 @@
}
#endif /* HAVE_IPV6 */
-int
-bgp_import_check (struct prefix *p, u_int32_t *igpmetric, struct in_addr *igpnexthop)
+static int
+bgp_import_check (struct prefix *p, u_int32_t *igpmetric,
+ struct in_addr *igpnexthop)
{
struct stream *s;
int ret;
@@ -1024,7 +1022,7 @@
/* Scan all configured BGP route then check the route exists in IGP or
not. */
-int
+static int
bgp_import (struct thread *t)
{
struct bgp *bgp;
@@ -1089,7 +1087,7 @@
}
/* Connect to zebra for nexthop lookup. */
-int
+static int
zlookup_connect (struct thread *t)
{
struct zclient *zlookup;