4 * Copyright (C) 2002-2004 by Darren Reed.
6 * See the IPFILTER.LICENCE file for details on licencing.
8 * Id: gethost.c,v 1.3.2.2 2006/06/16 17:20:59 darrenr Exp
13 int gethost(name
, hostp
)
21 if (!strcmp(name
, "test.host.dots")) {
22 *hostp
= htonl(0xfedcba98);
26 if (!strcmp(name
, "<thishost>"))
29 h
= gethostbyname(name
);
31 if ((h
->h_addr
!= NULL
) && (h
->h_length
== sizeof(addr
))) {
32 bcopy(h
->h_addr
, (char *)&addr
, sizeof(addr
));
38 n
= getnetbyname(name
);
40 *hostp
= (u_32_t
)htonl(n
->n_net
& 0xffffffff);