diff options
Diffstat (limited to 'sharpd/sharp_zebra.c')
| -rw-r--r-- | sharpd/sharp_zebra.c | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/sharpd/sharp_zebra.c b/sharpd/sharp_zebra.c index f02ce4979c..8915397c7e 100644 --- a/sharpd/sharp_zebra.c +++ b/sharpd/sharp_zebra.c @@ -56,7 +56,7 @@ static struct interface *zebra_interface_if_lookup(struct stream *s) /* Inteface addition message from zebra. */ static int interface_add(int command, struct zclient *zclient, - zebra_size_t length, vrf_id_t vrf_id) + zebra_size_t length, vrf_id_t vrf_id) { struct interface *ifp; @@ -130,6 +130,7 @@ static int interface_state_down(int command, struct zclient *zclient, extern uint32_t total_routes; extern uint32_t installed_routes; +extern uint32_t removed_routes; static int route_notify_owner(int command, struct zclient *zclient, zebra_size_t length, vrf_id_t vrf_id) @@ -141,10 +142,27 @@ static int route_notify_owner(int command, struct zclient *zclient, if (!zapi_route_notify_decode(zclient->ibuf, &p, &table, ¬e)) return -1; - installed_routes++; - - if (total_routes == installed_routes) - zlog_debug("Installed All Items"); + switch (note) { + case ZAPI_ROUTE_INSTALLED: + installed_routes++; + if (total_routes == installed_routes) + zlog_debug("Installed All Items"); + break; + case ZAPI_ROUTE_FAIL_INSTALL: + zlog_debug("Failed install of route"); + break; + case ZAPI_ROUTE_BETTER_ADMIN_WON: + zlog_debug("Better Admin Distance won over us"); + break; + case ZAPI_ROUTE_REMOVED: + removed_routes++; + if (total_routes == removed_routes) + zlog_debug("Removed all Items"); + break; + case ZAPI_ROUTE_REMOVE_FAIL: + zlog_debug("Route removal Failure"); + break; + } return 0; } @@ -200,7 +218,7 @@ extern struct zebra_privs_t sharp_privs; void sharp_zebra_init(void) { - struct zclient_options opt = { .receive_notify = true }; + struct zclient_options opt = {.receive_notify = true}; zclient = zclient_new_notify(master, &opt); |
