Functions to handle GloballyUniqueIDs. More...
#include <sofia-sip/su_types.h>
Go to the source code of this file.
Data Structures | |
union | GloballyUniqueIdentifier |
Globally unique identifier type. More... | |
Defines | |
#define | SU_UNIQUEID_H |
Defined when <sofia-sip/su_uniqueid.h> has been included. | |
Typedefs | |
typedef union GloballyUniqueIdentifier | su_guid_t |
Globally unique identifier type. | |
Enumerations | |
enum | { su_guid_strlen } |
Functions | |
size_t | su_node_identifier (void *address, size_t addrlen) |
Return node identifier. | |
void | su_guid_generate (su_guid_t *guid) |
Generate a GUID. | |
isize_t | su_guid_sprintf (char *buf, size_t len, su_guid_t const *guid) |
Print guid. | |
int | su_randint (int lb, int ub) |
Random integer in range [lb, ub] (inclusive). | |
void * | su_randmem (void *mem, size_t siz) |
Fill memory with random values. | |
uint32_t | su_random (void) |
Generate a random 32-bit integer. |
Functions to handle GloballyUniqueIDs.
#define SU_UNIQUEID_H |
Defined when <sofia-sip/su_uniqueid.h> has been included.
typedef union GloballyUniqueIdentifier su_guid_t |
Globally unique identifier type.
void su_guid_generate | ( | su_guid_t * | guid | ) |
Generate a GUID.
The function guid_generate() generates a new globally unique identifier for an IP telephony call. The guid follows the structure specified in the ITU-T recommendation H.225.0 v2. The guid is usable also in SIP Call-ID header.
guid | [out] pointer to structure for new call identifier |
Print guid.
The function guid_sprintf() formats the IP telephony call identifier according the human-readable format specified in the ITU-T recommendation H.225.0 v2. The printed identifier can be used as a SIP Call-ID if the colons in IEEE MAC address are replaced with '-', '+' or other character allowed in SIP token.
buf | [out] buffer to store the formatted globally unique identifier | |
len | [in] size of buffer buf (should be at least guid_strlen bytes) | |
guid | [in] pointer to structure containing globally unique identifier |
The | function guid_sprintf() returns length of the formatted globally unique identifier excluding the final NUL. |
int su_randint | ( | int | lb, | |
int | ub | |||
) |
Random integer in range [lb, ub] (inclusive).
The function randint() generates a pseudo-random integer in the range [ln, ub] (inclusive).
lb | [in] lower bound | |
ub | [in] upper bound |
void* su_randmem | ( | void * | mem, | |
size_t | siz | |||
) |
Fill memory with random values.
The function randmem() fills the given memory range with pseudo-random data.
mem | [out] pointer to the beginning of the memory area to be filled | |
siz | [in] size fo the memory area in bytes |
uint32_t su_random | ( | void | ) |
Generate a random 32-bit integer.