Lines Matching refs:src
57 static int inet_cidr_pton_ipv4(const char *src, u_char *dst,
59 static int inet_cidr_pton_ipv6(const char *src, u_char *dst, int *bits);
65 * inet_cidr_pton(af, src, dst, *bits)
81 inet_cidr_pton(int af, const char *src, void *dst, int *bits) {
84 return (inet_cidr_pton_ipv4(src, dst, bits, 0));
86 return (inet_cidr_pton_ipv6(src, dst, bits));
96 inet_cidr_pton_ipv4(const char *src, u_char *dst, int *pbits, int ipv6) {
103 while (ch = *src++, (isascii(ch) && isdigit(ch))) {
112 } while ((ch = *src++) != '\0' && isascii(ch) && isdigit(ch));
125 bits = getbits(src, ipv6);
164 inet_cidr_pton_ipv6(const char *src, u_char *dst, int *pbits) {
177 if (*src == ':')
178 if (*++src != ':')
180 curtok = src;
184 while ((ch = *src++) != '\0') {
198 curtok = src;
204 } else if (*src == '\0') {
222 bits = getbits(src, 1);
267 getbits(const char *src, int ipv6) {
271 if (*src == '\0') /*%< syntax */
274 ch = *src++;
280 if (bits == 0 && *src != '\0') /*%< no leading zeros */
284 } while (*src != '\0');