]>
Commit | Line | Data |
---|---|---|
a529e3cd | 1 | /* Copyright (c) 2009, 2010, 2017, 2019 Nicira, Inc. |
f85f8ebb BP |
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 | #ifndef OVSDB_TRANSACTION_H | |
17 | #define OVSDB_TRANSACTION_H 1 | |
18 | ||
19 | #include <stdbool.h> | |
20 | #include "compiler.h" | |
21 | ||
bd06962a | 22 | struct json; |
f85f8ebb BP |
23 | struct ovsdb; |
24 | struct ovsdb_table; | |
25 | struct uuid; | |
26 | ||
27 | struct ovsdb_txn *ovsdb_txn_create(struct ovsdb *); | |
695e8150 | 28 | void ovsdb_txn_set_txnid(const struct uuid *, struct ovsdb_txn *); |
9167cb52 | 29 | const struct uuid *ovsdb_txn_get_txnid(const struct ovsdb_txn *); |
f85f8ebb | 30 | void ovsdb_txn_abort(struct ovsdb_txn *); |
53178986 | 31 | |
2cd62f75 | 32 | bool ovsdb_txn_precheck_prereq(const struct ovsdb *db); |
1b1d2e6d | 33 | struct ovsdb_error *ovsdb_txn_replay_commit(struct ovsdb_txn *) |
53178986 | 34 | OVS_WARN_UNUSED_RESULT; |
1b1d2e6d BP |
35 | struct ovsdb_txn_progress *ovsdb_txn_propose_commit(struct ovsdb_txn *, |
36 | bool durable) | |
53178986 | 37 | OVS_WARN_UNUSED_RESULT; |
1b1d2e6d BP |
38 | struct ovsdb_error *ovsdb_txn_propose_commit_block(struct ovsdb_txn *, |
39 | bool durable) | |
cab50449 | 40 | OVS_WARN_UNUSED_RESULT; |
1b1d2e6d BP |
41 | void ovsdb_txn_complete(struct ovsdb_txn *); |
42 | ||
43 | struct ovsdb_txn_progress *ovsdb_txn_propose_schema_change( | |
44 | struct ovsdb *, const struct json *schema, const struct json *data); | |
45 | ||
46 | bool ovsdb_txn_progress_is_complete(const struct ovsdb_txn_progress *); | |
47 | const struct ovsdb_error *ovsdb_txn_progress_get_error( | |
48 | const struct ovsdb_txn_progress *); | |
49 | void ovsdb_txn_progress_destroy(struct ovsdb_txn_progress *); | |
f85f8ebb BP |
50 | |
51 | struct ovsdb_row *ovsdb_txn_row_modify(struct ovsdb_txn *, | |
52 | const struct ovsdb_row *); | |
f85f8ebb BP |
53 | void ovsdb_txn_row_insert(struct ovsdb_txn *, struct ovsdb_row *); |
54 | void ovsdb_txn_row_delete(struct ovsdb_txn *, const struct ovsdb_row *); | |
55 | ||
a529e3cd BP |
56 | bool ovsdb_txn_may_create_row(const struct ovsdb_table *, |
57 | const struct uuid *row_uuid); | |
58 | ||
bd06962a BP |
59 | typedef bool ovsdb_txn_row_cb_func(const struct ovsdb_row *old, |
60 | const struct ovsdb_row *new, | |
17d18afb | 61 | const unsigned long int *changed, |
bd06962a BP |
62 | void *aux); |
63 | void ovsdb_txn_for_each_change(const struct ovsdb_txn *, | |
64 | ovsdb_txn_row_cb_func *, void *aux); | |
65 | ||
d171b584 BP |
66 | void ovsdb_txn_add_comment(struct ovsdb_txn *, const char *); |
67 | const char *ovsdb_txn_get_comment(const struct ovsdb_txn *); | |
695e8150 | 68 | void ovsdb_txn_history_run(struct ovsdb *); |
c194367c | 69 | void ovsdb_txn_history_init(struct ovsdb *, bool need_txn_history); |
695e8150 | 70 | void ovsdb_txn_history_destroy(struct ovsdb *); |
d171b584 | 71 | |
f85f8ebb | 72 | #endif /* ovsdb/transaction.h */ |