for (ALL_LIST_ELEMENTS_RO(inst, node, bgp)) {
const char *name, *type;
struct peer *peer;
- struct listnode *node, *nnode;
+ struct listnode *node2, *nnode2;
int peers_cfg, peers_estb;
json_object *json_vrf = NULL;
json_vrf = json_object_new_object();
- for (ALL_LIST_ELEMENTS(bgp->peer, node, nnode, peer)) {
+ for (ALL_LIST_ELEMENTS(bgp->peer, node2, nnode2, peer)) {
if (!CHECK_FLAG(peer->flags, PEER_FLAG_CONFIG_NODE))
continue;
peers_cfg++;
vty_out(vty, "!\n");
if (hc->l2_groups) {
- struct rfapi_l2_group_cfg *rfg = NULL;
+ struct rfapi_l2_group_cfg *rfgc = NULL;
struct listnode *gnode;
- for (ALL_LIST_ELEMENTS_RO(hc->l2_groups, gnode, rfg)) {
+ for (ALL_LIST_ELEMENTS_RO(hc->l2_groups, gnode, rfgc)) {
struct listnode *lnode;
void *data;
++write;
- vty_out(vty, " vnc l2-group %s\n", rfg->name);
- if (rfg->logical_net_id != 0)
+ vty_out(vty, " vnc l2-group %s\n", rfgc->name);
+ if (rfgc->logical_net_id != 0)
vty_out(vty,
" logical-network-id %u\n",
- rfg->logical_net_id);
- if (rfg->labels != NULL
- && listhead(rfg->labels) != NULL) {
+ rfgc->logical_net_id);
+ if (rfgc->labels != NULL
+ && listhead(rfgc->labels) != NULL) {
vty_out(vty, " labels ");
- for (ALL_LIST_ELEMENTS_RO(rfg->labels,
+ for (ALL_LIST_ELEMENTS_RO(rfgc->labels,
lnode,
data)) {
vty_out(vty, "%hu ",
vty_out(vty, "\n");
}
- if (rfg->rt_import_list && rfg->rt_export_list
- && ecommunity_cmp(rfg->rt_import_list,
- rfg->rt_export_list)) {
+ if (rfgc->rt_import_list && rfgc->rt_export_list
+ && ecommunity_cmp(rfgc->rt_import_list,
+ rfgc->rt_export_list)) {
char *b = ecommunity_ecom2str(
- rfg->rt_import_list,
+ rfgc->rt_import_list,
ECOMMUNITY_FORMAT_ROUTE_MAP,
ECOMMUNITY_ROUTE_TARGET);
vty_out(vty, " rt both %s\n", b);
XFREE(MTYPE_ECOMMUNITY_STR, b);
} else {
- if (rfg->rt_import_list) {
+ if (rfgc->rt_import_list) {
char *b = ecommunity_ecom2str(
- rfg->rt_import_list,
+ rfgc->rt_import_list,
ECOMMUNITY_FORMAT_ROUTE_MAP,
ECOMMUNITY_ROUTE_TARGET);
vty_out(vty, " rt import %s\n",
b);
XFREE(MTYPE_ECOMMUNITY_STR, b);
}
- if (rfg->rt_export_list) {
+ if (rfgc->rt_export_list) {
char *b = ecommunity_ecom2str(
- rfg->rt_export_list,
+ rfgc->rt_export_list,
ECOMMUNITY_FORMAT_ROUTE_MAP,
ECOMMUNITY_ROUTE_TARGET);
vty_out(vty, " rt export %s\n",
.cfg_group_cb)(
vty, bgp->rfapi->rfp,
RFAPI_RFP_CFG_GROUP_L2,
- rfg->name, rfg->rfp_cfg);
+ rfgc->name, rfgc->rfp_cfg);
vty_out(vty, " exit-vnc\n");
vty_out(vty, "!\n");
}
}
if (list_adopted) {
struct listnode *node;
- struct agg_node *bi_exterior;
+ struct agg_node *an_bi_exterior;
- for (ALL_LIST_ELEMENTS_RO(list_adopted, node, bi_exterior)) {
+ for (ALL_LIST_ELEMENTS_RO(list_adopted, node, an_bi_exterior)) {
skiplist_delete(it->monitor_exterior_orphans,
- bi_exterior, NULL);
+ an_bi_exterior, NULL);
}
list_delete_and_null(&list_adopted);
}
if (pentry->any)
vty_out(vty, "any");
else {
- struct prefix *p = &pentry->prefix;
+ struct prefix *pf = &pentry->prefix;
char buf[BUFSIZ];
vty_out(vty, "%s/%d",
- inet_ntop(p->family, p->u.val, buf,
+ inet_ntop(pf->family, pf->u.val, buf,
BUFSIZ),
- p->prefixlen);
+ pf->prefixlen);
if (pentry->ge)
vty_out(vty, " ge %d", pentry->ge);
int ncols = 0;
/* count how many columns we have */
- for (int i = 0; format[i]; i++)
- ncols += !!(format[i] == '|');
+ for (int j = 0; format[j]; j++)
+ ncols += !!(format[j] == '|');
ncols++;
if (tt->ncols == 0)
memcpy(&buf[pos], left, lsize);
pos += lsize;
- for (size_t i = 0; i < width - lsize - rsize; i++)
+ for (size_t l = 0; l < width - lsize - rsize; l++)
buf[pos++] = row[0].style.border.bottom;
pos -= width - lsize - rsize;
#define VRF_GET_ID(V, NAME, USE_JSON) \
do { \
- struct vrf *vrf; \
- if (!(vrf = vrf_lookup_by_name(NAME))) { \
+ struct vrf *_vrf; \
+ if (!(_vrf = vrf_lookup_by_name(NAME))) { \
if (USE_JSON) { \
vty_out(vty, "{}\n"); \
} else { \
} \
return CMD_WARNING; \
} \
- if (vrf->vrf_id == VRF_UNKNOWN) { \
+ if (_vrf->vrf_id == VRF_UNKNOWN) { \
if (USE_JSON) { \
vty_out(vty, "{}\n"); \
} else { \
} \
return CMD_WARNING; \
} \
- (V) = vrf->vrf_id; \
+ (V) = _vrf->vrf_id; \
} while (0)
/*
#endif
#define MAX(a, b) \
({ \
- typeof(a) _a = (a); \
- typeof(b) _b = (b); \
- _a > _b ? _a : _b; \
+ typeof(a) _max_a = (a); \
+ typeof(b) _max_b = (b); \
+ _max_a > _max_b ? _max_a : _max_b; \
})
#ifdef MIN
#undef MIN
#endif
#define MIN(a, b) \
({ \
- typeof(a) _a = (a); \
- typeof(b) _b = (b); \
- _a < _b ? _a : _b; \
+ typeof(a) _min_a = (a); \
+ typeof(b) _min_b = (b); \
+ _min_a < _min_b ? _min_a : _min_b; \
})
#ifndef offsetof
#define threadtimer_string(now, t, buf, size) \
do { \
- struct timeval result; \
+ struct timeval _result; \
if (!t) \
snprintf(buf, size, "inactive"); \
else { \
- timersub(&t->u.sands, &now, &result); \
- timerstring(&result, buf, size); \
+ timersub(&t->u.sands, &now, &_result); \
+ timerstring(&_result, buf, size); \
} \
} while (0)
pnhgc);
for (ALL_NEXTHOPS(nhgc->nhg, nhop)) {
- struct pbr_nexthop_cache lookup;
+ struct pbr_nexthop_cache lookupc;
struct pbr_nexthop_cache *pnhc;
- lookup.nexthop = nhop;
- pnhc = hash_lookup(pnhgc->nhh, &lookup);
+ lookupc.nexthop = nhop;
+ pnhc = hash_lookup(pnhgc->nhh, &lookupc);
if (!pnhc) {
- pnhc = hash_get(pnhgc->nhh, &lookup, pbr_nh_alloc);
+ pnhc = hash_get(pnhgc->nhh, &lookupc, pbr_nh_alloc);
pnhc->parent = pnhgc;
}
}
if (descriptions != NULL) {
for (j = 0; j < vector_active(descriptions);
j++) {
- struct cmd_token *cmd =
+ struct cmd_token *ct =
vector_slot(descriptions, j);
- printf(" '%s' '%s'\n", cmd->text,
- cmd->desc);
+ printf(" '%s' '%s'\n", ct->text,
+ ct->desc);
}
vector_free(descriptions);
}
expected_lock++;
if (rn->lock != expected_lock) {
- const struct prefix_ipv6 *dst_p, *src_p;
srcdest_rnode_prefixes(
rn, (const struct prefix **)&dst_p,
(const struct prefix **)&src_p);
static int if_config_write(struct vty *vty)
{
- struct vrf *vrf;
+ struct vrf *vrf0;
struct interface *ifp;
zebra_ptm_write(vty);
- RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name)
- FOR_ALL_INTERFACES (vrf, ifp) {
+ RB_FOREACH (vrf0, vrf_name_head, &vrfs_by_name)
+ FOR_ALL_INTERFACES (vrf0, ifp) {
struct zebra_if *if_data;
struct listnode *addrnode;
struct connected *ifc;