Motr
M0
|
Macros | |
#define | M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_LIB |
#define | M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_LIB |
Enumerations | |
enum | { MACHINE_ID_LEN = 32 } |
enum | { M0_UUID_STRLEN = 36 } |
Functions | |
module_param (node_uuid, charp, S_IRUGO) | |
MODULE_PARM_DESC (node_uuid, "UUID of Motr node") | |
static const char * | m0_param_node_uuid_get (void) |
int | m0_node_uuid_string_get (char buf[M0_UUID_STRLEN+1]) |
void | m0_kmod_uuid_file_set (const char *path) |
void | m0_node_uuid_string_set (const char *uuid) |
M0_INTERNAL int | m0_uuid_parse (const char *str, struct m0_uint128 *val) |
M0_INTERNAL void | m0_uuid_format (const struct m0_uint128 *val, char *buf, size_t len) |
M0_INTERNAL void | m0_uuid_generate (struct m0_uint128 *u) |
Variables | |
static char * | node_uuid = "00000000-0000-0000-0000-000000000000" |
static const char * | uuid_file = "/etc/machine-id" |
static char | default_node_uuid [M0_UUID_STRLEN+1] |
static bool | use_default_node_uuid = false |
M0_EXTERN struct m0_uint128 | m0_node_uuid |
void m0_kmod_uuid_file_set | ( | const char * | path | ) |
int m0_node_uuid_string_get | ( | char | buf[M0_UUID_STRLEN+1] | ) |
void m0_node_uuid_string_set | ( | const char * | uuid | ) |
|
static |
M0_INTERNAL void m0_uuid_format | ( | const struct m0_uint128 * | val, |
char * | buf, | ||
size_t | len | ||
) |
Produce the 8-4-4-4-12 hexadecimal string representation of a UUID from its numerical form. See Universally unique identifier for more details.
val | The numerical UUID. |
buf | String buffer. |
len | Length of the buffer. It must be at least M0_UUID_STRLEN+1 bytes long. |
Definition at line 107 of file uuid.c.
M0_INTERNAL void m0_uuid_generate | ( | struct m0_uint128 * | u | ) |
M0_INTERNAL int m0_uuid_parse | ( | const char * | str, |
struct m0_uint128 * | val | ||
) |
Parse the 8-4-4-4-12 hexadecimal string representation of a UUID and convert to numerical form. See Universally unique identifier for more details.
Definition at line 77 of file uuid.c.
module_param | ( | node_uuid | , |
charp | , | ||
S_IRUGO | |||
) |
|
static |
Default node uuid which can be used instead of a "real" one, which is obtained from kernel module; this can be handy for some utility applications which don't need full functionality of libmotr.so, so they can provide some fake uuid.
M0_EXTERN struct m0_uint128 m0_node_uuid |
|
static |
|
static |
The default path to read node uuid parameter is "etc/machine-id". It can be updated in the function m0_kmod_uuid_file_set().