2 * Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Portions Copyright (c) 2002 Apple Computer, Inc. All Rights
7 * Reserved. This file contains Original Code and/or Modifications of
8 * Original Code as defined in and that are subject to the Apple Public
9 * Source License Version 1.1 (the "License"). You may not use this file
10 * except in compliance with the License. Please obtain a copy of the
11 * License at http://www.apple.com/publicsource and read it before using
14 * The Original Code and all software distributed under the License are
15 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
16 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
17 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the
19 * License for the specific language governing rights and limitations
22 * @APPLE_LICENSE_HEADER_END@
25 #ifndef _NETDB_ASYNC_H_
26 #define _NETDB_ASYNC_H_
28 #include <sys/cdefs.h>
29 #include <mach/mach.h>
35 @typedef gethostbyaddr_async_callback
36 @discussion Type of the callback function used when a
37 gethostbyaddr_async_start() request is delivered.
38 @param hent The resolved host entry.
39 @param context The context provided when the request
42 typedef void (*gethostbyaddr_async_callback
) (
48 @function gethostbyaddr_async_start
49 @description Asynchronously resolves an Internet address
50 @param addr The address to be resolved.
51 @param len The length, in bytes, of the address.
53 @param callout The function to be called when the specified
54 address has been resolved.
55 @param context A user specified context which will be passed
56 to the callout function.
57 @result A mach reply port which will be sent a message when
58 the addr resolution has completed. This message
59 should be passed to the gethostbyaddr_async_handleReply
60 function. A NULL value indicates that no address
61 was specified or some other error occurred which
62 prevented the resolution from being started.
65 gethostbyaddr_async_start (
69 gethostbyaddr_async_callback callout
,
75 @function gethostbyaddr_async_handleReply
76 @description This function should be called with the Mach message sent
77 to the port returned by the call to gethostbyaddr_async_start.
78 The reply message will be interpreted and will result in a
79 call to the specified callout function.
80 @param replyMsg The Mach message.
83 gethostbyaddr_async_handleReply (
89 @typedef gethostbyname_async_callback
90 @discussion Type of the callback function used when a
91 gethostbyname_async_start() request is delivered.
92 @param hent The resolved host entry.
93 @param context The context provided when the request
96 typedef void (*gethostbyname_async_callback
) (
102 @function gethostbyname_async_start
103 @description Asynchronously resolves a hostname
104 @param name The hostname to be resolved.
105 @param callout The function to be called when the specified
106 hostname has been resolved.
107 @param context A user specified context which will be passed
108 to the callout function.
109 @result A mach reply port which will be sent a message when
110 the name resolution has completed. This message
111 should be passed to the gethostbyname_async_handleReply
112 function. A NULL value indicates that no hostname
113 was specified or some other error occurred which
114 prevented the resolution from being started.
117 gethostbyname_async_start (
119 gethostbyname_async_callback callout
,
125 @function gethostbyname_async_handleReply
126 @description This function should be called with the Mach message sent
127 to the port returned by the call to gethostbyname_async_start.
128 The reply message will be interpreted and will result in a
129 call to the specified callout function.
130 @param replyMsg The Mach message.
133 gethostbyname_async_handleReply (
139 @typedef getipnodebyaddr_async_callback
140 @discussion Type of the callback function used when a
141 getipnodebyaddr_async_start() request is delivered.
142 @param hent The resolved host entry. If not NULL, the caller
143 must call freehostent() on the host entry.
144 @param error If error code if the resolved host entry is NULL
145 @param context The context provided when the request
148 typedef void (*getipnodebyaddr_async_callback
) (
149 struct hostent
*hent
,
155 @function getipnodebyaddr_async_start
156 @description Asynchronously resolves an Internet address
157 @param addr The address to be resolved.
158 @param len The length, in bytes, of the address.
159 @param af The address family
161 @param callout The function to be called when the specified
162 address has been resolved.
163 @param context A user specified context which will be passed
164 to the callout function.
165 @result A mach reply port which will be sent a message when
166 the addr resolution has completed. This message
167 should be passed to the getipnodebyaddr_async_handleReply
168 function. A NULL value indicates that no address
169 was specified or some other error occurred which
170 prevented the resolution from being started.
173 getipnodebyaddr_async_start (
178 getipnodebyaddr_async_callback callout
,
184 @function getipnodebyaddr_async_handleReply
185 @description This function should be called with the Mach message sent
186 to the port returned by the call to getipnodebyaddr_async_start.
187 The reply message will be interpreted and will result in a
188 call to the specified callout function.
189 @param replyMsg The Mach message.
192 getipnodebyaddr_async_handleReply (
198 @typedef getipnodebyname_async_callback
199 @discussion Type of the callback function used when a
200 getipnodebyname_async_start() request is delivered.
201 @param hent The resolved host entry. If not NULL, the caller
202 must call freehostent() on the host entry.
203 @param error If error code if the resolved host entry is NULL
204 @param context The context provided when the request
207 typedef void (*getipnodebyname_async_callback
) (
208 struct hostent
*hent
,
214 @function getipnodebyname_async_start
215 @description Asynchronously resolves a hostname
216 @param name The hostname to be resolved.
220 @param callout The function to be called when the specified
221 hostname has been resolved.
222 @param context A user specified context which will be passed
223 to the callout function.
224 @result A mach reply port which will be sent a message when
225 the name resolution has completed. This message
226 should be passed to the getipnodebyname_async_handleReply
227 function. A NULL value indicates that no hostname
228 was specified or some other error occurred which
229 prevented the resolution from being started.
232 getipnodebyname_async_start (
237 getipnodebyname_async_callback callout
,
243 @function getipnodebyname_async_handleReply
244 @description This function should be called with the Mach message sent
245 to the port returned by the call to getipnodebyname_async_start.
246 The reply message will be interpreted and will result in a
247 call to the specified callout function.
248 @param replyMsg The Mach message.
251 getipnodebyname_async_handleReply (
257 #endif /* !_NETDB_ASYNC_H_ */