2 * Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC")
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
8 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
9 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10 * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
11 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
13 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14 * PERFORMANCE OF THIS SOFTWARE.
17 /* $Id: clientinfo.h,v 1.3 2011/10/11 23:46:45 tbox Exp $ */
19 #ifndef DNS_CLIENTINFO_H
20 #define DNS_CLIENTINFO_H 1
26 /*! \file dns/clientinfo.h
28 * The DNS clientinfo interface allows libdns to retrieve information
29 * about the client from the caller.
31 * The clientinfo interface is used by the DNS DB and DLZ interfaces;
32 * it allows databases to modify their answers on the basis of information
33 * about the client, such as source IP address.
35 * dns_clientinfo_t contains a pointer to an opaque structure containing
36 * client information in some form. dns_clientinfomethods_t contains a
37 * list of methods which operate on that opaque structure to return
38 * potentially useful data. Both structures also contain versioning
46 #include <isc/sockaddr.h>
47 #include <isc/types.h>
55 #define DNS_CLIENTINFO_VERSION 1
56 typedef struct dns_clientinfo {
61 typedef isc_result_t (*dns_clientinfo_sourceip_t)(dns_clientinfo_t *client,
62 isc_sockaddr_t **addrp);
64 #define DNS_CLIENTINFOMETHODS_VERSION 1
65 #define DNS_CLIENTINFOMETHODS_AGE 0
67 typedef struct dns_clientinfomethods {
70 dns_clientinfo_sourceip_t sourceip;
71 } dns_clientinfomethods_t;
77 dns_clientinfomethods_init(dns_clientinfomethods_t *methods,
78 dns_clientinfo_sourceip_t sourceip);
81 dns_clientinfo_init(dns_clientinfo_t *ci, void *data);
85 #endif /* DNS_CLIENTINFO_H */