#include <config.h>
#include <isc/event.h>
#include <isc/lex.h>
#include <isc/magic.h>
#include <isc/mem.h>
#include <isc/print.h>
#include <isc/serial.h>
#include <isc/stdio.h>
#include <isc/stdtime.h>
#include <isc/string.h>
#include <isc/task.h>
#include <isc/util.h>
#include <dns/callbacks.h>
#include <dns/events.h>
#include <dns/fixedname.h>
#include <dns/master.h>
#include <dns/name.h>
#include <dns/rdata.h>
#include <dns/rdataclass.h>
#include <dns/rdatalist.h>
#include <dns/rdataset.h>
#include <dns/rdatastruct.h>
#include <dns/rdatatype.h>
#include <dns/result.h>
#include <dns/soa.h>
#include <dns/time.h>
#include <dns/ttl.h>
Go to the source code of this file.
Data Structures | |
struct | dns_incctx |
Defines | |
#define | RDLSZ 32 |
RDLSZ reflects the number of different types with the same name expected. | |
#define | RDSZ 512 |
RDSZ reflects the number of rdata expected at a give name that can fit into 64k. | |
#define | NBUFS 4 |
#define | MAXWIRESZ 255 |
#define | TSIZ (128*1024) |
Target buffer size and minimum target size. MINTSIZ must be big enough to hold the largest rdata record. | |
#define | MINTSIZ DNS_RDATA_MAXLENGTH |
max message size - header - root - type - class - ttl - rdlen | |
#define | TOKENSIZ (8*1024) |
Size for tokens in the presentation format, The largest tokens are the base64 blocks in KEY and CERT records, Largest key allowed is about 1372 bytes but there is no fixed upper bound on CERT records. 2K is too small for some X.509s, 8K is overkill. | |
#define | DNS_MASTER_LHS 2048 |
Buffers sizes for $GENERATE. | |
#define | DNS_MASTER_RHS MINTSIZ |
#define | CHECKNAMESFAIL(x) (((x) & DNS_MASTER_CHECKNAMESFAIL) != 0) |
#define | DNS_LCTX_MAGIC ISC_MAGIC('L','c','t','x') |
#define | DNS_LCTX_VALID(lctx) ISC_MAGIC_VALID(lctx, DNS_LCTX_MAGIC) |
#define | DNS_AS_STR(t) ((t).value.as_textregion.base) |
#define | GETTOKENERR(lexer, options, token, eol, err) |
#define | GETTOKEN(lexer, options, token, eol) GETTOKENERR(lexer, options, token, eol, {} ) |
#define | COMMITALL |
#define | WARNUNEXPECTEDEOF(lexer) |
#define | EXPECTEOL |
#define | MANYERRS(lctx, result) |
#define | SETRESULT(lctx, r) |
#define | LOGITFILE(result, filename) |
#define | LOGIT(result) |
Functions | |
typedef | ISC_LIST (dns_rdatalist_t) |
Master file load state. | |
static isc_result_t | openfile_text (dns_loadctx_t *lctx, const char *master_file) |
static isc_result_t | load_text (dns_loadctx_t *lctx) |
static isc_result_t | openfile_raw (dns_loadctx_t *lctx, const char *master_file) |
static isc_result_t | load_raw (dns_loadctx_t *lctx) |
static isc_result_t | openfile_map (dns_loadctx_t *lctx, const char *master_file) |
static isc_result_t | load_map (dns_loadctx_t *lctx) |
static isc_result_t | pushfile (const char *master_file, dns_name_t *origin, dns_loadctx_t *lctx) |
static isc_result_t | commit (dns_rdatacallbacks_t *, dns_loadctx_t *, rdatalist_head_t *, dns_name_t *, const char *, unsigned int) |
static isc_boolean_t | is_glue (rdatalist_head_t *, dns_name_t *) |
static dns_rdatalist_t * | grow_rdatalist (int, dns_rdatalist_t *, int, rdatalist_head_t *, rdatalist_head_t *, isc_mem_t *mctx) |
static dns_rdata_t * | grow_rdata (int, dns_rdata_t *, int, rdatalist_head_t *, rdatalist_head_t *, isc_mem_t *) |
static void | load_quantum (isc_task_t *task, isc_event_t *event) |
static isc_result_t | task_send (dns_loadctx_t *lctx) |
static void | loadctx_destroy (dns_loadctx_t *lctx) |
static isc_result_t | gettoken (isc_lex_t *lex, unsigned int options, isc_token_t *token, isc_boolean_t eol, dns_rdatacallbacks_t *callbacks) |
void | dns_loadctx_attach (dns_loadctx_t *source, dns_loadctx_t **target) |
Attach to the load context. | |
void | dns_loadctx_detach (dns_loadctx_t **lctxp) |
Detach from the load context. | |
static void | incctx_destroy (isc_mem_t *mctx, dns_incctx_t *ictx) |
static isc_result_t | incctx_create (isc_mem_t *mctx, dns_name_t *origin, dns_incctx_t **ictxp) |
static isc_result_t | loadctx_create (dns_masterformat_t format, isc_mem_t *mctx, unsigned int options, isc_uint32_t resign, dns_name_t *top, dns_rdataclass_t zclass, dns_name_t *origin, dns_rdatacallbacks_t *callbacks, isc_task_t *task, dns_loaddonefunc_t done, void *done_arg, dns_masterincludecb_t include_cb, void *include_arg, isc_lex_t *lex, dns_loadctx_t **lctxp) |
static unsigned int | nibbles (char *numbuf, size_t length, unsigned int width, char mode, int value) |
Convert value into a nibble sequence from least significant to most significant nibble. Zero fill upper most significant nibbles if required to make the width. | |
static isc_result_t | genname (char *name, int it, char *buffer, size_t length) |
static isc_result_t | generate (dns_loadctx_t *lctx, char *range, char *lhs, char *gtype, char *rhs, const char *source, unsigned int line) |
static void | limit_ttl (dns_rdatacallbacks_t *callbacks, const char *source, unsigned int line, isc_uint32_t *ttlp) |
static isc_result_t | check_ns (dns_loadctx_t *lctx, isc_token_t *token, const char *source, unsigned long line) |
static void | check_wildcard (dns_incctx_t *ictx, const char *source, unsigned long line, dns_rdatacallbacks_t *callbacks) |
static isc_result_t | read_and_check (isc_boolean_t do_read, isc_buffer_t *buffer, size_t len, FILE *f) |
static isc_result_t | load_header (dns_loadctx_t *lctx) |
isc_result_t | dns_master_loadfile (const char *master_file, dns_name_t *top, dns_name_t *origin, dns_rdataclass_t zclass, unsigned int options, dns_rdatacallbacks_t *callbacks, isc_mem_t *mctx) |
isc_result_t | dns_master_loadfile2 (const char *master_file, dns_name_t *top, dns_name_t *origin, dns_rdataclass_t zclass, unsigned int options, dns_rdatacallbacks_t *callbacks, isc_mem_t *mctx, dns_masterformat_t format) |
isc_result_t | dns_master_loadfile3 (const char *master_file, dns_name_t *top, dns_name_t *origin, dns_rdataclass_t zclass, unsigned int options, isc_uint32_t resign, dns_rdatacallbacks_t *callbacks, isc_mem_t *mctx, dns_masterformat_t format) |
isc_result_t | dns_master_loadfile4 (const char *master_file, dns_name_t *top, dns_name_t *origin, dns_rdataclass_t zclass, unsigned int options, isc_uint32_t resign, dns_rdatacallbacks_t *callbacks, dns_masterincludecb_t include_cb, void *include_arg, isc_mem_t *mctx, dns_masterformat_t format) |
isc_result_t | dns_master_loadfile5 (const char *master_file, dns_name_t *top, dns_name_t *origin, dns_rdataclass_t zclass, unsigned int options, isc_uint32_t resign, dns_rdatacallbacks_t *callbacks, dns_masterincludecb_t include_cb, void *include_arg, isc_mem_t *mctx, dns_masterformat_t format, dns_ttl_t maxttl) |
isc_result_t | dns_master_loadfileinc (const char *master_file, dns_name_t *top, dns_name_t *origin, dns_rdataclass_t zclass, unsigned int options, dns_rdatacallbacks_t *callbacks, isc_task_t *task, dns_loaddonefunc_t done, void *done_arg, dns_loadctx_t **lctxp, isc_mem_t *mctx) |
isc_result_t | dns_master_loadfileinc2 (const char *master_file, dns_name_t *top, dns_name_t *origin, dns_rdataclass_t zclass, unsigned int options, dns_rdatacallbacks_t *callbacks, isc_task_t *task, dns_loaddonefunc_t done, void *done_arg, dns_loadctx_t **lctxp, isc_mem_t *mctx, dns_masterformat_t format) |
isc_result_t | dns_master_loadfileinc3 (const char *master_file, dns_name_t *top, dns_name_t *origin, dns_rdataclass_t zclass, unsigned int options, isc_uint32_t resign, dns_rdatacallbacks_t *callbacks, isc_task_t *task, dns_loaddonefunc_t done, void *done_arg, dns_loadctx_t **lctxp, isc_mem_t *mctx, dns_masterformat_t format) |
isc_result_t | dns_master_loadfileinc4 (const char *master_file, dns_name_t *top, dns_name_t *origin, dns_rdataclass_t zclass, unsigned int options, isc_uint32_t resign, dns_rdatacallbacks_t *callbacks, isc_task_t *task, dns_loaddonefunc_t done, void *done_arg, dns_loadctx_t **lctxp, dns_masterincludecb_t include_cb, void *include_arg, isc_mem_t *mctx, dns_masterformat_t format) |
isc_result_t | dns_master_loadfileinc5 (const char *master_file, dns_name_t *top, dns_name_t *origin, dns_rdataclass_t zclass, unsigned int options, isc_uint32_t resign, dns_rdatacallbacks_t *callbacks, isc_task_t *task, dns_loaddonefunc_t done, void *done_arg, dns_loadctx_t **lctxp, dns_masterincludecb_t include_cb, void *include_arg, isc_mem_t *mctx, dns_masterformat_t format, isc_uint32_t maxttl) |
isc_result_t | dns_master_loadstream (FILE *stream, dns_name_t *top, dns_name_t *origin, dns_rdataclass_t zclass, unsigned int options, dns_rdatacallbacks_t *callbacks, isc_mem_t *mctx) |
isc_result_t | dns_master_loadstreaminc (FILE *stream, dns_name_t *top, dns_name_t *origin, dns_rdataclass_t zclass, unsigned int options, dns_rdatacallbacks_t *callbacks, isc_task_t *task, dns_loaddonefunc_t done, void *done_arg, dns_loadctx_t **lctxp, isc_mem_t *mctx) |
isc_result_t | dns_master_loadbuffer (isc_buffer_t *buffer, dns_name_t *top, dns_name_t *origin, dns_rdataclass_t zclass, unsigned int options, dns_rdatacallbacks_t *callbacks, isc_mem_t *mctx) |
isc_result_t | dns_master_loadbufferinc (isc_buffer_t *buffer, dns_name_t *top, dns_name_t *origin, dns_rdataclass_t zclass, unsigned int options, dns_rdatacallbacks_t *callbacks, isc_task_t *task, dns_loaddonefunc_t done, void *done_arg, dns_loadctx_t **lctxp, isc_mem_t *mctx) |
isc_result_t | dns_master_loadlexer (isc_lex_t *lex, dns_name_t *top, dns_name_t *origin, dns_rdataclass_t zclass, unsigned int options, dns_rdatacallbacks_t *callbacks, isc_mem_t *mctx) |
isc_result_t | dns_master_loadlexerinc (isc_lex_t *lex, dns_name_t *top, dns_name_t *origin, dns_rdataclass_t zclass, unsigned int options, dns_rdatacallbacks_t *callbacks, isc_task_t *task, dns_loaddonefunc_t done, void *done_arg, dns_loadctx_t **lctxp, isc_mem_t *mctx) |
Loads a RFC1305 master file from a file, stream, buffer, or existing lexer into rdatasets and then calls 'callbacks->commit' to commit the rdatasets. Rdata memory belongs to dns_master_load and will be reused / released when the callback completes. dns_load_master will abort if callbacks->commit returns any value other than ISC_R_SUCCESS. | |
static isc_uint32_t | resign_fromlist (dns_rdatalist_t *this, isc_uint32_t resign) |
void | dns_loadctx_cancel (dns_loadctx_t *lctx) |
Cancel loading the zone file associated with this load context. | |
void | dns_master_initrawheader (dns_masterrawheader_t *header) |
Initializes the header for a raw master file, setting all values to zero. | |
Variables | |
static unsigned char | in_addr_arpa_data [] = "\007IN-ADDR\004ARPA" |
static unsigned char | in_addr_arpa_offsets [] = { 0, 8, 13 } |
static const dns_name_t | in_addr_arpa |
static unsigned char | ip6_int_data [] = "\003IP6\003INT" |
static unsigned char | ip6_int_offsets [] = { 0, 4, 8 } |
static const dns_name_t | ip6_int |
static unsigned char | ip6_arpa_data [] = "\003IP6\004ARPA" |
static unsigned char | ip6_arpa_offsets [] = { 0, 4, 9 } |
static const dns_name_t | ip6_arpa |
static const char * | hex = "0123456789abcdef0123456789ABCDEF" |
Definition in file master.c.
#define RDLSZ 32 |
RDLSZ reflects the number of different types with the same name expected.
Grow the number of dns_rdatalist_t (RDLSZ) and dns_rdata_t (RDSZ) structures by these sizes when we need to.
Definition at line 58 of file master.c.
Referenced by load_text().
#define RDSZ 512 |
RDSZ reflects the number of rdata expected at a give name that can fit into 64k.
Definition at line 63 of file master.c.
Referenced by load_raw(), and load_text().
#define NBUFS 4 |
#define TSIZ (128*1024) |
Target buffer size and minimum target size. MINTSIZ must be big enough to hold the largest rdata record.
TSIZ >= MINTSIZ
Definition at line 74 of file master.c.
Referenced by load_raw(), and load_text().
#define MINTSIZ DNS_RDATA_MAXLENGTH |
max message size - header - root - type - class - ttl - rdlen
Definition at line 78 of file master.c.
Referenced by generate(), load_raw(), and load_text().
#define TOKENSIZ (8*1024) |
Size for tokens in the presentation format, The largest tokens are the base64 blocks in KEY and CERT records, Largest key allowed is about 1372 bytes but there is no fixed upper bound on CERT records. 2K is too small for some X.509s, 8K is overkill.
Definition at line 86 of file master.c.
Referenced by loadctx_create().
#define DNS_MASTER_LHS 2048 |
#define DNS_MASTER_RHS MINTSIZ |
#define CHECKNAMESFAIL | ( | x | ) | (((x) & DNS_MASTER_CHECKNAMESFAIL) != 0) |
#define DNS_LCTX_MAGIC ISC_MAGIC('L','c','t','x') |
Definition at line 175 of file master.c.
Referenced by dns_loadctx_attach(), dns_loadctx_cancel(), dns_loadctx_detach(), load_header(), load_map(), load_quantum(), load_raw(), load_text(), loadctx_destroy(), and pushfile().
#define DNS_AS_STR | ( | t | ) | ((t).value.as_textregion.base) |
Definition at line 177 of file master.c.
Referenced by atob_tobuffer(), check_mx(), check_ns(), dns_rdata_fromtext(), fromtext_any_tsig(), fromtext_error(), fromtext_eui48(), fromtext_eui64(), fromtext_hip(), fromtext_hs_a(), fromtext_in_a(), fromtext_in_a6(), fromtext_in_aaaa(), fromtext_in_apl(), fromtext_in_wks(), fromtext_ipseckey(), fromtext_keydata(), fromtext_l32(), fromtext_l64(), fromtext_loc(), fromtext_nid(), fromtext_nsec3(), fromtext_nsec3param(), fromtext_nxt(), fromtext_rrsig(), fromtext_sig(), fromtext_tkey(), load_text(), and warn_badmx().
#define GETTOKENERR | ( | lexer, | |||
options, | |||||
token, | |||||
eol, | |||||
err | ) |
Value:
do { \ result = gettoken(lexer, options, token, eol, callbacks); \ switch (result) { \ case ISC_R_SUCCESS: \ break; \ case ISC_R_UNEXPECTED: \ goto insist_and_cleanup; \ default: \ if (MANYERRS(lctx, result)) { \ SETRESULT(lctx, result); \ LOGIT(result); \ read_till_eol = ISC_TRUE; \ err \ goto next_line; \ } else \ goto log_and_cleanup; \ } \ if ((token)->type == isc_tokentype_special) { \ result = DNS_R_SYNTAX; \ if (MANYERRS(lctx, result)) { \ SETRESULT(lctx, result); \ LOGIT(result); \ read_till_eol = ISC_TRUE; \ goto next_line; \ } else \ goto log_and_cleanup; \ } \ } while (0)
Definition at line 224 of file master.c.
Referenced by load_text().
#define COMMITALL |
Value:
do { \ result = commit(callbacks, lctx, ¤t_list, \ ictx->current, source, ictx->current_line); \ if (MANYERRS(lctx, result)) { \ SETRESULT(lctx, result); \ } else if (result != ISC_R_SUCCESS) \ goto insist_and_cleanup; \ result = commit(callbacks, lctx, &glue_list, \ ictx->glue, source, ictx->glue_line); \ if (MANYERRS(lctx, result)) { \ SETRESULT(lctx, result); \ } else if (result != ISC_R_SUCCESS) \ goto insist_and_cleanup; \ rdcount = 0; \ rdlcount = 0; \ isc_buffer_init(&target, target_mem, target_size); \ rdcount_save = rdcount; \ rdlcount_save = rdlcount; \ } while (0)
Definition at line 256 of file master.c.
Referenced by load_text().
#define WARNUNEXPECTEDEOF | ( | lexer | ) |
Value:
do { \ if (isc_lex_isfile(lexer)) \ (*callbacks->warn)(callbacks, \ "%s: file does not end with newline", \ source); \ } while (0)
Definition at line 277 of file master.c.
Referenced by load_text().
#define EXPECTEOL |
Value:
do { \ GETTOKEN(lctx->lex, 0, &token, ISC_TRUE); \ if (token.type != isc_tokentype_eol) { \ isc_lex_ungettoken(lctx->lex, &token); \ result = DNS_R_EXTRATOKEN; \ if (MANYERRS(lctx, result)) { \ SETRESULT(lctx, result); \ LOGIT(result); \ read_till_eol = ISC_TRUE; \ continue; \ } else if (result != ISC_R_SUCCESS) \ goto log_and_cleanup; \ } \ } while (0)
Definition at line 285 of file master.c.
Referenced by load_text().
#define MANYERRS | ( | lctx, | |||
result | ) |
Value:
((result != ISC_R_SUCCESS) && \ (result != ISC_R_IOERROR) && \ ((lctx)->options & DNS_MASTER_MANYERRORS) != 0)
Definition at line 301 of file master.c.
Referenced by commit(), and load_text().
Value:
do { \ if ((lctx)->result == ISC_R_SUCCESS) \ (lctx)->result = r; \ } while (0)
Definition at line 306 of file master.c.
Referenced by commit(), and load_text().
#define LOGITFILE | ( | result, | |||
filename | ) |
Value:
if (result == ISC_R_INVALIDFILE || result == ISC_R_FILENOTFOUND || \ result == ISC_R_IOERROR || result == ISC_R_TOOMANYOPENFILES || \ result == ISC_R_NOPERM) \ (*callbacks->error)(callbacks, "%s: %s:%lu: %s: %s", \ "dns_master_load", source, line, \ filename, dns_result_totext(result)); \ else LOGIT(result)
Definition at line 312 of file master.c.
Referenced by load_text().
#define LOGIT | ( | result | ) |
Value:
if (result == ISC_R_NOMEMORY) \ (*callbacks->error)(callbacks, "dns_master_load: %s", \ dns_result_totext(result)); \ else \ (*callbacks->error)(callbacks, "%s: %s:%lu: %s", \ "dns_master_load", \ source, line, dns_result_totext(result))
Definition at line 321 of file master.c.
Referenced by load_text().
typedef ISC_LIST | ( | dns_rdatalist_t | ) |
static isc_result_t openfile_text | ( | dns_loadctx_t * | lctx, | |
const char * | master_file | |||
) | [static] |
Definition at line 1022 of file master.c.
References isc_lex_openfile().
Referenced by loadctx_create().
static isc_result_t load_text | ( | dns_loadctx_t * | lctx | ) | [static] |
Definition at line 1027 of file master.c.
References isc_tokenvalue_t::as_region, isc_tokenvalue_t::as_textregion, isc_textregion::base, isc_region::base, buffer, callbacks, check_ns(), check_wildcard(), CHECKNAMESFAIL, cleanup(), commit(), COMMITALL, DNS_AS_STR, dns_fixedname_init, dns_fixedname_name, DNS_LCTX_VALID, DNS_MASTER_AGETTL, DNS_MASTER_CHECKMX, DNS_MASTER_CHECKMXFAIL, DNS_MASTER_CHECKNAMES, DNS_MASTER_CHECKNAMESFAIL, DNS_MASTER_CHECKNS, DNS_MASTER_CHECKTTL, DNS_MASTER_CHECKWILDCARD, DNS_MASTER_FATALNS, DNS_MASTER_HINT, DNS_MASTER_KEY, DNS_MASTER_NOINCLUDE, DNS_MASTER_SLAVE, DNS_MASTER_ZONE, dns_name_compare(), dns_name_format(), DNS_NAME_FORMATSIZE, dns_name_fromtext(), dns_name_issubdomain(), DNS_R_BADCLASS, DNS_R_BADOWNERNAME, DNS_R_CONTINUE, DNS_R_NOOWNER, DNS_R_NOTTL, DNS_R_NOTZONETOP, DNS_R_OBSOLETE, DNS_R_REFUSED, DNS_R_SEENINCLUDE, DNS_R_SYNTAX, DNS_RDATA_CHECKMX, DNS_RDATA_CHECKMXFAIL, DNS_RDATA_CHECKNAMES, DNS_RDATA_CHECKNAMESFAIL, dns_rdata_checkowner(), DNS_RDATA_CHECKREVERSE, dns_rdata_covers(), dns_rdata_fromtext(), dns_rdata_init(), dns_rdata_tostruct(), dns_rdataclass_format(), DNS_RDATACLASS_FORMATSIZE, dns_rdataclass_fromtext(), dns_rdatalist_init(), dns_rdatatype_format(), DNS_RDATATYPE_FORMATSIZE, dns_rdatatype_fromtext(), dns_result_totext(), dns_soa_getminimum(), dns_time64_fromtext(), dns_ttl_fromtext(), dns_rdatacallbacks::error, EXPECTEOL, generate(), GETTOKEN, GETTOKENERR, grow_rdata(), grow_rdatalist(), incctx_destroy(), include_file, INSIST, is_glue(), isc_buffer_add, isc_buffer_init, isc_buffer_setactive, ISC_FALSE, isc_lex_close(), isc_lex_getsourceline(), isc_lex_getsourcename(), isc_lex_ungettoken(), ISC_LEXOPT_INITIALWS, ISC_LEXOPT_QSTRING, ISC_LIST_APPEND, ISC_LIST_HEAD, ISC_LIST_INIT, ISC_LIST_INITANDPREPEND, ISC_LIST_NEXT, ISC_LIST_UNLINK, isc_mem_free, isc_mem_get, isc_mem_put, isc_mem_strdup, ISC_R_NOMEMORY, ISC_R_RANGE, ISC_R_SUCCESS, ISC_R_UNEXPECTED, isc_serial_lt(), isc_stdtime_get(), isc_tokentype_eof, isc_tokentype_eol, isc_tokentype_initialws, isc_tokentype_qstring, isc_tokentype_string, ISC_TRUE, isc_buffer::length, isc_textregion::length, isc_region::length, limit_ttl(), LOGIT, LOGITFILE, MANYERRS, mctx, MINTSIZ, name, namebuf, NBUFS, now, POST, pushfile(), rdclass, RDLSZ, RDSZ, REQUIRE, RUNTIME_CHECK, SETRESULT, token, TSIZ, ttl, isc_token::type, UNEXPECTED_ERROR, isc_buffer::used, isc_token::value, dns_rdatacallbacks::warn, and WARNUNEXPECTEDEOF.
Referenced by loadctx_create().
static isc_result_t openfile_raw | ( | dns_loadctx_t * | lctx, | |
const char * | master_file | |||
) | [static] |
Definition at line 2252 of file master.c.
References ISC_R_FILENOTFOUND, ISC_R_SUCCESS, isc_result_totext(), isc_stdio_open(), and UNEXPECTED_ERROR.
Referenced by loadctx_create().
static isc_result_t load_raw | ( | dns_loadctx_t * | lctx | ) | [static] |
Definition at line 2266 of file master.c.
References isc_buffer::base, callbacks, cleanup(), commit(), dns_rdatalist::covers, dns_decompress_init(), DNS_DECOMPRESS_NONE, dns_fixedname_init, dns_fixedname_name, DNS_LCTX_VALID, DNS_MASTER_CHECKTTL, dns_name_fromwire(), DNS_NAME_MAXWIRE, DNS_R_CONTINUE, dns_rdata_fromwire(), dns_rdata_init(), dns_rdata_reset(), dns_rdatalist_init(), dns_result_totext(), dummy, dns_rdatacallbacks::error, fixed, grow_rdata(), INSIST, isc_buffer_add, isc_buffer_availablelength, isc_buffer_clear, isc_buffer_consumedlength, isc_buffer_current, isc_buffer_getuint16(), isc_buffer_getuint32(), isc_buffer_init, isc_buffer_remaininglength, isc_buffer_setactive, ISC_FALSE, ISC_LIST_APPEND, ISC_LIST_INIT, ISC_LIST_UNLINK, isc_mem_get, isc_mem_put, ISC_R_EOF, ISC_R_NOMEMORY, ISC_R_RANGE, ISC_R_SUCCESS, isc_stdio_read(), ISC_TRUE, load_header(), mctx, MINTSIZ, name, namebuf, dns_rdatacallbacks::rawdata, dns_rdatalist::rdclass, RDSZ, read_and_check(), REQUIRE, TSIZ, dns_rdatalist::ttl, dns_rdatalist::type, and dns_rdatacallbacks::zone.
Referenced by loadctx_create().
static isc_result_t openfile_map | ( | dns_loadctx_t * | lctx, | |
const char * | master_file | |||
) | [static] |
Definition at line 2213 of file master.c.
References ISC_R_FILENOTFOUND, ISC_R_SUCCESS, isc_result_totext(), isc_stdio_open(), and UNEXPECTED_ERROR.
Referenced by loadctx_create().
static isc_result_t load_map | ( | dns_loadctx_t * | lctx | ) | [static] |
Definition at line 2230 of file master.c.
References callbacks, dns_rdatacallbacks::deserialize, dns_rdatacallbacks::deserialize_private, DNS_LCTX_VALID, ISC_R_SUCCESS, load_header(), and REQUIRE.
Referenced by loadctx_create().
static isc_result_t pushfile | ( | const char * | master_file, | |
dns_name_t * | origin, | |||
dns_loadctx_t * | lctx | |||
) | [static] |
Definition at line 2061 of file master.c.
References cleanup(), dns_fixedname_name, DNS_LCTX_VALID, dns_name_fromregion(), dns_name_toregion(), incctx_create(), incctx_destroy(), INSIST, ISC_R_SUCCESS, ISC_TRUE, NBUFS, r, and REQUIRE.
Referenced by load_text().
static isc_result_t commit | ( | dns_rdatacallbacks_t * | callbacks, | |
dns_loadctx_t * | lctx, | |||
rdatalist_head_t * | head, | |||
dns_name_t * | owner, | |||
const char * | source, | |||
unsigned int | line | |||
) | [static] |
Definition at line 3061 of file master.c.
References dns_rdatacallbacks::add, dns_rdatacallbacks::add_private, dns_rdataset::attributes, DNS_MASTER_RESIGN, dns_name_format(), DNS_NAME_FORMATSIZE, dns_rdatalist_tordataset(), dns_rdataset_init(), DNS_RDATASETATTR_RESIGN, dns_result_totext(), dns_trust_ultimate, dns_rdatacallbacks::error, error(), ISC_LIST_HEAD, ISC_LIST_UNLINK, ISC_R_NOMEMORY, ISC_R_SUCCESS, MANYERRS, namebuf, dns_rdataset::resign, resign_fromlist(), RUNTIME_CHECK, SETRESULT, dns_rdataset::trust, and dns_rdataset::type.
Referenced by generate(), keyfetch_done(), load_raw(), load_text(), sync_keyzone(), zone_refreshkeys(), and zone_sign().
static isc_boolean_t is_glue | ( | rdatalist_head_t * | head, | |
dns_name_t * | owner | |||
) | [static] |
Definition at line 3121 of file master.c.
References dns_name_compare(), dns_name_fromregion(), dns_name_init(), dns_rdata_toregion(), ISC_FALSE, ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_TRUE, and name.
Referenced by load_text().
static dns_rdatalist_t * grow_rdatalist | ( | int | new_len, | |
dns_rdatalist_t * | old, | |||
int | old_len, | |||
rdatalist_head_t * | current, | |||
rdatalist_head_t * | glue, | |||
isc_mem_t * | mctx | |||
) | [static] |
Definition at line 2924 of file master.c.
References INSIST, ISC_LIST, ISC_LIST_APPEND, ISC_LIST_HEAD, ISC_LIST_INIT, ISC_LIST_UNLINK, isc_mem_get, and isc_mem_put.
Referenced by load_text().
static dns_rdata_t * grow_rdata | ( | int | new_len, | |
dns_rdata_t * | old, | |||
int | old_len, | |||
rdatalist_head_t * | current, | |||
rdatalist_head_t * | glue, | |||
isc_mem_t * | mctx | |||
) | [static] |
Definition at line 2974 of file master.c.
References INSIST, ISC_LIST, ISC_LIST_APPEND, ISC_LIST_HEAD, ISC_LIST_INIT, ISC_LIST_NEXT, ISC_LIST_UNLINK, isc_mem_get, and isc_mem_put.
Referenced by load_raw(), and load_text().
static void load_quantum | ( | isc_task_t * | task, | |
isc_event_t * | event | |||
) | [static] |
Definition at line 3152 of file master.c.
References DNS_LCTX_VALID, dns_loadctx_detach(), DNS_R_CONTINUE, isc_event_free(), ISC_R_CANCELED, isc_task_send(), lctx, and REQUIRE.
Referenced by task_send().
static isc_result_t task_send | ( | dns_loadctx_t * | lctx | ) | [static] |
Definition at line 3175 of file master.c.
References DNS_EVENT_MASTERQUANTUM, isc_event_allocate(), ISC_R_NOMEMORY, ISC_R_SUCCESS, isc_task_send(), and load_quantum().
static void loadctx_destroy | ( | dns_loadctx_t * | lctx | ) | [static] |
Definition at line 467 of file master.c.
References DESTROYLOCK, DNS_LCTX_VALID, incctx_destroy(), isc_lex_destroy(), isc_mem_attach(), isc_mem_detach(), isc_mem_put, ISC_R_SUCCESS, isc_result_totext(), isc_stdio_close(), isc_task_detach(), mctx, REQUIRE, and UNEXPECTED_ERROR.
Referenced by dns_loadctx_detach().
static isc_result_t gettoken | ( | isc_lex_t * | lex, | |
unsigned int | options, | |||
isc_token_t * | token, | |||
isc_boolean_t | eol, | |||
dns_rdatacallbacks_t * | callbacks | |||
) | [inline, static] |
Definition at line 369 of file master.c.
References dns_rdatacallbacks::error, isc_lex_getsourceline(), isc_lex_getsourcename(), isc_lex_gettoken(), ISC_LEXOPT_DNSMULTILINE, ISC_LEXOPT_EOF, ISC_LEXOPT_EOL, ISC_LEXOPT_ESCAPE, ISC_R_NOMEMORY, ISC_R_SUCCESS, ISC_R_UNEXPECTEDEND, isc_result_totext(), isc_tokentype_eof, isc_tokentype_eol, ISC_TRUE, and isc_token::type.
void dns_loadctx_attach | ( | dns_loadctx_t * | source, | |
dns_loadctx_t ** | target | |||
) |
Attach to the load context.
Requires:
Definition at line 415 of file master.c.
References DNS_LCTX_VALID, INSIST, LOCK, REQUIRE, and UNLOCK.
Referenced by dns_master_loadbufferinc(), dns_master_loadfileinc5(), dns_master_loadlexerinc(), and dns_master_loadstreaminc().
void dns_loadctx_detach | ( | dns_loadctx_t ** | ctxp | ) |
Detach from the load context.
Requires:
Definition at line 430 of file master.c.
References DNS_LCTX_VALID, INSIST, ISC_FALSE, ISC_TRUE, lctx, loadctx_destroy(), LOCK, REQUIRE, and UNLOCK.
Referenced by dns_master_loadbuffer(), dns_master_loadbufferinc(), dns_master_loadfile5(), dns_master_loadfileinc5(), dns_master_loadlexer(), dns_master_loadlexerinc(), dns_master_loadstream(), dns_master_loadstreaminc(), load_quantum(), and zone_loaddone().
static void incctx_destroy | ( | isc_mem_t * | mctx, | |
dns_incctx_t * | ictx | |||
) | [static] |
Definition at line 451 of file master.c.
References isc_mem_put.
Referenced by load_text(), loadctx_create(), loadctx_destroy(), and pushfile().
static isc_result_t incctx_create | ( | isc_mem_t * | mctx, | |
dns_name_t * | origin, | |||
dns_incctx_t ** | ictxp | |||
) | [static] |
Definition at line 501 of file master.c.
References dns_fixedname_init, dns_fixedname_name, dns_name_fromregion(), dns_name_toregion(), ISC_FALSE, isc_mem_get, ISC_R_NOMEMORY, ISC_R_SUCCESS, ISC_TRUE, NBUFS, and r.
Referenced by loadctx_create(), and pushfile().
static isc_result_t loadctx_create | ( | dns_masterformat_t | format, | |
isc_mem_t * | mctx, | |||
unsigned int | options, | |||
isc_uint32_t | resign, | |||
dns_name_t * | top, | |||
dns_rdataclass_t | zclass, | |||
dns_name_t * | origin, | |||
dns_rdatacallbacks_t * | callbacks, | |||
isc_task_t * | task, | |||
dns_loaddonefunc_t | done, | |||
void * | done_arg, | |||
dns_masterincludecb_t | include_cb, | |||
void * | include_arg, | |||
isc_lex_t * | lex, | |||
dns_loadctx_t ** | lctxp | |||
) | [static] |
Definition at line 536 of file master.c.
References dns_rdatacallbacks::add, dns_fixedname_init, dns_fixedname_name, DNS_LCTX_MAGIC, dns_master_initrawheader(), DNS_MASTER_NOTTL, dns_masterformat_map, dns_masterformat_raw, dns_masterformat_text, dns_name_fromregion(), dns_name_isabsolute(), dns_name_toregion(), dns_rdatacallbacks::error, incctx_create(), incctx_destroy(), INSIST, ISC_FALSE, isc_lex_create(), isc_lex_setcomments(), isc_lex_setspecials(), ISC_LEXCOMMENT_DNSMASTERFILE, isc_mem_attach(), isc_mem_get, isc_mem_put, isc_mutex_init, ISC_R_NOMEMORY, ISC_R_SUCCESS, isc_task_attach(), ISC_TF, ISC_TRUE, lctx, load_map(), load_raw(), load_text(), openfile_map(), openfile_raw(), openfile_text(), r, REQUIRE, TOKENSIZ, and dns_rdatacallbacks::warn.
Referenced by dns_master_loadbuffer(), dns_master_loadbufferinc(), dns_master_loadfile5(), dns_master_loadfileinc5(), dns_master_loadlexer(), dns_master_loadlexerinc(), dns_master_loadstream(), and dns_master_loadstreaminc().
static unsigned int nibbles | ( | char * | numbuf, | |
size_t | length, | |||
unsigned int | width, | |||
char | mode, | |||
int | value | |||
) | [static] |
Convert value into a nibble sequence from least significant to most significant nibble. Zero fill upper most significant nibbles if required to make the width.
Returns the number of characters that should have been written without counting the terminating NUL.
Definition at line 669 of file master.c.
References hex.
Referenced by genname().
static isc_result_t genname | ( | char * | name, | |
int | it, | |||
char * | buffer, | |||
size_t | length | |||
) | [static] |
Definition at line 710 of file master.c.
References isc_textregion::base, DNS_R_SYNTAX, ISC_FALSE, ISC_R_NOSPACE, ISC_R_SUCCESS, isc_textregion_consume, ISC_TRUE, isc_textregion::length, nibbles(), and r.
Referenced by generate().
static isc_result_t generate | ( | dns_loadctx_t * | lctx, | |
char * | range, | |||
char * | lhs, | |||
char * | gtype, | |||
char * | rhs, | |||
const char * | source, | |||
unsigned int | line | |||
) | [static] |
Definition at line 802 of file master.c.
References isc_textregion::base, buffer, callbacks, cleanup(), commit(), dns_fixedname_init, dns_fixedname_name, DNS_MASTER_KEY, DNS_MASTER_LHS, DNS_MASTER_RHS, DNS_MASTER_SLAVE, DNS_MASTER_ZONE, dns_name_format(), DNS_NAME_FORMATSIZE, dns_name_fromtext(), dns_name_issubdomain(), DNS_R_SYNTAX, dns_rdata_fromtext(), DNS_RDATA_INIT, dns_rdata_reset(), dns_rdatalist_init(), dns_rdatatype_fromtext(), dns_result_totext(), dummy, dns_rdatacallbacks::error, genname(), INSIST, isc_buffer_add, isc_buffer_init, isc_buffer_setactive, isc_lex_close(), isc_lex_openbuffer(), ISC_LIST_APPEND, ISC_LIST_INIT, ISC_LIST_PREPEND, ISC_LIST_UNLINK, isc_mem_get, isc_mem_put, ISC_R_NOMEMORY, ISC_R_SUCCESS, isc_textregion::length, MINTSIZ, namebuf, r, dns_rdatalist::rdclass, RUNTIME_CHECK, start, dns_rdatalist::ttl, dns_rdatalist::type, and dns_rdatacallbacks::warn.
Referenced by load_text().
static void limit_ttl | ( | dns_rdatacallbacks_t * | callbacks, | |
const char * | source, | |||
unsigned int | line, | |||
isc_uint32_t * | ttlp | |||
) | [static] |
Definition at line 951 of file master.c.
References dns_rdatacallbacks::warn.
Referenced by load_text().
static isc_result_t check_ns | ( | dns_loadctx_t * | lctx, | |
isc_token_t * | token, | |||
const char * | source, | |||
unsigned long | line | |||
) | [static] |
Definition at line 967 of file master.c.
References AF_INET6, DNS_AS_STR, DNS_MASTER_FATALNS, DNS_R_NSISADDRESS, inet_aton, isc_mem_free, isc_mem_strdup, ISC_R_NOMEMORY, ISC_R_SUCCESS, isc_tokentype_string, and isc_token::type.
Referenced by load_text().
static void check_wildcard | ( | dns_incctx_t * | ictx, | |
const char * | source, | |||
unsigned long | line, | |||
dns_rdatacallbacks_t * | callbacks | |||
) | [static] |
Definition at line 1005 of file master.c.
References dns_name_format(), DNS_NAME_FORMATSIZE, dns_name_internalwildcard(), name, namebuf, and dns_rdatacallbacks::warn.
Referenced by load_text().
static isc_result_t read_and_check | ( | isc_boolean_t | do_read, | |
isc_buffer_t * | buffer, | |||
size_t | len, | |||
FILE * | f | |||
) | [inline, static] |
Definition at line 2115 of file master.c.
References INSIST, isc_buffer_add, isc_buffer_availablelength, isc_buffer_remaininglength, isc_buffer_used, ISC_R_RANGE, ISC_R_SUCCESS, and isc_stdio_read().
Referenced by load_raw().
static isc_result_t load_header | ( | dns_loadctx_t * | lctx | ) | [static] |
Definition at line 2134 of file master.c.
References callbacks, DNS_LCTX_VALID, dns_master_initrawheader(), dns_masterformat_map, dns_masterformat_raw, DNS_RAWFORMAT_VERSION, dns_masterrawheader::dumptime, dns_rdatacallbacks::error, dns_masterrawheader::flags, dns_masterrawheader::format, header, INSIST, isc_buffer_add, isc_buffer_getuint32(), isc_buffer_init, ISC_FALSE, ISC_R_NOTIMPLEMENTED, ISC_R_SUCCESS, isc_result_totext(), isc_stdio_read(), dns_masterrawheader::lastxfrin, REQUIRE, dns_masterrawheader::sourceserial, UNEXPECTED_ERROR, and dns_masterrawheader::version.
Referenced by load_map(), and load_raw().
isc_result_t dns_master_loadfile | ( | const char * | master_file, | |
dns_name_t * | top, | |||
dns_name_t * | origin, | |||
dns_rdataclass_t | zclass, | |||
unsigned int | options, | |||
dns_rdatacallbacks_t * | callbacks, | |||
isc_mem_t * | mctx | |||
) |
Definition at line 2555 of file master.c.
References dns_master_loadfile5(), and dns_masterformat_text.
Referenced by dns_rootns_create().
isc_result_t dns_master_loadfile2 | ( | const char * | master_file, | |
dns_name_t * | top, | |||
dns_name_t * | origin, | |||
dns_rdataclass_t | zclass, | |||
unsigned int | options, | |||
dns_rdatacallbacks_t * | callbacks, | |||
isc_mem_t * | mctx, | |||
dns_masterformat_t | format | |||
) |
Definition at line 2566 of file master.c.
References dns_master_loadfile5().
Referenced by dns_db_load3(), and test_master().
isc_result_t dns_master_loadfile3 | ( | const char * | master_file, | |
dns_name_t * | top, | |||
dns_name_t * | origin, | |||
dns_rdataclass_t | zclass, | |||
unsigned int | options, | |||
isc_uint32_t | resign, | |||
dns_rdatacallbacks_t * | callbacks, | |||
isc_mem_t * | mctx, | |||
dns_masterformat_t | format | |||
) |
isc_result_t dns_master_loadfile4 | ( | const char * | master_file, | |
dns_name_t * | top, | |||
dns_name_t * | origin, | |||
dns_rdataclass_t | zclass, | |||
unsigned int | options, | |||
isc_uint32_t | resign, | |||
dns_rdatacallbacks_t * | callbacks, | |||
dns_masterincludecb_t | include_cb, | |||
void * | include_arg, | |||
isc_mem_t * | mctx, | |||
dns_masterformat_t | format | |||
) |
Definition at line 2590 of file master.c.
References dns_master_loadfile5().
Referenced by ATF_TC_BODY().
isc_result_t dns_master_loadfile5 | ( | const char * | master_file, | |
dns_name_t * | top, | |||
dns_name_t * | origin, | |||
dns_rdataclass_t | zclass, | |||
unsigned int | options, | |||
isc_uint32_t | resign, | |||
dns_rdatacallbacks_t * | callbacks, | |||
dns_masterincludecb_t | include_cb, | |||
void * | include_arg, | |||
isc_mem_t * | mctx, | |||
dns_masterformat_t | format, | |||
dns_ttl_t | maxttl | |||
) |
Definition at line 2604 of file master.c.
References cleanup(), dns_loadctx_detach(), DNS_R_CONTINUE, INSIST, ISC_R_SUCCESS, lctx, and loadctx_create().
Referenced by dns_master_loadfile(), dns_master_loadfile2(), dns_master_loadfile3(), dns_master_loadfile4(), and zone_startload().
isc_result_t dns_master_loadfileinc | ( | const char * | master_file, | |
dns_name_t * | top, | |||
dns_name_t * | origin, | |||
dns_rdataclass_t | zclass, | |||
unsigned int | options, | |||
dns_rdatacallbacks_t * | callbacks, | |||
isc_task_t * | task, | |||
dns_loaddonefunc_t | done, | |||
void * | done_arg, | |||
dns_loadctx_t ** | lctxp, | |||
isc_mem_t * | mctx | |||
) |
Definition at line 2636 of file master.c.
References dns_master_loadfileinc4(), and dns_masterformat_text.
isc_result_t dns_master_loadfileinc2 | ( | const char * | master_file, | |
dns_name_t * | top, | |||
dns_name_t * | origin, | |||
dns_rdataclass_t | zclass, | |||
unsigned int | options, | |||
dns_rdatacallbacks_t * | callbacks, | |||
isc_task_t * | task, | |||
dns_loaddonefunc_t | done, | |||
void * | done_arg, | |||
dns_loadctx_t ** | lctxp, | |||
isc_mem_t * | mctx, | |||
dns_masterformat_t | format | |||
) |
isc_result_t dns_master_loadfileinc3 | ( | const char * | master_file, | |
dns_name_t * | top, | |||
dns_name_t * | origin, | |||
dns_rdataclass_t | zclass, | |||
unsigned int | options, | |||
isc_uint32_t | resign, | |||
dns_rdatacallbacks_t * | callbacks, | |||
isc_task_t * | task, | |||
dns_loaddonefunc_t | done, | |||
void * | done_arg, | |||
dns_loadctx_t ** | lctxp, | |||
isc_mem_t * | mctx, | |||
dns_masterformat_t | format | |||
) |
isc_result_t dns_master_loadfileinc4 | ( | const char * | master_file, | |
dns_name_t * | top, | |||
dns_name_t * | origin, | |||
dns_rdataclass_t | zclass, | |||
unsigned int | options, | |||
isc_uint32_t | resign, | |||
dns_rdatacallbacks_t * | callbacks, | |||
isc_task_t * | task, | |||
dns_loaddonefunc_t | done, | |||
void * | done_arg, | |||
dns_loadctx_t ** | lctxp, | |||
dns_masterincludecb_t | include_cb, | |||
void * | include_arg, | |||
isc_mem_t * | mctx, | |||
dns_masterformat_t | format | |||
) |
Definition at line 2678 of file master.c.
References DNS_MASTER_CHECKTTL, and dns_master_loadfileinc5().
Referenced by dns_master_loadfileinc(), dns_master_loadfileinc2(), and dns_master_loadfileinc3().
isc_result_t dns_master_loadfileinc5 | ( | const char * | master_file, | |
dns_name_t * | top, | |||
dns_name_t * | origin, | |||
dns_rdataclass_t | zclass, | |||
unsigned int | options, | |||
isc_uint32_t | resign, | |||
dns_rdatacallbacks_t * | callbacks, | |||
isc_task_t * | task, | |||
dns_loaddonefunc_t | done, | |||
void * | done_arg, | |||
dns_loadctx_t ** | lctxp, | |||
dns_masterincludecb_t | include_cb, | |||
void * | include_arg, | |||
isc_mem_t * | mctx, | |||
dns_masterformat_t | format, | |||
isc_uint32_t | maxttl | |||
) |
Definition at line 2695 of file master.c.
References cleanup(), dns_loadctx_attach(), dns_loadctx_detach(), DNS_R_CONTINUE, ISC_R_SUCCESS, lctx, loadctx_create(), REQUIRE, and task_send().
Referenced by dns_master_loadfileinc4(), and zone_gotreadhandle().
isc_result_t dns_master_loadstream | ( | FILE * | stream, | |
dns_name_t * | top, | |||
dns_name_t * | origin, | |||
dns_rdataclass_t | zclass, | |||
unsigned int | options, | |||
dns_rdatacallbacks_t * | callbacks, | |||
isc_mem_t * | mctx | |||
) |
Definition at line 2735 of file master.c.
References cleanup(), dns_loadctx_detach(), dns_masterformat_text, DNS_R_CONTINUE, INSIST, isc_lex_openstream(), ISC_R_SUCCESS, lctx, loadctx_create(), and REQUIRE.
Referenced by db_load_from_stream().
isc_result_t dns_master_loadstreaminc | ( | FILE * | stream, | |
dns_name_t * | top, | |||
dns_name_t * | origin, | |||
dns_rdataclass_t | zclass, | |||
unsigned int | options, | |||
dns_rdatacallbacks_t * | callbacks, | |||
isc_task_t * | task, | |||
dns_loaddonefunc_t | done, | |||
void * | done_arg, | |||
dns_loadctx_t ** | lctxp, | |||
isc_mem_t * | mctx | |||
) |
Definition at line 2764 of file master.c.
References cleanup(), dns_loadctx_attach(), dns_loadctx_detach(), dns_masterformat_text, DNS_R_CONTINUE, isc_lex_openstream(), ISC_R_SUCCESS, lctx, loadctx_create(), REQUIRE, and task_send().
isc_result_t dns_master_loadbuffer | ( | isc_buffer_t * | buffer, | |
dns_name_t * | top, | |||
dns_name_t * | origin, | |||
dns_rdataclass_t | zclass, | |||
unsigned int | options, | |||
dns_rdatacallbacks_t * | callbacks, | |||
isc_mem_t * | mctx | |||
) |
Definition at line 2800 of file master.c.
References cleanup(), dns_loadctx_detach(), dns_masterformat_text, DNS_R_CONTINUE, INSIST, isc_lex_openbuffer(), ISC_R_SUCCESS, lctx, loadctx_create(), and REQUIRE.
Referenced by dns_rootns_create().
isc_result_t dns_master_loadbufferinc | ( | isc_buffer_t * | buffer, | |
dns_name_t * | top, | |||
dns_name_t * | origin, | |||
dns_rdataclass_t | zclass, | |||
unsigned int | options, | |||
dns_rdatacallbacks_t * | callbacks, | |||
isc_task_t * | task, | |||
dns_loaddonefunc_t | done, | |||
void * | done_arg, | |||
dns_loadctx_t ** | lctxp, | |||
isc_mem_t * | mctx | |||
) |
Definition at line 2829 of file master.c.
References cleanup(), dns_loadctx_attach(), dns_loadctx_detach(), dns_masterformat_text, DNS_R_CONTINUE, isc_lex_openbuffer(), ISC_R_SUCCESS, lctx, loadctx_create(), REQUIRE, and task_send().
isc_result_t dns_master_loadlexer | ( | isc_lex_t * | lex, | |
dns_name_t * | top, | |||
dns_name_t * | origin, | |||
dns_rdataclass_t | zclass, | |||
unsigned int | options, | |||
dns_rdatacallbacks_t * | callbacks, | |||
isc_mem_t * | mctx | |||
) |
Definition at line 2865 of file master.c.
References dns_loadctx_detach(), dns_masterformat_text, DNS_R_CONTINUE, INSIST, ISC_R_SUCCESS, lctx, loadctx_create(), and REQUIRE.
isc_result_t dns_master_loadlexerinc | ( | isc_lex_t * | lex, | |
dns_name_t * | top, | |||
dns_name_t * | origin, | |||
dns_rdataclass_t | zclass, | |||
unsigned int | options, | |||
dns_rdatacallbacks_t * | callbacks, | |||
isc_task_t * | task, | |||
dns_loaddonefunc_t | done, | |||
void * | done_arg, | |||
dns_loadctx_t ** | ctxp, | |||
isc_mem_t * | mctx | |||
) |
Loads a RFC1305 master file from a file, stream, buffer, or existing lexer into rdatasets and then calls 'callbacks->commit' to commit the rdatasets. Rdata memory belongs to dns_master_load and will be reused / released when the callback completes. dns_load_master will abort if callbacks->commit returns any value other than ISC_R_SUCCESS.
If 'DNS_MASTER_AGETTL' is set and the master file contains one or more $DATE directives, the TTLs of the data will be aged accordingly.
'callbacks->commit' is assumed to call 'callbacks->error' or 'callbacks->warn' to generate any error messages required.
'done' is called with 'done_arg' and a result code when the loading is completed or has failed. If the initial setup fails 'done' is not called.
'resign' the number of seconds before a RRSIG expires that it should be re-signed. 0 is used if not provided.
Requires:
Definition at line 2889 of file master.c.
References dns_loadctx_attach(), dns_loadctx_detach(), dns_masterformat_text, DNS_R_CONTINUE, ISC_R_SUCCESS, lctx, loadctx_create(), REQUIRE, and task_send().
static isc_uint32_t resign_fromlist | ( | dns_rdatalist_t * | this, | |
isc_uint32_t | resign | |||
) | [static] |
Definition at line 3035 of file master.c.
References dns_rdata_tostruct(), INSIST, ISC_LIST_HEAD, and ISC_LIST_NEXT.
Referenced by commit().
void dns_loadctx_cancel | ( | dns_loadctx_t * | ctx | ) |
Cancel loading the zone file associated with this load context.
Requires:
Definition at line 3188 of file master.c.
References DNS_LCTX_VALID, ISC_TRUE, LOCK, REQUIRE, and UNLOCK.
Referenced by zone_shutdown().
void dns_master_initrawheader | ( | dns_masterrawheader_t * | header | ) |
Initializes the header for a raw master file, setting all values to zero.
Definition at line 3197 of file master.c.
Referenced by ATF_TC_BODY(), dumpctx_create(), dumptostream(), load_header(), loadctx_create(), main(), setup_master(), zone_dump(), and zone_gotwritehandle().
unsigned char in_addr_arpa_data[] = "\007IN-ADDR\004ARPA" [static] |
unsigned char in_addr_arpa_offsets[] = { 0, 8, 13 } [static] |
const dns_name_t in_addr_arpa [static] |
Initial value:
{ DNS_NAME_MAGIC, in_addr_arpa_data, 14, 3, DNS_NAMEATTR_READONLY | DNS_NAMEATTR_ABSOLUTE, in_addr_arpa_offsets, NULL, {(void *)-1, (void *)-1}, {NULL, NULL} }
unsigned char ip6_int_data[] = "\003IP6\003INT" [static] |
unsigned char ip6_int_offsets[] = { 0, 4, 8 } [static] |
const dns_name_t ip6_int [static] |
Initial value:
{ DNS_NAME_MAGIC, ip6_int_data, 9, 3, DNS_NAMEATTR_READONLY | DNS_NAMEATTR_ABSOLUTE, ip6_int_offsets, NULL, {(void *)-1, (void *)-1}, {NULL, NULL} }
Definition at line 345 of file master.c.
Referenced by dash_option().
unsigned char ip6_arpa_data[] = "\003IP6\004ARPA" [static] |
unsigned char ip6_arpa_offsets[] = { 0, 4, 9 } [static] |
const dns_name_t ip6_arpa [static] |
Initial value:
{ DNS_NAME_MAGIC, ip6_arpa_data, 10, 3, DNS_NAMEATTR_READONLY | DNS_NAMEATTR_ABSOLUTE, ip6_arpa_offsets, NULL, {(void *)-1, (void *)-1}, {NULL, NULL} }
const char* hex = "0123456789abcdef0123456789ABCDEF" [static] |