]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | #pragma once |
2 | ||
3 | #ifdef __cplusplus | |
4 | extern "C" { | |
5 | #endif | |
6 | ||
7 | #define LIBCEPHD_VER_MAJOR 0 | |
8 | #define LIBCEPHD_VER_MINOR 1 | |
9 | #define LIBCEPHD_VER_PATCH 0 | |
10 | ||
11 | #define LIBCEPHFD_VERSION(maj, min, extra) ((maj << 16) + (min << 8) + extra) | |
12 | #define LIBCEPHFD_VERSION_CODE LIBCEPHD_VERSION(LIBCEPHD_VER_MAJOR, LIBCEPHD_VER_MINOR, LIBCEPHD_VER_PATCH) | |
13 | ||
14 | #define CEPH_LIBCEPHD_API __attribute__ ((visibility ("default"))) | |
15 | ||
16 | /** | |
17 | * Get the API version of libcephd. We use semantic versioning | |
18 | * for the API: | |
19 | * | |
20 | * - incrementing major is for backwards-incompatible changes | |
21 | * - incrementing minor is for backwards-compatible changes | |
22 | * - incrementing extra is for bug fixes | |
23 | * | |
24 | * @param pmajor where to store the major version number | |
25 | * @param pminor where to store the minor version number | |
26 | * @param ppatch where to store the patch version number | |
27 | */ | |
28 | CEPH_LIBCEPHD_API void cephd_version(int *pmajor, int *pminor, int *ppatch); | |
29 | ||
30 | /** | |
31 | * Gets the runtime version of ceph. | |
32 | * | |
33 | * @param pmajor where to store the major version number | |
34 | * @param pminor where to store the minor version number | |
35 | * @param ppatch where to store the patch version number | |
36 | */ | |
37 | CEPH_LIBCEPHD_API const char *ceph_version(int *pmajor, int *pminor, int *ppatch); | |
38 | ||
39 | /** | |
40 | * Generates a new cluster id (fsid) and returns a hexadecimal string. | |
41 | * | |
42 | * @param context where to the store the handle | |
43 | * @param buf where to write the fsid | |
44 | * @param len the size of buf in bytes (should be at least 37) | |
45 | * @returns 0 on success, negative error code on failure | |
46 | * @returns -ERANGE if the buffer is too short to contain the key | |
47 | */ | |
48 | CEPH_LIBCEPHD_API int cephd_generate_fsid(char *buf, size_t len); | |
49 | ||
50 | /** | |
51 | * Generates a new secret key and returns a base64 encoded string. | |
52 | * | |
53 | * @param context where to the store the handle | |
54 | * @param buf where to write the fsid | |
55 | * @param len the size of buf in bytes | |
56 | * @returns 0 on success, negative error code on failure | |
57 | * @returns -ERANGE if the buffer is too short to contain the key | |
58 | */ | |
59 | CEPH_LIBCEPHD_API int cephd_generate_secret_key(char *buf, size_t len); | |
60 | ||
61 | /** | |
62 | * Runs ceph-mon passing in command line args | |
63 | * | |
64 | * @param argc number of parameters | |
65 | * @param argv array of string arguments | |
66 | * @returns 0 on success, negative error code on failure | |
67 | */ | |
68 | CEPH_LIBCEPHD_API int cephd_run_mon(int argc, const char **argv); | |
69 | ||
70 | /** | |
71 | * Runs ceph-osd passing in command line args | |
72 | * | |
73 | * @param argc number of parameters | |
74 | * @param argv array of string arguments | |
75 | * @returns 0 on success, negative error code on failure | |
76 | */ | |
77 | CEPH_LIBCEPHD_API int cephd_run_osd(int argc, const char **argv); | |
78 | ||
79 | /** | |
80 | * Runs ceph-mds passing in command line args | |
81 | * | |
82 | * @param argc number of parameters | |
83 | * @param argv array of string arguments | |
84 | * @returns 0 on success, negative error code on failure | |
85 | */ | |
86 | CEPH_LIBCEPHD_API int cephd_run_mds(int argc, const char **argv); | |
87 | ||
88 | /** | |
89 | * Runs ceph-rgw passing in command line args | |
90 | * | |
91 | * @param argc number of parameters | |
92 | * @param argv array of string arguments | |
93 | * @returns 0 on success, negative error code on failure | |
94 | */ | |
95 | CEPH_LIBCEPHD_API int cephd_run_rgw(int argc, const char **argv); | |
96 | ||
97 | /** | |
98 | * Runs radosgw-admin passing in command line args | |
99 | * | |
100 | * @param argc number of parameters | |
101 | * @param argv array of string arguments | |
102 | * @returns 0 on success, negative error code on failure | |
103 | */ | |
104 | CEPH_LIBCEPHD_API int cephd_run_rgw_admin(int argc, const char **argv); | |
105 | ||
106 | #ifdef __cplusplus | |
107 | } | |
108 | #endif |