builtin.c revision 0e84be2c52c405bcfb4eb57f094de4f48ad19524
/*
* Copyright (C) 2001 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.
*/
/* $Id: builtin.c,v 1.2 2002/01/25 03:12:07 marka Exp $ */
/*
* The built-in "version", "hostname", and "authors" databases.
*/
#include <config.h>
#include <string.h>
#include <stdio.h>
/*
* We can't use function pointers as the db_data directly
* because ANSI C does not guarantee that function pointers
* can safely be cast to void pointers and back.
*/
struct builtin {
};
static dns_sdbimplementation_t *builtin_impl;
static isc_result_t
{
else
return (ISC_R_NOTFOUND);
}
static isc_result_t
unsigned char buf[256];
if (len > 255)
}
static isc_result_t
if (ns_g_server->version_set) {
return (ISC_R_SUCCESS);
else
} else {
}
}
static isc_result_t
if (ns_g_server->hostname_set) {
return (ISC_R_SUCCESS);
else
} else {
char buf[256];
if (result != ISC_R_SUCCESS)
return (result);
}
}
static isc_result_t
const char **p;
static const char *authors[] = {
"Mark Andrews",
"James Brister",
"Ben Cottrell",
"Michael Graff",
"Andreas Gustafsson",
"Bob Halley",
"David Lawrence",
"Danny Mayer",
"Damien Neil",
"Matt Nelson",
"Michael Sawyer",
"Brian Wellington",
};
/*
* If a version string is specified, disable the authors.bind zone.
*/
if (ns_g_server->version_set)
return (ISC_R_SUCCESS);
if (result != ISC_R_SUCCESS)
return (result);
}
return (ISC_R_SUCCESS);
}
static isc_result_t
if (result != ISC_R_SUCCESS)
return (ISC_R_FAILURE);
if (result != ISC_R_SUCCESS)
return (ISC_R_FAILURE);
return (ISC_R_SUCCESS);
}
static isc_result_t
void *driverdata, void **dbdata)
{
if (argc != 1)
return (DNS_R_SYNTAX);
*dbdata = &version_builtin;
*dbdata = &hostname_builtin;
*dbdata = &authors_builtin;
else
return (ISC_R_NOTIMPLEMENTED);
return (ISC_R_SUCCESS);
}
static dns_sdbmethods_t builtin_methods = {
NULL, /* allnodes */
NULL /* destroy */
};
ns_builtin_init(void) {
== ISC_R_SUCCESS);
return (ISC_R_SUCCESS);
}
void
ns_builtin_deinit(void) {
}