X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=ovsdb%2Fserver.h;h=561f01ebf3b5b00b99c8c876305e374af284db88;hb=49a4902d76b9149e4fa399bde6d5cb9a91e64c07;hp=17e4222195f9ab6cbcc6825d54e44a7b805d9759;hpb=6e492d81450217a5c90cbb4ad31d81b1e611989b;p=openvswitch diff --git a/ovsdb/server.h b/ovsdb/server.h index 17e42221..561f01eb 100644 --- a/ovsdb/server.h +++ b/ovsdb/server.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2012 Nicira Networks +/* Copyright (c) 2011, 2012 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,17 +18,21 @@ #include "hmap.h" #include "list.h" +#include "shash.h" + +struct ovsdb; +struct ovsdb_server; /* Abstract representation of an OVSDB client connection, not tied to any * particular network protocol. Protocol implementations * (e.g. jsonrpc-server.c) embed this in a larger data structure. */ struct ovsdb_session { - struct ovsdb *db; + struct ovsdb_server *server; struct list completions; /* Completed triggers. */ struct hmap waiters; /* "ovsdb_lock_waiter *"s by lock name. */ }; -void ovsdb_session_init(struct ovsdb_session *, struct ovsdb *); +void ovsdb_session_init(struct ovsdb_session *, struct ovsdb_server *); void ovsdb_session_destroy(struct ovsdb_session *); struct ovsdb_lock_waiter *ovsdb_session_get_lock_waiter( @@ -73,11 +77,12 @@ bool ovsdb_lock_waiter_is_owner(const struct ovsdb_lock_waiter *); * network protocol. Protocol implementations (e.g. jsonrpc-server.c) embed * this in a larger data structure. */ struct ovsdb_server { - struct ovsdb *db; + struct shash dbs; /* Maps from a db name to a "struct ovsdb *". */ struct hmap locks; /* Contains "struct ovsdb_lock"s indexed by name. */ }; -void ovsdb_server_init(struct ovsdb_server *, struct ovsdb *); +void ovsdb_server_init(struct ovsdb_server *); +bool ovsdb_server_add_db(struct ovsdb_server *, struct ovsdb *); void ovsdb_server_destroy(struct ovsdb_server *); struct ovsdb_lock_waiter *ovsdb_server_lock(struct ovsdb_server *,