Lines Matching refs:str_len
729 static bool parse_ipv6(const char *str, size_t str_len, in parse_ipv6() argument
738 len = MIN(INET6_ADDRSTRLEN, str_len); in parse_ipv6()
776 if ((ptr + 1) < (str + str_len) && *(ptr + 1) == ':') { in parse_ipv6()
780 len = str_len - end - 1 - 2; in parse_ipv6()
813 static inline bool parse_ipv6(const char *str, size_t str_len, in parse_ipv6() argument
821 static bool parse_ipv4(const char *str, size_t str_len, in parse_ipv4() argument
830 len = MIN(NET_IPV4_ADDR_LEN, str_len); in parse_ipv4()
867 memcpy(ipaddr, ptr + 1, str_len - end - 1); in parse_ipv4()
868 ipaddr[str_len - end - 1] = '\0'; in parse_ipv4()
883 static inline bool parse_ipv4(const char *str, size_t str_len, in parse_ipv4() argument
890 bool net_ipaddr_parse(const char *str, size_t str_len, struct sockaddr *addr) in net_ipaddr_parse() argument
894 if (!str || str_len == 0) { in net_ipaddr_parse()
904 return parse_ipv6(str, str_len, addr, true); in net_ipaddr_parse()
907 for (count = i = 0; i < str_len && str[i]; i++) { in net_ipaddr_parse()
914 return parse_ipv4(str, str_len, addr, true); in net_ipaddr_parse()
918 if (!parse_ipv4(str, str_len, addr, false)) { in net_ipaddr_parse()
919 return parse_ipv6(str, str_len, addr, false); in net_ipaddr_parse()
926 return parse_ipv4(str, str_len, addr, false); in net_ipaddr_parse()
930 return parse_ipv6(str, str_len, addr, false); in net_ipaddr_parse()