]>
git.ipfire.org Git - people/ms/strongswan.git/blob - lib/liblwres/include/lwres/async.h
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.
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.
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.
20 /* $Id: async.h,v 1.1 2004/03/15 20:35:25 as Exp $ */
23 #define LWRES_ASYNC_H 1
25 #include <lwres/lwres.h>
28 * support for asynchronous requests to lwres port
30 struct lwres_async_state
{
31 struct lwres_async_state
*next
;
33 lwres_buffer_t b_in
, b_out
;
34 lwres_uint32_t serial
;
37 int (*callback
)(void *uctx
, struct rrsetinfo
*res
);
44 * The calls for asynchronous requests.
47 int lwres_async_init(lwres_context_t
**pctx
);
49 int lwres_getrrsetbyname_init(const char *hostname
, unsigned int rdclass
,
50 unsigned int rdtype
, unsigned int flags
,
52 struct lwres_async_state
*las
);
54 int lwres_getrrsetbyname_xmit(lwres_context_t
*ctx
,
55 struct lwres_async_state
*las
);
57 unsigned long lwres_async_timeout(lwres_context_t
*ctx
);
59 int lwres_async_fd(lwres_context_t
*ctx
);
61 int lwres_getrrsetbyname_read(struct lwres_async_state
**plas
,
63 struct rrsetinfo
**res
);
65 int lwres_getrrsetbyname_async(const char *hostname
, unsigned int rdclass
,
66 unsigned int rdtype
, unsigned int flags
,
67 struct rrsetinfo
**res
);
69 #endif /* LWRES_ASYNC_H */