master.h File Reference

#include <stdio.h>
#include <isc/lang.h>
#include <dns/types.h>

Go to the source code of this file.

Data Structures

struct  dns_masterrawheader
struct  dns_masterrawrdataset_t

Defines

#define DNS_MASTER_H   1
#define DNS_MASTER_AGETTL   0x00000001
 Age the ttl based on $DATE.
#define DNS_MASTER_MANYERRORS   0x00000002
 Continue processing on errors.
#define DNS_MASTER_NOINCLUDE   0x00000004
 Disallow $INCLUDE directives.
#define DNS_MASTER_ZONE   0x00000008
 Loading a zone master file.
#define DNS_MASTER_HINT   0x00000010
 Loading a hint master file.
#define DNS_MASTER_SLAVE   0x00000020
 Loading a slave master file.
#define DNS_MASTER_CHECKNS   0x00000040
 Check NS records to see if they are an address.
#define DNS_MASTER_FATALNS   0x00000080
 Treat DNS_MASTER_CHECKNS matches as fatal.
#define DNS_MASTER_CHECKNAMES   0x00000100
#define DNS_MASTER_CHECKNAMESFAIL   0x00000200
#define DNS_MASTER_CHECKWILDCARD   0x00000400
#define DNS_MASTER_CHECKMX   0x00000800
#define DNS_MASTER_CHECKMXFAIL   0x00001000
#define DNS_MASTER_RESIGN   0x00002000
#define DNS_MASTER_KEY   0x00004000
 Loading a key zone master file.
#define DNS_MASTER_NOTTL   0x00008000
 Don't require ttl.
#define DNS_MASTER_CHECKTTL   0x00010000
 Check max-zone-ttl.
#define DNS_RAWFORMAT_VERSION   1
#define DNS_MASTERRAW_COMPAT   0x01
#define DNS_MASTERRAW_SOURCESERIALSET   0x02
#define DNS_MASTERRAW_LASTXFRINSET   0x04

Typedefs

typedef void(* dns_masterincludecb_t )(const char *file, void *arg)

Functions

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_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_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_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_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 **ctxp, 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 **ctxp, 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 **ctxp, 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 **ctxp, 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 **ctxp, 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_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 **ctxp, 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 **ctxp, 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 **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.
void dns_loadctx_detach (dns_loadctx_t **ctxp)
 Detach from the load context.
void dns_loadctx_attach (dns_loadctx_t *source, dns_loadctx_t **target)
 Attach to the load context.
void dns_loadctx_cancel (dns_loadctx_t *ctx)
 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.


Detailed Description

Definition in file master.h.


Define Documentation

#define DNS_MASTER_H   1

Definition at line 21 of file master.h.

#define DNS_MASTER_AGETTL   0x00000001

Age the ttl based on $DATE.

Definition at line 38 of file master.h.

Referenced by dns_db_load3(), and load_text().

#define DNS_MASTER_MANYERRORS   0x00000002

Continue processing on errors.

Definition at line 39 of file master.h.

Referenced by zone_startload().

#define DNS_MASTER_NOINCLUDE   0x00000004

Disallow $INCLUDE directives.

Definition at line 40 of file master.h.

Referenced by load_text().

#define DNS_MASTER_ZONE   0x00000008

Loading a zone master file.

Definition at line 41 of file master.h.

Referenced by generate(), get_master_options(), and load_text().

#define DNS_MASTER_HINT   0x00000010

Loading a hint master file.

Definition at line 42 of file master.h.

Referenced by dns_rootns_create(), load_text(), and opendb().

#define DNS_MASTER_SLAVE   0x00000020

Loading a slave master file.

Definition at line 43 of file master.h.

Referenced by generate(), get_master_options(), and load_text().

#define DNS_MASTER_CHECKNS   0x00000040

Check NS records to see if they are an address.

Definition at line 44 of file master.h.

Referenced by get_master_options(), and load_text().

#define DNS_MASTER_FATALNS   0x00000080

Treat DNS_MASTER_CHECKNS matches as fatal.

Definition at line 48 of file master.h.

Referenced by check_ns(), get_master_options(), and load_text().

#define DNS_MASTER_CHECKNAMES   0x00000100

Definition at line 52 of file master.h.

Referenced by get_master_options(), and load_text().

#define DNS_MASTER_CHECKNAMESFAIL   0x00000200

Definition at line 53 of file master.h.

Referenced by get_master_options(), and load_text().

#define DNS_MASTER_CHECKWILDCARD   0x00000400

Definition at line 54 of file master.h.

Referenced by get_master_options(), and load_text().

#define DNS_MASTER_CHECKMX   0x00000800

Definition at line 55 of file master.h.

Referenced by get_master_options(), and load_text().

#define DNS_MASTER_CHECKMXFAIL   0x00001000

Definition at line 56 of file master.h.

Referenced by get_master_options(), and load_text().

#define DNS_MASTER_RESIGN   0x00002000

Definition at line 58 of file master.h.

Referenced by commit(), and get_master_options().

#define DNS_MASTER_KEY   0x00004000

Loading a key zone master file.

Definition at line 59 of file master.h.

Referenced by generate(), get_master_options(), and load_text().

#define DNS_MASTER_NOTTL   0x00008000

Don't require ttl.

Definition at line 60 of file master.h.

Referenced by loadctx_create(), and loadset().

#define DNS_MASTER_CHECKTTL   0x00010000

Check max-zone-ttl.

Definition at line 61 of file master.h.

Referenced by dns_master_loadfileinc4(), get_master_options(), load_raw(), and load_text().

#define DNS_RAWFORMAT_VERSION   1

Definition at line 71 of file master.h.

Referenced by dns_zone_dumptostream2(), and load_header().

#define DNS_MASTERRAW_COMPAT   0x01

Definition at line 76 of file master.h.

Referenced by dumptostream(), main(), and writeheader().

#define DNS_MASTERRAW_SOURCESERIALSET   0x02

Definition at line 77 of file master.h.

Referenced by ATF_TC_BODY(), dumptostream(), get_raw_serial(), main(), and zone_setrawdata().

#define DNS_MASTERRAW_LASTXFRINSET   0x04

Definition at line 78 of file master.h.


Typedef Documentation

typedef void(* dns_masterincludecb_t)(const char *file, void *arg)

Definition at line 115 of file master.h.


Function Documentation

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 
)

Definition at line 2578 of file master.c.

References dns_master_loadfile5().

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_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_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_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_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 **  ctxp,
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 **  ctxp,
isc_mem_t mctx,
dns_masterformat_t  format 
)

Definition at line 2649 of file master.c.

References dns_master_loadfileinc4().

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 **  ctxp,
isc_mem_t mctx,
dns_masterformat_t  format 
)

Definition at line 2663 of file master.c.

References dns_master_loadfileinc4().

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 **  ctxp,
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 **  ctxp,
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_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 **  ctxp,
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_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 **  ctxp,
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_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:

Returns:

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().

void dns_loadctx_detach ( dns_loadctx_t **  ctxp  ) 

Detach from the load context.

Requires:

Ensures:

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().

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_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().


Generated on Tue Apr 28 17:41:09 2015 by Doxygen 1.5.4 for BIND9 Internals 9.11.0pre-alpha