timedb.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: timedb.c,v 1.12 2011/10/11 23:46:45 tbox Exp $ */
/*
* A simple database driver that enables the server to return the
* current time in a DNS record.
*/
#include <config.h>
#include <string.h>
#include <stdio.h>
#include <time.h>
#include "timedb.h"
/*
* This database operates on relative names.
*
* "time" and "@" return the time in a TXT record.
* "clock" is a CNAME to "time"
* "current" is a DNAME to "@" (try time.current.time)
*/
#ifdef DNS_CLIENTINFO_VERSION
static isc_result_t
#else
static isc_result_t
#endif /* DNS_CLIENTINFO_VERSION */
{
#ifdef DNS_CLIENTINFO_VERSION
#endif /* DNS_CLIENTINFO_VERSION */
char buf[100];
int n;
/*
* Call ctime to create the string, put it in quotes, and
* remove the trailing newline.
*/
if (n < 0)
return (ISC_R_FAILURE);
if (result != ISC_R_SUCCESS)
return (ISC_R_FAILURE);
if (result != ISC_R_SUCCESS)
return (ISC_R_FAILURE);
if (result != ISC_R_SUCCESS)
return (ISC_R_FAILURE);
} else
return (ISC_R_NOTFOUND);
return (ISC_R_SUCCESS);
}
/*
* lookup() does not return SOA or NS records, so authority() must be defined.
*/
static isc_result_t
if (result != ISC_R_SUCCESS)
return (ISC_R_FAILURE);
if (result != ISC_R_SUCCESS)
return (ISC_R_FAILURE);
if (result != ISC_R_SUCCESS)
return (ISC_R_FAILURE);
return (ISC_R_SUCCESS);
}
/*
* This zone does not support zone transfer, so allnodes() is NULL. There
* is no database specific data, so create() and destroy() are NULL.
*/
static dns_sdbmethods_t timedb_methods = {
NULL, /* allnodes */
NULL, /* create */
NULL, /* destroy */
NULL /* lookup2 */
};
/*
* Wrapper around dns_sdb_register().
*/
timedb_init(void) {
unsigned int flags;
}
/*
* Wrapper around dns_sdb_unregister().
*/
void
timedb_clear(void) {
}