ovsdb: Refactor jsonrpc-server to make the concept of a session public.
[sliver-openvswitch.git] / ovsdb / server.c
1 /* Copyright (c) 2011 Nicira Networks
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at:
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15
16 #include <config.h>
17
18 #include "server.h"
19
20 /* Initializes 'session' as a session that operates on 'db'. */
21 void
22 ovsdb_session_init(struct ovsdb_session *session, struct ovsdb *db)
23 {
24     session->db = db;
25     list_init(&session->completions);
26 }
27
28 /* Destroys 'session'. */
29 void
30 ovsdb_session_destroy(struct ovsdb_session *session OVS_UNUSED)
31 {
32 }
33
34 /* Initializes 'server' as a server that operates on 'db'. */
35 void
36 ovsdb_server_init(struct ovsdb_server *server, struct ovsdb *db)
37 {
38     server->db = db;
39 }
40
41 /* Destroys 'server'. */
42 void
43 ovsdb_server_destroy(struct ovsdb_server *server OVS_UNUSED)
44 {
45 }