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;
/* Zebra route add and delete treatment. */
static int
-babel_zebra_read_route (int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf)
+babel_zebra_read_route (ZAPI_CALLBACK_ARGS)
{
struct zapi_route api;
if (CHECK_FLAG(api.message, ZAPI_MESSAGE_SRCPFX))
return 0;
- if (command == ZEBRA_REDISTRIBUTE_ROUTE_ADD) {
+ if (cmd == ZEBRA_REDISTRIBUTE_ROUTE_ADD) {
babel_route_add(&api);
} else {
babel_route_delete(&api);
log_error("ptm-del-client: failed to deregister client");
}
-static int bfdd_replay(int cmd, struct zclient *zc, uint16_t len, vrf_id_t vid)
+static int bfdd_replay(ZAPI_CALLBACK_ARGS)
{
- struct stream *msg = zc->ibuf;
+ struct stream *msg = zclient->ibuf;
uint32_t rcmd;
STREAM_GETL(msg, rcmd);
}
}
-static int bfdd_interface_update(int cmd, struct zclient *zc,
- uint16_t len __attribute__((__unused__)),
- vrf_id_t vrfid)
+static int bfdd_interface_update(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
* rolling our own.
*/
if (cmd == ZEBRA_INTERFACE_ADD) {
- ifp = zebra_interface_add_read(zc->ibuf, vrfid);
+ ifp = zebra_interface_add_read(zclient->ibuf, vrf_id);
if (ifp == NULL)
return 0;
}
/* Update interface information. */
- ifp = zebra_interface_state_read(zc->ibuf, vrfid);
+ ifp = zebra_interface_state_read(zclient->ibuf, vrf_id);
if (ifp == NULL)
return 0;
return 0;
}
-static int bfdd_interface_vrf_update(int command __attribute__((__unused__)),
- struct zclient *zclient,
- zebra_size_t length
- __attribute__((__unused__)),
- vrf_id_t vrfid)
+static int bfdd_interface_vrf_update(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
vrf_id_t nvrfid;
- ifp = zebra_interface_vrf_update_read(zclient->ibuf, vrfid, &nvrfid);
+ ifp = zebra_interface_vrf_update_read(zclient->ibuf, vrf_id, &nvrfid);
if (ifp == NULL)
return 0;
}
}
-static int bfdd_interface_address_update(int cmd, struct zclient *zc,
- zebra_size_t len
- __attribute__((__unused__)),
- vrf_id_t vrfid)
+static int bfdd_interface_address_update(ZAPI_CALLBACK_ARGS)
{
struct connected *ifc;
- ifc = zebra_interface_address_read(cmd, zc->ibuf, vrfid);
+ ifc = zebra_interface_address_read(cmd, zclient->ibuf, vrf_id);
if (ifc == NULL)
return 0;
* bgp_bfd_dest_replay - Replay all the peers that have BFD enabled
* to zebra
*/
-static int bgp_bfd_dest_replay(int command, struct zclient *client,
- zebra_size_t length, vrf_id_t vrf_id)
+static int bgp_bfd_dest_replay(ZAPI_CALLBACK_ARGS)
{
struct listnode *mnode, *node, *nnode;
struct bgp *bgp;
* has changed and bring down the peer
* connectivity if the BFD session went down.
*/
-static int bgp_bfd_dest_update(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int bgp_bfd_dest_update(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
struct prefix dp;
int zclient_num_connects;
/* Router-id update message from zebra. */
-static int bgp_router_id_update(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int bgp_router_id_update(ZAPI_CALLBACK_ARGS)
{
struct prefix router_id;
}
/* Nexthop update message from zebra. */
-static int bgp_read_nexthop_update(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int bgp_read_nexthop_update(ZAPI_CALLBACK_ARGS)
{
- bgp_parse_nexthop_update(command, vrf_id);
+ bgp_parse_nexthop_update(cmd, vrf_id);
return 0;
}
-static int bgp_read_import_check_update(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int bgp_read_import_check_update(ZAPI_CALLBACK_ARGS)
{
- bgp_parse_nexthop_update(command, vrf_id);
+ bgp_parse_nexthop_update(cmd, vrf_id);
return 0;
}
}
/* Inteface addition message from zebra. */
-static int bgp_interface_add(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int bgp_interface_add(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
struct bgp *bgp;
return 0;
}
-static int bgp_interface_delete(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int bgp_interface_delete(ZAPI_CALLBACK_ARGS)
{
struct stream *s;
struct interface *ifp;
return 0;
}
-static int bgp_interface_up(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int bgp_interface_up(ZAPI_CALLBACK_ARGS)
{
struct stream *s;
struct interface *ifp;
return 0;
}
-static int bgp_interface_down(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int bgp_interface_down(ZAPI_CALLBACK_ARGS)
{
struct stream *s;
struct interface *ifp;
return 0;
}
-static int bgp_interface_address_add(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int bgp_interface_address_add(ZAPI_CALLBACK_ARGS)
{
struct connected *ifc;
struct bgp *bgp;
bgp = bgp_lookup_by_vrf_id(vrf_id);
- ifc = zebra_interface_address_read(command, zclient->ibuf, vrf_id);
+ ifc = zebra_interface_address_read(cmd, zclient->ibuf, vrf_id);
if (ifc == NULL)
return 0;
return 0;
}
-static int bgp_interface_address_delete(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int bgp_interface_address_delete(ZAPI_CALLBACK_ARGS)
{
struct connected *ifc;
struct bgp *bgp;
bgp = bgp_lookup_by_vrf_id(vrf_id);
- ifc = zebra_interface_address_read(command, zclient->ibuf, vrf_id);
+ ifc = zebra_interface_address_read(cmd, zclient->ibuf, vrf_id);
if (ifc == NULL)
return 0;
return 0;
}
-static int bgp_interface_nbr_address_add(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int bgp_interface_nbr_address_add(ZAPI_CALLBACK_ARGS)
{
struct nbr_connected *ifc = NULL;
struct bgp *bgp;
- ifc = zebra_interface_nbr_address_read(command, zclient->ibuf, vrf_id);
+ ifc = zebra_interface_nbr_address_read(cmd, zclient->ibuf, vrf_id);
if (ifc == NULL)
return 0;
return 0;
}
-static int bgp_interface_nbr_address_delete(int command,
- struct zclient *zclient,
- zebra_size_t length,
- vrf_id_t vrf_id)
+static int bgp_interface_nbr_address_delete(ZAPI_CALLBACK_ARGS)
{
struct nbr_connected *ifc = NULL;
struct bgp *bgp;
- ifc = zebra_interface_nbr_address_read(command, zclient->ibuf, vrf_id);
+ ifc = zebra_interface_nbr_address_read(cmd, zclient->ibuf, vrf_id);
if (ifc == NULL)
return 0;
}
/* VRF update for an interface. */
-static int bgp_interface_vrf_update(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int bgp_interface_vrf_update(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
vrf_id_t new_vrf_id;
}
/* Zebra route add and delete treatment. */
-static int zebra_read_route(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int zebra_read_route(ZAPI_CALLBACK_ARGS)
{
enum nexthop_types_t nhtype;
struct zapi_route api;
ifindex = api.nexthops[0].ifindex;
nhtype = api.nexthops[0].type;
- add = (command == ZEBRA_REDISTRIBUTE_ROUTE_ADD);
+ add = (cmd == ZEBRA_REDISTRIBUTE_ROUTE_ADD);
if (add) {
/*
* The ADD message is actually an UPDATE and there is no
return zclient_send_message(zclient);
}
-static int rule_notify_owner(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int rule_notify_owner(ZAPI_CALLBACK_ARGS)
{
uint32_t seqno, priority, unique;
enum zapi_rule_notify_owner note;
return 0;
}
-static int ipset_notify_owner(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int ipset_notify_owner(ZAPI_CALLBACK_ARGS)
{
uint32_t unique;
enum zapi_ipset_notify_owner note;
return 0;
}
-static int ipset_entry_notify_owner(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int ipset_entry_notify_owner(ZAPI_CALLBACK_ARGS)
{
uint32_t unique;
char ipset_name[ZEBRA_IPSET_NAME_SIZE];
return 0;
}
-static int iptable_notify_owner(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int iptable_notify_owner(ZAPI_CALLBACK_ARGS)
{
uint32_t unique;
enum zapi_iptable_notify_owner note;
/* this function is used to forge ip rule,
* - either for iptable/ipset using fwmark id
- * - or for sample ip rule command
+ * - or for sample ip rule cmd
*/
static void bgp_encode_pbr_rule_action(struct stream *s,
struct bgp_pbr_action *pbra,
*/
}
-static int bgp_zebra_process_local_es(int cmd, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int bgp_zebra_process_local_es(ZAPI_CALLBACK_ARGS)
{
esi_t esi;
struct bgp *bgp = NULL;
return 0;
}
-static int bgp_zebra_process_local_l3vni(int cmd, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int bgp_zebra_process_local_l3vni(ZAPI_CALLBACK_ARGS)
{
int filter = 0;
char buf[ETHER_ADDR_STRLEN];
return 0;
}
-static int bgp_zebra_process_local_vni(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int bgp_zebra_process_local_vni(ZAPI_CALLBACK_ARGS)
{
struct stream *s;
vni_t vni;
s = zclient->ibuf;
vni = stream_getl(s);
- if (command == ZEBRA_VNI_ADD) {
+ if (cmd == ZEBRA_VNI_ADD) {
vtep_ip.s_addr = stream_get_ipv4(s);
stream_get(&tenant_vrf_id, s, sizeof(vrf_id_t));
mcast_grp.s_addr = stream_get_ipv4(s);
if (BGP_DEBUG(zebra, ZEBRA))
zlog_debug("Rx VNI %s VRF %s VNI %u tenant-vrf %s",
- (command == ZEBRA_VNI_ADD) ? "add" : "del",
+ (cmd == ZEBRA_VNI_ADD) ? "add" : "del",
vrf_id_to_name(vrf_id), vni,
vrf_id_to_name(tenant_vrf_id));
- if (command == ZEBRA_VNI_ADD)
+ if (cmd == ZEBRA_VNI_ADD)
return bgp_evpn_local_vni_add(
bgp, vni, vtep_ip.s_addr ? vtep_ip : bgp->router_id,
tenant_vrf_id, mcast_grp);
return bgp_evpn_local_vni_del(bgp, vni);
}
-static int bgp_zebra_process_local_macip(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int bgp_zebra_process_local_macip(ZAPI_CALLBACK_ARGS)
{
struct stream *s;
vni_t vni;
&& ipa_len != IPV6_MAX_BYTELEN) {
flog_err(EC_BGP_MACIP_LEN,
"%u:Recv MACIP %s with invalid IP addr length %d",
- vrf_id, (command == ZEBRA_MACIP_ADD) ? "Add" : "Del",
+ vrf_id, (cmd == ZEBRA_MACIP_ADD) ? "Add" : "Del",
ipa_len);
return -1;
}
(ipa_len == IPV4_MAX_BYTELEN) ? IPADDR_V4 : IPADDR_V6;
stream_get(&ip.ip.addr, s, ipa_len);
}
- if (command == ZEBRA_MACIP_ADD) {
+ if (cmd == ZEBRA_MACIP_ADD) {
flags = stream_getc(s);
seqnum = stream_getl(s);
} else {
if (BGP_DEBUG(zebra, ZEBRA))
zlog_debug("%u:Recv MACIP %s flags 0x%x MAC %s IP %s VNI %u seq %u state %d",
- vrf_id, (command == ZEBRA_MACIP_ADD) ? "Add" : "Del",
+ vrf_id, (cmd == ZEBRA_MACIP_ADD) ? "Add" : "Del",
flags, prefix_mac2str(&mac, buf, sizeof(buf)),
ipaddr2str(&ip, buf1, sizeof(buf1)), vni, seqnum,
state);
- if (command == ZEBRA_MACIP_ADD)
+ if (cmd == ZEBRA_MACIP_ADD)
return bgp_evpn_local_macip_add(bgp, vni, &mac, &ip,
flags, seqnum);
else
return bgp_evpn_local_macip_del(bgp, vni, &mac, &ip, state);
}
-static void bgp_zebra_process_local_ip_prefix(int cmd, struct zclient *zclient,
- zebra_size_t length,
- vrf_id_t vrf_id)
+static void bgp_zebra_process_local_ip_prefix(ZAPI_CALLBACK_ARGS)
{
struct stream *s = NULL;
struct bgp *bgp_vrf = NULL;
}
}
-static void bgp_zebra_process_label_chunk(
- int cmd,
- struct zclient *zclient,
- zebra_size_t length,
- vrf_id_t vrf_id)
+static void bgp_zebra_process_label_chunk(ZAPI_CALLBACK_ARGS)
{
struct stream *s = NULL;
uint8_t response_keep;
*
* Assumes 1 nexthop
*/
-static int vnc_zebra_read_route(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int vnc_zebra_read_route(ZAPI_CALLBACK_ARGS)
{
struct zapi_route api;
int add;
if (CHECK_FLAG(api.message, ZAPI_MESSAGE_SRCPFX))
return 0;
- add = (command == ZEBRA_REDISTRIBUTE_ROUTE_ADD);
+ add = (cmd == ZEBRA_REDISTRIBUTE_ROUTE_ADD);
if (add)
vnc_redistribute_add(&api.prefix, api.metric, api.type);
else
#include "eigrpd/eigrp_topology.h"
#include "eigrpd/eigrp_fsm.h"
-static int eigrp_interface_add(int, struct zclient *, zebra_size_t, vrf_id_t);
-static int eigrp_interface_delete(int, struct zclient *, zebra_size_t,
- vrf_id_t);
-static int eigrp_interface_address_add(int, struct zclient *, zebra_size_t,
- vrf_id_t vrf_id);
-static int eigrp_interface_address_delete(int, struct zclient *, zebra_size_t,
- vrf_id_t vrf_id);
-static int eigrp_interface_state_up(int, struct zclient *, zebra_size_t,
- vrf_id_t vrf_id);
-static int eigrp_interface_state_down(int, struct zclient *, zebra_size_t,
- vrf_id_t vrf_id);
+static int eigrp_interface_add(ZAPI_CALLBACK_ARGS);
+static int eigrp_interface_delete(ZAPI_CALLBACK_ARGS);
+static int eigrp_interface_address_add(ZAPI_CALLBACK_ARGS);
+static int eigrp_interface_address_delete(ZAPI_CALLBACK_ARGS);
+static int eigrp_interface_state_up(ZAPI_CALLBACK_ARGS);
+static int eigrp_interface_state_down(ZAPI_CALLBACK_ARGS);
static struct interface *zebra_interface_if_lookup(struct stream *);
-static int eigrp_zebra_read_route(int, struct zclient *, zebra_size_t,
- vrf_id_t vrf_id);
+static int eigrp_zebra_read_route(ZAPI_CALLBACK_ARGS);
/* Zebra structure to hold current status. */
struct zclient *zclient = NULL;
struct in_addr router_id_zebra;
/* Router-id update message from zebra. */
-static int eigrp_router_id_update_zebra(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int eigrp_router_id_update_zebra(ZAPI_CALLBACK_ARGS)
{
struct eigrp *eigrp;
struct prefix router_id;
return 0;
}
-static int eigrp_zebra_route_notify_owner(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int eigrp_zebra_route_notify_owner(ZAPI_CALLBACK_ARGS)
{
struct prefix p;
enum zapi_route_notify_owner note;
/* Zebra route add and delete treatment. */
-static int eigrp_zebra_read_route(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int eigrp_zebra_read_route(ZAPI_CALLBACK_ARGS)
{
struct zapi_route api;
struct eigrp *eigrp;
if (eigrp == NULL)
return 0;
- if (command == ZEBRA_REDISTRIBUTE_ROUTE_ADD) {
+ if (cmd == ZEBRA_REDISTRIBUTE_ROUTE_ADD) {
- } else /* if (command == ZEBRA_REDISTRIBUTE_ROUTE_DEL) */
+ } else /* if (cmd == ZEBRA_REDISTRIBUTE_ROUTE_DEL) */
{
}
}
/* Inteface addition message from zebra. */
-static int eigrp_interface_add(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int eigrp_interface_add(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
struct eigrp_interface *ei;
return 0;
}
-static int eigrp_interface_delete(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int eigrp_interface_delete(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
struct stream *s;
return 0;
}
-static int eigrp_interface_address_add(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int eigrp_interface_address_add(ZAPI_CALLBACK_ARGS)
{
struct connected *c;
- c = zebra_interface_address_read(command, zclient->ibuf, vrf_id);
+ c = zebra_interface_address_read(cmd, zclient->ibuf, vrf_id);
if (c == NULL)
return 0;
return 0;
}
-static int eigrp_interface_address_delete(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int eigrp_interface_address_delete(ZAPI_CALLBACK_ARGS)
{
struct connected *c;
struct interface *ifp;
struct eigrp_interface *ei;
- c = zebra_interface_address_read(command, zclient->ibuf, vrf_id);
+ c = zebra_interface_address_read(cmd, zclient->ibuf, vrf_id);
if (c == NULL)
return 0;
return 0;
}
-static int eigrp_interface_state_up(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int eigrp_interface_state_up(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
return 0;
}
-static int eigrp_interface_state_down(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int eigrp_interface_state_down(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
isis_adj_state_change(adj, ISIS_ADJ_DOWN, "bfd session went down");
}
-static int isis_bfd_interface_dest_update(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int isis_bfd_interface_dest_update(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
struct prefix dst_ip;
return 0;
}
-static int isis_bfd_nbr_replay(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int isis_bfd_nbr_replay(ZAPI_CALLBACK_ARGS)
{
bfd_client_sendmsg(zclient, ZEBRA_BFD_CLIENT_REGISTER);
struct zclient *zclient = NULL;
/* Router-id update message from zebra. */
-static int isis_router_id_update_zebra(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int isis_router_id_update_zebra(ZAPI_CALLBACK_ARGS)
{
struct isis_area *area;
struct listnode *node;
return 0;
}
-static int isis_zebra_if_add(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int isis_zebra_if_add(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
return 0;
}
-static int isis_zebra_if_del(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int isis_zebra_if_del(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
struct stream *s;
return 0;
}
-static int isis_zebra_if_state_up(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int isis_zebra_if_state_up(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
return 0;
}
-static int isis_zebra_if_state_down(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int isis_zebra_if_state_down(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
struct isis_circuit *circuit;
return 0;
}
-static int isis_zebra_if_address_add(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int isis_zebra_if_address_add(ZAPI_CALLBACK_ARGS)
{
struct connected *c;
struct prefix *p;
return 0;
}
-static int isis_zebra_if_address_del(int command, struct zclient *client,
- zebra_size_t length, vrf_id_t vrf_id)
+static int isis_zebra_if_address_del(ZAPI_CALLBACK_ARGS)
{
struct connected *c;
struct interface *ifp;
return 0;
}
-static int isis_zebra_link_params(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int isis_zebra_link_params(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
isis_zebra_route_del_route(prefix, src_p, route_info);
}
-static int isis_zebra_read(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int isis_zebra_read(ZAPI_CALLBACK_ARGS)
{
struct zapi_route api;
if (api.prefix.prefixlen == 0
&& api.src_prefix.prefixlen == 0
&& api.type == PROTO_TYPE) {
- command = ZEBRA_REDISTRIBUTE_ROUTE_DEL;
+ cmd = ZEBRA_REDISTRIBUTE_ROUTE_DEL;
}
- if (command == ZEBRA_REDISTRIBUTE_ROUTE_ADD)
+ if (cmd == ZEBRA_REDISTRIBUTE_ROUTE_ADD)
isis_redist_add(api.type, &api.prefix, &api.src_prefix,
api.distance, api.metric);
else
static void ifc2kaddr(struct interface *, struct connected *,
struct kaddr *);
static int zebra_send_mpls_labels(int, struct kroute *);
-static int ldp_router_id_update(int, struct zclient *, zebra_size_t,
- vrf_id_t);
-static int ldp_interface_add(int, struct zclient *, zebra_size_t,
- vrf_id_t);
-static int ldp_interface_delete(int, struct zclient *, zebra_size_t,
- vrf_id_t);
-static int ldp_interface_status_change(int command, struct zclient *,
- zebra_size_t, vrf_id_t);
-static int ldp_interface_address_add(int, struct zclient *, zebra_size_t,
- vrf_id_t);
-static int ldp_interface_address_delete(int, struct zclient *,
- zebra_size_t, vrf_id_t);
-static int ldp_zebra_read_route(int, struct zclient *, zebra_size_t,
- vrf_id_t);
-static int ldp_zebra_read_pw_status_update(int, struct zclient *,
- zebra_size_t, vrf_id_t);
+static int ldp_router_id_update(ZAPI_CALLBACK_ARGS);
+static int ldp_interface_add(ZAPI_CALLBACK_ARGS);
+static int ldp_interface_delete(ZAPI_CALLBACK_ARGS);
+static int ldp_interface_status_change(ZAPI_CALLBACK_ARGS);
+static int ldp_interface_address_add(ZAPI_CALLBACK_ARGS);
+static int ldp_interface_address_delete(ZAPI_CALLBACK_ARGS);
+static int ldp_zebra_read_route(ZAPI_CALLBACK_ARGS);
+static int ldp_zebra_read_pw_status_update(ZAPI_CALLBACK_ARGS);
static void ldp_zebra_connected(struct zclient *);
static struct zclient *zclient;
}
static int
-ldp_router_id_update(int command, struct zclient *zclient, zebra_size_t length,
- vrf_id_t vrf_id)
+ldp_router_id_update(ZAPI_CALLBACK_ARGS)
{
struct prefix router_id;
}
static int
-ldp_interface_add(int command, struct zclient *zclient, zebra_size_t length,
- vrf_id_t vrf_id)
+ldp_interface_add(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
struct kif kif;
}
static int
-ldp_interface_delete(int command, struct zclient *zclient, zebra_size_t length,
- vrf_id_t vrf_id)
+ldp_interface_delete(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
struct kif kif;
}
static int
-ldp_interface_status_change(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+ldp_interface_status_change(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
struct listnode *node;
}
static int
-ldp_interface_address_add(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+ldp_interface_address_add(ZAPI_CALLBACK_ARGS)
{
struct connected *ifc;
struct interface *ifp;
struct kaddr ka;
- ifc = zebra_interface_address_read(command, zclient->ibuf, vrf_id);
+ ifc = zebra_interface_address_read(cmd, zclient->ibuf, vrf_id);
if (ifc == NULL)
return (0);
}
static int
-ldp_interface_address_delete(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+ldp_interface_address_delete(ZAPI_CALLBACK_ARGS)
{
struct connected *ifc;
struct interface *ifp;
struct kaddr ka;
- ifc = zebra_interface_address_read(command, zclient->ibuf, vrf_id);
+ ifc = zebra_interface_address_read(cmd, zclient->ibuf, vrf_id);
if (ifc == NULL)
return (0);
}
static int
-ldp_zebra_read_route(int command, struct zclient *zclient, zebra_size_t length,
- vrf_id_t vrf_id)
+ldp_zebra_read_route(ZAPI_CALLBACK_ARGS)
{
struct zapi_route api;
struct zapi_nexthop *api_nh;
(kr.af == AF_INET6 && IN6_IS_SCOPE_EMBED(&kr.prefix.v6)))
return (0);
- if (command == ZEBRA_REDISTRIBUTE_ROUTE_ADD)
+ if (cmd == ZEBRA_REDISTRIBUTE_ROUTE_ADD)
add = 1;
if (api.nexthop_num == 0)
* Receive PW status update from Zebra and send it to LDE process.
*/
static int
-ldp_zebra_read_pw_status_update(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+ldp_zebra_read_pw_status_update(ZAPI_CALLBACK_ARGS)
{
struct zapi_pw_status zpw;
- zebra_read_pw_status_update(command, zclient, length, vrf_id, &zpw);
+ zebra_read_pw_status_update(cmd, zclient, length, vrf_id, &zpw);
debug_zebra_in("pseudowire %s status %s", zpw.ifname,
(zpw.status == PW_STATUS_UP) ? "up" : "down");
/*
* Receive PW status update from Zebra and send it to LDE process.
*/
-void zebra_read_pw_status_update(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id,
- struct zapi_pw_status *pw)
+void zebra_read_pw_status_update(ZAPI_CALLBACK_ARGS, struct zapi_pw_status *pw)
{
struct stream *s;
pw->status = stream_getl(s);
}
-static void zclient_capability_decode(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static void zclient_capability_decode(ZAPI_CALLBACK_ARGS)
{
struct zclient_capabilities cap;
struct stream *s = zclient->ibuf;
extern int zebra_send_pw(struct zclient *zclient, int command,
struct zapi_pw *pw);
-extern void zebra_read_pw_status_update(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id,
- struct zapi_pw_status *pw);
+extern void zebra_read_pw_status_update(ZAPI_CALLBACK_ARGS, struct zapi_pw_status *pw);
extern int zclient_route_send(uint8_t, struct zclient *, struct zapi_route *);
extern int zclient_send_rnh(struct zclient *zclient, int command,
}
}
-int nhrp_interface_add(int cmd, struct zclient *client, zebra_size_t length,
- vrf_id_t vrf_id)
+int nhrp_interface_add(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
/* read and add the interface in the iflist. */
- ifp = zebra_interface_add_read(client->ibuf, vrf_id);
+ ifp = zebra_interface_add_read(zclient->ibuf, vrf_id);
if (ifp == NULL)
return 0;
return 0;
}
-int nhrp_interface_delete(int cmd, struct zclient *client, zebra_size_t length,
- vrf_id_t vrf_id)
+int nhrp_interface_delete(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
struct stream *s;
- s = client->ibuf;
+ s = zclient->ibuf;
ifp = zebra_interface_state_read(s, vrf_id);
if (ifp == NULL)
return 0;
return 0;
}
-int nhrp_interface_up(int cmd, struct zclient *client, zebra_size_t length,
- vrf_id_t vrf_id)
+int nhrp_interface_up(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
- ifp = zebra_interface_state_read(client->ibuf, vrf_id);
+ ifp = zebra_interface_state_read(zclient->ibuf, vrf_id);
if (ifp == NULL)
return 0;
return 0;
}
-int nhrp_interface_down(int cmd, struct zclient *client, zebra_size_t length,
- vrf_id_t vrf_id)
+int nhrp_interface_down(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
- ifp = zebra_interface_state_read(client->ibuf, vrf_id);
+ ifp = zebra_interface_state_read(zclient->ibuf, vrf_id);
if (ifp == NULL)
return 0;
return 0;
}
-int nhrp_interface_address_add(int cmd, struct zclient *client,
- zebra_size_t length, vrf_id_t vrf_id)
+int nhrp_interface_address_add(ZAPI_CALLBACK_ARGS)
{
struct connected *ifc;
char buf[PREFIX_STRLEN];
- ifc = zebra_interface_address_read(cmd, client->ibuf, vrf_id);
+ ifc = zebra_interface_address_read(cmd, zclient->ibuf, vrf_id);
if (ifc == NULL)
return 0;
return 0;
}
-int nhrp_interface_address_delete(int cmd, struct zclient *client,
- zebra_size_t length, vrf_id_t vrf_id)
+int nhrp_interface_address_delete(ZAPI_CALLBACK_ARGS)
{
struct connected *ifc;
char buf[PREFIX_STRLEN];
- ifc = zebra_interface_address_read(cmd, client->ibuf, vrf_id);
+ ifc = zebra_interface_address_read(cmd, zclient->ibuf, vrf_id);
if (ifc == NULL)
return 0;
&api);
}
-int nhrp_route_read(int cmd, struct zclient *zclient, zebra_size_t length,
- vrf_id_t vrf_id)
+int nhrp_route_read(ZAPI_CALLBACK_ARGS)
{
struct zapi_route api;
struct zapi_nexthop *api_nh;
void nhrp_interface_update(struct interface *ifp);
void nhrp_interface_update_mtu(struct interface *ifp, afi_t afi);
-int nhrp_interface_add(int cmd, struct zclient *client, zebra_size_t length,
- vrf_id_t vrf_id);
-int nhrp_interface_delete(int cmd, struct zclient *client, zebra_size_t length,
- vrf_id_t vrf_id);
-int nhrp_interface_up(int cmd, struct zclient *client, zebra_size_t length,
- vrf_id_t vrf_id);
-int nhrp_interface_down(int cmd, struct zclient *client, zebra_size_t length,
- vrf_id_t vrf_id);
-int nhrp_interface_address_add(int cmd, struct zclient *client,
- zebra_size_t length, vrf_id_t vrf_id);
-int nhrp_interface_address_delete(int cmd, struct zclient *client,
- zebra_size_t length, vrf_id_t vrf_id);
+int nhrp_interface_add(ZAPI_CALLBACK_ARGS);
+int nhrp_interface_delete(ZAPI_CALLBACK_ARGS);
+int nhrp_interface_up(ZAPI_CALLBACK_ARGS);
+int nhrp_interface_down(ZAPI_CALLBACK_ARGS);
+int nhrp_interface_address_add(ZAPI_CALLBACK_ARGS);
+int nhrp_interface_address_delete(ZAPI_CALLBACK_ARGS);
void nhrp_interface_notify_add(struct interface *ifp, struct notifier_block *n,
notifier_fn_t fn);
void nhrp_route_announce(int add, enum nhrp_cache_type type,
const struct prefix *p, struct interface *ifp,
const union sockunion *nexthop, uint32_t mtu);
-int nhrp_route_read(int command, struct zclient *zclient, zebra_size_t length,
- vrf_id_t vrf_id);
+int nhrp_route_read(ZAPI_CALLBACK_ARGS);
int nhrp_route_get_nexthop(const union sockunion *addr, struct prefix *p,
union sockunion *via, struct interface **ifp);
enum nhrp_route_type nhrp_route_address(struct interface *in_ifp,
* ospf6_bfd_nbr_replay - Replay all the neighbors that have BFD enabled
* to zebra
*/
-static int ospf6_bfd_nbr_replay(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int ospf6_bfd_nbr_replay(ZAPI_CALLBACK_ARGS)
{
struct vrf *vrf = vrf_lookup_by_id(VRF_DEFAULT);
struct listnode *node;
* has changed and bring down the neighbor
* connectivity if BFD down is received.
*/
-static int ospf6_bfd_interface_dest_update(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int ospf6_bfd_interface_dest_update(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
struct ospf6_interface *oi;
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;
}
/* 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)
+static int ospf6_zebra_if_add(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
return 0;
}
-static int ospf6_zebra_if_del(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int ospf6_zebra_if_del(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
return 0;
}
-static int ospf6_zebra_if_state_update(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int ospf6_zebra_if_state_update(ZAPI_CALLBACK_ARGS)
{
struct interface *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];
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
* ospf_bfd_nbr_replay - Replay all the neighbors that have BFD enabled
* to zebra
*/
-static int ospf_bfd_nbr_replay(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int ospf_bfd_nbr_replay(ZAPI_CALLBACK_ARGS)
{
struct listnode *inode, *node, *onode;
struct ospf *ospf;
* connectivity if the BFD status changed to
* down.
*/
-static int ospf_bfd_interface_dest_update(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int ospf_bfd_interface_dest_update(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
struct ospf_interface *oi;
extern struct thread_master *master;
/* Router-id update message from zebra. */
-static int ospf_router_id_update_zebra(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int ospf_router_id_update_zebra(ZAPI_CALLBACK_ARGS)
{
struct ospf *ospf = NULL;
struct prefix router_id;
}
/* Inteface addition message from zebra. */
-static int ospf_interface_add(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int ospf_interface_add(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp = NULL;
struct ospf *ospf = NULL;
return 0;
}
-static int ospf_interface_delete(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int ospf_interface_delete(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
struct stream *s;
return if_lookup_by_name(ifname_tmp, vrf_id);
}
-static int ospf_interface_state_up(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int ospf_interface_state_up(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
struct ospf_interface *oi;
return 0;
}
-static int ospf_interface_state_down(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int ospf_interface_state_down(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
struct ospf_interface *oi;
return 0;
}
-static int ospf_interface_address_add(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int ospf_interface_address_add(ZAPI_CALLBACK_ARGS)
{
struct connected *c;
struct ospf *ospf = NULL;
- c = zebra_interface_address_read(command, zclient->ibuf, vrf_id);
+ c = zebra_interface_address_read(cmd, zclient->ibuf, vrf_id);
if (c == NULL)
return 0;
return 0;
}
-static int ospf_interface_address_delete(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int ospf_interface_address_delete(ZAPI_CALLBACK_ARGS)
{
struct connected *c;
struct interface *ifp;
struct route_node *rn;
struct prefix p;
- c = zebra_interface_address_read(command, zclient->ibuf, vrf_id);
+ c = zebra_interface_address_read(cmd, zclient->ibuf, vrf_id);
if (c == NULL)
return 0;
return 0;
}
-static int ospf_interface_link_params(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int ospf_interface_link_params(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
}
/* VRF update for an interface. */
-static int ospf_interface_vrf_update(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int ospf_interface_vrf_update(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp = NULL;
vrf_id_t new_vrf_id;
}
/* Zebra route add and delete treatment. */
-static int ospf_zebra_read_route(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int ospf_zebra_read_route(ZAPI_CALLBACK_ARGS)
{
struct zapi_route api;
struct prefix_ipv4 p;
zebra_route_string(api.type), vrf_id, buf_prefix);
}
- if (command == ZEBRA_REDISTRIBUTE_ROUTE_ADD) {
+ if (cmd == ZEBRA_REDISTRIBUTE_ROUTE_ADD) {
/* XXX|HACK|TODO|FIXME:
* Maybe we should ignore reject/blackhole routes? Testing
* shows that there is no problems though and this is only way
}
}
}
- } else /* if (command == ZEBRA_REDISTRIBUTE_ROUTE_DEL) */
+ } else /* if (cmd == ZEBRA_REDISTRIBUTE_ROUTE_DEL) */
{
ospf_external_info_delete(ospf, rt_type, api.instance, p);
if (is_prefix_default(&p))
}
/* Inteface addition message from zebra. */
-static int interface_add(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int interface_add(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
return 0;
}
-static int interface_delete(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int interface_delete(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
struct stream *s;
return 0;
}
-static int interface_address_add(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int interface_address_add(ZAPI_CALLBACK_ARGS)
{
struct connected *c;
char buf[PREFIX_STRLEN];
- c = zebra_interface_address_read(command, zclient->ibuf, vrf_id);
+ c = zebra_interface_address_read(cmd, zclient->ibuf, vrf_id);
DEBUGD(&pbr_dbg_zebra,
"%s: %s added %s", __PRETTY_FUNCTION__, c->ifp->name,
return 0;
}
-static int interface_address_delete(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int interface_address_delete(ZAPI_CALLBACK_ARGS)
{
struct connected *c;
char buf[PREFIX_STRLEN];
- c = zebra_interface_address_read(command, zclient->ibuf, vrf_id);
+ c = zebra_interface_address_read(cmd, zclient->ibuf, vrf_id);
if (!c)
return 0;
return 0;
}
-static int interface_state_up(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int interface_state_up(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
return 0;
}
-static int interface_state_down(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int interface_state_down(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
return 0;
}
-static int route_notify_owner(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int route_notify_owner(ZAPI_CALLBACK_ARGS)
{
struct prefix p;
enum zapi_route_notify_owner note;
return 0;
}
-static int rule_notify_owner(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int rule_notify_owner(ZAPI_CALLBACK_ARGS)
{
uint32_t seqno, priority, unique;
enum zapi_rule_notify_owner note;
}
}
-static int pbr_zebra_nexthop_update(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int pbr_zebra_nexthop_update(ZAPI_CALLBACK_ARGS)
{
struct zapi_route nhr;
char buf[PREFIX2STR_BUFFER];
* connectivity if the BFD status changed to
* down.
*/
-static int pim_bfd_interface_dest_update(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int pim_bfd_interface_dest_update(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp = NULL;
struct pim_interface *pim_ifp = NULL;
* pim_bfd_nbr_replay - Replay all the neighbors that have BFD enabled
* to zebra
*/
-static int pim_bfd_nbr_replay(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int pim_bfd_nbr_replay(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp = NULL;
struct pim_interface *pim_ifp = NULL;
/* This API is used to parse Registered address nexthop update coming from Zebra
*/
-int pim_parse_nexthop_update(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+int pim_parse_nexthop_update(ZAPI_CALLBACK_ARGS)
{
struct nexthop *nexthop;
struct nexthop *nhlist_head = NULL;
return 0;
}
- if (command == ZEBRA_NEXTHOP_UPDATE) {
+ if (cmd == ZEBRA_NEXTHOP_UPDATE) {
prefix_copy(&rpf.rpf_addr, &nhr.prefix);
pnc = pim_nexthop_cache_find(pim, &rpf);
if (!pnc) {
struct hash *upstream_hash;
};
-int pim_parse_nexthop_update(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id);
+int pim_parse_nexthop_update(ZAPI_CALLBACK_ARGS);
int pim_find_or_track_nexthop(struct pim_instance *pim, struct prefix *addr,
struct pim_upstream *up, struct rp_info *rp,
struct pim_nexthop_cache *out_pnc);
/* Router-id update message from zebra. */
-static int pim_router_id_update_zebra(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int pim_router_id_update_zebra(ZAPI_CALLBACK_ARGS)
{
struct prefix router_id;
return 0;
}
-static int pim_zebra_if_add(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int pim_zebra_if_add(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
struct pim_instance *pim;
return 0;
}
-static int pim_zebra_if_del(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int pim_zebra_if_del(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
struct pim_instance *pim;
return 0;
}
-static int pim_zebra_if_state_up(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int pim_zebra_if_state_up(ZAPI_CALLBACK_ARGS)
{
struct pim_instance *pim;
struct interface *ifp;
return 0;
}
-static int pim_zebra_if_state_down(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int pim_zebra_if_state_down(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
return 0;
}
-static int pim_zebra_interface_vrf_update(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int pim_zebra_interface_vrf_update(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
vrf_id_t new_vrf_id;
}
#endif
-static int pim_zebra_if_address_add(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int pim_zebra_if_address_add(ZAPI_CALLBACK_ARGS)
{
struct connected *c;
struct prefix *p;
will add address to interface list by calling
connected_add_by_prefix()
*/
- c = zebra_interface_address_read(command, zclient->ibuf, vrf_id);
+ c = zebra_interface_address_read(cmd, zclient->ibuf, vrf_id);
if (!c)
return 0;
return 0;
}
-static int pim_zebra_if_address_del(int command, struct zclient *client,
- zebra_size_t length, vrf_id_t vrf_id)
+static int pim_zebra_if_address_del(ZAPI_CALLBACK_ARGS)
{
struct connected *c;
struct prefix *p;
will remove address from interface list by calling
connected_delete_by_prefix()
*/
- c = zebra_interface_address_read(command, client->ibuf, vrf_id);
+ c = zebra_interface_address_read(cmd, zclient->ibuf, vrf_id);
if (!c)
return 0;
pim_upstream_update_join_desired(pim, up);
}
-static int pim_zebra_vxlan_sg_proc(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int pim_zebra_vxlan_sg_proc(ZAPI_CALLBACK_ARGS)
{
struct stream *s;
struct pim_instance *pim;
pim_str_sg_set(&sg, sg_str);
zlog_debug("%u:recv SG %s %s", vrf_id,
- (command == ZEBRA_VXLAN_SG_ADD)?"add":"del",
+ (cmd == ZEBRA_VXLAN_SG_ADD)?"add":"del",
sg_str);
}
- if (command == ZEBRA_VXLAN_SG_ADD)
+ if (cmd == ZEBRA_VXLAN_SG_ADD)
pim_vxlan_sg_add(pim, &sg);
else
pim_vxlan_sg_del(pim, &sg);
}
/* Inteface link down message processing. */
-int rip_interface_down(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+int rip_interface_down(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
struct stream *s;
}
/* Inteface link up message processing */
-int rip_interface_up(int command, struct zclient *zclient, zebra_size_t length,
- vrf_id_t vrf_id)
+int rip_interface_up(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
}
/* Inteface addition message from zebra. */
-int rip_interface_add(int command, struct zclient *zclient, zebra_size_t length,
- vrf_id_t vrf_id)
+int rip_interface_add(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
return 0;
}
-int rip_interface_delete(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+int rip_interface_delete(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
struct stream *s;
}
/* VRF update for an interface. */
-int rip_interface_vrf_update(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+int rip_interface_vrf_update(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
vrf_id_t new_vrf_id;
0);
}
-int rip_interface_address_add(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+int rip_interface_address_add(ZAPI_CALLBACK_ARGS)
{
struct connected *ifc;
struct prefix *p;
&address, ifc->ifp->ifindex);
}
-int rip_interface_address_delete(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+int rip_interface_address_delete(ZAPI_CALLBACK_ARGS)
{
struct connected *ifc;
struct prefix *p;
vrf_id_t);
extern int rip_interface_address_delete(int, struct zclient *, zebra_size_t,
vrf_id_t);
-extern int rip_interface_vrf_update(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id);
+extern int rip_interface_vrf_update(ZAPI_CALLBACK_ARGS);
extern void rip_interface_sync(struct interface *ifp);
#endif /* _QUAGGA_RIP_INTERFACE_H */
}
/* Zebra route add and delete treatment. */
-static int rip_zebra_read_route(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int rip_zebra_read_route(ZAPI_CALLBACK_ARGS)
{
struct rip *rip;
struct zapi_route api;
nh.ifindex = api.nexthops[0].ifindex;
/* Then fetch IPv4 prefixes. */
- if (command == ZEBRA_REDISTRIBUTE_ROUTE_ADD)
+ if (cmd == ZEBRA_REDISTRIBUTE_ROUTE_ADD)
rip_redistribute_add(rip, api.type, RIP_ROUTE_REDISTRIBUTE,
(struct prefix_ipv4 *)&api.prefix, &nh,
api.metric, api.distance, api.tag);
- else if (command == ZEBRA_REDISTRIBUTE_ROUTE_DEL)
+ else if (cmd == ZEBRA_REDISTRIBUTE_ROUTE_DEL)
rip_redistribute_delete(rip, api.type, RIP_ROUTE_REDISTRIBUTE,
(struct prefix_ipv4 *)&api.prefix,
nh.ifindex);
}
/* Inteface link up message processing. */
-int ripng_interface_up(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+int ripng_interface_up(ZAPI_CALLBACK_ARGS)
{
struct stream *s;
struct interface *ifp;
}
/* Inteface link down message processing. */
-int ripng_interface_down(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+int ripng_interface_down(ZAPI_CALLBACK_ARGS)
{
struct stream *s;
struct interface *ifp;
}
/* Inteface addition message from zebra. */
-int ripng_interface_add(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+int ripng_interface_add(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
return 0;
}
-int ripng_interface_delete(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+int ripng_interface_delete(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
struct stream *s;
}
/* VRF update for an interface. */
-int ripng_interface_vrf_update(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+int ripng_interface_vrf_update(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
vrf_id_t new_vrf_id;
ifc->ifp->ifindex, NULL, 0);
}
-int ripng_interface_address_add(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+int ripng_interface_address_add(ZAPI_CALLBACK_ARGS)
{
struct connected *c;
struct prefix *p;
ifc->ifp->ifindex);
}
-int ripng_interface_address_delete(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+int ripng_interface_address_delete(ZAPI_CALLBACK_ARGS)
{
struct connected *ifc;
struct prefix *p;
}
/* Zebra route add and delete treatment. */
-static int ripng_zebra_read_route(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int ripng_zebra_read_route(ZAPI_CALLBACK_ARGS)
{
struct ripng *ripng;
struct zapi_route api;
nexthop = api.nexthops[0].gate.ipv6;
ifindex = api.nexthops[0].ifindex;
- if (command == ZEBRA_REDISTRIBUTE_ROUTE_ADD)
+ if (cmd == ZEBRA_REDISTRIBUTE_ROUTE_ADD)
ripng_redistribute_add(ripng, api.type,
RIPNG_ROUTE_REDISTRIBUTE,
(struct prefix_ipv6 *)&api.prefix,
extern void ripng_packet_dump(struct ripng_packet *packet, int size,
const char *sndrcv);
-extern int ripng_interface_up(int command, struct zclient *, zebra_size_t,
- vrf_id_t);
-extern int ripng_interface_down(int command, struct zclient *, zebra_size_t,
- vrf_id_t);
-extern int ripng_interface_add(int command, struct zclient *, zebra_size_t,
- vrf_id_t);
-extern int ripng_interface_delete(int command, struct zclient *, zebra_size_t,
- vrf_id_t);
-extern int ripng_interface_address_add(int command, struct zclient *,
- zebra_size_t, vrf_id_t);
-extern int ripng_interface_address_delete(int command, struct zclient *,
- zebra_size_t, vrf_id_t);
-extern int ripng_interface_vrf_update(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id);
+extern int ripng_interface_up(ZAPI_CALLBACK_ARGS);
+extern int ripng_interface_down(ZAPI_CALLBACK_ARGS);
+extern int ripng_interface_add(ZAPI_CALLBACK_ARGS);
+extern int ripng_interface_delete(ZAPI_CALLBACK_ARGS);
+extern int ripng_interface_address_add(ZAPI_CALLBACK_ARGS);
+extern int ripng_interface_address_delete(ZAPI_CALLBACK_ARGS);
+extern int ripng_interface_vrf_update(ZAPI_CALLBACK_ARGS);
extern void ripng_interface_sync(struct interface *ifp);
extern struct ripng *ripng_lookup_by_vrf_id(vrf_id_t vrf_id);
}
/* Inteface addition message from zebra. */
-static int interface_add(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int interface_add(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
return 0;
}
-static int interface_delete(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int interface_delete(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
struct stream *s;
return 0;
}
-static int interface_address_add(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int interface_address_add(ZAPI_CALLBACK_ARGS)
{
- zebra_interface_address_read(command, zclient->ibuf, vrf_id);
+ zebra_interface_address_read(cmd, zclient->ibuf, vrf_id);
return 0;
}
-static int interface_address_delete(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int interface_address_delete(ZAPI_CALLBACK_ARGS)
{
struct connected *c;
- c = zebra_interface_address_read(command, zclient->ibuf, vrf_id);
+ c = zebra_interface_address_read(cmd, zclient->ibuf, vrf_id);
if (!c)
return 0;
return 0;
}
-static int interface_state_up(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int interface_state_up(ZAPI_CALLBACK_ARGS)
{
zebra_interface_if_lookup(zclient->ibuf);
return 0;
}
-static int interface_state_down(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int interface_state_down(ZAPI_CALLBACK_ARGS)
{
zebra_interface_state_read(zclient->ibuf, vrf_id);
}
}
-static int route_notify_owner(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int route_notify_owner(ZAPI_CALLBACK_ARGS)
{
struct timeval r;
struct prefix p;
__PRETTY_FUNCTION__);
}
-static int sharp_nexthop_update(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int sharp_nexthop_update(ZAPI_CALLBACK_ARGS)
{
struct sharp_nh_tracker *nht;
struct zapi_route nhr;
}
/* Inteface addition message from zebra. */
-static int interface_add(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int interface_add(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
return 0;
}
-static int interface_delete(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int interface_delete(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
struct stream *s;
return 0;
}
-static int interface_address_add(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int interface_address_add(ZAPI_CALLBACK_ARGS)
{
- zebra_interface_address_read(command, zclient->ibuf, vrf_id);
+ zebra_interface_address_read(cmd, zclient->ibuf, vrf_id);
return 0;
}
-static int interface_address_delete(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int interface_address_delete(ZAPI_CALLBACK_ARGS)
{
struct connected *c;
- c = zebra_interface_address_read(command, zclient->ibuf, vrf_id);
+ c = zebra_interface_address_read(cmd, zclient->ibuf, vrf_id);
if (!c)
return 0;
return 0;
}
-static int interface_state_up(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int interface_state_up(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
return 0;
}
-static int interface_state_down(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int interface_state_down(ZAPI_CALLBACK_ARGS)
{
zebra_interface_state_read(zclient->ibuf, vrf_id);
return 0;
}
-static int route_notify_owner(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int route_notify_owner(ZAPI_CALLBACK_ARGS)
{
struct prefix p;
enum zapi_route_notify_owner note;
uint8_t nh_num;
};
-static int static_zebra_nexthop_update(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int static_zebra_nexthop_update(ZAPI_CALLBACK_ARGS)
{
struct static_nht_data *nhtd, lookup;
struct zapi_route nhr;