]> git.proxmox.com Git - mirror_ovs.git/blame - ovsdb/monitor.h
dist-docs: Include manpages generated from rST.
[mirror_ovs.git] / ovsdb / monitor.h
CommitLineData
2fa1df7b 1/*
009bf21f 2 * Copyright (c) 2015, 2017 Nicira, Inc.
2fa1df7b
AZ
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at:
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef OVSDB_MONITOR_H
18#define OVSDB_MONITOR_H
19
009bf21f
BP
20struct ovsdb;
21struct ovsdb_column;
2fa1df7b 22struct ovsdb_monitor;
85226894 23struct ovsdb_jsonrpc_monitor;
71cdf7cd
LS
24struct ovsdb_monitor_session_condition;
25struct ovsdb_condition;
009bf21f
BP
26struct ovsdb_txn;
27struct simap;
2fa1df7b
AZ
28
29enum ovsdb_monitor_selection {
71cdf7cd 30 OJMS_NONE = 0, /* None for this iteration */
2fa1df7b
AZ
31 OJMS_INITIAL = 1 << 0, /* All rows when monitor is created. */
32 OJMS_INSERT = 1 << 1, /* New rows. */
33 OJMS_DELETE = 1 << 2, /* Deleted rows. */
34 OJMS_MODIFY = 1 << 3 /* Modified rows. */
35};
36
37
52553aea
AZ
38enum ovsdb_monitor_version {
39 OVSDB_MONITOR_V1, /* RFC 7047 "monitor" method. */
40 OVSDB_MONITOR_V2, /* Extension to RFC 7047, see ovsdb-server
41 man page for details. */
9167cb52
HZ
42 OVSDB_MONITOR_V3, /* Extension to V2, see ovsdb-server man
43 page for details. */
52553aea
AZ
44
45 /* Last entry. */
46 OVSDB_MONITOR_VERSION_MAX
47};
48
be084595
HZ
49struct ovsdb_monitor *ovsdb_monitor_create(struct ovsdb *,
50 struct ovsdb_jsonrpc_monitor *);
009bf21f
BP
51void ovsdb_monitors_remove(struct ovsdb *);
52void ovsdb_monitors_commit(struct ovsdb *, const struct ovsdb_txn *);
6e5a9216 53
53178986
BP
54void ovsdb_monitor_prereplace_db(struct ovsdb *);
55
be084595 56struct ovsdb_monitor *ovsdb_monitor_add(struct ovsdb_monitor *);
6e5a9216 57
be084595
HZ
58void ovsdb_monitor_add_jsonrpc_monitor(struct ovsdb_monitor *,
59 struct ovsdb_jsonrpc_monitor *);
6e5a9216 60
222bed54 61struct ovsdb_monitor_change_set;
be084595
HZ
62void ovsdb_monitor_remove_jsonrpc_monitor(struct ovsdb_monitor *,
63 struct ovsdb_jsonrpc_monitor *,
222bed54 64 struct ovsdb_monitor_change_set *);
d9412837 65
be084595
HZ
66void ovsdb_monitor_add_table(struct ovsdb_monitor *,
67 const struct ovsdb_table *);
2fa1df7b 68
be084595
HZ
69const char * ovsdb_monitor_add_column(struct ovsdb_monitor *,
70 const struct ovsdb_table *,
71 const struct ovsdb_column *,
72 enum ovsdb_monitor_selection,
845a1187
LS
73 bool monitored);
74bool
be084595
HZ
75ovsdb_monitor_table_exists(struct ovsdb_monitor *,
76 const struct ovsdb_table *);
845a1187 77
be084595 78struct json *ovsdb_monitor_get_update(struct ovsdb_monitor *,
845a1187
LS
79 bool initial,
80 bool cond_updated,
be084595
HZ
81 struct ovsdb_monitor_session_condition *,
82 enum ovsdb_monitor_version,
222bed54 83 struct ovsdb_monitor_change_set **p_mcs);
2fa1df7b 84
9167cb52
HZ
85const struct uuid *ovsdb_monitor_get_last_txnid(struct ovsdb_monitor *);
86
be084595
HZ
87void ovsdb_monitor_table_add_select(struct ovsdb_monitor *,
88 const struct ovsdb_table *,
89 enum ovsdb_monitor_selection);
2fa1df7b 90
be084595 91bool ovsdb_monitor_needs_flush(struct ovsdb_monitor *,
222bed54 92 struct ovsdb_monitor_change_set *);
2fa1df7b 93
222bed54
HZ
94void ovsdb_monitor_get_initial(struct ovsdb_monitor *,
95 struct ovsdb_monitor_change_set **);
9167cb52
HZ
96void ovsdb_monitor_get_changes_after(const struct uuid *txn_uuid,
97 struct ovsdb_monitor *, struct ovsdb_monitor_change_set **);
e0c73ed1 98
be084595 99void ovsdb_monitor_get_memory_usage(struct simap *);
71cdf7cd
LS
100
101struct ovsdb_monitor_session_condition *
102ovsdb_monitor_session_condition_create(void);
103
104void
105ovsdb_monitor_session_condition_destroy(
be084595 106 struct ovsdb_monitor_session_condition *);
71cdf7cd
LS
107struct ovsdb_error *
108ovsdb_monitor_table_condition_create(
be084595
HZ
109 struct ovsdb_monitor_session_condition *,
110 const struct ovsdb_table *,
71cdf7cd
LS
111 const struct json *json_cnd);
112
113void
be084595
HZ
114ovsdb_monitor_condition_bind(struct ovsdb_monitor *,
115 struct ovsdb_monitor_session_condition *);
71cdf7cd 116
845a1187
LS
117struct ovsdb_error *
118ovsdb_monitor_table_condition_update(
be084595
HZ
119 struct ovsdb_monitor *,
120 struct ovsdb_monitor_session_condition *,
121 const struct ovsdb_table *,
845a1187
LS
122 const struct json *cond_json);
123
2fa1df7b 124#endif