|
COAP_STATIC_INLINE const uint8_t * | strnchr (const uint8_t *s, size_t len, unsigned char c) |
| A length-safe version of strchr(). More...
|
|
static int | coap_split_uri_sub (const uint8_t *str_var, size_t len, coap_uri_t *uri, coap_uri_check_t check_proxy) |
|
int | coap_split_uri (const uint8_t *str_var, size_t len, coap_uri_t *uri) |
| Parses a given string into URI components. More...
|
|
int | coap_split_proxy_uri (const uint8_t *str_var, size_t len, coap_uri_t *uri) |
| Parses a given string into URI components. More...
|
|
static void | decode_segment (const uint8_t *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 uint8_t *s, size_t length, size_t *segment_size) |
| Runs through the given path (or query) segment and checks if percent-encodings are correct. More...
|
|
static int | make_decoded_option (const uint8_t *s, size_t length, unsigned char *buf, size_t buflen, size_t *optionsize) |
| Writes a coap option from given string s to buf . More...
|
|
COAP_STATIC_INLINE int | dots (const uint8_t *s, size_t len) |
| Checks if path segment s consists of one or two dots. More...
|
|
static size_t | coap_split_path_impl (const uint8_t *s, size_t length, segment_handler_t h, void *data) |
| Splits the given string into segments. More...
|
|
static void | write_option (const uint8_t *s, size_t len, void *data) |
|
int | coap_split_path (const uint8_t *s, size_t length, unsigned char *buf, size_t *buflen) |
| Splits the given URI path into segments. More...
|
|
int | coap_split_query (const uint8_t *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 uint8_t *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...
|
|
COAP_STATIC_INLINE int | is_unescaped_in_path (const uint8_t c) |
|
COAP_STATIC_INLINE int | is_unescaped_in_query (const uint8_t c) |
|
coap_string_t * | coap_get_query (const coap_pdu_t *request) |
| Extract query string from request PDU according to escape rules in 6.5.8. More...
|
|
coap_string_t * | coap_get_uri_path (const coap_pdu_t *request) |
| Extract uri_path string from request PDU. More...
|
|
static int make_decoded_option |
( |
const uint8_t * |
s, |
|
|
size_t |
length, |
|
|
unsigned char * |
buf, |
|
|
size_t |
buflen, |
|
|
size_t * |
optionsize |
|
) |
| |
|
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 0
and sets optionsize
to the option's size. On error the function returns a value less than zero. 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 . |
optionsize | The option's size. |
- Returns
0
on success and -1
on error.
Definition at line 330 of file uri.c.