server.c revision 5787fc1ed4f5b727b2e52beebca1460e8017219b
/*
* Copyright (C) 1999 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
* CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
* SOFTWARE.
*/
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <isc/assertions.h>
#include <dns/fixedname.h>
#include <dns/rdatalist.h>
#include <dns/rdataset.h>
#include <dns/rdatasetiter.h>
#include <dns/compress.h>
static isc_task_t * server_task;
static dns_db_t * version_db;
static dns_view_t * version_view;
static dns_result_t
/*
* XXXRTH View list code will move to its own module soon.
*/
break;
}
}
return (DNS_R_NOTFOUND);
NULL);
if (result != DNS_R_SUCCESS)
goto view_detach;
if (result != DNS_R_SUCCESS)
goto view_detach;
if (result != DNS_R_SUCCESS)
goto db_detach;
printf("loaded\n");
/*
* XXXRTH We must ensure that this is safe, since the
* field is not covered by the view's lock.
*
* We're OK for now, but we'll have to be careful
* when we start processing the config file.
*/
goto db_detach;
return (DNS_R_SUCCESS);
return (result);
}
static isc_result_t
load_version(void) {
char version_text[1024];
/*
* XXXRTH View list code will move to its own module soon.
*/
version_view = NULL;
break;
}
}
return (DNS_R_NOTFOUND);
NULL);
if (result != DNS_R_SUCCESS)
goto view_detach;
version_db = NULL;
if (result != DNS_R_SUCCESS)
goto view_detach;
if (result != DNS_R_SUCCESS)
return (result);
if (result == ISC_R_SUCCESS)
if (result != ISC_R_SUCCESS)
goto db_detach;
goto db_detach;
return (DNS_R_SUCCESS);
return (result);
}
static isc_result_t
load_all(void) {
result = load_version();
if (result != ISC_R_SUCCESS)
return (result);
if (result != ISC_R_SUCCESS)
break;
}
return (result);
}
static void
unload_all(void) {
}
}
if (version_view != NULL) {
}
}
static void
load_configuration(void) {
/*
* XXXRTH loading code below is temporary; it
* will be replaced by proper config file processing.
*/
if (result != ISC_R_SUCCESS) {
/* XXXRTH */
}
}
static void
(void)task;
printf("server running\n");
}
static void
(void)task;
printf("server shutting down\n");
unload_all();
}
}
ns_server_init(void) {
/*
* XXXRTH The view management code here will probably move to its
* own module when we start using the config file.
*/
if (result != ISC_R_SUCCESS)
goto cleanup_views;
if (result != ISC_R_SUCCESS)
goto cleanup_views;
if (result != ISC_R_SUCCESS)
goto cleanup_views;
if (result != ISC_R_SUCCESS)
goto cleanup_task;
if (result != ISC_R_SUCCESS)
goto cleanup_task;
return (ISC_R_SUCCESS);
}
return (result);
}