diff options
| author | vivek <vivek@cumulusnetworks.com> | 2016-07-21 08:50:17 -0700 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2016-12-21 20:26:02 -0500 |
| commit | 5e08fee1e1da3fb6f3e56af12ffdf16400bfa49b (patch) | |
| tree | 28b85703ab92cd3cfdc948bcd5890939f96c2904 | |
| parent | 7fcdfb34acd927d5ea15e871f6627385a3eac5d9 (diff) | |
zebra: API to locate client structure based on protocol
Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket:
Reviewed By: CCR-4968
Testing Done: Tested with subsequent patch(es)
| -rw-r--r-- | zebra/zserv.c | 15 | ||||
| -rw-r--r-- | zebra/zserv.h | 2 |
2 files changed, 17 insertions, 0 deletions
diff --git a/zebra/zserv.c b/zebra/zserv.c index b7e45d8df1..a92efa027f 100644 --- a/zebra/zserv.c +++ b/zebra/zserv.c @@ -2371,6 +2371,21 @@ zebra_show_client_brief (struct vty *vty, struct zserv *client) } +struct zserv * +zebra_find_client (u_char proto) +{ + struct listnode *node, *nnode; + struct zserv *client; + + for (ALL_LIST_ELEMENTS (zebrad.client_list, node, nnode, client)) + { + if (client->proto == proto) + return client; + } + + return NULL; +} + /* Display default rtm_table for all clients. */ DEFUN (show_table, diff --git a/zebra/zserv.h b/zebra/zserv.h index a0434d299b..d17a28eb6a 100644 --- a/zebra/zserv.h +++ b/zebra/zserv.h @@ -176,4 +176,6 @@ extern void zserv_create_header(struct stream *s, uint16_t cmd, vrf_id_t vrf_id) extern void zserv_nexthop_num_warn(const char *, const struct prefix *, const unsigned int); extern int zebra_server_send_message(struct zserv *client); +extern struct zserv *zebra_find_client (u_char proto); + #endif /* _ZEBRA_ZEBRA_H */ |
