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
7eb998ba
Commit
7eb998ba
authored
Oct 22, 2011
by
Brickner_cp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DNS
parent
6ceb7ab8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
2 deletions
+60
-2
RandomDnsExtensions.cs
...t/src/PcapDotNet.Packets.TestUtils/RandomDnsExtensions.cs
+3
-0
DnsResourceData.cs
PcapDotNet/src/PcapDotNet.Packets/Dns/DnsResourceData.cs
+54
-0
DnsType.cs
PcapDotNet/src/PcapDotNet.Packets/Dns/DnsType.cs
+3
-2
No files found.
PcapDotNet/src/PcapDotNet.Packets.TestUtils/RandomDnsExtensions.cs
View file @
7eb998ba
...
@@ -186,6 +186,9 @@ namespace PcapDotNet.Packets.TestUtils
...
@@ -186,6 +186,9 @@ namespace PcapDotNet.Packets.TestUtils
random
.
NextDataSegment
(
random
.
Next
(
100
)),
random
.
NextDataSegment
(
random
.
Next
(
100
)),
random
.
NextDataSegment
(
random
.
Next
(
100
)),
random
.
NextDataSegment
(
random
.
Next
(
100
)),
random
.
NextDnsDomainName
());
random
.
NextDnsDomainName
());
case
DnsType
.
Kx
:
return
new
DnsResourceDataKeyExchanger
(
random
.
NextUShort
(),
random
.
NextDnsDomainName
());
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 @
7eb998ba
...
@@ -883,8 +883,15 @@ namespace PcapDotNet.Packets.Dns
...
@@ -883,8 +883,15 @@ namespace PcapDotNet.Packets.Dns
{
{
}
}
/// <summary>
/// Specifies the preference given to this RR among others at the same owner.
/// Lower values are preferred.
/// </summary>
public
ushort
Preference
{
get
{
return
Value
;
}
}
public
ushort
Preference
{
get
{
return
Value
;
}
}
/// <summary>
/// Specifies a host willing to act as a mail exchange for the owner name.
/// </summary>
public
DnsDomainName
MailExchangeHost
{
get
{
return
DomainName
;
}
}
public
DnsDomainName
MailExchangeHost
{
get
{
return
DomainName
;
}
}
internal
override
DnsResourceData
CreateInstance
(
DnsDatagram
dns
,
int
offsetInDns
,
int
length
)
internal
override
DnsResourceData
CreateInstance
(
DnsDatagram
dns
,
int
offsetInDns
,
int
length
)
...
@@ -2871,4 +2878,51 @@ namespace PcapDotNet.Packets.Dns
...
@@ -2871,4 +2878,51 @@ namespace PcapDotNet.Packets.Dns
return
flags
.
All
(
flag
=>
(
flag
>=
'0'
&&
flag
<=
'9'
||
flag
>=
'A'
&&
flag
<=
'Z'
||
flag
>=
'a'
&&
flag
<=
'z'
));
return
flags
.
All
(
flag
=>
(
flag
>=
'0'
&&
flag
<=
'9'
||
flag
>=
'A'
&&
flag
<=
'Z'
||
flag
>=
'a'
&&
flag
<=
'z'
));
}
}
}
}
/// <summary>
/// <pre>
/// +-----+-------------------+
/// | bit | 0-15 |
/// +-----+-------------------+
/// | 0 | PREFERENCE |
/// +-----+-------------------+
/// | 16 | EXCHANGER |
/// | | |
/// +-----+-------------------+
/// </pre>
/// </summary>
[
DnsTypeRegistration
(
Type
=
DnsType
.
Kx
)]
public
sealed
class
DnsResourceDataKeyExchanger
:
DnsResourceDataUShortDomainName
{
public
DnsResourceDataKeyExchanger
()
:
this
(
0
,
DnsDomainName
.
Root
)
{
}
public
DnsResourceDataKeyExchanger
(
ushort
preference
,
DnsDomainName
keyExchanger
)
:
base
(
preference
,
keyExchanger
)
{
}
/// <summary>
/// Specifies the preference given to this RR among other KX records at the same owner.
/// Lower values are preferred.
/// </summary>
public
ushort
Preference
{
get
{
return
Value
;
}
}
/// <summary>
/// Specifies a host willing to act as a key exchange for the owner name.
/// </summary>
public
DnsDomainName
KeyExchangeHost
{
get
{
return
DomainName
;
}
}
internal
override
DnsResourceData
CreateInstance
(
DnsDatagram
dns
,
int
offsetInDns
,
int
length
)
{
ushort
preference
;
DnsDomainName
keyExchangeHost
;
if
(!
TryRead
(
out
preference
,
out
keyExchangeHost
,
dns
,
offsetInDns
,
length
))
return
null
;
return
new
DnsResourceDataKeyExchanger
(
preference
,
keyExchangeHost
);
}
}
}
}
PcapDotNet/src/PcapDotNet.Packets/Dns/DnsType.cs
View file @
7eb998ba
...
@@ -257,6 +257,7 @@
...
@@ -257,6 +257,7 @@
/// <summary>
/// <summary>
/// RFC 2230.
/// RFC 2230.
/// Key Exchanger.
/// Key Exchanger.
/// Payload type: DnsResourceDataKeyExchanger.
/// </summary>
/// </summary>
Kx
=
36
,
Kx
=
36
,
...
@@ -430,13 +431,13 @@
...
@@ -430,13 +431,13 @@
Axft
=
252
,
Axft
=
252
,
/// <summary>
/// <summary>
/// RFC 1035
]
.
/// RFC 1035.
/// Mailbox-related RRs (MB, MG or MR).
/// Mailbox-related RRs (MB, MG or MR).
/// </summary>
/// </summary>
MailB
=
253
,
MailB
=
253
,
/// <summary>
/// <summary>
/// RFC 1035
]
.
/// RFC 1035.
/// Mail agent RRs (Obsolete - see MX).
/// Mail agent RRs (Obsolete - see MX).
/// </summary>
/// </summary>
MailA
=
254
,
MailA
=
254
,
...
...
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