]> git.proxmox.com Git - mirror_frr.git/commitdiff
zebra: API to locate client structure based on protocol
authorvivek <vivek@cumulusnetworks.com>
Thu, 21 Jul 2016 15:50:17 +0000 (08:50 -0700)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 17 Jan 2017 23:20:52 +0000 (18:20 -0500)
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)

zebra/zserv.c
zebra/zserv.h

index d3c204d119a53fbe80c08bc06071b143d5f576e0..a736577a3c548aa803970d8559366d845f827f6b 100644 (file)
@@ -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,
index a0434d299bdf108af9de5e80adab25bfe28d7996..d17a28eb6a9f50c6b9c11d9f6944412d2cac49ef 100644 (file)
@@ -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 */