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
b5224c38
Commit
b5224c38
authored
Jan 27, 2012
by
Brickner_cp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DNS
Code coverage 94.28%
parent
16498b62
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
108 additions
and
14 deletions
+108
-14
LivePacketDeviceTests.cs
PcapDotNet/src/PcapDotNet.Core.Test/LivePacketDeviceTests.cs
+2
-2
DnsTests.cs
PcapDotNet/src/PcapDotNet.Packets.Test/DnsTests.cs
+102
-11
DnsResourceData.cs
...rc/PcapDotNet.Packets/Dns/ResourceData/DnsResourceData.cs
+2
-0
DnsResourceDataNamingAuthorityPointer.cs
...Dns/ResourceData/DnsResourceDataNamingAuthorityPointer.cs
+2
-1
No files found.
PcapDotNet/src/PcapDotNet.Core.Test/LivePacketDeviceTests.cs
View file @
b5224c38
...
@@ -161,7 +161,7 @@ namespace PcapDotNet.Core.Test
...
@@ -161,7 +161,7 @@ namespace PcapDotNet.Core.Test
TestReceivePackets
(
NumPacketsToSend
,
NumPacketsToSend
/
2
,
int
.
MaxValue
,
2
,
PacketSize
,
PacketCommunicatorReceiveResult
.
Ok
,
NumPacketsToSend
/
2
,
0
,
0.04
);
TestReceivePackets
(
NumPacketsToSend
,
NumPacketsToSend
/
2
,
int
.
MaxValue
,
2
,
PacketSize
,
PacketCommunicatorReceiveResult
.
Ok
,
NumPacketsToSend
/
2
,
0
,
0.04
);
// Wait for more packets
// Wait for more packets
TestReceivePackets
(
NumPacketsToSend
,
0
,
int
.
MaxValue
,
2
,
PacketSize
,
PacketCommunicatorReceiveResult
.
None
,
NumPacketsToSend
,
2
,
2.
14
);
TestReceivePackets
(
NumPacketsToSend
,
0
,
int
.
MaxValue
,
2
,
PacketSize
,
PacketCommunicatorReceiveResult
.
None
,
NumPacketsToSend
,
2
,
2.
45
);
TestReceivePackets
(
NumPacketsToSend
,
-
1
,
int
.
MaxValue
,
2
,
PacketSize
,
PacketCommunicatorReceiveResult
.
None
,
NumPacketsToSend
,
2
,
2.3
);
TestReceivePackets
(
NumPacketsToSend
,
-
1
,
int
.
MaxValue
,
2
,
PacketSize
,
PacketCommunicatorReceiveResult
.
None
,
NumPacketsToSend
,
2
,
2.3
);
TestReceivePackets
(
NumPacketsToSend
,
NumPacketsToSend
+
1
,
int
.
MaxValue
,
2
,
PacketSize
,
PacketCommunicatorReceiveResult
.
None
,
NumPacketsToSend
,
2
,
2.12
);
TestReceivePackets
(
NumPacketsToSend
,
NumPacketsToSend
+
1
,
int
.
MaxValue
,
2
,
PacketSize
,
PacketCommunicatorReceiveResult
.
None
,
NumPacketsToSend
,
2
,
2.12
);
...
@@ -319,7 +319,7 @@ namespace PcapDotNet.Core.Test
...
@@ -319,7 +319,7 @@ namespace PcapDotNet.Core.Test
// Wait for less statistics
// Wait for less statistics
TestGetStatistics
(
SourceMac
,
DestinationMac
,
NumPacketsToSend
,
NumStatisticsToGather
/
2
,
int
.
MaxValue
,
5
,
PacketSize
,
TestGetStatistics
(
SourceMac
,
DestinationMac
,
NumPacketsToSend
,
NumStatisticsToGather
/
2
,
int
.
MaxValue
,
5
,
PacketSize
,
PacketCommunicatorReceiveResult
.
Ok
,
NumStatisticsToGather
/
2
,
NumPacketsToSend
,
NumStatisticsToGather
/
2
,
NumStatisticsToGather
/
2
+
0.
053
);
PacketCommunicatorReceiveResult
.
Ok
,
NumStatisticsToGather
/
2
,
NumPacketsToSend
,
NumStatisticsToGather
/
2
,
NumStatisticsToGather
/
2
+
0.
17
);
// Wait for more statistics
// Wait for more statistics
TestGetStatistics
(
SourceMac
,
DestinationMac
,
NumPacketsToSend
,
0
,
int
.
MaxValue
,
5.5
,
PacketSize
,
TestGetStatistics
(
SourceMac
,
DestinationMac
,
NumPacketsToSend
,
0
,
int
.
MaxValue
,
5.5
,
PacketSize
,
...
...
PcapDotNet/src/PcapDotNet.Packets.Test/DnsTests.cs
View file @
b5224c38
This diff is collapsed.
Click to expand it.
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsResourceData.cs
View file @
b5224c38
...
@@ -10,6 +10,8 @@ namespace PcapDotNet.Packets.Dns
...
@@ -10,6 +10,8 @@ namespace PcapDotNet.Packets.Dns
{
{
public
abstract
class
DnsResourceData
:
IEquatable
<
DnsResourceData
>
public
abstract
class
DnsResourceData
:
IEquatable
<
DnsResourceData
>
{
{
internal
const
int
StringMinimumLength
=
sizeof
(
byte
);
public
static
Type
GetDnsResourceDataType
(
DnsType
dnsType
)
public
static
Type
GetDnsResourceDataType
(
DnsType
dnsType
)
{
{
DnsResourceData
prototype
=
TryGetPrototype
(
dnsType
);
DnsResourceData
prototype
=
TryGetPrototype
(
dnsType
);
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsResourceDataNamingAuthorityPointer.cs
View file @
b5224c38
...
@@ -38,6 +38,7 @@ namespace PcapDotNet.Packets.Dns
...
@@ -38,6 +38,7 @@ namespace PcapDotNet.Packets.Dns
}
}
private
const
int
ConstantPartLength
=
Offset
.
Flags
;
private
const
int
ConstantPartLength
=
Offset
.
Flags
;
private
const
int
MinimumLength
=
ConstantPartLength
+
StringMinimumLength
+
StringMinimumLength
+
StringMinimumLength
+
DnsDomainName
.
RootLength
;
public
DnsResourceDataNamingAuthorityPointer
(
ushort
order
,
ushort
preference
,
DataSegment
flags
,
DataSegment
services
,
DataSegment
regexp
,
DnsDomainName
replacement
)
public
DnsResourceDataNamingAuthorityPointer
(
ushort
order
,
ushort
preference
,
DataSegment
flags
,
DataSegment
services
,
DataSegment
regexp
,
DnsDomainName
replacement
)
{
{
...
@@ -160,7 +161,7 @@ namespace PcapDotNet.Packets.Dns
...
@@ -160,7 +161,7 @@ namespace PcapDotNet.Packets.Dns
internal
override
DnsResourceData
CreateInstance
(
DnsDatagram
dns
,
int
offsetInDns
,
int
length
)
internal
override
DnsResourceData
CreateInstance
(
DnsDatagram
dns
,
int
offsetInDns
,
int
length
)
{
{
if
(
length
<
ConstantPart
Length
)
if
(
length
<
Minimum
Length
)
return
null
;
return
null
;
ushort
order
=
dns
.
ReadUShort
(
offsetInDns
+
Offset
.
Order
,
Endianity
.
Big
);
ushort
order
=
dns
.
ReadUShort
(
offsetInDns
+
Offset
.
Order
,
Endianity
.
Big
);
...
...
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