forked from Mirror/frr
babeld: clean up -Wshadow warnings
Clean up various "shadow" warnings in babeld. Signed-off-by: Mark Stapp <mjs@cisco.com>
This commit is contained in:
parent
5be982966c
commit
e636398908
|
@ -755,8 +755,10 @@ babel_interface_close_all(void)
|
||||||
}
|
}
|
||||||
/* Disable babel redistribution */
|
/* Disable babel redistribution */
|
||||||
for (type = 0; type < ZEBRA_ROUTE_MAX; type++) {
|
for (type = 0; type < ZEBRA_ROUTE_MAX; type++) {
|
||||||
zclient_redistribute (ZEBRA_REDISTRIBUTE_DELETE, zclient, AFI_IP, type, 0, VRF_DEFAULT);
|
zclient_redistribute(ZEBRA_REDISTRIBUTE_DELETE, babel_zclient, AFI_IP, type, 0,
|
||||||
zclient_redistribute (ZEBRA_REDISTRIBUTE_DELETE, zclient, AFI_IP6, type, 0, VRF_DEFAULT);
|
VRF_DEFAULT);
|
||||||
|
zclient_redistribute(ZEBRA_REDISTRIBUTE_DELETE, babel_zclient, AFI_IP6, type, 0,
|
||||||
|
VRF_DEFAULT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -974,6 +976,7 @@ DEFUN (show_babel_route,
|
||||||
{
|
{
|
||||||
struct route_stream *routes = NULL;
|
struct route_stream *routes = NULL;
|
||||||
struct xroute_stream *xroutes = NULL;
|
struct xroute_stream *xroutes = NULL;
|
||||||
|
|
||||||
routes = route_stream(0);
|
routes = route_stream(0);
|
||||||
if(routes) {
|
if(routes) {
|
||||||
while(1) {
|
while(1) {
|
||||||
|
|
|
@ -19,7 +19,7 @@ void babelz_zebra_init(void);
|
||||||
|
|
||||||
|
|
||||||
/* we must use a pointer because of zclient.c's functions (new, free). */
|
/* we must use a pointer because of zclient.c's functions (new, free). */
|
||||||
struct zclient *zclient;
|
struct zclient *babel_zclient;
|
||||||
|
|
||||||
/* Debug types */
|
/* Debug types */
|
||||||
static const struct {
|
static const struct {
|
||||||
|
@ -94,9 +94,10 @@ DEFUN (babel_redistribute_type,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!negate)
|
if (!negate)
|
||||||
zclient_redistribute (ZEBRA_REDISTRIBUTE_ADD, zclient, afi, type, 0, VRF_DEFAULT);
|
zclient_redistribute(ZEBRA_REDISTRIBUTE_ADD, babel_zclient, afi, type, 0, VRF_DEFAULT);
|
||||||
else {
|
else {
|
||||||
zclient_redistribute (ZEBRA_REDISTRIBUTE_DELETE, zclient, afi, type, 0, VRF_DEFAULT);
|
zclient_redistribute(ZEBRA_REDISTRIBUTE_DELETE, babel_zclient, afi, type, 0,
|
||||||
|
VRF_DEFAULT);
|
||||||
/* perhaps should we remove xroutes having the same type... */
|
/* perhaps should we remove xroutes having the same type... */
|
||||||
}
|
}
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
|
@ -230,11 +231,11 @@ static zclient_handler *const babel_handlers[] = {
|
||||||
|
|
||||||
void babelz_zebra_init(void)
|
void babelz_zebra_init(void)
|
||||||
{
|
{
|
||||||
zclient = zclient_new(master, &zclient_options_default, babel_handlers,
|
babel_zclient = zclient_new(master, &zclient_options_default, babel_handlers,
|
||||||
array_size(babel_handlers));
|
array_size(babel_handlers));
|
||||||
zclient_init(zclient, ZEBRA_ROUTE_BABEL, 0, &babeld_privs);
|
zclient_init(babel_zclient, ZEBRA_ROUTE_BABEL, 0, &babeld_privs);
|
||||||
|
|
||||||
zclient->zebra_connected = babel_zebra_connected;
|
babel_zclient->zebra_connected = babel_zebra_connected;
|
||||||
|
|
||||||
install_element(BABEL_NODE, &babel_redistribute_type_cmd);
|
install_element(BABEL_NODE, &babel_redistribute_type_cmd);
|
||||||
install_element(ENABLE_NODE, &debug_babel_cmd);
|
install_element(ENABLE_NODE, &debug_babel_cmd);
|
||||||
|
@ -248,6 +249,6 @@ void babelz_zebra_init(void)
|
||||||
void
|
void
|
||||||
babel_zebra_close_connexion(void)
|
babel_zebra_close_connexion(void)
|
||||||
{
|
{
|
||||||
zclient_stop(zclient);
|
zclient_stop(babel_zclient);
|
||||||
zclient_free(zclient);
|
zclient_free(babel_zclient);
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@ Copyright 2011 by Matthieu Boutier and Juliusz Chroboczek
|
||||||
|
|
||||||
#include "vty.h"
|
#include "vty.h"
|
||||||
|
|
||||||
extern struct zclient *zclient;
|
extern struct zclient *babel_zclient;
|
||||||
|
|
||||||
void babelz_zebra_init(void);
|
void babelz_zebra_init(void);
|
||||||
void babel_zebra_close_connexion(void);
|
void babel_zebra_close_connexion(void);
|
||||||
|
|
|
@ -108,8 +108,8 @@ babel_config_write (struct vty *vty)
|
||||||
/* list redistributed protocols */
|
/* list redistributed protocols */
|
||||||
for (afi = AFI_IP; afi <= AFI_IP6; afi++) {
|
for (afi = AFI_IP; afi <= AFI_IP6; afi++) {
|
||||||
for (i = 0; i < ZEBRA_ROUTE_MAX; i++) {
|
for (i = 0; i < ZEBRA_ROUTE_MAX; i++) {
|
||||||
if (i != zclient->redist_default &&
|
if (i != babel_zclient->redist_default &&
|
||||||
vrf_bitmap_check(&zclient->redist[afi][i], VRF_DEFAULT)) {
|
vrf_bitmap_check(&babel_zclient->redist[afi][i], VRF_DEFAULT)) {
|
||||||
vty_out(vty, " redistribute %s %s\n",
|
vty_out(vty, " redistribute %s %s\n",
|
||||||
(afi == AFI_IP) ? "ipv4" : "ipv6",
|
(afi == AFI_IP) ? "ipv4" : "ipv6",
|
||||||
zebra_route_string(i));
|
zebra_route_string(i));
|
||||||
|
|
|
@ -176,8 +176,7 @@ zebra_route(int add, int family, const unsigned char *pref, unsigned short plen,
|
||||||
debugf(BABEL_DEBUG_ROUTE, "%s route (%s) to zebra",
|
debugf(BABEL_DEBUG_ROUTE, "%s route (%s) to zebra",
|
||||||
add ? "adding" : "removing",
|
add ? "adding" : "removing",
|
||||||
(family == AF_INET) ? "ipv4" : "ipv6");
|
(family == AF_INET) ? "ipv4" : "ipv6");
|
||||||
return zclient_route_send (add ? ZEBRA_ROUTE_ADD : ZEBRA_ROUTE_DELETE,
|
return zclient_route_send(add ? ZEBRA_ROUTE_ADD : ZEBRA_ROUTE_DELETE, babel_zclient, &api);
|
||||||
zclient, &api);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
|
@ -38,7 +38,6 @@ struct babel_route {
|
||||||
|
|
||||||
struct route_stream;
|
struct route_stream;
|
||||||
|
|
||||||
extern struct babel_route **routes;
|
|
||||||
extern int kernel_metric;
|
extern int kernel_metric;
|
||||||
extern enum babel_diversity diversity_kind;
|
extern enum babel_diversity diversity_kind;
|
||||||
extern int diversity_factor;
|
extern int diversity_factor;
|
||||||
|
|
Loading…
Reference in a new issue