]> git.puffer.fish Git - matthieu/frr.git/commitdiff
lib: Add missing enum's to northbound.c
authorDonald Sharp <sharpd@nvidia.com>
Fri, 27 Jan 2023 13:48:47 +0000 (08:48 -0500)
committerDonald Sharp <sharpd@nvidia.com>
Tue, 31 Jan 2023 17:29:08 +0000 (12:29 -0500)
Some enums were missing for string conversions in northbound.c

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
lib/northbound.c

index ccfc3840ecc4d8a00d5bf7dc07d4878c5077f20e..6a014f37ba965044bfa2961985442621ad592f79 100644 (file)
@@ -731,7 +731,13 @@ int nb_candidate_edit(struct nb_config *candidate,
        case NB_OP_MOVE:
                /* TODO: update configuration. */
                break;
-       default:
+       case NB_OP_PRE_VALIDATE:
+       case NB_OP_APPLY_FINISH:
+       case NB_OP_GET_ELEM:
+       case NB_OP_GET_NEXT:
+       case NB_OP_GET_KEYS:
+       case NB_OP_LOOKUP_ENTRY:
+       case NB_OP_RPC:
                flog_warn(EC_LIB_DEVELOPMENT,
                          "%s: unknown operation (%u) [xpath %s]", __func__,
                          operation, xpath_edit);
@@ -1360,7 +1366,13 @@ static int nb_callback_configuration(struct nb_context *context,
                ret = nb_callback_move(context, nb_node, event, dnode, errmsg,
                                       errmsg_len);
                break;
-       default:
+       case NB_OP_PRE_VALIDATE:
+       case NB_OP_APPLY_FINISH:
+       case NB_OP_GET_ELEM:
+       case NB_OP_GET_NEXT:
+       case NB_OP_GET_KEYS:
+       case NB_OP_LOOKUP_ENTRY:
+       case NB_OP_RPC:
                yang_dnode_get_path(dnode, xpath, sizeof(xpath));
                flog_err(EC_LIB_DEVELOPMENT,
                         "%s: unknown operation (%u) [xpath %s]", __func__,
@@ -1489,7 +1501,7 @@ static int nb_transaction_process(enum nb_event event,
                         * 'prepare' phase.
                         */
                        break;
-               default:
+               case NB_EV_VALIDATE:
                        break;
                }
        }
@@ -2319,9 +2331,9 @@ const char *nb_event_name(enum nb_event event)
                return "abort";
        case NB_EV_APPLY:
                return "apply";
-       default:
-               return "unknown";
        }
+
+       assert(!"Reached end of function we should never hit");
 }
 
 const char *nb_operation_name(enum nb_operation operation)
@@ -2349,9 +2361,9 @@ const char *nb_operation_name(enum nb_operation operation)
                return "lookup_entry";
        case NB_OP_RPC:
                return "rpc";
-       default:
-               return "unknown";
        }
+
+       assert(!"Reached end of function we should never hit");
 }
 
 const char *nb_err_name(enum nb_error error)
@@ -2373,9 +2385,9 @@ const char *nb_err_name(enum nb_error error)
                return "failed to allocate resource";
        case NB_ERR_INCONSISTENCY:
                return "internal inconsistency";
-       default:
-               return "unknown";
        }
+
+       assert(!"Reached end of function we should never hit");
 }
 
 const char *nb_client_name(enum nb_client client)
@@ -2389,9 +2401,13 @@ const char *nb_client_name(enum nb_client client)
                return "Sysrepo";
        case NB_CLIENT_GRPC:
                return "gRPC";
-       default:
-               return "unknown";
+       case NB_CLIENT_PCEP:
+               return "Pcep";
+       case NB_CLIENT_NONE:
+               return "None";
        }
+
+       assert(!"Reached end of function we should never hit");
 }
 
 static void nb_load_callbacks(const struct frr_yang_module_info *module)