3 //=============================================================================
7 * @author Douglas C. Schmidt <d.schmidt@vanderbilt.edu>
8 * @author Jesper S. M|ller<stophph@diku.dk>
9 * @author and a cast of thousands...
11 //=============================================================================
13 #ifndef ACE_OS_NS_NETDB_H
14 #define ACE_OS_NS_NETDB_H
16 # include /**/ "ace/pre.h"
18 # include "ace/config-all.h"
20 # if !defined (ACE_LACKS_PRAGMA_ONCE)
22 # endif /* ACE_LACKS_PRAGMA_ONCE */
24 #include "ace/os_include/os_netdb.h"
25 #include "ace/os_include/sys/os_socket.h"
26 #include /**/ "ace/ACE_export.h"
28 #if defined (ACE_EXPORT_MACRO)
29 # undef ACE_EXPORT_MACRO
31 #define ACE_EXPORT_MACRO ACE_Export
33 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
37 ACE_NAMESPACE_INLINE_FUNCTION
38 struct hostent
*gethostbyaddr (const char *addr
,
42 ACE_NAMESPACE_INLINE_FUNCTION
43 struct hostent
*gethostbyaddr_r (const char *addr
,
46 struct hostent
*result
,
47 ACE_HOSTENT_DATA buffer
,
50 ACE_NAMESPACE_INLINE_FUNCTION
51 struct hostent
*gethostbyname (const char *name
);
53 ACE_NAMESPACE_INLINE_FUNCTION
54 struct hostent
*gethostbyname_r (const char *name
,
55 struct hostent
*result
,
56 ACE_HOSTENT_DATA buffer
,
60 ACE_NAMESPACE_INLINE_FUNCTION
61 struct hostent
*getipnodebyaddr (const void *src
, size_t len
,
64 ACE_NAMESPACE_INLINE_FUNCTION
65 struct hostent
*getipnodebyname (const char *name
, int family
,
69 * Get the first adapter found on the machine.
70 * @todo: this is really useless except for UUID, move there? dhinton
72 struct macaddr_node_t
{
73 unsigned char node
[6];
77 int getmacaddress (struct macaddr_node_t
*node
);
79 ACE_NAMESPACE_INLINE_FUNCTION
80 struct protoent
*getprotobyname (const char *name
);
82 ACE_NAMESPACE_INLINE_FUNCTION
83 struct protoent
*getprotobyname_r (const char *name
,
84 struct protoent
*result
,
85 ACE_PROTOENT_DATA buffer
);
87 ACE_NAMESPACE_INLINE_FUNCTION
88 struct protoent
*getprotobynumber (int proto
);
90 ACE_NAMESPACE_INLINE_FUNCTION
91 struct protoent
*getprotobynumber_r (int proto
,
92 struct protoent
*result
,
93 ACE_PROTOENT_DATA buffer
);
95 ACE_NAMESPACE_INLINE_FUNCTION
96 struct servent
*getservbyname (const char *svc
,
99 ACE_NAMESPACE_INLINE_FUNCTION
100 struct servent
*getservbyname_r (const char *svc
,
102 struct servent
*result
,
103 ACE_SERVENT_DATA buf
);
105 ACE_NAMESPACE_INLINE_FUNCTION
106 int getaddrinfo (const char *name
, const char *service
,
107 const addrinfo
*hints
, addrinfo
**result
);
109 ACE_NAMESPACE_INLINE_FUNCTION
110 void freeaddrinfo (addrinfo
*result
);
112 ACE_NAMESPACE_INLINE_FUNCTION
113 const ACE_TCHAR
*gai_strerror (int errcode
);
115 ACE_NAMESPACE_INLINE_FUNCTION
116 int getnameinfo (const sockaddr
*addr
, ACE_SOCKET_LEN addr_len
,
117 char *host
, ACE_SOCKET_LEN host_len
,
118 char *service
, ACE_SOCKET_LEN service_len
,
121 #ifdef ACE_LACKS_GETADDRINFO
123 int getaddrinfo_emulation (const char *name
, addrinfo
**result
);
126 void freeaddrinfo_emulation (addrinfo
*result
);
129 #ifdef ACE_LACKS_GETNAMEINFO
131 int getnameinfo_emulation (const sockaddr
*addr
, ACE_SOCKET_LEN addr_len
,
132 char *host
, ACE_SOCKET_LEN host_len
);
135 # if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) && defined (ACE_LACKS_NETDB_REENTRANT_FUNCTIONS)
137 int netdb_acquire ();
140 int netdb_release ();
141 # endif /* defined (ACE_MT_SAFE) && ACE_LACKS_NETDB_REENTRANT_FUNCTIONS */
143 } /* namespace ACE_OS */
145 ACE_END_VERSIONED_NAMESPACE_DECL
147 # if defined (ACE_HAS_INLINED_OSCALLS)
148 # if defined (ACE_INLINE)
150 # endif /* ACE_INLINE */
151 # define ACE_INLINE inline
152 # include "ace/OS_NS_netdb.inl"
153 # endif /* ACE_HAS_INLINED_OSCALLS */
155 # include /**/ "ace/post.h"
156 #endif /* ACE_OS_NS_NETDB_H */