mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-30 14:07:59 +00:00
allow db_type to be specified
This commit is contained in:
@@ -88,15 +88,20 @@ main(int argc, char *argv[]) {
|
|||||||
dns_rdataset_t rdataset;
|
dns_rdataset_t rdataset;
|
||||||
isc_region_t r;
|
isc_region_t r;
|
||||||
char basetext[1000];
|
char basetext[1000];
|
||||||
|
char dbtype[128];
|
||||||
int ch;
|
int ch;
|
||||||
dns_rdatatype_t type = 2;
|
dns_rdatatype_t type = 2;
|
||||||
|
|
||||||
strcpy(basetext, "");
|
strcpy(basetext, "");
|
||||||
while ((ch = getopt(argc, argv, "z:t:")) != -1) {
|
strcpy(dbtype, "rbt");
|
||||||
|
while ((ch = getopt(argc, argv, "z:d:t:")) != -1) {
|
||||||
switch (ch) {
|
switch (ch) {
|
||||||
case 'z':
|
case 'z':
|
||||||
strcpy(basetext, optarg);
|
strcpy(basetext, optarg);
|
||||||
break;
|
break;
|
||||||
|
case 'd':
|
||||||
|
strcpy(dbtype, optarg);
|
||||||
|
break;
|
||||||
case 't':
|
case 't':
|
||||||
type = atoi(optarg);
|
type = atoi(optarg);
|
||||||
break;
|
break;
|
||||||
@@ -118,9 +123,13 @@ main(int argc, char *argv[]) {
|
|||||||
makename(mctx, basetext, &base, NULL);
|
makename(mctx, basetext, &base, NULL);
|
||||||
|
|
||||||
db = NULL;
|
db = NULL;
|
||||||
result = dns_db_create(mctx, "rbt", &base, ISC_FALSE, 1, 0, NULL,
|
result = dns_db_create(mctx, dbtype, &base, ISC_FALSE, 1, 0, NULL,
|
||||||
&db);
|
&db);
|
||||||
RUNTIME_CHECK(result == DNS_R_SUCCESS);
|
if (result != DNS_R_SUCCESS) {
|
||||||
|
printf("dns_db_create(), DB type '%s', failed: %s\n",
|
||||||
|
dbtype, dns_result_totext(result));
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
origin = &base;
|
origin = &base;
|
||||||
printf("loading %s\n", argv[0]);
|
printf("loading %s\n", argv[0]);
|
||||||
|
Reference in New Issue
Block a user