]> git.proxmox.com Git - mirror_frr.git/blobdiff - zebra/kernel_netlink.c
zebra:add df flag into evpn esi json output
[mirror_frr.git] / zebra / kernel_netlink.c
index fac6acae0c8d52df4024b48b6d6358fa269f700f..78b1dfe27633039f3c515d01883d42abb49f587b 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Kernel communication using netlink interface.
  * Copyright (C) 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -30,7 +15,7 @@
 #include "table.h"
 #include "memory.h"
 #include "rib.h"
-#include "thread.h"
+#include "frrevent.h"
 #include "privs.h"
 #include "nexthop.h"
 #include "vrf.h"
@@ -171,7 +156,7 @@ static const struct message rttype_str[] = {{RTN_UNSPEC, "none"},
                                            {RTN_XRESOLVE, "resolver"},
                                            {0}};
 
-extern struct thread_master *master;
+extern struct event_loop *master;
 
 extern struct zebra_privs_t zserv_privs;
 
@@ -497,9 +482,9 @@ static int dplane_netlink_information_fetch(struct nlmsghdr *h, ns_id_t ns_id,
        return 0;
 }
 
-static void kernel_read(struct thread *thread)
+static void kernel_read(struct event *thread)
 {
-       struct zebra_ns *zns = (struct zebra_ns *)THREAD_ARG(thread);
+       struct zebra_ns *zns = (struct zebra_ns *)EVENT_ARG(thread);
        struct zebra_dplane_info dp_info;
 
        /* Capture key info from ns struct */
@@ -508,8 +493,8 @@ static void kernel_read(struct thread *thread)
        netlink_parse_info(netlink_information_fetch, &zns->netlink, &dp_info,
                           5, false);
 
-       thread_add_read(zrouter.master, kernel_read, zns, zns->netlink.sock,
-                       &zns->t_netlink);
+       event_add_read(zrouter.master, kernel_read, zns, zns->netlink.sock,
+                      &zns->t_netlink);
 }
 
 /*
@@ -1954,8 +1939,8 @@ void kernel_init(struct zebra_ns *zns)
 
        zns->t_netlink = NULL;
 
-       thread_add_read(zrouter.master, kernel_read, zns,
-                       zns->netlink.sock, &zns->t_netlink);
+       event_add_read(zrouter.master, kernel_read, zns, zns->netlink.sock,
+                      &zns->t_netlink);
 
        rt_netlink_init();
 }
@@ -1974,7 +1959,7 @@ static void kernel_nlsock_fini(struct nlsock *nls)
 
 void kernel_terminate(struct zebra_ns *zns, bool complete)
 {
-       THREAD_OFF(zns->t_netlink);
+       EVENT_OFF(zns->t_netlink);
 
        kernel_nlsock_fini(&zns->netlink);