rdata.c revision 7c0378745269fe49a05904935afc42b85528f53a
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews * Copyright (C) 1998, 1999 Internet Software Consortium.
6c52944ef2281095d1c317a45ea013b8f3cfa135Mark Andrews * Permission to use, copy, modify, and distribute this software for any
/* $Id: rdata.c,v 1.63 1999/10/17 22:34:16 tale Exp $ */
#include <config.h>
#include <stdarg.h>
#include <stdio.h>
#define RETERR(x) do { \
return (__r); \
typedef struct dns_rdata_textctx {
unsigned int type);
unsigned int length);
static void default_fromtext_callback(
#include "code.h"
#define METATYPES \
#define EMPTYCLASSES \
#define METACLASSES \
#define RCODENAMES \
{ 0, NULL, 0 }
#define CERTNAMES \
{ 0, NULL, 0}
#define SECALGNAMES \
{ 0, NULL, 0}
#define SECPROTONAMES \
{ 0, NULL, 0}
static struct tbl {
unsigned int value;
char *name;
int flags;
static struct keyflag {
char *name;
unsigned int value;
unsigned int mask;
} keyflags[] = {
{ NULL, 0, 0 }
int result = 0;
if (use_default) {
return (result);
if (use_default)
(void)NULL;
return (result);
if (use_default) {
return (DNS_R_NOSPACE);
return (DNS_R_SUCCESS);
return (result);
char *name;
int line;
if (use_default)
(void)NULL;
switch (iresult) {
case ISC_R_NOMEMORY:
case ISC_R_NOSPACE:
return (result);
static dns_result_t
return (DNS_R_SUCCESS);
if (use_default)
(void)NULL;
return (result);
if (use_default)
(void)NULL;
return (result);
if (use_default)
(void)NULL;
return (result);
void *arg)
if (use_default)
(void)NULL;
return (result);
if (use_default)
(void)NULL;
return (result);
static dns_result_t
if (n > max)
return (DNS_R_RANGE);
*valuep = n;
return (DNS_R_SUCCESS);
return (DNS_R_SUCCESS);
return (DNS_R_UNKNOWN);
static dns_result_t
return (DNS_R_NOTIMPLEMENTED);
return (DNS_R_SUCCESS);
return (DNS_R_UNKNOWN);
return (DNS_R_NOTIMPLEMENTED);
return (DNS_R_SUCCESS);
return (DNS_R_UNKNOWN);
return (DNS_R_SUCCESS);
return (DNS_R_UNKNOWN);
unsigned int value;
return (DNS_R_SUCCESS);
unsigned int value;
return (DNS_R_SUCCESS);
unsigned int value;
return (DNS_R_SUCCESS);
return (DNS_R_RANGE);
*flagsp = n;
return (DNS_R_SUCCESS);
struct keyflag *p;
unsigned int len;
return (DNS_R_UNKNOWN);
#ifdef notyet
return (DNS_R_SUCCESS);
static dns_result_t
unsigned int tl;
unsigned char *sp;
char *tp;
n = *sp++;
return (DNS_R_NOSPACE);
tl--;
return (DNS_R_NOSPACE);
return (DNS_R_NOSPACE);
tl--;
return (DNS_R_NOSPACE);
tl--;
return (DNS_R_NOSPACE);
tl--;
return (DNS_R_SUCCESS);
static dns_result_t
unsigned int n, nrem;
return (DNS_R_NOSPACE);
nrem--;
return (DNS_R_SYNTAX);
return (DNS_R_SYNTAX);
return (DNS_R_SYNTAX);
return (DNS_R_SYNTAX);
return (DNS_R_SYNTAX);
if (nrem == 0)
return (DNS_R_NOSPACE);
nrem--;
if (escape)
return (DNS_R_SYNTAX);
return (DNS_R_SUCCESS);
static dns_result_t
return(DNS_R_UNEXPECTEDEND);
return (DNS_R_UNEXPECTEDEND);
return (DNS_R_NOSPACE);
return (DNS_R_SUCCESS);
static isc_boolean_t
goto return_false;
goto return_false;
goto return_false;
goto return_false;
return (ISC_TRUE);
return (ISC_FALSE);
static dns_result_t
return (DNS_R_NOSPACE);
return (DNS_R_SUCCESS);
static isc_boolean_t
unsigned int type) {
static dns_result_t
return (DNS_R_NOSPACE);
return (DNS_R_SUCCESS);
static dns_result_t
return (DNS_R_RANGE);
return (DNS_R_NOSPACE);
return (DNS_R_SUCCESS);
static dns_result_t
return (DNS_R_RANGE);
return (DNS_R_NOSPACE);
return (DNS_R_SUCCESS);
static isc_uint32_t
unsigned long value;
return(value);
static isc_uint16_t
static isc_uint8_t
static dns_result_t
switch (result) {
case ISC_R_SUCCESS:
case ISC_R_NOMEMORY:
return (DNS_R_NOMEMORY);
case ISC_R_NOSPACE:
return (DNS_R_NOSPACE);
return (DNS_R_UNEXPECTED);
return (DNS_R_SUCCESS);
return (DNS_R_SUCCESS);
return (DNS_R_UNEXPECTEDEND);
return (DNS_R_UNEXPECTEDTOKEN);
return (DNS_R_SUCCESS);
static dns_result_t
return (DNS_R_NOSPACE);
return (DNS_R_SUCCESS);
int result;
return (s - hexdigits);
return (s - decdigits);
struct state {
static dns_result_t
if (bcount != 0)
return(DNS_R_SYNTAX);
if (bcount == 0) {
++bcount;
++bcount;
word = 0;
bcount = 0;
return(DNS_R_SYNTAX);
return(DNS_R_SUCCESS);
static dns_result_t
Ceor ^= c;
Csum += c;
Crot += c;
return (DNS_R_NOSPACE);
return (DNS_R_SUCCESS);
static dns_result_t
return (DNS_R_SYNTAX);
return (DNS_R_SYNTAX);
return (DNS_R_SYNTAX);
return(DNS_R_BADCKSUM);
return(DNS_R_SUCCESS);
static dns_result_t
Ceor ^= c;
Csum += c;
Crot += c;
word |= c;
if (word == 0) {
return (DNS_R_NOSPACE);
register int tmp = 0;
if (tmpword < 0) {
if (tmpword < 0) {
return (DNS_R_NOSPACE);
+ tmp];
bcount = 0;
return (DNS_R_SUCCESS);
static dns_result_t
int inc;
while (bcount != 0)
case isc_tokentype_eol:
case isc_tokentype_eof:
case isc_tokentype_number:
case isc_tokentype_string:
case isc_tokentype_qstring:
static isc_boolean_t
struct tbl *t;