+static struct ovsdb_error * WARN_UNUSED_RESULT
+ovsdb_schema_check_ref_table(const struct ovsdb_column *column,
+ const struct shash *tables,
+ const struct ovsdb_base_type *base,
+ const char *base_name)
+{
+ if (base->type == OVSDB_TYPE_UUID && base->u.uuid.refTableName
+ && !shash_find(tables, base->u.uuid.refTableName)) {
+ return ovsdb_syntax_error(NULL, NULL,
+ "column %s %s refers to undefined table %s",
+ column->name, base_name,
+ base->u.uuid.refTableName);
+ } else {
+ return NULL;
+ }
+}
+
+static bool
+is_valid_version(const char *s)
+{
+ int n = -1;
+ ignore(sscanf(s, "%*[0-9].%*[0-9].%*[0-9]%n", &n));
+ return n != -1 && s[n] == '\0';
+}
+
+/* Returns the number of tables in 'schema''s root set. */
+static size_t
+root_set_size(const struct ovsdb_schema *schema)
+{
+ struct shash_node *node;
+ size_t n_root = 0;
+
+ SHASH_FOR_EACH (node, &schema->tables) {
+ struct ovsdb_table_schema *table = node->data;
+
+ n_root += table->is_root;
+ }
+ return n_root;
+}
+