int
-babel_interface_up (int cmd, struct zclient *client, zebra_size_t length, vrf_id_t vrf)
+babel_interface_up (ZAPI_CALLBACK_ARGS)
{
struct stream *s = NULL;
struct interface *ifp = NULL;
debugf(BABEL_DEBUG_IF, "receive a 'interface up'");
s = zclient->ibuf;
- ifp = zebra_interface_state_read(s, vrf); /* it updates iflist */
+ ifp = zebra_interface_state_read(s, vrf_id); /* it updates iflist */
if (ifp == NULL) {
return 0;
}
int
-babel_interface_down (int cmd, struct zclient *client, zebra_size_t length, vrf_id_t vrf)
+babel_interface_down (ZAPI_CALLBACK_ARGS)
{
struct stream *s = NULL;
struct interface *ifp = NULL;
debugf(BABEL_DEBUG_IF, "receive a 'interface down'");
s = zclient->ibuf;
- ifp = zebra_interface_state_read(s, vrf); /* it updates iflist */
+ ifp = zebra_interface_state_read(s, vrf_id); /* it updates iflist */
if (ifp == NULL) {
return 0;
}
int
-babel_interface_add (int cmd, struct zclient *client, zebra_size_t length, vrf_id_t vrf)
+babel_interface_add (ZAPI_CALLBACK_ARGS)
{
struct interface *ifp = NULL;
debugf(BABEL_DEBUG_IF, "receive a 'interface add'");
/* read and add the interface in the iflist. */
- ifp = zebra_interface_add_read (zclient->ibuf, vrf);
+ ifp = zebra_interface_add_read (zclient->ibuf, vrf_id);
if (ifp == NULL) {
return 0;
}
int
-babel_interface_delete (int cmd, struct zclient *client, zebra_size_t length, vrf_id_t vrf)
+babel_interface_delete (ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
struct stream *s;
debugf(BABEL_DEBUG_IF, "receive a 'interface delete'");
s = zclient->ibuf;
- ifp = zebra_interface_state_read(s, vrf); /* it updates iflist */
+ ifp = zebra_interface_state_read(s, vrf_id); /* it updates iflist */
if (ifp == NULL)
return 0;
}
int
-babel_interface_address_add (int cmd, struct zclient *client,
- zebra_size_t length, vrf_id_t vrf)
+babel_interface_address_add (ZAPI_CALLBACK_ARGS)
{
babel_interface_nfo *babel_ifp;
struct connected *ifc;
debugf(BABEL_DEBUG_IF, "receive a 'interface address add'");
ifc = zebra_interface_address_read (ZEBRA_INTERFACE_ADDRESS_ADD,
- zclient->ibuf, vrf);
+ zclient->ibuf, vrf_id);
if (ifc == NULL)
return 0;
}
int
-babel_interface_address_delete (int cmd, struct zclient *client,
- zebra_size_t length, vrf_id_t vrf)
+babel_interface_address_delete (ZAPI_CALLBACK_ARGS)
{
babel_interface_nfo *babel_ifp;
struct connected *ifc;
debugf(BABEL_DEBUG_IF, "receive a 'interface address delete'");
ifc = zebra_interface_address_read (ZEBRA_INTERFACE_ADDRESS_DELETE,
- zclient->ibuf, vrf);
+ zclient->ibuf, vrf_id);
if (ifc == NULL)
return 0;
rc = setsockopt(protocol_socket, IPPROTO_IPV6, IPV6_JOIN_GROUP,
(char*)&mreq, sizeof(mreq));
if(rc < 0) {
- flog_err_sys(LIB_ERR_SOCKET,
+ flog_err_sys(EC_LIB_SOCKET,
"setsockopt(IPV6_JOIN_GROUP) on interface '%s': %s",
ifp->name, safe_strerror(errno));
/* This is probably due to a missing link-local address,
rc = setsockopt(protocol_socket, IPPROTO_IPV6, IPV6_LEAVE_GROUP,
(char*)&mreq, sizeof(mreq));
if(rc < 0)
- flog_err_sys(LIB_ERR_SOCKET,
+ flog_err_sys(EC_LIB_SOCKET,
"setsockopt(IPV6_LEAVE_GROUP) on interface '%s': %s",
ifp->name, safe_strerror(errno));
}
"Babel information\n"
"Configuration information\n")
{
+ struct babel *babel_ctx;
+
vty_out (vty, " -- Babel running configuration --\n");
show_babel_main_configuration(vty);
- vty_out (vty, " -- distribution lists --\n");
- config_show_distribute(vty);
+ babel_ctx = babel_lookup();
+ if (babel_ctx) {
+ vty_out (vty, " -- distribution lists --\n");
+ config_show_distribute(vty, babel_ctx->distribute_ctx);
+ }
return CMD_SUCCESS;
}
void
-babel_if_init ()
+babel_if_init(void)
{
/* initialize interface list */
hook_register_prio(if_add, 0, babel_if_new_hook);
babel_interface_allocate (void)
{
babel_interface_nfo *babel_ifp;
- babel_ifp = XMALLOC(MTYPE_BABEL_IF, sizeof(babel_interface_nfo));
- if(babel_ifp == NULL)
- return NULL;
-
- /* Here are set the default values for an interface. */
- memset(babel_ifp, 0, sizeof(babel_interface_nfo));
+ babel_ifp = XCALLOC(MTYPE_BABEL_IF, sizeof(babel_interface_nfo));
/* All flags are unset */
babel_ifp->bucket_time = babel_now.tv_sec;
babel_ifp->bucket = BUCKET_TOKENS_MAX;