Lines Matching full:host

4   * it provides methods to map a transport address to a printable host name
7 * The result from the hostname lookup method is STRING_PARANOID when a host
8 * pretends to have someone elses name, or when a host name is available but
50 * Speed up DNS lookups by terminating the host name with a dot. Should be
93 * Look up the client host address. Hal R. Brand <BRAND@addvax.llnl.gov> in sock_host()
94 * suggested how to get the client host info in case of UDP connections: in sock_host()
140 void sock_hostaddr(struct host_info *host) in sock_hostaddr() argument
143 struct sockaddr *sin = host->sin; in sock_hostaddr()
154 getnameinfo(sin, salen, host->addr, sizeof(host->addr), in sock_hostaddr()
157 struct sockaddr_in *sin = host->sin; in sock_hostaddr()
160 STRN_CPY(host->addr, inet_ntoa(sin->sin_addr), sizeof(host->addr)); in sock_hostaddr()
164 /* sock_hostname - map endpoint address to host name */
166 void sock_hostname(struct host_info *host) in sock_hostname() argument
169 struct sockaddr *sin = host->sin; in sock_hostname()
210 STRN_CPY(host->name, hname, sizeof(host->name)); in sock_hostname()
217 if ((err = getaddrinfo(host->name, NULL, &hints, &res0)) == 0) { in sock_hostname()
219 tcpd_warn("host name/name mismatch: " in sock_hostname()
221 host->name); in sock_hostname()
222 strcpy(host->name, paranoid); /* name is bad, clobber it */ in sock_hostname()
246 if (getaddrinfo(host->name, NULL, &hints, &res0) != 0) { in sock_hostname()
249 * Unable to verify that the host name matches the address. This in sock_hostname()
254 host->name, in sock_hostname()
258 || STR_NE(host->name, res0->ai_canonname)) in sock_hostname()
259 && STR_NE(host->name, "localhost")) { in sock_hostname()
267 tcpd_warn("host name/name mismatch: %s != %.*s", in sock_hostname()
268 host->name, STRING_LENGTH, in sock_hostname()
305 * The host name does not map to the initial address. Perhaps in sock_hostname()
312 tcpd_warn("host name/address mismatch: %s != %.*s", in sock_hostname()
316 strcpy(host->name, paranoid); /* name is bad, clobber it */ in sock_hostname()
321 struct sockaddr_in *sin = host->sin; in sock_hostname()
330 * host name/address checking code below. in sock_hostname()
336 STRN_CPY(host->name, hp->h_name, sizeof(host->name)); in sock_hostname()
351 if ((hp = gethostbyname(host->name)) == 0) { in sock_hostname()
354 * Unable to verify that the host name matches the address. This in sock_hostname()
359 host->name); in sock_hostname()
361 } else if (STR_NE(host->name, hp->h_name) in sock_hostname()
362 && STR_NE(host->name, "localhost")) { in sock_hostname()
370 tcpd_warn("host name/name mismatch: %s != %.*s", in sock_hostname()
371 host->name, STRING_LENGTH, hp->h_name); in sock_hostname()
390 * The host name does not map to the initial address. Perhaps in sock_hostname()
395 tcpd_warn("host name/address mismatch: %s != %.*s", in sock_hostname()
398 strcpy(host->name, paranoid); /* name is bad, clobber it */ in sock_hostname()