builtin.c File Reference

The built-in "version", "hostname", "id", "authors" and "empty" databases. More...

#include <config.h>
#include <string.h>
#include <stdio.h>
#include <isc/mem.h>
#include <isc/print.h>
#include <isc/result.h>
#include <isc/util.h>
#include <dns/result.h>
#include <dns/sdb.h>
#include <named/builtin.h>
#include <named/globals.h>
#include <named/server.h>
#include <named/os.h>

Go to the source code of this file.

Data Structures

struct  builtin

Defines

#define ZLEN(x)   (10 + (x)/2)

Typedefs

typedef struct builtin builtin_t

Functions

static isc_result_t do_version_lookup (dns_sdblookup_t *lookup)
static isc_result_t do_hostname_lookup (dns_sdblookup_t *lookup)
static isc_result_t do_authors_lookup (dns_sdblookup_t *lookup)
static isc_result_t do_id_lookup (dns_sdblookup_t *lookup)
static isc_result_t do_empty_lookup (dns_sdblookup_t *lookup)
static isc_result_t do_dns64_lookup (dns_sdblookup_t *lookup)
static size_t dns64_rdata (unsigned char *v, size_t start, unsigned char *rdata)
static isc_result_t dns64_cname (const dns_name_t *zone, const dns_name_t *name, dns_sdblookup_t *lookup)
static isc_result_t builtin_lookup (const char *zone, const char *name, void *dbdata, dns_sdblookup_t *lookup, dns_clientinfomethods_t *methods, dns_clientinfo_t *clientinfo)
static isc_result_t dns64_lookup (const dns_name_t *zone, const dns_name_t *name, void *dbdata, dns_sdblookup_t *lookup, dns_clientinfomethods_t *methods, dns_clientinfo_t *clientinfo)
static isc_result_t put_txt (dns_sdblookup_t *lookup, const char *text)
static isc_result_t builtin_authority (const char *zone, void *dbdata, dns_sdblookup_t *lookup)
static isc_result_t builtin_create (const char *zone, int argc, char **argv, void *driverdata, void **dbdata)
static void builtin_destroy (const char *zone, void *driverdata, void **dbdata)
isc_result_t ns_builtin_init (void)
void ns_builtin_deinit (void)

Variables

static builtin_t version_builtin = { do_version_lookup, NULL, NULL }
static builtin_t hostname_builtin = { do_hostname_lookup, NULL, NULL }
static builtin_t authors_builtin = { do_authors_lookup, NULL, NULL }
static builtin_t id_builtin = { do_id_lookup, NULL, NULL }
static builtin_t empty_builtin = { do_empty_lookup, NULL, NULL }
static builtin_t dns64_builtin = { do_dns64_lookup, NULL, NULL }
static dns_sdbimplementation_tbuiltin_impl
static dns_sdbimplementation_tdns64_impl
static const unsigned char hex16 [256]
const unsigned char decimal [] = "0123456789"
static dns_sdbmethods_t builtin_methods
static dns_sdbmethods_t dns64_methods


Detailed Description

The built-in "version", "hostname", "id", "authors" and "empty" databases.

Definition in file builtin.c.


Define Documentation

#define ZLEN (  )     (10 + (x)/2)

Referenced by dns64_cname().


Typedef Documentation

typedef struct builtin builtin_t

Definition at line 43 of file builtin.c.


Function Documentation

static isc_result_t do_version_lookup ( dns_sdblookup_t lookup  )  [static]

Definition at line 328 of file builtin.c.

References ISC_R_SUCCESS, and put_txt().

static isc_result_t do_hostname_lookup ( dns_sdblookup_t lookup  )  [static]

Definition at line 340 of file builtin.c.

References ISC_R_SUCCESS, ns_os_gethostname(), and put_txt().

static isc_result_t do_authors_lookup ( dns_sdblookup_t lookup  )  [static]

Definition at line 356 of file builtin.c.

References ISC_R_SUCCESS, and put_txt().

static isc_result_t do_id_lookup ( dns_sdblookup_t lookup  )  [static]

Definition at line 397 of file builtin.c.

References ISC_R_SUCCESS, ns_os_gethostname(), and put_txt().

static isc_result_t do_empty_lookup ( dns_sdblookup_t lookup  )  [static]

Definition at line 420 of file builtin.c.

References ISC_R_SUCCESS, and UNUSED.

static isc_result_t do_dns64_lookup ( dns_sdblookup_t lookup  )  [static]

Definition at line 414 of file builtin.c.

References ISC_R_SUCCESS, and UNUSED.

static size_t dns64_rdata ( unsigned char *  v,
size_t  start,
unsigned char *  rdata 
) [static]

Definition at line 99 of file builtin.c.

References decimal.

Referenced by dns64_cname(), and query_dns64().

static isc_result_t dns64_cname ( const dns_name_t zone,
const dns_name_t name,
dns_sdblookup_t lookup 
) [static]

Definition at line 125 of file builtin.c.

