clientinfo.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2011, 2014  Internet Systems Consortium, Inc. ("ISC")
00003  *
00004  * Permission to use, copy, modify, and/or distribute this software for any
00005  * purpose with or without fee is hereby granted, provided that the above
00006  * copyright notice and this permission notice appear in all copies.
00007  *
00008  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
00009  * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
00010  * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
00011  * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
00012  * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
00013  * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
00014  * PERFORMANCE OF THIS SOFTWARE.
00015  */
00016 
00017 /* $Id: clientinfo.h,v 1.3 2011/10/11 23:46:45 tbox Exp $ */
00018 
00019 #ifndef DNS_CLIENTINFO_H
00020 #define DNS_CLIENTINFO_H 1
00021 
00022 /*****
00023  ***** Module Info
00024  *****/
00025 
00026 /*! \file dns/clientinfo.h
00027  * \brief
00028  * The DNS clientinfo interface allows libdns to retrieve information
00029  * about the client from the caller.
00030  *
00031  * The clientinfo interface is used by the DNS DB and DLZ interfaces;
00032  * it allows databases to modify their answers on the basis of information
00033  * about the client, such as source IP address.
00034  *
00035  * dns_clientinfo_t contains a pointer to an opaque structure containing
00036  * client information in some form.  dns_clientinfomethods_t contains a
00037  * list of methods which operate on that opaque structure to return
00038  * potentially useful data.  Both structures also contain versioning
00039  * information.
00040  */
00041 
00042 /*****
00043  ***** Imports
00044  *****/
00045 
00046 #include <isc/sockaddr.h>
00047 #include <isc/types.h>
00048 
00049 ISC_LANG_BEGINDECLS
00050 
00051 /*****
00052  ***** Types
00053  *****/
00054 
00055 #define DNS_CLIENTINFO_VERSION 2
00056 typedef struct dns_clientinfo {
00057         isc_uint16_t version;
00058         void *data;
00059         void *dbversion;
00060 } dns_clientinfo_t;
00061 
00062 typedef isc_result_t (*dns_clientinfo_sourceip_t)(dns_clientinfo_t *client,
00063                                                   isc_sockaddr_t **addrp);
00064 
00065 #define DNS_CLIENTINFOMETHODS_VERSION 1
00066 #define DNS_CLIENTINFOMETHODS_AGE 0
00067 
00068 typedef struct dns_clientinfomethods {
00069         isc_uint16_t version;
00070         isc_uint16_t age;
00071         dns_clientinfo_sourceip_t sourceip;
00072 } dns_clientinfomethods_t;
00073 
00074 /*****
00075  ***** Methods
00076  *****/
00077 void
00078 dns_clientinfomethods_init(dns_clientinfomethods_t *methods,
00079                            dns_clientinfo_sourceip_t sourceip);
00080 
00081 void
00082 dns_clientinfo_init(dns_clientinfo_t *ci, void *data, void *versionp);
00083 
00084 ISC_LANG_ENDDECLS
00085 
00086 #endif /* DNS_CLIENTINFO_H */

Generated on Tue Apr 28 17:40:57 2015 by Doxygen 1.5.4 for BIND9 Internals 9.11.0pre-alpha