Lines Matching defs:host
31 static int is_valid_hostname(const char *host)
34 if (strnlen(host, 255)-1 >= 254 || mbstowcs(0, host, 0) == -1) return 0;
35 for (s=(void *)host; *s>=0x80 || *s=='.' || *s=='-' || isalnum(*s); s++);
468 MUSL_LOGE("%{public}s: %{public}d: flag is AI_NUMERICHOST but host is Illegal", __func__, __LINE__);
604 char* host;
646 int predefined_host_remove_host(const char *host)
658 if (strcmp(pinfo->host, host) == 0) {
670 static int _predefined_host_is_contain_host_ip(const char* host, const char* ip, int is_check_ip)
677 if (strcmp(pinfo->host, host) == 0) {
692 int predefined_host_is_contain_host(const char *host)
694 return _predefined_host_is_contain_host_ip(host, NULL, 0);
697 static int _predefined_host_add_record(char* host, char* ip)
700 int host_len = strlen(host);
713 memcpy(i_host, host, host_len + 1);
716 pinfo->host = i_host;
730 char* host = strsep(&cmd, SEPARATOR);
735 if (!_predefined_host_is_contain_host_ip(host, ip, 1)) {
736 ret = _predefined_host_add_record(host, ip);
747 int predefined_host_lookup_ip(const char* host, const char* serv,
757 if (strcmp(pinfo->host, host) == 0) {
800 int predefined_host_set_host(const char* host, const char* ip)
802 if (host == NULL || strlen(host) == 0 || ip == NULL || strlen(ip) == 0) {
813 if (_predefined_host_is_contain_host_ip(host, ip, 1)) {
817 return _predefined_host_add_record(host, ip);
831 if (strcmp(pinfo->host, name) == 0) {