]> git.proxmox.com Git - pve-cluster.git/blame - data/src/dcdb.h
buildsys: add sbuild convenience target
[pve-cluster.git] / data / src / dcdb.h
CommitLineData
fe000966 1/*
84c98315 2 Copyright (C) 2010 - 2020 Proxmox Server Solutions GmbH
fe000966
DM
3
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU Affero General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU Affero General Public License for more details.
13
14 You should have received a copy of the GNU Affero General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>.
16
17 Author: Dietmar Maurer <dietmar@proxmox.com>
18
19*/
20
21#ifndef _PVE_DCDB_H_
22#define _PVE_DCDB_H_
23
24#include <glib.h>
25
26#include "dfsm.h"
27#include "memdb.h"
28
29#define DCDB_CPG_GROUP_NAME "pve_dcdb_v1"
30/* please increase protocol version if you want to stop older nodes */
31#define DCDB_PROTOCOL_VERSION 1
32#define DCDB_VERIFY_TIME (60*60)
33
34typedef enum {
35 DCDB_MESSAGE_CFS_WRITE = 1,
36 DCDB_MESSAGE_CFS_MKDIR = 2,
37 DCDB_MESSAGE_CFS_DELETE = 3,
38 DCDB_MESSAGE_CFS_RENAME = 4,
39 DCDB_MESSAGE_CFS_CREATE = 5,
40 DCDB_MESSAGE_CFS_MTIME = 6,
41 DCDB_MESSAGE_CFS_UNLOCK_REQUEST = 7,
42 DCDB_MESSAGE_CFS_UNLOCK = 8,
43} dcdb_message_t;
44
45#define DCDB_VALID_MESSAGE_TYPE(mt) (mt >= DCDB_MESSAGE_CFS_WRITE && mt <= DCDB_MESSAGE_CFS_UNLOCK)
46
47dfsm_t *dcdb_new(memdb_t *memdb);
48
2113d031 49void dcdb_sync_corosync_conf(
fe000966 50 memdb_t *memdb,
2113d031 51 gboolean notify_corosync);
fe000966
DM
52
53int dcdb_send_fuse_message(
54 dfsm_t *dfsm,
55 dcdb_message_t msg_type,
56 const char *path,
57 const char *to,
58 const char *buf,
59 guint32 size,
60 guint32 offset,
61 guint32 flags);
62
63void
64dcdb_send_unlock(
65 dfsm_t *dfsm,
66 const char *path,
67 const guchar csum[32],
68 gboolean request);
69
70#endif /* _PVE_DCDB_H_ */