Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ShExBy/shex_roo.../usr/include/bind9/dns
File: sdlz.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/sdlz.h */
[47] Fix | Delete
[48] Fix | Delete
#ifndef SDLZ_H
[49] Fix | Delete
#define SDLZ_H 1
[50] Fix | Delete
[51] Fix | Delete
#include <inttypes.h>
[52] Fix | Delete
#include <stdbool.h>
[53] Fix | Delete
[54] Fix | Delete
#include <dns/clientinfo.h>
[55] Fix | Delete
#include <dns/dlz.h>
[56] Fix | Delete
[57] Fix | Delete
ISC_LANG_BEGINDECLS
[58] Fix | Delete
[59] Fix | Delete
#define DNS_SDLZFLAG_THREADSAFE 0x00000001U
[60] Fix | Delete
#define DNS_SDLZFLAG_RELATIVEOWNER 0x00000002U
[61] Fix | Delete
#define DNS_SDLZFLAG_RELATIVERDATA 0x00000004U
[62] Fix | Delete
[63] Fix | Delete
/* A simple DLZ database. */
[64] Fix | Delete
typedef struct dns_sdlz_db dns_sdlz_db_t;
[65] Fix | Delete
[66] Fix | Delete
/* A simple DLZ database lookup in progress. */
[67] Fix | Delete
typedef struct dns_sdlzlookup dns_sdlzlookup_t;
[68] Fix | Delete
[69] Fix | Delete
/* A simple DLZ database traversal in progress. */
[70] Fix | Delete
typedef struct dns_sdlzallnodes dns_sdlzallnodes_t;
[71] Fix | Delete
[72] Fix | Delete
typedef isc_result_t (*dns_sdlzallnodesfunc_t)(const char *zone,
[73] Fix | Delete
void *driverarg,
[74] Fix | Delete
void *dbdata,
[75] Fix | Delete
dns_sdlzallnodes_t *allnodes);
[76] Fix | Delete
/*%<
[77] Fix | Delete
* Method prototype. Drivers implementing the SDLZ interface may
[78] Fix | Delete
* supply an all nodes method. This method is called when the DNS
[79] Fix | Delete
* server is performing a zone transfer query, after the allow zone
[80] Fix | Delete
* transfer method has been called. This method is only called if the
[81] Fix | Delete
* allow zone transfer method returned ISC_R_SUCCESS. This method and
[82] Fix | Delete
* the allow zone transfer method are both required for zone transfers
[83] Fix | Delete
* to be supported. If the driver generates data dynamically (instead
[84] Fix | Delete
* of searching in a database for it) it should not implement this
[85] Fix | Delete
* function as a zone transfer would be meaningless. A SDLZ driver
[86] Fix | Delete
* does not have to implement an all nodes method.
[87] Fix | Delete
*/
[88] Fix | Delete
[89] Fix | Delete
typedef isc_result_t (*dns_sdlzallowzonexfr_t)(void *driverarg,
[90] Fix | Delete
void *dbdata, const char *name,
[91] Fix | Delete
const char *client);
[92] Fix | Delete
[93] Fix | Delete
/*%<
[94] Fix | Delete
* Method prototype. Drivers implementing the SDLZ interface may
[95] Fix | Delete
* supply an allow zone transfer method. This method is called when
[96] Fix | Delete
* the DNS server is performing a zone transfer query, before the all
[97] Fix | Delete
* nodes method can be called. This method and the all node method
[98] Fix | Delete
* are both required for zone transfers to be supported. If the
[99] Fix | Delete
* driver generates data dynamically (instead of searching in a
[100] Fix | Delete
* database for it) it should not implement this function as a zone
[101] Fix | Delete
* transfer would be meaningless. A SDLZ driver does not have to
[102] Fix | Delete
* implement an allow zone transfer method.
[103] Fix | Delete
*
[104] Fix | Delete
* This method should return ISC_R_SUCCESS if the zone is supported by
[105] Fix | Delete
* the database and a zone transfer is allowed for the specified
[106] Fix | Delete
* client. If the zone is supported by the database, but zone
[107] Fix | Delete
* transfers are not allowed for the specified client this method
[108] Fix | Delete
* should return ISC_R_NOPERM.. Lastly the method should return
[109] Fix | Delete
* ISC_R_NOTFOUND if the zone is not supported by the database. If an
[110] Fix | Delete
* error occurs it should return a result code indicating the type of
[111] Fix | Delete
* error.
[112] Fix | Delete
*/
[113] Fix | Delete
[114] Fix | Delete
typedef isc_result_t (*dns_sdlzauthorityfunc_t)(const char *zone,
[115] Fix | Delete
void *driverarg, void *dbdata,
[116] Fix | Delete
dns_sdlzlookup_t *lookup);
[117] Fix | Delete
[118] Fix | Delete
/*%<
[119] Fix | Delete
* Method prototype. Drivers implementing the SDLZ interface may
[120] Fix | Delete
* supply an authority method. This method is called when the DNS
[121] Fix | Delete
* server is performing a query, after both the find zone and lookup
[122] Fix | Delete
* methods have been called. This method is required if the lookup
[123] Fix | Delete
* function does not supply authority information for the dns
[124] Fix | Delete
* record. A SDLZ driver does not have to implement an authority
[125] Fix | Delete
* method.
[126] Fix | Delete
*/
[127] Fix | Delete
[128] Fix | Delete
typedef isc_result_t (*dns_sdlzcreate_t)(const char *dlzname,
[129] Fix | Delete
unsigned int argc, char *argv[],
[130] Fix | Delete
void *driverarg, void **dbdata);
[131] Fix | Delete
[132] Fix | Delete
/*%<
[133] Fix | Delete
* Method prototype. Drivers implementing the SDLZ interface may
[134] Fix | Delete
* supply a create method. This method is called when the DNS server
[135] Fix | Delete
* is starting up and creating drivers for use later. A SDLZ driver
[136] Fix | Delete
* does not have to implement a create method.
[137] Fix | Delete
*/
[138] Fix | Delete
[139] Fix | Delete
typedef void (*dns_sdlzdestroy_t)(void *driverarg, void *dbdata);
[140] Fix | Delete
[141] Fix | Delete
/*%<
[142] Fix | Delete
* Method prototype. Drivers implementing the SDLZ interface may
[143] Fix | Delete
* supply a destroy method. This method is called when the DNS server
[144] Fix | Delete
* is shutting down and no longer needs the driver. A SDLZ driver does
[145] Fix | Delete
* not have to implement a destroy method.
[146] Fix | Delete
*/
[147] Fix | Delete
[148] Fix | Delete
typedef isc_result_t
[149] Fix | Delete
(*dns_sdlzfindzone_t)(void *driverarg, void *dbdata, const char *name,
[150] Fix | Delete
dns_clientinfomethods_t *methods,
[151] Fix | Delete
dns_clientinfo_t *clientinfo);
[152] Fix | Delete
/*%<
[153] Fix | Delete
* Method prototype. Drivers implementing the SDLZ interface MUST
[154] Fix | Delete
* supply a find zone method. This method is called when the DNS
[155] Fix | Delete
* server is performing a query to to determine if 'name' is a
[156] Fix | Delete
* supported dns zone. The find zone method will be called with the
[157] Fix | Delete
* longest possible name first, and continue to be called with
[158] Fix | Delete
* successively shorter domain names, until any of the following
[159] Fix | Delete
* occur:
[160] Fix | Delete
*
[161] Fix | Delete
* \li 1) the function returns (ISC_R_SUCCESS) indicating a zone name
[162] Fix | Delete
* match.
[163] Fix | Delete
*
[164] Fix | Delete
* \li 2) a problem occurs, and the functions returns anything other than
[165] Fix | Delete
* (ISC_R_NOTFOUND)
[166] Fix | Delete
*
[167] Fix | Delete
* \li 3) we run out of domain name labels. I.E. we have tried the
[168] Fix | Delete
* shortest domain name
[169] Fix | Delete
*
[170] Fix | Delete
* \li 4) the number of labels in the domain name is less than min_labels
[171] Fix | Delete
* for dns_dlzfindzone
[172] Fix | Delete
*
[173] Fix | Delete
* The driver's find zone method should return ISC_R_SUCCESS if the
[174] Fix | Delete
* zone is supported by the database. Otherwise it should return
[175] Fix | Delete
* ISC_R_NOTFOUND, if the zone is not supported. If an error occurs
[176] Fix | Delete
* it should return a result code indicating the type of error.
[177] Fix | Delete
*/
[178] Fix | Delete
[179] Fix | Delete
typedef isc_result_t
[180] Fix | Delete
(*dns_sdlzlookupfunc_t)(const char *zone, const char *name, void *driverarg,
[181] Fix | Delete
void *dbdata, dns_sdlzlookup_t *lookup,
[182] Fix | Delete
dns_clientinfomethods_t *methods,
[183] Fix | Delete
dns_clientinfo_t *clientinfo);
[184] Fix | Delete
[185] Fix | Delete
/*%<
[186] Fix | Delete
* Method prototype. Drivers implementing the SDLZ interface MUST
[187] Fix | Delete
* supply a lookup method. This method is called when the
[188] Fix | Delete
* DNS server is performing a query, after the find zone and before any
[189] Fix | Delete
* other methods have been called. This function returns DNS record
[190] Fix | Delete
* information using the dns_sdlz_putrr and dns_sdlz_putsoa functions.
[191] Fix | Delete
* If this function supplies authority information for the DNS record
[192] Fix | Delete
* the authority method is not required. If it does not, the
[193] Fix | Delete
* authority function is required.
[194] Fix | Delete
*
[195] Fix | Delete
* The 'methods' and 'clientinfo' args allow an SDLZ driver to retrieve
[196] Fix | Delete
* information about the querying client (such as source IP address)
[197] Fix | Delete
* from the caller.
[198] Fix | Delete
*/
[199] Fix | Delete
[200] Fix | Delete
typedef isc_result_t (*dns_sdlznewversion_t)(const char *zone,
[201] Fix | Delete
void *driverarg, void *dbdata,
[202] Fix | Delete
void **versionp);
[203] Fix | Delete
/*%<
[204] Fix | Delete
* Method prototype. Drivers implementing the SDLZ interface may
[205] Fix | Delete
* supply a newversion method. This method is called to start a
[206] Fix | Delete
* write transaction on a zone and should only be implemented by
[207] Fix | Delete
* writeable backends.
[208] Fix | Delete
* When implemented, the driver should create a new transaction, and
[209] Fix | Delete
* fill *versionp with a pointer to the transaction state. The
[210] Fix | Delete
* closeversion function will be called to close the transaction.
[211] Fix | Delete
*/
[212] Fix | Delete
[213] Fix | Delete
typedef void (*dns_sdlzcloseversion_t)(const char *zone, bool commit,
[214] Fix | Delete
void *driverarg, void *dbdata,
[215] Fix | Delete
void **versionp);
[216] Fix | Delete
/*%<
[217] Fix | Delete
* Method prototype. Drivers implementing the SDLZ interface must
[218] Fix | Delete
* supply a closeversion method if they supply a newversion method.
[219] Fix | Delete
* When implemented, the driver should close the given transaction,
[220] Fix | Delete
* committing changes if 'commit' is true. If 'commit' is not true
[221] Fix | Delete
* then all changes should be discarded and the database rolled back.
[222] Fix | Delete
* If the call is successful then *versionp should be set to NULL
[223] Fix | Delete
*/
[224] Fix | Delete
[225] Fix | Delete
typedef isc_result_t (*dns_sdlzconfigure_t)(dns_view_t *view,
[226] Fix | Delete
dns_dlzdb_t *dlzdb,
[227] Fix | Delete
void *driverarg, void *dbdata);
[228] Fix | Delete
/*%<
[229] Fix | Delete
* Method prototype. Drivers implementing the SDLZ interface may
[230] Fix | Delete
* supply a configure method. When supplied, it will be called
[231] Fix | Delete
* immediately after the create method to give the driver a chance
[232] Fix | Delete
* to configure writeable zones
[233] Fix | Delete
*/
[234] Fix | Delete
[235] Fix | Delete
[236] Fix | Delete
typedef bool (*dns_sdlzssumatch_t)(const char *signer,
[237] Fix | Delete
const char *name,
[238] Fix | Delete
const char *tcpaddr,
[239] Fix | Delete
const char *type,
[240] Fix | Delete
const char *key,
[241] Fix | Delete
uint32_t keydatalen,
[242] Fix | Delete
unsigned char *keydata,
[243] Fix | Delete
void *driverarg,
[244] Fix | Delete
void *dbdata);
[245] Fix | Delete
[246] Fix | Delete
/*%<
[247] Fix | Delete
* Method prototype. Drivers implementing the SDLZ interface may
[248] Fix | Delete
* supply a ssumatch method. If supplied, then ssumatch will be
[249] Fix | Delete
* called to authorize any zone updates. The driver should return
[250] Fix | Delete
* true to allow the update, and false to deny it. For a DLZ
[251] Fix | Delete
* controlled zone, this is the only access control on updates.
[252] Fix | Delete
*/
[253] Fix | Delete
[254] Fix | Delete
[255] Fix | Delete
typedef isc_result_t (*dns_sdlzmodrdataset_t)(const char *name,
[256] Fix | Delete
const char *rdatastr,
[257] Fix | Delete
void *driverarg, void *dbdata,
[258] Fix | Delete
void *version);
[259] Fix | Delete
/*%<
[260] Fix | Delete
* Method prototype. Drivers implementing the SDLZ interface may
[261] Fix | Delete
* supply addrdataset and subtractrdataset methods. If supplied, then these
[262] Fix | Delete
* will be called when rdatasets are added/subtracted during
[263] Fix | Delete
* updates. The version parameter comes from a call to the sdlz
[264] Fix | Delete
* newversion() method from the driver. The rdataset parameter is a
[265] Fix | Delete
* linearise string representation of the rdataset change. The format
[266] Fix | Delete
* is the same as used by dig when displaying records. The fields are
[267] Fix | Delete
* tab delimited.
[268] Fix | Delete
*/
[269] Fix | Delete
[270] Fix | Delete
typedef isc_result_t (*dns_sdlzdelrdataset_t)(const char *name,
[271] Fix | Delete
const char *type,
[272] Fix | Delete
void *driverarg, void *dbdata,
[273] Fix | Delete
void *version);
[274] Fix | Delete
/*%<
[275] Fix | Delete
* Method prototype. Drivers implementing the SDLZ interface may
[276] Fix | Delete
* supply a delrdataset method. If supplied, then this
[277] Fix | Delete
* function will be called when rdatasets are deleted during
[278] Fix | Delete
* updates. The call should remove all rdatasets of the given type for
[279] Fix | Delete
* the specified name.
[280] Fix | Delete
*/
[281] Fix | Delete
[282] Fix | Delete
typedef struct dns_sdlzmethods {
[283] Fix | Delete
dns_sdlzcreate_t create;
[284] Fix | Delete
dns_sdlzdestroy_t destroy;
[285] Fix | Delete
dns_sdlzfindzone_t findzone;
[286] Fix | Delete
dns_sdlzlookupfunc_t lookup;
[287] Fix | Delete
dns_sdlzauthorityfunc_t authority;
[288] Fix | Delete
dns_sdlzallnodesfunc_t allnodes;
[289] Fix | Delete
dns_sdlzallowzonexfr_t allowzonexfr;
[290] Fix | Delete
dns_sdlznewversion_t newversion;
[291] Fix | Delete
dns_sdlzcloseversion_t closeversion;
[292] Fix | Delete
dns_sdlzconfigure_t configure;
[293] Fix | Delete
dns_sdlzssumatch_t ssumatch;
[294] Fix | Delete
dns_sdlzmodrdataset_t addrdataset;
[295] Fix | Delete
dns_sdlzmodrdataset_t subtractrdataset;
[296] Fix | Delete
dns_sdlzdelrdataset_t delrdataset;
[297] Fix | Delete
} dns_sdlzmethods_t;
[298] Fix | Delete
[299] Fix | Delete
isc_result_t
[300] Fix | Delete
dns_sdlzregister(const char *drivername, const dns_sdlzmethods_t *methods,
[301] Fix | Delete
void *driverarg, unsigned int flags, isc_mem_t *mctx,
[302] Fix | Delete
dns_sdlzimplementation_t **sdlzimp);
[303] Fix | Delete
/*%<
[304] Fix | Delete
* Register a dynamically loadable zones (dlz) driver for the database
[305] Fix | Delete
* type 'drivername', implemented by the functions in '*methods'.
[306] Fix | Delete
*
[307] Fix | Delete
* sdlzimp must point to a NULL dns_sdlzimplementation_t pointer.
[308] Fix | Delete
* That is, sdlzimp != NULL && *sdlzimp == NULL. It will be assigned
[309] Fix | Delete
* a value that will later be used to identify the driver when
[310] Fix | Delete
* deregistering it.
[311] Fix | Delete
*/
[312] Fix | Delete
[313] Fix | Delete
void
[314] Fix | Delete
dns_sdlzunregister(dns_sdlzimplementation_t **sdlzimp);
[315] Fix | Delete
[316] Fix | Delete
/*%<
[317] Fix | Delete
* Removes the sdlz driver from the list of registered sdlz drivers.
[318] Fix | Delete
* There must be no active sdlz drivers of this type when this
[319] Fix | Delete
* function is called.
[320] Fix | Delete
*/
[321] Fix | Delete
[322] Fix | Delete
typedef isc_result_t dns_sdlz_putnamedrr_t(dns_sdlzallnodes_t *allnodes,
[323] Fix | Delete
const char *name,
[324] Fix | Delete
const char *type,
[325] Fix | Delete
dns_ttl_t ttl,
[326] Fix | Delete
const char *data);
[327] Fix | Delete
dns_sdlz_putnamedrr_t dns_sdlz_putnamedrr;
[328] Fix | Delete
[329] Fix | Delete
/*%<
[330] Fix | Delete
* Add a single resource record to the allnodes structure to be later
[331] Fix | Delete
* parsed into a zone transfer response.
[332] Fix | Delete
*/
[333] Fix | Delete
[334] Fix | Delete
typedef isc_result_t dns_sdlz_putrr_t(dns_sdlzlookup_t *lookup,
[335] Fix | Delete
const char *type,
[336] Fix | Delete
dns_ttl_t ttl,
[337] Fix | Delete
const char *data);
[338] Fix | Delete
dns_sdlz_putrr_t dns_sdlz_putrr;
[339] Fix | Delete
/*%<
[340] Fix | Delete
* Add a single resource record to the lookup structure to be later
[341] Fix | Delete
* parsed into a query response.
[342] Fix | Delete
*/
[343] Fix | Delete
[344] Fix | Delete
typedef isc_result_t dns_sdlz_putsoa_t(dns_sdlzlookup_t *lookup,
[345] Fix | Delete
const char *mname,
[346] Fix | Delete
const char *rname,
[347] Fix | Delete
uint32_t serial);
[348] Fix | Delete
dns_sdlz_putsoa_t dns_sdlz_putsoa;
[349] Fix | Delete
/*%<
[350] Fix | Delete
* This function may optionally be called from the 'authority'
[351] Fix | Delete
* callback to simplify construction of the SOA record for 'zone'. It
[352] Fix | Delete
* will provide a SOA listing 'mname' as as the master server and
[353] Fix | Delete
* 'rname' as the responsible person mailbox. It is the
[354] Fix | Delete
* responsibility of the driver to increment the serial number between
[355] Fix | Delete
* responses if necessary. All other SOA fields will have reasonable
[356] Fix | Delete
* default values.
[357] Fix | Delete
*/
[358] Fix | Delete
[359] Fix | Delete
[360] Fix | Delete
typedef isc_result_t dns_sdlz_setdb_t(dns_dlzdb_t *dlzdatabase,
[361] Fix | Delete
dns_rdataclass_t rdclass,
[362] Fix | Delete
dns_name_t *name,
[363] Fix | Delete
dns_db_t **dbp);
[364] Fix | Delete
dns_sdlz_setdb_t dns_sdlz_setdb;
[365] Fix | Delete
/*%<
[366] Fix | Delete
* Create the database pointers for a writeable SDLZ zone
[367] Fix | Delete
*/
[368] Fix | Delete
[369] Fix | Delete
[370] Fix | Delete
ISC_LANG_ENDDECLS
[371] Fix | Delete
[372] Fix | Delete
#endif /* SDLZ_H */
[373] Fix | Delete
[374] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function