]>
git.proxmox.com Git - mirror_ovs.git/blob - ovsdb/transaction.h
1 /* Copyright (c) 2009, 2010, 2017 Nicira, Inc.
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:
7 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 #ifndef OVSDB_TRANSACTION_H
17 #define OVSDB_TRANSACTION_H 1
27 struct ovsdb_txn
*ovsdb_txn_create(struct ovsdb
*);
28 void ovsdb_txn_abort(struct ovsdb_txn
*);
30 struct ovsdb_error
*ovsdb_txn_replay_commit(struct ovsdb_txn
*)
31 OVS_WARN_UNUSED_RESULT
;
32 struct ovsdb_txn_progress
*ovsdb_txn_propose_commit(struct ovsdb_txn
*,
34 OVS_WARN_UNUSED_RESULT
;
35 struct ovsdb_error
*ovsdb_txn_propose_commit_block(struct ovsdb_txn
*,
37 OVS_WARN_UNUSED_RESULT
;
38 void ovsdb_txn_complete(struct ovsdb_txn
*);
40 struct ovsdb_txn_progress
*ovsdb_txn_propose_schema_change(
41 struct ovsdb
*, const struct json
*schema
, const struct json
*data
);
43 bool ovsdb_txn_progress_is_complete(const struct ovsdb_txn_progress
*);
44 const struct ovsdb_error
*ovsdb_txn_progress_get_error(
45 const struct ovsdb_txn_progress
*);
46 void ovsdb_txn_progress_destroy(struct ovsdb_txn_progress
*);
48 struct ovsdb_row
*ovsdb_txn_row_modify(struct ovsdb_txn
*,
49 const struct ovsdb_row
*);
50 void ovsdb_txn_row_insert(struct ovsdb_txn
*, struct ovsdb_row
*);
51 void ovsdb_txn_row_delete(struct ovsdb_txn
*, const struct ovsdb_row
*);
53 typedef bool ovsdb_txn_row_cb_func(const struct ovsdb_row
*old
,
54 const struct ovsdb_row
*new,
55 const unsigned long int *changed
,
57 void ovsdb_txn_for_each_change(const struct ovsdb_txn
*,
58 ovsdb_txn_row_cb_func
*, void *aux
);
60 void ovsdb_txn_add_comment(struct ovsdb_txn
*, const char *);
61 const char *ovsdb_txn_get_comment(const struct ovsdb_txn
*);
63 #endif /* ovsdb/transaction.h */