ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
mdl_url_guard.h
Go to the documentation of this file.
1
20#pragma once
21
22#include <stddef.h>
23#include <stdint.h>
24
50
75bool mdl_url_scheme_allowed(const char* url);
76
105mdl_addr_class_t mdl_classify_ip(const char* ip);
106
132bool mdl_addr_is_fetchable(mdl_addr_class_t cls, bool allow_private);
133
159bool mdl_size_exceeds(uint64_t have, uint64_t add, uint64_t cap);
160
188bool mdl_url_host(const char* url, char* out, size_t cap);
189
216bool mdl_url_path(const char* url, char* out, size_t cap);
bool mdl_url_host(const char *url, char *out, size_t cap)
Extract the authority (host and optional port) from an http(s) URL.
bool mdl_url_scheme_allowed(const char *url)
True when url uses an allowlisted scheme (http:// or https://).
bool mdl_addr_is_fetchable(mdl_addr_class_t cls, bool allow_private)
Decide whether an address class is fetchable under the active policy.
bool mdl_size_exceeds(uint64_t have, uint64_t add, uint64_t cap)
True when appending add bytes to have would exceed cap.
mdl_addr_class_t mdl_classify_ip(const char *ip)
Classify a resolved peer IP string into a mdl_addr_class_t.
bool mdl_url_path(const char *url, char *out, size_t cap)
Extract the path (with leading /, without query/fragment) from a URL.
mdl_addr_class_t
Reachability class of a resolved peer address.
@ k_mdl_addr_public
Routable public unicast address.
@ k_mdl_addr_unknown
Unparseable, unspecified, or reserved.
@ k_mdl_addr_loopback
127.0.0.0/8 or ::1.
@ k_mdl_addr_private
RFC1918, RFC6598 (CGNAT), or fc00::/7.
@ k_mdl_addr_linklocal
169.254.0.0/16 or fe80::/10.