Go to the documentation of this file.
21 #ifdef HAVE_NETINET_IN_H
22 # include <netinet/in.h>
24 #ifdef HAVE_ARPA_INET_H
25 # include <arpa/inet.h>
36 const struct ares_in6_addr ares_in6addr_any = { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } };
39 #ifndef HAVE_INET_NET_PTON
65 static const char xdigits[] =
"0123456789abcdef";
66 static const char digits[] =
"0123456789";
68 const unsigned char *odst =
dst;
71 if (
ch ==
'0' && (src[0] ==
'x' || src[0] ==
'X')
90 *
dst++ = (
unsigned char)
tmp;
97 *
dst++ = (
unsigned char) (
tmp << 4);
109 }
while ((
ch = *src++) !=
'\0' &&
113 *
dst++ = (
unsigned char)
tmp;
114 if (
ch ==
'\0' ||
ch ==
'/')
153 else if (*odst >= 224)
155 else if (*odst >= 192)
157 else if (*odst >= 128)
168 if (
bits == 8 && *odst == 224)
172 while (
bits > ((
dst - odst) * 8)) {
191 static const char digits[] =
"0123456789";
198 while ((
ch = *src++) !=
'\0') {
201 pch = strchr(digits,
ch);
203 if (
n++ != 0 && val == 0)
220 getv4(
const char *src,
unsigned char *
dst,
int *bitsp)
222 static const char digits[] =
"0123456789";
223 unsigned char *odst =
dst;
230 while ((
ch = *src++) !=
'\0') {
233 pch = strchr(digits,
ch);
235 if (
n++ != 0 && val == 0)
243 if (
ch ==
'.' ||
ch ==
'/') {
246 *
dst++ = (
unsigned char)val;
259 *
dst = (
unsigned char)val;
266 static const char xdigits_l[] =
"0123456789abcdef",
267 xdigits_u[] =
"0123456789ABCDEF";
269 const char *xdigits, *curtok;
291 while ((
ch = *src++) !=
'\0') {
294 if ((pch = strchr((xdigits = xdigits_l),
ch)) == NULL)
295 pch = strchr((xdigits = xdigits_u),
ch);
311 }
else if (*src ==
'\0')
315 *tp++ = (
unsigned char)((val >> 8) & 0xff);
316 *tp++ = (
unsigned char)(val & 0xff);
336 *tp++ = (
unsigned char)((val >> 8) & 0xff);
337 *tp++ = (
unsigned char)(val & 0xff);
349 if (colonp != NULL) {
359 for (
i = 1;
i <=
n;
i++) {
360 *(endp -
i) = *(colonp +
n -
i);
361 *(colonp +
n -
i) = 0;
417 #ifndef HAVE_INET_PTON
424 size =
sizeof(
struct in_addr);
435 return (
result > -1 ? 1 : -1);
441 return inet_pton(af, src,
dst);
return memset(p, 0, total)
static int inet_net_pton_ipv4(const char *src, unsigned char *dst, size_t size)
std::vector< std::string > words
const struct ares_in6_addr ares_in6addr_any
static int getv4(const char *src, unsigned char *dst, int *bitsp)
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
static int getbits(const char *src, int *bitsp)
OPENSSL_EXPORT ASN1_BIT_STRING * bits
int ares_inet_net_pton(int af, const char *src, void *dst, size_t size)
int aresx_sztosi(ares_ssize_t sznum)
static int inet_net_pton_ipv6(const char *src, unsigned char *dst, size_t size)
int ares_inet_pton(int af, const char *src, void *dst)
CARES_TYPEOF_ARES_SSIZE_T ares_ssize_t
unsigned int aresx_sztoui(ares_ssize_t sznum)
grpc
Author(s):
autogenerated on Fri May 16 2025 02:59:02