Functions to handle GloballyUniqueIDs.
More...
Go to the source code of this file.
|
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 unsigned integer.
|
|
uint64_t | su_random64 (void) |
| Generate a random 64-bit unsigned integer.
|
|
Functions to handle GloballyUniqueIDs.
- Author
- Pekka Pessi Pekka.nosp@m..Pes.nosp@m.si@no.nosp@m.kia..nosp@m.com
- Date
- Created: Tue Apr 15 06:31:41 1997 pessi
◆ anonymous enum
Enumerator |
---|
su_guid_strlen | Length of guid in hex format.
|
◆ su_guid_generate()
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.
- Parameters
-
guid | [out] pointer to structure for new call identifier |
◆ su_guid_sprintf()
isize_t su_guid_sprintf |
( |
char * |
buf, |
|
|
size_t |
len, |
|
|
su_guid_t const * |
guid |
|
) |
| |
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.
- Parameters
-
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 |
- Return values
-
The | function guid_sprintf() returns length of the formatted globally unique identifier excluding the final NUL. |
◆ su_randint()
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).
- Parameters
-
lb | [in] lower bound |
ub | [in] upper bound |
- Returns
- The function randint() returns a pseudo-random integer.
Random integer in range [lb, ub] (inclusive).
◆ su_randmem()
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.
- Parameters
-
mem | [out] pointer to the beginning of the memory area to be filled |
siz | [in] size fo the memory area in bytes |