]> git.proxmox.com Git - mirror_ovs.git/blob - ovsdb/replication.h
ovsdb replication: Provide option to configure probe interval.
[mirror_ovs.git] / ovsdb / replication.h
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
21 #include <stdbool.h>
22 struct ovsdb;
23
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
47 #define REPLICATION_DEFAULT_PROBE_INTERVAL 60000
48
49 void replication_init(const char *sync_from, const char *exclude_tables,
50 const struct uuid *server, int probe_interval);
51 void replication_run(void);
52 void replication_wait(void);
53 void replication_destroy(void);
54 void replication_usage(void);
55 void replication_add_local_db(const char *databse, struct ovsdb *db);
56 bool replication_is_alive(void);
57 int replication_get_last_error(void);
58 char *replication_status(void);
59 void replication_set_probe_interval(int);
60
61 char *set_blacklist_tables(const char *blacklist, bool dryrun)
62 OVS_WARN_UNUSED_RESULT;
63 char *get_blacklist_tables(void) OVS_WARN_UNUSED_RESULT;
64 void disconnect_active_server(void);
65
66 #endif /* ovsdb/replication.h */