2
* Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
2
* Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
3
3
* Copyright (C) 1999-2002 Internet Software Consortium.
5
* Permission to use, copy, modify, and distribute this software for any
5
* Permission to use, copy, modify, and/or distribute this software for any
6
6
* purpose with or without fee is hereby granted, provided that the above
7
7
* copyright notice and this permission notice appear in all copies.
49
/* Omit the owner name when possible. */
51
/*% Omit the owner name when possible. */
50
52
#define DNS_STYLEFLAG_OMIT_OWNER 0x00010000U
53
55
* Omit the TTL when possible. If DNS_STYLEFLAG_TTL is
54
56
* also set, this means no TTLs are ever printed
55
57
* because $TTL directives are generated before every
68
70
#define DNS_STYLEFLAG_OMIT_TTL 0x00020000U
70
/* Omit the class when possible. */
72
/*% Omit the class when possible. */
71
73
#define DNS_STYLEFLAG_OMIT_CLASS 0x00040000U
73
/* Output $TTL directives. */
75
/*% Output $TTL directives. */
74
76
#define DNS_STYLEFLAG_TTL 0x00080000U
77
79
* Output $ORIGIN directives and print owner names relative to
78
80
* the origin when possible.
80
82
#define DNS_STYLEFLAG_REL_OWNER 0x00100000U
82
/* Print domain names in RR data in relative form when possible.
84
/*% Print domain names in RR data in relative form when possible.
83
85
For this to take effect, DNS_STYLEFLAG_REL_OWNER must also be set. */
84
86
#define DNS_STYLEFLAG_REL_DATA 0x00200000U
86
/* Print the trust level of each rdataset. */
88
/*% Print the trust level of each rdataset. */
87
89
#define DNS_STYLEFLAG_TRUST 0x00400000U
89
/* Print negative caching entries. */
91
/*% Print negative caching entries. */
90
92
#define DNS_STYLEFLAG_NCACHE 0x00800000U
92
/* Never print the TTL */
94
/*% Never print the TTL */
93
95
#define DNS_STYLEFLAG_NO_TTL 0x01000000U
95
/* Never print the CLASS */
97
/*% Never print the CLASS */
96
98
#define DNS_STYLEFLAG_NO_CLASS 0x02000000U
98
100
ISC_LANG_BEGINDECLS
111
113
LIBDNS_EXTERNAL_DATA extern const dns_master_style_t dns_master_style_default;
114
116
* A master file style that dumps zones to a very generic format easily
115
117
* imported/checked with external tools.
117
119
LIBDNS_EXTERNAL_DATA extern const dns_master_style_t dns_master_style_full;
120
122
* A master file style that prints explicit TTL values on each
121
123
* record line, never using $TTL statements. The TTL has a tab
122
124
* stop of its own, but the class and type share one.
124
126
LIBDNS_EXTERNAL_DATA extern const dns_master_style_t
125
127
dns_master_style_explicitttl;
128
130
* A master style format designed for cache files. It prints explicit TTL
129
131
* values on each record line and never uses $ORIGIN or relative names.
131
133
LIBDNS_EXTERNAL_DATA extern const dns_master_style_t dns_master_style_cache;
134
136
* A master style that prints name, ttl, class, type, and value on
135
137
* every line. Similar to explicitttl above, but more verbose.
136
138
* Intended for generating master files which can be easily parsed
151
153
dns_dumpctx_attach(dns_dumpctx_t *source, dns_dumpctx_t **target);
153
155
* Attach to a dump context.
156
* 'source' to be valid.
157
* 'target' to be non NULL and '*target' to be NULL.
158
*\li 'source' to be valid.
159
*\li 'target' to be non NULL and '*target' to be NULL.
161
163
dns_dumpctx_detach(dns_dumpctx_t **dctxp);
163
165
* Detach from a dump context.
166
* 'dctxp' to point to a valid dump context.
168
*\li 'dctxp' to point to a valid dump context.
171
*\li '*dctxp' is NULL.
173
175
dns_dumpctx_cancel(dns_dumpctx_t *dctx);
175
177
* Cancel a in progress dump.
178
* 'dctx' to be valid.
180
*\li 'dctx' to be valid.
181
183
dns_dbversion_t *
182
184
dns_dumpctx_version(dns_dumpctx_t *dctx);
184
186
* Return the version handle (if any) of the database being dumped.
187
* 'dctx' to be valid.
189
*\li 'dctx' to be valid.
191
193
dns_dumpctx_db(dns_dumpctx_t *dctx);
193
195
* Return the database being dumped.
196
* 'dctx' to be valid.
198
*\li 'dctx' to be valid.
201
204
dns_master_dumptostreaminc(isc_mem_t *mctx, dns_db_t *db,
202
205
dns_dbversion_t *version,
208
211
dns_master_dumptostream(isc_mem_t *mctx, dns_db_t *db,
209
212
dns_dbversion_t *version,
210
213
const dns_master_style_t *style, FILE *f);
212
* Dump the database 'db' to the steam 'f' in RFC1035 master
213
* file format, in the style defined by 'style'
214
* (e.g., &dns_default_master_style_default)
216
dns_master_dumptostream2(isc_mem_t *mctx, dns_db_t *db,
217
dns_dbversion_t *version,
218
const dns_master_style_t *style,
219
dns_masterformat_t format, FILE *f);
221
* Dump the database 'db' to the steam 'f' in the specified format by
222
* 'format'. If the format is dns_masterformat_text (the RFC1035 format),
223
* 'style' specifies the file style (e.g., &dns_master_style_default).
225
* dns_master_dumptostream() is an old form of dns_master_dumptostream2(),
226
* which always specifies the dns_masterformat_text format.
216
228
* Temporary dynamic memory may be allocated from 'mctx'.
219
* 'task' to be valid.
220
* 'done' to be non NULL.
221
* 'dctxp' to be non NULL && '*dctxp' to be NULL.
231
*\li 'task' to be valid.
232
*\li 'done' to be non NULL.
233
*\li 'dctxp' to be non NULL && '*dctxp' to be NULL.
225
* DNS_R_CONTINUE dns_master_dumptostreaminc() only.
227
* Any database or rrset iterator error.
228
* Any dns_rdata_totext() error code.
237
*\li ISC_R_CONTINUE dns_master_dumptostreaminc() only.
239
*\li Any database or rrset iterator error.
240
*\li Any dns_rdata_totext() error code.
232
246
dns_master_dumpinc(isc_mem_t *mctx, dns_db_t *db, dns_dbversion_t *version,
233
247
const dns_master_style_t *style, const char *filename,
235
249
dns_dumpctx_t **dctxp);
252
dns_master_dumpinc2(isc_mem_t *mctx, dns_db_t *db, dns_dbversion_t *version,
253
const dns_master_style_t *style, const char *filename,
254
isc_task_t *task, dns_dumpdonefunc_t done, void *done_arg, dns_dumpctx_t **dctxp, dns_masterformat_t format);
238
257
dns_master_dump(isc_mem_t *mctx, dns_db_t *db,
239
258
dns_dbversion_t *version,
240
259
const dns_master_style_t *style, const char *filename);
242
* Dump the database 'db' to the file 'filename' in RFC1035 master
243
* file format, in the style defined by 'style'
244
* (e.g., &dns_default_master_style_default)
262
dns_master_dump2(isc_mem_t *mctx, dns_db_t *db,
263
dns_dbversion_t *version,
264
const dns_master_style_t *style, const char *filename,
265
dns_masterformat_t format);
268
* Dump the database 'db' to the file 'filename' in the specified format by
269
* 'format'. If the format is dns_masterformat_text (the RFC1035 format),
270
* 'style' specifies the file style (e.g., &dns_master_style_default).
272
* dns_master_dumpinc() and dns_master_dump() are old forms of _dumpinc2()
273
* and _dump2(), respectively, which always specify the dns_masterformat_text
246
276
* Temporary dynamic memory may be allocated from 'mctx'.
250
* DNS_R_CONTINUE dns_master_dumpinc() only.
252
* Any database or rrset iterator error.
253
* Any dns_rdata_totext() error code.
280
*\li ISC_R_CONTINUE dns_master_dumpinc() only.
282
*\li Any database or rrset iterator error.
283
*\li Any dns_rdata_totext() error code.
257
288
dns_master_rdatasettotext(dns_name_t *owner_name,
258
289
dns_rdataset_t *rdataset,
259
290
const dns_master_style_t *style,
260
291
isc_buffer_t *target);
262
293
* Convert 'rdataset' to text format, storing the result in 'target'.
265
* The rdata cursor position will be changed.
296
*\li The rdata cursor position will be changed.
268
* 'rdataset' is a valid non-question rdataset.
299
*\li 'rdataset' is a valid non-question rdataset.
270
* 'rdataset' is not empty.
301
*\li 'rdataset' is not empty.