Merge pull request #2301 from sonndinh/remove-dup-reactor-functions
[ACE_TAO.git] / ACE / ace / OS_NS_netdb.h
blobbcf82cf22bc615bc6b278a2cc8f800562c12f5b5
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file OS_NS_netdb.h
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)
21 # 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
30 #endif
31 #define ACE_EXPORT_MACRO ACE_Export
33 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
35 namespace ACE_OS
37 ACE_NAMESPACE_INLINE_FUNCTION
38 struct hostent *gethostbyaddr (const char *addr,
39 int length,
40 int type);
42 ACE_NAMESPACE_INLINE_FUNCTION
43 struct hostent *gethostbyaddr_r (const char *addr,
44 int length,
45 int type,
46 struct hostent *result,
47 ACE_HOSTENT_DATA buffer,
48 int *h_errnop);
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,
57 int *h_errnop);
60 ACE_NAMESPACE_INLINE_FUNCTION
61 struct hostent *getipnodebyaddr (const void *src, size_t len,
62 int family);
64 ACE_NAMESPACE_INLINE_FUNCTION
65 struct hostent *getipnodebyname (const char *name, int family,
66 int flags = 0);
68 /**
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];
76 extern ACE_Export
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,
97 const char *proto);
99 ACE_NAMESPACE_INLINE_FUNCTION
100 struct servent *getservbyname_r (const char *svc,
101 const char *proto,
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,
119 unsigned int flags);
121 #ifdef ACE_LACKS_GETADDRINFO
122 extern ACE_Export
123 int getaddrinfo_emulation (const char *name, addrinfo **result);
125 extern ACE_Export
126 void freeaddrinfo_emulation (addrinfo *result);
127 #endif
129 #ifdef ACE_LACKS_GETNAMEINFO
130 extern ACE_Export
131 int getnameinfo_emulation (const sockaddr *addr, ACE_SOCKET_LEN addr_len,
132 char *host, ACE_SOCKET_LEN host_len);
133 #endif
135 # if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) && defined (ACE_LACKS_NETDB_REENTRANT_FUNCTIONS)
136 extern ACE_Export
137 int netdb_acquire ();
139 extern ACE_Export
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)
149 # undef 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 */