X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fovsdb-data.h;h=3f2d489437e5a42d067626a273382a11eae13029;hb=36775dad3505929f8370166c33e8e0f04ca96c1c;hp=35c4e3075ca10b56852081db599a44506d14fb36;hpb=58fda1dab104041fc693032475ec4662c1a52849;p=openvswitch diff --git a/lib/ovsdb-data.h b/lib/ovsdb-data.h index 35c4e307..3f2d4894 100644 --- a/lib/ovsdb-data.h +++ b/lib/ovsdb-data.h @@ -84,6 +84,8 @@ void ovsdb_datum_clone(struct ovsdb_datum *, const struct ovsdb_datum *, const struct ovsdb_type *); void ovsdb_datum_destroy(struct ovsdb_datum *, const struct ovsdb_type *); void ovsdb_datum_swap(struct ovsdb_datum *, struct ovsdb_datum *); +struct ovsdb_error *ovsdb_datum_sort(struct ovsdb_datum *, + const struct ovsdb_type *); struct ovsdb_error *ovsdb_datum_from_json(struct ovsdb_datum *, const struct ovsdb_type *, @@ -108,6 +110,14 @@ bool ovsdb_datum_excludes_all(const struct ovsdb_datum *, const struct ovsdb_datum *, const struct ovsdb_type *); +void ovsdb_datum_union(struct ovsdb_datum *, + const struct ovsdb_datum *, + const struct ovsdb_type *); +void ovsdb_datum_subtract(struct ovsdb_datum *a, + const struct ovsdb_type *a_type, + const struct ovsdb_datum *b, + const struct ovsdb_type *b_type); + static inline bool ovsdb_datum_conforms_to_type(const struct ovsdb_datum *datum, const struct ovsdb_type *type) @@ -118,11 +128,16 @@ ovsdb_datum_conforms_to_type(const struct ovsdb_datum *datum, /* A table mapping from names to data items. Currently the data items are * always UUIDs; perhaps this will be expanded in the future. */ +struct ovsdb_symbol { + struct uuid uuid; /* The UUID that the symbol represents. */ + bool used; /* Already used as row UUID? */ +}; + struct ovsdb_symbol_table *ovsdb_symbol_table_create(void); void ovsdb_symbol_table_destroy(struct ovsdb_symbol_table *); -const struct uuid *ovsdb_symbol_table_get(const struct ovsdb_symbol_table *, - const char *name); +struct ovsdb_symbol *ovsdb_symbol_table_get(const struct ovsdb_symbol_table *, + const char *name); void ovsdb_symbol_table_put(struct ovsdb_symbol_table *, const char *name, - const struct uuid *); + const struct uuid *, bool used); #endif /* ovsdb-data.h */