#include "ripngd/ripng_debug.h"
/* All information about zebra. */
-struct zclient *zclient = NULL;
+struct zclient *ripng_zclient = NULL;
/* Send ECMP routes to zebra. */
static void ripng_zebra_ipv6_send(struct ripng *ripng, struct agg_node *rp,
api.tag = rinfo->tag;
}
- zclient_route_send(cmd, zclient, &api);
+ zclient_route_send(cmd, ripng_zclient, &api);
if (IS_RIPNG_DEBUG_ZEBRA) {
if (ripng->ecmp)
void ripng_redistribute_conf_update(struct ripng *ripng, int type)
{
- zebra_redistribute_send(ZEBRA_REDISTRIBUTE_ADD, zclient, AFI_IP6,
+ zebra_redistribute_send(ZEBRA_REDISTRIBUTE_ADD, ripng_zclient, AFI_IP6,
type, 0, ripng->vrf->vrf_id);
}
void ripng_redistribute_conf_delete(struct ripng *ripng, int type)
{
- if (zclient->sock > 0)
- zebra_redistribute_send(ZEBRA_REDISTRIBUTE_DELETE, zclient,
+ if (ripng_zclient->sock > 0)
+ zebra_redistribute_send(ZEBRA_REDISTRIBUTE_DELETE, ripng_zclient,
AFI_IP6, type, 0, ripng->vrf->vrf_id);
ripng_redistribute_withdraw(ripng, type);
if (!ripng_redistribute_check(ripng, i))
continue;
- zebra_redistribute_send(ZEBRA_REDISTRIBUTE_ADD, zclient,
+ zebra_redistribute_send(ZEBRA_REDISTRIBUTE_ADD, ripng_zclient,
AFI_IP6, i, 0, ripng->vrf->vrf_id);
}
}
if (!ripng_redistribute_check(ripng, i))
continue;
- zebra_redistribute_send(ZEBRA_REDISTRIBUTE_DELETE, zclient,
+ zebra_redistribute_send(ZEBRA_REDISTRIBUTE_DELETE, ripng_zclient,
AFI_IP6, i, 0, ripng->vrf->vrf_id);
}
}
int i;
for (i = 0; i < ZEBRA_ROUTE_MAX; i++) {
- if (i == zclient->redist_default
+ if (i == ripng_zclient->redist_default
|| !ripng_redistribute_check(ripng, i))
continue;
zlog_debug("%s: register VRF %s(%u) to zebra", __func__,
vrf->name, vrf->vrf_id);
- zclient_send_reg_requests(zclient, vrf->vrf_id);
+ zclient_send_reg_requests(ripng_zclient, vrf->vrf_id);
}
void ripng_zebra_vrf_deregister(struct vrf *vrf)
zlog_debug("%s: deregister VRF %s(%u) from zebra.", __func__,
vrf->name, vrf->vrf_id);
- zclient_send_dereg_requests(zclient, vrf->vrf_id);
+ zclient_send_dereg_requests(ripng_zclient, vrf->vrf_id);
}
static void ripng_zebra_connected(struct zclient *zclient)
}
/* Initialize zebra structure and it's commands. */
-void zebra_init(struct event_loop *master)
+void zebra_init(struct event_loop *mst)
{
/* Allocate zebra structure. */
- zclient = zclient_new(master, &zclient_options_default, ripng_handlers,
- array_size(ripng_handlers));
- zclient_init(zclient, ZEBRA_ROUTE_RIPNG, 0, &ripngd_privs);
+ ripng_zclient = zclient_new(mst, &zclient_options_default, ripng_handlers,
+ array_size(ripng_handlers));
+ zclient_init(ripng_zclient, ZEBRA_ROUTE_RIPNG, 0, &ripngd_privs);
- zclient->zebra_connected = ripng_zebra_connected;
- zclient->zebra_capabilities = ripng_zebra_capabilities;
+ ripng_zclient->zebra_connected = ripng_zebra_connected;
+ ripng_zclient->zebra_capabilities = ripng_zebra_capabilities;
}
void ripng_zebra_stop(void)
{
- zclient_stop(zclient);
- zclient_free(zclient);
+ zclient_stop(ripng_zclient);
+ zclient_free(ripng_zclient);
}