Asterisk - The Open Source Telephony Project
18.5.0
|
Universally unique identifier support. More...
Go to the source code of this file.
Macros | |
#define | AST_UUID_STR_LEN (36 + 1) |
Functions | |
struct ast_uuid * | ast_str_to_uuid (char *str) |
Convert a string to a UUID. More... | |
void | ast_uuid_clear (struct ast_uuid *uuid) |
Clear a UUID by setting it to be a nil UUID (all 0s) More... | |
int | ast_uuid_compare (struct ast_uuid *left, struct ast_uuid *right) |
Compare two UUIDs. More... | |
struct ast_uuid * | ast_uuid_copy (struct ast_uuid *src) |
Make a copy of a UUID. More... | |
struct ast_uuid * | ast_uuid_generate (void) |
Generate a UUID. More... | |
char * | ast_uuid_generate_str (char *buf, size_t size) |
Generate a UUID string. More... | |
void | ast_uuid_init (void) |
Initialize the UUID system. More... | |
int | ast_uuid_is_nil (struct ast_uuid *uuid) |
Check if a UUID is a nil UUID (all 0s) More... | |
char * | ast_uuid_to_str (struct ast_uuid *uuid, char *buf, size_t size) |
Convert a UUID to a string. More... | |
Universally unique identifier support.
Definition in file uuid.h.
#define AST_UUID_STR_LEN (36 + 1) |
Definition at line 27 of file uuid.h.
Referenced by add_msid_to_stream(), ast_datastores_alloc_datastore(), ast_rtcp_generate_sdes(), ast_rtcp_write(), ast_rtp_read(), ast_sip_publish_client_alloc_datastore(), ast_sip_session_alloc_datastore(), ast_sorcery_alloc(), AST_TEST_DEFINE(), ast_uuid_to_str(), ast_websocket_uri_cb(), asterisk_daemon(), bridge_base_init(), bridge_moh_create(), build_entity_id(), endpoint_lookup(), exchangecal_write_event(), generate_exchange_uuid(), handle_show_settings(), mock_retrieve_multiple(), playback_create(), sorcery_memory_cache_thrash_retrieve(), sorcery_memory_cache_thrash_update(), and stir_shaken_add_origid().
struct ast_uuid* ast_str_to_uuid | ( | char * | str | ) |
Convert a string to a UUID.
This function allocates memory on the heap. The returned pointer must be freed using ast_free()
str | The string to convert to a UUID |
NULL | Failed to convert |
non-NULL | The heap-allocated converted UUID |
Definition at line 151 of file uuid.c.
References ast_free, ast_log, ast_malloc, LOG_WARNING, NULL, and ast_uuid::uu.
Referenced by AST_TEST_DEFINE(), and is_valid_uuid().
void ast_uuid_clear | ( | struct ast_uuid * | uuid | ) |
Clear a UUID by setting it to be a nil UUID (all 0s)
uuid | UUID to clear |
Definition at line 184 of file uuid.c.
References ast_uuid::uu.
Referenced by AST_TEST_DEFINE().
Compare two UUIDs.
left | First UUID to compare |
right | Second UUID to compare |
<0 | left is lexicographically less than right |
0 | left and right are the same |
>0 | left is lexicographically greater than right |
Definition at line 179 of file uuid.c.
References ast_uuid::uu.
Referenced by AST_TEST_DEFINE().
Make a copy of a UUID.
This function allocates memory on the heap. The returned pointer must be freed using ast_free()
src | The source UUID to copy |
NULL | Failed to copy |
non-NULL | The heap-allocated duplicate UUID |
Definition at line 168 of file uuid.c.
References ast_malloc, NULL, and ast_uuid::uu.
Referenced by AST_TEST_DEFINE().
struct ast_uuid* ast_uuid_generate | ( | void | ) |
Generate a UUID.
This function allocates memory on the heap. The returned pointer must be freed using ast_free()
NULL | Generation failed |
non-NULL | heap-allocated UUID |
Definition at line 125 of file uuid.c.
References ast_malloc, generate_uuid(), and NULL.
Referenced by AST_TEST_DEFINE().
char* ast_uuid_generate_str | ( | char * | buf, |
size_t | size | ||
) |
Generate a UUID string.
buf | The buffer where the UUID string will be stored |
size | The size of the buffer. Must be at least AST_UUID_STR_LEN. |
Definition at line 143 of file uuid.c.
References ast_uuid_to_str(), and generate_uuid().
Referenced by add_msid_to_stream(), ast_datastores_alloc_datastore(), ast_rtp_new(), ast_sip_publish_client_alloc_datastore(), ast_sip_session_alloc_datastore(), ast_sorcery_alloc(), AST_TEST_DEFINE(), ast_websocket_uri_cb(), asterisk_daemon(), bridge_base_init(), build_entity_id(), generate_exchange_uuid(), mock_retrieve_multiple(), playback_create(), sorcery_config_open(), and stir_shaken_add_origid().
void ast_uuid_init | ( | void | ) |
Initialize the UUID system.
Definition at line 194 of file uuid.c.
References ast_debug, ast_log, dev_urandom_fd, has_dev_urandom, LOG_WARNING, and ast_uuid::uu.
Referenced by asterisk_daemon().
int ast_uuid_is_nil | ( | struct ast_uuid * | uuid | ) |
Check if a UUID is a nil UUID (all 0s)
uuid | UUID to check |
0 | The UUID is not nil |
non-zero | The UUID is nil |
Definition at line 189 of file uuid.c.
References ast_uuid::uu.
Referenced by AST_TEST_DEFINE().
char* ast_uuid_to_str | ( | struct ast_uuid * | uuid, |
char * | buf, | ||
size_t | size | ||
) |
Convert a UUID to a string.
uuid | The UUID to convert to a string | |
[out] | buf | The buffer where the UUID string will be stored |
size | The size of the buffer. Must be at least AST_UUID_STR_LEN. |
Definition at line 136 of file uuid.c.
References ast_assert, ast_str_to_lower(), AST_UUID_STR_LEN, and ast_uuid::uu.
Referenced by AST_TEST_DEFINE(), and ast_uuid_generate_str().