#include "ipf.h" int gethost(name, hostp) char *name; u_32_t *hostp; { struct hostent *h; u_32_t addr; if (!strcmp(name, "")) name = thishost; h = gethostbyname(name); if (h != NULL) { if ((h->h_addr != NULL) && (h->h_length == sizeof(addr))) { bcopy(h->h_addr, (char *)&addr, sizeof(addr)); *hostp = addr; return 0; } } return -1; }