diff options
| author | Quentin Young <qlyoung@cumulusnetworks.com> | 2019-05-03 19:42:59 +0000 |
|---|---|---|
| committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2019-05-03 20:57:35 +0000 |
| commit | 121f9dee7ce9f1b1b8a81f8bd97eed39ed87b477 (patch) | |
| tree | 96db220e5aa1f111be363aafe8f5264a19970fed /ripngd/ripng_interface.c | |
| parent | 6c33ca975ab61a869cc70fa64c0a10bcc6bc1e0d (diff) | |
*: 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 'ripngd/ripng_interface.c')
| -rw-r--r-- | ripngd/ripng_interface.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/ripngd/ripng_interface.c b/ripngd/ripng_interface.c index e35652b1ac..5a4087b177 100644 --- a/ripngd/ripng_interface.c +++ b/ripngd/ripng_interface.c @@ -193,8 +193,7 @@ static int ripng_if_down(struct interface *ifp) } /* 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; @@ -228,8 +227,7 @@ int ripng_interface_up(int command, struct zclient *zclient, } /* 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; @@ -255,8 +253,7 @@ int ripng_interface_down(int command, struct zclient *zclient, } /* 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; @@ -281,8 +278,7 @@ int ripng_interface_add(int command, struct zclient *zclient, 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; @@ -313,8 +309,7 @@ int ripng_interface_delete(int command, struct zclient *zclient, } /* 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; @@ -383,8 +378,7 @@ static void ripng_apply_address_add(struct connected *ifc) 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; @@ -450,8 +444,7 @@ static void ripng_apply_address_del(struct connected *ifc) 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; |
