eliminate temporary zone/cache loading scheme

This commit is contained in:
Bob Halley
1999-10-15 01:48:29 +00:00
parent e7dbdb2547
commit ba88ba8a3f
2 changed files with 1 additions and 88 deletions

View File

@@ -26,27 +26,4 @@ typedef struct ns_client ns_client_t;
typedef struct ns_clientmgr ns_clientmgr_t;
typedef struct ns_query ns_query_t;
/*
* XXXRTH This stuff is temporary. As soon as we have zone and config
* support, it will go away.
*/
typedef struct ns_dbinfo {
char * path;
char * origin;
char * master; /* Dotted quad, or NULL */
isc_boolean_t iscache;
isc_boolean_t isslave;
dns_view_t * view;
dns_zone_t * zone;
dns_db_t * db;
ISC_LINK(struct ns_dbinfo) link;
} ns_dbinfo_t;
typedef ISC_LIST(ns_dbinfo_t) ns_dbinfolist_t;
/*
* XXXRTH End of temporary stuff.
*/
#endif /* NS_TYPES_H */

View File

@@ -115,34 +115,13 @@ usage(void) {
static void
parse_command_line(int argc, char *argv[]) {
char *argtext, *mastertext, *origintext;
int ch;
ns_dbinfo_t *dbi;
while ((ch = isc_commandline_parse(argc, argv, "b:c:N:p:sz:")) != -1) {
switch (ch) {
case 'b':
ns_g_conffile = isc_commandline_argument;
break;
case 'c':
/* XXXRTH temporary syntax */
dbi = isc_mem_get(ns_g_mctx, sizeof *dbi);
if (dbi == NULL)
early_fatal("creating cache info failed");
dbi->path = isc_mem_strdup(ns_g_mctx,
isc_commandline_argument);
if (dbi->path == NULL)
early_fatal("out of memory");
dbi->origin = isc_mem_strdup(ns_g_mctx, ".");
if (dbi->origin == NULL)
early_fatal("out of memory");
dbi->master = NULL;
dbi->iscache = ISC_TRUE;
dbi->isslave = ISC_FALSE;
dbi->view = NULL;
dbi->db = NULL;
ISC_LINK_INIT(dbi, link);
ISC_LIST_APPEND(ns_g_dbs, dbi, link);
ns_g_conffile = isc_commandline_argument;
break;
case 'N':
ns_g_cpus = atoi(isc_commandline_argument);
@@ -156,49 +135,6 @@ parse_command_line(int argc, char *argv[]) {
/* XXXRTH temporary syntax */
want_stats = ISC_TRUE;
break;
case 'z':
/* XXXRTH temporary syntax */
dbi = isc_mem_get(ns_g_mctx, sizeof *dbi);
if (dbi == NULL)
early_fatal("creating zone info failed");
argtext = isc_mem_strdup(ns_g_mctx,
isc_commandline_argument);
if (argtext == NULL)
early_fatal("out of memory");
mastertext = strrchr(argtext, '@');
if (mastertext == NULL) {
dbi->master = NULL;
dbi->isslave = ISC_FALSE;
} else {
*mastertext++ = '\0';
dbi->master = isc_mem_strdup(ns_g_mctx,
mastertext);
if (dbi->master == NULL)
early_fatal("out of memory");
RUNTIME_CHECK(dbi->master != NULL);
dbi->isslave = ISC_TRUE;
}
origintext = strrchr(argtext, '/');
if (origintext == NULL)
origintext = argtext;
else
origintext++; /* Skip '/'. */
dbi->path = isc_mem_strdup(ns_g_mctx, argtext);
if (dbi->path == NULL)
early_fatal("out of memory");
dbi->origin = isc_mem_strdup(ns_g_mctx, origintext);
if (dbi->origin == NULL)
early_fatal("out of memory");
dbi->view = NULL;
dbi->db = NULL;
dbi->iscache = ISC_FALSE;
isc_mem_free(ns_g_mctx, argtext);
ISC_LINK_INIT(dbi, link);
ISC_LIST_APPEND(ns_g_dbs, dbi, link);
break;
case '?':
usage();
early_fatal("unknown command line argument");