Commit f1c1aab2 authored by Mark Andrews's avatar Mark Andrews
Browse files

3457. [protocol] Add ILNP records (NID, LP, L32, L64). [RT #31836]

parent ef2aea27
3457. [protocol] Add ILNP records (NID, LP, L32, L64). [RT #31836]
3456. [port] g++47: aft fails to compile. [RT #32012]
3455. [contrib] queryperf: fix getopt option list. [RT #32338]
......
#!/bin/sh
#
# Copyright (C) 2005-2007, 2012 Internet Systems Consortium, Inc. ("ISC")
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
# $Id: clean.sh,v 1.6 2007/09/26 03:22:44 marka Exp $
#
# Clean up after tests.
#
rm -f dig.out.*
rm -f */named.memstats
rm -f */named.conf
rm -f */named.run
# this server runs named with only one worker thread
-m record,size,mctx -c named.conf -d 99 -g -T clienttest -n 1
\ No newline at end of file
/*
* Copyright (C) 2005-2007 Internet Systems Consortium, Inc. ("ISC")
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: named.conf,v 1.5 2007/06/19 23:47:06 tbox Exp $ */
options {
query-source address 10.53.0.1;
notify-source 10.53.0.1;
transfer-source 10.53.0.1;
recursion no;
additional-from-auth no;
port 5300;
pid-file "named.pid";
listen-on { 10.53.0.1; };
listen-on-v6 { none; };
notify no;
minimal-responses yes;
};
include "../../common/rndc.key";
controls {
inet 10.53.0.1 port 9953 allow { any; } keys { rndc_key; };
};
zone "rt.example" {
type master;
file "rt.db";
};
zone "naptr.example" {
type master;
file "naptr.db";
};
zone "rt2.example" {
type master;
file "rt2.db";
};
zone "naptr2.example" {
type master;
file "naptr2.db";
};
zone "nid.example" {
type master;
file "nid.db";
};
/*
* Copyright (C) 2005-2007 Internet Systems Consortium, Inc. ("ISC")
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: named.conf,v 1.5 2007/06/19 23:47:06 tbox Exp $ */
options {
query-source address 10.53.0.1;
notify-source 10.53.0.1;
transfer-source 10.53.0.1;
recursion no;
additional-from-auth no;
port 5300;
pid-file "named.pid";
listen-on { 10.53.0.1; };
listen-on-v6 { none; };
notify no;
minimal-responses no;
};
include "../../common/rndc.key";
controls {
inet 10.53.0.1 port 9953 allow { any; } keys { rndc_key; };
};
zone "rt.example" {
type master;
file "rt.db";
};
zone "naptr.example" {
type master;
file "naptr.db";
};
zone "rt2.example" {
type master;
file "rt2.db";
};
zone "naptr2.example" {
type master;
file "naptr2.db";
};
zone "nid.example" {
type master;
file "nid.db";
};
$TTL 86400
@ IN SOA ns1 hostmaster ( 2 8H 2H 4W 1D );
NS ns1
ns1 A 127.0.0.0
nap IN NAPTR 50 50 "S" "SIPS+D2T" "" server
server SRV 0 0 5061 server
server A 192.168.2.9
server AAAA 192::9
$TTL 86400
@ IN SOA ns1 hostmaster ( 2 8H 2H 4W 1D );
NS ns1
ns1 A 127.0.0.0
nap IN NAPTR 50 50 "S" "SIPS+D2T" "" server.hang3a.zone.
www AAAA 192::99
www A 192.168.2.99
www X25 100099
$TTL 86400
@ IN SOA ns1 hostmaster ( 2 8H 2H 4W 1D );
NS ns1
ns1 A 127.0.0.0
ns1 NID 2 0:0:0:0
ns1 L64 2 0:0:0:0
ns1 L32 2 0.0.0.0
nid2 NID 2 0:0:0:1
nid2 LP 2 ns1
$TTL 86400
@ IN SOA ns1 hostmaster ( 2 8H 2H 4W 1D );
NS ns1
ns1 A 127.0.0.0
rt RT 2 www
www AAAA 192::99
www A 192.168.2.99
www X25 100099
$TTL 86400
@ IN SOA ns1 hostmaster ( 2 8H 2H 4W 1D );
NS ns1
ns1 A 127.0.0.0
rt RT 2 www.hang3b.zone.
server SRV 0 0 5061 server
server A 192.168.2.9
server AAAA 192::9
#!/bin/sh
#
# Copyright (C) 2012 Internet Systems Consortium, Inc. ("ISC")
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
cp -f ns1/named1.conf ns1/named.conf
#!/bin/sh
#
# Copyright (C) 2005-2007, 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
# $Id: tests.sh,v 1.7 2011/11/06 23:46:40 tbox Exp $
SYSTEMTESTTOP=..
. $SYSTEMTESTTOP/conf.sh
status=0
n=0
dotests() {
n=`expr $n + 1`
echo "I:test with RT, single zone ($n)"
ret=0
$DIG -t RT rt.rt.example @10.53.0.1 -p 5300 > dig.out.$n || ret=1
if [ $ret -eq 1 ] ; then
echo "I: failed"; status=1
fi
n=`expr $n + 1`
echo "I:test with RT, two zones ($n)"
ret=0
$DIG -t RT rt.rt2.example @10.53.0.1 -p 5300 > dig.out.$n || ret=1
if [ $ret -eq 1 ] ; then
echo "I: failed"; status=1
fi
n=`expr $n + 1`
echo "I:test with NAPTR, single zone ($n)"
ret=0
$DIG -t NAPTR nap.naptr.example @10.53.0.1 -p 5300 > dig.out.$n || ret=1
if [ $ret -eq 1 ] ; then
echo "I: failed"; status=1
fi
n=`expr $n + 1`
echo "I:test with NAPTR, two zones ($n)"
ret=0
$DIG -t NAPTR nap.hang3b.example @10.53.0.1 -p 5300 > dig.out.$n || ret=1
if [ $ret -eq 1 ] ; then
echo "I: failed"; status=1
fi
n=`expr $n + 1`
echo "I:test with LP ($n)"
ret=0
$DIG -t LP nid2.nid.example @10.53.0.1 -p 5300 > dig.out.$n || ret=1
if [ $minimal = no ] ; then
grep "L64" dig.out.$n > /dev/null || ret=1
grep "L32" dig.out.$n > /dev/null || ret=1
else
grep "L64" dig.out.$n > /dev/null && ret=1
grep "L32" dig.out.$n > /dev/null && ret=1
fi
if [ $ret -eq 1 ] ; then
echo "I: failed"; status=1
fi
n=`expr $n + 1`
echo "I:test with NID ($n)"
ret=0
$DIG -t NID ns1.nid.example @10.53.0.1 -p 5300 > dig.out.$n || ret=1
if [ $minimal = no ] ; then
# change && to || when we support NID additional processing
grep "L64" dig.out.$n > /dev/null && ret=1
grep "L32" dig.out.$n > /dev/null && ret=1
else
grep "L64" dig.out.$n > /dev/null && ret=1
grep "L32" dig.out.$n > /dev/null && ret=1
fi
if [ $ret -eq 1 ] ; then
echo "I: failed"; status=1
fi
n=`expr $n + 1`
echo "I:test with NID + LP ($n)"
ret=0
$DIG -t NID nid2.nid.example @10.53.0.1 -p 5300 > dig.out.$n || ret=1
if [ $minimal = no ] ; then
# change && to || when we support NID additional processing
grep "LP" dig.out.$n > /dev/null && ret=1
grep "L64" dig.out.$n > /dev/null && ret=1
grep "L32" dig.out.$n > /dev/null && ret=1
else
grep "LP" dig.out.$n > /dev/null && ret=1
grep "L64" dig.out.$n > /dev/null && ret=1
grep "L32" dig.out.$n > /dev/null && ret=1
fi
if [ $ret -eq 1 ] ; then
echo "I: failed"; status=1
fi
}
echo "I:testing with 'minimal-responses yes;'"
minimal=yes
dotests
echo "I:reconfiguring server"
cp ns1/named2.conf ns1/named.conf
$RNDC -c ../common/rndc.conf -s 10.53.0.1 -p 9953 reconfig 2>&1 | sed 's/^/I:ns1 /'
sleep 2
echo "I:testing with 'minimal-responses no;'"
minimal=no
dotests
exit $status
......@@ -55,14 +55,15 @@ ARPANAME=$TOP/bin/tools/arpaname
# The "stress" test is not run by default since it creates enough
# load on the machine to make it unusable to other users.
# v6synth
SUBDIRS="acl allow_query addzone autosign builtin cacheclean checkconf
@CHECKDS@ checknames checkzone database dlv dlvauto dlz dlzexternal
dlzredir dname dns64 dnssec dsdigest ecdsa forward glue gost ixfr
inline limits logfileconfig lwresd masterfile masterformat metadata
notify nsupdate pending pkcs11 redirect resolver rndc rpz rrsetorder
rsabigexponent sortlist smartsign staticstub statistics stub
tkey tsig tsiggss unknown upforwd verify views wildcard xfer xferquota
zonechecks"
SUBDIRS="acl additional allow_query addzone autosign builtin
cacheclean checkconf @CHECKDS@ checknames checkzone database
dlv dlvauto dlz dlzexternal dlzredir dname dns64 dnssec
dsdigest ecdsa forward glue gost ixfr inline limits
logfileconfig lwresd masterfile masterformat metadata
notify nsupdate pending pkcs11 redirect resolver rndc rpz
rrsetorder rsabigexponent sortlist smartsign staticstub
statistics stub tkey tsig tsiggss unknown upforwd verify
views wildcard xfer xferquota zonechecks"
# PERL will be an empty string if no perl interpreter was found.
PERL=@PERL@
......
......@@ -275,6 +275,14 @@ tlsa TLSA ( 1 1 2 92003ba34942dc74152e2f2c408d29ec
1b177615d466f6c4b71c216a50292bd5
8c9ebdd2f74e38fe51ffd48c43326cbc )
nid NID 10 0014:4fff:ff20:ee64
l32 L32 10 1.2.3.4
l64 L64 10 0014:4fff:ff20:ee64
lp LP 10 example.net.
; type 255
; TSIG is a meta-type and should never occur in master files.
......
......@@ -20,7 +20,7 @@ gpos01.example. 3600 IN GPOS "-22.6882" "116.8652" "250.0"
gpos02.example. 3600 IN GPOS "" "" ""
hinfo01.example. 3600 IN HINFO "Generic PC clone" "NetBSD-1.4"
hinfo02.example. 3600 IN HINFO "PC" "NetBSD"
hip1.example. 3600 IN HIP 2 200100107B1A74DF365639CC39F1D578 AwEAAbdxyhNuSutc5EMzxTs9LBPCIkOFH8cIvM4p9+LrV4e19WzK00+CI6zBCQTdtWsuxKbWIy87UOoJTwkUs7lBu+Upr1gsNrut79ryra+bSRGQb1slImA8YVJyuIDsj7kwzG7jnERNqnWxZ48AWkskmdHaVDP4BcelrTI3rMXdXF5D
hip1.example. 3600 IN HIP 2 200100107B1A74DF365639CC39F1D578 AwEAAbdxyhNuSutc5EMzxTs9LBPCIkOFH8cIvM4p9+LrV4e19WzK00+CI6zBCQTdtWsuxKbWIy87UOoJTwkUs7lBu+Upr1gsNrut79ryra+bSRGQb1slImA8YVJyuIDsj7kwzG7jnERNqnWxZ48AWkskmdHaVDP4BcelrTI3rMXdXF5D
hip2.example. 3600 IN HIP 2 200100107B1A74DF365639CC39F1D578 AwEAAbdxyhNuSutc5EMzxTs9LBPCIkOFH8cIvM4p9+LrV4e19WzK00+CI6zBCQTdtWsuxKbWIy87UOoJTwkUs7lBu+Upr1gsNrut79ryra+bSRGQb1slImA8YVJyuIDsj7kwzG7jnERNqnWxZ48AWkskmdHaVDP4BcelrTI3rMXdXF5D rvs.example.com.
isdn01.example. 3600 IN ISDN "isdn-address"
isdn02.example. 3600 IN ISDN "isdn-address" "subaddress"
......@@ -31,6 +31,10 @@ kx01.example. 3600 IN KX 10 kdc.example.
kx02.example. 3600 IN KX 10 .
loc01.example. 3600 IN LOC 60 9 0.000 N 24 39 0.000 E 10.00m 20m 2000m 20m
loc02.example. 3600 IN LOC 60 9 0.000 N 24 39 0.000 E 10.00m 20m 2000m 20m
l32.example. 3600 IN L32 10 1.2.3.4
l64.example. 3600 IN L64 10 14:4fff:ff20:ee64
lp.example. 3600 IN LP 10 example.net.
nid.example. 3600 IN NID 10 14:4fff:ff20:ee64
mb01.example. 3600 IN MG madname.example.
mb02.example. 3600 IN MG .
mg01.example. 3600 IN MG mgmname.example.
......
......@@ -31,6 +31,10 @@ kx01.example. 3600 IN KX 10 kdc.example.
kx02.example. 3600 IN KX 10 .
loc01.example. 3600 IN LOC 60 9 0.000 N 24 39 0.000 E 10.00m 20m 2000m 20m
loc02.example. 3600 IN LOC 60 9 0.000 N 24 39 0.000 E 10.00m 20m 2000m 20m
l32.example. 3600 IN L32 10 1.2.3.4
l64.example. 3600 IN L64 10 14:4fff:ff20:ee64
lp.example. 3600 IN LP 10 example.net.
nid.example. 3600 IN NID 10 14:4fff:ff20:ee64
mb01.example. 3600 IN MG madname.example.
mb02.example. 3600 IN MG .
mg01.example. 3600 IN MG mgmname.example.
......
......@@ -141,3 +141,6 @@
5933: Use of GOST Signature Algorithms in DNSKEY
and RRSIG Resource Records for DNSSEC
6303: Locally Served DNS Zones
6742: DNS Resource Records for the
Identifier-Locator Network Protocol (ILNP)
This diff is collapsed.
......@@ -222,6 +222,72 @@ static isc_result_t
unknown_totext(dns_rdata_t *rdata, dns_rdata_textctx_t *tctx,
isc_buffer_t *target);
/*% INT16 Size */
#define NS_INT16SZ 2
/*% IPv6 Address Size */
#define NS_LOCATORSZ 8
/*%
* convert presentation level address to network order binary form.
* \return
* 1 if `src' is a valid [RFC1884 2.2] address, else 0.
* \note
* (1) does not touch `dst' unless it's returning 1.
*/
static inline int
locator_pton(const char *src, unsigned char *dst) {
static const char xdigits_l[] = "0123456789abcdef",
xdigits_u[] = "0123456789ABCDEF";
unsigned char tmp[NS_LOCATORSZ];
unsigned char *tp = tmp, *endp;
const char *xdigits, *curtok;
int ch, seen_xdigits;
unsigned int val;
memset(tp, '\0', NS_LOCATORSZ);
endp = tp + NS_LOCATORSZ;
curtok = src;
seen_xdigits = 0;
val = 0;
while ((ch = *src++) != '\0') {
const char *pch;
pch = strchr((xdigits = xdigits_l), ch);
if (pch == NULL)
pch = strchr((xdigits = xdigits_u), ch);
if (pch != NULL) {
val <<= 4;
val |= (pch - xdigits);
if (++seen_xdigits > 4)
return (0);
continue;
}
if (ch == ':') {
curtok = src;
if (!seen_xdigits)
return (0);
if (tp + NS_INT16SZ > endp)
return (0);
*tp++ = (unsigned char) (val >> 8) & 0xff;
*tp++ = (unsigned char) val & 0xff;
seen_xdigits = 0;
val = 0;
continue;
}
return (0);
}
if (seen_xdigits) {
if (tp + NS_INT16SZ > endp)
return (0);
*tp++ = (unsigned char) (val >> 8) & 0xff;
*tp++ = (unsigned char) val & 0xff;
}
if (tp != endp)
return (0);
memcpy(dst, tmp, NS_LOCATORSZ);
return (1);
}
static inline int
getquad(const void *src, struct in_addr *dst,
isc_lex_t *lexer, dns_rdatacallbacks_t *callbacks)
......
/*
* Copyright (C) 2012 Internet Systems Consortium, Inc. ("ISC")
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef RDATA_GENERIC_L32_105_C
#define RDATA_GENERIC_L32_105_C
#include <string.h>
#include <isc/net.h>
#define RRTYPE_L32_ATTRIBUTES (0)
static inline isc_result_t
fromtext_l32(ARGS_FROMTEXT) {
isc_token_t token;
struct in_addr addr;
isc_region_t region;
REQUIRE(type == 105);
UNUSED(type);
UNUSED(rdclass);
UNUSED(origin);
UNUSED(options);
UNUSED(callbacks);
RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number,
ISC_FALSE));
if (token.value.as_ulong > 0xffffU)
RETTOK(ISC_R_RANGE);
RETERR(uint16_tobuffer(token.value.as_ulong, target));
RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,
ISC_FALSE));
if (getquad(DNS_AS_STR(token), &addr, lexer, callbacks) != 1)
RETTOK(DNS_R_BADDOTTEDQUAD);
isc_buffer_availableregion(target, &region);
if (region.length < 4)
return (ISC_R_NOSPACE);
memcpy(region.base, &addr, 4);
isc_buffer_add(target, 4);
return (ISC_R_SUCCESS);
}
static inline isc_result_t
totext_l32(ARGS_TOTEXT) {
isc_region_t region;
char buf[sizeof("65000")];
unsigned short num;
REQUIRE(rdata->type == 105);
REQUIRE(rdata->length == 6);
UNUSED(tctx);
dns_rdata_toregion(rdata, &region);
num = uint16_fromregion(&region);
isc_region_consume(&region, 2);
sprintf(buf, "%u", num);
RETERR(str_totext(buf, target));
RETERR(str_totext(" ", target));
return (inet_totext(AF_INET, &region, target));
}
static inline isc_result_t
fromwire_l32(ARGS_FROMWIRE) {
isc_region_t sregion;
REQUIRE(type == 105);
UNUSED(type);
UNUSED(options);
UNUSED(rdclass);
UNUSED(dctx);
isc_buffer_activeregion(source, &sregion);
if (sregion.length != 6)
return (DNS_R_FORMERR);
isc_buffer_forward(source, sregion.length);
return (mem_tobuffer(target, sregion.base, sregion.length));
}
static inline isc_result_t