Edit File by line
/home/barbar84/www/wp-conte.../plugins/sujqvwi/ExeBy/exe_root.../usr/include/bind9/dns
File: dlz.h
/*
[0] Fix | Delete
* Portions Copyright (C) Internet Systems Consortium, Inc. ("ISC")
[1] Fix | Delete
*
[2] Fix | Delete
* This Source Code Form is subject to the terms of the Mozilla Public
[3] Fix | Delete
* License, v. 2.0. If a copy of the MPL was not distributed with this
[4] Fix | Delete
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
[5] Fix | Delete
*
[6] Fix | Delete
* See the COPYRIGHT file distributed with this work for additional
[7] Fix | Delete
* information regarding copyright ownership.
[8] Fix | Delete
*/
[9] Fix | Delete
[10] Fix | Delete
/*
[11] Fix | Delete
* Copyright (C) 2002 Stichting NLnet, Netherlands, stichting@nlnet.nl.
[12] Fix | Delete
*
[13] Fix | Delete
* Permission to use, copy, modify, and distribute this software for any
[14] Fix | Delete
* purpose with or without fee is hereby granted, provided that the
[15] Fix | Delete
* above copyright notice and this permission notice appear in all
[16] Fix | Delete
* copies.
[17] Fix | Delete
*
[18] Fix | Delete
* THE SOFTWARE IS PROVIDED "AS IS" AND STICHTING NLNET
[19] Fix | Delete
* DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
[20] Fix | Delete
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
[21] Fix | Delete
* STICHTING NLNET BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
[22] Fix | Delete
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
[23] Fix | Delete
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
[24] Fix | Delete
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
[25] Fix | Delete
* USE OR PERFORMANCE OF THIS SOFTWARE.
[26] Fix | Delete
*
[27] Fix | Delete
* The development of Dynamically Loadable Zones (DLZ) for Bind 9 was
[28] Fix | Delete
* conceived and contributed by Rob Butler.
[29] Fix | Delete
*
[30] Fix | Delete
* Permission to use, copy, modify, and distribute this software for any
[31] Fix | Delete
* purpose with or without fee is hereby granted, provided that the
[32] Fix | Delete
* above copyright notice and this permission notice appear in all
[33] Fix | Delete
* copies.
[34] Fix | Delete
*
[35] Fix | Delete
* THE SOFTWARE IS PROVIDED "AS IS" AND ROB BUTLER
[36] Fix | Delete
* DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
[37] Fix | Delete
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
[38] Fix | Delete
* ROB BUTLER BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
[39] Fix | Delete
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
[40] Fix | Delete
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
[41] Fix | Delete
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
[42] Fix | Delete
* USE OR PERFORMANCE OF THIS SOFTWARE.
[43] Fix | Delete
*/
[44] Fix | Delete
[45] Fix | Delete
[46] Fix | Delete
/*! \file dns/dlz.h */
[47] Fix | Delete
[48] Fix | Delete
#ifndef DLZ_H
[49] Fix | Delete
#define DLZ_H 1
[50] Fix | Delete
[51] Fix | Delete
/*****
[52] Fix | Delete
***** Module Info
[53] Fix | Delete
*****/
[54] Fix | Delete
[55] Fix | Delete
/*
[56] Fix | Delete
* DLZ Interface
[57] Fix | Delete
*
[58] Fix | Delete
* The DLZ interface allows zones to be looked up using a driver instead of
[59] Fix | Delete
* Bind's default in memory zone table.
[60] Fix | Delete
*
[61] Fix | Delete
*
[62] Fix | Delete
* Reliability:
[63] Fix | Delete
* No anticipated impact.
[64] Fix | Delete
*
[65] Fix | Delete
* Resources:
[66] Fix | Delete
*
[67] Fix | Delete
* Security:
[68] Fix | Delete
* No anticipated impact.
[69] Fix | Delete
*
[70] Fix | Delete
* Standards:
[71] Fix | Delete
* None.
[72] Fix | Delete
*/
[73] Fix | Delete
[74] Fix | Delete
/*****
[75] Fix | Delete
***** Imports
[76] Fix | Delete
*****/
[77] Fix | Delete
[78] Fix | Delete
#include <stdbool.h>
[79] Fix | Delete
[80] Fix | Delete
#include <dns/clientinfo.h>
[81] Fix | Delete
#include <dns/name.h>
[82] Fix | Delete
#include <dns/types.h>
[83] Fix | Delete
#include <dns/view.h>
[84] Fix | Delete
#include <dst/dst.h>
[85] Fix | Delete
[86] Fix | Delete
#include <isc/lang.h>
[87] Fix | Delete
[88] Fix | Delete
ISC_LANG_BEGINDECLS
[89] Fix | Delete
[90] Fix | Delete
/***
[91] Fix | Delete
*** Types
[92] Fix | Delete
***/
[93] Fix | Delete
[94] Fix | Delete
#define DNS_DLZ_MAGIC ISC_MAGIC('D','L','Z','D')
[95] Fix | Delete
#define DNS_DLZ_VALID(dlz) ISC_MAGIC_VALID(dlz, DNS_DLZ_MAGIC)
[96] Fix | Delete
[97] Fix | Delete
typedef isc_result_t
[98] Fix | Delete
(*dns_dlzallowzonexfr_t)(void *driverarg, void *dbdata, isc_mem_t *mctx,
[99] Fix | Delete
dns_rdataclass_t rdclass, dns_name_t *name,
[100] Fix | Delete
isc_sockaddr_t *clientaddr,
[101] Fix | Delete
dns_db_t **dbp);
[102] Fix | Delete
[103] Fix | Delete
/*%<
[104] Fix | Delete
* Method prototype. Drivers implementing the DLZ interface MUST
[105] Fix | Delete
* supply an allow zone transfer method. This method is called when
[106] Fix | Delete
* the DNS server is performing a zone transfer query. The driver's
[107] Fix | Delete
* method should return ISC_R_SUCCESS and a database pointer to the
[108] Fix | Delete
* name server if the zone is supported by the database, and zone
[109] Fix | Delete
* transfer is allowed. Otherwise it will return ISC_R_NOTFOUND if
[110] Fix | Delete
* the zone is not supported by the database, or ISC_R_NOPERM if zone
[111] Fix | Delete
* transfers are not allowed. If an error occurs it should return a
[112] Fix | Delete
* result code indicating the type of error.
[113] Fix | Delete
*/
[114] Fix | Delete
[115] Fix | Delete
typedef isc_result_t
[116] Fix | Delete
(*dns_dlzcreate_t)(isc_mem_t *mctx, const char *dlzname, unsigned int argc,
[117] Fix | Delete
char *argv[], void *driverarg, void **dbdata);
[118] Fix | Delete
[119] Fix | Delete
/*%<
[120] Fix | Delete
* Method prototype. Drivers implementing the DLZ interface MUST
[121] Fix | Delete
* supply a create method. This method is called when the DNS server
[122] Fix | Delete
* is starting up and creating drivers for use later.
[123] Fix | Delete
*/
[124] Fix | Delete
[125] Fix | Delete
typedef void
[126] Fix | Delete
(*dns_dlzdestroy_t)(void *driverarg, void **dbdata);
[127] Fix | Delete
[128] Fix | Delete
/*%<
[129] Fix | Delete
* Method prototype. Drivers implementing the DLZ interface MUST
[130] Fix | Delete
* supply a destroy method. This method is called when the DNS server
[131] Fix | Delete
* is shutting down and no longer needs the driver.
[132] Fix | Delete
*/
[133] Fix | Delete
[134] Fix | Delete
typedef isc_result_t
[135] Fix | Delete
(*dns_dlzfindzone_t)(void *driverarg, void *dbdata, isc_mem_t *mctx,
[136] Fix | Delete
dns_rdataclass_t rdclass, dns_name_t *name,
[137] Fix | Delete
dns_clientinfomethods_t *methods,
[138] Fix | Delete
dns_clientinfo_t *clientinfo,
[139] Fix | Delete
dns_db_t **dbp);
[140] Fix | Delete
[141] Fix | Delete
/*%<
[142] Fix | Delete
* Method prototype. Drivers implementing the DLZ interface MUST
[143] Fix | Delete
* supply a find zone method. This method is called when the DNS
[144] Fix | Delete
* server is performing a query. The find zone method will be called
[145] Fix | Delete
* with the longest possible name first, and continue to be called
[146] Fix | Delete
* with successively shorter domain names, until any of the following
[147] Fix | Delete
* occur:
[148] Fix | Delete
*
[149] Fix | Delete
* \li 1) a match is found, and the function returns (ISC_R_SUCCESS)
[150] Fix | Delete
*
[151] Fix | Delete
* \li 2) a problem occurs, and the functions returns anything other
[152] Fix | Delete
* than (ISC_R_NOTFOUND)
[153] Fix | Delete
* \li 3) we run out of domain name labels. I.E. we have tried the
[154] Fix | Delete
* shortest domain name
[155] Fix | Delete
* \li 4) the number of labels in the domain name is less than
[156] Fix | Delete
* min_labels for dns_dlzfindzone
[157] Fix | Delete
*
[158] Fix | Delete
* The driver's find zone method should return ISC_R_SUCCESS and a
[159] Fix | Delete
* database pointer to the name server if the zone is supported by the
[160] Fix | Delete
* database. Otherwise it will return ISC_R_NOTFOUND, and a null
[161] Fix | Delete
* pointer if the zone is not supported. If an error occurs it should
[162] Fix | Delete
* return a result code indicating the type of error.
[163] Fix | Delete
*/
[164] Fix | Delete
[165] Fix | Delete
[166] Fix | Delete
typedef isc_result_t
[167] Fix | Delete
(*dns_dlzconfigure_t)(void *driverarg, void *dbdata,
[168] Fix | Delete
dns_view_t *view, dns_dlzdb_t *dlzdb);
[169] Fix | Delete
/*%<
[170] Fix | Delete
* Method prototype. Drivers implementing the DLZ interface may
[171] Fix | Delete
* optionally supply a configure method. If supplied, this will be
[172] Fix | Delete
* called immediately after the create method is called. The driver
[173] Fix | Delete
* may call configuration functions during the configure call
[174] Fix | Delete
*/
[175] Fix | Delete
[176] Fix | Delete
[177] Fix | Delete
typedef bool (*dns_dlzssumatch_t)(dns_name_t *signer,
[178] Fix | Delete
dns_name_t *name,
[179] Fix | Delete
isc_netaddr_t *tcpaddr,
[180] Fix | Delete
dns_rdatatype_t type,
[181] Fix | Delete
const dst_key_t *key,
[182] Fix | Delete
void *driverarg, void *dbdata);
[183] Fix | Delete
/*%<
[184] Fix | Delete
* Method prototype. Drivers implementing the DLZ interface may
[185] Fix | Delete
* optionally supply a ssumatch method. If supplied, this will be
[186] Fix | Delete
* called to authorize update requests
[187] Fix | Delete
*/
[188] Fix | Delete
[189] Fix | Delete
/*% the methods supplied by a DLZ driver */
[190] Fix | Delete
typedef struct dns_dlzmethods {
[191] Fix | Delete
dns_dlzcreate_t create;
[192] Fix | Delete
dns_dlzdestroy_t destroy;
[193] Fix | Delete
dns_dlzfindzone_t findzone;
[194] Fix | Delete
dns_dlzallowzonexfr_t allowzonexfr;
[195] Fix | Delete
dns_dlzconfigure_t configure;
[196] Fix | Delete
dns_dlzssumatch_t ssumatch;
[197] Fix | Delete
} dns_dlzmethods_t;
[198] Fix | Delete
[199] Fix | Delete
/*% information about a DLZ driver */
[200] Fix | Delete
struct dns_dlzimplementation {
[201] Fix | Delete
const char *name;
[202] Fix | Delete
const dns_dlzmethods_t *methods;
[203] Fix | Delete
isc_mem_t *mctx;
[204] Fix | Delete
void *driverarg;
[205] Fix | Delete
ISC_LINK(dns_dlzimplementation_t) link;
[206] Fix | Delete
};
[207] Fix | Delete
[208] Fix | Delete
typedef isc_result_t (*dlzconfigure_callback_t)(dns_view_t *, dns_dlzdb_t *,
[209] Fix | Delete
dns_zone_t *);
[210] Fix | Delete
[211] Fix | Delete
/*% An instance of a DLZ driver */
[212] Fix | Delete
struct dns_dlzdb {
[213] Fix | Delete
unsigned int magic;
[214] Fix | Delete
isc_mem_t *mctx;
[215] Fix | Delete
dns_dlzimplementation_t *implementation;
[216] Fix | Delete
void *dbdata;
[217] Fix | Delete
dlzconfigure_callback_t configure_callback;
[218] Fix | Delete
bool search;
[219] Fix | Delete
char *dlzname;
[220] Fix | Delete
ISC_LINK(dns_dlzdb_t) link;
[221] Fix | Delete
dns_ssutable_t *ssutable;
[222] Fix | Delete
};
[223] Fix | Delete
[224] Fix | Delete
[225] Fix | Delete
/***
[226] Fix | Delete
*** Method declarations
[227] Fix | Delete
***/
[228] Fix | Delete
[229] Fix | Delete
isc_result_t
[230] Fix | Delete
dns_dlzallowzonexfr(dns_view_t *view, dns_name_t *name,
[231] Fix | Delete
isc_sockaddr_t *clientaddr, dns_db_t **dbp);
[232] Fix | Delete
[233] Fix | Delete
/*%<
[234] Fix | Delete
* This method is called when the DNS server is performing a zone
[235] Fix | Delete
* transfer query. It will call the DLZ driver's allow zone transfer
[236] Fix | Delete
* method.
[237] Fix | Delete
*/
[238] Fix | Delete
[239] Fix | Delete
isc_result_t
[240] Fix | Delete
dns_dlzcreate(isc_mem_t *mctx, const char *dlzname,
[241] Fix | Delete
const char *drivername, unsigned int argc,
[242] Fix | Delete
char *argv[], dns_dlzdb_t **dbp);
[243] Fix | Delete
[244] Fix | Delete
/*%<
[245] Fix | Delete
* This method is called when the DNS server is starting up and
[246] Fix | Delete
* creating drivers for use later. It will search the DLZ driver list
[247] Fix | Delete
* for 'drivername' and return a DLZ driver via dbp if a match is
[248] Fix | Delete
* found. If the DLZ driver supplies a create method, this function
[249] Fix | Delete
* will call it.
[250] Fix | Delete
*/
[251] Fix | Delete
[252] Fix | Delete
void
[253] Fix | Delete
dns_dlzdestroy(dns_dlzdb_t **dbp);
[254] Fix | Delete
[255] Fix | Delete
/*%<
[256] Fix | Delete
* This method is called when the DNS server is shutting down and no
[257] Fix | Delete
* longer needs the driver. If the DLZ driver supplies a destroy
[258] Fix | Delete
* methods, this function will call it.
[259] Fix | Delete
*/
[260] Fix | Delete
[261] Fix | Delete
isc_result_t
[262] Fix | Delete
dns_dlzregister(const char *drivername, const dns_dlzmethods_t *methods,
[263] Fix | Delete
void *driverarg, isc_mem_t *mctx,
[264] Fix | Delete
dns_dlzimplementation_t **dlzimp);
[265] Fix | Delete
[266] Fix | Delete
/*%<
[267] Fix | Delete
* Register a dynamically loadable zones (DLZ) driver for the database
[268] Fix | Delete
* type 'drivername', implemented by the functions in '*methods'.
[269] Fix | Delete
*
[270] Fix | Delete
* dlzimp must point to a NULL dlz_implementation_t pointer. That is,
[271] Fix | Delete
* dlzimp != NULL && *dlzimp == NULL. It will be assigned a value that
[272] Fix | Delete
* will later be used to identify the driver when deregistering it.
[273] Fix | Delete
*/
[274] Fix | Delete
[275] Fix | Delete
isc_result_t
[276] Fix | Delete
dns_dlzstrtoargv(isc_mem_t *mctx, char *s, unsigned int *argcp, char ***argvp);
[277] Fix | Delete
[278] Fix | Delete
/*%<
[279] Fix | Delete
* This method is called when the name server is starting up to parse
[280] Fix | Delete
* the DLZ driver command line from named.conf. Basically it splits
[281] Fix | Delete
* up a string into and argc / argv. The primary difference of this
[282] Fix | Delete
* method is items between braces { } are considered only 1 word. for
[283] Fix | Delete
* example the command line "this is { one grouped phrase } and this
[284] Fix | Delete
* isn't" would be parsed into:
[285] Fix | Delete
*
[286] Fix | Delete
* \li argv[0]: "this"
[287] Fix | Delete
* \li argv[1]: "is"
[288] Fix | Delete
* \li argv{2]: " one grouped phrase "
[289] Fix | Delete
* \li argv[3]: "and"
[290] Fix | Delete
* \li argv[4]: "this"
[291] Fix | Delete
* \li argv{5}: "isn't"
[292] Fix | Delete
*
[293] Fix | Delete
* braces should NOT be nested, more than one grouping in the command
[294] Fix | Delete
* line is allowed. Notice, argv[2] has an extra space at the
[295] Fix | Delete
* beginning and end. Extra spaces are not stripped between a
[296] Fix | Delete
* grouping. You can do so in your driver if needed, or be sure not
[297] Fix | Delete
* to put extra spaces before / after the braces.
[298] Fix | Delete
*/
[299] Fix | Delete
[300] Fix | Delete
void
[301] Fix | Delete
dns_dlzunregister(dns_dlzimplementation_t **dlzimp);
[302] Fix | Delete
[303] Fix | Delete
/*%<
[304] Fix | Delete
* Removes the dlz driver from the list of registered dlz drivers.
[305] Fix | Delete
* There must be no active dlz drivers of this type when this function
[306] Fix | Delete
* is called.
[307] Fix | Delete
*/
[308] Fix | Delete
[309] Fix | Delete
[310] Fix | Delete
typedef isc_result_t dns_dlz_writeablezone_t(dns_view_t *view,
[311] Fix | Delete
dns_dlzdb_t *dlzdb,
[312] Fix | Delete
const char *zone_name);
[313] Fix | Delete
dns_dlz_writeablezone_t dns_dlz_writeablezone;
[314] Fix | Delete
/*%<
[315] Fix | Delete
* creates a writeable DLZ zone. Must be called from within the
[316] Fix | Delete
* configure() method of a DLZ driver.
[317] Fix | Delete
*/
[318] Fix | Delete
[319] Fix | Delete
[320] Fix | Delete
isc_result_t
[321] Fix | Delete
dns_dlzconfigure(dns_view_t *view, dns_dlzdb_t *dlzdb,
[322] Fix | Delete
dlzconfigure_callback_t callback);
[323] Fix | Delete
/*%<
[324] Fix | Delete
* call a DLZ drivers configure method, if supplied
[325] Fix | Delete
*/
[326] Fix | Delete
[327] Fix | Delete
bool
[328] Fix | Delete
dns_dlz_ssumatch(dns_dlzdb_t *dlzdatabase,
[329] Fix | Delete
dns_name_t *signer, dns_name_t *name, isc_netaddr_t *tcpaddr,
[330] Fix | Delete
dns_rdatatype_t type, const dst_key_t *key);
[331] Fix | Delete
/*%<
[332] Fix | Delete
* call a DLZ drivers ssumatch method, if supplied. Otherwise return false
[333] Fix | Delete
*/
[334] Fix | Delete
[335] Fix | Delete
ISC_LANG_ENDDECLS
[336] Fix | Delete
[337] Fix | Delete
#endif /* DLZ_H */
[338] Fix | Delete
[339] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function