X-Git-Url: https://gapil.gnulinux.it/gitweb/?p=gapil.git;a=blobdiff_plain;f=sources%2Fmygethost.c;h=2167852064349e66599fe5ac5049f19523b1e74a;hp=76cf84477eb5edd568c52c40bf3d6199b30dfb1a;hb=26f7a8bb19c6cb198c213757a97b6ac79e40db4b;hpb=4c6bdffb5a1a4746b241d8323faaf3a49a4633a9 diff --git a/sources/mygethost.c b/sources/mygethost.c index 76cf844..2167852 100644 --- a/sources/mygethost.c +++ b/sources/mygethost.c @@ -22,21 +22,21 @@ * * Author: S. Piccardi Jul. 2004 * - * $Id$ - * *****************************************************************************/ -#include -#include -#include -#include /* C standard library */ -#include /* I/O standard library */ -#include -#include +#include /* primitive system data types */ +#include /* file characteristics constants and functions */ +#include /* C standard library */ +#include /* standard I/O library */ +#include /* unix standard library */ +#include /* IP addresses conversion utilities */ +#include /* C resolver library */ +#include /* TCP socket option */ + extern int h_errno; #include "Gapil.h" /* - * Program myhost + * Program mygethost * * Use gethostbyname and print results */ @@ -50,6 +50,18 @@ int main(int argc, char *argv[]) */ int i; struct hostent *data; + + struct sock_level { + int level; + char * name; + } sock_level[] = { + SOL_SOCKET, "SOL_SOCKET", + SOL_IP, "SOL_IP", + SOL_TCP, "SOL_TCP", + SOL_IPV6, "SOL_IPV6", + SOL_ICMPV6, "SOL_ICMPV6" + }; + char **alias; char *addr; char buffer[INET6_ADDRSTRLEN];