ssu.c revision 0c27b3fe77ac1d5094ba3521e8142d9e7973133f
/*
* Copyright (C) 2000, 2001, 2003-2008, 2010, 2011, 2013, 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/.
*/
/*! \file */
/*
* $Id: ssu.c,v 1.38 2011/01/06 23:47:00 tbox Exp $
* Principal Author: Brian Wellington
*/
#include <config.h>
#include <dns/fixedname.h>
struct dns_ssurule {
unsigned int magic;
unsigned int matchtype; /*%< which type of pattern match? */
unsigned int ntypes; /*%< number of data types covered */
/*%< defaults to all but SIG,SOA,NS if NULL */
};
struct dns_ssutable {
unsigned int magic;
unsigned int references;
};
return (ISC_R_NOMEMORY);
if (result != ISC_R_SUCCESS) {
return (result);
}
return (ISC_R_SUCCESS);
}
static inline void
}
}
}
}
void
source->references++;
}
void
if (--table->references == 0)
if (done)
}
{
if (matchtype == DNS_SSUMATCHTYPE_WILDCARD)
if (ntypes > 0)
return (ISC_R_NOMEMORY);
goto failure;
}
if (result != ISC_R_SUCCESS)
goto failure;
goto failure;
}
if (result != ISC_R_SUCCESS)
goto failure;
if (ntypes > 0) {
ntypes * sizeof(dns_rdatatype_t));
goto failure;
}
} else
return (ISC_R_SUCCESS);
}
}
ntypes * sizeof(dns_rdatatype_t));
return (result);
}
static inline isc_boolean_t
type != dns_rdatatype_soa &&
type != dns_rdatatype_rrsig));
}
static void
unsigned char *ap;
isc_buffer_t b;
unsigned long l;
case AF_INET:
"%lu.%lu.%lu.%lu.IN-ADDR.ARPA.",
(l >> 0) & 0xff, (l >> 8) & 0xff,
(l >> 16) & 0xff, (l >> 24) & 0xff);
break;
case AF_INET6:
"%x.%x.%x.%x.%x.%x.%x.%x."
"%x.%x.%x.%x.%x.%x.%x.%x."
"%x.%x.%x.%x.%x.%x.%x.%x."
"%x.%x.%x.%x.%x.%x.%x.%x."
"IP6.ARPA.",
break;
default:
INSIST(0);
}
}
static void
char buf[sizeof("X.X.X.X.Y.Y.Y.Y.2.0.0.2.IP6.ARPA.")];
unsigned char *ap;
isc_buffer_t b;
unsigned long l;
case AF_INET:
"%lx.%lx.%lx.%lx.%lx.%lx.%lx.%lx"
"2.0.0.2.IP6.ARPA.",
l & 0xf, (l >> 4) & 0xf,
(l >> 8) & 0xf, (l >> 12) & 0xf,
(l >> 16) & 0xf, (l >> 20) & 0xf,
(l >> 24) & 0xf, (l >> 28) & 0xf);
break;
case AF_INET6:
"%x.%x.%x.%x.%x.%x.%x.%x."
"%x.%x.%x.%x.IP6.ARPA.",
break;
default:
INSIST(0);
}
}
{
unsigned int i;
return (ISC_FALSE);
{
case DNS_SSUMATCHTYPE_NAME:
case DNS_SSUMATCHTYPE_SELF:
case DNS_SSUMATCHTYPE_SELFSUB:
continue;
continue;
} else {
continue;
}
break;
case DNS_SSUMATCHTYPE_SELFMS:
continue;
break;
case DNS_SSUMATCHTYPE_TCPSELF:
continue;
break;
}
case DNS_SSUMATCHTYPE_NAME:
continue;
break;
continue;
break;
continue;
break;
case DNS_SSUMATCHTYPE_SELF:
continue;
break;
case DNS_SSUMATCHTYPE_SELFSUB:
continue;
break;
if (result != ISC_R_SUCCESS)
continue;
continue;
break;
continue;
break;
case DNS_SSUMATCHTYPE_SELFMS:
continue;
break;
continue;
continue;
break;
continue;
continue;
break;
case DNS_SSUMATCHTYPE_TCPSELF:
continue;
} else {
continue;
}
continue;
break;
continue;
} else {
continue;
}
continue;
break;
continue;
break;
case DNS_SSUMATCHTYPE_DLZ:
continue;
break;
}
/*
* If this is a DLZ rule, then the DLZ ssu
* checks will have already checked
* the type.
*/
!isusertype(type))
continue;
} else {
break;
}
continue;
}
}
return (ISC_FALSE);
}
}
}
unsigned int
}
}
unsigned int
}
}
}
/*
* Create a specialised SSU table that points at an external DLZ database
*/
{
if (result != ISC_R_SUCCESS)
return (result);
return (ISC_R_NOMEMORY);
}
return (ISC_R_SUCCESS);
}