]>
Commit | Line | Data |
---|---|---|
ae671c5f MC |
1 | /* |
2 | * (c) Copyright 2016 Hewlett Packard Enterprise Development LP | |
3 | * Copyright (c) 2009, 2010, 2012, 2013 Nicira, Inc. | |
4 | * | |
5 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
6 | * you may not use this file except in compliance with the License. | |
7 | * You may obtain a copy of the License at: | |
8 | * | |
9 | * http://www.apache.org/licenses/LICENSE-2.0 | |
10 | * | |
11 | * Unless required by applicable law or agreed to in writing, software | |
12 | * distributed under the License is distributed on an "AS IS" BASIS, | |
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
14 | * See the License for the specific language governing permissions and | |
15 | * limitations under the License. | |
16 | */ | |
17 | ||
18 | #ifndef REPLICATION_H | |
19 | #define REPLICATION_H 1 | |
20 | ||
3109b4e1 | 21 | #include <stdbool.h> |
6ab3dd96 | 22 | struct ovsdb; |
ae671c5f | 23 | |
60e0cd04 AZ |
24 | /* Replication module runs when OVSDB server runs in the backup mode. |
25 | * | |
26 | * API Usage | |
27 | *=========== | |
28 | * | |
29 | * - replication_init() needs to be called whenever OVSDB server switches into | |
30 | * the backup mode. | |
31 | * | |
32 | * - replication_add_local_db() should be called immediately after to add all | |
33 | * known database that OVSDB server owns, one at a time. | |
34 | * | |
35 | * - replication_destroy() should be called when OVSDB server shutdown to | |
36 | * reclaim resources. | |
37 | * | |
38 | * - replication_run(), replication_wait(), replication_is_alive() and | |
39 | * replication_get_last_error() should be call within the main loop | |
40 | * whenever OVSDB server runs in the backup mode. | |
41 | * | |
42 | * - set_blacklist_tables(), get_blacklist_tables(), | |
43 | * disconnect_active_server() and replication_usage() are support functions | |
44 | * used mainly by uinxctl commands. | |
45 | */ | |
46 | ||
05ac209a AZ |
47 | void replication_init(const char *sync_from, const char *exclude_tables, |
48 | const struct uuid *server); | |
6ab3dd96 | 49 | void replication_run(void); |
8c945cec | 50 | void replication_wait(void); |
3109b4e1 AZ |
51 | void replication_destroy(void); |
52 | void replication_usage(void); | |
23c16b51 AZ |
53 | void replication_add_local_db(const char *databse, struct ovsdb *db); |
54 | bool replication_is_alive(void); | |
55 | int replication_get_last_error(void); | |
60e0cd04 | 56 | char *replication_status(void); |
3109b4e1 | 57 | |
3109b4e1 AZ |
58 | char *set_blacklist_tables(const char *blacklist, bool dryrun) |
59 | OVS_WARN_UNUSED_RESULT; | |
60 | char *get_blacklist_tables(void) OVS_WARN_UNUSED_RESULT; | |
f53d7518 | 61 | void disconnect_active_server(void); |
ae671c5f MC |
62 | |
63 | #endif /* ovsdb/replication.h */ |