00001
00003
#ifndef _w32_GET_X_BY_Y_H
00004
#define _w32_GET_X_BY_Y_H
00005
00006
#ifndef _REENTRANT
00007
#define _REENTRANT
00008
#endif
00009
00010
#ifndef __NETDB_H
00011
#include <netdb.h>
00012
#endif
00013
00014
#define MAX_SERV_ALIASES 5
00015
#define MAX_HOST_ALIASES 5
00016
#define MAX_NETENT_ALIASES 5
00017
#define MAX_PROTO_ALIASES 0
00018
#define MAX_CACHE_LIFE (15*60)
00019
00020
#define ReadHostsFile NAMESPACE (ReadHostsFile)
00021
#define GetHostsFile NAMESPACE (GetHostsFile)
00022
#define CloseHostFile NAMESPACE (CloseHostFile)
00023
00024
#define ReadHosts6File NAMESPACE (ReadHosts6File)
00025
#define CloseHost6File NAMESPACE (CloseHost6File)
00026
#define GetHosts6File NAMESPACE (GetHosts6File)
00027
00028
#define ReadServFile NAMESPACE (ReadServFile)
00029
#define GetServFile NAMESPACE (GetServFile)
00030
#define CloseServFile NAMESPACE (CloseServFile)
00031
00032
#define ReadProtoFile NAMESPACE (ReadProtoFile)
00033
#define GetProtoFile NAMESPACE (GetProtoFile)
00034
#define CloseProtoFile NAMESPACE (CloseProtoFile)
00035
00036
#define ReadNetworksFile NAMESPACE (ReadNetworksFile)
00037
#define CloseNetworksFile NAMESPACE (CloseNetworksFile)
00038
#define GetNetFile NAMESPACE (GetNetFile)
00039
00040
#define InitEthersFile NAMESPACE (InitEthersFile)
00041
#define ReadEthersFile NAMESPACE (ReadEthersFile)
00042
#define GetEthersFile NAMESPACE (GetEthersFile)
00043
#define NumEtherEntries NAMESPACE (NumEtherEntries)
00044
00045
#define gethostbyname6 NAMESPACE (gethostbyname6)
00046
#define gethostbyaddr6 NAMESPACE (gethostbyaddr6)
00047
#define gethostent6 NAMESPACE (gethostent6)
00048
00049
#define DumpHostsCache NAMESPACE (DumpHostsCache)
00050
#define DumpHosts6Cache NAMESPACE (DumpHosts6Cache)
00051
00052
00056 struct _hostent {
00057
char *h_name;
00058
char *h_aliases[MAX_HOST_ALIASES+1];
00059
int h_num_addr;
00060
DWORD h_address[MAX_ADDRESSES+1];
00061
DWORD h_real_ttl;
00062 time_t h_timeout;
00063
struct _hostent *h_next;
00064 };
00065
00069 struct _hostent6 {
00070
char *h_name;
00071
char *h_aliases[MAX_HOST_ALIASES+1];
00072
int h_num_addr;
00073
ip6_address h_address[MAX_ADDRESSES+1];
00074
DWORD h_real_ttl;
00075 time_t h_timeout;
00076
struct _hostent6 *h_next;
00077 };
00078
00082 struct _netent {
00083
char *n_name;
00084
char *n_aliases [MAX_NETENT_ALIASES+1];
00085
int n_addrtype;
00086
DWORD n_net;
00087
struct _netent *n_next;
00088 };
00089
00093 struct _protoent {
00094
char *p_name;
00095
char *p_aliases [MAX_PROTO_ALIASES+1];
00096
int p_proto;
00097
struct _protoent *p_next;
00098 };
00099
00103 struct _servent {
00104
char *s_name;
00105
char *s_aliases [MAX_SERV_ALIASES+1];
00106
int s_port;
00107
char *s_proto;
00108
struct _servent *s_next;
00109 };
00110
00111
extern BOOL called_from_getai;
00112
00113 W32_DATA
unsigned netdbCacheLife;
00114
00115 W32_FUNC
void ReadHostsFile (
const char *fname);
00116 W32_FUNC
void ReadServFile (
const char *fname);
00117 W32_FUNC
void ReadProtoFile (
const char *fname);
00118 W32_FUNC
void ReadNetworksFile (
const char *fname);
00119 W32_FUNC
void ReadEthersFile (
void);
00120 W32_FUNC
int NumEtherEntries (
void);
00121 W32_FUNC
void InitEthersFile (
const char *fname);
00122
00123 W32_FUNC
void CloseHostFile (
void);
00124 W32_FUNC
void CloseServFile (
void);
00125 W32_FUNC
void CloseProtoFile (
void);
00126 W32_FUNC
void CloseNetworksFile(
void);
00127
00128 W32_FUNC
const char *
GetHostsFile (
void);
00129 W32_FUNC
const char *GetServFile (
void);
00130 W32_FUNC
const char *GetProtoFile (
void);
00131 W32_FUNC
const char *GetNetFile (
void);
00132 W32_FUNC
const char *GetEthersFile(
void);
00133
00134 W32_FUNC
void DumpHostsCache (
void);
00135
00136
#if defined(USE_BSD_API) && defined(USE_IPV6)
00137 W32_FUNC
void ReadHosts6File (
const char *fname);
00138 W32_FUNC
void CloseHost6File (
void);
00139 W32_FUNC
void DumpHosts6Cache (
void);
00140 W32_FUNC
const char *GetHosts6File (
void);
00141
00142 W32_FUNC
void sethostent6 (
int stayopen);
00143 W32_FUNC
void endhostent6 (
void);
00144 W32_FUNC
struct hostent *gethostent6 (
void);
00145 W32_FUNC
struct hostent *gethostbyname6 (
const char *name);
00146 W32_FUNC
struct hostent *gethostbyaddr6 (
const void *addr);
00147
#endif
00148
00149
#endif