]> git.proxmox.com Git - mirror_frr.git/blobdiff - pathd/path_pcep_controller.h
Merge pull request #12798 from donaldsharp/rib_match_multicast
[mirror_frr.git] / pathd / path_pcep_controller.h
index 1b7c3a4c72a5d83b22c51aa3c87c597e72921c5f..c2359beb23c38035118b0b20fe395ef6b0183993 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
  */
 
 #ifndef _PATH_PCEP_CONTROLLER_H_
@@ -27,6 +14,7 @@ struct pcc_state;
 enum pcep_main_event_type {
        PCEP_MAIN_EVENT_UNDEFINED = 0,
        PCEP_MAIN_EVENT_START_SYNC,
+       PCEP_MAIN_EVENT_INITIATE_CANDIDATE,
        PCEP_MAIN_EVENT_UPDATE_CANDIDATE,
        PCEP_MAIN_EVENT_REMOVE_CANDIDATE_LSP,
 };
@@ -89,7 +77,7 @@ struct pcep_ctrl_socket_data {
        void *payload;
 };
 
-typedef int (*pcep_ctrl_thread_callback)(struct thread *);
+typedef void (*pcep_ctrl_thread_callback)(struct thread *);
 
 /* PCC connection information, populated in a thread-safe
  * manner with pcep_ctrl_get_pcc_info() */
@@ -131,16 +119,21 @@ struct pcep_pcc_info *pcep_ctrl_get_pcc_info(struct frr_pthread *fpt,
 
 /* Asynchronously send a report. The caller is giving away the path structure,
  * it shouldn't be allocated on the stack. If `pcc_id` is `0` the report is
- * sent by all PCCs.  The parameter is_stable is used to hint wether the status
+ * sent by all PCCs.  The parameter is_stable is used to hint whether the status
  * will soon change, this is used to ensure all report updates are sent even
  * when missing status update events */
 int pcep_ctrl_send_report(struct frr_pthread *fpt, int pcc_id,
                          struct path *path, bool is_stable);
 
+int pcep_ctrl_send_error(struct frr_pthread *fpt, int pcc_id,
+                        struct pcep_error *error);
+
 /* Functions called from the controller thread */
 void pcep_thread_start_sync(struct ctrl_state *ctrl_state, int pcc_id);
 void pcep_thread_update_path(struct ctrl_state *ctrl_state, int pcc_id,
                             struct path *path);
+void pcep_thread_initiate_path(struct ctrl_state *ctrl_state, int pcc_id,
+                              struct path *path);
 void pcep_thread_cancel_timer(struct thread **thread);
 void pcep_thread_schedule_reconnect(struct ctrl_state *ctrl_state, int pcc_id,
                                    int retry_count, struct thread **thread);
@@ -168,7 +161,7 @@ int pcep_thread_socket_write(void *fpt, void **thread, int fd, void *payload,
 
 int pcep_thread_send_ctrl_event(void *fpt, void *payload,
                                pcep_ctrl_thread_callback cb);
-int pcep_thread_pcep_event(struct thread *thread);
+void pcep_thread_pcep_event(struct thread *thread);
 int pcep_thread_pcc_count(struct ctrl_state *ctrl_state);
 /* Called by the PCC to refine a path in the main thread */
 int pcep_thread_refine_path(struct ctrl_state *ctrl_state, int pcc_id,