summaryrefslogtreecommitdiffstats
path: root/ripd/rip_zebra.c
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2019-05-03 21:42:59 +0200
committerQuentin Young <qlyoung@cumulusnetworks.com>2019-05-03 22:57:35 +0200
commit121f9dee7ce9f1b1b8a81f8bd97eed39ed87b477 (patch)
tree96db220e5aa1f111be363aafe8f5264a19970fed /ripd/rip_zebra.c
parentlib: define ZAPI_CALLBACK_ARGS macro (diff)
downloadfrr-121f9dee7ce9f1b1b8a81f8bd97eed39ed87b477.tar.xz
frr-121f9dee7ce9f1b1b8a81f8bd97eed39ed87b477.zip
*: use ZAPI_CALLBACK_ARGS macro for zapi handlers
This macro: - Marks ZAPI callbacks for readability - Standardizes argument names - Makes it simple to add ZAPI arguments in the future - Ensures proper types - Looks better - Shortens function declarations Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'ripd/rip_zebra.c')
-rw-r--r--ripd/rip_zebra.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/ripd/rip_zebra.c b/ripd/rip_zebra.c
index 4f0df1223..0c88cb202 100644
--- a/ripd/rip_zebra.c
+++ b/ripd/rip_zebra.c
@@ -118,8 +118,7 @@ void rip_zebra_ipv4_delete(struct rip *rip, struct route_node *rp)
}
/* 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;
@@ -138,11 +137,11 @@ static int rip_zebra_read_route(int command, struct zclient *zclient,
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);