Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pcap-Net
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Pcap-Net
Commits
7ec2cf6d
Commit
7ec2cf6d
authored
Nov 04, 2011
by
Brickner_cp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DNS
parent
c56980ec
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
408 additions
and
21 deletions
+408
-21
RandomDnsExtensions.cs
...t/src/PcapDotNet.Packets.TestUtils/RandomDnsExtensions.cs
+8
-0
DnsResourceData.cs
PcapDotNet/src/PcapDotNet.Packets/Dns/DnsResourceData.cs
+397
-20
DnsType.cs
PcapDotNet/src/PcapDotNet.Packets/Dns/DnsType.cs
+3
-1
No files found.
PcapDotNet/src/PcapDotNet.Packets.TestUtils/RandomDnsExtensions.cs
View file @
7ec2cf6d
...
@@ -246,6 +246,14 @@ namespace PcapDotNet.Packets.TestUtils
...
@@ -246,6 +246,14 @@ namespace PcapDotNet.Packets.TestUtils
case
DnsType
.
Opt
:
case
DnsType
.
Opt
:
return
new
DnsResourceDataOptions
(
random
.
NextDnsOptions
());
return
new
DnsResourceDataOptions
(
random
.
NextDnsOptions
());
case
DnsType
.
Apl
:
return
new
DnsResourceDataAddressPrefixList
(
((
Func
<
DnsAddressPrefix
>)
(()
=>
new
DnsAddressPrefix
(
random
.
NextEnum
<
AddressFamily
>(),
random
.
NextByte
(),
random
.
NextBool
(),
random
.
NextDataSegment
(
random
.
Next
(
0
,
128
))))).
GenerateArray
(
random
.
Next
(
10
)));
default
:
default
:
return
new
DnsResourceDataAnything
(
random
.
NextDataSegment
(
random
.
Next
(
100
)));
return
new
DnsResourceDataAnything
(
random
.
NextDataSegment
(
random
.
Next
(
100
)));
}
}
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/DnsResourceData.cs
View file @
7ec2cf6d
...
@@ -257,10 +257,10 @@ namespace PcapDotNet.Packets.Dns
...
@@ -257,10 +257,10 @@ namespace PcapDotNet.Packets.Dns
/// | bit | 0-31 |
/// | bit | 0-31 |
/// +-------+---------+
/// +-------+---------+
/// | 0 | MNAME |
/// | 0 | MNAME |
/// |
| |
/// |
...
| |
/// +-------+---------+
/// +-------+---------+
/// | X | RNAME |
/// | X | RNAME |
/// |
| |
/// |
...
| |
/// +-------+---------+
/// +-------+---------+
/// | Y | SERIAL |
/// | Y | SERIAL |
/// +-------+---------+
/// +-------+---------+
...
@@ -786,7 +786,7 @@ namespace PcapDotNet.Packets.Dns
...
@@ -786,7 +786,7 @@ namespace PcapDotNet.Packets.Dns
/// | 0 | Value |
/// | 0 | Value |
/// +-----+--------+
/// +-----+--------+
/// | 16 | Domain |
/// | 16 | Domain |
/// |
| |
/// |
...
| |
/// +-----+--------+
/// +-----+--------+
/// </pre>
/// </pre>
/// </summary>
/// </summary>
...
@@ -869,7 +869,7 @@ namespace PcapDotNet.Packets.Dns
...
@@ -869,7 +869,7 @@ namespace PcapDotNet.Packets.Dns
/// | 0 | PREFERENCE |
/// | 0 | PREFERENCE |
/// +-----+------------+
/// +-----+------------+
/// | 16 | EXCHANGE |
/// | 16 | EXCHANGE |
/// |
| |
/// |
...
| |
/// +-----+------------+
/// +-----+------------+
/// </pre>
/// </pre>
/// </summary>
/// </summary>
...
@@ -992,7 +992,7 @@ namespace PcapDotNet.Packets.Dns
...
@@ -992,7 +992,7 @@ namespace PcapDotNet.Packets.Dns
/// | 0 | subtype |
/// | 0 | subtype |
/// +-----+----------+
/// +-----+----------+
/// | 16 | hostname |
/// | 16 | hostname |
/// |
| |
/// |
...
| |
/// +-----+----------+
/// +-----+----------+
/// </pre>
/// </pre>
/// </summary>
/// </summary>
...
@@ -1088,7 +1088,7 @@ namespace PcapDotNet.Packets.Dns
...
@@ -1088,7 +1088,7 @@ namespace PcapDotNet.Packets.Dns
/// | 0 | preference |
/// | 0 | preference |
/// +-----+-------------------+
/// +-----+-------------------+
/// | 16 | intermediate-host |
/// | 16 | intermediate-host |
/// |
| |
/// |
...
| |
/// +-----+-------------------+
/// +-----+-------------------+
/// </pre>
/// </pre>
/// </summary>
/// </summary>
...
@@ -1352,10 +1352,10 @@ namespace PcapDotNet.Packets.Dns
...
@@ -1352,10 +1352,10 @@ namespace PcapDotNet.Packets.Dns
/// +-----+--------------+--------------------+
/// +-----+--------------+--------------------+
/// | 128 | key tag | |
/// | 128 | key tag | |
/// +-----+--------------+ signer's name |
/// +-----+--------------+ signer's name |
/// |
| |
/// |
...
| |
/// +-----+-----------------------------------+
/// +-----+-----------------------------------+
/// | | signature |
/// | | signature |
/// |
| |
/// |
...
| |
/// +-----+-----------------------------------+
/// +-----+-----------------------------------+
/// </pre>
/// </pre>
/// </summary>
/// </summary>
...
@@ -1669,6 +1669,7 @@ namespace PcapDotNet.Packets.Dns
...
@@ -1669,6 +1669,7 @@ namespace PcapDotNet.Packets.Dns
/// | 32 | public key |
/// | 32 | public key |
/// | or | |
/// | or | |
/// | 48 | |
/// | 48 | |
/// | ... | |
/// +-----+--------------------------------------------------------------+
/// +-----+--------------------------------------------------------------+
/// </pre>
/// </pre>
/// </summary>
/// </summary>
...
@@ -1838,10 +1839,10 @@ namespace PcapDotNet.Packets.Dns
...
@@ -1838,10 +1839,10 @@ namespace PcapDotNet.Packets.Dns
/// | 0 | Preference |
/// | 0 | Preference |
/// +-----+------------+
/// +-----+------------+
/// | 16 | MAP822 |
/// | 16 | MAP822 |
/// |
| |
/// |
...
| |
/// +-----+------------+
/// +-----+------------+
/// | | MAPX400 |
/// | | MAPX400 |
/// |
| |
/// |
...
| |
/// +-----+------------+
/// +-----+------------+
/// </pre>
/// </pre>
/// </summary>
/// </summary>
...
@@ -2457,7 +2458,7 @@ namespace PcapDotNet.Packets.Dns
...
@@ -2457,7 +2458,7 @@ namespace PcapDotNet.Packets.Dns
/// | 32 | Port |
/// | 32 | Port |
/// +-----+----------+
/// +-----+----------+
/// | 48 | Target |
/// | 48 | Target |
/// |
| |
/// |
...
| |
/// +-----+----------+
/// +-----+----------+
/// </pre>
/// </pre>
/// </summary>
/// </summary>
...
@@ -2601,7 +2602,7 @@ namespace PcapDotNet.Packets.Dns
...
@@ -2601,7 +2602,7 @@ namespace PcapDotNet.Packets.Dns
/// | 0 | FORMAT |
/// | 0 | FORMAT |
/// +-----+---------+
/// +-----+---------+
/// | 8 | ADDRESS |
/// | 8 | ADDRESS |
/// |
| |
/// |
...
| |
/// +-----+---------+
/// +-----+---------+
/// </pre>
/// </pre>
/// </summary>
/// </summary>
...
@@ -2685,16 +2686,16 @@ namespace PcapDotNet.Packets.Dns
...
@@ -2685,16 +2686,16 @@ namespace PcapDotNet.Packets.Dns
/// | 0 | Order | Preference |
/// | 0 | Order | Preference |
/// +-----+-------+------------+
/// +-----+-------+------------+
/// | 32 | FLAGS |
/// | 32 | FLAGS |
/// |
| |
/// |
...
| |
/// +-----+--------------------+
/// +-----+--------------------+
/// | | SERVICES |
/// | | SERVICES |
/// |
| |
/// |
...
| |
/// +-----+--------------------+
/// +-----+--------------------+
/// | | REGEXP |
/// | | REGEXP |
/// |
| |
/// |
...
| |
/// +-----+--------------------+
/// +-----+--------------------+
/// | | REPLACEMENT |
/// | | REPLACEMENT |
/// |
| |
/// |
...
| |
/// +-----+--------------------+
/// +-----+--------------------+
/// </summary>
/// </summary>
[
DnsTypeRegistration
(
Type
=
DnsType
.
NaPtr
)]
[
DnsTypeRegistration
(
Type
=
DnsType
.
NaPtr
)]
...
@@ -2879,7 +2880,7 @@ namespace PcapDotNet.Packets.Dns
...
@@ -2879,7 +2880,7 @@ namespace PcapDotNet.Packets.Dns
/// | 0 | PREFERENCE |
/// | 0 | PREFERENCE |
/// +-----+-------------------+
/// +-----+-------------------+
/// | 16 | EXCHANGER |
/// | 16 | EXCHANGER |
/// |
| |
/// |
...
| |
/// +-----+-------------------+
/// +-----+-------------------+
/// </pre>
/// </pre>
/// </summary>
/// </summary>
...
@@ -3014,7 +3015,10 @@ namespace PcapDotNet.Packets.Dns
...
@@ -3014,7 +3015,10 @@ namespace PcapDotNet.Packets.Dns
/// | 0 | type | key tag |
/// | 0 | type | key tag |
/// +-----+-----------+------+------------+
/// +-----+-----------+------+------------+
/// | 32 | algorithm | certificate or CRL|
/// | 32 | algorithm | certificate or CRL|
/// +-----+-----------+-------------------+
/// +-----+-----------+ |
/// | | |
/// | ... | |
/// +-----+-------------------------------+
/// </pre>
/// </pre>
/// </summary>
/// </summary>
[
DnsTypeRegistration
(
Type
=
DnsType
.
Cert
)]
[
DnsTypeRegistration
(
Type
=
DnsType
.
Cert
)]
...
@@ -3578,7 +3582,7 @@ namespace PcapDotNet.Packets.Dns
...
@@ -3578,7 +3582,7 @@ namespace PcapDotNet.Packets.Dns
/// | 0 | coding | subcoding |
/// | 0 | coding | subcoding |
/// +-----+--------+-----------+
/// +-----+--------+-----------+
/// | 16 | data |
/// | 16 | data |
/// |
| |
/// |
...
| |
/// +-----+--------------------+
/// +-----+--------------------+
/// </pre>
/// </pre>
/// </summary>
/// </summary>
...
@@ -4034,7 +4038,7 @@ namespace PcapDotNet.Packets.Dns
...
@@ -4034,7 +4038,7 @@ namespace PcapDotNet.Packets.Dns
/// | 16 | OPTION-LENGTH |
/// | 16 | OPTION-LENGTH |
/// +-----+---------------+
/// +-----+---------------+
/// | 32 | OPTION-DATA |
/// | 32 | OPTION-DATA |
/// |
| |
/// |
...
| |
/// +-----+---------------+
/// +-----+---------------+
/// </pre>
/// </pre>
/// </summary>
/// </summary>
...
@@ -4082,4 +4086,377 @@ namespace PcapDotNet.Packets.Dns
...
@@ -4082,4 +4086,377 @@ namespace PcapDotNet.Packets.Dns
return
new
DnsResourceDataOptions
(
options
);
return
new
DnsResourceDataOptions
(
options
);
}
}
}
}
/// <summary>
/// RFCs 2453, 2858.
/// </summary>
public
enum
AddressFamily
:
ushort
{
/// <summary>
/// IP (IP version 4).
/// </summary>
IpV4
=
1
,
/// <summary>
/// IP6 (IP version 6).
/// </summary>
IpV6
=
2
,
/// <summary>
/// Network Service Access Point.
/// </summary>
Nsap
=
3
,
/// <summary>
/// High-Level Data Link (8-bit multidrop).
/// </summary>
Hdlc
=
4
,
/// <summary>
/// BBN Report 1822.
/// </summary>
Bbn1822
=
5
,
/// <summary>
/// 802 (includes all 802 media plus Ethernet "canonical format").
/// </summary>
Media802
=
6
,
/// <summary>
/// E.163.
/// </summary>
E163
=
7
,
/// <summary>
/// E.164 (SMDS, Frame Relay, ATM).
/// </summary>
E164
=
8
,
/// <summary>
/// F.69 (Telex).
/// </summary>
F69
=
9
,
/// <summary>
/// X.121 (X.25, Frame Relay).
/// </summary>
X121
=
10
,
/// <summary>
/// IPX.
/// </summary>
Ipx
=
11
,
/// <summary>
/// Appletalk.
/// </summary>
AppleTalk
=
12
,
/// <summary>
/// Decnet IV.
/// </summary>
DecnetIv
=
13
,
/// <summary>
/// Banyan Vines.
/// </summary>
BanyanVines
=
14
,
/// <summary>
/// E.164 with NSAP format subaddress.
/// ATM Forum UNI 3.1. October 1995.
/// Andy Malis.
/// </summary>
E164WithNsapFormatSubaddresses
=
15
,
/// <summary>
/// DNS (Domain Name System).
/// </summary>
Dns
=
16
,
/// <summary>
/// Distinguished Name.
/// Charles Lynn.
/// </summary>
DistinguishedName
=
17
,
/// <summary>
/// AS Number.
/// Charles Lynn.
/// </summary>
AsNumber
=
18
,
/// <summary>
/// XTP over IP version 4.
/// Mike Saul.
/// </summary>
XtpOverIpV4
=
19
,
/// <summary>
/// XTP over IP version 6.
/// Mike Saul.
/// </summary>
XtpOverIpV6
=
20
,
/// <summary>
/// XTP native mode XTP.
/// Mike Saul.
/// </summary>
XtpNativeModeXtp
=
21
,
/// <summary>
/// Fibre Channel World-Wide Port Name.
/// Mark Bakke.
/// </summary>
FibreChannelWorldWidePortName
=
22
,
/// <summary>
/// Fibre Channel World-Wide Node Name.
/// Mark Bakke.
/// </summary>
FibreChannelWorldWideNodeName
=
23
,
/// <summary>
/// GWID.
/// Subra Hegde.
/// </summary>
Gwis
=
24
,
/// <summary>
/// RFCs 4761, 6074.
/// AFI for L2VPN information.
/// </summary>
AfiForL2VpnInformation
=
25
,
/// <summary>
/// EIGRP Common Service Family.
/// Donnie Savage.
/// </summary>
EigrpCommonServiceFamily
=
16384
,
/// <summary>
/// EIGRP IPv4 Service Family.
/// Donnie Savage.
/// </summary>
EigrpIpV4ServiceFamily
=
16385
,
/// <summary>
/// EIGRP IPv6 Service Family.
/// Donnie Savage.
/// </summary>
EigrpIpV6ServiceFamily
=
16386
,
/// <summary>
/// LISP Canonical Address Format (LCAF).
/// David Meyer.
/// </summary>
LispCanonicalAddressFormat
=
16387
,
}
/// <summary>
/// RFC 3123.
/// <pre>
/// +-----+--------+---+-----------+
/// | bit | 0-7 | 8 | 9-15 |
/// +-----+--------+---+-----------+
/// | 0 | ADDRESSFAMILY |
/// +-----+--------+---+-----------+
/// | 16 | PREFIX | N | AFDLENGTH |
/// +-----+--------+---+-----------+
/// | 32 | AFDPART |
/// | ... | |
/// +-----+------------------------+
/// </pre>
/// </summary>
public
class
DnsAddressPrefix
:
IEquatable
<
DnsAddressPrefix
>
{
private
static
class
Offset
{
public
const
int
AddressFamily
=
0
;
public
const
int
PrefixLength
=
AddressFamily
+
sizeof
(
ushort
);
public
const
int
Negation
=
PrefixLength
+
sizeof
(
byte
);
public
const
int
AddressFamilyDependentPartLength
=
Negation
;
public
const
int
AddressFamilyDependentPart
=
AddressFamilyDependentPartLength
+
sizeof
(
byte
);
}
public
const
int
MinimumLength
=
Offset
.
AddressFamilyDependentPart
;
private
static
class
Mask
{
public
const
byte
Negation
=
0x80
;
public
const
byte
AddressFamilyDependentPartLength
=
0x7F
;
}
public
const
int
AddressFamilyDependentPartMaxLength
=
(
1
<<
7
)
-
1
;
public
DnsAddressPrefix
(
AddressFamily
addressFamily
,
byte
prefixLength
,
bool
negation
,
DataSegment
addressFamilyDependentPart
)
{
if
(
addressFamilyDependentPart
.
Length
>
AddressFamilyDependentPartMaxLength
)
throw
new
ArgumentOutOfRangeException
(
"addressFamilyDependentPart"
,
addressFamilyDependentPart
,
"Cannot be longer than "
+
AddressFamilyDependentPartMaxLength
);
AddressFamily
=
addressFamily
;
PrefixLength
=
prefixLength
;
Negation
=
negation
;
AddressFamilyDependentPart
=
addressFamilyDependentPart
;
}
public
AddressFamily
AddressFamily
{
get
;
private
set
;
}
/// <summary>
/// Prefix length.
/// Upper and lower bounds and interpretation of this value are address family specific.
///
/// For IPv4, specifies the number of bits of the IPv4 address starting at the most significant bit.
/// Legal values range from 0 to 32.
///
/// For IPv6, specifies the number of bits of the IPv6 address starting at the most significant bit.
/// Legal values range from 0 to 128.
/// </summary>
public
byte
PrefixLength
{
get
;
private
set
;
}
/// <summary>
/// Negation flag, indicates the presence of the "!" character in the textual format.
/// </summary>
public
bool
Negation
{
get
;
private
set
;
}
/// <summary>
/// For IPv4, the encoding follows the encoding specified for the A RR by RFC 1035.
/// Trailing zero octets do not bear any information (e.g., there is no semantic difference between 10.0.0.0/16 and 10/16) in an address prefix,
/// so the shortest possible AddressFamilyDependentPart can be used to encode it.
/// However, for DNSSEC (RFC 2535) a single wire encoding must be used by all.
/// Therefore the sender must not include trailing zero octets in the AddressFamilyDependentPart regardless of the value of PrefixLength.
/// This includes cases in which AddressFamilyDependentPart length times 8 results in a value less than PrefixLength.
/// The AddressFamilyDependentPart is padded with zero bits to match a full octet boundary.
/// An IPv4 AddressFamilyDependentPart has a variable length of 0 to 4 octets.
///
/// For IPv6, the 128 bit IPv6 address is encoded in network byte order (high-order byte first).
/// The sender must not include trailing zero octets in the AddressFamilyDependentPart regardless of the value of PrefixLength.
/// This includes cases in which AddressFamilyDependentPart length times 8 results in a value less than PrefixLength.
/// The AddressFamilyDependentPart is padded with zero bits to match a full octet boundary.
/// An IPv6 AddressFamilyDependentPart has a variable length of 0 to 16 octets.
/// </summary>
public
DataSegment
AddressFamilyDependentPart
{
get
;
private
set
;
}
public
int
Length
{
get
{
return
MinimumLength
+
AddressFamilyDependentPart
.
Length
;
}
}
public
bool
Equals
(
DnsAddressPrefix
other
)
{
return
other
!=
null
&&
AddressFamily
.
Equals
(
other
.
AddressFamily
)
&&
PrefixLength
.
Equals
(
other
.
PrefixLength
)
&&
Negation
.
Equals
(
other
.
Negation
)
&&
AddressFamilyDependentPart
.
Equals
(
other
.
AddressFamilyDependentPart
);
}
public
override
bool
Equals
(
object
obj
)
{
return
Equals
(
obj
as
DnsAddressPrefix
);
}
public
static
DnsAddressPrefix
Read
(
DataSegment
data
)
{
if
(
data
.
Length
<
MinimumLength
)
return
null
;
AddressFamily
addressFamily
=
(
AddressFamily
)
data
.
ReadUShort
(
Offset
.
AddressFamily
,
Endianity
.
Big
);
byte
prefixLength
=
data
[
Offset
.
PrefixLength
];
bool
negation
=
data
.
ReadBool
(
Offset
.
Negation
,
Mask
.
Negation
);
byte
addressFamilyDependentPartLength
=
(
byte
)(
data
[
Offset
.
AddressFamilyDependentPartLength
]
&
Mask
.
AddressFamilyDependentPartLength
);
if
(
data
.
Length
<
MinimumLength
+
addressFamilyDependentPartLength
)
return
null
;
DataSegment
addressFamilyDependentPart
=
data
.
SubSegment
(
Offset
.
AddressFamilyDependentPart
,
addressFamilyDependentPartLength
);
return
new
DnsAddressPrefix
(
addressFamily
,
prefixLength
,
negation
,
addressFamilyDependentPart
);
}
public
void
Write
(
byte
[]
buffer
,
ref
int
offset
)
{
buffer
.
Write
(
offset
+
Offset
.
AddressFamily
,
(
ushort
)
AddressFamily
,
Endianity
.
Big
);
buffer
.
Write
(
offset
+
Offset
.
PrefixLength
,
PrefixLength
);
buffer
.
Write
(
offset
+
Offset
.
Negation
,
(
byte
)((
Negation
?
Mask
.
Negation
:
0
)
|
AddressFamilyDependentPart
.
Length
));
AddressFamilyDependentPart
.
Write
(
buffer
,
offset
+
Offset
.
AddressFamilyDependentPart
);
offset
+=
MinimumLength
+
AddressFamilyDependentPart
.
Length
;
}
}
/// <summary>
/// RFC 3123.
/// <pre>
/// 0 Or more of:
/// +-----+--------+---+-----------+
/// | bit | 0-7 | 8 | 9-15 |
/// +-----+--------+---+-----------+
/// | 0 | ADDRESSFAMILY |
/// +-----+--------+---+-----------+
/// | 16 | PREFIX | N | AFDLENGTH |
/// +-----+--------+---+-----------+
/// | 32 | AFDPART |
/// | ... | |
/// +-----+------------------------+
/// </pre>
/// </summary>
[
DnsTypeRegistration
(
Type
=
DnsType
.
Apl
)]
public
sealed
class
DnsResourceDataAddressPrefixList
:
DnsResourceDataSimple
,
IEquatable
<
DnsResourceDataAddressPrefixList
>
{
public
DnsResourceDataAddressPrefixList
()
:
this
(
new
DnsAddressPrefix
[
0
])
{
}
public
DnsResourceDataAddressPrefixList
(
IList
<
DnsAddressPrefix
>
items
)
{
Items
=
items
.
AsReadOnly
();
}
public
DnsResourceDataAddressPrefixList
(
params
DnsAddressPrefix
[]
items
)
:
this
((
IList
<
DnsAddressPrefix
>)
items
)
{
Length
=
items
.
Sum
(
item
=>
item
.
Length
);
}
public
ReadOnlyCollection
<
DnsAddressPrefix
>
Items
{
get
;
private
set
;
}
public
int
Length
{
get
;
private
set
;
}
public
bool
Equals
(
DnsResourceDataAddressPrefixList
other
)
{
return
other
!=
null
&&
Items
.
SequenceEqual
(
other
.
Items
);
}
public
override
bool
Equals
(
DnsResourceData
other
)
{
return
Equals
(
other
as
DnsResourceDataAddressPrefixList
);
}
internal
override
int
GetLength
()
{
return
Length
;
}
internal
override
void
WriteDataSimple
(
byte
[]
buffer
,
int
offset
)
{
foreach
(
DnsAddressPrefix
item
in
Items
)
item
.
Write
(
buffer
,
ref
offset
);
}
internal
override
DnsResourceData
CreateInstance
(
DataSegment
data
)
{
List
<
DnsAddressPrefix
>
items
=
new
List
<
DnsAddressPrefix
>();
while
(
data
.
Length
!=
0
)
{
DnsAddressPrefix
item
=
DnsAddressPrefix
.
Read
(
data
);
if
(
item
==
null
)
return
null
;
items
.
Add
(
item
);
data
=
data
.
SubSegment
(
item
.
Length
,
data
.
Length
-
item
.
Length
);
}
return
new
DnsResourceDataAddressPrefixList
(
items
);
}
}
}
}
PcapDotNet/src/PcapDotNet.Packets/Dns/DnsType.cs
View file @
7ec2cf6d
...
@@ -292,12 +292,14 @@
...
@@ -292,12 +292,14 @@
/// <summary>
/// <summary>
/// RFC 2671.
/// RFC 2671.
/// OPT.
/// OPT.
/// Payload type: DnsResourceDataOptions.
/// </summary>
/// </summary>
Opt
=
41
,
Opt
=
41
,
/// <summary>
/// <summary>
/// RFC 3123.
/// RFC 3123.
/// APL.
/// Address Prefix List.
/// Payload type: DnsResourceDataAddressPrefixList.
/// </summary>
/// </summary>
Apl
=
42
,
Apl
=
42
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment