|
| static unsigned char * | strnchr (unsigned char *s, size_t len, unsigned char c) |
| | A length-safe version of strchr(). 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...
|
| |
| static void | decode_segment (const unsigned char *seg, size_t length, unsigned char *buf) |
| | Decodes percent-encoded characters while copying the string seg of size length to buf. More...
|
| |
| static int | check_segment (const unsigned char *s, size_t length) |
| | Runs through the given path (or query) segment and checks if percent-encodings are correct. More...
|
| |
| static int | make_decoded_option (const unsigned char *s, size_t length, unsigned char *buf, size_t buflen) |
| | Writes a coap option from given string s to buf. More...
|
| |
| static int | dots (unsigned char *s, size_t len) |
| | Checks if path segment s consists of one or two dots. More...
|
| |
| static size_t | coap_split_path_impl (const unsigned char *s, size_t length, segment_handler_t h, void *data) |
| | Splits the given string into segments. More...
|
| |
| static void | write_option (unsigned char *s, size_t len, void *data) |
| |
| 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_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...
|
| |
| static void | hash_segment (unsigned char *s, size_t len, void *data) |
| |
| 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...
|
| |
| static int make_decoded_option |
( |
const unsigned char * |
s, |
|
|
size_t |
length, |
|
|
unsigned char * |
buf, |
|
|
size_t |
buflen |
|
) |
| |
|
static |
Writes a coap option from given string s to buf.
s should point to a (percent-encoded) path or query segment of a coap_uri_t object. The created option will have type 0, and the length parameter will be set according to the size of the decoded string. On success, this function returns the option's size, or a value less than zero on error. This function must be called from coap_split_path_impl() only.
- Parameters
-
| s | The string to decode. |
| length | The size of the percent-encoded string s. |
| buf | The buffer to store the new coap option. |
| buflen | The maximum size of buf. |
- Returns
- The option's size, or
-1 on error.
- Bug:
- This function does not split segments that are bigger than 270 bytes.
Definition at line 266 of file uri.c.