summaryrefslogtreecommitdiff
path: root/bgpd/bgp_vty.c
diff options
context:
space:
mode:
authorpaul <paul>2005-04-07 07:30:20 +0000
committerpaul <paul>2005-04-07 07:30:20 +0000
commit1eb8ef2584833f18fb674e127d59cb5a7f771482 (patch)
treef5b09d4781de9a9b08839fefb6530e64d2d2ec31 /bgpd/bgp_vty.c
parent5920990fecba7e2430af3cfaa8bcbaed40d0ba1a (diff)
2005-04-07 Paul Jakma <paul.jakma@sun.com>
* (global): Fix up list loops to match changes in lib/linklist, and some basic auditing of usage. * configure.ac: define QUAGGA_NO_DEPRECATED_INTERFACES * HACKING: Add notes about deprecating interfaces and commands. * lib/linklist.h: Add usage comments. Rename getdata macro to listgetdata. Rename nextnode to listnextnode and fix its odd behaviour to be less dangerous. Make listgetdata macro assert node is not null, NULL list entries should be bug condition. ALL_LIST_ELEMENTS, new macro, forward-referencing macro for use with for loop, Suggested by Jim Carlson of Sun. Add ALL_LIST_ELEMENTS_RO for cases which obviously do not need the "safety" of previous macro. LISTNODE_ADD and DELETE macros renamed to ATTACH, DETACH, to distinguish from the similarly named functions, and reflect their effect better. Add a QUAGGA_NO_DEPRECATED_INTERFACES define guarded section with the old defines which were modified above, for backwards compatibility - guarded to prevent Quagga using it.. * lib/linklist.c: fix up for linklist.h changes. * ospf6d/ospf6_abr.c: (ospf6_abr_examin_brouter) change to a single scan of the area list, rather than scanning all areas first for INTER_ROUTER and then again for INTER_NETWORK. According to 16.2, the scan should be area specific anyway, and further ospf6d does not seem to implement 16.3 anyway.
Diffstat (limited to 'bgpd/bgp_vty.c')
-rw-r--r--bgpd/bgp_vty.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index c4b1ef54..52025b76 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -1996,7 +1996,7 @@ peer_rsclient_set_vty (struct vty *vty, const char *peer_str,
struct bgp *bgp;
struct peer *peer;
struct peer_group *group;
- struct listnode *nn;
+ struct listnode *node, *nnode;
struct bgp_filter *pfilter;
struct bgp_filter *gfilter;
@@ -2032,7 +2032,7 @@ peer_rsclient_set_vty (struct vty *vty, const char *peer_str,
group = peer->group;
gfilter = &peer->filter[afi][safi];
- LIST_LOOP(group->peer, peer, nn)
+ for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer))
{
pfilter = &peer->filter[afi][safi];
@@ -2078,7 +2078,7 @@ peer_rsclient_unset_vty (struct vty *vty, const char *peer_str,
struct bgp *bgp;
struct peer *peer;
struct peer_group *group;
- struct listnode *nn;
+ struct listnode *node, *nnode;
bgp = vty->index;
@@ -2094,7 +2094,7 @@ peer_rsclient_unset_vty (struct vty *vty, const char *peer_str,
{
group = peer->group;
- LIST_LOOP (group->peer, peer, nn)
+ for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer))
{
ret = peer_af_flag_unset (peer, afi, safi, PEER_FLAG_RSERVER_CLIENT);
if (ret < 0)
@@ -3967,12 +3967,12 @@ bgp_clear (struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi,
{
int ret;
struct peer *peer;
- struct listnode *nn;
+ struct listnode *node, *nnode;
/* Clear all neighbors. */
if (sort == clear_all)
{
- LIST_LOOP (bgp->peer, peer, nn)
+ for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer))
{
if (stype == BGP_CLEAR_SOFT_NONE)
ret = peer_clear (peer);
@@ -4028,7 +4028,7 @@ bgp_clear (struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi,
return -1;
}
- LIST_LOOP (group->peer, peer, nn)
+ for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer))
{
if (stype == BGP_CLEAR_SOFT_NONE)
{
@@ -4049,7 +4049,7 @@ bgp_clear (struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi,
if (sort == clear_external)
{
- LIST_LOOP (bgp->peer, peer, nn)
+ for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer))
{
if (peer_sort (peer) == BGP_PEER_IBGP)
continue;
@@ -4081,7 +4081,7 @@ bgp_clear (struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi,
}
as = (as_t) as_ul;
- LIST_LOOP (bgp->peer, peer, nn)
+ for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer))
{
if (peer->as != as)
continue;
@@ -6425,7 +6425,7 @@ int
bgp_show_summary (struct vty *vty, struct bgp *bgp, int afi, int safi)
{
struct peer *peer;
- struct listnode *nn;
+ struct listnode *node, *nnode;
int count = 0;
char timebuf[BGP_UPTIME_LEN];
int len;
@@ -6433,7 +6433,7 @@ bgp_show_summary (struct vty *vty, struct bgp *bgp, int afi, int safi)
/* Header string for each address family. */
static char header[] = "Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd";
- LIST_LOOP (bgp->peer, peer, nn)
+ for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer))
{
if (peer->afc[afi][safi])
{
@@ -7319,11 +7319,11 @@ int
bgp_show_neighbor (struct vty *vty, struct bgp *bgp,
enum show_type type, union sockunion *su)
{
- struct listnode *nn;
+ struct listnode *node, *nnode;
struct peer *peer;
int find = 0;
- LIST_LOOP (bgp->peer, peer, nn)
+ for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer))
{
switch (type)
{
@@ -7667,13 +7667,13 @@ bgp_write_rsclient_summary (struct vty *vty, struct peer *rsclient,
char rmbuf[14];
const char *rmname;
struct peer *peer;
- struct listnode *nn;
+ struct listnode *node, *nnode;
int len;
int count = 0;
if (CHECK_FLAG (rsclient->sflags, PEER_STATUS_GROUP))
{
- LIST_LOOP (rsclient->group->peer, peer, nn)
+ for (ALL_LIST_ELEMENTS (rsclient->group->peer, node, nnode, peer))
{
count++;
bgp_write_rsclient_summary (vty, peer, afi, safi);
@@ -7732,13 +7732,13 @@ bgp_show_rsclient_summary (struct vty *vty, struct bgp *bgp,
afi_t afi, safi_t safi)
{
struct peer *peer;
- struct listnode *nn;
+ struct listnode *node, *nnode;
int count = 0;
/* Header string for each address family. */
static char header[] = "Neighbor V AS Export-Policy Import-Policy Up/Down State";
- LIST_LOOP (bgp->rsclient, peer, nn)
+ for (ALL_LIST_ELEMENTS (bgp->rsclient, node, nnode, peer))
{
if (peer->afc[afi][safi] &&
CHECK_FLAG (peer->af_flags[afi][safi], PEER_FLAG_RSERVER_CLIENT))