References dns64_rdata(), dns_sdb_putrdata(), hex16, INSIST, ISC_R_NOTFOUND, ISC_R_SUCCESS, dns_name::length, dns_name::ndata, and ZLEN.

Referenced by dns64_lookup().

static isc_result_t builtin_lookup ( const char *  zone,
const char *  name,
void *  dbdata,
dns_sdblookup_t lookup,
dns_clientinfomethods_t methods,
dns_clientinfo_t clientinfo 
) [static]

Definition at line 284 of file builtin.c.

References builtin::do_lookup, ISC_R_NOTFOUND, and UNUSED.

static isc_result_t dns64_lookup ( const dns_name_t zone,
const dns_name_t name,
void *  dbdata,
dns_sdblookup_t lookup,
dns_clientinfomethods_t methods,
dns_clientinfo_t clientinfo 
) [static]

Definition at line 301 of file builtin.c.

References dns64_cname(), builtin::do_lookup, dns_name::labels, dns_name::length, and UNUSED.

static isc_result_t put_txt ( dns_sdblookup_t lookup,
const char *  text 
) [static]

Definition at line 317 of file builtin.c.

References dns_sdb_putrdata().

Referenced by do_authors_lookup(), do_hostname_lookup(), do_id_lookup(), and do_version_lookup().

static isc_result_t builtin_authority ( const char *  zone,
void *  dbdata,
dns_sdblookup_t lookup 
) [static]

Definition at line 427 of file builtin.c.

References builtin::contact, dns_sdb_putrr(), dns_sdb_putsoa(), ISC_R_FAILURE, ISC_R_SUCCESS, builtin::server, and UNUSED.

static isc_result_t builtin_create ( const char *  zone,
int  argc,
char **  argv,
void *  driverdata,
void **  dbdata 
) [static]

Definition at line 458 of file builtin.c.

References builtin::contact, DNS_R_SYNTAX, isc_mem_free, isc_mem_get, isc_mem_put, isc_mem_strdup, ISC_R_NOTIMPLEMENTED, ISC_R_SUCCESS, REQUIRE, builtin::server, and UNUSED.

static void builtin_destroy ( const char *  zone,
void *  driverdata,
void **  dbdata 
) [static]

Definition at line 520 of file builtin.c.

References builtin::contact, isc_mem_free, isc_mem_put, builtin::server, and UNUSED.

isc_result_t ns_builtin_init ( void   ) 

Definition at line 558 of file builtin.c.

References dns_sdb_register(), DNS_SDBFLAG_DNS64, DNS_SDBFLAG_RELATIVEOWNER, DNS_SDBFLAG_RELATIVERDATA, ISC_R_SUCCESS, and RUNTIME_CHECK.

Referenced by setup().

void ns_builtin_deinit ( void   ) 

Definition at line 574 of file builtin.c.

References dns_sdb_unregister().

Referenced by cleanup().


Variable Documentation

builtin_t version_builtin = { do_version_lookup, NULL, NULL } [static]

Definition at line 64 of file builtin.c.

builtin_t hostname_builtin = { do_hostname_lookup, NULL, NULL } [static]

Definition at line 65 of file builtin.c.

builtin_t authors_builtin = { do_authors_lookup, NULL, NULL } [static]

Definition at line 66 of file builtin.c.

builtin_t id_builtin = { do_id_lookup, NULL, NULL } [static]

Definition at line 67 of file builtin.c.

builtin_t empty_builtin = { do_empty_lookup, NULL, NULL } [static]

Definition at line 68 of file builtin.c.

builtin_t dns64_builtin = { do_dns64_lookup, NULL, NULL } [static]

Definition at line 69 of file builtin.c.

dns_sdbimplementation_t* builtin_impl [static]

Definition at line 71 of file builtin.c.

dns_sdbimplementation_t* dns64_impl [static]

Definition at line 72 of file builtin.c.

const unsigned char hex16[256] [static]

Initial value:

 {
         1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1, 
         1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1, 
         1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1, 
         0, 16, 32, 48, 64, 80, 96,112,128,144,  1,  1,  1,  1,  1,  1, 
         1,160,176,192,208,224,240,  1,  1,  1,  1,  1,  1,  1,  1,  1, 
         1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1, 
         1,160,176,192,208,224,240,  1,  1,  1,  1,  1,  1,  1,  1,  1, 
         1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1, 
         1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1, 
         1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1, 
         1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1, 
         1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1, 
         1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1, 
         1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1, 
         1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1, 
         1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1  
}

Definition at line 77 of file builtin.c.

Referenced by dns64_cname().

const unsigned char decimal[] = "0123456789"

Definition at line 96 of file builtin.c.

Referenced by dns64_rdata().

dns_sdbmethods_t builtin_methods [static]

Initial value:

Definition at line 539 of file builtin.c.

dns_sdbmethods_t dns64_methods [static]

Initial value:

Definition at line 548 of file builtin.c.


Generated on Tue Apr 28 17:41:06 2015 by Doxygen 1.5.4 for BIND9 Internals 9.11.0pre-alpha