#include <sys/stat.h> /* file characteristics constants and functions */
#include <unistd.h> /* unix standard library */
#include <stdlib.h> /* C standard library */
-#include <stdio.h> /* I/O standard library */
-#include <arpa/inet.h>
+#include <stdio.h> /* standard I/O library */
+#include <arpa/inet.h> /* IP addresses conversion utilities */
#include <sys/socket.h> /* socket constants, types and functions */
-#include <netinet/in.h>
-#include <netdb.h>
+#include <netinet/in.h> /* IPv4 and IPv6 constants and types */
+#include <netdb.h> /* C resolver library */
#include "Gapil.h"
/*
* routine to print usage info and exit
*/
void usage(void) {
- printf("Program mygethost: do an hostname resolution \n");
+ printf("Program mygetaddr: do an hostname resolution \n");
printf("Usage:\n");
- printf("mygethost [-h] [-p protocol] [-t socktype] hostname service\n");
+ printf("mygetaddr [-h] [-p protocol] [-t socktype] hostname service\n");
printf(" -h print this help\n");
printf(" -p udp,tcp select a protocol\n");
printf(" -t dgram,stream select a socket type\n");