diff options
Diffstat (limited to 'zebra/zserv.c')
| -rw-r--r-- | zebra/zserv.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/zebra/zserv.c b/zebra/zserv.c index 6965c285cd..dda6a3e13d 100644 --- a/zebra/zserv.c +++ b/zebra/zserv.c @@ -23,7 +23,6 @@ #include "lib/buffer.h" /* for BUFFER_EMPTY, BUFFER_ERROR, BUFFE... */ #include "lib/command.h" /* for vty, install_element, CMD_SUCCESS... */ #include "lib/hook.h" /* for DEFINE_HOOK, DEFINE_KOOH, hook_call */ -#include "lib/linklist.h" /* for ALL_LIST_ELEMENTS_RO, ALL_LIST_EL... */ #include "lib/libfrr.h" /* for frr_zclient_addr */ #include "lib/log.h" /* for zlog_warn, zlog_debug, safe_strerror */ #include "lib/memory.h" /* for MTYPE_TMP, XCALLOC, XFREE */ @@ -728,7 +727,7 @@ void zserv_close_client(struct zserv *client) frr_with_mutex (&client_mutex) { if (client->busy_count <= 0) { /* remove from client list */ - listnode_delete(zrouter.client_list, client); + zserv_client_list_del(&zrouter.client_list, client); } else { /* * The client session object may be in use, although @@ -802,7 +801,7 @@ static struct zserv *zserv_client_create(int sock) /* Add this client to linked list. */ frr_with_mutex (&client_mutex) { - listnode_add(zrouter.client_list, client); + zserv_client_list_add_tail(&zrouter.client_list, client); } struct frr_pthread_attr zclient_pthr_attrs = { @@ -1311,10 +1310,9 @@ static struct zserv *find_client_internal(uint8_t proto, unsigned short instance, uint32_t session_id) { - struct listnode *node, *nnode; struct zserv *client = NULL; - for (ALL_LIST_ELEMENTS(zrouter.client_list, node, nnode, client)) { + frr_each (zserv_client_list, &zrouter.client_list, client) { if (client->proto == proto && client->instance == instance && client->session_id == session_id) break; @@ -1362,10 +1360,9 @@ DEFUN (show_zebra_client, ZEBRA_STR "Client information\n") { - struct listnode *node; struct zserv *client; - for (ALL_LIST_ELEMENTS_RO(zrouter.client_list, node, client)) { + frr_each (zserv_client_list, &zrouter.client_list, client) { zebra_show_client_detail(vty, client); /* Show GR info if present */ zebra_show_stale_client_detail(vty, client); @@ -1383,7 +1380,6 @@ DEFUN (show_zebra_client_summary, "Client information brief\n" "Brief Summary\n") { - struct listnode *node; struct zserv *client; vty_out(vty, @@ -1391,7 +1387,7 @@ DEFUN (show_zebra_client_summary, vty_out(vty, "------------------------------------------------------------------------------------------\n"); - for (ALL_LIST_ELEMENTS_RO(zrouter.client_list, node, client)) + frr_each (zserv_client_list, &zrouter.client_list, client) zebra_show_client_brief(vty, client); vty_out(vty, "Routes column shows (added+updated)/deleted\n"); @@ -1400,10 +1396,9 @@ DEFUN (show_zebra_client_summary, static int zserv_client_close_cb(struct zserv *closed_client) { - struct listnode *node, *nnode; struct zserv *client = NULL; - for (ALL_LIST_ELEMENTS(zrouter.client_list, node, nnode, client)) { + frr_each (zserv_client_list, &zrouter.client_list, client) { if (client->proto == closed_client->proto) continue; @@ -1416,7 +1411,7 @@ static int zserv_client_close_cb(struct zserv *closed_client) void zserv_init(void) { /* Client list init. */ - zrouter.client_list = list_new(); + zserv_client_list_init(&zrouter.client_list); zrouter.stale_client_list = list_new(); /* Misc init. */ |
