diff options
| author | Quentin Young <qlyoung@cumulusnetworks.com> | 2018-03-13 12:08:38 -0400 |
|---|---|---|
| committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2018-03-13 12:08:38 -0400 |
| commit | 1f35b46a2f35d59b86ed3ee557aa1c9fcf2fcac9 (patch) | |
| tree | 27de606b3510b126766ac7a0ac9eb8ddf4573ab0 /sharpd/sharp_zebra.c | |
| parent | d47ae3db4cf14c72d8468d61113ac88e19235791 (diff) | |
| parent | c1a003878246ccc84ab5986558ca959f4545f738 (diff) | |
Merge branch 'master' into docuser
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
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); |
