|
Zephyr API Documentation 4.5.99
A Scalable Open Source RTOS
|
Data Structures | |
| struct | net_url_field |
| A component of a URL, located in the string it was parsed from. More... | |
| struct | net_url |
| The components of a URL. More... | |
Functions | |
| int | net_url_parse (const char *url, struct net_url *out) |
| Split a URL into its components. | |
| bool | net_url_scheme_is (const struct net_url *url, const char *scheme) |
| Compare the scheme of a URL, ignoring case. | |
| bool | net_url_has_port (const struct net_url *url) |
| Check whether a URL names a port. | |
| int | net_url_field_copy (const struct net_url *url, const struct net_url_field *field, char *dst, size_t dst_len) |
| Copy a component into a NUL-terminated buffer. | |
| int | net_url_target_copy (const struct net_url *url, char *dst, size_t dst_len) |
| Copy the request target of a URL into a NUL-terminated buffer. | |
| int net_url_field_copy | ( | const struct net_url * | url, |
| const struct net_url_field * | field, | ||
| char * | dst, | ||
| size_t | dst_len ) |
#include <zephyr/net/url.h>
Copy a component into a NUL-terminated buffer.
An absent component yields an empty string.
| url | Parsed URL. |
| field | Component of url to copy. |
| dst | Destination buffer. |
| dst_len | Size of dst. |
| 0 | Success. |
| -ENOBUFS | The component and its terminator do not fit in dst. |
#include <zephyr/net/url.h>
Check whether a URL names a port.
| url | Parsed URL. |
| int net_url_parse | ( | const char * | url, |
| struct net_url * | out ) |
#include <zephyr/net/url.h>
Split a URL into its components.
The components are offsets into url, which must stay valid and unchanged while out is used.
| url | NUL-terminated URL. |
| out | Components of the URL. |
| 0 | Success. |
| -EINVAL | url or out is NULL, or url is not a URL. |
#include <zephyr/net/url.h>
Compare the scheme of a URL, ignoring case.
| url | Parsed URL. |
| scheme | Scheme to compare with, without the "://". |
scheme as scheme. | int net_url_target_copy | ( | const struct net_url * | url, |
| char * | dst, | ||
| size_t | dst_len ) |
#include <zephyr/net/url.h>
Copy the request target of a URL into a NUL-terminated buffer.
The request target is the path followed by "?" and the query when there is one, as sent in an HTTP request line. An empty path is written as "/".
| url | Parsed URL. |
| dst | Destination buffer. |
| dst_len | Size of dst. |
| 0 | Success. |
| -ENOBUFS | The target and its terminator do not fit in dst. |