GitHub Actions: Try MSVC builds with /std:c++17 and 20
[ACE_TAO.git] / ACE / ace / OS_NS_netdb.h
blob5885e1789007bb1ac00e88527102331db770fa55
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 * Originally in OS.h.
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)
23 # 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
32 #endif
33 #define ACE_EXPORT_MACRO ACE_Export
35 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
37 namespace ACE_OS
40 ACE_NAMESPACE_INLINE_FUNCTION
41 struct hostent *gethostbyaddr (const char *addr,
42 int length,
43 int type);
45 ACE_NAMESPACE_INLINE_FUNCTION
46 struct hostent *gethostbyaddr_r (const char *addr,
47 int length,
48 int type,
49 struct hostent *result,
50 ACE_HOSTENT_DATA buffer,
51 int *h_errnop);
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,
60 int *h_errnop);
63 ACE_NAMESPACE_INLINE_FUNCTION
64 struct hostent *getipnodebyaddr (const void *src, size_t len,
65 int family);
67 ACE_NAMESPACE_INLINE_FUNCTION
68 struct hostent *getipnodebyname (const char *name, int family,
69 int flags = 0);
71 /**
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];
79 extern ACE_Export
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,
100 const char *proto);
102 ACE_NAMESPACE_INLINE_FUNCTION
103 struct servent *getservbyname_r (const char *svc,
104 const char *proto,
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,
122 unsigned int flags);
124 #ifdef ACE_LACKS_GETADDRINFO
125 extern ACE_Export
126 int getaddrinfo_emulation (const char *name, addrinfo **result);
128 extern ACE_Export
129 void freeaddrinfo_emulation (addrinfo *result);
130 #endif
132 #ifdef ACE_LACKS_GETNAMEINFO
133 extern ACE_Export
134 int getnameinfo_emulation (const sockaddr *addr, ACE_SOCKET_LEN addr_len,
135 char *host, ACE_SOCKET_LEN host_len);
136 #endif
138 # if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) && defined (ACE_LACKS_NETDB_REENTRANT_FUNCTIONS)
139 extern ACE_Export
140 int netdb_acquire (void);
142 extern ACE_Export
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)
152 # undef 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 */