master_test.c revision 27ffc5a69779c3c7224580a89aa2bf0a3ff8c16d
c46bcd7c6908745e19b0b1fe18a23bbaaee553edBob Halley * Copyright (C) 1999 Internet Software Consortium.
c46bcd7c6908745e19b0b1fe18a23bbaaee553edBob Halley * Permission to use, copy, modify, and distribute this software for any
c46bcd7c6908745e19b0b1fe18a23bbaaee553edBob Halley * purpose with or without fee is hereby granted, provided that the above
c46bcd7c6908745e19b0b1fe18a23bbaaee553edBob Halley * copyright notice and this permission notice appear in all copies.
c46bcd7c6908745e19b0b1fe18a23bbaaee553edBob Halley * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
c46bcd7c6908745e19b0b1fe18a23bbaaee553edBob Halley * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
c46bcd7c6908745e19b0b1fe18a23bbaaee553edBob Halley * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
c46bcd7c6908745e19b0b1fe18a23bbaaee553edBob Halley * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
c46bcd7c6908745e19b0b1fe18a23bbaaee553edBob Halley * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
c46bcd7c6908745e19b0b1fe18a23bbaaee553edBob Halley * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
c46bcd7c6908745e19b0b1fe18a23bbaaee553edBob Halley * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
a01f52a731f03c9d61357ac872f3d228db56a0afBob Halleydns_result_t print_dataset(void *arg, dns_name_t *owner,
a01f52a731f03c9d61357ac872f3d228db56a0afBob Halleyprint_dataset(void *arg, dns_name_t *owner, dns_rdataset_t *dataset) {
3ff55a3111fe09f517218905248974b8319b2c59Mark Andrews isc_buffer_init(&target, buf, 64*1024, ISC_BUFFERTYPE_TEXT);
8d6024e7cffbd84fa8d06ce50c60307d7b3b49c2Michael Graff result = dns_rdataset_totext(dataset, owner, ISC_FALSE, ISC_FALSE,
3ff55a3111fe09f517218905248974b8319b2c59Mark Andrews RUNTIME_CHECK(isc_mem_create(0, 0, &mctx) == ISC_R_SUCCESS);
3ff55a3111fe09f517218905248974b8319b2c59Mark Andrews isc_buffer_init(&source, argv[1], strlen(argv[1]),
3ff55a3111fe09f517218905248974b8319b2c59Mark Andrews isc_buffer_setactive(&source, strlen(argv[1]));
3ff55a3111fe09f517218905248974b8319b2c59Mark Andrews isc_buffer_init(&target, name_buf, 255, ISC_BUFFERTYPE_BINARY);
3ff55a3111fe09f517218905248974b8319b2c59Mark Andrews result = dns_name_fromtext(&origin, &source, dns_rootname,
27ffc5a69779c3c7224580a89aa2bf0a3ff8c16dBob Halley result = dns_master_loadfile(argv[1], &origin, &origin, 1,
0c67279acb4a6ac356879498b220645755d77cc9Mark Andrews fprintf(stdout, "soacount = %d, nscount = %d\n",