7 #define LIBCEPHD_VER_MAJOR 0
8 #define LIBCEPHD_VER_MINOR 1
9 #define LIBCEPHD_VER_PATCH 0
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)
14 #define CEPH_LIBCEPHD_API __attribute__ ((visibility ("default")))
17 * Get the API version of libcephd. We use semantic versioning
20 * - incrementing major is for backwards-incompatible changes
21 * - incrementing minor is for backwards-compatible changes
22 * - incrementing extra is for bug fixes
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
28 CEPH_LIBCEPHD_API void cephd_version(int *pmajor, int *pminor, int *ppatch);
31 * Gets the runtime version of ceph.
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
37 CEPH_LIBCEPHD_API const char *ceph_version(int *pmajor, int *pminor, int *ppatch);
40 * Generates a new cluster id (fsid) and returns a hexadecimal string.
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
48 CEPH_LIBCEPHD_API int cephd_generate_fsid(char *buf, size_t len);
51 * Generates a new secret key and returns a base64 encoded string.
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
59 CEPH_LIBCEPHD_API int cephd_generate_secret_key(char *buf, size_t len);
62 * Runs ceph-mon passing in command line args
64 * @param argc number of parameters
65 * @param argv array of string arguments
66 * @returns 0 on success, negative error code on failure
68 CEPH_LIBCEPHD_API int cephd_run_mon(int argc, const char **argv);
71 * Runs ceph-osd passing in command line args
73 * @param argc number of parameters
74 * @param argv array of string arguments
75 * @returns 0 on success, negative error code on failure
77 CEPH_LIBCEPHD_API int cephd_run_osd(int argc, const char **argv);
80 * Runs ceph-mds passing in command line args
82 * @param argc number of parameters
83 * @param argv array of string arguments
84 * @returns 0 on success, negative error code on failure
86 CEPH_LIBCEPHD_API int cephd_run_mds(int argc, const char **argv);
89 * Runs ceph-rgw passing in command line args
91 * @param argc number of parameters
92 * @param argv array of string arguments
93 * @returns 0 on success, negative error code on failure
95 CEPH_LIBCEPHD_API int cephd_run_rgw(int argc, const char **argv);
98 * Runs radosgw-admin passing in command line args
100 * @param argc number of parameters
101 * @param argv array of string arguments
102 * @returns 0 on success, negative error code on failure
104 CEPH_LIBCEPHD_API int cephd_run_rgw_admin(int argc, const char **argv);