Patrick Welche <prlw1@cam.ac.uk>
[netbsd-mini2440.git] / external / bsd / bind / dist / lib / lwres / context_p.h
blob26a5461a23be146b11319c12e3e7ac9095d44e3e
1 /* $NetBSD$ */
3 /*
4 * Copyright (C) 2004, 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC")
5 * Copyright (C) 2000, 2001 Internet Software Consortium.
7 * Permission to use, copy, modify, and/or distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above
9 * copyright notice and this permission notice appear in all copies.
11 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
12 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
13 * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
14 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
15 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
16 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17 * PERFORMANCE OF THIS SOFTWARE.
20 /* Id: context_p.h,v 1.19 2008/12/17 23:47:58 tbox Exp */
22 #ifndef LWRES_CONTEXT_P_H
23 #define LWRES_CONTEXT_P_H 1
25 /*! \file */
27 /*@{*/
28 /**
29 * Helper functions, assuming the context is always called "ctx" in
30 * the scope these functions are called from.
32 #define CTXMALLOC(len) ctx->malloc(ctx->arg, (len))
33 #define CTXFREE(addr, len) ctx->free(ctx->arg, (addr), (len))
34 /*@}*/
36 #define LWRES_DEFAULT_TIMEOUT 120 /* 120 seconds for a reply */
38 /**
39 * Not all the attributes here are actually settable by the application at
40 * this time.
42 struct lwres_context {
43 unsigned int timeout; /*%< time to wait for reply */
44 lwres_uint32_t serial; /*%< serial number state */
47 * For network I/O.
49 int sock; /*%< socket to send on */
50 lwres_addr_t address; /*%< address to send to */
51 int use_ipv4; /*%< use IPv4 transaction */
52 int use_ipv6; /*%< use IPv6 transaction */
54 /*@{*/
56 * Function pointers for allocating memory.
58 lwres_malloc_t malloc;
59 lwres_free_t free;
60 void *arg;
61 /*@}*/
63 /*%
64 * resolv.conf-like data
66 lwres_conf_t confdata;
69 #endif /* LWRES_CONTEXT_P_H */