]> git.proxmox.com Git - mirror_frr.git/blobdiff - pathd/pathd.c
*: Convert thread_cancelXXX to event_cancelXXX
[mirror_frr.git] / pathd / pathd.c
index 2ca4f4cc9d02f0397f50ba88cc99ef2d718dfd8d..d1c0c82d9d8034b916173a00f86eae5e91adeed9 100644 (file)
@@ -1,19 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020  NetDEF, Inc.
- *
- * 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>
@@ -58,9 +45,9 @@ struct debug path_policy_debug;
 
 
 static void trigger_pathd_candidate_created(struct srte_candidate *candidate);
-static void trigger_pathd_candidate_created_timer(struct thread *thread);
+static void trigger_pathd_candidate_created_timer(struct event *thread);
 static void trigger_pathd_candidate_updated(struct srte_candidate *candidate);
-static void trigger_pathd_candidate_updated_timer(struct thread *thread);
+static void trigger_pathd_candidate_updated_timer(struct event *thread);
 static void trigger_pathd_candidate_removed(struct srte_candidate *candidate);
 static const char *
 srte_candidate_metric_name(enum srte_candidate_metric_type type);
@@ -1306,11 +1293,11 @@ void trigger_pathd_candidate_created(struct srte_candidate *candidate)
        from changing the candidate by hand with the console */
        if (candidate->hook_timer != NULL)
                return;
-       thread_add_timer(master, trigger_pathd_candidate_created_timer,
-                        (void *)candidate, HOOK_DELAY, &candidate->hook_timer);
+       event_add_timer(master, trigger_pathd_candidate_created_timer,
+                       (void *)candidate, HOOK_DELAY, &candidate->hook_timer);
 }
 
-void trigger_pathd_candidate_created_timer(struct thread *thread)
+void trigger_pathd_candidate_created_timer(struct event *thread)
 {
        struct srte_candidate *candidate = THREAD_ARG(thread);
        candidate->hook_timer = NULL;
@@ -1326,11 +1313,11 @@ void trigger_pathd_candidate_updated(struct srte_candidate *candidate)
        from changing the candidate by hand with the console */
        if (candidate->hook_timer != NULL)
                return;
-       thread_add_timer(master, trigger_pathd_candidate_updated_timer,
-                        (void *)candidate, HOOK_DELAY, &candidate->hook_timer);
+       event_add_timer(master, trigger_pathd_candidate_updated_timer,
+                       (void *)candidate, HOOK_DELAY, &candidate->hook_timer);
 }
 
-void trigger_pathd_candidate_updated_timer(struct thread *thread)
+void trigger_pathd_candidate_updated_timer(struct event *thread)
 {
        struct srte_candidate *candidate = THREAD_ARG(thread);
        candidate->hook_timer = NULL;
@@ -1342,7 +1329,7 @@ void trigger_pathd_candidate_removed(struct srte_candidate *candidate)
        /* The hook needs to be call synchronously, otherwise the candidate
        path will be already deleted when the handler is called */
        if (candidate->hook_timer != NULL) {
-               thread_cancel(&candidate->hook_timer);
+               event_cancel(&candidate->hook_timer);
                candidate->hook_timer = NULL;
        }
        hook_call(pathd_candidate_removed, candidate);