{
struct peer *peer;
struct peer_af *paf;
- enum bgp_af_index af;
+ int afidx;
bgp_debug_list_add_entry(bgp_debug_update_out_peers, host, NULL);
peer = bgp_find_peer (vty, host);
if (peer)
{
- PEERAF_FOREACH (peer, paf, af)
+ for (afidx = BGP_AF_START; afidx < BGP_AF_MAX; afidx++)
{
- if (PAF_SUBGRP (paf))
+ paf = peer->peer_af_array[afidx];
+ if (paf != NULL)
{
- UPDGRP_PEER_DBG_EN(PAF_SUBGRP(paf)->update_group);
+ if (PAF_SUBGRP (paf))
+ {
+ UPDGRP_PEER_DBG_EN(PAF_SUBGRP(paf)->update_group);
+ }
}
}
}
struct peer *peer;
struct peer_af *paf;
- enum bgp_af_index af;
+ int afidx;
peer = bgp_find_peer (vty, host);
if (peer)
{
- PEERAF_FOREACH (peer, paf, af)
+ for (afidx = BGP_AF_START; afidx < BGP_AF_MAX; afidx++)
{
- if (PAF_SUBGRP (paf))
+ paf = peer->peer_af_array[afidx];
+ if (paf != NULL)
{
- UPDGRP_PEER_DBG_DIS(PAF_SUBGRP(paf)->update_group);
+ if (PAF_SUBGRP (paf))
+ {
+ UPDGRP_PEER_DBG_DIS(PAF_SUBGRP(paf)->update_group);
+ }
}
}
}
update_group_adjust_peer_afs (struct peer *peer)
{
struct peer_af *paf;
- enum bgp_af_index afi;
+ int afidx;
- PEERAF_FOREACH (peer, paf, afi) update_group_adjust_peer (paf);
+ for (afidx = BGP_AF_START; afidx < BGP_AF_MAX; afidx++)
+ {
+ paf = peer->peer_af_array[afidx];
+ if (paf != NULL)
+ update_group_adjust_peer (paf);
+ }
}
/*
update_group_remove_peer_afs (struct peer *peer)
{
struct peer_af *paf;
- enum bgp_af_index afi;
+ int afidx;
- PEERAF_FOREACH (peer, paf, afi)
- update_subgroup_remove_peer (PAF_SUBGRP (paf), paf);
+ for (afidx = BGP_AF_START; afidx < BGP_AF_MAX; afidx++)
+ {
+ paf = peer->peer_af_array[afidx];
+ if (paf != NULL)
+ update_subgroup_remove_peer (PAF_SUBGRP (paf), paf);
+ }
}
/*
bgp_announce_peer (struct peer *peer)
{
struct peer_af *paf;
- enum bgp_af_index af;
+ int afidx;
- PEERAF_FOREACH (peer, paf, af) subgroup_announce_all (PAF_SUBGRP (paf));
+ for (afidx = BGP_AF_START; afidx < BGP_AF_MAX; afidx++)
+ {
+ paf = peer->peer_af_array[afidx];
+ if (paf != NULL)
+ subgroup_announce_all (PAF_SUBGRP (paf));
+ }
}
/**
struct peer_af *paf;
afi_t afi;
safi_t safi;
- enum bgp_af_index afindex;
+ int afidx;
assert(peer_src);
assert(peer_dst);
peer_dst->allowas_in[afi][safi] = peer_src->allowas_in[afi][safi];
}
- PEERAF_FOREACH(peer_src, paf, afindex)
- peer_af_create(peer_dst, paf->afi, paf->safi);
+ for (afidx = BGP_AF_START; afidx < BGP_AF_MAX; afidx++)
+ {
+ paf = peer_src->peer_af_array[afidx];
+ if (paf != NULL)
+ peer_af_create(peer_dst, paf->afi, paf->safi);
+ }
/* update-source apply */
if (peer_src->update_source)
bgp_size_t length;
};
-#define PEERAF_FOREACH(peer, paf, afi) \
- for ((afi) = BGP_AF_START, (paf) = (peer)->peer_af_array[(afi)]; \
- (afi) < BGP_AF_MAX; \
- (afi)++, (paf) = (peer)->peer_af_array[(afi)]) \
- if ((paf) != NULL) \
-
/* BGP versions. */
#define BGP_VERSION_4 4