Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ShExBy/shex_roo.../usr/include/bind9/dns
File: rdataslab.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_RDATASLAB_H
[12] Fix | Delete
#define DNS_RDATASLAB_H 1
[13] Fix | Delete
[14] Fix | Delete
/*! \file dns/rdataslab.h
[15] Fix | Delete
* \brief
[16] Fix | Delete
* Implements storage of rdatasets into slabs of memory.
[17] Fix | Delete
*
[18] Fix | Delete
* MP:
[19] Fix | Delete
*\li Clients of this module must impose any required synchronization.
[20] Fix | Delete
*
[21] Fix | Delete
* Reliability:
[22] Fix | Delete
*\li This module deals with low-level byte streams. Errors in any of
[23] Fix | Delete
* the functions are likely to crash the server or corrupt memory.
[24] Fix | Delete
*
[25] Fix | Delete
*\li If the caller passes invalid memory references, these functions are
[26] Fix | Delete
* likely to crash the server or corrupt memory.
[27] Fix | Delete
*
[28] Fix | Delete
* Resources:
[29] Fix | Delete
*\li None.
[30] Fix | Delete
*
[31] Fix | Delete
* Security:
[32] Fix | Delete
*\li None.
[33] Fix | Delete
*
[34] Fix | Delete
* Standards:
[35] Fix | Delete
*\li None.
[36] Fix | Delete
*/
[37] Fix | Delete
[38] Fix | Delete
/***
[39] Fix | Delete
*** Imports
[40] Fix | Delete
***/
[41] Fix | Delete
[42] Fix | Delete
#include <stdbool.h>
[43] Fix | Delete
[44] Fix | Delete
#include <isc/lang.h>
[45] Fix | Delete
[46] Fix | Delete
#include <dns/types.h>
[47] Fix | Delete
[48] Fix | Delete
ISC_LANG_BEGINDECLS
[49] Fix | Delete
[50] Fix | Delete
#define DNS_RDATASLAB_FORCE 0x1
[51] Fix | Delete
#define DNS_RDATASLAB_EXACT 0x2
[52] Fix | Delete
[53] Fix | Delete
#define DNS_RDATASLAB_OFFLINE 0x01 /* RRSIG is for offline DNSKEY */
[54] Fix | Delete
#define DNS_RDATASLAB_WARNMASK 0x0E /*%< RRSIG(DNSKEY) expired
[55] Fix | Delete
* warnings number mask. */
[56] Fix | Delete
#define DNS_RDATASLAB_WARNSHIFT 1 /*%< How many bits to shift to find
[57] Fix | Delete
* remaining expired warning number. */
[58] Fix | Delete
[59] Fix | Delete
[60] Fix | Delete
/***
[61] Fix | Delete
*** Functions
[62] Fix | Delete
***/
[63] Fix | Delete
[64] Fix | Delete
isc_result_t
[65] Fix | Delete
dns_rdataslab_fromrdataset(dns_rdataset_t *rdataset, isc_mem_t *mctx,
[66] Fix | Delete
isc_region_t *region, unsigned int reservelen);
[67] Fix | Delete
/*%<
[68] Fix | Delete
* Slabify a rdataset. The slab area will be allocated and returned
[69] Fix | Delete
* in 'region'.
[70] Fix | Delete
*
[71] Fix | Delete
* Requires:
[72] Fix | Delete
*\li 'rdataset' is valid.
[73] Fix | Delete
*
[74] Fix | Delete
* Ensures:
[75] Fix | Delete
*\li 'region' will have base pointing to the start of allocated memory,
[76] Fix | Delete
* with the slabified region beginning at region->base + reservelen.
[77] Fix | Delete
* region->length contains the total length allocated.
[78] Fix | Delete
*
[79] Fix | Delete
* Returns:
[80] Fix | Delete
*\li ISC_R_SUCCESS - successful completion
[81] Fix | Delete
*\li ISC_R_NOMEMORY - no memory.
[82] Fix | Delete
*\li XXX others
[83] Fix | Delete
*/
[84] Fix | Delete
[85] Fix | Delete
void
[86] Fix | Delete
dns_rdataslab_tordataset(unsigned char *slab, unsigned int reservelen,
[87] Fix | Delete
dns_rdataclass_t rdclass, dns_rdatatype_t rdtype,
[88] Fix | Delete
dns_rdatatype_t covers, dns_ttl_t ttl,
[89] Fix | Delete
dns_rdataset_t *rdataset);
[90] Fix | Delete
/*%<
[91] Fix | Delete
* Construct an rdataset from a slab.
[92] Fix | Delete
*
[93] Fix | Delete
* Requires:
[94] Fix | Delete
*\li 'slab' points to a slab.
[95] Fix | Delete
*\li 'rdataset' is disassociated.
[96] Fix | Delete
*
[97] Fix | Delete
* Ensures:
[98] Fix | Delete
*\li 'rdataset' is associated and points to a valid rdataest.
[99] Fix | Delete
*/
[100] Fix | Delete
[101] Fix | Delete
unsigned int
[102] Fix | Delete
dns_rdataslab_size(unsigned char *slab, unsigned int reservelen);
[103] Fix | Delete
/*%<
[104] Fix | Delete
* Return the total size of an rdataslab.
[105] Fix | Delete
*
[106] Fix | Delete
* Requires:
[107] Fix | Delete
*\li 'slab' points to a slab.
[108] Fix | Delete
*
[109] Fix | Delete
* Returns:
[110] Fix | Delete
*\li The number of bytes in the slab, including the reservelen.
[111] Fix | Delete
*/
[112] Fix | Delete
[113] Fix | Delete
unsigned int
[114] Fix | Delete
dns_rdataslab_count(unsigned char *slab, unsigned int reservelen);
[115] Fix | Delete
/*%<
[116] Fix | Delete
* Return the number of records in the rdataslab
[117] Fix | Delete
*
[118] Fix | Delete
* Requires:
[119] Fix | Delete
*\li 'slab' points to a slab.
[120] Fix | Delete
*
[121] Fix | Delete
* Returns:
[122] Fix | Delete
*\li The number of records in the slab.
[123] Fix | Delete
*/
[124] Fix | Delete
[125] Fix | Delete
isc_result_t
[126] Fix | Delete
dns_rdataslab_merge(unsigned char *oslab, unsigned char *nslab,
[127] Fix | Delete
unsigned int reservelen, isc_mem_t *mctx,
[128] Fix | Delete
dns_rdataclass_t rdclass, dns_rdatatype_t type,
[129] Fix | Delete
unsigned int flags, unsigned char **tslabp);
[130] Fix | Delete
/*%<
[131] Fix | Delete
* Merge 'oslab' and 'nslab'.
[132] Fix | Delete
*/
[133] Fix | Delete
[134] Fix | Delete
isc_result_t
[135] Fix | Delete
dns_rdataslab_subtract(unsigned char *mslab, unsigned char *sslab,
[136] Fix | Delete
unsigned int reservelen, isc_mem_t *mctx,
[137] Fix | Delete
dns_rdataclass_t rdclass, dns_rdatatype_t type,
[138] Fix | Delete
unsigned int flags, unsigned char **tslabp);
[139] Fix | Delete
/*%<
[140] Fix | Delete
* Subtract 'sslab' from 'mslab'. If 'exact' is true then all elements
[141] Fix | Delete
* of 'sslab' must exist in 'mslab'.
[142] Fix | Delete
*
[143] Fix | Delete
* XXX
[144] Fix | Delete
* valid flags are DNS_RDATASLAB_EXACT
[145] Fix | Delete
*/
[146] Fix | Delete
[147] Fix | Delete
bool
[148] Fix | Delete
dns_rdataslab_equal(unsigned char *slab1, unsigned char *slab2,
[149] Fix | Delete
unsigned int reservelen);
[150] Fix | Delete
/*%<
[151] Fix | Delete
* Compare two rdataslabs for equality. This does _not_ do a full
[152] Fix | Delete
* DNSSEC comparison.
[153] Fix | Delete
*
[154] Fix | Delete
* Requires:
[155] Fix | Delete
*\li 'slab1' and 'slab2' point to slabs.
[156] Fix | Delete
*
[157] Fix | Delete
* Returns:
[158] Fix | Delete
*\li true if the slabs are equal, false otherwise.
[159] Fix | Delete
*/
[160] Fix | Delete
bool
[161] Fix | Delete
dns_rdataslab_equalx(unsigned char *slab1, unsigned char *slab2,
[162] Fix | Delete
unsigned int reservelen, dns_rdataclass_t rdclass,
[163] Fix | Delete
dns_rdatatype_t type);
[164] Fix | Delete
/*%<
[165] Fix | Delete
* Compare two rdataslabs for DNSSEC equality.
[166] Fix | Delete
*
[167] Fix | Delete
* Requires:
[168] Fix | Delete
*\li 'slab1' and 'slab2' point to slabs.
[169] Fix | Delete
*
[170] Fix | Delete
* Returns:
[171] Fix | Delete
*\li true if the slabs are equal, #false otherwise.
[172] Fix | Delete
*/
[173] Fix | Delete
[174] Fix | Delete
ISC_LANG_ENDDECLS
[175] Fix | Delete
[176] Fix | Delete
#endif /* DNS_RDATASLAB_H */
[177] Fix | Delete
[178] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function