]>
Commit | Line | Data |
---|---|---|
eafe8130 TL |
1 | #ifndef _SRC_MOUNT_MOUNT_CEPH_H |
2 | #define _SRC_MOUNT_MOUNT_CEPH_H | |
3 | ||
4 | #ifdef __cplusplus | |
5 | extern "C" { | |
6 | #endif | |
7 | ||
8 | /* | |
9 | * See class CryptoKey | |
10 | * | |
11 | * 2 (for the type of secret) + | |
12 | * 8 (for the timestamp) + | |
13 | * 2 (for the length of secret) + | |
14 | * 16 (for an AES-128 key) | |
15 | */ | |
16 | #define MAX_RAW_SECRET_LEN (2 + 8 + 2 + 16) | |
17 | ||
18 | /* Max length of base64 encoded secret. 4/3 original size (rounded up) */ | |
19 | #define MAX_SECRET_LEN ((MAX_RAW_SECRET_LEN + (3 - 1)) * 4 / 3) | |
20 | ||
21 | /* Max Including null terminator */ | |
22 | #define SECRET_BUFSIZE (MAX_SECRET_LEN + 1) | |
23 | ||
eafe8130 TL |
24 | /* 2k should be enough for anyone? */ |
25 | #define MON_LIST_BUFSIZE 2048 | |
26 | ||
27 | void mount_ceph_debug(const char *fmt, ...); | |
28 | ||
29 | struct ceph_config_info { | |
30 | char cci_secret[SECRET_BUFSIZE]; // auth secret | |
31 | char cci_mons[MON_LIST_BUFSIZE]; // monitor addrs | |
32 | }; | |
33 | ||
34 | void mount_ceph_get_config_info(const char *config_file, const char *name, | |
35 | struct ceph_config_info *cci); | |
36 | ||
37 | #ifdef __cplusplus | |
38 | } | |
39 | #endif | |
40 | ||
41 | #endif /* _SRC_MOUNT_MOUNT_CEPH_H */ |