Priority: 0
CommentPragmas: '\$(FRR|clippy)'
ContinuationIndentWidth: 8
+ForEachMacros:
+ # lib
+ - LIST_FOREACH
+ - LIST_FOREACH_SAFE
+ - SLIST_FOREACH
+ - SLIST_FOREACH_SAFE
+ - SLIST_FOREACH_PREVPTR
+ - STAILQ_FOREACH
+ - STAILQ_FOREACH_SAFE
+ - TAILQ_FOREACH
+ - TAILQ_FOREACH_SAFE
+ - TAILQ_FOREACH_REVERSE
+ - TAILQ_FOREACH_REVERSE_SAFE
+ - RB_FOREACH
+ - RB_FOREACH_SAFE
+ - RB_FOREACH_REVERSE
+ - RB_FOREACH_REVERSE_SAFE
+ - SPLAY_FOREACH
+ # zebra
+ - RE_DEST_FOREACH_ROUTE
+ - RE_DEST_FOREACH_ROUTE_SAFE
+ - RNODE_FOREACH_RE
+ - RNODE_FOREACH_RE_SAFE
+ # bgpd
+ - UPDGRP_FOREACH_SUBGRP
+ - UPDGRP_FOREACH_SUBGRP_SAFE
+ - SUBGRP_FOREACH_PEER
+ - SUBGRP_FOREACH_PEER_SAFE
+ - SUBGRP_FOREACH_ADJ
+ - SUBGRP_FOREACH_ADJ_SAFE
+ - AF_FOREACH
+ - FOREACH_AFI_SAFI
int addpath_capable;
for (adj = rn->adj_out; adj; adj = adj->next)
- SUBGRP_FOREACH_PEER(adj->subgroup, paf)
- if (paf->peer == peer) {
- afi = SUBGRP_AFI(adj->subgroup);
- safi = SUBGRP_SAFI(adj->subgroup);
- addpath_capable = bgp_addpath_encode_tx(peer, afi, safi);
-
- /* Match on a specific addpath_tx_id if we are using addpath for
- * this
- * peer and if an addpath_tx_id was specified */
- if (addpath_capable && addpath_tx_id
- && adj->addpath_tx_id != addpath_tx_id)
- continue;
-
- return (adj->adv ? (adj->adv->baa ? 1 : 0)
- : (adj->attr ? 1 : 0));
- }
+ SUBGRP_FOREACH_PEER (adj->subgroup, paf)
+ if (paf->peer == peer) {
+ afi = SUBGRP_AFI(adj->subgroup);
+ safi = SUBGRP_SAFI(adj->subgroup);
+ addpath_capable =
+ bgp_addpath_encode_tx(peer, afi, safi);
+
+ /* Match on a specific addpath_tx_id if we are
+ * using addpath for
+ * this
+ * peer and if an addpath_tx_id was specified */
+ if (addpath_capable && addpath_tx_id
+ && adj->addpath_tx_id != addpath_tx_id)
+ continue;
+
+ return (adj->adv ? (adj->adv->baa ? 1 : 0)
+ : (adj->attr ? 1 : 0));
+ }
return 0;
}
buf, bnc->flags, bnc->change_flags);
}
- LIST_FOREACH(path, &(bnc->paths), nh_thread)
- {
+ LIST_FOREACH (path, &(bnc->paths), nh_thread) {
if (!(path->type == ZEBRA_ROUTE_BGP
&& ((path->sub_type == BGP_ROUTE_NORMAL)
|| (path->sub_type == BGP_ROUTE_STATIC))))
* Note: 3rd party nexthop currently implemented for
* IPv4 only.
*/
- SUBGRP_FOREACH_PEER(subgrp, paf)
- {
+ SUBGRP_FOREACH_PEER (subgrp, paf) {
if (bgp_multiaccess_check_v4(riattr->nexthop,
paf->peer))
break;
}
} else {
for (adj = rn->adj_out; adj; adj = adj->next)
- SUBGRP_FOREACH_PEER(adj->subgroup, paf)
- if (paf->peer == peer) {
- if (header1) {
- if (use_json) {
- json_object_int_add(
- json, "bgpTableVersion",
- table->version);
- json_object_string_add(
- json,
- "bgpLocalRouterId",
- inet_ntoa(
- bgp->router_id));
- json_object_object_add(
- json, "bgpStatusCodes",
- json_scode);
- json_object_object_add(
- json, "bgpOriginCodes",
- json_ocode);
- } else {
- vty_out(vty,
- "BGP table version is %" PRIu64
- ", local router ID is %s\n",
- table->version,
- inet_ntoa(
- bgp->router_id));
- vty_out(vty,
- BGP_SHOW_SCODE_HEADER);
- vty_out(vty,
- BGP_SHOW_OCODE_HEADER);
- }
- header1 = 0;
- }
+ SUBGRP_FOREACH_PEER (adj->subgroup, paf)
+ if (paf->peer == peer) {
+ if (header1) {
+ if (use_json) {
+ json_object_int_add(
+ json,
+ "bgpTableVersion",
+ table->version);
+ json_object_string_add(
+ json,
+ "bgpLocalRouterId",
+ inet_ntoa(
+ bgp->router_id));
+ json_object_object_add(
+ json,
+ "bgpStatusCodes",
+ json_scode);
+ json_object_object_add(
+ json,
+ "bgpOriginCodes",
+ json_ocode);
+ } else {
+ vty_out(vty,
+ "BGP table version is %" PRIu64
+ ", local router ID is %s\n",
+ table->version,
+ inet_ntoa(
+ bgp->router_id));
+ vty_out(vty,
+ BGP_SHOW_SCODE_HEADER);
+ vty_out(vty,
+ BGP_SHOW_OCODE_HEADER);
+ }
+ header1 = 0;
+ }
- if (header2) {
- if (!use_json)
- vty_out(vty, BGP_SHOW_HEADER);
- header2 = 0;
- }
+ if (header2) {
+ if (!use_json)
+ vty_out(vty,
+ BGP_SHOW_HEADER);
+ header2 = 0;
+ }
- if (adj->attr) {
- bgp_attr_dup(&attr, adj->attr);
- ret = bgp_output_modifier(
- peer, &rn->p, &attr, afi, safi,
- rmap_name);
- if (ret != RMAP_DENY) {
- route_vty_out_tmp(vty, &rn->p,
- &attr, safi,
- use_json,
- json_ar);
- output_count++;
- } else
- filtered_count++;
- }
- }
+ if (adj->attr) {
+ bgp_attr_dup(&attr,
+ adj->attr);
+ ret = bgp_output_modifier(
+ peer, &rn->p,
+ &attr, afi,
+ safi,
+ rmap_name);
+ if (ret != RMAP_DENY) {
+ route_vty_out_tmp(
+ vty,
+ &rn->p,
+ &attr,
+ safi,
+ use_json,
+ json_ar);
+ output_count++;
+ } else
+ filtered_count++;
+ }
+ }
}
}
if (use_json)
return CMD_SUCCESS;
if (ctx->subgrp_id) {
- UPDGRP_FOREACH_SUBGRP(updgrp, subgrp)
- {
+ UPDGRP_FOREACH_SUBGRP (updgrp, subgrp) {
if (ctx->subgrp_id && (ctx->subgrp_id != subgrp->id))
continue;
else {
? " replace-as"
: "");
- UPDGRP_FOREACH_SUBGRP(updgrp, subgrp)
- {
+ UPDGRP_FOREACH_SUBGRP (updgrp, subgrp) {
if (ctx->subgrp_id && (ctx->subgrp_id != subgrp->id))
continue;
vty_out(vty, "\n");
: "");
if (subgrp->peer_count > 0) {
vty_out(vty, " Peers:\n");
- SUBGRP_FOREACH_PEER(subgrp, paf)
- vty_out(vty, " - %s\n", paf->peer->host);
+ SUBGRP_FOREACH_PEER (subgrp, paf)
+ vty_out(vty, " - %s\n", paf->peer->host);
}
}
return UPDWALK_CONTINUE;
struct vty *vty;
vty = ctx->vty;
- UPDGRP_FOREACH_SUBGRP(updgrp, subgrp)
- {
+ UPDGRP_FOREACH_SUBGRP (updgrp, subgrp) {
if (ctx->subgrp_id && (ctx->subgrp_id != subgrp->id))
continue;
vty_out(vty, "update group %" PRIu64 ", subgroup %" PRIu64 "\n",
if (!peer_established(PAF_PEER(paf)))
return NULL;
- UPDGRP_FOREACH_SUBGRP(updgrp, subgrp)
- {
+ UPDGRP_FOREACH_SUBGRP (updgrp, subgrp) {
if (subgrp->version != version
|| CHECK_FLAG(subgrp->sflags,
SUBGRP_STATUS_DEFAULT_ORIGINATE))
/*
* Look for a subgroup to merge into.
*/
- UPDGRP_FOREACH_SUBGRP(subgrp->update_group, target)
- {
+ UPDGRP_FOREACH_SUBGRP (subgrp->update_group, target) {
if (update_subgroup_can_merge_into(subgrp, target))
break;
}
{
struct bgp_adj_out *aout, *aout_copy;
- SUBGRP_FOREACH_ADJ(source, aout)
- {
+ SUBGRP_FOREACH_ADJ (source, aout) {
/*
* Copy the adj out.
*/
* refresh.
*/
if (ctx->policy_event_start_flag) {
- UPDGRP_FOREACH_SUBGRP(updgrp, subgrp)
- {
+ UPDGRP_FOREACH_SUBGRP (updgrp, subgrp) {
update_subgroup_set_needs_refresh(subgrp, 1);
}
return UPDWALK_CONTINUE;
}
- UPDGRP_FOREACH_SUBGRP(updgrp, subgrp)
- {
+ UPDGRP_FOREACH_SUBGRP (updgrp, subgrp) {
if (changed) {
if (bgp_debug_update(NULL, NULL, updgrp, 0))
zlog_debug(
struct update_subgroup *tmp_subgrp;
const char *reason = arg;
- UPDGRP_FOREACH_SUBGRP_SAFE(updgrp, subgrp, tmp_subgrp)
- update_subgroup_check_merge(subgrp, reason);
+ UPDGRP_FOREACH_SUBGRP_SAFE (updgrp, subgrp, tmp_subgrp)
+ update_subgroup_check_merge(subgrp, reason);
return UPDWALK_CONTINUE;
}
{
int afid;
- AF_FOREACH(afid)
+ AF_FOREACH (afid)
bgp->update_groups[afid] =
hash_create(updgrp_hash_key_make,
updgrp_hash_cmp,
{
int afid;
- AF_FOREACH(afid)
- {
+ AF_FOREACH (afid) {
if (bgp->update_groups[afid]) {
hash_free(bgp->update_groups[afid]);
bgp->update_groups[afid] = NULL;
afi_t afi;
safi_t safi;
- FOREACH_AFI_SAFI(afi, safi)
- {
+ FOREACH_AFI_SAFI (afi, safi) {
update_group_af_walk(bgp, afi, safi, cb, ctx);
}
}
afi_t afi;
safi_t safi;
- UPDGRP_FOREACH_SUBGRP(updgrp, subgrp)
- {
+ UPDGRP_FOREACH_SUBGRP (updgrp, subgrp) {
peer = SUBGRP_PEER(subgrp);
afi = SUBGRP_AFI(subgrp);
safi = SUBGRP_SAFI(subgrp);
*/
all_pending = 1;
- SUBGRP_FOREACH_PEER(subgrp, cur_paf)
- {
+ SUBGRP_FOREACH_PEER (subgrp, cur_paf) {
if (cur_paf == paf)
continue;
*
* First stop refresh timers on all the other peers.
*/
- SUBGRP_FOREACH_PEER(subgrp, cur_paf)
- {
+ SUBGRP_FOREACH_PEER (subgrp, cur_paf) {
if (cur_paf == paf)
continue;
zlog_debug("u%llu:s%llu scheduling write thread for peers",
subgrp->update_group->id, subgrp->id);
#endif
- SUBGRP_FOREACH_PEER(subgrp, paf)
- {
+ SUBGRP_FOREACH_PEER (subgrp, paf) {
if (paf->peer->status == Established) {
BGP_PEER_WRITE_ON(paf->peer->t_write, bgp_write,
paf->peer->fd, paf->peer);
peer = UPDGRP_PEER(updgrp);
addpath_capable = bgp_addpath_encode_tx(peer, afi, safi);
- UPDGRP_FOREACH_SUBGRP(updgrp, subgrp)
- {
+ UPDGRP_FOREACH_SUBGRP (updgrp, subgrp) {
/*
* Skip the subgroups that have coalesce timer running. We will
struct vty *vty;
vty = ctx->vty;
- UPDGRP_FOREACH_SUBGRP(updgrp, subgrp)
- {
+ UPDGRP_FOREACH_SUBGRP (updgrp, subgrp) {
if (ctx->subgrp_id && (ctx->subgrp_id != subgrp->id))
continue;
vty_out(vty, "update group %" PRIu64 ", subgroup %" PRIu64 "\n",
struct peer_af *paf;
struct peer *peer;
- SUBGRP_FOREACH_PEER(subgrp, paf)
- {
+ SUBGRP_FOREACH_PEER (subgrp, paf) {
peer = PAF_PEER(paf);
BGP_TIMER_OFF(peer->t_routeadv);
BGP_TIMER_ON(peer->t_routeadv, bgp_routeadv_timer, 0);
{
struct update_subgroup *subgrp;
- UPDGRP_FOREACH_SUBGRP(updgrp, subgrp)
- {
+ UPDGRP_FOREACH_SUBGRP (updgrp, subgrp) {
subgroup_announce_all(subgrp);
}
/* Only announce if this is a group of route-reflector-clients */
if (CHECK_FLAG(peer->af_flags[afi][safi], PEER_FLAG_REFLECTOR_CLIENT)) {
- UPDGRP_FOREACH_SUBGRP(updgrp, subgrp)
- {
+ UPDGRP_FOREACH_SUBGRP (updgrp, subgrp) {
subgroup_announce_all(subgrp);
}
}
if (BGP_ADV_FIFO_EMPTY(&subgrp->sync->update)) {
struct peer_af *paf;
- SUBGRP_FOREACH_PEER(subgrp, paf)
- {
+ SUBGRP_FOREACH_PEER (subgrp, paf) {
bgp_adjust_routeadv(PAF_PEER(paf));
}
}
{
struct bgp_adj_out *aout, *taout;
- SUBGRP_FOREACH_ADJ_SAFE(subgrp, aout, taout)
- {
+ SUBGRP_FOREACH_ADJ_SAFE (subgrp, aout, taout) {
struct bgp_node *rn = aout->rn;
bgp_adj_out_remove_subgroup(rn, aout, subgrp);
bgp_unlock_node(rn);
vty_out(vty, " Packet %p ver %u buffer %p\n", pkt, pkt->ver,
pkt->buffer);
- LIST_FOREACH(paf, &(pkt->peers), pkt_train)
- {
+ LIST_FOREACH (paf, &(pkt->peers), pkt_train) {
vty_out(vty, " - %s\n", paf->peer->host);
}
pkt = bpacket_next(pkt);
}
}
- FOREACH_AFI_SAFI(afi, safi)
- peer_af_delete(peer, afi, safi);
+ FOREACH_AFI_SAFI (afi, safi)
+ peer_af_delete(peer, afi, safi);
if (peer->hostname) {
XFREE(MTYPE_BGP_PEER_HOST, peer->hostname);
struct listnode *next;
struct bgp *bgp;
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
if (vrf->vrf_id != VRF_DEFAULT)
vector_set(comps, XSTRDUP(MTYPE_COMPLETION, vrf->name));
}
{
struct isis_item_list *n, *nnext;
- RB_FOREACH_SAFE(n, isis_mt_item_list, m, nnext)
- {
+ RB_FOREACH_SAFE (n, isis_mt_item_list, m, nnext) {
free_items(context, type, n);
RB_REMOVE(isis_mt_item_list, m, n);
XFREE(MTYPE_ISIS_MT_ITEM_LIST, n);
{
struct isis_item_list *n;
- RB_FOREACH(n, isis_mt_item_list, m)
- {
+ RB_FOREACH (n, isis_mt_item_list, m) {
format_items_(n->mtid, context, type, n, buf, indent);
}
}
{
struct isis_item_list *n;
- RB_FOREACH(n, isis_mt_item_list, m)
- {
+ RB_FOREACH (n, isis_mt_item_list, m) {
int rv;
rv = pack_items_(n->mtid, context, type, n, s, fragment_tlvs,
RB_INIT(isis_mt_item_list, dest);
- RB_FOREACH(n, isis_mt_item_list, src)
- {
+ RB_FOREACH (n, isis_mt_item_list, src) {
copy_items(context, type, n, isis_get_mt_items(dest, n->mtid));
}
}
struct vrf *vrf;
struct interface *ifp;
- RB_FOREACH(vrf, vrf_id_head, &vrfs_by_id)
- {
+ RB_FOREACH (vrf, vrf_id_head, &vrfs_by_id) {
ifp = if_lookup_by_name(name, vrf->vrf_id);
if (ifp)
return ifp;
return ifp;
/* Didn't find the interface on that vrf. Defined on a different one? */
- RB_FOREACH(vrf, vrf_id_head, &vrfs_by_id)
- {
+ RB_FOREACH (vrf, vrf_id_head, &vrfs_by_id) {
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(vrf->vrf_id), node, ifp)) {
if (!memcmp(name, ifp->name, namelen)
&& (ifp->name[namelen] == '\0')) {
struct listnode *node;
void *p;
- RB_FOREACH(vrf, vrf_id_head, &vrfs_by_id)
- if (vrf->iflist != NULL)
- for (ALL_LIST_ELEMENTS_RO(vrf->iflist, node, p))
- if_dump(p);
+ RB_FOREACH (vrf, vrf_id_head, &vrfs_by_id)
+ if (vrf->iflist != NULL)
+ for (ALL_LIST_ELEMENTS_RO(vrf->iflist, node, p))
+ if_dump(p);
}
DEFUN (interface_desc,
struct listnode *ln;
struct vrf *vrf = NULL;
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
for (ALL_LIST_ELEMENTS_RO(vrf->iflist, ln, ifp))
vector_set(comps, XSTRDUP(MTYPE_COMPLETION, ifp->name));
}
struct ns *ns;
int write = 0;
- RB_FOREACH(ns, ns_head, &ns_tree)
- {
+ RB_FOREACH (ns, ns_head, &ns_tree) {
if (ns->ns_id == NS_DEFAULT || ns->name == NULL)
continue;
{
struct vrf *vrf = NULL;
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
if (vrf->vrf_id != 0)
vector_set(comps, XSTRDUP(MTYPE_COMPLETION, vrf->name));
}
if (wq->cycles.granularity == 0)
wq->cycles.granularity = WORK_QUEUE_MIN_GRANULARITY;
- STAILQ_FOREACH_SAFE(item, &wq->items, wq, titem) {
+ STAILQ_FOREACH_SAFE (item, &wq->items, wq, titem) {
assert(item && item->data);
/* dont run items which are past their allowed retries */
/* Send the client registration */
bfd_client_sendmsg(zclient, ZEBRA_BFD_CLIENT_REGISTER);
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name) {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(vrf->vrf_id), node, ifp)) {
pim_ifp = ifp->info;
if (!pim_ifp)
continue;
- RB_FOREACH(ch, pim_ifchannel_rb, &pim_ifp->ifchannel_rb) {
+ RB_FOREACH (ch, pim_ifchannel_rb, &pim_ifp->ifchannel_rb) {
pim_show_assert_helper(vty, pim_ifp, ch, now);
} /* scan interface channels */
}
if (!pim_ifp)
continue;
- RB_FOREACH(ch, pim_ifchannel_rb, &pim_ifp->ifchannel_rb) {
+ RB_FOREACH (ch, pim_ifchannel_rb, &pim_ifp->ifchannel_rb) {
pim_show_assert_internal_helper(vty, pim_ifp, ch);
} /* scan interface channels */
}
if (!pim_ifp)
continue;
- RB_FOREACH(ch, pim_ifchannel_rb, &pim_ifp->ifchannel_rb) {
+ RB_FOREACH (ch, pim_ifchannel_rb, &pim_ifp->ifchannel_rb) {
pim_show_assert_metric_helper(vty, pim_ifp, ch);
} /* scan interface channels */
}
if (!pim_ifp)
continue;
- RB_FOREACH(ch, pim_ifchannel_rb, &pim_ifp->ifchannel_rb) {
+ RB_FOREACH (ch, pim_ifchannel_rb, &pim_ifp->ifchannel_rb) {
pim_show_assert_winner_metric_helper(vty, pim_ifp, ch);
} /* scan interface channels */
}
if (!pim_ifp)
continue;
- RB_FOREACH(ch, pim_ifchannel_rb, &pim_ifp->ifchannel_rb) {
+ RB_FOREACH (ch, pim_ifchannel_rb, &pim_ifp->ifchannel_rb) {
pim_show_membership_helper(vty, pim_ifp, ch, json);
} /* scan interface channels */
}
if (!pim_ifp)
continue;
- RB_FOREACH(ch, pim_ifchannel_rb, &pim_ifp->ifchannel_rb) {
- pim_show_join_helper(vty, pim_ifp,
- ch, json, now, uj);
+ RB_FOREACH (ch, pim_ifchannel_rb, &pim_ifp->ifchannel_rb) {
+ pim_show_join_helper(vty, pim_ifp, ch, json, now, uj);
} /* scan interface channels */
}
continue;
- RB_FOREACH(ch, pim_ifchannel_rb, &pim_ifp->ifchannel_rb) {
+ RB_FOREACH (ch, pim_ifchannel_rb, &pim_ifp->ifchannel_rb) {
/* scan all interfaces */
pim_show_join_desired_helper(pim, vty,
pim_ifp, ch,
if (uj)
vty_out(vty, "{ ");
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
if (uj) {
if (!first)
vty_out(vty, ", ");
if (uj)
vty_out(vty, "{ ");
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
if (uj) {
if (!first)
vty_out(vty, ", ");
if (uj)
vty_out(vty, "{ ");
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
if (uj) {
if (!first)
vty_out(vty, ", ");
if (uj)
vty_out(vty, "{ ");
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
if (uj) {
if (!first)
vty_out(vty, ", ");
if (uj)
vty_out(vty, "{ ");
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
if (uj) {
if (!first)
vty_out(vty, ", ");
if (uj)
vty_out(vty, "{ ");
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
if (uj) {
if (!first)
vty_out(vty, ", ");
group = argv[idx + 1]->arg;
}
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
if (uj) {
if (!first)
vty_out(vty, ", ");
if (uj)
vty_out(vty, "{ ");
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
if (uj) {
if (!first)
vty_out(vty, ", ");
if (uj)
vty_out(vty, "{ ");
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
if (uj) {
if (!first)
vty_out(vty, ", ");
if (uj)
vty_out(vty, "{ ");
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
if (uj) {
if (!first)
vty_out(vty, ", ");
if (uj)
vty_out(vty, "{ ");
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
if (uj) {
if (!first)
vty_out(vty, ", ");
if (uj)
vty_out(vty, "{ ");
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
if (uj) {
if (!first)
vty_out(vty, ", ");
if (uj)
vty_out(vty, "{ ");
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
if (uj) {
if (!first)
vty_out(vty, ", ");
if (uj)
vty_out(vty, "{ ");
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
if (uj) {
if (!first)
vty_out(vty, ", ");
if (uj)
vty_out(vty, "{ ");
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
if (uj) {
if (!first)
vty_out(vty, ", ");
if (uj)
vty_out(vty, "{ ");
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
if (uj) {
if (!first)
vty_out(vty, ", ");
if (uj)
vty_out(vty, "{ ");
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name) {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
if (uj) {
if (!first)
vty_out(vty, ", ");
pim_ifp = ifp->info;
zassert(pim_ifp);
- RB_FOREACH(ch, pim_ifchannel_rb, &pim_ifp->ifchannel_rb) {
+ RB_FOREACH (ch, pim_ifchannel_rb, &pim_ifp->ifchannel_rb) {
pim_ifchannel_update_could_assert(ch);
}
}
pim_ifp = ifp->info;
zassert(pim_ifp);
- RB_FOREACH(ch, pim_ifchannel_rb, &pim_ifp->ifchannel_rb) {
+ RB_FOREACH (ch, pim_ifchannel_rb, &pim_ifp->ifchannel_rb) {
pim_ifchannel_update_my_assert_metric(ch);
}
}
pim_ifp = ifp->info;
zassert(pim_ifp);
- RB_FOREACH(ch, pim_ifchannel_rb, &pim_ifp->ifchannel_rb) {
+ RB_FOREACH (ch, pim_ifchannel_rb, &pim_ifp->ifchannel_rb) {
/* Is (S,G,I) assert loser ? */
if (ch->ifassert_state != PIM_IFASSERT_I_AM_LOSER)
continue;
struct pim_ifchannel *ch;
/* clear off flag from interface's upstreams */
- RB_FOREACH(ch, pim_ifchannel_rb, &pim_ifp->ifchannel_rb) {
+ RB_FOREACH (ch, pim_ifchannel_rb, &pim_ifp->ifchannel_rb) {
PIM_UPSTREAM_FLAG_UNSET_DR_JOIN_DESIRED_UPDATED(
ch->upstream->flags);
}
/* scan per-interface (S,G,I) state on this I interface */
- RB_FOREACH(ch, pim_ifchannel_rb, &pim_ifp->ifchannel_rb) {
+ RB_FOREACH (ch, pim_ifchannel_rb, &pim_ifp->ifchannel_rb) {
struct pim_upstream *up = ch->upstream;
if (PIM_UPSTREAM_FLAG_TEST_DR_JOIN_DESIRED_UPDATED(up->flags))
if (!pim_ifp)
return;
- RB_FOREACH(ch, pim_ifchannel_rb, &pim_ifp->ifchannel_rb) {
+ RB_FOREACH (ch, pim_ifchannel_rb, &pim_ifp->ifchannel_rb) {
pim_ifchannel_update_assert_tracking_desired(ch);
}
}
{
struct vrf *vrf;
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
if (strncmp(ifp->name, vrf->name, strlen(ifp->name)) == 0)
return 1;
}
struct pim_ifchannel *ch;
int count = 0;
- RB_FOREACH(ch, pim_ifchannel_rb, &pim_ifp->ifchannel_rb) {
+ RB_FOREACH (ch, pim_ifchannel_rb, &pim_ifp->ifchannel_rb) {
count++;
}
&& (ch->sg.grp.s_addr == INADDR_ANY))
return;
- RB_FOREACH(child, pim_ifchannel_rb, &pim_ifp->ifchannel_rb) {
+ RB_FOREACH (child, pim_ifchannel_rb, &pim_ifp->ifchannel_rb) {
if ((ch->sg.grp.s_addr != INADDR_ANY)
&& (child->sg.grp.s_addr == ch->sg.grp.s_addr)
&& (child != ch)) {
pim_ifp = ifp->info;
zassert(pim_ifp);
- RB_FOREACH(ch, pim_ifchannel_rb, &pim_ifp->ifchannel_rb)
+ RB_FOREACH (ch, pim_ifchannel_rb, &pim_ifp->ifchannel_rb)
ifmembership_set(ch, PIM_IFMEMBERSHIP_NOINFO);
}
pim_ifp = ifp->info;
zassert(pim_ifp);
- RB_FOREACH_SAFE(ch, pim_ifchannel_rb, &pim_ifp->ifchannel_rb, ch_tmp)
+ RB_FOREACH_SAFE (ch, pim_ifchannel_rb, &pim_ifp->ifchannel_rb, ch_tmp)
delete_on_noinfo(ch);
}
if (new_pim_ifp == loop_pim_ifp)
continue;
- RB_FOREACH(ch, pim_ifchannel_rb, &loop_pim_ifp->ifchannel_rb) {
+ RB_FOREACH (ch, pim_ifchannel_rb, &loop_pim_ifp->ifchannel_rb) {
if (ch->ifjoin_state == PIM_IFJOIN_JOIN) {
struct pim_upstream *up = ch->upstream;
if ((!up->channel_oil)
struct vrf *vrf;
struct pim_instance *pim;
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
pim = vrf->info;
if (!pim)
struct vrf *vrf;
int writes = 0;
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
pim = vrf->info;
if (!pim)
continue;
*/
if (sscanf(ifp->name, "pimreg%d", &table_id) == 1) {
struct vrf *vrf;
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
if ((table_id == vrf->data.l.table_id)
&& (ifp->vrf_id != vrf->vrf_id)) {
struct interface *master = if_lookup_by_name(
struct vrf *vrf;
struct pim_instance *pim;
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
pim = vrf->info;
if (!pim)
continue;
} /* for (qpim_upstream_list) */
}
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
pim = vrf->info;
if (!pim)
continue;
qpim_scan_oil_last = pim_time_monotonic_sec();
++qpim_scan_oil_events;
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
pim = vrf->info;
if (!pim)
continue;
struct vrf *vrf;
struct pim_instance *pim;
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
pim = vrf->info;
if (!pim)
continue;
struct pim_instance *pim;
struct vrf *vrf;
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
pim = vrf->info;
if (!pim)
continue;
struct namespace *namespace;
int fd;
- LIST_FOREACH(namespace, &namespace_head, list)
- {
+ LIST_FOREACH (namespace, &namespace_head, list) {
if ((fd = open(namespace->path, O_RDONLY)) == -1)
fatal("open namespace %s: %s", namespace->path,
strerror(errno));
interface_update_stats();
/* All interface print. */
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- for (ALL_LIST_ELEMENTS_RO(vrf->iflist, node, ifp))
- if_dump_vty(vty, ifp);
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name)
+ for (ALL_LIST_ELEMENTS_RO(vrf->iflist, node, ifp))
+ if_dump_vty(vty, ifp);
return CMD_SUCCESS;
}
interface_update_stats();
/* All interface print. */
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
/* Specified interface print. */
ifp = if_lookup_by_name(argv[idx_ifname]->arg, vrf->vrf_id);
if (ifp) {
{
struct vrf *vrf;
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- if (!list_isempty(vrf->iflist)) {
- vty_out(vty, "\n\tVRF %u\n\n", vrf->vrf_id);
- if_show_description(vty, vrf->vrf_id);
- }
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name)
+ if (!list_isempty(vrf->iflist)) {
+ vty_out(vty, "\n\tVRF %u\n\n", vrf->vrf_id);
+ if_show_description(vty, vrf->vrf_id);
+ }
return CMD_SUCCESS;
}
zebra_ptm_write(vty);
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- for (ALL_LIST_ELEMENTS_RO(vrf->iflist, node, ifp)) {
- struct zebra_if *if_data;
- struct listnode *addrnode;
- struct connected *ifc;
- struct prefix *p;
- struct vrf *vrf;
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name)
+ for (ALL_LIST_ELEMENTS_RO(vrf->iflist, node, ifp)) {
+ struct zebra_if *if_data;
+ struct listnode *addrnode;
+ struct connected *ifc;
+ struct prefix *p;
+ struct vrf *vrf;
- if_data = ifp->info;
- vrf = vrf_lookup_by_id(ifp->vrf_id);
+ if_data = ifp->info;
+ vrf = vrf_lookup_by_id(ifp->vrf_id);
- if (ifp->vrf_id == VRF_DEFAULT)
- vty_frame(vty, "interface %s\n", ifp->name);
- else
- vty_frame(vty, "interface %s vrf %s\n", ifp->name,
- vrf->name);
+ if (ifp->vrf_id == VRF_DEFAULT)
+ vty_frame(vty, "interface %s\n", ifp->name);
+ else
+ vty_frame(vty, "interface %s vrf %s\n",
+ ifp->name, vrf->name);
- if (if_data) {
- if (if_data->shutdown == IF_ZEBRA_SHUTDOWN_ON)
- vty_out(vty, " shutdown\n");
+ if (if_data) {
+ if (if_data->shutdown == IF_ZEBRA_SHUTDOWN_ON)
+ vty_out(vty, " shutdown\n");
- zebra_ptm_if_write(vty, if_data);
- }
+ zebra_ptm_if_write(vty, if_data);
+ }
- if (ifp->desc)
- vty_out(vty, " description %s\n", ifp->desc);
-
- /* Assign bandwidth here to avoid unnecessary interface flap
- while processing config script */
- if (ifp->bandwidth != 0)
- vty_out(vty, " bandwidth %u\n", ifp->bandwidth);
-
- if (!CHECK_FLAG(ifp->status, ZEBRA_INTERFACE_LINKDETECTION))
- vty_out(vty, " no link-detect\n");
-
- for (ALL_LIST_ELEMENTS_RO(ifp->connected, addrnode, ifc)) {
- if (CHECK_FLAG(ifc->conf, ZEBRA_IFC_CONFIGURED)) {
- char buf[INET6_ADDRSTRLEN];
- p = ifc->address;
- vty_out(vty, " ip%s address %s",
- p->family == AF_INET ? "" : "v6",
- inet_ntop(p->family, &p->u.prefix, buf,
- sizeof(buf)));
- if (CONNECTED_PEER(ifc)) {
- p = ifc->destination;
- vty_out(vty, " peer %s",
+ if (ifp->desc)
+ vty_out(vty, " description %s\n", ifp->desc);
+
+ /* Assign bandwidth here to avoid unnecessary interface
+ flap
+ while processing config script */
+ if (ifp->bandwidth != 0)
+ vty_out(vty, " bandwidth %u\n", ifp->bandwidth);
+
+ if (!CHECK_FLAG(ifp->status,
+ ZEBRA_INTERFACE_LINKDETECTION))
+ vty_out(vty, " no link-detect\n");
+
+ for (ALL_LIST_ELEMENTS_RO(ifp->connected, addrnode,
+ ifc)) {
+ if (CHECK_FLAG(ifc->conf,
+ ZEBRA_IFC_CONFIGURED)) {
+ char buf[INET6_ADDRSTRLEN];
+ p = ifc->address;
+ vty_out(vty, " ip%s address %s",
+ p->family == AF_INET ? ""
+ : "v6",
inet_ntop(p->family,
&p->u.prefix, buf,
sizeof(buf)));
- }
- vty_out(vty, "/%d", p->prefixlen);
+ if (CONNECTED_PEER(ifc)) {
+ p = ifc->destination;
+ vty_out(vty, " peer %s",
+ inet_ntop(p->family,
+ &p->u.prefix,
+ buf,
+ sizeof(buf)));
+ }
+ vty_out(vty, "/%d", p->prefixlen);
- if (ifc->label)
- vty_out(vty, " label %s", ifc->label);
+ if (ifc->label)
+ vty_out(vty, " label %s",
+ ifc->label);
- vty_out(vty, "\n");
+ vty_out(vty, "\n");
+ }
}
- }
- if (if_data) {
- if (if_data->multicast != IF_ZEBRA_MULTICAST_UNSPEC)
- vty_out(vty, " %smulticast\n",
- if_data->multicast
- == IF_ZEBRA_MULTICAST_ON
- ? ""
- : "no ");
- }
+ if (if_data) {
+ if (if_data->multicast
+ != IF_ZEBRA_MULTICAST_UNSPEC)
+ vty_out(vty, " %smulticast\n",
+ if_data->multicast
+ == IF_ZEBRA_MULTICAST_ON
+ ? ""
+ : "no ");
+ }
- hook_call(zebra_if_config_wr, vty, ifp);
+ hook_call(zebra_if_config_wr, vty, ifp);
- link_params_config_write(vty, ifp);
+ link_params_config_write(vty, ifp);
- vty_endframe(vty, "!\n");
- }
+ vty_endframe(vty, "!\n");
+ }
return 0;
}
zlog_info("IRDP: Received shutdown notification.");
- RB_FOREACH(vrf, vrf_id_head, &vrfs_by_id)
- for (ALL_LIST_ELEMENTS(vrf->iflist, node, nnode, ifp)) {
- zi = ifp->info;
-
- if (!zi)
- continue;
- irdp = zi->irdp;
- if (!irdp)
- continue;
-
- if (irdp->flags & IF_ACTIVE) {
- irdp->flags |= IF_SHUTDOWN;
- irdp_advert_off(ifp);
+ RB_FOREACH (vrf, vrf_id_head, &vrfs_by_id)
+ for (ALL_LIST_ELEMENTS(vrf->iflist, node, nnode, ifp)) {
+ zi = ifp->info;
+
+ if (!zi)
+ continue;
+ irdp = zi->irdp;
+ if (!irdp)
+ continue;
+
+ if (irdp->flags & IF_ACTIVE) {
+ irdp->flags |= IF_SHUTDOWN;
+ irdp_advert_off(ifp);
+ }
}
- }
return 0;
}
list_delete_all_node(zebrad.client_list);
if (retain_mode)
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
zvrf = vrf->info;
if (zvrf)
SET_FLAG(zvrf->flags, ZEBRA_VRF_RETAIN);
if (!rn)
continue;
- RNODE_FOREACH_RE(rn, newre) {
+ RNODE_FOREACH_RE (rn, newre) {
if (CHECK_FLAG(newre->flags, ZEBRA_FLAG_SELECTED)
&& newre->distance != DISTANCE_INFINITY)
zsend_redistribute_route(
- ZEBRA_REDISTRIBUTE_ROUTE_ADD,
- client, &rn->p, NULL, newre);
+ ZEBRA_REDISTRIBUTE_ROUTE_ADD, client,
+ &rn->p, NULL, newre);
}
route_unlock_node(rn);
return;
for (rn = route_top(table); rn; rn = srcdest_route_next(rn))
- RNODE_FOREACH_RE(rn, newre)
- {
+ RNODE_FOREACH_RE (rn, newre) {
struct prefix *dst_p, *src_p;
srcdest_rnode_prefixes(rn, &dst_p, &src_p);
prefix_copy(&p, &rn->p);
- RNODE_FOREACH_RE(rn, same)
- {
- if (CHECK_FLAG(same->status,
- ROUTE_ENTRY_REMOVED))
+ RNODE_FOREACH_RE (rn, same) {
+ if (CHECK_FLAG(same->status, ROUTE_ENTRY_REMOVED))
continue;
if (same->type == re->type
if (!rn->info)
continue;
- RNODE_FOREACH_RE(rn, re)
- {
+ RNODE_FOREACH_RE (rn, re) {
if (CHECK_FLAG(re->status, ROUTE_ENTRY_REMOVED))
continue;
break;
if (!rn->info)
continue;
- RNODE_FOREACH_RE(rn, re)
- {
- if (CHECK_FLAG(
- re->status,
- ROUTE_ENTRY_REMOVED))
+ RNODE_FOREACH_RE (rn, re) {
+ if (CHECK_FLAG(re->status,
+ ROUTE_ENTRY_REMOVED))
continue;
break;
}
struct vrf *vrf;
struct zebra_vrf *zvrf;
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- if ((zvrf = vrf->info) != NULL)
- if (zvrf->rid_user_assigned.u.prefix4.s_addr) {
- if (zvrf_id(zvrf) == VRF_DEFAULT)
- vty_out(vty, "router-id %s\n",
- inet_ntoa(zvrf->rid_user_assigned.u
- .prefix4));
- else
- vty_out(vty, "router-id %s vrf %s\n",
- inet_ntoa(zvrf->rid_user_assigned.u
- .prefix4),
- zvrf_name(zvrf));
- }
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name)
+ if ((zvrf = vrf->info) != NULL)
+ if (zvrf->rid_user_assigned.u.prefix4.s_addr) {
+ if (zvrf_id(zvrf) == VRF_DEFAULT)
+ vty_out(vty, "router-id %s\n",
+ inet_ntoa(
+ zvrf->rid_user_assigned
+ .u.prefix4));
+ else
+ vty_out(vty, "router-id %s vrf %s\n",
+ inet_ntoa(
+ zvrf->rid_user_assigned
+ .u.prefix4),
+ zvrf_name(zvrf));
+ }
}
DEFUN (router_id,
struct vrf *vrf;
struct zebra_vrf *zvrf;
- RB_FOREACH(vrf, vrf_id_head, &vrfs_by_id)
- {
+ RB_FOREACH (vrf, vrf_id_head, &vrfs_by_id) {
if ((zvrf = vrf->info) == NULL || (zvrf->table_id != table_id))
continue;
rtadv_event(zns, RTADV_TIMER_MSEC, 10 /* 10 ms */);
}
- RB_FOREACH(vrf, vrf_id_head, &vrfs_by_id)
- for (ALL_LIST_ELEMENTS(vrf->iflist, node, nnode, ifp)) {
- if (if_is_loopback(ifp)
- || CHECK_FLAG(ifp->status, ZEBRA_INTERFACE_VRF_LOOPBACK)
- || !if_is_operative(ifp))
- continue;
+ RB_FOREACH (vrf, vrf_id_head, &vrfs_by_id)
+ for (ALL_LIST_ELEMENTS(vrf->iflist, node, nnode, ifp)) {
+ if (if_is_loopback(ifp)
+ || CHECK_FLAG(ifp->status,
+ ZEBRA_INTERFACE_VRF_LOOPBACK)
+ || !if_is_operative(ifp))
+ continue;
+
+ zif = ifp->info;
+
+ if (zif->rtadv.AdvSendAdvertisements) {
+ if (zif->rtadv.inFastRexmit) {
+ /* We assume we fast rexmit every sec so
+ * no
+ * additional vars */
+ if (--zif->rtadv.NumFastReXmitsRemain
+ <= 0)
+ zif->rtadv.inFastRexmit = 0;
+
+ if (IS_ZEBRA_DEBUG_SEND)
+ zlog_debug(
+ "Fast RA Rexmit on interface %s",
+ ifp->name);
- zif = ifp->info;
-
- if (zif->rtadv.AdvSendAdvertisements) {
- if (zif->rtadv.inFastRexmit) {
- /* We assume we fast rexmit every sec so no
- * additional vars */
- if (--zif->rtadv.NumFastReXmitsRemain <= 0)
- zif->rtadv.inFastRexmit = 0;
-
- if (IS_ZEBRA_DEBUG_SEND)
- zlog_debug(
- "Fast RA Rexmit on interface %s",
- ifp->name);
-
- rtadv_send_packet(zns->rtadv.sock, ifp);
- } else {
- zif->rtadv.AdvIntervalTimer -= period;
- if (zif->rtadv.AdvIntervalTimer <= 0) {
- /* FIXME: using MaxRtrAdvInterval each
- time isn't what section
- 6.2.4 of RFC4861 tells to do. */
- zif->rtadv.AdvIntervalTimer =
- zif->rtadv.MaxRtrAdvInterval;
rtadv_send_packet(zns->rtadv.sock, ifp);
+ } else {
+ zif->rtadv.AdvIntervalTimer -= period;
+ if (zif->rtadv.AdvIntervalTimer <= 0) {
+ /* FIXME: using
+ MaxRtrAdvInterval each
+ time isn't what section
+ 6.2.4 of RFC4861 tells to do.
+ */
+ zif->rtadv.AdvIntervalTimer =
+ zif->rtadv
+ .MaxRtrAdvInterval;
+ rtadv_send_packet(
+ zns->rtadv.sock, ifp);
+ }
}
}
}
- }
return 0;
}
{
struct route_entry *re;
- RE_DEST_FOREACH_ROUTE(dest, re)
- {
+ RE_DEST_FOREACH_ROUTE (dest, re) {
if (!CHECK_FLAG(re->status, ROUTE_ENTRY_SELECTED_FIB))
continue;
struct listnode *node;
struct interface *ifp;
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
for (ALL_LIST_ELEMENTS_RO(vrf->iflist, node, ifp)) {
struct zebra_if *zif;
struct zebra_l2info_brslave *br_slave;
if (!rn)
return 0;
- RNODE_FOREACH_RE(rn, re)
- {
+ RNODE_FOREACH_RE (rn, re) {
if (CHECK_FLAG(re->flags, ZEBRA_FLAG_SELECTED))
break;
}
route_unlock_node(rn);
/* Locate a valid connected route. */
- RNODE_FOREACH_RE(rn, match)
- {
+ RNODE_FOREACH_RE (rn, match) {
if (CHECK_FLAG(match->status, ROUTE_ENTRY_REMOVED)
|| !CHECK_FLAG(match->flags, ZEBRA_FLAG_SELECTED))
continue;
route_unlock_node(rn);
/* Locate a valid connected route. */
- RNODE_FOREACH_RE(rn, match)
- {
+ RNODE_FOREACH_RE (rn, match) {
if ((match->type == ZEBRA_ROUTE_CONNECT)
&& !CHECK_FLAG(match->status, ROUTE_ENTRY_REMOVED)
&& CHECK_FLAG(match->flags, ZEBRA_FLAG_SELECTED))
/* Lookup existing route */
rn = route_node_get(table, prefix);
- RNODE_FOREACH_RE(rn, re)
- {
+ RNODE_FOREACH_RE (rn, re) {
if (CHECK_FLAG(re->status, ROUTE_ENTRY_REMOVED))
continue;
if (re->distance == distance)
for (rn = route_top(table); rn; rn = route_next(rn)) {
update = 0;
- RNODE_FOREACH_RE(rn, re) {
- for (nexthop = re->nexthop;
- nexthop;
+ RNODE_FOREACH_RE (rn, re) {
+ for (nexthop = re->nexthop; nexthop;
nexthop = nexthop->next) {
if (nexthop->nh_label_type != ZEBRA_LSP_LDP)
continue;
ptm_cb.ptm_enable = ZEBRA_IF_PTM_ENABLE_ON;
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- for (ALL_LIST_ELEMENTS_RO(vrf->iflist, i, ifp))
- if (!ifp->ptm_enable) {
- if_data = (struct zebra_if *)ifp->info;
- if (if_data && (if_data->ptm_enable
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name)
+ for (ALL_LIST_ELEMENTS_RO(vrf->iflist, i, ifp))
+ if (!ifp->ptm_enable) {
+ if_data = (struct zebra_if *)ifp->info;
+ if (if_data
+ && (if_data->ptm_enable
== ZEBRA_IF_PTM_ENABLE_UNSPEC)) {
- ifp->ptm_enable = ZEBRA_IF_PTM_ENABLE_ON;
+ ifp->ptm_enable =
+ ZEBRA_IF_PTM_ENABLE_ON;
+ }
+ /* Assign a default unknown status */
+ ifp->ptm_status = ZEBRA_PTM_STATUS_UNKNOWN;
}
- /* Assign a default unknown status */
- ifp->ptm_status = ZEBRA_PTM_STATUS_UNKNOWN;
- }
zebra_ptm_connect(NULL);
struct interface *ifp;
int send_linkup;
- RB_FOREACH(vrf, vrf_id_head, &vrfs_by_id)
- for (ALL_LIST_ELEMENTS_RO(vrf->iflist, i, ifp)) {
- send_linkup = 0;
- if (ifp->ptm_enable) {
- if (!if_is_operative(ifp))
- send_linkup = 1;
-
- if (ptm_disable)
- ifp->ptm_enable = ZEBRA_IF_PTM_ENABLE_OFF;
- ifp->ptm_status = ZEBRA_PTM_STATUS_UNKNOWN;
-
- if (if_is_operative(ifp) && send_linkup) {
- if (IS_ZEBRA_DEBUG_EVENT)
- zlog_debug(
- "%s: Bringing up interface %s",
- __func__, ifp->name);
- if_up(ifp);
+ RB_FOREACH (vrf, vrf_id_head, &vrfs_by_id)
+ for (ALL_LIST_ELEMENTS_RO(vrf->iflist, i, ifp)) {
+ send_linkup = 0;
+ if (ifp->ptm_enable) {
+ if (!if_is_operative(ifp))
+ send_linkup = 1;
+
+ if (ptm_disable)
+ ifp->ptm_enable =
+ ZEBRA_IF_PTM_ENABLE_OFF;
+ ifp->ptm_status = ZEBRA_PTM_STATUS_UNKNOWN;
+
+ if (if_is_operative(ifp) && send_linkup) {
+ if (IS_ZEBRA_DEBUG_EVENT)
+ zlog_debug(
+ "%s: Bringing up interface %s",
+ __func__, ifp->name);
+ if_up(ifp);
+ }
}
}
- }
}
void zebra_ptm_if_init(struct zebra_if *zebra_ifp)
struct zebra_vrf *zvrf;
struct zebra_pw *pw, *tmp;
- RB_FOREACH(vrf, vrf_id_head, &vrfs_by_id)
- {
+ RB_FOREACH (vrf, vrf_id_head, &vrfs_by_id) {
zvrf = vrf->info;
- RB_FOREACH_SAFE(pw, zebra_pw_head, &zvrf->pseudowires, tmp)
- {
+ RB_FOREACH_SAFE (pw, zebra_pw_head, &zvrf->pseudowires, tmp) {
if (pw->client != client)
continue;
zebra_pw_del(zvrf, pw);
vty_out(vty, "%-16s %-24s %-12s %-8s %-10s\n", "Interface", "Neighbor",
"Labels", "Protocol", "Status");
- RB_FOREACH(pw, zebra_pw_head, &zvrf->pseudowires)
- {
+ RB_FOREACH (pw, zebra_pw_head, &zvrf->pseudowires) {
char buf_nbr[INET6_ADDRSTRLEN];
char buf_labels[64];
if (!zvrf)
return 0;
- RB_FOREACH(pw, zebra_static_pw_head, &zvrf->static_pseudowires)
- {
+ RB_FOREACH (pw, zebra_static_pw_head, &zvrf->static_pseudowires) {
vty_out(vty, "pseudowire %s\n", pw->ifname);
if (pw->local_label != MPLS_NO_LABEL
&& pw->remote_label != MPLS_NO_LABEL)
&& !nh_resolve_via_default(p.family))
return 0;
- RNODE_FOREACH_RE(rn, match)
- {
+ RNODE_FOREACH_RE (rn, match) {
if (CHECK_FLAG(match->status, ROUTE_ENTRY_REMOVED))
continue;
route_unlock_node(rn);
/* Pick up selected route. */
- RNODE_FOREACH_RE(rn, match)
- {
+ RNODE_FOREACH_RE (rn, match) {
if (CHECK_FLAG(match->status, ROUTE_ENTRY_REMOVED))
continue;
if (CHECK_FLAG(match->status, ROUTE_ENTRY_SELECTED_FIB))
/* Unlock node. */
route_unlock_node(rn);
- RNODE_FOREACH_RE(rn, match)
- {
+ RNODE_FOREACH_RE (rn, match) {
if (CHECK_FLAG(match->status, ROUTE_ENTRY_REMOVED))
continue;
if (CHECK_FLAG(match->status, ROUTE_ENTRY_SELECTED_FIB))
/* Find out if a "selected" RR for the discovered RIB entry exists ever.
*/
- RNODE_FOREACH_RE(rn, match)
- {
+ RNODE_FOREACH_RE (rn, match) {
if (CHECK_FLAG(match->status, ROUTE_ENTRY_REMOVED))
continue;
if (CHECK_FLAG(match->status, ROUTE_ENTRY_SELECTED_FIB))
if (IS_ZEBRA_DEBUG_RIB_DETAILED)
zlog_debug("%u:%s: Processing rn %p", vrf_id, buf, rn);
- RNODE_FOREACH_RE_SAFE(rn, re, next)
- {
+ RNODE_FOREACH_RE_SAFE (rn, re, next) {
if (IS_ZEBRA_DEBUG_RIB_DETAILED)
zlog_debug(
"%u:%s: Examine re %p (type %d) status %x flags %x "
}
/* Remove all RE entries queued for removal */
- RNODE_FOREACH_RE_SAFE(rn, re, next)
- {
+ RNODE_FOREACH_RE_SAFE (rn, re, next) {
if (CHECK_FLAG(re->status, ROUTE_ENTRY_REMOVED)) {
if (IS_ZEBRA_DEBUG_RIB) {
rnode_debug(rn, vrf_id, "rn %p, removing re %p",
* should limit the evaluation to the necessary VRFs in most common
* situations.
*/
- RB_FOREACH(vrf, vrf_id_head, &vrfs_by_id)
- {
+ RB_FOREACH (vrf, vrf_id_head, &vrfs_by_id) {
zvrf = vrf->info;
if (zvrf == NULL || !(zvrf->flags & ZEBRA_VRF_RIB_SCHEDULED))
continue;
{
struct route_entry *re;
- RNODE_FOREACH_RE(rn, re)
- {
+ RNODE_FOREACH_RE (rn, re) {
u_char qindex = meta_queue_map[re->type];
struct zebra_vrf *zvrf;
route_unlock_node(rn);
/* let's go */
- RNODE_FOREACH_RE(rn, re)
- {
+ RNODE_FOREACH_RE (rn, re) {
zlog_debug("%s: rn %p, re %p: %s, %s", __func__, (void *)rn,
(void *)re,
(CHECK_FLAG(re->status, ROUTE_ENTRY_REMOVED)
* revalidation
* of the rest of the RE.
*/
- RNODE_FOREACH_RE(rn, re)
- {
+ RNODE_FOREACH_RE (rn, re) {
if (CHECK_FLAG(re->status, ROUTE_ENTRY_SELECTED_FIB)
&& !RIB_SYSTEM_ROUTE(re)) {
changed = 1;
/* If same type of route are installed, treat it as a implicit
withdraw. */
- RNODE_FOREACH_RE(rn, same)
- {
+ RNODE_FOREACH_RE (rn, same) {
if (CHECK_FLAG(same->status, ROUTE_ENTRY_REMOVED))
continue;
}
/* Lookup same type route. */
- RNODE_FOREACH_RE(rn, re)
- {
+ RNODE_FOREACH_RE (rn, re) {
if (CHECK_FLAG(re->status, ROUTE_ENTRY_REMOVED))
continue;
/* If same type of route are installed, treat it as a implicit
withdraw. */
- RNODE_FOREACH_RE(rn, re)
- {
+ RNODE_FOREACH_RE (rn, re) {
if (CHECK_FLAG(re->status, ROUTE_ENTRY_REMOVED))
continue;
* always
* get queued for processing.
*/
- RNODE_FOREACH_RE_SAFE(rn, re, next)
- {
+ RNODE_FOREACH_RE_SAFE (rn, re, next) {
struct nexthop *nh;
if (re->type != ZEBRA_ROUTE_SYSTEM &&
if (table)
for (rn = route_top(table); rn; rn = srcdest_route_next(rn))
- RNODE_FOREACH_RE_SAFE(rn, re, next)
- {
+ RNODE_FOREACH_RE_SAFE (rn, re, next) {
if (CHECK_FLAG(re->status, ROUTE_ENTRY_REMOVED))
continue;
struct vrf *vrf;
struct zebra_vrf *zvrf;
- RB_FOREACH(vrf, vrf_id_head, &vrfs_by_id)
- if ((zvrf = vrf->info) != NULL) {
- rib_weed_table(zvrf->table[AFI_IP][SAFI_UNICAST]);
- rib_weed_table(zvrf->table[AFI_IP6][SAFI_UNICAST]);
- }
+ RB_FOREACH (vrf, vrf_id_head, &vrfs_by_id)
+ if ((zvrf = vrf->info) != NULL) {
+ rib_weed_table(zvrf->table[AFI_IP][SAFI_UNICAST]);
+ rib_weed_table(zvrf->table[AFI_IP6][SAFI_UNICAST]);
+ }
}
/* Delete self installed routes after zebra is relaunched. */
return;
for (rn = route_top(table); rn; rn = srcdest_route_next(rn)) {
- RNODE_FOREACH_RE_SAFE(rn, re, next)
- {
+ RNODE_FOREACH_RE_SAFE (rn, re, next) {
if (IS_ZEBRA_DEBUG_RIB)
route_entry_dump(&rn->p, NULL, re);
struct vrf *vrf;
struct zebra_vrf *zvrf;
- RB_FOREACH(vrf, vrf_id_head, &vrfs_by_id) {
+ RB_FOREACH (vrf, vrf_id_head, &vrfs_by_id) {
if ((zvrf = vrf->info) == NULL)
continue;
if (table)
for (rn = route_top(table); rn; rn = srcdest_route_next(rn))
- RNODE_FOREACH_RE_SAFE(rn, re, next)
- {
+ RNODE_FOREACH_RE_SAFE (rn, re, next) {
if (CHECK_FLAG(re->status, ROUTE_ENTRY_REMOVED))
continue;
if (re->type == proto
struct zebra_vrf *zvrf;
unsigned long cnt = 0;
- RB_FOREACH(vrf, vrf_id_head, &vrfs_by_id)
- if ((zvrf = vrf->info) != NULL)
- cnt += rib_score_proto_table(proto, instance,
- zvrf->table[AFI_IP][SAFI_UNICAST])
- + rib_score_proto_table(
- proto, instance,
- zvrf->table[AFI_IP6][SAFI_UNICAST]);
+ RB_FOREACH (vrf, vrf_id_head, &vrfs_by_id)
+ if ((zvrf = vrf->info) != NULL)
+ cnt += rib_score_proto_table(
+ proto, instance,
+ zvrf->table[AFI_IP][SAFI_UNICAST])
+ + rib_score_proto_table(
+ proto, instance,
+ zvrf->table[AFI_IP6][SAFI_UNICAST]);
return cnt;
}
info = table->info;
for (rn = route_top(table); rn; rn = srcdest_route_next(rn))
- RNODE_FOREACH_RE(rn, re)
- {
- if (!CHECK_FLAG(re->status,
- ROUTE_ENTRY_SELECTED_FIB))
+ RNODE_FOREACH_RE (rn, re) {
+ if (!CHECK_FLAG(re->status, ROUTE_ENTRY_SELECTED_FIB))
continue;
if (info->safi == SAFI_UNICAST)
re = NULL;
else {
/* Identify appropriate route entry. */
- RNODE_FOREACH_RE(rn, re)
- {
+ RNODE_FOREACH_RE (rn, re) {
if (CHECK_FLAG(re->status, ROUTE_ENTRY_REMOVED))
continue;
if (!CHECK_FLAG(re->status, ROUTE_ENTRY_SELECTED_FIB))
/* Evaluate each static route associated with this nexthop. */
for (ALL_LIST_ELEMENTS_RO(rnh->zebra_static_route_list, node,
static_rn)) {
- RNODE_FOREACH_RE(static_rn, sre)
- {
+ RNODE_FOREACH_RE (static_rn, sre) {
if (sre->type != ZEBRA_ROUTE_STATIC)
continue;
return CMD_WARNING_CONFIG_FAILED;
}
- RB_FOREACH(vrf, vrf_id_head, &vrfs_by_id)
- {
+ RB_FOREACH (vrf, vrf_id_head, &vrfs_by_id) {
if (family == AF_INET)
pif = if_lookup_exact_address((void *)&src.ipv4,
AF_INET, vrf->vrf_id);
/* Return number of routing entries. */
result = 0;
for (rn = route_top(table); rn; rn = route_next(rn))
- RNODE_FOREACH_RE(rn, re) {
+ RNODE_FOREACH_RE (rn, re) {
result++;
}
/* Return number of routing entries. */
result = 0;
for (rn = route_top(table); rn; rn = route_next(rn))
- RNODE_FOREACH_RE(rn, re) {
+ RNODE_FOREACH_RE (rn, re) {
result++;
}
return;
for (*np = route_top(table); *np; *np = route_next(*np)) {
if (!in_addr_cmp(&(*np)->p.u.prefix, (u_char *)&dest)) {
- RNODE_FOREACH_RE(*np, *re)
- {
+ RNODE_FOREACH_RE (*np, *re) {
if (!in_addr_cmp((u_char *)&(*re)
->nexthop->gate
.ipv4,
/* Check destination first */
if (in_addr_cmp(&np2->p.u.prefix, (u_char *)&dest) > 0)
- RNODE_FOREACH_RE(np2, re2) {
+ RNODE_FOREACH_RE (np2, re2) {
check_replace(np2, re2, np, re);
}
if (in_addr_cmp(&np2->p.u.prefix, (u_char *)&dest)
== 0) { /* have to look at each re individually */
- RNODE_FOREACH_RE(np2, re2)
- {
+ RNODE_FOREACH_RE (np2, re2) {
int proto2, policy2;
proto2 = proto_trans(re2->type);
/* Lookup existing route */
rn = srcdest_rnode_get(table, p, src_p);
- RNODE_FOREACH_RE(rn, re)
- {
+ RNODE_FOREACH_RE (rn, re) {
if (CHECK_FLAG(re->status, ROUTE_ENTRY_REMOVED))
continue;
if (!rn)
return;
- RNODE_FOREACH_RE(rn, re)
- {
+ RNODE_FOREACH_RE (rn, re) {
if (CHECK_FLAG(re->status, ROUTE_ENTRY_REMOVED))
continue;
{
struct vrf *vrf;
- RB_FOREACH(vrf, vrf_id_head, &vrfs_by_id)
- {
+ RB_FOREACH (vrf, vrf_id_head, &vrfs_by_id) {
if (vrf->vrf_id)
zsend_vrf_add(client, vrf_info_lookup(vrf->vrf_id));
}
{
struct route_entry *re, *next;
- RNODE_FOREACH_RE_SAFE(node, re, next) {
+ RNODE_FOREACH_RE_SAFE (node, re, next) {
rib_unlink(node, re);
}
struct vrf *vrf;
struct zebra_vrf *zvrf;
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
zvrf = vrf->info;
if (!zvrf)
char buf[SRCDEST2STR_BUFFER];
struct zebra_vrf *zvrf;
- RNODE_FOREACH_RE(rn, re)
- {
+ RNODE_FOREACH_RE (rn, re) {
const char *mcast_info = "";
if (mcast) {
rib_table_info_t *info = srcdest_rnode_table_info(rn);
/* Show all routes. */
for (rn = route_top(table); rn; rn = route_next(rn)) {
- RNODE_FOREACH_RE(rn, re)
- {
+ RNODE_FOREACH_RE (rn, re) {
if (use_fib
&& !CHECK_FLAG(re->status,
ROUTE_ENTRY_SELECTED_FIB))
struct vrf *vrf;
struct zebra_vrf *zvrf;
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- if ((zvrf = vrf->info) != NULL) {
- vty_out(vty, "\nVRF %s:\n", zvrf_name(zvrf));
- zebra_print_rnh_table(zvrf_id(zvrf), AF_INET, vty,
- RNH_NEXTHOP_TYPE);
- }
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name)
+ if ((zvrf = vrf->info) != NULL) {
+ vty_out(vty, "\nVRF %s:\n", zvrf_name(zvrf));
+ zebra_print_rnh_table(zvrf_id(zvrf), AF_INET, vty,
+ RNH_NEXTHOP_TYPE);
+ }
return CMD_SUCCESS;
}
struct vrf *vrf;
struct zebra_vrf *zvrf;
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- if ((zvrf = vrf->info) != NULL) {
- vty_out(vty, "\nVRF %s:\n", zvrf_name(zvrf));
- zebra_print_rnh_table(zvrf_id(zvrf), AF_INET6, vty,
- RNH_NEXTHOP_TYPE);
- }
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name)
+ if ((zvrf = vrf->info) != NULL) {
+ vty_out(vty, "\nVRF %s:\n", zvrf_name(zvrf));
+ zebra_print_rnh_table(zvrf_id(zvrf), AF_INET6, vty,
+ RNH_NEXTHOP_TYPE);
+ }
return CMD_SUCCESS;
}
}
if (vrf_all) {
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
if ((zvrf = vrf->info) == NULL
|| (table = zvrf->table[AFI_IP][SAFI_UNICAST])
== NULL)
memset(&rib_cnt, 0, sizeof(rib_cnt));
memset(&fib_cnt, 0, sizeof(fib_cnt));
for (rn = route_top(table); rn; rn = srcdest_route_next(rn))
- RNODE_FOREACH_RE(rn, re)
- {
+ RNODE_FOREACH_RE (rn, re) {
is_ibgp = (re->type == ZEBRA_ROUTE_BGP
&& CHECK_FLAG(re->flags, ZEBRA_FLAG_IBGP));
memset(&rib_cnt, 0, sizeof(rib_cnt));
memset(&fib_cnt, 0, sizeof(fib_cnt));
for (rn = route_top(table); rn; rn = srcdest_route_next(rn))
- RNODE_FOREACH_RE(rn, re)
- {
+ RNODE_FOREACH_RE (rn, re) {
/*
* In case of ECMP, count only once.
return CMD_WARNING;
}
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
if ((zvrf = vrf->info) == NULL
|| (table = zvrf->table[AFI_IP][SAFI_UNICAST]) == NULL)
continue;
return CMD_WARNING;
}
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
if ((zvrf = vrf->info) == NULL
|| (table = zvrf->table[AFI_IP][SAFI_UNICAST]) == NULL)
continue;
struct vrf *vrf;
struct zebra_vrf *zvrf;
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- if ((zvrf = vrf->info) != NULL)
- vty_show_ip_route_summary(vty,
- zvrf->table[AFI_IP][SAFI_UNICAST]);
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name)
+ if ((zvrf = vrf->info) != NULL)
+ vty_show_ip_route_summary(
+ vty, zvrf->table[AFI_IP][SAFI_UNICAST]);
return CMD_SUCCESS;
}
struct vrf *vrf;
struct zebra_vrf *zvrf;
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- if ((zvrf = vrf->info) != NULL)
- vty_show_ip_route_summary_prefix(
- vty, zvrf->table[AFI_IP][SAFI_UNICAST]);
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name)
+ if ((zvrf = vrf->info) != NULL)
+ vty_show_ip_route_summary_prefix(
+ vty, zvrf->table[AFI_IP][SAFI_UNICAST]);
return CMD_SUCCESS;
}
char buf[SRCDEST2STR_BUFFER];
int write = 0;
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
if (!(zvrf = vrf->info))
continue;
if ((stable = zvrf->stable[afi][safi]) == NULL)
}
if (vrf_all) {
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
if ((zvrf = vrf->info) == NULL
|| (table = zvrf->table[AFI_IP6][SAFI_UNICAST])
== NULL)
/* Show all IPv6 route. */
for (rn = route_top(table); rn; rn = srcdest_route_next(rn))
- RNODE_FOREACH_RE(rn, re)
- {
+ RNODE_FOREACH_RE (rn, re) {
if (first) {
vty_out(vty, SHOW_ROUTE_V6_HEADER);
first = 0;
return CMD_WARNING;
}
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
if ((zvrf = vrf->info) == NULL
|| (table = zvrf->table[AFI_IP6][SAFI_UNICAST]) == NULL)
continue;
return CMD_WARNING;
}
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
if ((zvrf = vrf->info) == NULL
|| (table = zvrf->table[AFI_IP6][SAFI_UNICAST]) == NULL)
continue;
struct vrf *vrf;
struct zebra_vrf *zvrf;
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- if ((zvrf = vrf->info) != NULL)
- vty_show_ip_route_summary(vty,
- zvrf->table[AFI_IP6][SAFI_UNICAST]);
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name)
+ if ((zvrf = vrf->info) != NULL)
+ vty_show_ip_route_summary(
+ vty, zvrf->table[AFI_IP6][SAFI_UNICAST]);
return CMD_SUCCESS;
}
struct zebra_vrf *zvrf;
int first = 1;
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
if ((zvrf = vrf->info) == NULL
|| (table = zvrf->table[AFI_IP6][SAFI_MULTICAST]) == NULL)
continue;
/* Show all IPv6 route. */
for (rn = route_top(table); rn; rn = srcdest_route_next(rn))
- RNODE_FOREACH_RE(rn, re)
- {
+ RNODE_FOREACH_RE (rn, re) {
if (first) {
vty_out(vty, SHOW_ROUTE_V6_HEADER);
first = 0;
struct vrf *vrf;
struct zebra_vrf *zvrf;
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- if ((zvrf = vrf->info) != NULL)
- vty_show_ip_route_summary_prefix(
- vty, zvrf->table[AFI_IP6][SAFI_UNICAST]);
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name)
+ if ((zvrf = vrf->info) != NULL)
+ vty_show_ip_route_summary_prefix(
+ vty, zvrf->table[AFI_IP6][SAFI_UNICAST]);
return CMD_SUCCESS;
}
struct vrf *vrf;
struct zebra_vrf *zvrf;
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
if (!(zvrf = vrf->info))
continue;
if (!zvrf_id(zvrf))
/* Interface information is needed. */
vrf_bitmap_set(client->ifinfo, zvrf_id(zvrf));
- RB_FOREACH(vrf, vrf_id_head, &vrfs_by_id)
- {
+ RB_FOREACH (vrf, vrf_id_head, &vrfs_by_id) {
for (ALL_LIST_ELEMENTS(vrf->iflist, ifnode, ifnnode, ifp)) {
/* Skip pseudo interface. */
if (!CHECK_FLAG(ifp->status, ZEBRA_INTERFACE_ACTIVE))
struct vrf *vrf;
struct zebra_vrf *zvrf;
- RB_FOREACH(vrf, vrf_id_head, &vrfs_by_id)
- {
+ RB_FOREACH (vrf, vrf_id_head, &vrfs_by_id) {
if ((zvrf = vrf->info) != NULL) {
zebra_cleanup_rnh_client(zvrf_id(zvrf), AF_INET, client,
RNH_NEXTHOP_TYPE);
" Route Route Neighbor LSP LSP\n");
vty_out(vty,
"VRF Installs Removals Updates Installs Removals\n");
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
struct zebra_vrf *zvrf = vrf->info;
vty_out(vty, "%-25s %10" PRIu64 " %10" PRIu64 " %10" PRIu64
" %10" PRIu64 " %10" PRIu64 "\n",