struct zclient *zclient = NULL;
/* Router-id update message from zebra. */
-static int ospf6_router_id_update_zebra(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int ospf6_router_id_update_zebra(ZAPI_CALLBACK_ARGS)
{
struct prefix router_id;
struct ospf6 *o = ospf6;
AFI_IP6, type, 0, VRF_DEFAULT);
}
-/* Inteface addition message from zebra. */
-static int ospf6_zebra_if_add(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
-{
- struct interface *ifp;
-
- ifp = zebra_interface_add_read(zclient->ibuf, vrf_id);
- if (IS_OSPF6_DEBUG_ZEBRA(RECV))
- zlog_debug("Zebra Interface add: %s index %d mtu %d", ifp->name,
- ifp->ifindex, ifp->mtu6);
- ospf6_interface_if_add(ifp);
- return 0;
-}
-
-static int ospf6_zebra_if_del(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
-{
- struct interface *ifp;
-
- if (!(ifp = zebra_interface_state_read(zclient->ibuf, vrf_id)))
- return 0;
-
- if (if_is_up(ifp))
- zlog_warn("Zebra: got delete of %s, but interface is still up",
- ifp->name);
-
- if (IS_OSPF6_DEBUG_ZEBRA(RECV))
- zlog_debug("Zebra Interface delete: %s index %d mtu %d",
- ifp->name, ifp->ifindex, ifp->mtu6);
-
- if_set_index(ifp, IFINDEX_INTERNAL);
- return 0;
-}
-
-static int ospf6_zebra_if_state_update(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
-{
- struct interface *ifp;
-
- ifp = zebra_interface_state_read(zclient->ibuf, vrf_id);
- if (ifp == NULL)
- return 0;
-
- if (IS_OSPF6_DEBUG_ZEBRA(RECV))
- zlog_debug(
- "Zebra Interface state change: "
- "%s index %d flags %llx metric %d mtu %d bandwidth %d",
- ifp->name, ifp->ifindex, (unsigned long long)ifp->flags,
- ifp->metric, ifp->mtu6, ifp->bandwidth);
-
- ospf6_interface_state_update(ifp);
- return 0;
-}
-
-static int ospf6_zebra_if_address_update_add(int command,
- struct zclient *zclient,
- zebra_size_t length,
- vrf_id_t vrf_id)
+static int ospf6_zebra_if_address_update_add(ZAPI_CALLBACK_ARGS)
{
struct connected *c;
char buf[128];
return 0;
}
-static int ospf6_zebra_if_address_update_delete(int command,
- struct zclient *zclient,
- zebra_size_t length,
- vrf_id_t vrf_id)
+static int ospf6_zebra_if_address_update_delete(ZAPI_CALLBACK_ARGS)
{
struct connected *c;
char buf[128];
ospf6_interface_state_update(c->ifp);
}
- connected_free(c);
+ connected_free(&c);
return 0;
}
-static int ospf6_zebra_read_route(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int ospf6_zebra_read_route(ZAPI_CALLBACK_ARGS)
{
struct zapi_route api;
unsigned long ifindex;
zlog_debug(
"Zebra Receive route %s: %s %s nexthop %s ifindex %ld tag %" ROUTE_TAG_PRI,
- (command == ZEBRA_REDISTRIBUTE_ROUTE_ADD ? "add"
- : "delete"),
+ (cmd == ZEBRA_REDISTRIBUTE_ROUTE_ADD ? "add"
+ : "delete"),
zebra_route_string(api.type), prefixstr, nexthopstr,
ifindex, api.tag);
}
- if (command == ZEBRA_REDISTRIBUTE_ROUTE_ADD)
+ if (cmd == ZEBRA_REDISTRIBUTE_ROUTE_ADD)
ospf6_asbr_redistribute_add(api.type, ifindex, &api.prefix,
api.nexthop_num, nexthop, api.tag);
else
return CMD_SUCCESS;
}
- vty_out(vty, "Zebra Infomation\n");
+ vty_out(vty, "Zebra Information\n");
vty_out(vty, " fail: %d\n", zclient->fail);
vty_out(vty, " redistribute default: %d\n",
vrf_bitmap_check(zclient->default_information[AFI_IP6],
static void ospf6_zebra_connected(struct zclient *zclient)
{
/* Send the client registration */
- bfd_client_sendmsg(zclient, ZEBRA_BFD_CLIENT_REGISTER);
+ bfd_client_sendmsg(zclient, ZEBRA_BFD_CLIENT_REGISTER, VRF_DEFAULT);
zclient_send_reg_requests(zclient, VRF_DEFAULT);
}
zclient_init(zclient, ZEBRA_ROUTE_OSPF6, 0, &ospf6d_privs);
zclient->zebra_connected = ospf6_zebra_connected;
zclient->router_id_update = ospf6_router_id_update_zebra;
- zclient->interface_add = ospf6_zebra_if_add;
- zclient->interface_delete = ospf6_zebra_if_del;
- zclient->interface_up = ospf6_zebra_if_state_update;
- zclient->interface_down = ospf6_zebra_if_state_update;
zclient->interface_address_add = ospf6_zebra_if_address_update_add;
zclient->interface_address_delete =
ospf6_zebra_if_address_update_delete;