home *** CD-ROM | disk | FTP | other *** search
- /* mac06©1997 by HNS/DSITRI hns@computer.org
- ** netdb.h
- */
-
- #pragma once
-
- /* host lookup */
-
- struct hostent
- {
- char *h_name; /* primary host name */
- char **h_aliases; /* NULL terminated list of aliases */
- int h_addrtype; /* type of address AF_INET */
- int h_len; /* length of addr in h_addr_list (4) */
- char **h_addr_list; /* NULL terminated list of addresses */
- #define h_addr h_addr_list[0] /* for compatibility */
- };
-
- struct hostent *gethostbyname(char *name);
- struct hostent *gethostbyaddr(char *addr, int len, int family);
-
- /* service (well known port) lookup */
-
- struct servent
- {
- unsigned short s_port;
- char *s_proto;
- char *s_name;
- char **s_aliases;
- };
-
- struct servent *getservbyname(char *name, char *proto);
- struct servent *getservbyport(short port, char *proto);
-
- struct protoent
- {
- int p_family; /* protocol family */
- char *p_name;
- char **p_aliases;
- int p_proto; /* protocol name */
- int p_type; /* socket type for this protocol */
- };
-
- struct protoent *getprotobyname(char *name, int family);
- struct protoent *getprotobynumber(short number, int family);
-
- /* EOF */