Zephyr API Documentation 4.5.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
url.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2026 Muhammad Waleed Badar
3 * SPDX-License-Identifier: Apache-2.0
4 */
5
10
11#ifndef ZEPHYR_INCLUDE_NET_URL_H_
12#define ZEPHYR_INCLUDE_NET_URL_H_
13
14#include <stdbool.h>
15#include <stddef.h>
16#include <stdint.h>
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
29
37
59
72int net_url_parse(const char *url, struct net_url *out);
73
82bool net_url_scheme_is(const struct net_url *url, const char *scheme);
83
91bool net_url_has_port(const struct net_url *url);
92
106int net_url_field_copy(const struct net_url *url, const struct net_url_field *field, char *dst,
107 size_t dst_len);
108
122int net_url_target_copy(const struct net_url *url, char *dst, size_t dst_len);
123
127
128#ifdef __cplusplus
129}
130#endif
131
132#endif /* ZEPHYR_INCLUDE_NET_URL_H_ */
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_parse(const char *url, struct net_url *out)
Split a URL into its components.
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.
bool net_url_has_port(const struct net_url *url)
Check whether a URL names a port.
bool net_url_scheme_is(const struct net_url *url, const char *scheme)
Compare the scheme of a URL, ignoring case.
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
A component of a URL, located in the string it was parsed from.
Definition url.h:31
uint16_t off
Offset of the component in net_url.base.
Definition url.h:33
uint16_t len
Length of the component, 0 when the URL has none.
Definition url.h:35
The components of a URL.
Definition url.h:39
struct net_url_field host
Host name or IP literal, without the brackets of an IPv6 literal.
Definition url.h:47
struct net_url_field fragment
Fragment, without the "#".
Definition url.h:55
uint16_t port_value
Port number, 0 when the URL has none or names port 0 explicitly.
Definition url.h:57
const char * base
The URL the components are located in.
Definition url.h:41
struct net_url_field userinfo
User information, without the "@".
Definition url.h:45
struct net_url_field query
Query, without the "?".
Definition url.h:53
struct net_url_field scheme
Scheme, without the "://".
Definition url.h:43
struct net_url_field port
Port, without the ":".
Definition url.h:49
struct net_url_field path
Path, up to the "?" or "#".
Definition url.h:51