isisd: Add missing enum's to switch statement

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
Donald Sharp 2023-01-30 10:08:47 -05:00
parent d5dea3506e
commit a348c9456f
5 changed files with 29 additions and 12 deletions

View File

@ -484,9 +484,11 @@ const char *isis_adj_yang_state(enum isis_adj_state state)
return "up";
case ISIS_ADJ_INITIALIZING:
return "init";
default:
case ISIS_ADJ_UNKNOWN:
return "failed";
}
assert(!"Reached end of function where we are not expecting to");
}
void isis_adj_expire(struct thread *thread)
@ -954,8 +956,9 @@ int isis_adj_usage2levels(enum isis_adj_usage usage)
return IS_LEVEL_2;
case ISIS_ADJ_LEVEL1AND2:
return IS_LEVEL_1 | IS_LEVEL_2;
default:
break;
case ISIS_ADJ_NONE:
return 0;
}
return 0;
assert(!"Reached end of function where we are not expecting to");
}

View File

@ -77,9 +77,11 @@ static const char *pdu_counter_index_to_name(enum pdu_counter_index index)
return "L1 PSNP";
case L2_PARTIAL_SEQ_NUM_INDEX:
return "L2 PSNP";
default:
case PDU_COUNTER_SIZE:
return "???????";
}
assert(!"Reached end of function where we were not expecting to");
}
void pdu_counter_count(pdu_counter_t counter, uint8_t pdu_type)

View File

@ -1587,8 +1587,8 @@ static void spf_path_process(struct isis_spftree *spftree,
vertex->N.ip.priority = priority;
if (vertex->depth == 1 || listcount(vertex->Adj_N) > 0) {
struct isis_spftree *pre_spftree;
struct route_table *route_table;
bool allow_ecmp;
struct route_table *route_table = NULL;
bool allow_ecmp = false;
switch (spftree->type) {
case SPF_TYPE_RLFA:
@ -1606,7 +1606,8 @@ static void spf_path_process(struct isis_spftree *spftree,
return;
}
break;
default:
case SPF_TYPE_FORWARD:
case SPF_TYPE_REVERSE:
break;
}
@ -1624,7 +1625,8 @@ static void spf_path_process(struct isis_spftree *spftree,
pre_spftree->lfa.protection_counters
.tilfa[vertex->N.ip.priority] += 1;
break;
default:
case SPF_TYPE_FORWARD:
case SPF_TYPE_REVERSE:
route_table = spftree->route_table;
allow_ecmp = true;
@ -1699,7 +1701,14 @@ static void isis_spf_loop(struct isis_spftree *spftree,
VTYPE_IPREACH_TE))
continue;
break;
default:
case VTYPE_PSEUDO_IS:
case VTYPE_PSEUDO_TE_IS:
case VTYPE_NONPSEUDO_IS:
case VTYPE_NONPSEUDO_TE_IS:
case VTYPE_ES:
case VTYPE_IPREACH_TE:
case VTYPE_IP6REACH_INTERNAL:
case VTYPE_IP6REACH_EXTERNAL:
break;
}

View File

@ -1344,7 +1344,8 @@ void isis_te_lsp_event(struct isis_lsp *lsp, enum lsp_event event)
case LSP_DEL:
isis_te_delete_lsp(area->mta, lsp0);
break;
default:
case LSP_UNKNOWN:
case LSP_TICK:
break;
}
}

View File

@ -2340,9 +2340,11 @@ static const char *pdu_counter_index_to_name_json(enum pdu_counter_index index)
return "l1-psnp";
case L2_PARTIAL_SEQ_NUM_INDEX:
return "l2-psnp";
default:
case PDU_COUNTER_SIZE:
return "???????";
}
assert(!"Reached end of function where we are not expecting to");
}
static void common_isis_summary_json(struct json_object *json,