00001 /******************************************************************************/ 00002 /* This file has been modified by Sergio Perez Alcañiz <serpeal@disca.upv.es> */ 00003 /* Departamento de Informática de Sistemas y Computadores */ 00004 /* Universidad Politécnica de Valencia */ 00005 /* Valencia (Spain) */ 00006 /* Date: April 2003 */ 00007 /******************************************************************************/ 00008 00009 #include "lwip/ip_addr.h" 00010 00011 #ifndef _NETDB_H 00012 #define _NETDB_H 00013 00014 /* Description of data base entry for a single service. */ 00015 struct protoent { 00016 char *p_name; /* Official protocol name. */ 00017 char **p_aliases; /* Alias list. */ 00018 int p_proto; /* Protocol number. */ 00019 }; 00020 00021 struct protoent *getprotobyname (const char *name); 00022 struct protoent *getprotobynumber (int proto); 00023 00024 struct servent { 00025 char *s_name; 00026 char **s_aliases; 00027 int s_port; 00028 char *s_proto; 00029 }; 00030 00031 #define HOST_NOT_FOUND ENSRNXDOMAIN 00032 #define NO_ADDRESS ENSRNODATA 00033 #define NO_DATA ENSRNODATA 00034 #define TRY_AGAIN ENSRTIMEOUT 00035 00036 #define h_addr h_addr_list[0] 00037 struct hostent { 00038 char *h_name; 00039 char **h_aliases; 00040 int h_addrtype; 00041 int h_length; 00042 char **h_addr_list; 00043 }; 00044 00045 extern int h_errno; 00046 struct hostent *gethostbyname (const char *name); 00047 struct hostent *gethostbyaddr (const char *addr, int len, int type); 00048 #if 0 00049 #define herror perror 00050 #define h_errno errno 00051 #define hstrerror strerror 00052 #endif 00053 00054 void setnameservers (const struct in_addr *ns1, const struct in_addr *ns2); 00055 void getnameservers (struct in_addr *ns1, struct in_addr *ns2); 00056 00057 #endif /* _NETDB_H */