1 /* Copyright (c) 2009 Nicira Networks.
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.
19 struct ovsdb_idl_class;
21 struct ovsdb_idl *ovsdb_idl_create(const char *remote,
22 const struct ovsdb_idl_class *);
23 void ovsdb_idl_destroy(struct ovsdb_idl *);
25 void ovsdb_idl_run(struct ovsdb_idl *);
26 void ovsdb_idl_wait(struct ovsdb_idl *);
28 unsigned int ovsdb_idl_get_seqno(const struct ovsdb_idl *);
29 void ovsdb_idl_force_reconnect(struct ovsdb_idl *);
31 enum ovsdb_idl_txn_status {
32 TXN_INCOMPLETE, /* Commit in progress, please wait. */
33 TXN_ABORTED, /* ovsdb_idl_txn_abort() called. */
34 TXN_SUCCESS, /* Commit successful. */
35 TXN_TRY_AGAIN, /* Commit failed because a "verify" operation
36 * reported an inconsistency, due to a network
37 * problem, or other transient failure. */
38 TXN_ERROR /* Commit failed due to a hard error. */
41 const char *ovsdb_idl_txn_status_to_string(enum ovsdb_idl_txn_status);
43 struct ovsdb_idl_txn *ovsdb_idl_txn_create(struct ovsdb_idl *);
44 void ovsdb_idl_txn_set_dry_run(struct ovsdb_idl_txn *);
45 void ovsdb_idl_txn_destroy(struct ovsdb_idl_txn *);
46 void ovsdb_idl_txn_wait(const struct ovsdb_idl_txn *);
47 enum ovsdb_idl_txn_status ovsdb_idl_txn_commit(struct ovsdb_idl_txn *);
48 void ovsdb_idl_txn_abort(struct ovsdb_idl_txn *);
50 #endif /* ovsdb-idl.h */