summaryrefslogtreecommitdiff
path: root/ovsdb/table.h
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2011-06-06 09:09:10 -0700
committerBen Pfaff <blp@nicira.com>2011-06-06 09:09:10 -0700
commit6910a6e6f25f7fe7adfd93c8405671e72d4d156b (patch)
tree71fa30e91f096cd368992abbb157a5ee5f65eddc /ovsdb/table.h
parent25d4983554f6cf8ce5e169f7c5bb5a08c981d27e (diff)
downloadopenvswitch-6910a6e6f25f7fe7adfd93c8405671e72d4d156b.tar.gz
ovsdb: Implement table uniqueness constraints ("indexes").
Diffstat (limited to 'ovsdb/table.h')
-rw-r--r--ovsdb/table.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/ovsdb/table.h b/ovsdb/table.h
index 8e9334386..a2f2aa84e 100644
--- a/ovsdb/table.h
+++ b/ovsdb/table.h
@@ -31,6 +31,8 @@ struct ovsdb_table_schema {
struct shash columns; /* Contains "struct ovsdb_column *"s. */
unsigned int max_rows; /* Maximum number of rows. */
bool is_root; /* Part of garbage collection root set? */
+ struct ovsdb_column_set *indexes;
+ size_t n_indexes;
};
struct ovsdb_table_schema *ovsdb_table_schema_create(
@@ -55,6 +57,11 @@ struct ovsdb_table {
struct ovsdb_table_schema *schema;
struct ovsdb_txn_table *txn_table; /* Only if table is in a transaction. */
struct hmap rows; /* Contains "struct ovsdb_row"s. */
+
+ /* An array of schema->n_indexes hmaps, each of which contains "struct
+ * ovsdb_row"s. Each of the hmap_nodes in indexes[i] are at index 'i' at
+ * the end of struct ovsdb_row, following the 'fields' member. */
+ struct hmap *indexes;
};
struct ovsdb_table *ovsdb_table_create(struct ovsdb_table_schema *);