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
65a24f13
Commit
65a24f13
authored
Sep 17, 2011
by
Brickner_cp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DNS
parent
64ffbb1d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
310 additions
and
3 deletions
+310
-3
RandomDnsExtensions.cs
...t/src/PcapDotNet.Packets.TestUtils/RandomDnsExtensions.cs
+14
-0
DataSegment.cs
PcapDotNet/src/PcapDotNet.Packets/DataSegment.cs
+11
-0
DnsResourceData.cs
PcapDotNet/src/PcapDotNet.Packets/Dns/DnsResourceData.cs
+284
-3
DnsType.cs
PcapDotNet/src/PcapDotNet.Packets/Dns/DnsType.cs
+1
-0
No files found.
PcapDotNet/src/PcapDotNet.Packets.TestUtils/RandomDnsExtensions.cs
View file @
65a24f13
...
@@ -117,6 +117,20 @@ namespace PcapDotNet.Packets.TestUtils
...
@@ -117,6 +117,20 @@ namespace PcapDotNet.Packets.TestUtils
case
DnsType
.
AfsDb
:
case
DnsType
.
AfsDb
:
return
new
DnsResourceDataAfsDb
(
random
.
NextUShort
(),
random
.
NextDnsDomainName
());
return
new
DnsResourceDataAfsDb
(
random
.
NextUShort
(),
random
.
NextDnsDomainName
());
case
DnsType
.
X25
:
return
new
DnsResourceDataString
(
random
.
NextDataSegment
(
random
.
Next
(
10
)));
case
DnsType
.
Isdn
:
return
random
.
NextBool
()
?
new
DnsResourceDataIsdn
(
random
.
NextDataSegment
(
random
.
Next
(
10
)))
:
new
DnsResourceDataIsdn
(
random
.
NextDataSegment
(
random
.
Next
(
10
)),
random
.
NextDataSegment
(
random
.
Next
(
10
)));
case
DnsType
.
Rt
:
return
new
DnsResourceDataRouteThrough
(
random
.
NextUShort
(),
random
.
NextDnsDomainName
());
case
DnsType
.
Nsap
:
return
new
DnsResourceDataNetworkServiceAccessPoint
(
random
.
NextDataSegment
(
1
+
random
.
Next
(
10
)),
random
.
NextUInt48
(),
random
.
NextByte
());
default
:
default
:
return
new
DnsResourceDataAnything
(
random
.
NextDataSegment
(
random
.
Next
(
100
)));
return
new
DnsResourceDataAnything
(
random
.
NextDataSegment
(
random
.
Next
(
100
)));
}
}
...
...
PcapDotNet/src/PcapDotNet.Packets/DataSegment.cs
View file @
65a24f13
...
@@ -218,6 +218,17 @@ namespace PcapDotNet.Packets
...
@@ -218,6 +218,17 @@ namespace PcapDotNet.Packets
return
Buffer
.
ReadUInt
(
StartOffset
+
offset
,
endianity
);
return
Buffer
.
ReadUInt
(
StartOffset
+
offset
,
endianity
);
}
}
/// <summary>
/// Reads 6 bytes from a specific offset in the segment as a UInt48 with a given endianity.
/// </summary>
/// <param name="offset">The offset in the segment to start reading.</param>
/// <param name="endianity">The endianity to use to translate the bytes to the value.</param>
/// <returns>The value converted from the read bytes according to the endianity.</returns>
internal
UInt48
ReadUInt48
(
int
offset
,
Endianity
endianity
)
{
return
Buffer
.
ReadUInt48
(
StartOffset
+
offset
,
endianity
);
}
/// <summary>
/// <summary>
/// Reads 6 bytes from a specific offset in the segment as a MacAddress with a given endianity.
/// Reads 6 bytes from a specific offset in the segment as a MacAddress with a given endianity.
/// </summary>
/// </summary>
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/DnsResourceData.cs
View file @
65a24f13
This diff is collapsed.
Click to expand it.
PcapDotNet/src/PcapDotNet.Packets/Dns/DnsType.cs
View file @
65a24f13
...
@@ -136,6 +136,7 @@
...
@@ -136,6 +136,7 @@
/// <summary>
/// <summary>
/// RFC 1706.
/// RFC 1706.
/// Network Service Access Point.
/// For NSAP address, NSAP style A record.
/// For NSAP address, NSAP style A record.
/// </summary>
/// </summary>
Nsap
=
22
,
Nsap
=
22
,
...
...
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