UPnPsdk 0.1
Universal Plug and Play +, Software Development Kit
 
Loading...
Searching...
No Matches
anonymous_namespace{uuid.cpp} Namespace Reference

Classes

struct  uuid_state
 Data type for UUID generator persistent state. More...
 

Functions

void format_uuid_v1 (uuid_upnp *uid, uint16_t clock_seq, uuid_time_t timestamp, uuid_node_t node)
 Make a UUID from the timestamp, clockseq, and node ID.
 
int read_state (uint16_t *clockseq, uuid_time_t *timestamp, uuid_node_t *node)
 Read UUID generator state from non-volatile store.
 
void write_state (uint16_t clockseq, uuid_time_t timestamp, uuid_node_t node)
 Save UUID generator state back to non-volatile storage.
 
void get_current_time (uuid_time_t *timestamp)
 Get time as 60 bit 100ns ticks since whenever.
 
uint16_t true_random ()
 generate a crypto-quality random number. This sample doesn't do that.
 
void format_uuid_v3 (uuid_upnp *uid, unsigned char hash[16])
 Make a UUID from a (pseudo)random 128 bit number.
 

Variables

pthread_mutex_t uuid_mutex
 Mutex to synchronize the uuid creation process.
 
uuid_state st
 UUID generator persistent state.
 
int stateInited {0}
 Flag if UUID generator persistent state is initiated.
 

Class Documentation

◆ anonymous_namespace{uuid.cpp}::uuid_state

struct anonymous_namespace{uuid.cpp}::uuid_state

Data type for UUID generator persistent state.

Definition at line 49 of file uuid.cpp.

+ Collaboration diagram for anonymous_namespace{uuid.cpp}::uuid_state:
Class Members
uuid_time_t ts

Saved timestamp.

uuid_node_t node

Saved node ID.

uint16_t cs

Saved clock sequence.

Function Documentation

◆ format_uuid_v1()

void anonymous_namespace{uuid.cpp}::format_uuid_v1 ( uuid_upnp uid,
uint16_t  clock_seq,
uuid_time_t  timestamp,
uuid_node_t  node 
)
inline

Make a UUID from the timestamp, clockseq, and node ID.

Definition at line 66 of file uuid.cpp.

+ Here is the caller graph for this function:

◆ read_state()

int anonymous_namespace{uuid.cpp}::read_state ( uint16_t *  clockseq,
uuid_time_t timestamp,
uuid_node_t node 
)
inline

Read UUID generator state from non-volatile store.

Returns
  • 0: State not initiated.
  • 1: State is initiated.

Definition at line 87 of file uuid.cpp.

+ Here is the caller graph for this function:

◆ write_state()

void anonymous_namespace{uuid.cpp}::write_state ( uint16_t  clockseq,
uuid_time_t  timestamp,
uuid_node_t  node 
)
inline

Save UUID generator state back to non-volatile storage.

Definition at line 101 of file uuid.cpp.

+ Here is the caller graph for this function:

◆ get_current_time()

void anonymous_namespace{uuid.cpp}::get_current_time ( uuid_time_t timestamp)
inline

Get time as 60 bit 100ns ticks since whenever.

Compensate for the fact that real clock resolution is less than 100ns.

Definition at line 124 of file uuid.cpp.

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

◆ true_random()

uint16_t anonymous_namespace{uuid.cpp}::true_random ( )
inline

generate a crypto-quality random number. This sample doesn't do that.

Definition at line 158 of file uuid.cpp.

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

◆ format_uuid_v3()

void anonymous_namespace{uuid.cpp}::format_uuid_v3 ( uuid_upnp uid,
unsigned char  hash[16] 
)
inline

Make a UUID from a (pseudo)random 128 bit number.

Definition at line 175 of file uuid.cpp.

+ Here is the caller graph for this function:

Variable Documentation

◆ uuid_mutex

pthread_mutex_t anonymous_namespace{uuid.cpp}::uuid_mutex

Mutex to synchronize the uuid creation process.

Definition at line 46 of file uuid.cpp.

◆ st

uuid_state anonymous_namespace{uuid.cpp}::st

UUID generator persistent state.

Definition at line 59 of file uuid.cpp.

◆ stateInited

int anonymous_namespace{uuid.cpp}::stateInited {0}

Flag if UUID generator persistent state is initiated.

Definition at line 61 of file uuid.cpp.