+/* Returns the type of the 'enum_' member for an ovsdb_base_type whose 'type'
+ * is 'atomic_type'. */
+const struct ovsdb_type *
+ovsdb_base_type_get_enum_type(enum ovsdb_atomic_type atomic_type)
+{
+ static struct ovsthread_once once = OVSTHREAD_ONCE_INITIALIZER;
+ static struct ovsdb_type *types[OVSDB_N_TYPES];
+
+ if (ovsthread_once_start(&once)) {
+ enum ovsdb_atomic_type i;
+
+ for (i = 0; i < OVSDB_N_TYPES; i++) {
+ struct ovsdb_type *type;
+
+ types[i] = type = xmalloc(sizeof *type);
+ ovsdb_base_type_init(&type->key, i);
+ ovsdb_base_type_init(&type->value, OVSDB_TYPE_VOID);
+ type->n_min = 1;
+ type->n_max = UINT_MAX;
+ }
+
+ ovsthread_once_done(&once);
+ }
+ return types[atomic_type];
+}
+