dirdb.c revision dafcb997e390efa4423883dafd100c975c4095d6
/*
* Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2000, 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 ISC DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS. IN NO EVENT SHALL ISC 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: dirdb.c,v 1.10 2004/03/05 05:04:30 marka Exp $ */
/*
* A simple database driver that returns basic information about
* files and directories in the Unix file system as DNS data.
*/
#include <config.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <sys/sysmacros.h>
#include "dirdb.h"
} while (0)
do { n = (op); \
if (n < 0) return (ISC_R_FAILURE); \
} while (0)
/*
* This database operates on relative names.
*
* Any name will be interpreted as a pathname offset from the directory
* specified in the configuration file.
*/
static isc_result_t
{
char filename[255];
char filename2[255];
char buf[1024];
int n;
else
"\"%sdev\" \"major %d\" \"minor %d\"",
buf[n] = 0;
filename2));
else {
}
return (ISC_R_SUCCESS);
}
/*
* lookup () does not return SOA or NS records, so authority() must be defined.
*/
static isc_result_t
return (ISC_R_SUCCESS);
}
/*
* Each database stores the top-level directory as the dbdata opaque
* object. The create() function allocates it. argv[0] holds the top
* level directory.
*/
static isc_result_t
void *driverdata, void **dbdata)
{
if (argc < 1)
return (ISC_R_FAILURE);
return (ISC_R_NOMEMORY);
return (ISC_R_SUCCESS);
}
/*
* The destroy() function frees the memory allocated by create().
*/
static void
}
/*
* This zone does not support zone transfer, so allnodes() is NULL.
*/
static dns_sdbmethods_t dirdb_methods = {
NULL, /* allnodes */
};
/*
* Wrapper around dns_sdb_register(). Note that the first ns_g_mctx is
* being passed as the "driverdata" parameter, so that will it will be
* passed to create() and destroy().
*/
dirdb_init(void) {
unsigned int flags;
}
/*
* Wrapper around dns_sdb_unregister().
*/
void
dirdb_clear(void) {
}