zebra_dplane_pre_finish();
- for (ALL_LIST_ELEMENTS(zebrad.client_list, ln, nn, client))
+ for (ALL_LIST_ELEMENTS(zrouter.client_list, ln, nn, client))
zserv_close_client(client);
- list_delete_all_node(zebrad.client_list);
+ list_delete_all_node(zrouter.client_list);
zebra_ptm_finish();
if (retain_mode)
prefix_list_reset();
route_map_finish();
- list_delete(&zebrad.client_list);
+ list_delete(&zrouter.client_list);
/* Indicate that all new dplane work has been enqueued. When that
* work is complete, the dataplane will enqueue an event
#include "srcdest_table.h"
#include "zebra/rib.h"
-#include "zebra/zserv.h"
+#include "zebra/zebra_router.h"
#include "zebra/zebra_ns.h"
#include "zebra/zebra_vrf.h"
#include "zebra/zebra_routemap.h"
return;
}
- for (ALL_LIST_ELEMENTS(zebrad.client_list, node, nnode, client)) {
+ for (ALL_LIST_ELEMENTS(zrouter.client_list, node, nnode, client)) {
send_redistribute = 0;
if (is_default_prefix(p)
return;
}
- for (ALL_LIST_ELEMENTS(zebrad.client_list, node, nnode, client)) {
+ for (ALL_LIST_ELEMENTS(zrouter.client_list, node, nnode, client)) {
if ((is_default_prefix(p)
&& vrf_bitmap_check(client->redist_default[afi],
re->vrf_id))
ifp->name, ifp->vrf_id);
if (ifp->ptm_status || !ifp->ptm_enable) {
- for (ALL_LIST_ELEMENTS(zebrad.client_list, node, nnode, client))
+ for (ALL_LIST_ELEMENTS(zrouter.client_list, node, nnode,
+ client))
if (vrf_bitmap_check(client->ifinfo, ifp->vrf_id)) {
zsend_interface_update(ZEBRA_INTERFACE_UP,
client, ifp);
zlog_debug("MESSAGE: ZEBRA_INTERFACE_DOWN %s(%u)",
ifp->name, ifp->vrf_id);
- for (ALL_LIST_ELEMENTS(zebrad.client_list, node, nnode, client)) {
+ for (ALL_LIST_ELEMENTS(zrouter.client_list, node, nnode, client)) {
zsend_interface_update(ZEBRA_INTERFACE_DOWN, client, ifp);
}
}
zlog_debug("MESSAGE: ZEBRA_INTERFACE_ADD %s(%u)", ifp->name,
ifp->vrf_id);
- for (ALL_LIST_ELEMENTS(zebrad.client_list, node, nnode, client))
+ for (ALL_LIST_ELEMENTS(zrouter.client_list, node, nnode, client))
if (vrf_bitmap_check(client->ifinfo, ifp->vrf_id)) {
client->ifadd_cnt++;
zsend_interface_add(client, ifp);
zlog_debug("MESSAGE: ZEBRA_INTERFACE_DELETE %s(%u)",
ifp->name, ifp->vrf_id);
- for (ALL_LIST_ELEMENTS(zebrad.client_list, node, nnode, client)) {
+ for (ALL_LIST_ELEMENTS(zrouter.client_list, node, nnode, client)) {
client->ifdel_cnt++;
zsend_interface_delete(client, ifp);
}
router_id_add_address(ifc);
- for (ALL_LIST_ELEMENTS(zebrad.client_list, node, nnode, client))
+ for (ALL_LIST_ELEMENTS(zrouter.client_list, node, nnode, client))
if (CHECK_FLAG(ifc->conf, ZEBRA_IFC_REAL)) {
client->connected_rt_add_cnt++;
zsend_interface_address(ZEBRA_INTERFACE_ADDRESS_ADD,
router_id_del_address(ifc);
- for (ALL_LIST_ELEMENTS(zebrad.client_list, node, nnode, client))
+ for (ALL_LIST_ELEMENTS(zrouter.client_list, node, nnode, client))
if (CHECK_FLAG(ifc->conf, ZEBRA_IFC_REAL)) {
client->connected_rt_del_cnt++;
zsend_interface_address(ZEBRA_INTERFACE_ADDRESS_DELETE,
"MESSAGE: ZEBRA_INTERFACE_VRF_UPDATE/DEL %s VRF Id %u -> %u",
ifp->name, ifp->vrf_id, new_vrf_id);
- for (ALL_LIST_ELEMENTS(zebrad.client_list, node, nnode, client)) {
+ for (ALL_LIST_ELEMENTS(zrouter.client_list, node, nnode, client)) {
/* Need to delete if the client is not interested in the new
* VRF. */
zsend_interface_update(ZEBRA_INTERFACE_DOWN, client, ifp);
"MESSAGE: ZEBRA_INTERFACE_VRF_UPDATE/ADD %s VRF Id %u -> %u",
ifp->name, old_vrf_id, ifp->vrf_id);
- for (ALL_LIST_ELEMENTS(zebrad.client_list, node, nnode, client)) {
+ for (ALL_LIST_ELEMENTS(zrouter.client_list, node, nnode, client)) {
/* Need to add if the client is interested in the new VRF. */
client->ifadd_cnt++;
zsend_interface_add(client, ifp);
zlog_debug("MESSAGE: ZEBRA_INTERFACE_LINK_PARAMS %s(%u)",
ifp->name, ifp->vrf_id);
- for (ALL_LIST_ELEMENTS(zebrad.client_list, node, nnode, client))
+ for (ALL_LIST_ELEMENTS(zrouter.client_list, node, nnode, client))
if (vrf_bitmap_check(client->ifinfo, ifp->vrf_id))
zsend_interface_link_params(client, ifp);
}
#include "rib.h"
#include "vrf.h"
-#include "zebra/zserv.h"
+#include "zebra/zebra_router.h"
#include "zebra/zapi_msg.h"
#include "zebra/zebra_vrf.h"
#include "zebra/router-id.h"
router_id_get(&p2, vrf_id);
- for (ALL_LIST_ELEMENTS_RO(zebrad.client_list, node, client))
+ for (ALL_LIST_ELEMENTS_RO(zrouter.client_list, node, client))
zsend_router_id_update(client, &p2, vrf_id);
}
if (prefix_same(&before, &after))
return;
- for (ALL_LIST_ELEMENTS_RO(zebrad.client_list, node, client))
+ for (ALL_LIST_ELEMENTS_RO(zrouter.client_list, node, client))
zsend_router_id_update(client, &after, zvrf_id(zvrf));
}
if (prefix_same(&before, &after))
return;
- for (ALL_LIST_ELEMENTS_RO(zebrad.client_list, node, client))
+ for (ALL_LIST_ELEMENTS_RO(zrouter.client_list, node, client))
zsend_router_id_update(client, &after, zvrf_id(zvrf));
}
#include "lib/libfrr.h"
#include "lib/sockopt.h"
+#include "zebra/zebra_router.h"
#include "zebra/rib.h"
#include "zebra/zebra_memory.h"
#include "zebra/zebra_ns.h"
p->prefixlen, ifc->ifp->name);
}
- for (ALL_LIST_ELEMENTS(zebrad.client_list, node, nnode, client))
+ for (ALL_LIST_ELEMENTS(zrouter.client_list, node, nnode, client))
zsend_interface_nbr_address(ZEBRA_INTERFACE_NBR_ADDRESS_ADD,
client, ifp, ifc);
}
p->prefixlen, ifc->ifp->name);
}
- for (ALL_LIST_ELEMENTS(zebrad.client_list, node, nnode, client))
+ for (ALL_LIST_ELEMENTS(zrouter.client_list, node, nnode, client))
zsend_interface_nbr_address(ZEBRA_INTERFACE_NBR_ADDRESS_DELETE,
client, ifp, ifc);
}
zlog_debug("%s: Notifying %u", __PRETTY_FUNCTION__,
rule->rule.unique);
- for (ALL_LIST_ELEMENTS_RO(zebrad.client_list, node, client)) {
+ for (ALL_LIST_ELEMENTS_RO(zrouter.client_list, node, client)) {
if (rule->sock == client->sock)
break;
}
zlog_debug("%s: Notifying %u", __PRETTY_FUNCTION__,
ipset->unique);
- for (ALL_LIST_ELEMENTS_RO(zebrad.client_list, node, client)) {
+ for (ALL_LIST_ELEMENTS_RO(zrouter.client_list, node, client)) {
if (ipset->sock == client->sock)
break;
}
zlog_debug("%s: Notifying %u", __PRETTY_FUNCTION__,
ipset->unique);
- for (ALL_LIST_ELEMENTS_RO(zebrad.client_list, node, client)) {
+ for (ALL_LIST_ELEMENTS_RO(zrouter.client_list, node, client)) {
if (ipset->sock == client->sock)
break;
}
zlog_debug("%s: Notifying %u", __PRETTY_FUNCTION__,
iptable->unique);
- for (ALL_LIST_ELEMENTS_RO(zebrad.client_list, node, client)) {
+ for (ALL_LIST_ELEMENTS_RO(zrouter.client_list, node, client)) {
if (iptable->sock == client->sock)
break;
}
#include "zebra/zebra_errors.h"
#include "zebra/zebra_ptm.h"
#include "zebra/zebra_ptm_redistribute.h"
-#include "zebra/zserv.h"
+#include "zebra/zebra_router.h"
#include "zebra_vrf.h"
/*
}
/* Send message to all running BFDd daemons. */
- for (ALL_LIST_ELEMENTS_RO(zebrad.client_list, node, client)) {
+ for (ALL_LIST_ELEMENTS_RO(zrouter.client_list, node, client)) {
if (client->proto != ZEBRA_ROUTE_BFD)
continue;
}
/* Send message to all running client daemons. */
- for (ALL_LIST_ELEMENTS_RO(zebrad.client_list, node, client)) {
+ for (ALL_LIST_ELEMENTS_RO(zrouter.client_list, node, client)) {
if (!IS_BFD_ENABLED_PROTOCOL(client->proto))
continue;
#include "prefix.h"
#include "vty.h"
#include "stream.h"
-#include "zebra/zserv.h"
+#include "zebra/zebra_router.h"
#include "zebra/zapi_msg.h"
#include "zebra/zebra_ptm.h"
#include "zebra/zebra_ptm_redistribute.h"
struct listnode *node, *nnode;
struct zserv *client;
- for (ALL_LIST_ELEMENTS(zebrad.client_list, node, nnode, client)) {
+ for (ALL_LIST_ELEMENTS(zrouter.client_list, node, nnode, client)) {
if (!IS_BFD_ENABLED_PROTOCOL(client->proto))
continue;
struct listnode *node, *nnode;
struct zserv *client;
- for (ALL_LIST_ELEMENTS(zebrad.client_list, node, nnode, client)) {
+ for (ALL_LIST_ELEMENTS(zrouter.client_list, node, nnode, client)) {
if (!IS_BFD_ENABLED_PROTOCOL(client->proto))
continue;
/* Thread master */
struct thread_master *master;
+ /* Lists of clients who have connected to us */
+ struct list *client_list;
+
struct zebra_router_table_head tables;
/* L3-VNI hash table (for EVPN). Only in default instance */
if (IS_ZEBRA_DEBUG_EVENT)
zlog_debug("MESSAGE: ZEBRA_VRF_ADD %s", zvrf_name(zvrf));
- for (ALL_LIST_ELEMENTS(zebrad.client_list, node, nnode, client))
+ for (ALL_LIST_ELEMENTS(zrouter.client_list, node, nnode, client))
zsend_vrf_add(client, zvrf);
}
if (IS_ZEBRA_DEBUG_EVENT)
zlog_debug("MESSAGE: ZEBRA_VRF_DELETE %s", zvrf_name(zvrf));
- for (ALL_LIST_ELEMENTS(zebrad.client_list, node, nnode, client))
+ for (ALL_LIST_ELEMENTS(zrouter.client_list, node, nnode, client))
zsend_vrf_delete(client, zvrf);
}
client->pthread = NULL;
/* remove from client list */
- listnode_delete(zebrad.client_list, client);
+ listnode_delete(zrouter.client_list, client);
/* delete client */
zserv_client_free(client);
client->is_synchronous = 0;
/* Add this client to linked list. */
- listnode_add(zebrad.client_list, client);
+ listnode_add(zrouter.client_list, client);
struct frr_pthread_attr zclient_pthr_attrs = {
.start = frr_pthread_attr_default.start,
struct listnode *node, *nnode;
struct zserv *client;
- for (ALL_LIST_ELEMENTS(zebrad.client_list, node, nnode, client)) {
+ for (ALL_LIST_ELEMENTS(zrouter.client_list, node, nnode, client)) {
if (client->proto == proto && client->instance == instance)
return client;
}
struct listnode *node;
struct zserv *client;
- for (ALL_LIST_ELEMENTS_RO(zebrad.client_list, node, client))
+ for (ALL_LIST_ELEMENTS_RO(zrouter.client_list, node, client))
zebra_show_client_detail(vty, client);
return CMD_SUCCESS;
vty_out(vty,
"--------------------------------------------------------------------------------\n");
- for (ALL_LIST_ELEMENTS_RO(zebrad.client_list, node, client))
+ for (ALL_LIST_ELEMENTS_RO(zrouter.client_list, node, client))
zebra_show_client_brief(vty, client);
vty_out(vty, "Routes column shows (added+updated)/deleted\n");
void zserv_init(void)
{
/* Client list init. */
- zebrad.client_list = list_new();
+ zrouter.client_list = list_new();
/* Misc init. */
zebrad.sock = -1;
/* Zebra instance */
struct zebra_t {
- struct list *client_list;
-
/* Socket */
int sock;