diff options
author | Samuel Mendoza-Jonas <sam@mendozajonas.com> | 2018-05-09 11:13:54 +1000 |
---|---|---|
committer | Samuel Mendoza-Jonas <sam@mendozajonas.com> | 2018-07-10 14:00:08 +1000 |
commit | becf2b28d8b0aa561ac7e42db519071f8065d37f (patch) | |
tree | 0dfcc6ef5cbcf1a433ec2f116de119b1c5742f07 /lib/url/url.h | |
parent | 99a1f905f585480cca2c9a43ab18ed8e37365192 (diff) | |
download | talos-petitboot-becf2b28d8b0aa561ac7e42db519071f8065d37f.tar.gz talos-petitboot-becf2b28d8b0aa561ac7e42db519071f8065d37f.zip |
lib: Add support and helpers for IPv6 host addresses
Recognise IPv6 addresses and URLs, and allow an interface_info struct to
have both an IPv4 and IPv6 address.
The addr_scheme() helper returns the address family of a given address.
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Diffstat (limited to 'lib/url/url.h')
-rw-r--r-- | lib/url/url.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/url/url.h b/lib/url/url.h index 9043615..49dff4a 100644 --- a/lib/url/url.h +++ b/lib/url/url.h @@ -19,6 +19,7 @@ #if !defined(_PB_URL_PARSER_H) #define _PB_URL_PARSER_H +#include <arpa/inet.h> #include <stdbool.h> /** @@ -61,6 +62,7 @@ struct pb_url { }; bool is_url(const char *str); +int addr_scheme(const char *address); struct pb_url *pb_url_parse(void *ctx, const char *url_str); struct pb_url *pb_url_copy(void *ctx, const struct pb_url *url); struct pb_url *pb_url_join(void *ctx, const struct pb_url *url, const char *s); |