From 22cf41f697ff6de1eb4d6c5f66e5de70e86c9f74 Mon Sep 17 00:00:00 2001
From: Laurent Bercot
-
-
- Functions
int s6dns_domain_fromstring (s6dns_domain_t *d, char const *s, unsigned int len)
+ int s6dns_domain_fromstring (s6dns_domain_t *d, char const *s, size_t len)
Makes a (string form) domain from string s of length len,
and stores it into *d. Returns 1 if it succeeds, otherwise it
returns 0 and sets errno appropriately - most likely ENAMETOOLONG, i.e.
@@ -104,20 +104,20 @@ valid packet form (EPROTO).
int s6dns_domain_fromstring_noqualify_encode (s6dns_domain_t *d, char const *s, unsigned int len)
+ int s6dns_domain_fromstring_noqualify_encode (s6dns_domain_t *d, char const *s, size_t len)
Higher-level function wrapping some of the above. Makes an encoded, fully qualified
(without resorting to qualification) domain from string s of
length len. Returns 1 if it succeeds and 0 if it fails.
unsigned int s6dns_domain_fromstring_qualify_encode (s6dns_domain_t *list, char const *s, unsigned int len, char const *rules, unsigned int rulesnum)
+ unsigned int s6dns_domain_fromstring_qualify_encode (s6dns_domain_t *list, char const *s, size_t len, char const *rules, unsigned int rulesnum)
Another wrapping function. It makes a list of encoded, fully qualified domains,
from string s of length len using rulesnum qualification
rules in rules. It writes at most rulesnum domains into the array
pointed to by list and returns the number of written domains, or 0 on an
error.
-
void s6dns_domain_arpafromip4 (s6dns_domain_t *d, char const *ip)
diff --git a/doc/libs6dns/s6dns-engine.html b/doc/libs6dns/s6dns-engine.html
index 61b966e..24105c9 100644
--- a/doc/libs6dns/s6dns-engine.html
+++ b/doc/libs6dns/s6dns-engine.html
@@ -79,7 +79,7 @@ after each use. It contains a stralloc, so it must be freed with
- int s6dns_engine_init (s6dns_engine_t *dt, s6dns_ip46list_t const *servers, uint32 options, char const *q, unsigned int qlen, uint16 qtype, tain_t const *deadline, tain_t const *stamp)
+ int s6dns_engine_init (s6dns_engine_t *dt, s6dns_ip46list_t const *servers, uint32_t options, char const *q, unsigned int qlen, uint16_t qtype, tain_t const *deadline, tain_t const *stamp)
diff --git a/doc/libs6dns/s6dns-fmt.html b/doc/libs6dns/s6dns-fmt.html index f77e925..7bd44b8 100644 --- a/doc/libs6dns/s6dns-fmt.html +++ b/doc/libs6dns/s6dns-fmt.html @@ -34,7 +34,7 @@ printable strings.
- unsigned int s6dns_fmt_domain (char *s, unsigned int max, s6dns_domain_t const *d)
+ size_t s6dns_fmt_domain (char *s, size_t max, s6dns_domain_t const *d)
Writes into string s the domain contained in *d (in string
form). Returns the number of bytes written, or 0 in case of failure. If
the output would be more than max bytes, 0 ENAMETOOLONG is returned.
@@ -43,7 +43,7 @@ This function is actually an alias to s6dns_domain_tostring.
- unsigned int s6dns_fmt_domainlist (char *s, unsigned int max, s6dns_domain_t const *list, unsigned int n, char const *delin, unsigned int delimlen)
+ size_t s6dns_fmt_domainlist (char *s, size_t max, s6dns_domain_t const *list, unsigned int n, char const *delim, size_t delimlen)
Writes into string s the list of n domains (in string form)
pointed to by list. Between each domain (and not after the last one),
string delim of length delimlen is appended.
@@ -53,7 +53,7 @@ To avoid that, S6DNS_FMT_DOMAINLIST(n) is a suitable number of bytes to prealloc
- unsigned int s6dns_fmt_hinfo (char *s, unsigned int max, s6dns_message_rr_hinfo_t const *p)
+ size_t s6dns_fmt_hinfo (char *s, size_t max, s6dns_message_rr_hinfo_t const *p)
Writes into string s the HINFO contained in *p: cpu, then os,
separated by a space.
Returns the number of bytes written, or 0 in case of failure. If
@@ -62,7 +62,7 @@ To avoid that, S6DNS_FMT_HINFO is a suitable number of bytes to preallocate
- unsigned int s6dns_fmt_mx (char *s, unsigned int max, s6dns_message_rr_mx_t const *p)
+ size_t s6dns_fmt_mx (char *s, size_t max, s6dns_message_rr_mx_t const *p)
Writes into string s the MX contained in *p: preference, then
exchanger name, separated by a space.
Returns the number of bytes written, or 0 in case of failure. If
@@ -71,7 +71,7 @@ To avoid that, S6DNS_FMT_MX is a suitable number of bytes to preallocate s
- unsigned int s6dns_fmt_soa (char *s, unsigned int max, s6dns_message_rr_soa_t const *p)
+ size_t s6dns_fmt_soa (char *s, size_t max, s6dns_message_rr_soa_t const *p)
Writes into string s the SOA contained in *p:
mname, then rname, then serial number, refresh time, retry time, expiration time
and minimum time, separated by spaces.
@@ -81,7 +81,7 @@ To avoid that, S6DNS_FMT_SOA is a suitable number of bytes to preallocate s<
- unsigned int s6dns_fmt_srv (char *s, unsigned int max, s6dns_message_rr_srv_t const *p)
+ size_t s6dns_fmt_srv (char *s, size_t max, s6dns_message_rr_srv_t const *p)
Writes into string s the SRV contained in *p: priority,
then weight, then port, then target, separated by spaces.
Returns the number of bytes written, or 0 in case of failure. If
diff --git a/doc/libs6dns/s6dns-resolve.html b/doc/libs6dns/s6dns-resolve.html
index bd770d3..e83d078 100644
--- a/doc/libs6dns/s6dns-resolve.html
+++ b/doc/libs6dns/s6dns-resolve.html
@@ -117,14 +117,14 @@ Returns 1 on success or 0 on failure.
- int s6dns_resolve_core_g (s6dns_domain_t const *d, uint16 qtype, tain_t const *deadline)
+ int s6dns_resolve_core_g (s6dns_domain_t const *d, uint16_t qtype, tain_t const *deadline)
Resolves the query on domain *d (in packet form), of type qtype.
Returns 0 on failure, or 1 on success, in which case
s6dns_engine_here contains the answer.
- int s6dns_resolve_parse_g (s6dns_domain_t const *d, uint16 qtype, s6dns_message_rr_func_t *f, void *data, tain_t const *deadline)
+ int s6dns_resolve_parse_g (s6dns_domain_t const *d, uint16_t qtype, s6dns_message_rr_func_t *f, void *data, tain_t const *deadline)
Resolves the query on domain *d (in packet form), of type qtype,
then parses the answer with function f and stores the result into data.
Returns 1 if it succeeds, 0 if no data can be extracted from the answer, or -1 if an
@@ -141,7 +141,7 @@ here as a return code of 0 with errno set to ENOENT.
- int s6dns_resolvenoq_g (char const *name, unsigned int len, uint16 qtype, s6dns_message_rr_func_t *f, void *data, tain_t const *deadline)
+ int s6dns_resolvenoq_g (char const *name, size_t len, uint16_t qtype, s6dns_message_rr_func_t *f, void *data, tain_t const *deadline)
Performs a query of type qtype on name name of length len,
without qualifying it. Parses the answer with function f and stores the
result into data. Returns 1 if it succeeds, 0 if no data can be extracted,
@@ -149,7 +149,7 @@ or -1 if an error occurs. Sets errno in the last two cases.
- int s6dns_resolveq_g (char const *name, unsigned int len, uint16 qtype, s6dns_message_rr_func_t *f, void *data, tain_t const *deadline)
+ int s6dns_resolveq_g (char const *name, size_t len, uint16_t qtype, s6dns_message_rr_func_t *f, void *data, tain_t const *deadline)
Performs a query of type qtype on name name of length len,
qualifying it first. Parses the answer with function f and stores the
result into data. Returns 1 if it succeeds, 0 if none of the FQDNs can
@@ -157,7 +157,7 @@ get a positive answer, or -1 if an error occurs. Sets errno in the last two case
- int s6dns_resolve_g (char const *name, unsigned int len, uint16 qtype, s6dns_message_rr_func_t *f, void *data, int qualif, tain_t const *deadline)
+ int s6dns_resolve_g (char const *name, size_t len, uint16_t qtype, s6dns_message_rr_func_t *f, void *data, int qualif, tain_t const *deadline)
Performs a query of type qtype on name name of length len.
Qualifies name first if qualif is nonzero; else, does not
qualify it. Parses the answer with function f and stores the
@@ -168,7 +168,7 @@ get a positive answer, or -1 if an error occurs. Sets errno in the last two case
- int s6dns_resolve_a_g (stralloc *ips, char const *name, unsigned int len, int qualif, tain_t const *deadline)
+ int s6dns_resolve_a_g (stralloc *ips, char const *name, size_t len, int qualif, tain_t const *deadline)
Performs an A query on name name of length len, qualifying it
iff qualif is nonzero. Returns -1 if an error occurs, or 0 if no answer
can be obtained from servers, or 1 if it succeeds, in which case the IPs are
@@ -176,7 +176,7 @@ appended to the stralloc *ips, using 4 bytes per answer.
- int s6dns_resolve_aaaa_g (stralloc *ips, char const *name, unsigned int len, int qualif, tain_t const *deadline)
+ int s6dns_resolve_aaaa_g (stralloc *ips, char const *name, size_t len, int qualif, tain_t const *deadline)
Performs an AAAA query on name name of length len, qualifying it
iff qualif is nonzero. Returns -1 if an error occurs, or 0 if no answer
can be obtained from servers, or 1 if it succeeds, in which case the IPs are
@@ -184,7 +184,7 @@ appended to the stralloc *ips, using 16 bytes per answer.
- int s6dns_resolve_aaaaa_g (genalloc *ips, char const *name, unsigned int len, int qualif, tain_t const *deadline)
+ int s6dns_resolve_aaaaa_g (genalloc *ips, char const *name, size_t len, int qualif, tain_t const *deadline)
Performs an AAAA query and an A query at the same time on name name
of length len, qualifying it first iff qualif is nonzero.
Returns -1 if an error occurs, or 0 if no answer
@@ -196,7 +196,7 @@ indiscriminately.
- int s6dns_resolve_ptr_g (genalloc *ds, char const *name, unsigned int len, int qualif, tain_t const *deadline)
+ int s6dns_resolve_ptr_g (genalloc *ds, char const *name, size_t len, int qualif, tain_t const *deadline)
Performs a PTR query on name name of length len, qualifying it
iff qualif is nonzero. Returns -1 if an error occurs, or 0 if no answer
can be obtained from servers, or 1 if it succeeds, in which case the domains are
@@ -228,7 +228,7 @@ depending on which ip is an IPv6 or IPv4 address.
- int s6dns_resolve_ns_g (genalloc *ds, char const *name, unsigned int len, int qualif, tain_t const *deadline)
+ int s6dns_resolve_ns_g (genalloc *ds, char const *name, size_t len, int qualif, tain_t const *deadline)
Performs a NS query on name name of length len, qualifying it
iff qualif is nonzero. Returns -1 if an error occurs, or 0 if no answer
can be obtained from servers, or 1 if it succeeds, in which case the domains are
@@ -236,7 +236,7 @@ appended to the genalloc *ds, which contains an array of s6dns_doma
- int s6dns_resolve_cname_g (genalloc *ds, char const *name, unsigned int len, int qualif, tain_t const *deadline)
+ int s6dns_resolve_cname_g (genalloc *ds, char const *name, size_t len, int qualif, tain_t const *deadline)
Performs a CNAME query on name name of length len, qualifying it
iff qualif is nonzero. Returns -1 if an error occurs, or 0 if no answer
can be obtained from servers, or 1 if it succeeds, in which case the domains are
@@ -245,7 +245,7 @@ appended to the genalloc *ds, which contains an array of s6dns_doma
int s6dns_resolve_hinfo_g (genalloc *hinfos, char const *name,
-unsigned int len, int qualif, tain_t const *deadline)
+size_t len, int qualif, tain_t const *deadline)
Performs an HINFO query on name name of length len, qualifying it
iff qualif is nonzero. Returns -1 if an error occurs, or 0 if no answer
can be obtained from servers, or 1 if it succeeds, in which case the domains are
@@ -255,7 +255,7 @@ appended to the genalloc *hinfos, which contains an array of
int s6dns_resolve_mx_g (genalloc *mxs, char const *name,
-unsigned int len, int qualif, tain_t const *deadline)
+size_t len, int qualif, tain_t const *deadline)
Performs an MX query on name name of length len, qualifying it
iff qualif is nonzero. Returns -1 if an error occurs, or 0 if no answer
can be obtained from servers, or 1 if it succeeds, in which case the domains are
@@ -265,7 +265,7 @@ appended to the genalloc *mxs, which contains an array of
int s6dns_resolve_soa_g (genalloc *soas, char const *name,
-unsigned int len, int qualif, tain_t const *deadline)
+size_t len, int qualif, tain_t const *deadline)
Performs an SOA query on name name of length len, qualifying it
iff qualif is nonzero. Returns -1 if an error occurs, or 0 if no answer
can be obtained from servers, or 1 if it succeeds, in which case the domains are
@@ -275,7 +275,7 @@ appended to the genalloc *soas, which contains an array of
int s6dns_resolve_srv_g (genalloc *srvs, char const *name,
-unsigned int len, int qualif, tain_t const *deadline)
+size_t len, int qualif, tain_t const *deadline)
Performs an SRV query on name name of length len, qualifying it
iff qualif is nonzero. Returns -1 if an error occurs, or 0 if no answer
can be obtained from servers, or 1 if it succeeds, in which case the domains are
--
cgit v1.2.3