]> git.ipfire.org Git - people/ms/strongswan.git/blob - lib/liblwres/include/lwres/async.h
- fixed stroke error output to starter
[people/ms/strongswan.git] / lib / liblwres / include / lwres / async.h
1 /*
2 * Copyright (C) 2003 Michael Richardson
3 * Contributed by Michael Richardson <mcr@freeswan.org> while working
4 * on the Linux FreeS/WAN project in 2003.
5 *
6 * Permission to use, copy, modify, and distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
11 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
12 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
13 * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
14 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
15 * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
16 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
17 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 */
19
20 /* $Id: async.h,v 1.1 2004/03/15 20:35:25 as Exp $ */
21
22 #ifndef LWRES_ASYNC_H
23 #define LWRES_ASYNC_H 1
24
25 #include <lwres/lwres.h>
26
27 /*
28 * support for asynchronous requests to lwres port
29 */
30 struct lwres_async_state {
31 struct lwres_async_state *next;
32
33 lwres_buffer_t b_in, b_out;
34 lwres_uint32_t serial;
35 int opcode;
36
37 int (*callback)(void *uctx, struct rrsetinfo *res);
38 void *uctx;
39 };
40
41
42
43 /*
44 * The calls for asynchronous requests.
45 */
46
47 int lwres_async_init(lwres_context_t **pctx);
48
49 int lwres_getrrsetbyname_init(const char *hostname, unsigned int rdclass,
50 unsigned int rdtype, unsigned int flags,
51 lwres_context_t *ctx,
52 struct lwres_async_state *las);
53
54 int lwres_getrrsetbyname_xmit(lwres_context_t *ctx,
55 struct lwres_async_state *las);
56
57 unsigned long lwres_async_timeout(lwres_context_t *ctx);
58
59 int lwres_async_fd(lwres_context_t *ctx);
60
61 int lwres_getrrsetbyname_read(struct lwres_async_state **plas,
62 lwres_context_t *ctx,
63 struct rrsetinfo **res);
64
65 int lwres_getrrsetbyname_async(const char *hostname, unsigned int rdclass,
66 unsigned int rdtype, unsigned int flags,
67 struct rrsetinfo **res);
68
69 #endif /* LWRES_ASYNC_H */
70
71
72
73
74
75
76
77
78