summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_updgrp.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2017-09-15 17:47:35 +0200
committerRenato Westphal <renato@opensourcerouting.org>2017-09-15 19:53:46 +0200
commita2addae8fe172f04f4d8ac99aa123a7d2dd64604 (patch)
treec58663b6654a9bec64ac4c26e11d158fd48b34ad /bgpd/bgp_updgrp.c
parentMerge pull request #1178 from donaldsharp/pim_obfuscation (diff)
downloadfrr-a2addae8fe172f04f4d8ac99aa123a7d2dd64604.tar.xz
frr-a2addae8fe172f04f4d8ac99aa123a7d2dd64604.zip
*: use clang's 'ForEachMacros' format style option
This fixes the broken indentation of several foreach loops throughout the code. From clang's documentation[1]: ForEachMacros: A vector of macros that should be interpreted as foreach loops instead of as function calls. [1] http://clang.llvm.org/docs/ClangFormatStyleOptions.html Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'bgpd/bgp_updgrp.c')
-rw-r--r--bgpd/bgp_updgrp.c52
1 files changed, 19 insertions, 33 deletions
diff --git a/bgpd/bgp_updgrp.c b/bgpd/bgp_updgrp.c
index 05395a583..8f6729060 100644
--- a/bgpd/bgp_updgrp.c
+++ b/bgpd/bgp_updgrp.c
@@ -549,8 +549,7 @@ static int update_group_show_walkcb(struct update_group *updgrp, void *arg)
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 {
@@ -591,8 +590,7 @@ static int update_group_show_walkcb(struct update_group *updgrp, void *arg)
? " 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");
@@ -636,8 +634,8 @@ static int update_group_show_walkcb(struct update_group *updgrp, void *arg)
: "");
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;
@@ -655,8 +653,7 @@ static int updgrp_show_packet_queue_walkcb(struct update_group *updgrp,
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",
@@ -959,8 +956,7 @@ static struct update_subgroup *update_subgroup_find(struct update_group *updgrp,
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))
@@ -1109,8 +1105,7 @@ int update_subgroup_check_merge(struct update_subgroup *subgrp,
/*
* 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;
}
@@ -1177,8 +1172,7 @@ static void update_subgroup_copy_adj_out(struct update_subgroup *source,
{
struct bgp_adj_out *aout, *aout_copy;
- SUBGRP_FOREACH_ADJ(source, aout)
- {
+ SUBGRP_FOREACH_ADJ (source, aout) {
/*
* Copy the adj out.
*/
@@ -1361,15 +1355,13 @@ static int updgrp_policy_update_walkcb(struct update_group *updgrp, void *arg)
* 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(
@@ -1408,8 +1400,8 @@ static int update_group_periodic_merge_walkcb(struct update_group *updgrp,
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;
}
@@ -1550,7 +1542,7 @@ void update_bgp_group_init(struct bgp *bgp)
{
int afid;
- AF_FOREACH(afid)
+ AF_FOREACH (afid)
bgp->update_groups[afid] =
hash_create(updgrp_hash_key_make,
updgrp_hash_cmp,
@@ -1561,8 +1553,7 @@ void update_bgp_group_free(struct bgp *bgp)
{
int afid;
- AF_FOREACH(afid)
- {
+ AF_FOREACH (afid) {
if (bgp->update_groups[afid]) {
hash_free(bgp->update_groups[afid]);
bgp->update_groups[afid] = NULL;
@@ -1740,8 +1731,7 @@ void update_group_walk(struct bgp *bgp, updgrp_walkcb cb, void *ctx)
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);
}
}
@@ -1763,8 +1753,7 @@ update_group_default_originate_route_map_walkcb(struct update_group *updgrp,
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);
@@ -1824,8 +1813,7 @@ void peer_af_announce_route(struct peer_af *paf, int combine)
*/
all_pending = 1;
- SUBGRP_FOREACH_PEER(subgrp, cur_paf)
- {
+ SUBGRP_FOREACH_PEER (subgrp, cur_paf) {
if (cur_paf == paf)
continue;
@@ -1860,8 +1848,7 @@ void peer_af_announce_route(struct peer_af *paf, int combine)
*
* 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;
@@ -1889,8 +1876,7 @@ void subgroup_trigger_write(struct update_subgroup *subgrp)
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);