|
libcoap
4.1.2
|
Go to the source code of this file.
Data Structures | |
| struct | coap_uri_t |
| Representation of parsed URI. More... | |
Functions | |
| coap_uri_t * | coap_new_uri (const unsigned char *uri, unsigned int length) |
| Creates a new coap_uri_t object from the specified URI. More... | |
| coap_uri_t * | coap_clone_uri (const coap_uri_t *uri) |
| Clones the specified coap_uri_t object. More... | |
| int | coap_hash_path (const unsigned char *path, size_t len, coap_key_t key) |
Calculates a hash over the given path and stores the result in key. More... | |
| int | coap_split_uri (const unsigned char *str_var, size_t len, coap_uri_t *uri) |
| Parses a given string into URI components. More... | |
| int | coap_split_path (const unsigned char *s, size_t length, unsigned char *buf, size_t *buflen) |
| Splits the given URI path into segments. More... | |
| int | coap_split_query (const unsigned char *s, size_t length, unsigned char *buf, size_t *buflen) |
| Splits the given URI query into segments. More... | |
| coap_uri_t* coap_clone_uri | ( | const coap_uri_t * | uri | ) |
Clones the specified coap_uri_t object.
Thie function allocates sufficient memory to hold the coap_uri_t structure and its contents. The object must be released with coap_free().
Definition at line 433 of file uri.c.
| int coap_hash_path | ( | const unsigned char * | path, |
| size_t | len, | ||
| coap_key_t | key | ||
| ) |
Calculates a hash over the given path and stores the result in key.
This function returns 0 on error or 1 on success.
| path | The URI path to generate hash for. |
| len | The length of path. |
| key | The output buffer. |
1 if key was set, 0 otherwise. Definition at line 483 of file uri.c.
| coap_uri_t* coap_new_uri | ( | const unsigned char * | uri, |
| unsigned int | length | ||
| ) |
Creates a new coap_uri_t object from the specified URI.
Returns the new object or NULL on error. The memory allocated by the new coap_uri_t must be released using coap_free().
| uri | The URI path to copy. |
| length | The length of uri. |
Definition at line 414 of file uri.c.
1.8.12