summaryrefslogtreecommitdiffstats
path: root/bgpd/bgpd.c
diff options
context:
space:
mode:
Diffstat (limited to 'bgpd/bgpd.c')
-rw-r--r--bgpd/bgpd.c91
1 files changed, 3 insertions, 88 deletions
diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c
index 8eb0d2e4..7f6ca168 100644
--- a/bgpd/bgpd.c
+++ b/bgpd/bgpd.c
@@ -114,46 +114,6 @@ bgp_option_check (int flag)
return CHECK_FLAG (bm->options, flag);
}
-/* BGP flag manipulation. */
-int
-bgp_flag_set (struct bgp *bgp, int flag)
-{
- SET_FLAG (bgp->flags, flag);
- return 0;
-}
-
-int
-bgp_flag_unset (struct bgp *bgp, int flag)
-{
- UNSET_FLAG (bgp->flags, flag);
- return 0;
-}
-
-int
-bgp_flag_check (struct bgp *bgp, int flag)
-{
- return CHECK_FLAG (bgp->flags, flag);
-}
-
-/* Internal function to set BGP structure configureation flag. */
-static void
-bgp_config_set (struct bgp *bgp, int config)
-{
- SET_FLAG (bgp->config, config);
-}
-
-static void
-bgp_config_unset (struct bgp *bgp, int config)
-{
- UNSET_FLAG (bgp->config, config);
-}
-
-static int
-bgp_config_check (struct bgp *bgp, int config)
-{
- return CHECK_FLAG (bgp->config, config);
-}
-
/* Set BGP router identifier. */
int
bgp_router_id_set (struct bgp *bgp, struct in_addr *id)
@@ -684,7 +644,7 @@ peer_sort (struct peer *peer)
}
}
-static inline void
+void
peer_free (struct peer *peer)
{
assert (peer->status == Deleted);
@@ -719,49 +679,6 @@ peer_free (struct peer *peer)
XFREE (MTYPE_BGP_PEER, peer);
}
-
-/* increase reference count on a struct peer */
-struct peer *
-peer_lock (struct peer *peer)
-{
- assert (peer && (peer->lock >= 0));
- assert (peer->status != Deleted);
-
- peer->lock++;
-
- return peer;
-}
-
-/* decrease reference count on a struct peer
- * struct peer is freed and NULL returned if last reference
- */
-struct peer *
-peer_unlock (struct peer *peer)
-{
- assert (peer && (peer->lock > 0));
-
- peer->lock--;
-
- if (peer->lock == 0)
- {
-#if 0
- zlog_debug ("unlocked and freeing");
- zlog_backtrace (LOG_DEBUG);
-#endif
- peer_free (peer);
- return NULL;
- }
-
-#if 0
- if (peer->lock == 1)
- {
- zlog_debug ("unlocked to 1");
- zlog_backtrace (LOG_DEBUG);
- }
-#endif
-
- return peer;
-}
/* Allocate new peer object, implicitely locked. */
static struct peer *
@@ -1190,7 +1107,7 @@ peer_delete (struct peer *peer)
if ((pn = listnode_lookup (peer->group->peer, peer)))
{
- peer = peer_unlock (peer); /* group->peer list reference */
+ peer_unlock (peer); /* group->peer list reference */
list_delete_node (peer->group->peer, pn);
}
peer->group = NULL;
@@ -2037,7 +1954,7 @@ bgp_get (struct bgp **bgp_val, as_t *as, const char *name)
}
/* Delete BGP instance. */
-int
+void
bgp_delete (struct bgp *bgp)
{
struct peer *peer;
@@ -2085,8 +2002,6 @@ bgp_delete (struct bgp *bgp)
XFREE (MTYPE_ROUTE_TABLE,bgp->rib[afi][safi]);
}
XFREE (MTYPE_BGP, bgp);
-
- return 0;
}
struct peer *