X-Git-Url: http://git.cascardo.eti.br/?a=blobdiff_plain;f=ovsdb%2Ftable.h;h=68a59add4150315e3c09e8cc9b50f72ba2d331af;hb=HEAD;hp=4d3b9ee72db8a2f3ce6ff93877d5ebfdea98a808;hpb=87ab878cadeb8cf5f8f89a7d00bfc64ee6b4edbf;p=cascardo%2Fovs.git diff --git a/ovsdb/table.h b/ovsdb/table.h index 4d3b9ee72..68a59add4 100644 --- a/ovsdb/table.h +++ b/ovsdb/table.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2009, 2010 Nicira Networks +/* Copyright (c) 2009, 2010, 2011 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,11 +30,13 @@ struct ovsdb_table_schema { bool mutable; 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(const char *name, - bool mutable, - unsigned int max_rows); +struct ovsdb_table_schema *ovsdb_table_schema_create( + const char *name, bool mutable, unsigned int max_rows, bool is_root); struct ovsdb_table_schema *ovsdb_table_schema_clone( const struct ovsdb_table_schema *); void ovsdb_table_schema_destroy(struct ovsdb_table_schema *); @@ -42,8 +44,9 @@ void ovsdb_table_schema_destroy(struct ovsdb_table_schema *); struct ovsdb_error *ovsdb_table_schema_from_json(const struct json *, const char *name, struct ovsdb_table_schema **) - WARN_UNUSED_RESULT; -struct json *ovsdb_table_schema_to_json(const struct ovsdb_table_schema *); + OVS_WARN_UNUSED_RESULT; +struct json *ovsdb_table_schema_to_json(const struct ovsdb_table_schema *, + bool default_is_root); const struct ovsdb_column *ovsdb_table_schema_get_column( const struct ovsdb_table_schema *, const char *name); @@ -54,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 *); @@ -61,6 +69,5 @@ void ovsdb_table_destroy(struct ovsdb_table *); const struct ovsdb_row *ovsdb_table_get_row(const struct ovsdb_table *, const struct uuid *); -bool ovsdb_table_put_row(struct ovsdb_table *, struct ovsdb_row *); #endif /* ovsdb/table.h */