Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ShExBy/shex_roo.../usr/include/bind9/dns
File: sdb.h
/*
[0] Fix | Delete
* 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
#ifndef DNS_SDB_H
[12] Fix | Delete
#define DNS_SDB_H 1
[13] Fix | Delete
[14] Fix | Delete
/*****
[15] Fix | Delete
***** Module Info
[16] Fix | Delete
*****/
[17] Fix | Delete
[18] Fix | Delete
/*! \file dns/sdb.h
[19] Fix | Delete
* \brief
[20] Fix | Delete
* Simple database API.
[21] Fix | Delete
*/
[22] Fix | Delete
[23] Fix | Delete
/***
[24] Fix | Delete
*** Imports
[25] Fix | Delete
***/
[26] Fix | Delete
[27] Fix | Delete
#include <inttypes.h>
[28] Fix | Delete
[29] Fix | Delete
#include <isc/lang.h>
[30] Fix | Delete
[31] Fix | Delete
#include <dns/clientinfo.h>
[32] Fix | Delete
#include <dns/types.h>
[33] Fix | Delete
[34] Fix | Delete
/***
[35] Fix | Delete
*** Types
[36] Fix | Delete
***/
[37] Fix | Delete
[38] Fix | Delete
/*%
[39] Fix | Delete
* A simple database. This is an opaque type.
[40] Fix | Delete
*/
[41] Fix | Delete
typedef struct dns_sdb dns_sdb_t;
[42] Fix | Delete
[43] Fix | Delete
/*%
[44] Fix | Delete
* A simple database lookup in progress. This is an opaque type.
[45] Fix | Delete
*/
[46] Fix | Delete
typedef struct dns_sdblookup dns_sdblookup_t;
[47] Fix | Delete
[48] Fix | Delete
/*%
[49] Fix | Delete
* A simple database traversal in progress. This is an opaque type.
[50] Fix | Delete
*/
[51] Fix | Delete
typedef struct dns_sdballnodes dns_sdballnodes_t;
[52] Fix | Delete
[53] Fix | Delete
typedef isc_result_t
[54] Fix | Delete
(*dns_sdblookupfunc_t)(const char *zone, const char *name, void *dbdata,
[55] Fix | Delete
dns_sdblookup_t *lookup,
[56] Fix | Delete
dns_clientinfomethods_t *methods,
[57] Fix | Delete
dns_clientinfo_t *clientinfo);
[58] Fix | Delete
typedef isc_result_t
[59] Fix | Delete
(*dns_sdblookup2func_t)(const dns_name_t *zone, const dns_name_t *name,
[60] Fix | Delete
void *dbdata, dns_sdblookup_t *lookup,
[61] Fix | Delete
dns_clientinfomethods_t *methods,
[62] Fix | Delete
dns_clientinfo_t *clientinfo);
[63] Fix | Delete
[64] Fix | Delete
typedef isc_result_t
[65] Fix | Delete
(*dns_sdbauthorityfunc_t)(const char *zone, void *dbdata, dns_sdblookup_t *);
[66] Fix | Delete
[67] Fix | Delete
typedef isc_result_t
[68] Fix | Delete
(*dns_sdballnodesfunc_t)(const char *zone, void *dbdata,
[69] Fix | Delete
dns_sdballnodes_t *allnodes);
[70] Fix | Delete
[71] Fix | Delete
typedef isc_result_t
[72] Fix | Delete
(*dns_sdbcreatefunc_t)(const char *zone, int argc, char **argv,
[73] Fix | Delete
void *driverdata, void **dbdata);
[74] Fix | Delete
[75] Fix | Delete
typedef void
[76] Fix | Delete
(*dns_sdbdestroyfunc_t)(const char *zone, void *driverdata, void **dbdata);
[77] Fix | Delete
[78] Fix | Delete
[79] Fix | Delete
typedef struct dns_sdbmethods {
[80] Fix | Delete
dns_sdblookupfunc_t lookup;
[81] Fix | Delete
dns_sdbauthorityfunc_t authority;
[82] Fix | Delete
dns_sdballnodesfunc_t allnodes;
[83] Fix | Delete
dns_sdbcreatefunc_t create;
[84] Fix | Delete
dns_sdbdestroyfunc_t destroy;
[85] Fix | Delete
dns_sdblookup2func_t lookup2;
[86] Fix | Delete
} dns_sdbmethods_t;
[87] Fix | Delete
[88] Fix | Delete
/***
[89] Fix | Delete
*** Functions
[90] Fix | Delete
***/
[91] Fix | Delete
[92] Fix | Delete
ISC_LANG_BEGINDECLS
[93] Fix | Delete
[94] Fix | Delete
#define DNS_SDBFLAG_RELATIVEOWNER 0x00000001U
[95] Fix | Delete
#define DNS_SDBFLAG_RELATIVERDATA 0x00000002U
[96] Fix | Delete
#define DNS_SDBFLAG_THREADSAFE 0x00000004U
[97] Fix | Delete
#define DNS_SDBFLAG_DNS64 0x00000008U
[98] Fix | Delete
[99] Fix | Delete
isc_result_t
[100] Fix | Delete
dns_sdb_register(const char *drivername, const dns_sdbmethods_t *methods,
[101] Fix | Delete
void *driverdata, unsigned int flags, isc_mem_t *mctx,
[102] Fix | Delete
dns_sdbimplementation_t **sdbimp);
[103] Fix | Delete
/*%<
[104] Fix | Delete
* Register a simple database driver for the database type 'drivername',
[105] Fix | Delete
* implemented by the functions in '*methods'.
[106] Fix | Delete
*
[107] Fix | Delete
* sdbimp must point to a NULL dns_sdbimplementation_t pointer. That is,
[108] Fix | Delete
* sdbimp != NULL && *sdbimp == NULL. It will be assigned a value that
[109] Fix | Delete
* will later be used to identify the driver when deregistering it.
[110] Fix | Delete
*
[111] Fix | Delete
* The name server will perform lookups in the database by calling the
[112] Fix | Delete
* function 'lookup', passing it a printable zone name 'zone', a printable
[113] Fix | Delete
* domain name 'name', and a copy of the argument 'dbdata' that
[114] Fix | Delete
* was potentially returned by the create function. The 'dns_sdblookup_t'
[115] Fix | Delete
* argument to 'lookup' and 'authority' is an opaque pointer to be passed to
[116] Fix | Delete
* ns_sdb_putrr().
[117] Fix | Delete
*
[118] Fix | Delete
* The lookup function returns the lookup results to the name server
[119] Fix | Delete
* by calling ns_sdb_putrr() once for each record found. On success,
[120] Fix | Delete
* the return value of the lookup function should be ISC_R_SUCCESS.
[121] Fix | Delete
* If the domain name 'name' does not exist, the lookup function should
[122] Fix | Delete
* ISC_R_NOTFOUND. Any other return value is treated as an error.
[123] Fix | Delete
*
[124] Fix | Delete
* Lookups at the zone apex will cause the server to also call the
[125] Fix | Delete
* function 'authority' (if non-NULL), which must provide an SOA record
[126] Fix | Delete
* and NS records for the zone by calling ns_sdb_putrr() once for each of
[127] Fix | Delete
* these records. The 'authority' function may be NULL if invoking
[128] Fix | Delete
* the 'lookup' function on the zone apex will return SOA and NS records.
[129] Fix | Delete
*
[130] Fix | Delete
* The allnodes function, if non-NULL, fills in an opaque structure to be
[131] Fix | Delete
* used by a database iterator. This allows the zone to be transferred.
[132] Fix | Delete
* This may use a considerable amount of memory for large zones, and the
[133] Fix | Delete
* zone transfer may not be fully RFC1035 compliant if the zone is
[134] Fix | Delete
* frequently changed.
[135] Fix | Delete
*
[136] Fix | Delete
* The create function will be called for each zone configured
[137] Fix | Delete
* into the name server using this database type. It can be used
[138] Fix | Delete
* to create a "database object" containing zone specific data,
[139] Fix | Delete
* which can make use of the database arguments specified in the
[140] Fix | Delete
* name server configuration.
[141] Fix | Delete
*
[142] Fix | Delete
* The destroy function will be called to free the database object
[143] Fix | Delete
* when its zone is destroyed.
[144] Fix | Delete
*
[145] Fix | Delete
* The create and destroy functions may be NULL.
[146] Fix | Delete
*
[147] Fix | Delete
* If flags includes DNS_SDBFLAG_RELATIVEOWNER, the lookup and authority
[148] Fix | Delete
* functions will be called with relative names rather than absolute names.
[149] Fix | Delete
* The string "@" represents the zone apex in this case.
[150] Fix | Delete
*
[151] Fix | Delete
* If flags includes DNS_SDBFLAG_RELATIVERDATA, the rdata strings may
[152] Fix | Delete
* include relative names. Otherwise, all names in the rdata string must
[153] Fix | Delete
* be absolute. Be aware that if relative names are allowed, any
[154] Fix | Delete
* absolute names must contain a trailing dot.
[155] Fix | Delete
*
[156] Fix | Delete
* If flags includes DNS_SDBFLAG_THREADSAFE, the driver must be able to
[157] Fix | Delete
* handle multiple lookups in parallel. Otherwise, calls into the driver
[158] Fix | Delete
* are serialized.
[159] Fix | Delete
*/
[160] Fix | Delete
[161] Fix | Delete
void
[162] Fix | Delete
dns_sdb_unregister(dns_sdbimplementation_t **sdbimp);
[163] Fix | Delete
/*%<
[164] Fix | Delete
* Removes the simple database driver from the list of registered database
[165] Fix | Delete
* types. There must be no active databases of this type when this function
[166] Fix | Delete
* is called.
[167] Fix | Delete
*/
[168] Fix | Delete
[169] Fix | Delete
/*% See dns_sdb_putradata() */
[170] Fix | Delete
isc_result_t
[171] Fix | Delete
dns_sdb_putrr(dns_sdblookup_t *lookup, const char *type, dns_ttl_t ttl,
[172] Fix | Delete
const char *data);
[173] Fix | Delete
isc_result_t
[174] Fix | Delete
dns_sdb_putrdata(dns_sdblookup_t *lookup, dns_rdatatype_t type, dns_ttl_t ttl,
[175] Fix | Delete
const unsigned char *rdata, unsigned int rdlen);
[176] Fix | Delete
/*%<
[177] Fix | Delete
* Add a single resource record to the lookup structure to be
[178] Fix | Delete
* returned in the query response. dns_sdb_putrr() takes the
[179] Fix | Delete
* resource record in master file text format as a null-terminated
[180] Fix | Delete
* string, and dns_sdb_putrdata() takes the raw RDATA in
[181] Fix | Delete
* uncompressed wire format.
[182] Fix | Delete
*/
[183] Fix | Delete
[184] Fix | Delete
/*% See dns_sdb_putnamerdata() */
[185] Fix | Delete
isc_result_t
[186] Fix | Delete
dns_sdb_putnamedrr(dns_sdballnodes_t *allnodes, const char *name,
[187] Fix | Delete
const char *type, dns_ttl_t ttl, const char *data);
[188] Fix | Delete
isc_result_t
[189] Fix | Delete
dns_sdb_putnamedrdata(dns_sdballnodes_t *allnodes, const char *name,
[190] Fix | Delete
dns_rdatatype_t type, dns_ttl_t ttl,
[191] Fix | Delete
const void *rdata, unsigned int rdlen);
[192] Fix | Delete
/*%<
[193] Fix | Delete
* Add a single resource record to the allnodes structure to be
[194] Fix | Delete
* included in a zone transfer response, in text or wire
[195] Fix | Delete
* format as above.
[196] Fix | Delete
*/
[197] Fix | Delete
[198] Fix | Delete
isc_result_t
[199] Fix | Delete
dns_sdb_putsoa(dns_sdblookup_t *lookup, const char *mname, const char *rname,
[200] Fix | Delete
uint32_t serial);
[201] Fix | Delete
/*%<
[202] Fix | Delete
* This function may optionally be called from the 'authority' callback
[203] Fix | Delete
* to simplify construction of the SOA record for 'zone'. It will
[204] Fix | Delete
* provide a SOA listing 'mname' as as the master server and 'rname' as
[205] Fix | Delete
* the responsible person mailbox. It is the responsibility of the
[206] Fix | Delete
* driver to increment the serial number between responses if necessary.
[207] Fix | Delete
* All other SOA fields will have reasonable default values.
[208] Fix | Delete
*/
[209] Fix | Delete
[210] Fix | Delete
ISC_LANG_ENDDECLS
[211] Fix | Delete
[212] Fix | Delete
#endif /* DNS_SDB_H */
[213] Fix | Delete
[214] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function