"Fossies" - the Fresh Open Source Software Archive

Member "bind-9.16.7/lib/dns/include/dns/clientinfo.h" (4 Sep 2020, 2012 Bytes) of package /linux/misc/dns/bind9/9.16.7/bind-9.16.7.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "clientinfo.h" see the Fossies "Dox" file reference documentation.

    1 /*
    2  * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
    3  *
    4  * This Source Code Form is subject to the terms of the Mozilla Public
    5  * License, v. 2.0. If a copy of the MPL was not distributed with this
    6  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
    7  *
    8  * See the COPYRIGHT file distributed with this work for additional
    9  * information regarding copyright ownership.
   10  */
   11 
   12 #ifndef DNS_CLIENTINFO_H
   13 #define DNS_CLIENTINFO_H 1
   14 
   15 /*****
   16 ***** Module Info
   17 *****/
   18 
   19 /*! \file dns/clientinfo.h
   20  * \brief
   21  * The DNS clientinfo interface allows libdns to retrieve information
   22  * about the client from the caller.
   23  *
   24  * The clientinfo interface is used by the DNS DB and DLZ interfaces;
   25  * it allows databases to modify their answers on the basis of information
   26  * about the client, such as source IP address.
   27  *
   28  * dns_clientinfo_t contains a pointer to an opaque structure containing
   29  * client information in some form.  dns_clientinfomethods_t contains a
   30  * list of methods which operate on that opaque structure to return
   31  * potentially useful data.  Both structures also contain versioning
   32  * information.
   33  */
   34 
   35 /*****
   36 ***** Imports
   37 *****/
   38 
   39 #include <inttypes.h>
   40 
   41 #include <isc/sockaddr.h>
   42 #include <isc/types.h>
   43 
   44 ISC_LANG_BEGINDECLS
   45 
   46 /*****
   47 ***** Types
   48 *****/
   49 
   50 #define DNS_CLIENTINFO_VERSION 2
   51 typedef struct dns_clientinfo {
   52     uint16_t version;
   53     void *   data;
   54     void *   dbversion;
   55 } dns_clientinfo_t;
   56 
   57 typedef isc_result_t (*dns_clientinfo_sourceip_t)(dns_clientinfo_t *client,
   58                           isc_sockaddr_t ** addrp);
   59 
   60 #define DNS_CLIENTINFOMETHODS_VERSION 2
   61 #define DNS_CLIENTINFOMETHODS_AGE     1
   62 
   63 typedef struct dns_clientinfomethods {
   64     uint16_t          version;
   65     uint16_t          age;
   66     dns_clientinfo_sourceip_t sourceip;
   67 } dns_clientinfomethods_t;
   68 
   69 /*****
   70 ***** Methods
   71 *****/
   72 void
   73 dns_clientinfomethods_init(dns_clientinfomethods_t * methods,
   74                dns_clientinfo_sourceip_t sourceip);
   75 
   76 void
   77 dns_clientinfo_init(dns_clientinfo_t *ci, void *data, void *versionp);
   78 
   79 ISC_LANG_ENDDECLS
   80 
   81 #endif /* DNS_CLIENTINFO_H */