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...
13 //=============================================================================
15 #ifndef ACE_OS_NS_NETDB_H
16 #define ACE_OS_NS_NETDB_H
18 # include /**/ "ace/pre.h"
20 # include "ace/config-all.h"
22 # if !defined (ACE_LACKS_PRAGMA_ONCE)
24 # endif /* ACE_LACKS_PRAGMA_ONCE */
26 #include "ace/os_include/os_netdb.h"
27 #include "ace/os_include/sys/os_socket.h"
28 #include /**/ "ace/ACE_export.h"
30 #if defined (ACE_EXPORT_MACRO)
31 # undef ACE_EXPORT_MACRO
33 #define ACE_EXPORT_MACRO ACE_Export
35 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
40 ACE_NAMESPACE_INLINE_FUNCTION
41 struct hostent
*gethostbyaddr (const char *addr
,
45 ACE_NAMESPACE_INLINE_FUNCTION
46 struct hostent
*gethostbyaddr_r (const char *addr
,
49 struct hostent
*result
,
50 ACE_HOSTENT_DATA buffer
,
53 ACE_NAMESPACE_INLINE_FUNCTION
54 struct hostent
*gethostbyname (const char *name
);
56 ACE_NAMESPACE_INLINE_FUNCTION
57 struct hostent
*gethostbyname_r (const char *name
,
58 struct hostent
*result
,
59 ACE_HOSTENT_DATA buffer
,
63 ACE_NAMESPACE_INLINE_FUNCTION
64 struct hostent
*getipnodebyaddr (const void *src
, size_t len
,
67 ACE_NAMESPACE_INLINE_FUNCTION
68 struct hostent
*getipnodebyname (const char *name
, int family
,
72 * Get the first adapter found on the machine.
73 * @todo: this is really useless except for UUID, move there? dhinton
75 struct macaddr_node_t
{
76 unsigned char node
[6];
80 int getmacaddress (struct macaddr_node_t
*node
);
82 ACE_NAMESPACE_INLINE_FUNCTION
83 struct protoent
*getprotobyname (const char *name
);
85 ACE_NAMESPACE_INLINE_FUNCTION
86 struct protoent
*getprotobyname_r (const char *name
,
87 struct protoent
*result
,
88 ACE_PROTOENT_DATA buffer
);
90 ACE_NAMESPACE_INLINE_FUNCTION
91 struct protoent
*getprotobynumber (int proto
);
93 ACE_NAMESPACE_INLINE_FUNCTION
94 struct protoent
*getprotobynumber_r (int proto
,
95 struct protoent
*result
,
96 ACE_PROTOENT_DATA buffer
);
98 ACE_NAMESPACE_INLINE_FUNCTION
99 struct servent
*getservbyname (const char *svc
,
102 ACE_NAMESPACE_INLINE_FUNCTION
103 struct servent
*getservbyname_r (const char *svc
,
105 struct servent
*result
,
106 ACE_SERVENT_DATA buf
);
108 ACE_NAMESPACE_INLINE_FUNCTION
109 int getaddrinfo (const char *name
, const char *service
,
110 const addrinfo
*hints
, addrinfo
**result
);
112 ACE_NAMESPACE_INLINE_FUNCTION
113 void freeaddrinfo (addrinfo
*result
);
115 ACE_NAMESPACE_INLINE_FUNCTION
116 const ACE_TCHAR
*gai_strerror (int errcode
);
118 ACE_NAMESPACE_INLINE_FUNCTION
119 int getnameinfo (const sockaddr
*addr
, ACE_SOCKET_LEN addr_len
,
120 char *host
, ACE_SOCKET_LEN host_len
,
121 char *service
, ACE_SOCKET_LEN service_len
,
124 #ifdef ACE_LACKS_GETADDRINFO
126 int getaddrinfo_emulation (const char *name
, addrinfo
**result
);
129 void freeaddrinfo_emulation (addrinfo
*result
);
132 #ifdef ACE_LACKS_GETNAMEINFO
134 int getnameinfo_emulation (const sockaddr
*addr
, ACE_SOCKET_LEN addr_len
,
135 char *host
, ACE_SOCKET_LEN host_len
);
138 # if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) && defined (ACE_LACKS_NETDB_REENTRANT_FUNCTIONS)
140 int netdb_acquire (void);
143 int netdb_release (void);
144 # endif /* defined (ACE_MT_SAFE) && ACE_LACKS_NETDB_REENTRANT_FUNCTIONS */
146 } /* namespace ACE_OS */
148 ACE_END_VERSIONED_NAMESPACE_DECL
150 # if defined (ACE_HAS_INLINED_OSCALLS)
151 # if defined (ACE_INLINE)
153 # endif /* ACE_INLINE */
154 # define ACE_INLINE inline
155 # include "ace/OS_NS_netdb.inl"
156 # endif /* ACE_HAS_INLINED_OSCALLS */
158 # include /**/ "ace/post.h"
159 #endif /* ACE_OS_NS_NETDB_H */