Пример #1
0
/* print the results as nslookup would */
static struct hostent *hostent_fprint(struct hostent *host, const char *server_host)
{
	if (host) {
		printf("%s     %s\n", server_host, host->h_name);
		addr_list_fprint(host->h_addr_list);
	} else {
		printf("*** Unknown host\n");
	}
	return host;
}
Пример #2
0
/* print the results as nslookup would */
static struct hostent *hostent_fprint(struct hostent *host, int is_server)
{
        char *format;
        if (is_server) {
                format = "Server:     ";
        } else {
                format = "Name:       ";
        }
        if (host) {
                printf("%s%s\n", format, host->h_name);
                addr_list_fprint(host->h_addr_list);
        } else {
                printf("*** Unknown host\n");
        }
        return host;
}