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
1a372992
Commit
1a372992
authored
Nov 25, 2011
by
Brickner_cp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DNS
parent
39796a8b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
243 additions
and
6 deletions
+243
-6
SerialNumber32.cs
PcapDotNet/src/PcapDotNet.Base/SerialNumber32.cs
+1
-0
RandomDnsExtensions.cs
...t/src/PcapDotNet.Packets.TestUtils/RandomDnsExtensions.cs
+6
-0
DnsDatagram.cs
PcapDotNet/src/PcapDotNet.Packets/Dns/DnsDatagram.cs
+2
-2
DnsResourceData.cs
PcapDotNet/src/PcapDotNet.Packets/Dns/DnsResourceData.cs
+226
-3
DnsResponseCode.cs
PcapDotNet/src/PcapDotNet.Packets/Dns/DnsResponseCode.cs
+1
-1
DnsType.cs
PcapDotNet/src/PcapDotNet.Packets/Dns/DnsType.cs
+7
-0
No files found.
PcapDotNet/src/PcapDotNet.Base/SerialNumber32.cs
View file @
1a372992
...
@@ -4,6 +4,7 @@ namespace PcapDotNet.Base
...
@@ -4,6 +4,7 @@ namespace PcapDotNet.Base
{
{
public
struct
SerialNumber32
:
IEquatable
<
SerialNumber32
>,
IComparable
<
SerialNumber32
>
public
struct
SerialNumber32
:
IEquatable
<
SerialNumber32
>,
IComparable
<
SerialNumber32
>
{
{
public
const
int
SizeOf
=
sizeof
(
uint
);
public
const
int
SerialBits
=
32
;
public
const
int
SerialBits
=
32
;
public
const
uint
MaxAdditiveNumber
=
((
uint
)
1
<<
(
SerialBits
-
1
))
-
1
;
public
const
uint
MaxAdditiveNumber
=
((
uint
)
1
<<
(
SerialBits
-
1
))
-
1
;
...
...
PcapDotNet/src/PcapDotNet.Packets.TestUtils/RandomDnsExtensions.cs
View file @
1a372992
...
@@ -149,6 +149,7 @@ namespace PcapDotNet.Packets.TestUtils
...
@@ -149,6 +149,7 @@ namespace PcapDotNet.Packets.TestUtils
return
new
DnsResourceDataMailExchange
(
random
.
NextUShort
(),
random
.
NextDnsDomainName
());
return
new
DnsResourceDataMailExchange
(
random
.
NextUShort
(),
random
.
NextDnsDomainName
());
case
DnsType
.
Txt
:
case
DnsType
.
Txt
:
case
DnsType
.
Spf
:
return
new
DnsResourceDataText
(((
Func
<
DataSegment
>)(()
=>
random
.
NextDataSegment
(
random
.
Next
(
10
)))).
GenerateArray
(
10
).
AsReadOnly
());
return
new
DnsResourceDataText
(((
Func
<
DataSegment
>)(()
=>
random
.
NextDataSegment
(
random
.
Next
(
10
)))).
GenerateArray
(
10
).
AsReadOnly
());
case
DnsType
.
Rp
:
case
DnsType
.
Rp
:
...
@@ -297,6 +298,11 @@ namespace PcapDotNet.Packets.TestUtils
...
@@ -297,6 +298,11 @@ namespace PcapDotNet.Packets.TestUtils
case
DnsType
.
TaLink
:
case
DnsType
.
TaLink
:
return
new
DnsResourceDataTrustAnchorLink
(
random
.
NextDnsDomainName
(),
random
.
NextDnsDomainName
());
return
new
DnsResourceDataTrustAnchorLink
(
random
.
NextDnsDomainName
(),
random
.
NextDnsDomainName
());
case
DnsType
.
TKey
:
return
new
DnsResourceDataTransactionKey
(
random
.
NextDnsDomainName
(),
random
.
NextUInt
(),
random
.
NextUInt
(),
random
.
NextEnum
<
DnsTransactionKeyMode
>(),
random
.
NextEnum
<
DnsResponseCode
>(),
random
.
NextDataSegment
(
random
.
NextInt
(
0
,
100
)),
random
.
NextDataSegment
(
random
.
NextInt
(
0
,
100
)));
default
:
default
:
return
new
DnsResourceDataAnything
(
random
.
NextDataSegment
(
random
.
Next
(
100
)));
return
new
DnsResourceDataAnything
(
random
.
NextDataSegment
(
random
.
Next
(
100
)));
}
}
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/DnsDatagram.cs
View file @
1a372992
...
@@ -73,7 +73,7 @@ namespace PcapDotNet.Packets.Dns
...
@@ -73,7 +73,7 @@ namespace PcapDotNet.Packets.Dns
public
const
byte
IsRecusionDesired
=
0x01
;
public
const
byte
IsRecusionDesired
=
0x01
;
public
const
byte
IsRecusionAvailable
=
0x80
;
public
const
byte
IsRecusionAvailable
=
0x80
;
public
const
byte
FutureUse
=
0x60
;
public
const
byte
FutureUse
=
0x60
;
public
const
byte
ResponseCode
=
0x1F
;
public
const
ushort
ResponseCode
=
0x1F
;
}
}
private
static
class
Shift
private
static
class
Shift
...
@@ -327,7 +327,7 @@ namespace PcapDotNet.Packets.Dns
...
@@ -327,7 +327,7 @@ namespace PcapDotNet.Packets.Dns
if
(
isRecursionAvailable
)
if
(
isRecursionAvailable
)
flags1
|=
Mask
.
IsRecusionAvailable
;
flags1
|=
Mask
.
IsRecusionAvailable
;
flags1
|=
(
byte
)((
futureUse
<<
Shift
.
FutureUse
)
&
Mask
.
FutureUse
);
flags1
|=
(
byte
)((
futureUse
<<
Shift
.
FutureUse
)
&
Mask
.
FutureUse
);
flags1
|=
(
byte
)((
byte
)
responseCode
&
Mask
.
ResponseCode
);
flags1
|=
(
byte
)((
ushort
)
responseCode
&
Mask
.
ResponseCode
);
buffer
.
Write
(
offset
+
Offset
.
IsRecusionAvailable
,
flags1
);
buffer
.
Write
(
offset
+
Offset
.
IsRecusionAvailable
,
flags1
);
DnsDomainNameCompressionData
compressionData
=
new
DnsDomainNameCompressionData
(
domainNameCompressionMode
);
DnsDomainNameCompressionData
compressionData
=
new
DnsDomainNameCompressionData
(
domainNameCompressionMode
);
int
recordOffset
=
HeaderLength
;
int
recordOffset
=
HeaderLength
;
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/DnsResourceData.cs
View file @
1a372992
This diff is collapsed.
Click to expand it.
PcapDotNet/src/PcapDotNet.Packets/Dns/DnsResponseCode.cs
View file @
1a372992
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
/// <summary>
/// <summary>
/// RFCs 1035, 2136, 2671, 2845, 2930, 4635.
/// RFCs 1035, 2136, 2671, 2845, 2930, 4635.
/// </summary>
/// </summary>
public
enum
DnsResponseCode
:
byte
public
enum
DnsResponseCode
:
ushort
{
{
/// <summary>
/// <summary>
/// RFC 1035.
/// RFC 1035.
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/DnsType.cs
View file @
1a372992
...
@@ -407,32 +407,39 @@
...
@@ -407,32 +407,39 @@
/// <summary>
/// <summary>
/// RFC 4408.
/// RFC 4408.
/// Sender Policy Framework.
/// Payload type: DnsResourceDataText.
/// </summary>
/// </summary>
Spf
=
99
,
Spf
=
99
,
/// <summary>
/// <summary>
/// IANA-Reserved.
/// IANA-Reserved.
/// Not documented.
/// </summary>
/// </summary>
UInfo
=
100
,
UInfo
=
100
,
/// <summary>
/// <summary>
/// IANA-Reserved.
/// IANA-Reserved.
/// Not documented.
/// </summary>
/// </summary>
Uid
=
101
,
Uid
=
101
,
/// <summary>
/// <summary>
/// IANA-Reserved.
/// IANA-Reserved.
/// Not documented.
/// </summary>
/// </summary>
Gid
=
102
,
Gid
=
102
,
/// <summary>
/// <summary>
/// IANA-Reserved.
/// IANA-Reserved.
/// Not documented.
/// </summary>
/// </summary>
UnSpec
=
103
,
UnSpec
=
103
,
/// <summary>
/// <summary>
/// RFC 2930.
/// RFC 2930.
/// Transaction Key.
/// Transaction Key.
/// Payload type: DnsResourceDataTransactionKey.
/// </summary>
/// </summary>
TKey
=
249
,
TKey
=
249
,
...
...
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