00001 /* 00002 ** netdb.h for in /home/anoman/work/lse/lseos/lseos-net/ping 00003 ** 00004 ** Copyright (c)2004 Arthur Kopatsy 00005 ** Login <kopats_a@epita.fr> 00006 ** 00007 ** Started on Wed Oct 20 15:38:03 2004 Arthur Kopatsy 00008 ** Last update Wed Nov 3 16:32:59 2004 Arthur Kopatsy 00009 */ 00010 00011 #ifndef NETDB_H_ 00012 #define NETDB_H_ 00013 00014 00015 #define MAXHOSTNAMELEN 256 00016 00017 /* 00018 * Structures returned by network data base library. All addresses are 00019 * supplied in host order, and returned in network order (suitable for 00020 * use in system calls). 00021 */ 00022 struct hostent { 00023 char *h_name; /* official name of host */ 00024 char **h_aliases; /* alias list */ 00025 int h_addrtype; /* host address type */ 00026 int h_length; /* length of address */ 00027 char **h_addr_list; /* list of addresses from name server */ 00028 #define h_addr h_addr_list[0] /* address, for backward compatiblity */ 00029 }; 00030 00031 struct hostent *gethostbyname(const char *name); 00032 00033 struct hostent *gethostbyaddr(const char *addr, 00034 socklen_t len, 00035 int type); 00036 00037 struct protoent { 00038 char *p_name; /* official protocol name */ 00039 char **p_aliases; /* alias list */ 00040 int p_proto; /* protocol number */ 00041 }; 00042 00043 struct protoent *getprotoent(void); 00044 00045 struct protoent *getprotobyname(const char *name); 00046 00047 struct protoent *getprotobynumber(int proto); 00048 00049 00050 #endif