Lines Matching refs:servname
262 int getaddrinfo_numeric(const char* hostname, const char* servname, addrinfo hints, in getaddrinfo_numeric() argument
274 return android_getaddrinfofornetcontext(hostname, servname, &hints, &netcontext, result, in getaddrinfo_numeric()
323 int android_getaddrinfofornetcontext(const char* hostname, const char* servname, in android_getaddrinfofornetcontext() argument
338 if (hostname == nullptr && servname == nullptr) { in android_getaddrinfofornetcontext()
354 error = get_portmatch(&tmp, servname); in android_getaddrinfofornetcontext()
375 error = explore_null(&tmp, servname, &cur->ai_next); in android_getaddrinfofornetcontext()
377 error = explore_numeric_scope(&tmp, hostname, servname, &cur->ai_next); in android_getaddrinfofornetcontext()
398 return resolv_getaddrinfo(hostname, servname, hints, netcontext, res, event); in android_getaddrinfofornetcontext()
410 int resolv_getaddrinfo(const char* _Nonnull hostname, const char* servname, const addrinfo* hints, in resolv_getaddrinfo() argument
413 if (hostname == nullptr && servname == nullptr) return EAI_NONAME; in resolv_getaddrinfo()
447 error = explore_fqdn(&tmp, hostname, servname, &cur->ai_next, netcontext, event); in resolv_getaddrinfo()
462 static int explore_fqdn(const addrinfo* pai, const char* hostname, const char* servname, in explore_fqdn() argument
474 if ((error = get_portmatch(pai, servname))) return error; in explore_fqdn()
486 if ((error = get_port(cur, servname, 0))) { in explore_fqdn()
500 static int explore_null(const struct addrinfo* pai, const char* servname, struct addrinfo** res) { in explore_null() argument
530 if (get_portmatch(pai, servname) != 0) return 0; in explore_null()
537 GET_PORT(cur->ai_next, servname); in explore_null()
540 GET_PORT(cur->ai_next, servname); in explore_null()
555 static int explore_numeric(const struct addrinfo* pai, const char* hostname, const char* servname, in explore_numeric() argument
575 if (get_portmatch(pai, servname) != 0) return 0; in explore_numeric()
583 GET_PORT(cur->ai_next, servname); in explore_numeric()
613 const char* servname, struct addrinfo** res) { in explore_numeric_scope() argument
630 if (get_portmatch(pai, servname) != 0) return 0; in explore_numeric_scope()
635 if (!afd->a_scoped) return explore_numeric(pai, hostname, servname, res, hostname); in explore_numeric_scope()
638 if (cp == NULL) return explore_numeric(pai, hostname, servname, res, hostname); in explore_numeric_scope()
650 error = explore_numeric(pai, addr, servname, res, hostname); in explore_numeric_scope()
705 static int get_portmatch(const struct addrinfo* ai, const char* servname) { in get_portmatch() argument
709 return get_port(ai, servname, 1); in get_portmatch()
712 static int get_port(const struct addrinfo* ai, const char* servname, int matchonly) { in get_port() argument
721 if (servname == NULL) return 0; in get_port()
742 port = str2number(servname); in get_port()
762 if ((sp = getservbyname(servname, proto)) == NULL) return EAI_SERVICE; in get_port()