summaryrefslogtreecommitdiff
path: root/lib/ovsdb-types.h
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2010-02-25 14:59:33 -0800
committerBen Pfaff <blp@nicira.com>2010-02-25 14:59:41 -0800
commitbfc96d9b50ae119fcbf39a9511bd9f662e7ad390 (patch)
tree254e753c940fa0997879b1494ef01d0558d91a4b /lib/ovsdb-types.h
parenta26cc67c16932fa9d07da200bbff75889cfe7529 (diff)
downloadopenvswitch-bfc96d9b50ae119fcbf39a9511bd9f662e7ad390.tar.gz
ovsdb: Add support for "enum" constraints.
Some of the uses for the formerly supported regular expression constraints were simply to limit values to those in a set of allowed values. This commit adds support for that kind of simple enumeration constraint.
Diffstat (limited to 'lib/ovsdb-types.h')
-rw-r--r--lib/ovsdb-types.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/ovsdb-types.h b/lib/ovsdb-types.h
index 0ef596ab0..6f1727ed1 100644
--- a/lib/ovsdb-types.h
+++ b/lib/ovsdb-types.h
@@ -46,6 +46,11 @@ struct json *ovsdb_atomic_type_to_json(enum ovsdb_atomic_type);
struct ovsdb_base_type {
enum ovsdb_atomic_type type;
+
+ /* If nonnull, a datum with keys of type 'type' that expresses all the
+ * valid values for this base_type. */
+ struct ovsdb_datum *enum_;
+
union {
struct ovsdb_integer_constraints {
int64_t min; /* minInteger or INT64_MIN. */
@@ -90,6 +95,7 @@ void ovsdb_base_type_destroy(struct ovsdb_base_type *);
bool ovsdb_base_type_is_valid(const struct ovsdb_base_type *);
bool ovsdb_base_type_has_constraints(const struct ovsdb_base_type *);
void ovsdb_base_type_clear_constraints(struct ovsdb_base_type *);
+const struct ovsdb_type *ovsdb_base_type_get_enum_type(enum ovsdb_atomic_type);
struct ovsdb_error *ovsdb_base_type_from_json(struct ovsdb_base_type *,
const struct json *)