Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
BIND
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
641
Issues
641
List
Boards
Labels
Service Desk
Milestones
Merge Requests
105
Merge Requests
105
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ISC Open Source Projects
BIND
Commits
1fb8d37e
Commit
1fb8d37e
authored
Feb 07, 2019
by
Mark Andrews
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '867-rrtypes-missing-from-named' into 'master'
Resolve "rrtypes missing from named" See merge request
!1475
parents
5847318a
72f6fb06
Pipeline
#9680
passed with stages
in 16 minutes and 53 seconds
Changes
11
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
1097 additions
and
2 deletions
+1097
-2
CHANGES
CHANGES
+2
-0
bin/tests/system/genzone.sh
bin/tests/system/genzone.sh
+17
-2
bin/tests/system/rrchecker/typelist.good
bin/tests/system/rrchecker/typelist.good
+2
-0
bin/tests/system/xfer/dig1.good
bin/tests/system/xfer/dig1.good
+7
-0
bin/tests/system/xfer/dig2.good
bin/tests/system/xfer/dig2.good
+7
-0
lib/dns/rdata/generic/atmrelay_260.c
lib/dns/rdata/generic/atmrelay_260.c
+467
-0
lib/dns/rdata/generic/atmrelay_260.h
lib/dns/rdata/generic/atmrelay_260.h
+29
-0
lib/dns/rdata/generic/zonemd_63.c
lib/dns/rdata/generic/zonemd_63.c
+313
-0
lib/dns/rdata/generic/zonemd_63.h
lib/dns/rdata/generic/zonemd_63.h
+31
-0
lib/dns/tests/rdata_test.c
lib/dns/tests/rdata_test.c
+218
-0
util/copyrights
util/copyrights
+4
-0
No files found.
CHANGES
View file @
1fb8d37e
5158. [protocol] Add support for ATMRELAY and ZONEMD. [GL #867]
5157. [bug] Nslookup now errors out if there are extra command
5157. [bug] Nslookup now errors out if there are extra command
line arguments. [GL #207]
line arguments. [GL #207]
...
...
bin/tests/system/genzone.sh
View file @
1fb8d37e
...
@@ -368,7 +368,14 @@ openpgpkey OPENPGPKEY ( AQMFD5raczCJHViKtLYhWGz8hMY
...
@@ -368,7 +368,14 @@ openpgpkey OPENPGPKEY ( AQMFD5raczCJHViKtLYhWGz8hMY
csync01 CSYNC 0 0 A NS AAAA
csync01 CSYNC 0 0 A NS AAAA
csync02 CSYNC 0 0
csync02 CSYNC 0 0
; type 63 -- 98 (unassigned)
;type 63
zonemd01 ZONEMD 2019020700 1 0 (
C220B8A6ED5728A971902F7E3D4FD93A
DEEA88B0453C2E8E8C863D465AB06CF3
4EB95B266398C98B59124FA239CB7EEB
)
; type 64 -- 98 (unassigned)
; type 99
; type 99
spf01 SPF "v=spf1 -all"
spf01 SPF "v=spf1 -all"
...
@@ -455,7 +462,15 @@ doa01 DOA ( 1234567890 1234567890 1 "image/gif"
...
@@ -455,7 +462,15 @@ doa01 DOA ( 1234567890 1234567890 1 "image/gif"
hmsBich1awPAjkY1SZR8bJWrz382SGqIBQQFQd4IsUTaX+ceuudPEQA7 )
hmsBich1awPAjkY1SZR8bJWrz382SGqIBQQFQd4IsUTaX+ceuudPEQA7 )
doa02 DOA 0 1 2 "" aHR0cHM6Ly93d3cuaXNjLm9yZy8=
doa02 DOA 0 1 2 "" aHR0cHM6Ly93d3cuaXNjLm9yZy8=
; type 260 -- 32767 (unassigned)
; type 260
atmrelay01 ATMRELAY 0 0 0
atmrelay02 ATMRELAY 0 1 0
atmrelay03 ATMRELAY 0 0 1 0.0.0.0
atmrelay04 ATMRELAY 0 0 2 ::
atmrelay05 ATMRELAY 0 0 3 example.net.
atmrelay06 ATMRELAY
\#
2 0004
; type 261 -- 32767 (unassigned)
; type 32768
; type 32768
ta TA 30795 1 1 (
ta TA 30795 1 1 (
...
...
bin/tests/system/rrchecker/typelist.good
View file @
1fb8d37e
...
@@ -58,6 +58,7 @@ CDS
...
@@ -58,6 +58,7 @@ CDS
CDNSKEY
CDNSKEY
OPENPGPKEY
OPENPGPKEY
CSYNC
CSYNC
ZONEMD
SPF
SPF
UINFO
UINFO
UID
UID
...
@@ -73,5 +74,6 @@ URI
...
@@ -73,5 +74,6 @@ URI
CAA
CAA
AVC
AVC
DOA
DOA
ATMRELAY
TA
TA
DLV
DLV
bin/tests/system/xfer/dig1.good
View file @
1fb8d37e
...
@@ -17,6 +17,12 @@ atma01.example. 3600 IN ATMA +61200000000
...
@@ -17,6 +17,12 @@ atma01.example. 3600 IN ATMA +61200000000
atma02.example. 3600 IN ATMA +61200000000
atma02.example. 3600 IN ATMA +61200000000
atma03.example. 3600 IN ATMA 1234567890abcdef
atma03.example. 3600 IN ATMA 1234567890abcdef
atma04.example. 3600 IN ATMA fedcba0987654321
atma04.example. 3600 IN ATMA fedcba0987654321
atmrelay01.example. 3600 IN ATMRELAY 0 0 0
atmrelay02.example. 3600 IN ATMRELAY 0 1 0
atmrelay03.example. 3600 IN ATMRELAY 0 0 1 0.0.0.0
atmrelay04.example. 3600 IN ATMRELAY 0 0 2 ::
atmrelay05.example. 3600 IN ATMRELAY 0 0 3 example.net.
atmrelay06.example. 3600 IN ATMRELAY \# 2 0004
avc.example. 3600 IN AVC "foo:bar"
avc.example. 3600 IN AVC "foo:bar"
caa01.example. 3600 IN CAA 0 issue "ca.example.net; policy=ev"
caa01.example. 3600 IN CAA 0 issue "ca.example.net; policy=ev"
caa02.example. 3600 IN CAA 128 tbs "Unknown"
caa02.example. 3600 IN CAA 128 tbs "Unknown"
...
@@ -159,6 +165,7 @@ wks01.example. 3600 IN WKS 10.0.0.1 6 0 1 2 21 23
...
@@ -159,6 +165,7 @@ wks01.example. 3600 IN WKS 10.0.0.1 6 0 1 2 21 23
wks02.example. 3600 IN WKS 10.0.0.1 17 0 1 2 53
wks02.example. 3600 IN WKS 10.0.0.1 17 0 1 2 53
wks03.example. 3600 IN WKS 10.0.0.2 6 65535
wks03.example. 3600 IN WKS 10.0.0.2 6 65535
x2501.example. 3600 IN X25 "123456789"
x2501.example. 3600 IN X25 "123456789"
zonemd01.example. 3600 IN ZONEMD 2019020700 1 0 C220B8A6ED5728A971902F7E3D4FD93ADEEA88B0453C2E8E8C863D46 5AB06CF34EB95B266398C98B59124FA239CB7EEB
8f1tmio9avcom2k0frp92lgcumak0cad.example. 3600 IN NSEC3 1 0 10 D2CF0294C020CE6C 8FPNS2UCT7FBS643THP2B77PEQ77K6IU A NS SOA MX AAAA RRSIG DNSKEY NSEC3PARAM
8f1tmio9avcom2k0frp92lgcumak0cad.example. 3600 IN NSEC3 1 0 10 D2CF0294C020CE6C 8FPNS2UCT7FBS643THP2B77PEQ77K6IU A NS SOA MX AAAA RRSIG DNSKEY NSEC3PARAM
kcd3juae64f9c5csl1kif1htaui7un0g.example. 3600 IN NSEC3 1 0 10 D2CF0294C020CE6C KD5MN2M20340DGO0BL7NTSB8JP4BSC7E
kcd3juae64f9c5csl1kif1htaui7un0g.example. 3600 IN NSEC3 1 0 10 D2CF0294C020CE6C KD5MN2M20340DGO0BL7NTSB8JP4BSC7E
mr5ukvsk1l37btu4q7b1dfevft4hkqdk.example. 3600 IN NSEC3 1 0 10 D2CF0294C020CE6C MT38J6VG7S0SN5G17MCUF6IQIKFUAJ05 A AAAA RRSIG
mr5ukvsk1l37btu4q7b1dfevft4hkqdk.example. 3600 IN NSEC3 1 0 10 D2CF0294C020CE6C MT38J6VG7S0SN5G17MCUF6IQIKFUAJ05 A AAAA RRSIG
...
...
bin/tests/system/xfer/dig2.good
View file @
1fb8d37e
...
@@ -17,6 +17,12 @@ atma01.example. 3600 IN ATMA +61200000000
...
@@ -17,6 +17,12 @@ atma01.example. 3600 IN ATMA +61200000000
atma02.example. 3600 IN ATMA +61200000000
atma02.example. 3600 IN ATMA +61200000000
atma03.example. 3600 IN ATMA 1234567890abcdef
atma03.example. 3600 IN ATMA 1234567890abcdef
atma04.example. 3600 IN ATMA fedcba0987654321
atma04.example. 3600 IN ATMA fedcba0987654321
atmrelay01.example. 3600 IN ATMRELAY 0 0 0
atmrelay02.example. 3600 IN ATMRELAY 0 1 0
atmrelay03.example. 3600 IN ATMRELAY 0 0 1 0.0.0.1
atmrelay04.example. 3600 IN ATMRELAY 0 0 2 ::
atmrelay05.example. 3600 IN ATMRELAY 0 0 3 example.net.
atmrelay06.example. 3600 IN ATMRELAY \# 2 0004
avc.example. 3600 IN AVC "foo:bar"
avc.example. 3600 IN AVC "foo:bar"
caa01.example. 3600 IN CAA 0 issue "ca.example.net; policy=ev"
caa01.example. 3600 IN CAA 0 issue "ca.example.net; policy=ev"
caa02.example. 3600 IN CAA 128 tbs "Unknown"
caa02.example. 3600 IN CAA 128 tbs "Unknown"
...
@@ -159,6 +165,7 @@ wks01.example. 3600 IN WKS 10.0.0.1 6 0 1 2 21 23
...
@@ -159,6 +165,7 @@ wks01.example. 3600 IN WKS 10.0.0.1 6 0 1 2 21 23
wks02.example. 3600 IN WKS 10.0.0.1 17 0 1 2 53
wks02.example. 3600 IN WKS 10.0.0.1 17 0 1 2 53
wks03.example. 3600 IN WKS 10.0.0.2 6 65535
wks03.example. 3600 IN WKS 10.0.0.2 6 65535
x2501.example. 3600 IN X25 "123456789"
x2501.example. 3600 IN X25 "123456789"
zonemd01.example. 3600 IN ZONEMD 2019020700 1 0 C220B8A6ED5728A971902F7E3D4FD93ADEEA88B0453C2E8E8C863D46 5AB06CF34EB95B266398C98B59124FA239CB7EEB
8f1tmio9avcom2k0frp92lgcumak0cad.example. 3600 IN NSEC3 1 0 10 D2CF0294C020CE6C 8FPNS2UCT7FBS643THP2B77PEQ77K6IU A NS SOA MX AAAA RRSIG DNSKEY NSEC3PARAM
8f1tmio9avcom2k0frp92lgcumak0cad.example. 3600 IN NSEC3 1 0 10 D2CF0294C020CE6C 8FPNS2UCT7FBS643THP2B77PEQ77K6IU A NS SOA MX AAAA RRSIG DNSKEY NSEC3PARAM
kcd3juae64f9c5csl1kif1htaui7un0g.example. 3600 IN NSEC3 1 0 10 D2CF0294C020CE6C KD5MN2M20340DGO0BL7NTSB8JP4BSC7E
kcd3juae64f9c5csl1kif1htaui7un0g.example. 3600 IN NSEC3 1 0 10 D2CF0294C020CE6C KD5MN2M20340DGO0BL7NTSB8JP4BSC7E
mr5ukvsk1l37btu4q7b1dfevft4hkqdk.example. 3600 IN NSEC3 1 0 10 D2CF0294C020CE6C MT38J6VG7S0SN5G17MCUF6IQIKFUAJ05 A AAAA RRSIG
mr5ukvsk1l37btu4q7b1dfevft4hkqdk.example. 3600 IN NSEC3 1 0 10 D2CF0294C020CE6C MT38J6VG7S0SN5G17MCUF6IQIKFUAJ05 A AAAA RRSIG
...
...
lib/dns/rdata/generic/atmrelay_260.c
0 → 100644
View file @
1fb8d37e
/*
* Copyright (C) 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/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
#ifndef RDATA_GENERIC_ATMRELAY_260_C
#define RDATA_GENERIC_ATMRELAY_260_C
#include <string.h>
#include <isc/net.h>
#define RRTYPE_ATMRELAY_ATTRIBUTES (0)
static
inline
isc_result_t
fromtext_atmrelay
(
ARGS_FROMTEXT
)
{
isc_token_t
token
;
dns_name_t
name
;
isc_buffer_t
buffer
;
unsigned
int
discovery
;
unsigned
int
gateway
;
struct
in_addr
addr
;
unsigned
char
addr6
[
16
];
isc_region_t
region
;
REQUIRE
(
type
==
dns_rdatatype_atmrelay
);
UNUSED
(
type
);
UNUSED
(
rdclass
);
UNUSED
(
callbacks
);
/*
* Precedence.
*/
RETERR
(
isc_lex_getmastertoken
(
lexer
,
&
token
,
isc_tokentype_number
,
false
));
if
(
token
.
value
.
as_ulong
>
0xffU
)
{
RETTOK
(
ISC_R_RANGE
);
}
RETERR
(
uint8_tobuffer
(
token
.
value
.
as_ulong
,
target
));
/*
* Discovery.
*/
RETERR
(
isc_lex_getmastertoken
(
lexer
,
&
token
,
isc_tokentype_number
,
false
));
if
(
token
.
value
.
as_ulong
>
1U
)
{
RETTOK
(
ISC_R_RANGE
);
}
discovery
=
token
.
value
.
as_ulong
;
/*
* Gateway type.
*/
RETERR
(
isc_lex_getmastertoken
(
lexer
,
&
token
,
isc_tokentype_number
,
false
));
if
(
token
.
value
.
as_ulong
>
0x7fU
)
RETTOK
(
ISC_R_RANGE
);
RETERR
(
uint8_tobuffer
(
token
.
value
.
as_ulong
|
(
discovery
<<
7
),
target
));
gateway
=
token
.
value
.
as_ulong
;
if
(
gateway
==
0
)
{
return
(
ISC_R_SUCCESS
);
}
if
(
gateway
>
3
)
{
return
(
ISC_R_NOTIMPLEMENTED
);
}
/*
* Gateway.
*/
RETERR
(
isc_lex_getmastertoken
(
lexer
,
&
token
,
isc_tokentype_string
,
false
));
switch
(
gateway
)
{
case
1
:
if
(
inet_pton
(
AF_INET
,
DNS_AS_STR
(
token
),
&
addr
)
!=
1
)
{
RETTOK
(
DNS_R_BADDOTTEDQUAD
);
}
isc_buffer_availableregion
(
target
,
&
region
);
if
(
region
.
length
<
4
)
{
return
(
ISC_R_NOSPACE
);
}
memmove
(
region
.
base
,
&
addr
,
4
);
isc_buffer_add
(
target
,
4
);
return
(
ISC_R_SUCCESS
);
case
2
:
if
(
inet_pton
(
AF_INET6
,
DNS_AS_STR
(
token
),
addr6
)
!=
1
)
{
RETTOK
(
DNS_R_BADAAAA
);
}
isc_buffer_availableregion
(
target
,
&
region
);
if
(
region
.
length
<
16
)
{
return
(
ISC_R_NOSPACE
);
}
memmove
(
region
.
base
,
addr6
,
16
);
isc_buffer_add
(
target
,
16
);
return
(
ISC_R_SUCCESS
);
case
3
:
dns_name_init
(
&
name
,
NULL
);
buffer_fromregion
(
&
buffer
,
&
token
.
value
.
as_region
);
if
(
origin
==
NULL
)
{
origin
=
dns_rootname
;
}
return
(
dns_name_fromtext
(
&
name
,
&
buffer
,
origin
,
options
,
target
));
default:
INSIST
(
0
);
ISC_UNREACHABLE
();
}
}
static
inline
isc_result_t
totext_atmrelay
(
ARGS_TOTEXT
)
{
isc_region_t
region
;
dns_name_t
name
;
char
buf
[
sizeof
(
"0 255 "
)];
unsigned
char
precedence
;
unsigned
char
discovery
;
unsigned
char
gateway
;
const
char
*
space
;
UNUSED
(
tctx
);
REQUIRE
(
rdata
->
type
==
dns_rdatatype_atmrelay
);
REQUIRE
(
rdata
->
length
>=
2
);
if
((
rdata
->
data
[
1
]
&
0x7f
)
>
3U
)
return
(
ISC_R_NOTIMPLEMENTED
);
/*
* Precedence.
*/
dns_rdata_toregion
(
rdata
,
&
region
);
precedence
=
uint8_fromregion
(
&
region
);
isc_region_consume
(
&
region
,
1
);
snprintf
(
buf
,
sizeof
(
buf
),
"%u "
,
precedence
);
RETERR
(
str_totext
(
buf
,
target
));
/*
* Discovery and Gateway type.
*/
gateway
=
uint8_fromregion
(
&
region
);
discovery
=
gateway
>>
7
;
gateway
&=
0x7f
;
space
=
(
gateway
!=
0U
)
?
" "
:
""
;
isc_region_consume
(
&
region
,
1
);
snprintf
(
buf
,
sizeof
(
buf
),
"%u %u%s"
,
discovery
,
gateway
,
space
);
RETERR
(
str_totext
(
buf
,
target
));
/*
* Gateway.
*/
switch
(
gateway
)
{
case
0
:
break
;
case
1
:
return
(
inet_totext
(
AF_INET
,
&
region
,
target
));
case
2
:
return
(
inet_totext
(
AF_INET6
,
&
region
,
target
));
case
3
:
dns_name_init
(
&
name
,
NULL
);
dns_name_fromregion
(
&
name
,
&
region
);
return
(
dns_name_totext
(
&
name
,
false
,
target
));
default:
INSIST
(
0
);
ISC_UNREACHABLE
();
}
return
(
ISC_R_SUCCESS
);
}
static
inline
isc_result_t
fromwire_atmrelay
(
ARGS_FROMWIRE
)
{
dns_name_t
name
;
isc_region_t
region
;
REQUIRE
(
type
==
dns_rdatatype_atmrelay
);
UNUSED
(
type
);
UNUSED
(
rdclass
);
dns_decompress_setmethods
(
dctx
,
DNS_COMPRESS_NONE
);
isc_buffer_activeregion
(
source
,
&
region
);
if
(
region
.
length
<
2
)
return
(
ISC_R_UNEXPECTEDEND
);
switch
(
region
.
base
[
1
]
&
0x7f
)
{
case
0
:
if
(
region
.
length
!=
2
)
{
return
(
DNS_R_FORMERR
);
}
isc_buffer_forward
(
source
,
region
.
length
);
return
(
mem_tobuffer
(
target
,
region
.
base
,
region
.
length
));
case
1
:
if
(
region
.
length
!=
6
)
{
return
(
DNS_R_FORMERR
);
}
isc_buffer_forward
(
source
,
region
.
length
);
return
(
mem_tobuffer
(
target
,
region
.
base
,
region
.
length
));
case
2
:
if
(
region
.
length
!=
18
)
{
return
(
DNS_R_FORMERR
);
}
isc_buffer_forward
(
source
,
region
.
length
);
return
(
mem_tobuffer
(
target
,
region
.
base
,
region
.
length
));
case
3
:
RETERR
(
mem_tobuffer
(
target
,
region
.
base
,
2
));
isc_buffer_forward
(
source
,
2
);
dns_name_init
(
&
name
,
NULL
);
return
(
dns_name_fromwire
(
&
name
,
source
,
dctx
,
options
,
target
));
default:
isc_buffer_forward
(
source
,
region
.
length
);
return
(
mem_tobuffer
(
target
,
region
.
base
,
region
.
length
));
}
}
static
inline
isc_result_t
towire_atmrelay
(
ARGS_TOWIRE
)
{
isc_region_t
region
;
REQUIRE
(
rdata
->
type
==
dns_rdatatype_atmrelay
);
REQUIRE
(
rdata
->
length
!=
0
);
UNUSED
(
cctx
);
dns_rdata_toregion
(
rdata
,
&
region
);
return
(
mem_tobuffer
(
target
,
region
.
base
,
region
.
length
));
}
static
inline
int
compare_atmrelay
(
ARGS_COMPARE
)
{
isc_region_t
region1
;
isc_region_t
region2
;
REQUIRE
(
rdata1
->
type
==
rdata2
->
type
);
REQUIRE
(
rdata1
->
rdclass
==
rdata2
->
rdclass
);
REQUIRE
(
rdata1
->
type
==
dns_rdatatype_atmrelay
);
REQUIRE
(
rdata1
->
length
>=
2
);
REQUIRE
(
rdata2
->
length
>=
2
);
dns_rdata_toregion
(
rdata1
,
&
region1
);
dns_rdata_toregion
(
rdata2
,
&
region2
);
return
(
isc_region_compare
(
&
region1
,
&
region2
));
}
static
inline
isc_result_t
fromstruct_atmrelay
(
ARGS_FROMSTRUCT
)
{
dns_rdata_atmrelay_t
*
atmrelay
=
source
;
isc_region_t
region
;
uint32_t
n
;
REQUIRE
(
type
==
dns_rdatatype_atmrelay
);
REQUIRE
(
source
!=
NULL
);
REQUIRE
(
atmrelay
->
common
.
rdtype
==
type
);
REQUIRE
(
atmrelay
->
common
.
rdclass
==
rdclass
);
UNUSED
(
type
);
UNUSED
(
rdclass
);
RETERR
(
uint8_tobuffer
(
atmrelay
->
precedence
,
target
));
n
=
(
atmrelay
->
discovery
?
0x80
:
0
)
|
atmrelay
->
gateway_type
;
RETERR
(
uint8_tobuffer
(
n
,
target
));
switch
(
atmrelay
->
gateway_type
)
{
case
0
:
return
(
ISC_R_SUCCESS
);
case
1
:
n
=
ntohl
(
atmrelay
->
in_addr
.
s_addr
);
return
(
uint32_tobuffer
(
n
,
target
));
case
2
:
return
(
mem_tobuffer
(
target
,
atmrelay
->
in6_addr
.
s6_addr
,
16
));
break
;
case
3
:
dns_name_toregion
(
&
atmrelay
->
gateway
,
&
region
);
return
(
isc_buffer_copyregion
(
target
,
&
region
));
break
;
default:
return
(
mem_tobuffer
(
target
,
atmrelay
->
data
,
atmrelay
->
length
));
}
}
static
inline
isc_result_t
tostruct_atmrelay
(
ARGS_TOSTRUCT
)
{
isc_region_t
region
;
dns_rdata_atmrelay_t
*
atmrelay
=
target
;
dns_name_t
name
;
uint32_t
n
;
REQUIRE
(
rdata
->
type
==
dns_rdatatype_atmrelay
);
REQUIRE
(
target
!=
NULL
);
REQUIRE
(
rdata
->
length
>=
2
);
atmrelay
->
common
.
rdclass
=
rdata
->
rdclass
;
atmrelay
->
common
.
rdtype
=
rdata
->
type
;
ISC_LINK_INIT
(
&
atmrelay
->
common
,
link
);
dns_name_init
(
&
atmrelay
->
gateway
,
NULL
);
atmrelay
->
data
=
NULL
;
dns_name_init
(
&
name
,
NULL
);
dns_rdata_toregion
(
rdata
,
&
region
);
atmrelay
->
precedence
=
uint8_fromregion
(
&
region
);
isc_region_consume
(
&
region
,
1
);
atmrelay
->
gateway_type
=
uint8_fromregion
(
&
region
);
atmrelay
->
discovery
=
(
atmrelay
->
gateway_type
&
0x80
)
!=
0
;
atmrelay
->
gateway_type
&=
0x7f
;
isc_region_consume
(
&
region
,
1
);
switch
(
atmrelay
->
gateway_type
)
{
case
0
:
break
;
case
1
:
n
=
uint32_fromregion
(
&
region
);
atmrelay
->
in_addr
.
s_addr
=
htonl
(
n
);
isc_region_consume
(
&
region
,
4
);
break
;
case
2
:
memmove
(
atmrelay
->
in6_addr
.
s6_addr
,
region
.
base
,
16
);
isc_region_consume
(
&
region
,
16
);
break
;
case
3
:
dns_name_fromregion
(
&
name
,
&
region
);
RETERR
(
name_duporclone
(
&
name
,
mctx
,
&
atmrelay
->
gateway
));
isc_region_consume
(
&
region
,
name_length
(
&
name
));
break
;
default:
if
(
region
.
length
!=
0
)
{
atmrelay
->
data
=
mem_maybedup
(
mctx
,
region
.
base
,
region
.
length
);
if
(
atmrelay
->
data
==
NULL
)
{
return
(
ISC_R_NOMEMORY
);
}
}
atmrelay
->
length
=
region
.
length
;
}
atmrelay
->
mctx
=
mctx
;
return
(
ISC_R_SUCCESS
);
}
static
inline
void
freestruct_atmrelay
(
ARGS_FREESTRUCT
)
{
dns_rdata_atmrelay_t
*
atmrelay
=
source
;
REQUIRE
(
source
!=
NULL
);
REQUIRE
(
atmrelay
->
common
.
rdtype
==
dns_rdatatype_atmrelay
);
if
(
atmrelay
->
mctx
==
NULL
)
return
;
if
(
atmrelay
->
gateway_type
==
3
)
dns_name_free
(
&
atmrelay
->
gateway
,
atmrelay
->
mctx
);
if
(
atmrelay
->
data
!=
NULL
)
isc_mem_free
(
atmrelay
->
mctx
,
atmrelay
->
data
);
atmrelay
->
mctx
=
NULL
;
}
static
inline
isc_result_t
additionaldata_atmrelay
(
ARGS_ADDLDATA
)
{
REQUIRE
(
rdata
->
type
==
dns_rdatatype_atmrelay
);
UNUSED
(
rdata
);
UNUSED
(
add
);
UNUSED
(
arg
);
return
(
ISC_R_SUCCESS
);
}
static
inline
isc_result_t
digest_atmrelay
(
ARGS_DIGEST
)
{
isc_region_t
region
;
REQUIRE
(
rdata
->
type
==
dns_rdatatype_atmrelay
);
dns_rdata_toregion
(
rdata
,
&
region
);
return
((
digest
)(
arg
,
&
region
));
}
static
inline
bool
checkowner_atmrelay
(
ARGS_CHECKOWNER
)
{
REQUIRE
(
type
==
dns_rdatatype_atmrelay
);
UNUSED
(
name
);
UNUSED
(
type
);
UNUSED
(
rdclass
);
UNUSED
(
wildcard
);
return
(
true
);
}
static
inline
bool
checknames_atmrelay
(
ARGS_CHECKNAMES
)
{
REQUIRE
(
rdata
->
type
==
dns_rdatatype_atmrelay
);
UNUSED
(
rdata
);
UNUSED
(
owner
);
UNUSED
(
bad
);
return
(
true
);
}
static
inline
int
casecompare_atmrelay
(
ARGS_COMPARE
)
{
isc_region_t
region1
;
isc_region_t
region2
;
dns_name_t
name1
;
dns_name_t
name2
;
REQUIRE
(
rdata1
->
type
==
rdata2
->
type
);
REQUIRE
(
rdata1
->
rdclass
==
rdata2
->
rdclass
);
REQUIRE
(
rdata1
->
type
==
dns_rdatatype_atmrelay
);
REQUIRE
(
rdata1
->
length
>=
2
);
REQUIRE
(
rdata2
->
length
>=
2
);
dns_rdata_toregion
(
rdata1
,
&
region1
);
dns_rdata_toregion
(
rdata2
,
&
region2
);
if
(
memcmp
(
region1
.
base
,
region2
.
base
,
2
)
!=
0
||
(
region1
.
base
[
1
]
&
0x7f
)
!=
3
)
return
(
isc_region_compare
(
&
region1
,
&
region2
));
dns_name_init
(
&
name1
,
NULL
);
dns_name_init
(
&
name2
,
NULL
);
isc_region_consume
(
&
region1
,
2
);
isc_region_consume
(
&
region2
,
2
);
dns_name_fromregion
(
&
name1
,
&
region1
);
dns_name_fromregion
(
&
name2
,
&
region2
);
return
(
dns_name_rdatacompare
(
&
name1
,
&
name2
));
}
#endif
/* RDATA_GENERIC_ATMRELAY_260_C */
lib/dns/rdata/generic/atmrelay_260.h
0 → 100644
View file @
1fb8d37e
/*
* Copyright (C) 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/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
#ifndef GENERIC_ATMRELAY_260_H
#define GENERIC_ATMRELAY_260_H 1
typedef
struct
dns_rdata_atmrelay
{
dns_rdatacommon_t
common
;