From d5dea3506e4bb55ebea5a225c70e24e8d6c800ac Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Mon, 30 Jan 2023 10:08:25 -0500 Subject: pathd: Add missing enum's to switch statement Signed-off-by: Donald Sharp --- pathd/path_pcep_controller.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'pathd/path_pcep_controller.c') diff --git a/pathd/path_pcep_controller.c b/pathd/path_pcep_controller.c index b9f2ba3c63..380d1ab221 100644 --- a/pathd/path_pcep_controller.c +++ b/pathd/path_pcep_controller.c @@ -603,7 +603,9 @@ void pcep_thread_timer_handler(struct thread *thread) pcep_thread_remove_candidate_path_segments(ctrl_state, pcc_state); break; - default: + case TM_PCEPLIB_TIMER: + case TM_UNDEFINED: + case TM_MAX: flog_warn(EC_PATH_PCEP_RECOVERABLE_INTERNAL_ERROR, "Unknown controller timer triggered: %u", timer_type); break; @@ -823,7 +825,7 @@ void pcep_thread_event_handler(struct thread *thread) pcep_pcc_send_error(ctrl_state, pcc_state, error, (bool)sub_type); break; - default: + case EV_PCEPLIB_EVENT: flog_warn(EC_PATH_PCEP_RECOVERABLE_INTERNAL_ERROR, "Unexpected event received in controller thread: %u", type); @@ -1074,10 +1076,16 @@ const char *timer_type_name(enum pcep_ctrl_timer_type type) return "PCEPLIB_TIMER"; case TM_TIMEOUT: return "TIMEOUT"; - default: + case TM_CALCULATE_BEST_PCE: + return "BEST_PCE"; + case TM_SESSION_TIMEOUT_PCC: + return "TIMEOUT_PCC"; + case TM_MAX: return "UNKNOWN"; } -}; + + assert(!"Reached end of function where we did not expect to"); +} const char *timeout_type_name(enum pcep_ctrl_timeout_type type) { @@ -1086,7 +1094,9 @@ const char *timeout_type_name(enum pcep_ctrl_timeout_type type) return "UNDEFINED"; case TO_COMPUTATION_REQUEST: return "COMPUTATION_REQUEST"; - default: + case TO_MAX: return "UNKNOWN"; } + + assert(!"Reached end of function where we did not expect to"); } -- cgit v1.2.3