]> git.proxmox.com Git - mirror_frr.git/blobdiff - pimd/pim_zpthread.c
*: Convert thread_add_XXX functions to event_add_XXX
[mirror_frr.git] / pimd / pim_zpthread.c
index e6fb3b3a17274ea2d027cd061c481d4a9081806b..d6b2621ff4b6fb4a2d35fa64e71f6c3ecfb81c54 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program 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 of the License, or
- * (at your option) any later version.
- *
- * This program 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>
@@ -35,12 +22,9 @@ int32_t mlag_bulk_cnt;
 static void pim_mlag_zebra_fill_header(enum mlag_msg_type msg_type)
 {
        uint32_t fill_msg_type = msg_type;
-       uint16_t data_len;
+       uint16_t data_len = 0;
        uint16_t msg_cnt = 1;
 
-       if (msg_type == MLAG_MSG_NONE)
-               return;
-
        switch (msg_type) {
        case MLAG_REGISTER:
        case MLAG_DEREGISTER:
@@ -54,7 +38,15 @@ static void pim_mlag_zebra_fill_header(enum mlag_msg_type msg_type)
                data_len = sizeof(struct mlag_mroute_del);
                fill_msg_type = MLAG_MROUTE_DEL_BULK;
                break;
-       default:
+       case MLAG_MSG_NONE:
+               return;
+       case MLAG_STATUS_UPDATE:
+       case MLAG_DUMP:
+       case MLAG_MROUTE_ADD_BULK:
+       case MLAG_MROUTE_DEL_BULK:
+       case MLAG_PIM_CFG_DUMP:
+       case MLAG_VXLAN_UPDATE:
+       case MLAG_PEER_FRR_STATUS:
                data_len = 0;
                break;
        }
@@ -141,7 +133,7 @@ static void pim_mlag_zebra_check_for_buffer_flush(uint32_t curr_msg_type,
  * Thsi thread reads the clients data from the Gloabl queue and encodes with
  * protobuf and pass on to the MLAG socket.
  */
-static void pim_mlag_zthread_handler(struct thread *event)
+static void pim_mlag_zthread_handler(struct event *event)
 {
        struct stream *read_s;
        uint32_t wr_count = 0;
@@ -217,8 +209,8 @@ int pim_mlag_signal_zpthread(void)
                if (PIM_DEBUG_MLAG)
                        zlog_debug(":%s: Scheduling PIM MLAG write Thread",
                                   __func__);
-               thread_add_event(router->master, pim_mlag_zthread_handler, NULL,
-                                0, &router->zpthread_mlag_write);
+               event_add_event(router->master, pim_mlag_zthread_handler, NULL,
+                               0, &router->zpthread_mlag_write);
        }
        return (0);
 }