Lines Matching refs:host
177 const char *host, int port,
186 const char *org_host = host; /* only for error msg */
190 if (ENABLE_FEATURE_UNIX_LOCAL && is_prefixed_with(host, "local:")) {
197 safe_strncpy(sun->sun_path, host + 6, sizeof(sun->sun_path));
204 if (ENABLE_FEATURE_IPV6 && host[0] == '[') {
206 host++;
207 cp = strchr(host, ']');
216 cp = strrchr(host, ':');
217 if (ENABLE_FEATURE_IPV6 && cp && strchr(host, ':') != cp) {
223 int sz = cp - host + 1;
225 host = safe_strncpy(alloca(sz), host, sz);
251 if (inet_aton(host, &in4) != 0) {
264 if (inet_pton(AF_INET6, host, &in6) > 0) {
280 rc = getaddrinfo(host, NULL, &hint, &result);
311 #define str2sockaddr(host, port, af, ai_flags) str2sockaddr(host, port, ai_flags) argument
315 len_and_sockaddr* FAST_FUNC host_and_af2sockaddr(const char *host, int port, sa_family_t af) in host_and_af2sockaddr() argument
317 return str2sockaddr(host, port, af, 0); in host_and_af2sockaddr()
320 len_and_sockaddr* FAST_FUNC xhost_and_af2sockaddr(const char *host, int port, sa_family_t af) in xhost_and_af2sockaddr() argument
322 return str2sockaddr(host, port, af, DIE_ON_ERROR); in xhost_and_af2sockaddr()
326 len_and_sockaddr* FAST_FUNC host2sockaddr(const char *host, int port) in host2sockaddr() argument
328 return str2sockaddr(host, port, AF_UNSPEC, 0); in host2sockaddr()
331 len_and_sockaddr* FAST_FUNC xhost2sockaddr(const char *host, int port) in xhost2sockaddr() argument
333 return str2sockaddr(host, port, AF_UNSPEC, DIE_ON_ERROR); in xhost2sockaddr()
336 len_and_sockaddr* FAST_FUNC xdotted2sockaddr(const char *host, int port) in xdotted2sockaddr() argument
338 return str2sockaddr(host, port, AF_UNSPEC, AI_NUMERICHOST | DIE_ON_ERROR); in xdotted2sockaddr()
472 char host[128]; in sockaddr2str() local
492 host, sizeof(host), in sockaddr2str()
501 return xstrdup(host); in sockaddr2str()
504 if (strchr(host, ':')) /* heh, it's not a resolved hostname */ in sockaddr2str()
505 return xasprintf("[%s]:%s", host, serv); in sockaddr2str()
512 return xasprintf("%s:%s", host, serv); in sockaddr2str()