Motr  M0
uuid.c File Reference
#include "lib/uuid.h"
#include "lib/atomic.h"
#include "lib/errno.h"
#include "lib/time.h"
#include "lib/string.h"
#include "lib/misc.h"
#include <uuid/uuid.h>
#include "lib/trace.h"
Include dependency graph for uuid.c:

Go to the source code of this file.

Macros

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_LIB
 

Functions

 M0_BASSERT (sizeof(struct m0_uint128)==sizeof(char[16]))
 
M0_INTERNAL void m0_uuid_generate (struct m0_uint128 *u)
 
static int parse_hex (const char *str, int len, uint64_t *val)
 
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)
 
int m0_node_uuid_init (void)
 

Variables

M0_INTERNAL struct m0_uint128 m0_node_uuid
 

Macro Definition Documentation

◆ M0_TRACE_SUBSYSTEM

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_LIB

Definition at line 36 of file uuid.c.

Function Documentation

◆ M0_BASSERT()

M0_BASSERT ( sizeof(struct m0_uint128 = =sizeof(char[16]))

◆ m0_node_uuid_init()

int m0_node_uuid_init ( void  )

Initialize the node UUID.

Definition at line 131 of file uuid.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_hex()

static int parse_hex ( const char *  str,
int  len,
uint64_t *  val 
)
static

Convert the leading hex string of a specified length to binary. The length and characters are enforced. The maximum length is 16 hex chars.

Definition at line 58 of file uuid.c.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ m0_node_uuid

M0_INTERNAL struct m0_uint128 m0_node_uuid

Definition at line 126 of file uuid.c.