dirdb.c revision 0c27b3fe77ac1d5094ba3521e8142d9e7973133f
/*
* Copyright (C) 2000, 2001, 2004, 2007, 2011, 2014, 2016 Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/* $Id: dirdb.c,v 1.14 2011/10/11 23:46:45 tbox 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.
*/
#ifdef DNS_CLIENTINFO_VERSION
static isc_result_t
#else
static isc_result_t
#endif /* DNS_CLIENTINFO_VERSION */
{
char filename[255];
char filename2[255];
char buf[1024];
int n;
#ifdef DNS_CLIENTINFO_VERSION
#endif /* DNS_CLIENTINFO_VERSION */
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 */
NULL /* lookup2 */
};
/*
* 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) {
}