summaryrefslogtreecommitdiff
path: root/ace/os_include/netdb.h
diff options
context:
space:
mode:
Diffstat (limited to 'ace/os_include/netdb.h')
-rw-r--r--ace/os_include/netdb.h72
1 files changed, 66 insertions, 6 deletions
diff --git a/ace/os_include/netdb.h b/ace/os_include/netdb.h
index 049973a2666..3e982e75fe4 100644
--- a/ace/os_include/netdb.h
+++ b/ace/os_include/netdb.h
@@ -2,19 +2,19 @@
//=============================================================================
/**
- * @file netdb.h
+ * @file os_netdb.h
*
* definitions for network database operations
*
* $Id$
*
- * @author Don Hinton <dhinton@ieee.org>
+ * @author Don Hinton <dhinton@dresystems.com>
* @author This code was originally in various places including ace/OS.h.
*/
//=============================================================================
-#ifndef ACE_OS_INCLUDE_NETDB_H
-#define ACE_OS_INCLUDE_NETDB_H
+#ifndef ACE_OS_INCLUDE_OS_NETDB_H
+#define ACE_OS_INCLUDE_OS_NETDB_H
#include "ace/pre.h"
@@ -25,10 +25,70 @@
#endif /* ACE_LACKS_PRAGMA_ONCE */
#include "ace/os_include/netinet/in.h"
+#include "ace/os_include/limits.h"
#if !defined (ACE_LACKS_NETDB_H)
-# include /**/ <netdb.h>
+# if defined (ACE_HAS_STL_QUEUE_CONFLICT)
+# define queue _Queue_
+# endif /* ACE_HAS_STL_QUEUE_CONFLICT */
+ extern "C" {
+# include /**/ <netdb.h>
+ }
+# if defined (ACE_HAS_STL_QUEUE_CONFLICT)
+# undef queue
+# endif /* ACE_HAS_STL_QUEUE_CONFLICT */
#endif /* !ACE_LACKS_NETDB_H */
+// Place all additions (especially function declarations) within extern "C" {}
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+#if defined (ACE_PSOS) || defined (VXWORKS)
+ struct hostent {
+ char *h_name; /* official name of host */
+ char **h_aliases; /* alias list */
+ int h_addrtype; /* host address type */
+ int h_length; /* address length */
+ char **h_addr_list; /* (first, only) address from name server */
+# define h_addr h_addr_list[0] /* the first address */
+ };
+
+ struct servent {
+ char *s_name; /* official service name */
+ char **s_aliases; /* alias list */
+ int s_port; /* port # */
+ char *s_proto; /* protocol to use */
+ };
+#endif /* ACE_PSOS */
+
+#if defined (ACE_HAS_STRUCT_NETDB_DATA)
+ typedef char ACE_HOSTENT_DATA[sizeof(struct hostent_data)];
+ typedef char ACE_SERVENT_DATA[sizeof(struct servent_data)];
+ typedef char ACE_PROTOENT_DATA[sizeof(struct protoent_data)];
+#else
+# if !defined ACE_HOSTENT_DATA_SIZE
+# define ACE_HOSTENT_DATA_SIZE (4*1024)
+# endif /*ACE_HOSTENT_DATA_SIZE */
+# if !defined ACE_SERVENT_DATA_SIZE
+# define ACE_SERVENT_DATA_SIZE (4*1024)
+# endif /*ACE_SERVENT_DATA_SIZE */
+# if !defined ACE_PROTOENT_DATA_SIZE
+# define ACE_PROTOENT_DATA_SIZE (2*1024)
+# endif /*ACE_PROTOENT_DATA_SIZE */
+ typedef char ACE_HOSTENT_DATA[ACE_HOSTENT_DATA_SIZE];
+ typedef char ACE_SERVENT_DATA[ACE_SERVENT_DATA_SIZE];
+ typedef char ACE_PROTOENT_DATA[ACE_PROTOENT_DATA_SIZE];
+#endif /* ACE_HAS_STRUCT_NETDB_DATA */
+
+# if !defined(MAXHOSTNAMELEN)
+# define MAXHOSTNAMELEN HOST_NAME_MAX
+# endif /* MAXHOSTNAMELEN */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
#include "ace/post.h"
-#endif /* ACE_OS_INCLUDE_NETDB_H */
+#endif /* ACE_OS_INCLUDE_OS_NETDB_H */