00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef ACE_OS_INCLUDE_OS_NETDB_H
00017 #define ACE_OS_INCLUDE_OS_NETDB_H
00018
00019 #include "ace/pre.h"
00020
00021 #include "ace/config-all.h"
00022
00023 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00024 # pragma once
00025 #endif
00026
00027 #include "ace/os_include/netinet/os_in.h"
00028 #include "ace/os_include/os_limits.h"
00029
00030 #if !defined (ACE_LACKS_NETDB_H)
00031 # if defined (ACE_HAS_STL_QUEUE_CONFLICT)
00032 # define queue _Queue_
00033 # endif
00034 extern "C" {
00035 # include <netdb.h>
00036 }
00037 # if defined (ACE_HAS_STL_QUEUE_CONFLICT)
00038 # undef queue
00039 # endif
00040 #endif
00041
00042 #if defined (ACE_VXWORKS) && (ACE_VXWORKS < 0x620)
00043 # include <hostLib.h>
00044 #endif
00045
00046
00047 #ifdef __cplusplus
00048 extern "C"
00049 {
00050 #endif
00051
00052 #if defined (ACE_LACKS_HOSTENT)
00053 struct hostent {
00054 char *h_name;
00055 char **h_aliases;
00056 int h_addrtype;
00057 int h_length;
00058 char **h_addr_list;
00059 #define h_addr h_addr_list[0]
00060 };
00061 #endif
00062
00063 #if defined (ACE_LACKS_PROTOENT)
00064 struct protoent {
00065 char *p_name;
00066 char **p_aliases;
00067 int p_proto;
00068 };
00069 #endif
00070
00071 #if defined (ACE_LACKS_SERVENT)
00072 struct servent {
00073 char *s_name;
00074 char **s_aliases;
00075 int s_port;
00076 char *s_proto;
00077 };
00078 #endif
00079
00080 #if defined (ACE_HAS_STRUCT_NETDB_DATA)
00081 typedef char ACE_HOSTENT_DATA[sizeof(struct hostent_data)];
00082 typedef char ACE_SERVENT_DATA[sizeof(struct servent_data)];
00083 typedef char ACE_PROTOENT_DATA[sizeof(struct protoent_data)];
00084 #else
00085 # if !defined ACE_HOSTENT_DATA_SIZE
00086 # define ACE_HOSTENT_DATA_SIZE (4*1024)
00087 # endif
00088 # if !defined ACE_SERVENT_DATA_SIZE
00089 # define ACE_SERVENT_DATA_SIZE (4*1024)
00090 # endif
00091 # if !defined ACE_PROTOENT_DATA_SIZE
00092 # define ACE_PROTOENT_DATA_SIZE (2*1024)
00093 # endif
00094 typedef char ACE_HOSTENT_DATA[ACE_HOSTENT_DATA_SIZE];
00095 typedef char ACE_SERVENT_DATA[ACE_SERVENT_DATA_SIZE];
00096 typedef char ACE_PROTOENT_DATA[ACE_PROTOENT_DATA_SIZE];
00097 #endif
00098
00099 # if !defined(MAXHOSTNAMELEN)
00100 # define MAXHOSTNAMELEN HOST_NAME_MAX
00101 # endif
00102
00103 #ifdef __cplusplus
00104 }
00105 #endif
00106
00107 #include "ace/post.h"
00108 #endif