Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ShExBy/shex_roo.../usr/include/bind9/dns
File: message.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
#ifndef DNS_MESSAGE_H
[11] Fix | Delete
#define DNS_MESSAGE_H 1
[12] Fix | Delete
[13] Fix | Delete
/***
[14] Fix | Delete
*** Imports
[15] Fix | Delete
***/
[16] Fix | Delete
[17] Fix | Delete
#include <inttypes.h>
[18] Fix | Delete
#include <stdbool.h>
[19] Fix | Delete
[20] Fix | Delete
#include <isc/lang.h>
[21] Fix | Delete
#include <isc/magic.h>
[22] Fix | Delete
#include <isc/refcount.h>
[23] Fix | Delete
[24] Fix | Delete
#include <dns/compress.h>
[25] Fix | Delete
#include <dns/masterdump.h>
[26] Fix | Delete
#include <dns/types.h>
[27] Fix | Delete
[28] Fix | Delete
#include <dst/dst.h>
[29] Fix | Delete
[30] Fix | Delete
/*! \file dns/message.h
[31] Fix | Delete
* \brief Message Handling Module
[32] Fix | Delete
*
[33] Fix | Delete
* How this beast works:
[34] Fix | Delete
*
[35] Fix | Delete
* When a dns message is received in a buffer, dns_message_parse() is called
[36] Fix | Delete
* on the memory region. Various items are checked including the format
[37] Fix | Delete
* of the message (if counts are right, if counts consume the entire sections,
[38] Fix | Delete
* and if sections consume the entire message) and known pseudo-RRs in the
[39] Fix | Delete
* additional data section are analyzed and removed.
[40] Fix | Delete
*
[41] Fix | Delete
* TSIG checking is also done at this layer, and any DNSSEC transaction
[42] Fix | Delete
* signatures should also be checked here.
[43] Fix | Delete
*
[44] Fix | Delete
* Notes on using the gettemp*() and puttemp*() functions:
[45] Fix | Delete
*
[46] Fix | Delete
* These functions return items (names, rdatasets, etc) allocated from some
[47] Fix | Delete
* internal state of the dns_message_t.
[48] Fix | Delete
*
[49] Fix | Delete
* Names and rdatasets must be put back into the dns_message_t in
[50] Fix | Delete
* one of two ways. Assume a name was allocated via
[51] Fix | Delete
* dns_message_gettempname():
[52] Fix | Delete
*
[53] Fix | Delete
*\li (1) insert it into a section, using dns_message_addname().
[54] Fix | Delete
*
[55] Fix | Delete
*\li (2) return it to the message using dns_message_puttempname().
[56] Fix | Delete
*
[57] Fix | Delete
* The same applies to rdatasets.
[58] Fix | Delete
*
[59] Fix | Delete
* On the other hand, offsets, rdatalists and rdatas allocated using
[60] Fix | Delete
* dns_message_gettemp*() will always be freed automatically
[61] Fix | Delete
* when the message is reset or destroyed; calling dns_message_puttemp*()
[62] Fix | Delete
* on rdatalists and rdatas is optional and serves only to enable the item
[63] Fix | Delete
* to be reused multiple times during the lifetime of the message; offsets
[64] Fix | Delete
* cannot be reused.
[65] Fix | Delete
*
[66] Fix | Delete
* Buffers allocated using isc_buffer_allocate() can be automatically freed
[67] Fix | Delete
* as well by giving the buffer to the message using dns_message_takebuffer().
[68] Fix | Delete
* Doing this will cause the buffer to be freed using isc_buffer_free()
[69] Fix | Delete
* when the section lists are cleared, such as in a reset or in a destroy.
[70] Fix | Delete
* Since the buffer itself exists until the message is destroyed, this sort
[71] Fix | Delete
* of code can be written:
[72] Fix | Delete
*
[73] Fix | Delete
* \code
[74] Fix | Delete
* buffer = isc_buffer_allocate(mctx, 512);
[75] Fix | Delete
* name = NULL;
[76] Fix | Delete
* name = dns_message_gettempname(message, &name);
[77] Fix | Delete
* dns_name_init(name, NULL);
[78] Fix | Delete
* result = dns_name_fromtext(name, &source, dns_rootname, 0, buffer);
[79] Fix | Delete
* dns_message_takebuffer(message, &buffer);
[80] Fix | Delete
* \endcode
[81] Fix | Delete
*
[82] Fix | Delete
*
[83] Fix | Delete
* TODO:
[84] Fix | Delete
*
[85] Fix | Delete
* XXX Needed: ways to set and retrieve EDNS information, add rdata to a
[86] Fix | Delete
* section, move rdata from one section to another, remove rdata, etc.
[87] Fix | Delete
*/
[88] Fix | Delete
[89] Fix | Delete
#define DNS_MESSAGEFLAG_QR 0x8000U
[90] Fix | Delete
#define DNS_MESSAGEFLAG_AA 0x0400U
[91] Fix | Delete
#define DNS_MESSAGEFLAG_TC 0x0200U
[92] Fix | Delete
#define DNS_MESSAGEFLAG_RD 0x0100U
[93] Fix | Delete
#define DNS_MESSAGEFLAG_RA 0x0080U
[94] Fix | Delete
#define DNS_MESSAGEFLAG_AD 0x0020U
[95] Fix | Delete
#define DNS_MESSAGEFLAG_CD 0x0010U
[96] Fix | Delete
[97] Fix | Delete
/*%< EDNS0 extended message flags */
[98] Fix | Delete
#define DNS_MESSAGEEXTFLAG_DO 0x8000U
[99] Fix | Delete
[100] Fix | Delete
/*%< EDNS0 extended OPT codes */
[101] Fix | Delete
#define DNS_OPT_LLQ 1 /*%< LLQ opt code */
[102] Fix | Delete
#define DNS_OPT_NSID 3 /*%< NSID opt code */
[103] Fix | Delete
#define DNS_OPT_CLIENT_SUBNET 8 /*%< client subnet opt code */
[104] Fix | Delete
#define DNS_OPT_EXPIRE 9 /*%< EXPIRE opt code */
[105] Fix | Delete
#define DNS_OPT_COOKIE 10 /*%< COOKIE opt code */
[106] Fix | Delete
#define DNS_OPT_TCP_KEEPALIVE 11 /*%< TCP keepalive opt code */
[107] Fix | Delete
#define DNS_OPT_PAD 12 /*%< PAD opt code */
[108] Fix | Delete
#define DNS_OPT_KEY_TAG 14 /*%< Key tag opt code */
[109] Fix | Delete
#define DNS_OPT_EDE 15 /*%< Extended DNS Error opt code */
[110] Fix | Delete
#define DNS_OPT_CLIENT_TAG 16 /*%< Client tag opt code */
[111] Fix | Delete
#define DNS_OPT_SERVER_TAG 17 /*%< Server tag opt code */
[112] Fix | Delete
[113] Fix | Delete
/*%< Experimental options [65001...65534] as per RFC6891 */
[114] Fix | Delete
[115] Fix | Delete
/*%< The number of EDNS options we know about. */
[116] Fix | Delete
#define DNS_EDNSOPTIONS 5
[117] Fix | Delete
[118] Fix | Delete
#define DNS_MESSAGE_REPLYPRESERVE (DNS_MESSAGEFLAG_RD|DNS_MESSAGEFLAG_CD)
[119] Fix | Delete
#define DNS_MESSAGEEXTFLAG_REPLYPRESERVE (DNS_MESSAGEEXTFLAG_DO)
[120] Fix | Delete
[121] Fix | Delete
#define DNS_MESSAGE_HEADERLEN 12 /*%< 6 uint16_t's */
[122] Fix | Delete
[123] Fix | Delete
#define DNS_MESSAGE_MAGIC ISC_MAGIC('M','S','G','@')
[124] Fix | Delete
#define DNS_MESSAGE_VALID(msg) ISC_MAGIC_VALID(msg, DNS_MESSAGE_MAGIC)
[125] Fix | Delete
[126] Fix | Delete
/*
[127] Fix | Delete
* Ordering here matters. DNS_SECTION_ANY must be the lowest and negative,
[128] Fix | Delete
* and DNS_SECTION_MAX must be one greater than the last used section.
[129] Fix | Delete
*/
[130] Fix | Delete
typedef int dns_section_t;
[131] Fix | Delete
#define DNS_SECTION_ANY (-1)
[132] Fix | Delete
#define DNS_SECTION_QUESTION 0
[133] Fix | Delete
#define DNS_SECTION_ANSWER 1
[134] Fix | Delete
#define DNS_SECTION_AUTHORITY 2
[135] Fix | Delete
#define DNS_SECTION_ADDITIONAL 3
[136] Fix | Delete
#define DNS_SECTION_MAX 4
[137] Fix | Delete
[138] Fix | Delete
typedef int dns_pseudosection_t;
[139] Fix | Delete
#define DNS_PSEUDOSECTION_ANY (-1)
[140] Fix | Delete
#define DNS_PSEUDOSECTION_OPT 0
[141] Fix | Delete
#define DNS_PSEUDOSECTION_TSIG 1
[142] Fix | Delete
#define DNS_PSEUDOSECTION_SIG0 2
[143] Fix | Delete
#define DNS_PSEUDOSECTION_MAX 3
[144] Fix | Delete
[145] Fix | Delete
typedef int dns_messagetextflag_t;
[146] Fix | Delete
#define DNS_MESSAGETEXTFLAG_NOCOMMENTS 0x0001
[147] Fix | Delete
#define DNS_MESSAGETEXTFLAG_NOHEADERS 0x0002
[148] Fix | Delete
#define DNS_MESSAGETEXTFLAG_ONESOA 0x0004
[149] Fix | Delete
#define DNS_MESSAGETEXTFLAG_OMITSOA 0x0008
[150] Fix | Delete
[151] Fix | Delete
/*
[152] Fix | Delete
* Dynamic update names for these sections.
[153] Fix | Delete
*/
[154] Fix | Delete
#define DNS_SECTION_ZONE DNS_SECTION_QUESTION
[155] Fix | Delete
#define DNS_SECTION_PREREQUISITE DNS_SECTION_ANSWER
[156] Fix | Delete
#define DNS_SECTION_UPDATE DNS_SECTION_AUTHORITY
[157] Fix | Delete
[158] Fix | Delete
/*
[159] Fix | Delete
* These tell the message library how the created dns_message_t will be used.
[160] Fix | Delete
*/
[161] Fix | Delete
#define DNS_MESSAGE_INTENTUNKNOWN 0 /*%< internal use only */
[162] Fix | Delete
#define DNS_MESSAGE_INTENTPARSE 1 /*%< parsing messages */
[163] Fix | Delete
#define DNS_MESSAGE_INTENTRENDER 2 /*%< rendering */
[164] Fix | Delete
[165] Fix | Delete
/*
[166] Fix | Delete
* Control behavior of parsing
[167] Fix | Delete
*/
[168] Fix | Delete
#define DNS_MESSAGEPARSE_PRESERVEORDER 0x0001 /*%< preserve rdata order */
[169] Fix | Delete
#define DNS_MESSAGEPARSE_BESTEFFORT 0x0002 /*%< return a message if a
[170] Fix | Delete
recoverable parse error
[171] Fix | Delete
occurs */
[172] Fix | Delete
#define DNS_MESSAGEPARSE_CLONEBUFFER 0x0004 /*%< save a copy of the
[173] Fix | Delete
source buffer */
[174] Fix | Delete
#define DNS_MESSAGEPARSE_IGNORETRUNCATION 0x0008 /*%< truncation errors are
[175] Fix | Delete
* not fatal. */
[176] Fix | Delete
[177] Fix | Delete
/*
[178] Fix | Delete
* Control behavior of rendering
[179] Fix | Delete
*/
[180] Fix | Delete
#define DNS_MESSAGERENDER_ORDERED 0x0001 /*%< don't change order */
[181] Fix | Delete
#define DNS_MESSAGERENDER_PARTIAL 0x0002 /*%< allow a partial rdataset */
[182] Fix | Delete
#define DNS_MESSAGERENDER_OMITDNSSEC 0x0004 /*%< omit DNSSEC records */
[183] Fix | Delete
#define DNS_MESSAGERENDER_PREFER_A 0x0008 /*%< prefer A records in
[184] Fix | Delete
additional section. */
[185] Fix | Delete
#define DNS_MESSAGERENDER_PREFER_AAAA 0x0010 /*%< prefer AAAA records in
[186] Fix | Delete
additional section. */
[187] Fix | Delete
#ifdef ALLOW_FILTER_AAAA
[188] Fix | Delete
#define DNS_MESSAGERENDER_FILTER_AAAA 0x0020 /*%< filter AAAA records */
[189] Fix | Delete
#endif
[190] Fix | Delete
[191] Fix | Delete
typedef struct dns_msgblock dns_msgblock_t;
[192] Fix | Delete
[193] Fix | Delete
struct dns_message {
[194] Fix | Delete
/* public from here down */
[195] Fix | Delete
unsigned int magic;
[196] Fix | Delete
isc_refcount_t refcount;
[197] Fix | Delete
[198] Fix | Delete
dns_messageid_t id;
[199] Fix | Delete
unsigned int flags;
[200] Fix | Delete
dns_rcode_t rcode;
[201] Fix | Delete
dns_opcode_t opcode;
[202] Fix | Delete
dns_rdataclass_t rdclass;
[203] Fix | Delete
[204] Fix | Delete
/* 4 real, 1 pseudo */
[205] Fix | Delete
unsigned int counts[DNS_SECTION_MAX];
[206] Fix | Delete
[207] Fix | Delete
/* private from here down */
[208] Fix | Delete
dns_namelist_t sections[DNS_SECTION_MAX];
[209] Fix | Delete
dns_name_t *cursors[DNS_SECTION_MAX];
[210] Fix | Delete
dns_rdataset_t *opt;
[211] Fix | Delete
dns_rdataset_t *sig0;
[212] Fix | Delete
dns_rdataset_t *tsig;
[213] Fix | Delete
[214] Fix | Delete
int state;
[215] Fix | Delete
unsigned int from_to_wire : 2;
[216] Fix | Delete
unsigned int header_ok : 1;
[217] Fix | Delete
unsigned int question_ok : 1;
[218] Fix | Delete
unsigned int tcp_continuation : 1;
[219] Fix | Delete
unsigned int verified_sig : 1;
[220] Fix | Delete
unsigned int verify_attempted : 1;
[221] Fix | Delete
unsigned int free_query : 1;
[222] Fix | Delete
unsigned int free_saved : 1;
[223] Fix | Delete
unsigned int cc_ok : 1;
[224] Fix | Delete
unsigned int cc_bad : 1;
[225] Fix | Delete
unsigned int tkey : 1;
[226] Fix | Delete
unsigned int rdclass_set : 1;
[227] Fix | Delete
[228] Fix | Delete
unsigned int opt_reserved;
[229] Fix | Delete
unsigned int sig_reserved;
[230] Fix | Delete
unsigned int reserved; /* reserved space (render) */
[231] Fix | Delete
[232] Fix | Delete
isc_buffer_t *buffer;
[233] Fix | Delete
dns_compress_t *cctx;
[234] Fix | Delete
[235] Fix | Delete
isc_mem_t *mctx;
[236] Fix | Delete
isc_mempool_t *namepool;
[237] Fix | Delete
isc_mempool_t *rdspool;
[238] Fix | Delete
[239] Fix | Delete
isc_bufferlist_t scratchpad;
[240] Fix | Delete
isc_bufferlist_t cleanup;
[241] Fix | Delete
[242] Fix | Delete
ISC_LIST(dns_msgblock_t) rdatas;
[243] Fix | Delete
ISC_LIST(dns_msgblock_t) rdatalists;
[244] Fix | Delete
ISC_LIST(dns_msgblock_t) offsets;
[245] Fix | Delete
[246] Fix | Delete
ISC_LIST(dns_rdata_t) freerdata;
[247] Fix | Delete
ISC_LIST(dns_rdatalist_t) freerdatalist;
[248] Fix | Delete
[249] Fix | Delete
dns_rcode_t tsigstatus;
[250] Fix | Delete
dns_rcode_t querytsigstatus;
[251] Fix | Delete
dns_name_t *tsigname; /* Owner name of TSIG, if any */
[252] Fix | Delete
dns_rdataset_t *querytsig;
[253] Fix | Delete
dns_tsigkey_t *tsigkey;
[254] Fix | Delete
dst_context_t *tsigctx;
[255] Fix | Delete
int sigstart;
[256] Fix | Delete
int timeadjust;
[257] Fix | Delete
[258] Fix | Delete
dns_name_t *sig0name; /* Owner name of SIG0, if any */
[259] Fix | Delete
dst_key_t *sig0key;
[260] Fix | Delete
dns_rcode_t sig0status;
[261] Fix | Delete
isc_region_t query;
[262] Fix | Delete
isc_region_t saved;
[263] Fix | Delete
[264] Fix | Delete
dns_rdatasetorderfunc_t order;
[265] Fix | Delete
const void * order_arg;
[266] Fix | Delete
[267] Fix | Delete
dns_indent_t indent;
[268] Fix | Delete
};
[269] Fix | Delete
[270] Fix | Delete
struct dns_ednsopt {
[271] Fix | Delete
uint16_t code;
[272] Fix | Delete
uint16_t length;
[273] Fix | Delete
unsigned char *value;
[274] Fix | Delete
};
[275] Fix | Delete
[276] Fix | Delete
/***
[277] Fix | Delete
*** Functions
[278] Fix | Delete
***/
[279] Fix | Delete
[280] Fix | Delete
ISC_LANG_BEGINDECLS
[281] Fix | Delete
[282] Fix | Delete
isc_result_t
[283] Fix | Delete
dns_message_create(isc_mem_t *mctx, unsigned int intent, dns_message_t **msgp);
[284] Fix | Delete
[285] Fix | Delete
/*%<
[286] Fix | Delete
* Create msg structure.
[287] Fix | Delete
*
[288] Fix | Delete
* This function will allocate some internal blocks of memory that are
[289] Fix | Delete
* expected to be needed for parsing or rendering nearly any type of message.
[290] Fix | Delete
*
[291] Fix | Delete
* Requires:
[292] Fix | Delete
*\li 'mctx' be a valid memory context.
[293] Fix | Delete
*
[294] Fix | Delete
*\li 'msgp' be non-null and '*msg' be NULL.
[295] Fix | Delete
*
[296] Fix | Delete
*\li 'intent' must be one of DNS_MESSAGE_INTENTPARSE or
[297] Fix | Delete
* #DNS_MESSAGE_INTENTRENDER.
[298] Fix | Delete
*
[299] Fix | Delete
* Ensures:
[300] Fix | Delete
*\li The data in "*msg" is set to indicate an unused and empty msg
[301] Fix | Delete
* structure.
[302] Fix | Delete
*
[303] Fix | Delete
* Returns:
[304] Fix | Delete
*\li #ISC_R_NOMEMORY -- out of memory
[305] Fix | Delete
*\li #ISC_R_SUCCESS -- success
[306] Fix | Delete
*/
[307] Fix | Delete
[308] Fix | Delete
void
[309] Fix | Delete
dns_message_reset(dns_message_t *msg, unsigned int intent);
[310] Fix | Delete
/*%<
[311] Fix | Delete
* Reset a message structure to default state. All internal lists are freed
[312] Fix | Delete
* or reset to a default state as well. This is simply a more efficient
[313] Fix | Delete
* way to call dns_message_detach() (assuming last reference is hold),
[314] Fix | Delete
* followed by dns_message_create(), since it avoid many memory allocations.
[315] Fix | Delete
*
[316] Fix | Delete
* If any data loanouts (buffers, names, rdatas, etc) were requested,
[317] Fix | Delete
* the caller must no longer use them after this call.
[318] Fix | Delete
*
[319] Fix | Delete
* The intended next use of the message will be 'intent'.
[320] Fix | Delete
*
[321] Fix | Delete
* Requires:
[322] Fix | Delete
*
[323] Fix | Delete
*\li 'msg' be valid.
[324] Fix | Delete
*
[325] Fix | Delete
*\li 'intent' is DNS_MESSAGE_INTENTPARSE or DNS_MESSAGE_INTENTRENDER
[326] Fix | Delete
*/
[327] Fix | Delete
[328] Fix | Delete
void
[329] Fix | Delete
dns_message_attach(dns_message_t *source, dns_message_t **target);
[330] Fix | Delete
/*%<
[331] Fix | Delete
* Attach to message 'source'.
[332] Fix | Delete
*
[333] Fix | Delete
* Requires:
[334] Fix | Delete
*\li 'source' to be a valid message.
[335] Fix | Delete
*\li 'target' to be non NULL and '*target' to be NULL.
[336] Fix | Delete
*/
[337] Fix | Delete
[338] Fix | Delete
void
[339] Fix | Delete
dns_message_detach(dns_message_t **messagep);
[340] Fix | Delete
/*%<
[341] Fix | Delete
* Detach *messagep from its message.
[342] Fix | Delete
* list.
[343] Fix | Delete
*
[344] Fix | Delete
* Requires:
[345] Fix | Delete
*\li '*messagep' to be a valid message.
[346] Fix | Delete
*/
[347] Fix | Delete
[348] Fix | Delete
isc_result_t
[349] Fix | Delete
dns_message_sectiontotext(dns_message_t *msg, dns_section_t section,
[350] Fix | Delete
const dns_master_style_t *style,
[351] Fix | Delete
dns_messagetextflag_t flags,
[352] Fix | Delete
isc_buffer_t *target);
[353] Fix | Delete
[354] Fix | Delete
isc_result_t
[355] Fix | Delete
dns_message_pseudosectiontotext(dns_message_t *msg,
[356] Fix | Delete
dns_pseudosection_t section,
[357] Fix | Delete
const dns_master_style_t *style,
[358] Fix | Delete
dns_messagetextflag_t flags,
[359] Fix | Delete
isc_buffer_t *target);
[360] Fix | Delete
/*%<
[361] Fix | Delete
* Convert section 'section' or 'pseudosection' of message 'msg' to
[362] Fix | Delete
* a cleartext representation
[363] Fix | Delete
*
[364] Fix | Delete
* Notes:
[365] Fix | Delete
* \li See dns_message_totext for meanings of flags.
[366] Fix | Delete
*
[367] Fix | Delete
* Requires:
[368] Fix | Delete
*
[369] Fix | Delete
*\li 'msg' is a valid message.
[370] Fix | Delete
*
[371] Fix | Delete
*\li 'style' is a valid master dump style.
[372] Fix | Delete
*
[373] Fix | Delete
*\li 'target' is a valid buffer.
[374] Fix | Delete
*
[375] Fix | Delete
*\li 'section' is a valid section label.
[376] Fix | Delete
*
[377] Fix | Delete
* Ensures:
[378] Fix | Delete
*
[379] Fix | Delete
*\li If the result is success:
[380] Fix | Delete
* The used space in 'target' is updated.
[381] Fix | Delete
*
[382] Fix | Delete
* Returns:
[383] Fix | Delete
*
[384] Fix | Delete
*\li #ISC_R_SUCCESS
[385] Fix | Delete
*\li #ISC_R_NOSPACE
[386] Fix | Delete
*\li #ISC_R_NOMORE
[387] Fix | Delete
*
[388] Fix | Delete
*\li Note: On error return, *target may be partially filled with data.
[389] Fix | Delete
*/
[390] Fix | Delete
[391] Fix | Delete
isc_result_t
[392] Fix | Delete
dns_message_totext(dns_message_t *msg, const dns_master_style_t *style,
[393] Fix | Delete
dns_messagetextflag_t flags, isc_buffer_t *target);
[394] Fix | Delete
/*%<
[395] Fix | Delete
* Convert all sections of message 'msg' to a cleartext representation
[396] Fix | Delete
*
[397] Fix | Delete
* Notes on flags:
[398] Fix | Delete
*\li If #DNS_MESSAGETEXTFLAG_NOCOMMENTS is cleared, lines beginning with
[399] Fix | Delete
* ";;" will be emitted indicating section name.
[400] Fix | Delete
*\li If #DNS_MESSAGETEXTFLAG_NOHEADERS is cleared, header lines will be
[401] Fix | Delete
* emitted.
[402] Fix | Delete
*\li If #DNS_MESSAGETEXTFLAG_ONESOA is set then only print the first
[403] Fix | Delete
* SOA record in the answer section.
[404] Fix | Delete
*\li If *#DNS_MESSAGETEXTFLAG_OMITSOA is set don't print any SOA records
[405] Fix | Delete
* in the answer section.
[406] Fix | Delete
*
[407] Fix | Delete
* The SOA flags are useful for suppressing the display of the second
[408] Fix | Delete
* SOA record in an AXFR by setting #DNS_MESSAGETEXTFLAG_ONESOA on the
[409] Fix | Delete
* first message in an AXFR stream and #DNS_MESSAGETEXTFLAG_OMITSOA on
[410] Fix | Delete
* subsequent messages.
[411] Fix | Delete
*
[412] Fix | Delete
* Requires:
[413] Fix | Delete
*
[414] Fix | Delete
*\li 'msg' is a valid message.
[415] Fix | Delete
*
[416] Fix | Delete
*\li 'style' is a valid master dump style.
[417] Fix | Delete
*
[418] Fix | Delete
*\li 'target' is a valid buffer.
[419] Fix | Delete
*
[420] Fix | Delete
* Ensures:
[421] Fix | Delete
*
[422] Fix | Delete
*\li If the result is success:
[423] Fix | Delete
* The used space in 'target' is updated.
[424] Fix | Delete
*
[425] Fix | Delete
* Returns:
[426] Fix | Delete
*
[427] Fix | Delete
*\li #ISC_R_SUCCESS
[428] Fix | Delete
*\li #ISC_R_NOSPACE
[429] Fix | Delete
*\li #ISC_R_NOMORE
[430] Fix | Delete
*
[431] Fix | Delete
*\li Note: On error return, *target may be partially filled with data.
[432] Fix | Delete
*/
[433] Fix | Delete
[434] Fix | Delete
isc_result_t
[435] Fix | Delete
dns_message_parse(dns_message_t *msg, isc_buffer_t *source,
[436] Fix | Delete
unsigned int options);
[437] Fix | Delete
/*%<
[438] Fix | Delete
* Parse raw wire data in 'source' as a DNS message.
[439] Fix | Delete
*
[440] Fix | Delete
* OPT records are detected and stored in the pseudo-section "opt".
[441] Fix | Delete
* TSIGs are detected and stored in the pseudo-section "tsig".
[442] Fix | Delete
*
[443] Fix | Delete
* If #DNS_MESSAGEPARSE_PRESERVEORDER is set, or if the opcode of the message
[444] Fix | Delete
* is UPDATE, a separate dns_name_t object will be created for each RR in the
[445] Fix | Delete
* message. Each such dns_name_t will have a single rdataset containing the
[446] Fix | Delete
* single RR, and the order of the RRs in the message is preserved.
[447] Fix | Delete
* Otherwise, only one dns_name_t object will be created for each unique
[448] Fix | Delete
* owner name in the section, and each such dns_name_t will have a list
[449] Fix | Delete
* of rdatasets. To access the names and their data, use
[450] Fix | Delete
* dns_message_firstname() and dns_message_nextname().
[451] Fix | Delete
*
[452] Fix | Delete
* If #DNS_MESSAGEPARSE_BESTEFFORT is set, errors in message content will
[453] Fix | Delete
* not be considered FORMERRs. If the entire message can be parsed, it
[454] Fix | Delete
* will be returned and DNS_R_RECOVERABLE will be returned.
[455] Fix | Delete
*
[456] Fix | Delete
* If #DNS_MESSAGEPARSE_IGNORETRUNCATION is set then return as many complete
[457] Fix | Delete
* RR's as possible, DNS_R_RECOVERABLE will be returned.
[458] Fix | Delete
*
[459] Fix | Delete
* OPT and TSIG records are always handled specially, regardless of the
[460] Fix | Delete
* 'preserve_order' setting.
[461] Fix | Delete
*
[462] Fix | Delete
* Requires:
[463] Fix | Delete
*\li "msg" be valid.
[464] Fix | Delete
*
[465] Fix | Delete
*\li "buffer" be a wire format buffer.
[466] Fix | Delete
*
[467] Fix | Delete
* Ensures:
[468] Fix | Delete
*\li The buffer's data format is correct.
[469] Fix | Delete
*
[470] Fix | Delete
*\li The buffer's contents verify as correct regarding header bits, buffer
[471] Fix | Delete
* and rdata sizes, etc.
[472] Fix | Delete
*
[473] Fix | Delete
* Returns:
[474] Fix | Delete
*\li #ISC_R_SUCCESS -- all is well
[475] Fix | Delete
*\li #ISC_R_NOMEMORY -- no memory
[476] Fix | Delete
*\li #DNS_R_RECOVERABLE -- the message parsed properly, but contained
[477] Fix | Delete
* errors.
[478] Fix | Delete
*\li Many other errors possible XXXMLG
[479] Fix | Delete
*/
[480] Fix | Delete
[481] Fix | Delete
isc_result_t
[482] Fix | Delete
dns_message_renderbegin(dns_message_t *msg, dns_compress_t *cctx,
[483] Fix | Delete
isc_buffer_t *buffer);
[484] Fix | Delete
/*%<
[485] Fix | Delete
* Begin rendering on a message. Only one call can be made to this function
[486] Fix | Delete
* per message.
[487] Fix | Delete
*
[488] Fix | Delete
* The compression context is "owned" by the message library until
[489] Fix | Delete
* dns_message_renderend() is called. It must be invalidated by the caller.
[490] Fix | Delete
*
[491] Fix | Delete
* The buffer is "owned" by the message library until dns_message_renderend()
[492] Fix | Delete
* is called.
[493] Fix | Delete
*
[494] Fix | Delete
* Requires:
[495] Fix | Delete
*
[496] Fix | Delete
*\li 'msg' be valid.
[497] Fix | Delete
*
[498] Fix | Delete
*\li 'cctx' be valid.
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function