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
bb3f755e
Commit
bb3f755e
authored
Feb 04, 2012
by
Brickner_cp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Warnings, Code Analysis and Documentation. 815 warnings left.
parent
6dbe3788
Hide whitespace changes
Inline
Side-by-side
Showing
92 changed files
with
573 additions
and
107 deletions
+573
-107
IEnumerableExtensionsTests.cs
...et/src/PcapDotNet.Base.Test/IEnumerableExtensionsTests.cs
+2
-2
BitSequence.cs
PcapDotNet/src/PcapDotNet.Base/BitSequence.cs
+100
-0
InlineEqualityComparer.cs
PcapDotNet/src/PcapDotNet.Base/InlineEqualityComparer.cs
+6
-6
PcapDotNet.Base.csproj
PcapDotNet/src/PcapDotNet.Base/PcapDotNet.Base.csproj
+2
-0
Sequence.cs
PcapDotNet/src/PcapDotNet.Base/Sequence.cs
+35
-0
SerialNumber32.cs
PcapDotNet/src/PcapDotNet.Base/SerialNumber32.cs
+5
-0
UInt128.cs
PcapDotNet/src/PcapDotNet.Base/UInt128.cs
+1
-1
UInt24.cs
PcapDotNet/src/PcapDotNet.Base/UInt24.cs
+5
-0
WiresharkDatagramComparerIgmp.cs
...src/PcapDotNet.Core.Test/WiresharkDatagramComparerIgmp.cs
+1
-0
ArpLayer.cs
PcapDotNet/src/PcapDotNet.Packets/Arp/ArpLayer.cs
+2
-1
Datagram.cs
PcapDotNet/src/PcapDotNet.Packets/Datagram.cs
+1
-1
DnsDataResourceRecord.cs
...otNet/src/PcapDotNet.Packets/Dns/DnsDataResourceRecord.cs
+6
-0
DnsDomainName.cs
PcapDotNet/src/PcapDotNet.Packets/Dns/DnsDomainName.cs
+5
-0
DnsOptResourceRecord.cs
...DotNet/src/PcapDotNet.Packets/Dns/DnsOptResourceRecord.cs
+4
-2
DnsOptionAnything.cs
PcapDotNet/src/PcapDotNet.Packets/Dns/DnsOptionAnything.cs
+5
-0
DnsQueryResourceRecord.cs
...tNet/src/PcapDotNet.Packets/Dns/DnsQueryResourceRecord.cs
+5
-0
DnsResourceRecord.cs
PcapDotNet/src/PcapDotNet.Packets/Dns/DnsResourceRecord.cs
+6
-0
DnsAddressPrefix.cs
...c/PcapDotNet.Packets/Dns/ResourceData/DnsAddressPrefix.cs
+7
-0
DnsGateway.cs
...Net/src/PcapDotNet.Packets/Dns/ResourceData/DnsGateway.cs
+7
-0
DnsGatewayDomainName.cs
...apDotNet.Packets/Dns/ResourceData/DnsGatewayDomainName.cs
+5
-0
DnsGatewayIpV4.cs
...src/PcapDotNet.Packets/Dns/ResourceData/DnsGatewayIpV4.cs
+5
-0
DnsGatewayIpV6.cs
...src/PcapDotNet.Packets/Dns/ResourceData/DnsGatewayIpV6.cs
+5
-0
DnsGatewayNone.cs
...src/PcapDotNet.Packets/Dns/ResourceData/DnsGatewayNone.cs
+5
-0
DnsOption.cs
...tNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsOption.cs
+7
-0
DnsOptionLongLivedQuery.cs
...otNet.Packets/Dns/ResourceData/DnsOptionLongLivedQuery.cs
+8
-1
DnsOptionUpdateLease.cs
...apDotNet.Packets/Dns/ResourceData/DnsOptionUpdateLease.cs
+5
-0
DnsOptions.cs
...Net/src/PcapDotNet.Packets/Dns/ResourceData/DnsOptions.cs
+5
-0
DnsResourceData.cs
...rc/PcapDotNet.Packets/Dns/ResourceData/DnsResourceData.cs
+1
-8
DnsResourceDataA6.cs
.../PcapDotNet.Packets/Dns/ResourceData/DnsResourceDataA6.cs
+6
-1
DnsResourceDataAddressPrefixList.cs
...kets/Dns/ResourceData/DnsResourceDataAddressPrefixList.cs
+6
-1
DnsResourceDataAnything.cs
...otNet.Packets/Dns/ResourceData/DnsResourceDataAnything.cs
+7
-1
DnsResourceDataAtmAddress.cs
...Net.Packets/Dns/ResourceData/DnsResourceDataAtmAddress.cs
+7
-1
DnsResourceDataCertificate.cs
...et.Packets/Dns/ResourceData/DnsResourceDataCertificate.cs
+7
-1
DnsResourceDataCertificationAuthorityAuthorization.cs
...ata/DnsResourceDataCertificationAuthorityAuthorization.cs
+7
-1
DnsResourceDataDelegationSigner.cs
...ckets/Dns/ResourceData/DnsResourceDataDelegationSigner.cs
+7
-1
DnsResourceDataDnsKey.cs
...pDotNet.Packets/Dns/ResourceData/DnsResourceDataDnsKey.cs
+7
-1
DnsResourceDataDomainName.cs
...Net.Packets/Dns/ResourceData/DnsResourceDataDomainName.cs
+6
-1
DnsResourceDataDomainNames.cs
...et.Packets/Dns/ResourceData/DnsResourceDataDomainNames.cs
+6
-1
DnsResourceDataGeographicalPosition.cs
...s/Dns/ResourceData/DnsResourceDataGeographicalPosition.cs
+7
-1
DnsResourceDataHostIdentityProtocol.cs
...s/Dns/ResourceData/DnsResourceDataHostIdentityProtocol.cs
+7
-1
DnsResourceDataIpSecKey.cs
...otNet.Packets/Dns/ResourceData/DnsResourceDataIpSecKey.cs
+7
-1
DnsResourceDataIpV4.cs
...capDotNet.Packets/Dns/ResourceData/DnsResourceDataIpV4.cs
+6
-1
DnsResourceDataIpV6.cs
...capDotNet.Packets/Dns/ResourceData/DnsResourceDataIpV6.cs
+6
-1
DnsResourceDataKey.cs
...PcapDotNet.Packets/Dns/ResourceData/DnsResourceDataKey.cs
+12
-1
DnsResourceDataLocationInformation.cs
...ts/Dns/ResourceData/DnsResourceDataLocationInformation.cs
+8
-1
DnsResourceDataNamingAuthorityPointer.cs
...Dns/ResourceData/DnsResourceDataNamingAuthorityPointer.cs
+6
-1
DnsResourceDataNetworkServiceAccessPoint.cs
.../ResourceData/DnsResourceDataNetworkServiceAccessPoint.cs
+6
-1
DnsResourceDataNextDomain.cs
...Net.Packets/Dns/ResourceData/DnsResourceDataNextDomain.cs
+7
-1
DnsResourceDataNextDomainSecure.cs
...ckets/Dns/ResourceData/DnsResourceDataNextDomainSecure.cs
+7
-1
DnsResourceDataNextDomainSecure3.cs
...kets/Dns/ResourceData/DnsResourceDataNextDomainSecure3.cs
+7
-1
DnsResourceDataNextDomainSecure3Base.cs
.../Dns/ResourceData/DnsResourceDataNextDomainSecure3Base.cs
+6
-0
DnsResourceDataNextDomainSecure3Parameters.cs
...esourceData/DnsResourceDataNextDomainSecure3Parameters.cs
+6
-1
DnsResourceDataOptions.cs
...DotNet.Packets/Dns/ResourceData/DnsResourceDataOptions.cs
+6
-1
DnsResourceDataRKey.cs
...capDotNet.Packets/Dns/ResourceData/DnsResourceDataRKey.cs
+7
-1
DnsResourceDataServerSelection.cs
...ackets/Dns/ResourceData/DnsResourceDataServerSelection.cs
+7
-1
DnsResourceDataSig.cs
...PcapDotNet.Packets/Dns/ResourceData/DnsResourceDataSig.cs
+7
-1
DnsResourceDataSink.cs
...capDotNet.Packets/Dns/ResourceData/DnsResourceDataSink.cs
+8
-2
DnsResourceDataSshFingerprint.cs
...Packets/Dns/ResourceData/DnsResourceDataSshFingerprint.cs
+7
-1
DnsResourceDataStartOfAuthority.cs
...ckets/Dns/ResourceData/DnsResourceDataStartOfAuthority.cs
+6
-1
DnsResourceDataString.cs
...pDotNet.Packets/Dns/ResourceData/DnsResourceDataString.cs
+6
-1
DnsResourceDataStrings.cs
...DotNet.Packets/Dns/ResourceData/DnsResourceDataStrings.cs
+6
-1
DnsResourceDataTransactionKey.cs
...Packets/Dns/ResourceData/DnsResourceDataTransactionKey.cs
+6
-1
DnsResourceDataTransactionSignature.cs
...s/Dns/ResourceData/DnsResourceDataTransactionSignature.cs
+6
-1
DnsResourceDataTrustAnchorLink.cs
...ackets/Dns/ResourceData/DnsResourceDataTrustAnchorLink.cs
+7
-1
DnsResourceDataUShortDomainName.cs
...ckets/Dns/ResourceData/DnsResourceDataUShortDomainName.cs
+7
-1
DnsResourceDataUri.cs
...PcapDotNet.Packets/Dns/ResourceData/DnsResourceDataUri.cs
+6
-1
DnsResourceDataWellKnownService.cs
...ckets/Dns/ResourceData/DnsResourceDataWellKnownService.cs
+7
-1
DnsResourceDataX400Pointer.cs
...et.Packets/Dns/ResourceData/DnsResourceDataX400Pointer.cs
+7
-1
DnsTypeBitmaps.cs
...src/PcapDotNet.Packets/Dns/ResourceData/DnsTypeBitmaps.cs
+6
-0
EthernetLayer.cs
PcapDotNet/src/PcapDotNet.Packets/Ethernet/EthernetLayer.cs
+2
-1
MacAddress.cs
PcapDotNet/src/PcapDotNet.Packets/Ethernet/MacAddress.cs
+2
-6
GreLayer.cs
PcapDotNet/src/PcapDotNet.Packets/Gre/GreLayer.cs
+2
-1
GreSourceRouteEntry.cs
PcapDotNet/src/PcapDotNet.Packets/Gre/GreSourceRouteEntry.cs
+2
-1
HttpFieldParameters.cs
...DotNet/src/PcapDotNet.Packets/Http/HttpFieldParameters.cs
+1
-1
HttpVersion.cs
PcapDotNet/src/PcapDotNet.Packets/Http/HttpVersion.cs
+1
-1
IcmpIdentifiedLayer.cs
...DotNet/src/PcapDotNet.Packets/Icmp/IcmpIdentifiedLayer.cs
+3
-1
IcmpLayer.cs
PcapDotNet/src/PcapDotNet.Packets/Icmp/IcmpLayer.cs
+3
-2
IcmpRouterAdvertisementEntry.cs
...c/PcapDotNet.Packets/Icmp/IcmpRouterAdvertisementEntry.cs
+2
-1
IgmpGroupRecord.cs
PcapDotNet/src/PcapDotNet.Packets/Igmp/IgmpGroupRecord.cs
+1
-2
IgmpLayer.cs
PcapDotNet/src/PcapDotNet.Packets/Igmp/IgmpLayer.cs
+1
-1
IgmpQueryVersion3Layer.cs
...Net/src/PcapDotNet.Packets/Igmp/IgmpQueryVersion3Layer.cs
+1
-2
IpV4Address.cs
PcapDotNet/src/PcapDotNet.Packets/IpV4/IpV4Address.cs
+5
-4
IpV4Layer.cs
PcapDotNet/src/PcapDotNet.Packets/IpV4/IpV4Layer.cs
+3
-7
IpV4OptionBasicSecurity.cs
...et/src/PcapDotNet.Packets/IpV4/IpV4OptionBasicSecurity.cs
+2
-1
IpV4OptionQuickStart.cs
...otNet/src/PcapDotNet.Packets/IpV4/IpV4OptionQuickStart.cs
+2
-2
IpV4OptionTimedAddress.cs
...Net/src/PcapDotNet.Packets/IpV4/IpV4OptionTimedAddress.cs
+2
-2
IpV4OptionTimestamp.cs
...DotNet/src/PcapDotNet.Packets/IpV4/IpV4OptionTimestamp.cs
+2
-2
IpV4OptionTraceRoute.cs
...otNet/src/PcapDotNet.Packets/IpV4/IpV4OptionTraceRoute.cs
+2
-3
Layer.cs
PcapDotNet/src/PcapDotNet.Packets/Layer.cs
+1
-0
TcpOptionPartialOrderServiceProfile.cs
....Packets/Transport/TcpOptionPartialOrderServiceProfile.cs
+2
-1
TcpOptionSelectiveAcknowledgmentBlock.cs
...ackets/Transport/TcpOptionSelectiveAcknowledgmentBlock.cs
+2
-1
TransportLayer.cs
...DotNet/src/PcapDotNet.Packets/Transport/TransportLayer.cs
+2
-2
No files found.
PcapDotNet/src/PcapDotNet.Base.Test/IEnumerableExtensionsTests.cs
View file @
bb3f755e
...
@@ -53,7 +53,7 @@ namespace PcapDotNet.Base.Test
...
@@ -53,7 +53,7 @@ namespace PcapDotNet.Base.Test
{
{
int
[]
sequence
=
new
[]{
1
,
2
,
3
,
4
,
5
};
int
[]
sequence
=
new
[]{
1
,
2
,
3
,
4
,
5
};
Assert
.
AreEqual
(
1.
GetHashCode
()
^
2.
GetHashCode
()
^
3.
GetHashCode
()
^
4.
GetHashCode
()
^
5.
GetHashCode
(),
sequence
.
SequenceGetHashCode
());
Assert
.
AreEqual
(
1.
GetHashCode
()
^
2.
GetHashCode
()
^
3.
GetHashCode
()
^
4.
GetHashCode
()
^
5.
GetHashCode
(),
sequence
.
SequenceGetHashCode
());
}
}
[
TestMethod
]
[
TestMethod
]
...
@@ -61,7 +61,7 @@ namespace PcapDotNet.Base.Test
...
@@ -61,7 +61,7 @@ namespace PcapDotNet.Base.Test
{
{
byte
[]
sequence
=
new
byte
[]
{
1
,
2
,
3
,
4
,
5
};
byte
[]
sequence
=
new
byte
[]
{
1
,
2
,
3
,
4
,
5
};
Assert
.
AreEqual
(
1
^
(
2
<<
8
)
^
(
3
<<
16
)
^
(
4
<<
24
)
^
5
,
sequence
.
BytesSequenceGetHashCode
());
Assert
.
AreEqual
(
(
int
)
BitSequence
.
Merge
(
4
,
3
,
2
,
1
)
^
5
,
sequence
.
BytesSequenceGetHashCode
());
}
}
[
TestMethod
]
[
TestMethod
]
...
...
PcapDotNet/src/PcapDotNet.Base/BitSequence.cs
0 → 100644
View file @
bb3f755e
namespace
PcapDotNet.Base
{
public
static
class
BitSequence
{
public
static
byte
ToByte
(
this
bool
value
)
{
return
value
?
(
byte
)
1
:
(
byte
)
0
;
}
public
static
byte
Merge
(
bool
value1
,
bool
value2
)
{
return
(
byte
)((
value1
.
ToByte
()
<<
1
)
|
value2
.
ToByte
());
}
public
static
byte
Merge
(
bool
value1
,
bool
value2
,
bool
value3
)
{
return
(
byte
)((
Merge
(
value1
,
value2
)
<<
1
)
|
value3
.
ToByte
());
}
public
static
byte
Merge
(
bool
value1
,
bool
value2
,
bool
value3
,
bool
value4
)
{
return
(
byte
)((
Merge
(
value1
,
value2
,
value3
)
<<
1
)
|
value4
.
ToByte
());
}
public
static
byte
Merge
(
bool
value1
,
bool
value2
,
bool
value3
,
bool
value4
,
bool
value5
)
{
return
(
byte
)((
Merge
(
value1
,
value2
,
value3
,
value4
)
<<
1
)
|
value5
.
ToByte
());
}
public
static
byte
Merge
(
bool
value1
,
bool
value2
,
bool
value3
,
bool
value4
,
bool
value5
,
bool
value6
)
{
return
(
byte
)((
Merge
(
value1
,
value2
,
value3
,
value4
,
value5
)
<<
1
)
|
value6
.
ToByte
());
}
public
static
byte
Merge
(
bool
value1
,
bool
value2
,
bool
value3
,
bool
value4
,
bool
value5
,
bool
value6
,
bool
value7
)
{
return
(
byte
)((
Merge
(
value1
,
value2
,
value3
,
value4
,
value5
,
value6
)
<<
1
)
|
value7
.
ToByte
());
}
public
static
byte
Merge
(
bool
value1
,
bool
value2
,
bool
value3
,
bool
value4
,
bool
value5
,
bool
value6
,
bool
value7
,
bool
value8
)
{
return
(
byte
)((
Merge
(
value1
,
value2
,
value3
,
value4
,
value5
,
value6
,
value7
)
<<
1
)
|
value8
.
ToByte
());
}
public
static
ushort
Merge
(
byte
value1
,
byte
value2
)
{
return
(
ushort
)((
value1
<<
8
)
|
value2
);
}
public
static
UInt24
Merge
(
byte
value1
,
byte
value2
,
byte
value3
)
{
return
(
UInt24
)
Merge
(
0
,
value1
,
value2
,
value3
);
}
public
static
uint
Merge
(
byte
value1
,
byte
value2
,
byte
value3
,
byte
value4
)
{
return
Merge
(
Merge
(
value1
,
value2
),
Merge
(
value3
,
value4
));
}
public
static
UInt48
Merge
(
byte
value1
,
byte
value2
,
byte
value3
,
byte
value4
,
byte
value5
,
byte
value6
)
{
return
(
UInt48
)
Merge
(
0
,
0
,
value1
,
value2
,
value3
,
value4
,
value5
,
value6
);
}
public
static
ulong
Merge
(
byte
value1
,
byte
value2
,
byte
value3
,
byte
value4
,
byte
value5
,
byte
value6
,
byte
value7
,
byte
value8
)
{
return
Merge
(
Merge
(
value1
,
value2
,
value3
,
value4
),
Merge
(
value5
,
value6
,
value7
,
value8
));
}
public
static
uint
Merge
(
ushort
value1
,
ushort
value2
)
{
return
(
uint
)((
value1
<<
16
)
|
value2
);
}
public
static
UInt24
Merge
(
byte
value1
,
ushort
value2
)
{
return
(
UInt24
)
Merge
(
0
,
value1
,
value2
);
}
public
static
uint
Merge
(
ushort
value1
,
byte
value2
,
byte
value3
)
{
return
Merge
(
value1
,
Merge
(
value2
,
value3
));
}
public
static
uint
Merge
(
byte
value1
,
ushort
value2
,
byte
value3
)
{
return
(
uint
)((
value1
<<
24
)
|
(
value2
<<
8
)
|
value3
);
}
public
static
uint
Merge
(
byte
value1
,
byte
value2
,
ushort
value3
)
{
return
Merge
(
Merge
(
value1
,
value2
),
value3
);
}
public
static
ulong
Merge
(
uint
value1
,
uint
value2
)
{
return
(((
ulong
)
value1
)
<<
32
)
|
value2
;
}
}
}
\ No newline at end of file
PcapDotNet/src/PcapDotNet.Base/InlineEqualityComparer.cs
View file @
bb3f755e
...
@@ -7,21 +7,21 @@ namespace PcapDotNet.Base
...
@@ -7,21 +7,21 @@ namespace PcapDotNet.Base
{
{
public
InlineEqualityComparer
(
Func
<
T
,
T
,
bool
>
equals
,
Func
<
T
,
int
>
getHashCode
)
public
InlineEqualityComparer
(
Func
<
T
,
T
,
bool
>
equals
,
Func
<
T
,
int
>
getHashCode
)
{
{
Equals
=
equals
;
Equals
Func
=
equals
;
GetHashCode
=
getHashCode
;
GetHashCode
Func
=
getHashCode
;
}
}
bool
IEqualityComparer
<
T
>.
Equals
(
T
x
,
T
y
)
bool
IEqualityComparer
<
T
>.
Equals
(
T
x
,
T
y
)
{
{
return
Equals
(
x
,
y
);
return
Equals
Func
(
x
,
y
);
}
}
int
IEqualityComparer
<
T
>.
GetHashCode
(
T
obj
)
int
IEqualityComparer
<
T
>.
GetHashCode
(
T
obj
)
{
{
return
GetHashCode
(
obj
);
return
GetHashCode
Func
(
obj
);
}
}
private
Func
<
T
,
T
,
bool
>
Equals
{
get
;
set
;
}
private
Func
<
T
,
T
,
bool
>
Equals
Func
{
get
;
set
;
}
private
Func
<
T
,
int
>
GetHashCode
{
get
;
set
;
}
private
Func
<
T
,
int
>
GetHashCode
Func
{
get
;
set
;
}
}
}
}
}
\ No newline at end of file
PcapDotNet/src/PcapDotNet.Base/PcapDotNet.Base.csproj
View file @
bb3f755e
...
@@ -85,6 +85,7 @@
...
@@ -85,6 +85,7 @@
<Reference
Include=
"System.Xml"
/>
<Reference
Include=
"System.Xml"
/>
</ItemGroup>
</ItemGroup>
<ItemGroup>
<ItemGroup>
<Compile
Include=
"BitSequence.cs"
/>
<Compile
Include=
"CharExtensions.cs"
/>
<Compile
Include=
"CharExtensions.cs"
/>
<Compile
Include=
"DateTimeExtensions.cs"
/>
<Compile
Include=
"DateTimeExtensions.cs"
/>
<Compile
Include=
"EncodingExtensions.cs"
/>
<Compile
Include=
"EncodingExtensions.cs"
/>
...
@@ -96,6 +97,7 @@
...
@@ -96,6 +97,7 @@
<Compile
Include=
"MatchExtensions.cs"
/>
<Compile
Include=
"MatchExtensions.cs"
/>
<Compile
Include=
"MemberInfoExtensions.cs"
/>
<Compile
Include=
"MemberInfoExtensions.cs"
/>
<Compile
Include=
"PropertyInfoExtensions.cs"
/>
<Compile
Include=
"PropertyInfoExtensions.cs"
/>
<Compile
Include=
"Sequence.cs"
/>
<Compile
Include=
"SerialNumber32.cs"
/>
<Compile
Include=
"SerialNumber32.cs"
/>
<Compile
Include=
"TimeSpanExtensions.cs"
/>
<Compile
Include=
"TimeSpanExtensions.cs"
/>
<Compile
Include=
"TypeExtensions.cs"
/>
<Compile
Include=
"TypeExtensions.cs"
/>
...
...
PcapDotNet/src/PcapDotNet.Base/Sequence.cs
0 → 100644
View file @
bb3f755e
namespace
PcapDotNet.Base
{
public
static
class
Sequence
{
public
static
int
GetHashCode
(
object
value1
,
object
value2
)
{
return
value1
.
GetHashCode
()
^
value2
.
GetHashCode
();
}
public
static
int
GetHashCode
(
object
value1
,
object
value2
,
object
value3
)
{
return
GetHashCode
(
value1
,
value2
)
^
value3
.
GetHashCode
();
}
public
static
int
GetHashCode
(
object
value1
,
object
value2
,
object
value3
,
object
value4
)
{
return
GetHashCode
(
value1
,
value2
,
value3
)
^
value4
.
GetHashCode
();
}
public
static
int
GetHashCode
(
object
value1
,
object
value2
,
object
value3
,
object
value4
,
object
value5
)
{
return
GetHashCode
(
value1
,
value2
,
value3
,
value4
)
^
value5
.
GetHashCode
();
}
public
static
int
GetHashCode
(
object
value1
,
object
value2
,
object
value3
,
object
value4
,
object
value5
,
object
value6
)
{
return
GetHashCode
(
value1
,
value2
,
value3
,
value4
,
value5
)
^
value6
.
GetHashCode
();
}
public
static
int
GetHashCode
(
object
value1
,
object
value2
,
object
value3
,
object
value4
,
object
value5
,
object
value6
,
object
value7
)
{
return
GetHashCode
(
value1
,
value2
,
value3
,
value4
,
value5
,
value6
)
^
value7
.
GetHashCode
();
}
}
}
\ No newline at end of file
PcapDotNet/src/PcapDotNet.Base/SerialNumber32.cs
View file @
bb3f755e
...
@@ -34,6 +34,11 @@ namespace PcapDotNet.Base
...
@@ -34,6 +34,11 @@ namespace PcapDotNet.Base
Equals
((
SerialNumber32
)
obj
);
Equals
((
SerialNumber32
)
obj
);
}
}
public
override
int
GetHashCode
()
{
return
Value
.
GetHashCode
();
}
public
int
CompareTo
(
SerialNumber32
other
)
public
int
CompareTo
(
SerialNumber32
other
)
{
{
if
(
Equals
(
other
))
if
(
Equals
(
other
))
...
...
PcapDotNet/src/PcapDotNet.Base/UInt128.cs
View file @
bb3f755e
...
@@ -519,7 +519,7 @@ namespace PcapDotNet.Base
...
@@ -519,7 +519,7 @@ namespace PcapDotNet.Base
/// <filterpriority>2</filterpriority>
/// <filterpriority>2</filterpriority>
public
override
int
GetHashCode
()
public
override
int
GetHashCode
()
{
{
return
_mostSignificant
.
GetHashCode
()
^
_leastSignificant
.
GetHashCode
(
);
return
Sequence
.
GetHashCode
(
_mostSignificant
,
_leastSignificant
);
}
}
/// <summary>
/// <summary>
...
...
PcapDotNet/src/PcapDotNet.Base/UInt24.cs
View file @
bb3f755e
...
@@ -29,6 +29,11 @@ namespace PcapDotNet.Base
...
@@ -29,6 +29,11 @@ namespace PcapDotNet.Base
return
new
UInt24
(
value
);
return
new
UInt24
(
value
);
}
}
public
static
explicit
operator
UInt24
(
uint
value
)
{
return
new
UInt24
((
int
)
value
);
}
/// <summary>
/// <summary>
/// Converts the 24 bits unsigned integer to a 32 bits signed integer.
/// Converts the 24 bits unsigned integer to a 32 bits signed integer.
/// </summary>
/// </summary>
...
...
PcapDotNet/src/PcapDotNet.Core.Test/WiresharkDatagramComparerIgmp.cs
View file @
bb3f755e
...
@@ -109,6 +109,7 @@ namespace PcapDotNet.Core.Test
...
@@ -109,6 +109,7 @@ namespace PcapDotNet.Core.Test
private
static
void
CompareIgmpGroupRecord
(
XElement
groupRecord
,
IgmpGroupRecordDatagram
groupRecordDatagram
)
private
static
void
CompareIgmpGroupRecord
(
XElement
groupRecord
,
IgmpGroupRecordDatagram
groupRecordDatagram
)
{
{
Console
.
WriteLine
(
groupRecordDatagram
.
AuxiliaryData
);
int
sourceAddressIndex
=
0
;
int
sourceAddressIndex
=
0
;
foreach
(
var
field
in
groupRecord
.
Fields
())
foreach
(
var
field
in
groupRecord
.
Fields
())
{
{
...
...
PcapDotNet/src/PcapDotNet.Packets/Arp/ArpLayer.cs
View file @
bb3f755e
using
System
;
using
System
;
using
System.Collections.ObjectModel
;
using
System.Collections.ObjectModel
;
using
System.Linq
;
using
System.Linq
;
using
PcapDotNet.Base
;
using
PcapDotNet.Packets.Ethernet
;
using
PcapDotNet.Packets.Ethernet
;
namespace
PcapDotNet.Packets.Arp
namespace
PcapDotNet.Packets.Arp
...
@@ -135,7 +136,7 @@ namespace PcapDotNet.Packets.Arp
...
@@ -135,7 +136,7 @@ namespace PcapDotNet.Packets.Arp
public
override
int
GetHashCode
()
public
override
int
GetHashCode
()
{
{
return
base
.
GetHashCode
()
^
return
base
.
GetHashCode
()
^
(((
ushort
)
ProtocolType
<<
16
)
+
(
ushort
)
Operation
);
BitSequence
.
Merge
((
ushort
)
ProtocolType
,
(
ushort
)
Operation
).
GetHashCode
(
);
}
}
}
}
}
}
\ No newline at end of file
PcapDotNet/src/PcapDotNet.Packets/Datagram.cs
View file @
bb3f755e
...
@@ -33,7 +33,7 @@ namespace PcapDotNet.Packets
...
@@ -33,7 +33,7 @@ namespace PcapDotNet.Packets
/// An empty datagram.
/// An empty datagram.
/// Useful for empty payloads.
/// Useful for empty payloads.
/// </summary>
/// </summary>
public
static
Datagram
Empty
public
new
static
Datagram
Empty
{
{
get
{
return
_empty
;
}
get
{
return
_empty
;
}
}
}
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/DnsDataResourceRecord.cs
View file @
bb3f755e
using
System
;
using
System
;
using
PcapDotNet.Base
;
namespace
PcapDotNet.Packets.Dns
namespace
PcapDotNet.Packets.Dns
{
{
...
@@ -52,6 +53,11 @@ namespace PcapDotNet.Packets.Dns
...
@@ -52,6 +53,11 @@ namespace PcapDotNet.Packets.Dns
return
Equals
(
obj
as
DnsDataResourceRecord
);
return
Equals
(
obj
as
DnsDataResourceRecord
);
}
}
public
override
int
GetHashCode
()
{
return
GetHashCodeBase
()
^
Sequence
.
GetHashCode
(
Ttl
,
Data
);
}
internal
static
DnsDataResourceRecord
Parse
(
DnsDatagram
dns
,
int
offsetInDns
,
out
int
numBytesRead
)
internal
static
DnsDataResourceRecord
Parse
(
DnsDatagram
dns
,
int
offsetInDns
,
out
int
numBytesRead
)
{
{
DnsDomainName
domainName
;
DnsDomainName
domainName
;
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/DnsDomainName.cs
View file @
bb3f755e
...
@@ -63,6 +63,11 @@ namespace PcapDotNet.Packets.Dns
...
@@ -63,6 +63,11 @@ namespace PcapDotNet.Packets.Dns
return
Equals
(
obj
as
DnsDomainName
);
return
Equals
(
obj
as
DnsDomainName
);
}
}
public
override
int
GetHashCode
()
{
return
_labels
.
SequenceGetHashCode
();
}
internal
int
GetLength
(
DnsDomainNameCompressionData
compressionData
,
int
offsetInDns
)
internal
int
GetLength
(
DnsDomainNameCompressionData
compressionData
,
int
offsetInDns
)
{
{
int
length
=
0
;
int
length
=
0
;
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/DnsOptResourceRecord.cs
View file @
bb3f755e
namespace
PcapDotNet.Packets.Dns
using
PcapDotNet.Base
;
namespace
PcapDotNet.Packets.Dns
{
{
/// <summary>
/// <summary>
/// RFC 2671.
/// RFC 2671.
...
@@ -27,7 +29,7 @@
...
@@ -27,7 +29,7 @@
public
sealed
class
DnsOptResourceRecord
:
DnsDataResourceRecord
public
sealed
class
DnsOptResourceRecord
:
DnsDataResourceRecord
{
{
public
DnsOptResourceRecord
(
DnsDomainName
domainName
,
ushort
sendersUdpPayloadSize
,
byte
extendedRcode
,
DnsOptVersion
version
,
DnsOptFlags
flags
,
DnsResourceDataOptions
data
)
public
DnsOptResourceRecord
(
DnsDomainName
domainName
,
ushort
sendersUdpPayloadSize
,
byte
extendedRcode
,
DnsOptVersion
version
,
DnsOptFlags
flags
,
DnsResourceDataOptions
data
)
:
this
(
domainName
,
(
DnsClass
)
sendersUdpPayloadSize
,
(
extendedRcode
<<
24
)
|
((
byte
)
version
<<
16
)
|
(
ushort
)
flags
,
data
)
:
this
(
domainName
,
(
DnsClass
)
sendersUdpPayloadSize
,
(
int
)
BitSequence
.
Merge
(
extendedRcode
,
(
byte
)
version
,
(
ushort
)
flags
)
,
data
)
{
{
}
}
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/DnsOptionAnything.cs
View file @
bb3f755e
...
@@ -22,6 +22,11 @@ namespace PcapDotNet.Packets.Dns
...
@@ -22,6 +22,11 @@ namespace PcapDotNet.Packets.Dns
return
Data
.
Equals
(((
DnsOptionAnything
)
other
).
Data
);
return
Data
.
Equals
(((
DnsOptionAnything
)
other
).
Data
);
}
}
internal
override
int
DataGetHashCode
()
{
return
Data
.
GetHashCode
();
}
internal
override
void
WriteData
(
byte
[]
buffer
,
ref
int
offset
)
internal
override
void
WriteData
(
byte
[]
buffer
,
ref
int
offset
)
{
{
Data
.
Write
(
buffer
,
ref
offset
);
Data
.
Write
(
buffer
,
ref
offset
);
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/DnsQueryResourceRecord.cs
View file @
bb3f755e
...
@@ -31,6 +31,11 @@ namespace PcapDotNet.Packets.Dns
...
@@ -31,6 +31,11 @@ namespace PcapDotNet.Packets.Dns
return
Equals
(
obj
as
DnsQueryResourceRecord
);
return
Equals
(
obj
as
DnsQueryResourceRecord
);
}
}
public
override
int
GetHashCode
()
{
return
GetHashCodeBase
();
}
internal
static
DnsQueryResourceRecord
Parse
(
DnsDatagram
dns
,
int
offsetInDns
,
out
int
numBytesRead
)
internal
static
DnsQueryResourceRecord
Parse
(
DnsDatagram
dns
,
int
offsetInDns
,
out
int
numBytesRead
)
{
{
DnsDomainName
domainName
;
DnsDomainName
domainName
;
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/DnsResourceRecord.cs
View file @
bb3f755e
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
PcapDotNet.Base
;
namespace
PcapDotNet.Packets.Dns
namespace
PcapDotNet.Packets.Dns
{
{
...
@@ -86,6 +87,11 @@ namespace PcapDotNet.Packets.Dns
...
@@ -86,6 +87,11 @@ namespace PcapDotNet.Packets.Dns
DnsClass
.
Equals
(
other
.
DnsClass
);
DnsClass
.
Equals
(
other
.
DnsClass
);
}
}
internal
int
GetHashCodeBase
()
{
return
Sequence
.
GetHashCode
(
DomainName
,
BitSequence
.
Merge
((
ushort
)
Type
,
(
ushort
)
DnsClass
));
}
internal
static
bool
TryParseBase
(
DnsDatagram
dns
,
int
offsetInDns
,
internal
static
bool
TryParseBase
(
DnsDatagram
dns
,
int
offsetInDns
,
out
DnsDomainName
domainName
,
out
DnsType
type
,
out
DnsClass
dnsClass
,
out
int
numBytesRead
)
out
DnsDomainName
domainName
,
out
DnsType
type
,
out
DnsClass
dnsClass
,
out
int
numBytesRead
)
{
{
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsAddressPrefix.cs
View file @
bb3f755e
using
System
;
using
System
;
using
PcapDotNet.Base
;
namespace
PcapDotNet.Packets.Dns
namespace
PcapDotNet.Packets.Dns
{
{
...
@@ -106,6 +107,12 @@ namespace PcapDotNet.Packets.Dns
...
@@ -106,6 +107,12 @@ namespace PcapDotNet.Packets.Dns
return
Equals
(
obj
as
DnsAddressPrefix
);
return
Equals
(
obj
as
DnsAddressPrefix
);
}
}
public
override
int
GetHashCode
()
{
return
BitSequence
.
Merge
((
ushort
)
AddressFamily
,
PrefixLength
,
(
byte
)(((
Negation
?
1
:
0
)
<<
7
)
|
AddressFamilyDependentPart
.
Length
)).
GetHashCode
()
^
AddressFamilyDependentPart
.
BytesSequenceGetHashCode
();
}
public
static
DnsAddressPrefix
Read
(
DataSegment
data
)
public
static
DnsAddressPrefix
Read
(
DataSegment
data
)
{
{
if
(
data
.
Length
<
MinimumLength
)
if
(
data
.
Length
<
MinimumLength
)
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsGateway.cs
View file @
bb3f755e
...
@@ -19,6 +19,13 @@ namespace PcapDotNet.Packets.Dns
...
@@ -19,6 +19,13 @@ namespace PcapDotNet.Packets.Dns
return
Equals
(
obj
as
DnsGateway
);
return
Equals
(
obj
as
DnsGateway
);
}
}
public
override
int
GetHashCode
()
{
return
Type
.
GetHashCode
()
^
DataGetHashCode
();
}
internal
abstract
int
DataGetHashCode
();
internal
abstract
void
Write
(
byte
[]
buffer
,
int
offset
);
internal
abstract
void
Write
(
byte
[]
buffer
,
int
offset
);
internal
static
DnsGateway
CreateInstance
(
DnsGatewayType
gatewayType
,
DnsDatagram
dns
,
int
offsetInDns
,
int
length
)
internal
static
DnsGateway
CreateInstance
(
DnsGatewayType
gatewayType
,
DnsDatagram
dns
,
int
offsetInDns
,
int
length
)
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsGatewayDomainName.cs
View file @
bb3f755e
...
@@ -32,6 +32,11 @@ namespace PcapDotNet.Packets.Dns
...
@@ -32,6 +32,11 @@ namespace PcapDotNet.Packets.Dns
return
Equals
(
other
as
DnsGatewayDomainName
);
return
Equals
(
other
as
DnsGatewayDomainName
);
}
}
internal
override
int
DataGetHashCode
()
{
return
Value
.
GetHashCode
();
}
internal
override
void
Write
(
byte
[]
buffer
,
int
offset
)
internal
override
void
Write
(
byte
[]
buffer
,
int
offset
)
{
{
Value
.
WriteUncompressed
(
buffer
,
offset
);
Value
.
WriteUncompressed
(
buffer
,
offset
);
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsGatewayIpV4.cs
View file @
bb3f755e
...
@@ -33,6 +33,11 @@ namespace PcapDotNet.Packets.Dns
...
@@ -33,6 +33,11 @@ namespace PcapDotNet.Packets.Dns
return
Equals
(
other
as
DnsGatewayIpV4
);
return
Equals
(
other
as
DnsGatewayIpV4
);
}
}
internal
override
int
DataGetHashCode
()
{
return
Value
.
GetHashCode
();
}
internal
override
void
Write
(
byte
[]
buffer
,
int
offset
)
internal
override
void
Write
(
byte
[]
buffer
,
int
offset
)
{
{
buffer
.
Write
(
offset
,
Value
,
Endianity
.
Big
);
buffer
.
Write
(
offset
,
Value
,
Endianity
.
Big
);
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsGatewayIpV6.cs
View file @
bb3f755e
...
@@ -33,6 +33,11 @@ namespace PcapDotNet.Packets.Dns
...
@@ -33,6 +33,11 @@ namespace PcapDotNet.Packets.Dns
return
Equals
(
other
as
DnsGatewayIpV6
);
return
Equals
(
other
as
DnsGatewayIpV6
);
}
}
internal
override
int
DataGetHashCode
()
{
return
Value
.
GetHashCode
();
}
internal
override
void
Write
(
byte
[]
buffer
,
int
offset
)
internal
override
void
Write
(
byte
[]
buffer
,
int
offset
)
{
{
buffer
.
Write
(
offset
,
Value
,
Endianity
.
Big
);
buffer
.
Write
(
offset
,
Value
,
Endianity
.
Big
);
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsGatewayNone.cs
View file @
bb3f755e
...
@@ -24,6 +24,11 @@ namespace PcapDotNet.Packets.Dns
...
@@ -24,6 +24,11 @@ namespace PcapDotNet.Packets.Dns
return
Equals
(
other
as
DnsGatewayNone
);
return
Equals
(
other
as
DnsGatewayNone
);
}
}
internal
override
int
DataGetHashCode
()
{
return
0
;
}
internal
DnsGatewayNone
()
internal
DnsGatewayNone
()
{
{
}
}
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsOption.cs
View file @
bb3f755e
...
@@ -23,6 +23,11 @@ namespace PcapDotNet.Packets.Dns
...
@@ -23,6 +23,11 @@ namespace PcapDotNet.Packets.Dns
return
Equals
(
obj
as
DnsOption
);
return
Equals
(
obj
as
DnsOption
);
}
}
public
override
int
GetHashCode
()
{
return
Code
.
GetHashCode
()
^
DataGetHashCode
();
}
internal
DnsOption
(
DnsOptionCode
code
)
internal
DnsOption
(
DnsOptionCode
code
)
{
{
Code
=
code
;
Code
=
code
;
...
@@ -30,6 +35,8 @@ namespace PcapDotNet.Packets.Dns
...
@@ -30,6 +35,8 @@ namespace PcapDotNet.Packets.Dns
internal
abstract
bool
EqualsData
(
DnsOption
other
);
internal
abstract
bool
EqualsData
(
DnsOption
other
);
internal
abstract
int
DataGetHashCode
();
internal
void
Write
(
byte
[]
buffer
,
ref
int
offset
)
internal
void
Write
(
byte
[]
buffer
,
ref
int
offset
)
{
{
buffer
.
Write
(
ref
offset
,
(
ushort
)
Code
,
Endianity
.
Big
);
buffer
.
Write
(
ref
offset
,
(
ushort
)
Code
,
Endianity
.
Big
);
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsOptionLongLivedQuery.cs
View file @
bb3f755e
namespace
PcapDotNet.Packets.Dns
using
PcapDotNet.Base
;
namespace
PcapDotNet.Packets.Dns
{
{
/// <summary>
/// <summary>
/// http://files.dns-sd.org/draft-sekar-dns-llq.txt.
/// http://files.dns-sd.org/draft-sekar-dns-llq.txt.
...
@@ -66,6 +68,11 @@
...
@@ -66,6 +68,11 @@
LeaseLife
.
Equals
(
castedOther
.
LeaseLife
);
LeaseLife
.
Equals
(
castedOther
.
LeaseLife
);
}
}
internal
override
int
DataGetHashCode
()
{
return
Sequence
.
GetHashCode
(
BitSequence
.
Merge
(
Version
,
(
ushort
)
Opcode
),
ErrorCode
,
Id
,
LeaseLife
);
}
internal
override
void
WriteData
(
byte
[]
buffer
,
ref
int
offset
)
internal
override
void
WriteData
(
byte
[]
buffer
,
ref
int
offset
)
{
{
buffer
.
Write
(
offset
+
Offset
.
Version
,
Version
,
Endianity
.
Big
);
buffer
.
Write
(
offset
+
Offset
.
Version
,
Version
,
Endianity
.
Big
);
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsOptionUpdateLease.cs
View file @
bb3f755e
...
@@ -42,6 +42,11 @@
...
@@ -42,6 +42,11 @@
return
Lease
.
Equals
(((
DnsOptionUpdateLease
)
other
).
Lease
);
return
Lease
.
Equals
(((
DnsOptionUpdateLease
)
other
).
Lease
);
}
}
internal
override
int
DataGetHashCode
()
{
return
Lease
.
GetHashCode
();
}
internal
override
void
WriteData
(
byte
[]
buffer
,
ref
int
offset
)
internal
override
void
WriteData
(
byte
[]
buffer
,
ref
int
offset
)
{
{
buffer
.
Write
(
ref
offset
,
Lease
,
Endianity
.
Big
);
buffer
.
Write
(
ref
offset
,
Lease
,
Endianity
.
Big
);
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsOptions.cs
View file @
bb3f755e
...
@@ -36,6 +36,11 @@ namespace PcapDotNet.Packets.Dns
...
@@ -36,6 +36,11 @@ namespace PcapDotNet.Packets.Dns
return
Equals
(
obj
as
DnsOptions
);
return
Equals
(
obj
as
DnsOptions
);
}
}
public
override
int
GetHashCode
()
{
return
Options
.
SequenceGetHashCode
();
}
private
static
readonly
DnsOptions
_none
=
new
DnsOptions
();
private
static
readonly
DnsOptions
_none
=
new
DnsOptions
();
internal
void
Write
(
byte
[]
buffer
,
int
offset
)
internal
void
Write
(
byte
[]
buffer
,
int
offset
)
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsResourceData.cs
View file @
bb3f755e
...
@@ -8,7 +8,7 @@ using PcapDotNet.Base;
...
@@ -8,7 +8,7 @@ using PcapDotNet.Base;
namespace
PcapDotNet.Packets.Dns
namespace
PcapDotNet.Packets.Dns
{
{
public
abstract
class
DnsResourceData
:
IEquatable
<
DnsResourceData
>
public
abstract
class
DnsResourceData
{
{
internal
const
int
StringMinimumLength
=
sizeof
(
byte
);
internal
const
int
StringMinimumLength
=
sizeof
(
byte
);
...
@@ -20,13 +20,6 @@ namespace PcapDotNet.Packets.Dns
...
@@ -20,13 +20,6 @@ namespace PcapDotNet.Packets.Dns
return
prototype
.
GetType
();
return
prototype
.
GetType
();
}
}
public
abstract
bool
Equals
(
DnsResourceData
other
);
public
sealed
override
bool
Equals
(
object
obj
)
{
return
Equals
(
obj
as
DnsResourceData
);
}
internal
abstract
int
GetLength
(
DnsDomainNameCompressionData
compressionData
,
int
offsetInDns
);
internal
abstract
int
GetLength
(
DnsDomainNameCompressionData
compressionData
,
int
offsetInDns
);
internal
int
Write
(
byte
[]
buffer
,
int
dnsOffset
,
int
offsetInDns
,
DnsDomainNameCompressionData
compressionData
)
internal
int
Write
(
byte
[]
buffer
,
int
dnsOffset
,
int
offsetInDns
,
DnsDomainNameCompressionData
compressionData
)
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsResourceDataA6.cs
View file @
bb3f755e
...
@@ -80,11 +80,16 @@ namespace PcapDotNet.Packets.Dns
...
@@ -80,11 +80,16 @@ namespace PcapDotNet.Packets.Dns
PrefixName
.
Equals
(
other
.
PrefixName
);
PrefixName
.
Equals
(
other
.
PrefixName
);
}
}
public
override
bool
Equals
(
DnsResourceData
other
)
public
override
bool
Equals
(
object
other
)
{
{
return
Equals
(
other
as
DnsResourceDataA6
);
return
Equals
(
other
as
DnsResourceDataA6
);
}
}
public
override
int
GetHashCode
()
{
return
Sequence
.
GetHashCode
(
PrefixLength
,
AddressSuffix
,
PrefixName
);
}
internal
DnsResourceDataA6
()
internal
DnsResourceDataA6
()
:
this
(
0
,
IpV6Address
.
MaxValue
,
DnsDomainName
.
Root
)
:
this
(
0
,
IpV6Address
.
MaxValue
,
DnsDomainName
.
Root
)
{
{
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsResourceDataAddressPrefixList.cs
View file @
bb3f755e
...
@@ -45,11 +45,16 @@ namespace PcapDotNet.Packets.Dns
...
@@ -45,11 +45,16 @@ namespace PcapDotNet.Packets.Dns
Items
.
SequenceEqual
(
other
.
Items
);
Items
.
SequenceEqual
(
other
.
Items
);
}
}
public
override
bool
Equals
(
DnsResourceData
other
)
public
override
bool
Equals
(
object
other
)
{
{
return
Equals
(
other
as
DnsResourceDataAddressPrefixList
);
return
Equals
(
other
as
DnsResourceDataAddressPrefixList
);
}
}
public
override
int
GetHashCode
()
{
return
Items
.
SequenceGetHashCode
();
}
internal
DnsResourceDataAddressPrefixList
()
internal
DnsResourceDataAddressPrefixList
()
:
this
(
new
DnsAddressPrefix
[
0
])
:
this
(
new
DnsAddressPrefix
[
0
])
{
{
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsResourceDataAnything.cs
View file @
bb3f755e
using
System
;
using
System
;
using
PcapDotNet.Base
;
namespace
PcapDotNet.Packets.Dns
namespace
PcapDotNet.Packets.Dns
{
{
...
@@ -28,11 +29,16 @@ namespace PcapDotNet.Packets.Dns
...
@@ -28,11 +29,16 @@ namespace PcapDotNet.Packets.Dns
return
other
!=
null
&&
Data
.
Equals
(
other
.
Data
);
return
other
!=
null
&&
Data
.
Equals
(
other
.
Data
);
}
}
public
override
bool
Equals
(
DnsResourceData
other
)
public
override
bool
Equals
(
object
other
)
{
{
return
Equals
(
other
as
DnsResourceDataAnything
);
return
Equals
(
other
as
DnsResourceDataAnything
);
}
}
public
override
int
GetHashCode
()
{
return
Data
.
GetHashCode
();
}
internal
override
int
GetLength
()
internal
override
int
GetLength
()
{
{
return
Data
.
Length
;
return
Data
.
Length
;
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsResourceDataAtmAddress.cs
View file @
bb3f755e
using
System
;
using
System
;
using
PcapDotNet.Base
;
namespace
PcapDotNet.Packets.Dns
namespace
PcapDotNet.Packets.Dns
{
{
...
@@ -53,11 +54,16 @@ namespace PcapDotNet.Packets.Dns
...
@@ -53,11 +54,16 @@ namespace PcapDotNet.Packets.Dns
Address
.
Equals
(
other
.
Address
);
Address
.
Equals
(
other
.
Address
);
}
}
public
override
bool
Equals
(
DnsResourceData
other
)
public
override
bool
Equals
(
object
other
)
{
{
return
Equals
(
other
as
DnsResourceDataAtmAddress
);
return
Equals
(
other
as
DnsResourceDataAtmAddress
);
}
}
public
override
int
GetHashCode
()
{
return
Sequence
.
GetHashCode
(
Format
,
Address
);
}
internal
DnsResourceDataAtmAddress
()
internal
DnsResourceDataAtmAddress
()
:
this
(
DnsAtmAddressFormat
.
AtmEndSystemAddress
,
DataSegment
.
Empty
)
:
this
(
DnsAtmAddressFormat
.
AtmEndSystemAddress
,
DataSegment
.
Empty
)
{
{
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsResourceDataCertificate.cs
View file @
bb3f755e
using
System
;
using
System
;
using
PcapDotNet.Base
;
namespace
PcapDotNet.Packets.Dns
namespace
PcapDotNet.Packets.Dns
{
{
...
@@ -75,11 +76,16 @@ namespace PcapDotNet.Packets.Dns
...
@@ -75,11 +76,16 @@ namespace PcapDotNet.Packets.Dns
Certificate
.
Equals
(
other
.
Certificate
);
Certificate
.
Equals
(
other
.
Certificate
);
}
}
public
override
bool
Equals
(
DnsResourceData
other
)
public
override
bool
Equals
(
object
other
)
{
{
return
Equals
(
other
as
DnsResourceDataCertificate
);
return
Equals
(
other
as
DnsResourceDataCertificate
);
}
}
public
override
int
GetHashCode
()
{
return
Sequence
.
GetHashCode
(
BitSequence
.
Merge
((
ushort
)
CertificateType
,
KeyTag
),
Algorithm
,
Certificate
);
}
internal
DnsResourceDataCertificate
()
internal
DnsResourceDataCertificate
()
:
this
(
DnsCertificateType
.
Pkix
,
0
,
DnsAlgorithm
.
None
,
DataSegment
.
Empty
)
:
this
(
DnsCertificateType
.
Pkix
,
0
,
DnsAlgorithm
.
None
,
DataSegment
.
Empty
)
{
{
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsResourceDataCertificationAuthorityAuthorization.cs
View file @
bb3f755e
using
System
;
using
System
;
using
System.Linq
;
using
System.Linq
;
using
PcapDotNet.Base
;
namespace
PcapDotNet.Packets.Dns
namespace
PcapDotNet.Packets.Dns
{
{
...
@@ -67,11 +68,16 @@ namespace PcapDotNet.Packets.Dns
...
@@ -67,11 +68,16 @@ namespace PcapDotNet.Packets.Dns
Value
.
SequenceEqual
(
other
.
Value
);
Value
.
SequenceEqual
(
other
.
Value
);
}
}
public
override
bool
Equals
(
DnsResourceData
other
)
public
override
bool
Equals
(
object
other
)
{
{
return
Equals
(
other
as
DnsResourceDataCertificationAuthorityAuthorization
);
return
Equals
(
other
as
DnsResourceDataCertificationAuthorityAuthorization
);
}
}
public
override
int
GetHashCode
()
{
return
Sequence
.
GetHashCode
(
Flags
,
Tag
,
Value
);
}
internal
DnsResourceDataCertificationAuthorityAuthorization
()
internal
DnsResourceDataCertificationAuthorityAuthorization
()
:
this
(
0
,
DataSegment
.
Empty
,
DataSegment
.
Empty
)
:
this
(
0
,
DataSegment
.
Empty
,
DataSegment
.
Empty
)
{
{
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsResourceDataDelegationSigner.cs
View file @
bb3f755e
using
System
;
using
System
;
using
PcapDotNet.Base
;
namespace
PcapDotNet.Packets.Dns
namespace
PcapDotNet.Packets.Dns
{
{
...
@@ -95,11 +96,16 @@ namespace PcapDotNet.Packets.Dns
...
@@ -95,11 +96,16 @@ namespace PcapDotNet.Packets.Dns
Digest
.
Equals
(
other
.
Digest
);
Digest
.
Equals
(
other
.
Digest
);
}
}
public
override
bool
Equals
(
DnsResourceData
other
)
public
override
bool
Equals
(
object
other
)
{
{
return
Equals
(
other
as
DnsResourceDataDelegationSigner
);
return
Equals
(
other
as
DnsResourceDataDelegationSigner
);
}
}
public
override
int
GetHashCode
()
{
return
Sequence
.
GetHashCode
(
BitSequence
.
Merge
(
KeyTag
,
(
byte
)
Algorithm
,
(
byte
)
DigestType
),
Digest
);
}
internal
DnsResourceDataDelegationSigner
()
internal
DnsResourceDataDelegationSigner
()
:
this
(
0
,
DnsAlgorithm
.
None
,
DnsDigestType
.
Sha1
,
DataSegment
.
Empty
)
:
this
(
0
,
DnsAlgorithm
.
None
,
DnsDigestType
.
Sha1
,
DataSegment
.
Empty
)
{
{
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsResourceDataDnsKey.cs
View file @
bb3f755e
using
System
;
using
System
;
using
PcapDotNet.Base
;
namespace
PcapDotNet.Packets.Dns
namespace
PcapDotNet.Packets.Dns
{
{
...
@@ -100,11 +101,16 @@ namespace PcapDotNet.Packets.Dns
...
@@ -100,11 +101,16 @@ namespace PcapDotNet.Packets.Dns
PublicKey
.
Equals
(
other
.
PublicKey
);
PublicKey
.
Equals
(
other
.
PublicKey
);
}
}
public
override
bool
Equals
(
DnsResourceData
other
)
public
override
bool
Equals
(
object
other
)
{
{
return
Equals
(
other
as
DnsResourceDataDnsKey
);
return
Equals
(
other
as
DnsResourceDataDnsKey
);
}
}
public
override
int
GetHashCode
()
{
return
BitSequence
.
Merge
(
BitSequence
.
Merge
(
ZoneKey
,
Revoke
,
SecureEntryPoint
),
Protocol
,
(
byte
)
Algorithm
).
GetHashCode
();
}
internal
DnsResourceDataDnsKey
()
internal
DnsResourceDataDnsKey
()
:
this
(
false
,
false
,
false
,
ProtocolValue
,
DnsAlgorithm
.
None
,
DataSegment
.
Empty
)
:
this
(
false
,
false
,
false
,
ProtocolValue
,
DnsAlgorithm
.
None
,
DataSegment
.
Empty
)
{
{
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsResourceDataDomainName.cs
View file @
bb3f755e
...
@@ -34,11 +34,16 @@ namespace PcapDotNet.Packets.Dns
...
@@ -34,11 +34,16 @@ namespace PcapDotNet.Packets.Dns
return
other
!=
null
&&
Data
.
Equals
(
other
.
Data
);
return
other
!=
null
&&
Data
.
Equals
(
other
.
Data
);
}
}
public
override
bool
Equals
(
DnsResourceData
other
)
public
override
bool
Equals
(
object
other
)
{
{
return
Equals
(
other
as
DnsResourceDataDomainName
);
return
Equals
(
other
as
DnsResourceDataDomainName
);
}
}
public
override
int
GetHashCode
()
{
return
Data
.
GetHashCode
();
}
internal
DnsResourceDataDomainName
()
internal
DnsResourceDataDomainName
()
:
this
(
DnsDomainName
.
Root
)
:
this
(
DnsDomainName
.
Root
)
{
{
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsResourceDataDomainNames.cs
View file @
bb3f755e
...
@@ -18,11 +18,16 @@ namespace PcapDotNet.Packets.Dns
...
@@ -18,11 +18,16 @@ namespace PcapDotNet.Packets.Dns
DomainNames
.
SequenceEqual
(
other
.
DomainNames
);
DomainNames
.
SequenceEqual
(
other
.
DomainNames
);
}
}
public
sealed
override
bool
Equals
(
DnsResourceData
other
)
public
sealed
override
bool
Equals
(
object
other
)
{
{
return
Equals
(
other
as
DnsResourceDataDomainNames
);
return
Equals
(
other
as
DnsResourceDataDomainNames
);
}
}
public
override
int
GetHashCode
()
{
return
GetType
().
GetHashCode
()
^
DomainNames
.
SequenceGetHashCode
();
}
internal
DnsResourceDataDomainNames
(
ReadOnlyCollection
<
DnsDomainName
>
domainNames
)
internal
DnsResourceDataDomainNames
(
ReadOnlyCollection
<
DnsDomainName
>
domainNames
)
{
{
DomainNames
=
domainNames
;
DomainNames
=
domainNames
;
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsResourceDataGeographicalPosition.cs
View file @
bb3f755e
using
System
;
using
System
;
using
System.Text
;
using
System.Text
;
using
PcapDotNet.Base
;
namespace
PcapDotNet.Packets.Dns
namespace
PcapDotNet.Packets.Dns
{
{
...
@@ -55,11 +56,16 @@ namespace PcapDotNet.Packets.Dns
...
@@ -55,11 +56,16 @@ namespace PcapDotNet.Packets.Dns
}
}
public
override
bool
Equals
(
DnsResourceData
other
)
public
override
bool
Equals
(
object
other
)
{
{
return
Equals
(
other
as
DnsResourceDataGeographicalPosition
);
return
Equals
(
other
as
DnsResourceDataGeographicalPosition
);
}
}
public
override
int
GetHashCode
()
{
return
Sequence
.
GetHashCode
(
Longitude
,
Latitude
,
Altitude
);
}
internal
DnsResourceDataGeographicalPosition
()
internal
DnsResourceDataGeographicalPosition
()
:
this
(
string
.
Empty
,
string
.
Empty
,
string
.
Empty
)
:
this
(
string
.
Empty
,
string
.
Empty
,
string
.
Empty
)
{
{
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsResourceDataHostIdentityProtocol.cs
View file @
bb3f755e
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Collections.ObjectModel
;
using
System.Collections.ObjectModel
;
using
System.Linq
;
using
System.Linq
;
using
PcapDotNet.Base
;
using
IListExtensions
=
PcapDotNet
.
Base
.
IListExtensions
;
using
IListExtensions
=
PcapDotNet
.
Base
.
IListExtensions
;
namespace
PcapDotNet.Packets.Dns
namespace
PcapDotNet.Packets.Dns
...
@@ -85,11 +86,16 @@ namespace PcapDotNet.Packets.Dns
...
@@ -85,11 +86,16 @@ namespace PcapDotNet.Packets.Dns
RendezvousServers
.
SequenceEqual
(
RendezvousServers
);
RendezvousServers
.
SequenceEqual
(
RendezvousServers
);
}
}
public
override
bool
Equals
(
DnsResourceData
other
)
public
override
bool
Equals
(
object
other
)
{
{
return
Equals
(
other
as
DnsResourceDataHostIdentityProtocol
);
return
Equals
(
other
as
DnsResourceDataHostIdentityProtocol
);
}
}
public
override
int
GetHashCode
()
{
return
Sequence
.
GetHashCode
(
HostIdentityTag
,
PublicKeyAlgorithm
,
PublicKey
)
^
RendezvousServers
.
SequenceGetHashCode
();
}
internal
DnsResourceDataHostIdentityProtocol
()
internal
DnsResourceDataHostIdentityProtocol
()
:
this
(
DataSegment
.
Empty
,
DnsPublicKeyAlgorithm
.
None
,
DataSegment
.
Empty
,
new
DnsDomainName
[
0
])
:
this
(
DataSegment
.
Empty
,
DnsPublicKeyAlgorithm
.
None
,
DataSegment
.
Empty
,
new
DnsDomainName
[
0
])
{
{
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsResourceDataIpSecKey.cs
View file @
bb3f755e
using
System
;
using
System
;
using
PcapDotNet.Base
;
namespace
PcapDotNet.Packets.Dns
namespace
PcapDotNet.Packets.Dns
{
{
...
@@ -79,11 +80,16 @@ namespace PcapDotNet.Packets.Dns
...
@@ -79,11 +80,16 @@ namespace PcapDotNet.Packets.Dns
PublicKey
.
Equals
(
other
.
PublicKey
);
PublicKey
.
Equals
(
other
.
PublicKey
);
}
}
public
override
bool
Equals
(
DnsResourceData
other
)
public
override
bool
Equals
(
object
other
)
{
{
return
Equals
(
other
as
DnsResourceDataIpSecKey
);
return
Equals
(
other
as
DnsResourceDataIpSecKey
);
}
}
public
override
int
GetHashCode
()
{
return
Sequence
.
GetHashCode
(
BitSequence
.
Merge
(
Precedence
,
(
byte
)
Algorithm
),
Gateway
,
PublicKey
);
}
internal
DnsResourceDataIpSecKey
()
internal
DnsResourceDataIpSecKey
()
:
this
(
0
,
DnsGateway
.
None
,
DnsPublicKeyAlgorithm
.
None
,
DataSegment
.
Empty
)
:
this
(
0
,
DnsGateway
.
None
,
DnsPublicKeyAlgorithm
.
None
,
DataSegment
.
Empty
)
{
{
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsResourceDataIpV4.cs
View file @
bb3f755e
...
@@ -28,11 +28,16 @@ namespace PcapDotNet.Packets.Dns
...
@@ -28,11 +28,16 @@ namespace PcapDotNet.Packets.Dns
return
other
!=
null
&&
Data
.
Equals
(
other
.
Data
);
return
other
!=
null
&&
Data
.
Equals
(
other
.
Data
);
}
}
public
override
bool
Equals
(
DnsResourceData
other
)
public
override
bool
Equals
(
object
other
)
{
{
return
Equals
(
other
as
DnsResourceDataIpV4
);
return
Equals
(
other
as
DnsResourceDataIpV4
);
}
}
public
override
int
GetHashCode
()
{
return
Data
.
GetHashCode
();
}
internal
DnsResourceDataIpV4
()
internal
DnsResourceDataIpV4
()
:
this
(
IpV4Address
.
Zero
)
:
this
(
IpV4Address
.
Zero
)
{
{
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsResourceDataIpV6.cs
View file @
bb3f755e
...
@@ -28,11 +28,16 @@ namespace PcapDotNet.Packets.Dns
...
@@ -28,11 +28,16 @@ namespace PcapDotNet.Packets.Dns
return
other
!=
null
&&
Data
.
Equals
(
other
.
Data
);
return
other
!=
null
&&
Data
.
Equals
(
other
.
Data
);
}
}
public
override
bool
Equals
(
DnsResourceData
other
)
public
override
bool
Equals
(
object
other
)
{
{
return
Equals
(
other
as
DnsResourceDataIpV6
);
return
Equals
(
other
as
DnsResourceDataIpV6
);
}
}
public
override
int
GetHashCode
()
{
return
Data
.
GetHashCode
();
}
internal
DnsResourceDataIpV6
()
internal
DnsResourceDataIpV6
()
:
this
(
IpV6Address
.
Zero
)
:
this
(
IpV6Address
.
Zero
)
{
{
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsResourceDataKey.cs
View file @
bb3f755e
using
System
;
using
System
;
using
PcapDotNet.Base
;
namespace
PcapDotNet.Packets.Dns
namespace
PcapDotNet.Packets.Dns
{
{
...
@@ -172,11 +173,21 @@ namespace PcapDotNet.Packets.Dns
...
@@ -172,11 +173,21 @@ namespace PcapDotNet.Packets.Dns
PublicKey
.
Equals
(
other
.
PublicKey
);
PublicKey
.
Equals
(
other
.
PublicKey
);
}
}
public
override
bool
Equals
(
DnsResourceData
other
)
public
override
bool
Equals
(
object
other
)
{
{
return
Equals
(
other
as
DnsResourceDataKey
);
return
Equals
(
other
as
DnsResourceDataKey
);
}
}
public
override
int
GetHashCode
()
{
return
Sequence
.
GetHashCode
(
BitSequence
.
Merge
(
BitSequence
.
Merge
(
AuthenticationProhibited
,
ConfidentialityProhibited
,
Experimental
,
UserAssociated
,
IpSec
,
Email
),
(
byte
)
NameType
,
(
byte
)
Signatory
,
(
byte
)
Protocol
),
BitSequence
.
Merge
((
byte
)
Algorithm
,
(
ushort
)(
FlagsExtension
.
HasValue
?
FlagsExtension
.
Value
:
0
)),
PublicKey
);
}
internal
DnsResourceDataKey
()
internal
DnsResourceDataKey
()
:
this
(
false
,
false
,
false
,
false
,
false
,
false
,
DnsKeyNameType
.
ZoneKey
,
DnsKeySignatory
.
Zone
,
DnsKeyProtocol
.
All
,
DnsAlgorithm
.
None
,
null
,
:
this
(
false
,
false
,
false
,
false
,
false
,
false
,
DnsKeyNameType
.
ZoneKey
,
DnsKeySignatory
.
Zone
,
DnsKeyProtocol
.
All
,
DnsAlgorithm
.
None
,
null
,
DataSegment
.
Empty
)
DataSegment
.
Empty
)
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsResourceDataLocationInformation.cs
View file @
bb3f755e
using
System
;
using
System
;
using
System.Linq
;
using
PcapDotNet.Base
;
namespace
PcapDotNet.Packets.Dns
namespace
PcapDotNet.Packets.Dns
{
{
...
@@ -128,11 +130,16 @@ namespace PcapDotNet.Packets.Dns
...
@@ -128,11 +130,16 @@ namespace PcapDotNet.Packets.Dns
Altitude
.
Equals
(
other
.
Altitude
);
Altitude
.
Equals
(
other
.
Altitude
);
}
}
public
override
bool
Equals
(
DnsResourceData
other
)
public
override
bool
Equals
(
object
other
)
{
{
return
Equals
(
other
as
DnsResourceDataLocationInformation
);
return
Equals
(
other
as
DnsResourceDataLocationInformation
);
}
}
public
override
int
GetHashCode
()
{
return
Sequence
.
GetHashCode
(
Version
,
Size
,
HorizontalPrecision
,
VerticalPrecision
,
Latitude
,
Longitude
,
Altitude
);
}
internal
DnsResourceDataLocationInformation
()
internal
DnsResourceDataLocationInformation
()
:
this
(
0
,
0
,
0
,
0
,
0
,
0
,
0
)
:
this
(
0
,
0
,
0
,
0
,
0
,
0
,
0
)
{
{
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsResourceDataNamingAuthorityPointer.cs
View file @
bb3f755e
...
@@ -131,11 +131,16 @@ namespace PcapDotNet.Packets.Dns
...
@@ -131,11 +131,16 @@ namespace PcapDotNet.Packets.Dns
Replacement
.
Equals
(
other
.
Replacement
);
Replacement
.
Equals
(
other
.
Replacement
);
}
}
public
override
bool
Equals
(
DnsResourceData
other
)
public
override
bool
Equals
(
object
other
)
{
{
return
Equals
(
other
as
DnsResourceDataNamingAuthorityPointer
);
return
Equals
(
other
as
DnsResourceDataNamingAuthorityPointer
);
}
}
public
override
int
GetHashCode
()
{
return
Sequence
.
GetHashCode
(
BitSequence
.
Merge
(
Order
,
Preference
),
Flags
,
Services
,
Regexp
,
Replacement
);
}
internal
DnsResourceDataNamingAuthorityPointer
()
internal
DnsResourceDataNamingAuthorityPointer
()
:
this
(
0
,
0
,
DataSegment
.
Empty
,
DataSegment
.
Empty
,
DataSegment
.
Empty
,
DnsDomainName
.
Root
)
:
this
(
0
,
0
,
DataSegment
.
Empty
,
DataSegment
.
Empty
,
DataSegment
.
Empty
,
DnsDomainName
.
Root
)
{
{
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsResourceDataNetworkServiceAccessPoint.cs
View file @
bb3f755e
...
@@ -80,11 +80,16 @@ namespace PcapDotNet.Packets.Dns
...
@@ -80,11 +80,16 @@ namespace PcapDotNet.Packets.Dns
Selector
.
Equals
(
other
.
Selector
);
Selector
.
Equals
(
other
.
Selector
);
}
}
public
override
bool
Equals
(
DnsResourceData
other
)
public
override
bool
Equals
(
object
other
)
{
{
return
Equals
(
other
as
DnsResourceDataNetworkServiceAccessPoint
);
return
Equals
(
other
as
DnsResourceDataNetworkServiceAccessPoint
);
}
}
public
override
int
GetHashCode
()
{
return
Sequence
.
GetHashCode
(
AreaAddress
,
SystemIdentifier
,
Selector
);
}
internal
DnsResourceDataNetworkServiceAccessPoint
()
internal
DnsResourceDataNetworkServiceAccessPoint
()
:
this
(
new
DataSegment
(
new
byte
[
MinAreaAddressLength
]),
0
,
0
)
:
this
(
new
DataSegment
(
new
byte
[
MinAreaAddressLength
]),
0
,
0
)
{
{
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsResourceDataNextDomain.cs
View file @
bb3f755e
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq
;
using
PcapDotNet.Base
;
namespace
PcapDotNet.Packets.Dns
namespace
PcapDotNet.Packets.Dns
{
{
...
@@ -111,11 +112,16 @@ namespace PcapDotNet.Packets.Dns
...
@@ -111,11 +112,16 @@ namespace PcapDotNet.Packets.Dns
TypeBitMap
.
Equals
(
other
.
TypeBitMap
);
TypeBitMap
.
Equals
(
other
.
TypeBitMap
);
}
}
public
override
bool
Equals
(
DnsResourceData
other
)
public
override
bool
Equals
(
object
other
)
{
{
return
Equals
(
other
as
DnsResourceDataNextDomain
);
return
Equals
(
other
as
DnsResourceDataNextDomain
);
}
}
public
override
int
GetHashCode
()
{
return
Sequence
.
GetHashCode
(
NextDomainName
,
TypeBitMap
);
}
internal
DnsResourceDataNextDomain
()
internal
DnsResourceDataNextDomain
()
:
this
(
DnsDomainName
.
Root
,
DataSegment
.
Empty
)
:
this
(
DnsDomainName
.
Root
,
DataSegment
.
Empty
)
{
{
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsResourceDataNextDomainSecure.cs
View file @
bb3f755e
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Collections.ObjectModel
;
using
System.Collections.ObjectModel
;
using
PcapDotNet.Base
;
namespace
PcapDotNet.Packets.Dns
namespace
PcapDotNet.Packets.Dns
{
{
...
@@ -52,11 +53,16 @@ namespace PcapDotNet.Packets.Dns
...
@@ -52,11 +53,16 @@ namespace PcapDotNet.Packets.Dns
_typeBitmaps
.
Equals
(
other
.
_typeBitmaps
);
_typeBitmaps
.
Equals
(
other
.
_typeBitmaps
);
}
}
public
override
bool
Equals
(
DnsResourceData
other
)
public
override
bool
Equals
(
object
other
)
{
{
return
Equals
(
other
as
DnsResourceDataNextDomainSecure
);
return
Equals
(
other
as
DnsResourceDataNextDomainSecure
);
}
}
public
override
int
GetHashCode
()
{
return
Sequence
.
GetHashCode
(
NextDomainName
,
_typeBitmaps
);
}
internal
DnsResourceDataNextDomainSecure
()
internal
DnsResourceDataNextDomainSecure
()
:
this
(
DnsDomainName
.
Root
,
new
DnsType
[
0
])
:
this
(
DnsDomainName
.
Root
,
new
DnsType
[
0
])
{
{
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsResourceDataNextDomainSecure3.cs
View file @
bb3f755e
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Collections.ObjectModel
;
using
System.Collections.ObjectModel
;
using
PcapDotNet.Base
;
namespace
PcapDotNet.Packets.Dns
namespace
PcapDotNet.Packets.Dns
{
{
...
@@ -55,11 +56,16 @@ namespace PcapDotNet.Packets.Dns
...
@@ -55,11 +56,16 @@ namespace PcapDotNet.Packets.Dns
_typeBitmaps
.
Equals
(
other
.
_typeBitmaps
);
_typeBitmaps
.
Equals
(
other
.
_typeBitmaps
);
}
}
public
override
bool
Equals
(
DnsResourceData
other
)
public
override
bool
Equals
(
object
other
)
{
{
return
Equals
(
other
as
DnsResourceDataNextDomainSecure3
);
return
Equals
(
other
as
DnsResourceDataNextDomainSecure3
);
}
}
public
override
int
GetHashCode
()
{
return
Sequence
.
GetHashCode
(
NextHashedOwnerName
,
_typeBitmaps
);
}
internal
DnsResourceDataNextDomainSecure3
()
internal
DnsResourceDataNextDomainSecure3
()
:
this
(
DnsSecNSec3HashAlgorithm
.
Sha1
,
DnsSecNSec3Flags
.
None
,
0
,
DataSegment
.
Empty
,
DataSegment
.
Empty
,
new
DnsType
[
0
])
:
this
(
DnsSecNSec3HashAlgorithm
.
Sha1
,
DnsSecNSec3Flags
.
None
,
0
,
DataSegment
.
Empty
,
DataSegment
.
Empty
,
new
DnsType
[
0
])
{
{
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsResourceDataNextDomainSecure3Base.cs
View file @
bb3f755e
using
System
;
using
System
;
using
PcapDotNet.Base
;
namespace
PcapDotNet.Packets.Dns
namespace
PcapDotNet.Packets.Dns
{
{
...
@@ -62,6 +63,11 @@ namespace PcapDotNet.Packets.Dns
...
@@ -62,6 +63,11 @@ namespace PcapDotNet.Packets.Dns
Salt
.
Equals
(
other
.
Salt
);
Salt
.
Equals
(
other
.
Salt
);
}
}
internal
int
GetHashCodeParameters
()
{
return
Sequence
.
GetHashCode
(
BitSequence
.
Merge
(
Iterations
,
(
byte
)
HashAlgorithm
,
(
byte
)
Flags
),
Salt
);
}
internal
DnsResourceDataNextDomainSecure3Base
(
DnsSecNSec3HashAlgorithm
hashAlgorithm
,
DnsSecNSec3Flags
flags
,
ushort
iterations
,
DataSegment
salt
)
internal
DnsResourceDataNextDomainSecure3Base
(
DnsSecNSec3HashAlgorithm
hashAlgorithm
,
DnsSecNSec3Flags
flags
,
ushort
iterations
,
DataSegment
salt
)
{
{
if
(
salt
.
Length
>
byte
.
MaxValue
)
if
(
salt
.
Length
>
byte
.
MaxValue
)
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsResourceDataNextDomainSecure3Parameters.cs
View file @
bb3f755e
...
@@ -29,11 +29,16 @@ namespace PcapDotNet.Packets.Dns
...
@@ -29,11 +29,16 @@ namespace PcapDotNet.Packets.Dns
return
EqualsParameters
(
other
);
return
EqualsParameters
(
other
);
}
}
public
override
bool
Equals
(
DnsResourceData
other
)
public
override
bool
Equals
(
object
other
)
{
{
return
Equals
(
other
as
DnsResourceDataNextDomainSecure3Parameters
);
return
Equals
(
other
as
DnsResourceDataNextDomainSecure3Parameters
);
}
}
public
override
int
GetHashCode
()
{
return
GetHashCodeParameters
();
}
internal
DnsResourceDataNextDomainSecure3Parameters
()
internal
DnsResourceDataNextDomainSecure3Parameters
()
:
this
(
DnsSecNSec3HashAlgorithm
.
Sha1
,
DnsSecNSec3Flags
.
None
,
0
,
DataSegment
.
Empty
)
:
this
(
DnsSecNSec3HashAlgorithm
.
Sha1
,
DnsSecNSec3Flags
.
None
,
0
,
DataSegment
.
Empty
)
{
{
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsResourceDataOptions.cs
View file @
bb3f755e
...
@@ -34,11 +34,16 @@ namespace PcapDotNet.Packets.Dns
...
@@ -34,11 +34,16 @@ namespace PcapDotNet.Packets.Dns
Options
.
Equals
(
other
.
Options
);
Options
.
Equals
(
other
.
Options
);
}
}
public
override
bool
Equals
(
DnsResourceData
other
)
public
override
bool
Equals
(
object
other
)
{
{
return
Equals
(
other
as
DnsResourceDataOptions
);
return
Equals
(
other
as
DnsResourceDataOptions
);
}
}
public
override
int
GetHashCode
()
{
return
Options
.
GetHashCode
();
}
internal
DnsResourceDataOptions
()
internal
DnsResourceDataOptions
()
:
this
(
DnsOptions
.
None
)
:
this
(
DnsOptions
.
None
)
{
{
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsResourceDataRKey.cs
View file @
bb3f755e
using
System
;
using
System
;
using
PcapDotNet.Base
;
namespace
PcapDotNet.Packets.Dns
namespace
PcapDotNet.Packets.Dns
{
{
...
@@ -65,11 +66,16 @@ namespace PcapDotNet.Packets.Dns
...
@@ -65,11 +66,16 @@ namespace PcapDotNet.Packets.Dns
PublicKey
.
Equals
(
other
.
PublicKey
);
PublicKey
.
Equals
(
other
.
PublicKey
);
}
}
public
override
bool
Equals
(
DnsResourceData
other
)
public
override
bool
Equals
(
object
other
)
{
{
return
Equals
(
other
as
DnsResourceDataRKey
);
return
Equals
(
other
as
DnsResourceDataRKey
);
}
}
public
override
int
GetHashCode
()
{
return
BitSequence
.
Merge
(
Flags
,
Protocol
,
(
byte
)
Algorithm
).
GetHashCode
();
}
internal
DnsResourceDataRKey
()
internal
DnsResourceDataRKey
()
:
this
(
0
,
1
,
DnsAlgorithm
.
None
,
DataSegment
.
Empty
)
:
this
(
0
,
1
,
DnsAlgorithm
.
None
,
DataSegment
.
Empty
)
{
{
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsResourceDataServerSelection.cs
View file @
bb3f755e
using
System
;
using
System
;
using
PcapDotNet.Base
;
namespace
PcapDotNet.Packets.Dns
namespace
PcapDotNet.Packets.Dns
{
{
...
@@ -92,7 +93,12 @@ namespace PcapDotNet.Packets.Dns
...
@@ -92,7 +93,12 @@ namespace PcapDotNet.Packets.Dns
Target
.
Equals
(
other
.
Target
);
Target
.
Equals
(
other
.
Target
);
}
}
public
override
bool
Equals
(
DnsResourceData
other
)
public
override
int
GetHashCode
()
{
return
Sequence
.
GetHashCode
(
BitSequence
.
Merge
(
Priority
,
Weight
),
Port
,
Target
);
}
public
override
bool
Equals
(
object
other
)
{
{
return
Equals
(
other
as
DnsResourceDataServerSelection
);
return
Equals
(
other
as
DnsResourceDataServerSelection
);
}
}
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsResourceDataSig.cs
View file @
bb3f755e
...
@@ -153,7 +153,13 @@ namespace PcapDotNet.Packets.Dns
...
@@ -153,7 +153,13 @@ namespace PcapDotNet.Packets.Dns
Signature
.
Equals
(
other
.
Signature
);
Signature
.
Equals
(
other
.
Signature
);
}
}
public
override
bool
Equals
(
DnsResourceData
other
)
public
override
int
GetHashCode
()
{
return
Sequence
.
GetHashCode
(
BitSequence
.
Merge
((
ushort
)
TypeCovered
,
(
byte
)
Algorithm
,
Labels
),
OriginalTtl
,
SignatureExpiration
,
SignatureInception
,
KeyTag
,
SignersName
,
Signature
);
}
public
override
bool
Equals
(
object
other
)
{
{
return
Equals
(
other
as
DnsResourceDataSig
);
return
Equals
(
other
as
DnsResourceDataSig
);
}
}
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsResourceDataSink.cs
View file @
bb3f755e
using
System
;
using
System
;
using
PcapDotNet.Base
;
namespace
PcapDotNet.Packets.Dns
namespace
PcapDotNet.Packets.Dns
{
{
...
@@ -57,7 +58,7 @@ namespace PcapDotNet.Packets.Dns
...
@@ -57,7 +58,7 @@ namespace PcapDotNet.Packets.Dns
{
{
get
get
{
{
ushort
codingSubcoding
=
(
ushort
)(((
ushort
)
Coding
<<
8
)
|
Subcoding
);
ushort
codingSubcoding
=
BitSequence
.
Merge
((
byte
)
Coding
,
Subcoding
);
return
(
DnsSinkCodingSubcoding
)
codingSubcoding
;
return
(
DnsSinkCodingSubcoding
)
codingSubcoding
;
}
}
}
}
...
@@ -75,11 +76,16 @@ namespace PcapDotNet.Packets.Dns
...
@@ -75,11 +76,16 @@ namespace PcapDotNet.Packets.Dns
Data
.
Equals
(
other
.
Data
);
Data
.
Equals
(
other
.
Data
);
}
}
public
override
bool
Equals
(
DnsResourceData
other
)
public
override
bool
Equals
(
object
other
)
{
{
return
Equals
(
other
as
DnsResourceDataSink
);
return
Equals
(
other
as
DnsResourceDataSink
);
}
}
public
override
int
GetHashCode
()
{
return
Sequence
.
GetHashCode
(
CodingSubcoding
,
Data
);
}
internal
DnsResourceDataSink
()
internal
DnsResourceDataSink
()
:
this
(
DnsSinkCodingSubcoding
.
Asn1SnmpBer
,
DataSegment
.
Empty
)
:
this
(
DnsSinkCodingSubcoding
.
Asn1SnmpBer
,
DataSegment
.
Empty
)
{
{
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsResourceDataSshFingerprint.cs
View file @
bb3f755e
using
System
;
using
System
;
using
PcapDotNet.Base
;
namespace
PcapDotNet.Packets.Dns
namespace
PcapDotNet.Packets.Dns
{
{
...
@@ -58,11 +59,16 @@ namespace PcapDotNet.Packets.Dns
...
@@ -58,11 +59,16 @@ namespace PcapDotNet.Packets.Dns
Fingerprint
.
Equals
(
other
.
Fingerprint
);
Fingerprint
.
Equals
(
other
.
Fingerprint
);
}
}
public
override
bool
Equals
(
DnsResourceData
other
)
public
override
bool
Equals
(
object
other
)
{
{
return
Equals
(
other
as
DnsResourceDataSshFingerprint
);
return
Equals
(
other
as
DnsResourceDataSshFingerprint
);
}
}
public
override
int
GetHashCode
()
{
return
Sequence
.
GetHashCode
(
BitSequence
.
Merge
((
byte
)
Algorithm
,
(
byte
)
FingerprintType
),
Fingerprint
);
}
internal
DnsResourceDataSshFingerprint
()
internal
DnsResourceDataSshFingerprint
()
:
this
(
DnsFingerprintPublicKeyAlgorithm
.
Rsa
,
DnsFingerprintType
.
Sha1
,
DataSegment
.
Empty
)
:
this
(
DnsFingerprintPublicKeyAlgorithm
.
Rsa
,
DnsFingerprintType
.
Sha1
,
DataSegment
.
Empty
)
{
{
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsResourceDataStartOfAuthority.cs
View file @
bb3f755e
...
@@ -102,7 +102,12 @@ namespace PcapDotNet.Packets.Dns
...
@@ -102,7 +102,12 @@ namespace PcapDotNet.Packets.Dns
MinimumTtl
.
Equals
(
other
.
MinimumTtl
);
MinimumTtl
.
Equals
(
other
.
MinimumTtl
);
}
}
public
override
bool
Equals
(
DnsResourceData
other
)
public
override
int
GetHashCode
()
{
return
Sequence
.
GetHashCode
(
MainNameServer
,
ResponsibleMailBox
,
Serial
,
Refresh
,
Retry
,
Expire
,
MinimumTtl
);
}
public
override
bool
Equals
(
object
other
)
{
{
return
Equals
(
other
as
DnsResourceDataStartOfAuthority
);
return
Equals
(
other
as
DnsResourceDataStartOfAuthority
);
}
}
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsResourceDataString.cs
View file @
bb3f755e
...
@@ -23,11 +23,16 @@ namespace PcapDotNet.Packets.Dns
...
@@ -23,11 +23,16 @@ namespace PcapDotNet.Packets.Dns
String
.
Equals
(
other
.
String
);
String
.
Equals
(
other
.
String
);
}
}
public
override
bool
Equals
(
DnsResourceData
other
)
public
override
bool
Equals
(
object
other
)
{
{
return
Equals
(
other
as
DnsResourceDataString
);
return
Equals
(
other
as
DnsResourceDataString
);
}
}
public
override
int
GetHashCode
()
{
return
String
.
GetHashCode
();
}
internal
DnsResourceDataString
()
internal
DnsResourceDataString
()
:
this
(
DataSegment
.
Empty
)
:
this
(
DataSegment
.
Empty
)
{
{
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsResourceDataStrings.cs
View file @
bb3f755e
...
@@ -20,11 +20,16 @@ namespace PcapDotNet.Packets.Dns
...
@@ -20,11 +20,16 @@ namespace PcapDotNet.Packets.Dns
Strings
.
SequenceEqual
(
other
.
Strings
);
Strings
.
SequenceEqual
(
other
.
Strings
);
}
}
public
sealed
override
bool
Equals
(
DnsResourceData
other
)
public
sealed
override
bool
Equals
(
object
other
)
{
{
return
Equals
(
other
as
DnsResourceDataStrings
);
return
Equals
(
other
as
DnsResourceDataStrings
);
}
}
public
override
int
GetHashCode
()
{
return
GetType
().
GetHashCode
()
^
Strings
.
SequenceGetHashCode
();
}
internal
DnsResourceDataStrings
(
ReadOnlyCollection
<
DataSegment
>
strings
)
internal
DnsResourceDataStrings
(
ReadOnlyCollection
<
DataSegment
>
strings
)
{
{
Strings
=
strings
;
Strings
=
strings
;
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsResourceDataTransactionKey.cs
View file @
bb3f755e
...
@@ -127,11 +127,16 @@ namespace PcapDotNet.Packets.Dns
...
@@ -127,11 +127,16 @@ namespace PcapDotNet.Packets.Dns
Other
.
Equals
(
other
.
Other
);
Other
.
Equals
(
other
.
Other
);
}
}
public
override
bool
Equals
(
DnsResourceData
other
)
public
override
bool
Equals
(
object
other
)
{
{
return
Equals
(
other
as
DnsResourceDataTransactionKey
);
return
Equals
(
other
as
DnsResourceDataTransactionKey
);
}
}
public
override
int
GetHashCode
()
{
return
Sequence
.
GetHashCode
(
Algorithm
,
Inception
,
Expiration
,
BitSequence
.
Merge
((
ushort
)
Mode
,
(
ushort
)
Error
),
Key
,
Other
);
}
internal
DnsResourceDataTransactionKey
()
internal
DnsResourceDataTransactionKey
()
:
this
(
DnsDomainName
.
Root
,
0
,
0
,
DnsTransactionKeyMode
.
DiffieHellmanExchange
,
DnsResponseCode
.
NoError
,
DataSegment
.
Empty
,
DataSegment
.
Empty
)
:
this
(
DnsDomainName
.
Root
,
0
,
0
,
DnsTransactionKeyMode
.
DiffieHellmanExchange
,
DnsResponseCode
.
NoError
,
DataSegment
.
Empty
,
DataSegment
.
Empty
)
{
{
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsResourceDataTransactionSignature.cs
View file @
bb3f755e
...
@@ -111,11 +111,16 @@ namespace PcapDotNet.Packets.Dns
...
@@ -111,11 +111,16 @@ namespace PcapDotNet.Packets.Dns
Other
.
Equals
(
other
.
Other
);
Other
.
Equals
(
other
.
Other
);
}
}
public
override
bool
Equals
(
DnsResourceData
other
)
public
override
bool
Equals
(
object
other
)
{
{
return
Equals
(
other
as
DnsResourceDataTransactionSignature
);
return
Equals
(
other
as
DnsResourceDataTransactionSignature
);
}
}
public
override
int
GetHashCode
()
{
return
Sequence
.
GetHashCode
(
Algorithm
,
TimeSigned
,
BitSequence
.
Merge
(
Fudge
,
OriginalId
),
MessageAuthenticationCode
,
Error
,
Other
);
}
internal
DnsResourceDataTransactionSignature
()
internal
DnsResourceDataTransactionSignature
()
:
this
(
DnsDomainName
.
Root
,
0
,
0
,
DataSegment
.
Empty
,
0
,
DnsResponseCode
.
NoError
,
DataSegment
.
Empty
)
:
this
(
DnsDomainName
.
Root
,
0
,
0
,
DataSegment
.
Empty
,
0
,
DnsResponseCode
.
NoError
,
DataSegment
.
Empty
)
{
{
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsResourceDataTrustAnchorLink.cs
View file @
bb3f755e
using
System
;
using
System
;
using
PcapDotNet.Base
;
namespace
PcapDotNet.Packets.Dns
namespace
PcapDotNet.Packets.Dns
{
{
...
@@ -40,11 +41,16 @@ namespace PcapDotNet.Packets.Dns
...
@@ -40,11 +41,16 @@ namespace PcapDotNet.Packets.Dns
Next
.
Equals
(
other
.
Next
);
Next
.
Equals
(
other
.
Next
);
}
}
public
override
bool
Equals
(
DnsResourceData
other
)
public
override
bool
Equals
(
object
other
)
{
{
return
Equals
(
other
as
DnsResourceDataTrustAnchorLink
);
return
Equals
(
other
as
DnsResourceDataTrustAnchorLink
);
}
}
public
override
int
GetHashCode
()
{
return
Sequence
.
GetHashCode
(
Previous
,
Next
);
}
internal
DnsResourceDataTrustAnchorLink
()
internal
DnsResourceDataTrustAnchorLink
()
:
this
(
DnsDomainName
.
Root
,
DnsDomainName
.
Root
)
:
this
(
DnsDomainName
.
Root
,
DnsDomainName
.
Root
)
{
{
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsResourceDataUShortDomainName.cs
View file @
bb3f755e
using
System
;
using
System
;
using
PcapDotNet.Base
;
namespace
PcapDotNet.Packets.Dns
namespace
PcapDotNet.Packets.Dns
{
{
...
@@ -33,11 +34,16 @@ namespace PcapDotNet.Packets.Dns
...
@@ -33,11 +34,16 @@ namespace PcapDotNet.Packets.Dns
DomainName
.
Equals
(
other
.
DomainName
);
DomainName
.
Equals
(
other
.
DomainName
);
}
}
public
override
bool
Equals
(
DnsResourceData
other
)
public
override
bool
Equals
(
object
other
)
{
{
return
Equals
(
other
as
DnsResourceDataUShortDomainName
);
return
Equals
(
other
as
DnsResourceDataUShortDomainName
);
}
}
public
override
int
GetHashCode
()
{
return
Sequence
.
GetHashCode
(
GetType
(),
Value
,
DomainName
);
}
internal
DnsResourceDataUShortDomainName
(
ushort
value
,
DnsDomainName
domainName
)
internal
DnsResourceDataUShortDomainName
(
ushort
value
,
DnsDomainName
domainName
)
{
{
Value
=
value
;
Value
=
value
;
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsResourceDataUri.cs
View file @
bb3f755e
...
@@ -66,11 +66,16 @@ namespace PcapDotNet.Packets.Dns
...
@@ -66,11 +66,16 @@ namespace PcapDotNet.Packets.Dns
Target
.
SequenceEqual
(
other
.
Target
);
Target
.
SequenceEqual
(
other
.
Target
);
}
}
public
override
bool
Equals
(
DnsResourceData
other
)
public
override
bool
Equals
(
object
other
)
{
{
return
Equals
(
other
as
DnsResourceDataUri
);
return
Equals
(
other
as
DnsResourceDataUri
);
}
}
public
override
int
GetHashCode
()
{
return
BitSequence
.
Merge
(
Priority
,
Weight
).
GetHashCode
()
^
Target
.
SequenceGetHashCode
();
}
internal
DnsResourceDataUri
()
internal
DnsResourceDataUri
()
:
this
(
0
,
0
,
new
DataSegment
[
0
])
:
this
(
0
,
0
,
new
DataSegment
[
0
])
{
{
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsResourceDataWellKnownService.cs
View file @
bb3f755e
using
System
;
using
System
;
using
PcapDotNet.Base
;
using
PcapDotNet.Packets.IpV4
;
using
PcapDotNet.Packets.IpV4
;
namespace
PcapDotNet.Packets.Dns
namespace
PcapDotNet.Packets.Dns
...
@@ -57,11 +58,16 @@ namespace PcapDotNet.Packets.Dns
...
@@ -57,11 +58,16 @@ namespace PcapDotNet.Packets.Dns
BitMap
.
Equals
(
other
.
BitMap
);
BitMap
.
Equals
(
other
.
BitMap
);
}
}
public
override
bool
Equals
(
DnsResourceData
other
)
public
override
bool
Equals
(
object
other
)
{
{
return
Equals
(
other
as
DnsResourceDataWellKnownService
);
return
Equals
(
other
as
DnsResourceDataWellKnownService
);
}
}
public
override
int
GetHashCode
()
{
return
Sequence
.
GetHashCode
(
Address
,
Protocol
,
BitMap
);
}
internal
DnsResourceDataWellKnownService
()
internal
DnsResourceDataWellKnownService
()
:
this
(
IpV4Address
.
Zero
,
IpV4Protocol
.
Ip
,
DataSegment
.
Empty
)
:
this
(
IpV4Address
.
Zero
,
IpV4Protocol
.
Ip
,
DataSegment
.
Empty
)
{
{
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsResourceDataX400Pointer.cs
View file @
bb3f755e
using
System
;
using
System
;
using
PcapDotNet.Base
;
namespace
PcapDotNet.Packets.Dns
namespace
PcapDotNet.Packets.Dns
{
{
...
@@ -61,11 +62,16 @@ namespace PcapDotNet.Packets.Dns
...
@@ -61,11 +62,16 @@ namespace PcapDotNet.Packets.Dns
MapX400
.
Equals
(
other
.
MapX400
);
MapX400
.
Equals
(
other
.
MapX400
);
}
}
public
override
bool
Equals
(
DnsResourceData
other
)
public
override
bool
Equals
(
object
other
)
{
{
return
Equals
(
other
as
DnsResourceDataX400Pointer
);
return
Equals
(
other
as
DnsResourceDataX400Pointer
);
}
}
public
override
int
GetHashCode
()
{
return
Sequence
.
GetHashCode
(
Preference
,
Map822
,
MapX400
);
}
internal
DnsResourceDataX400Pointer
()
internal
DnsResourceDataX400Pointer
()
:
this
(
0
,
DnsDomainName
.
Root
,
DnsDomainName
.
Root
)
:
this
(
0
,
DnsDomainName
.
Root
,
DnsDomainName
.
Root
)
{
{
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsTypeBitmaps.cs
View file @
bb3f755e
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq
;
using
PcapDotNet.Base
;
namespace
PcapDotNet.Packets.Dns
namespace
PcapDotNet.Packets.Dns
{
{
...
@@ -35,6 +36,11 @@ namespace PcapDotNet.Packets.Dns
...
@@ -35,6 +36,11 @@ namespace PcapDotNet.Packets.Dns
return
Equals
(
obj
as
DnsTypeBitmaps
);
return
Equals
(
obj
as
DnsTypeBitmaps
);
}
}
public
override
int
GetHashCode
()
{
return
TypesExist
.
SequenceGetHashCode
();
}
public
int
GetLength
()
public
int
GetLength
()
{
{
int
length
=
0
;
int
length
=
0
;
...
...
PcapDotNet/src/PcapDotNet.Packets/Ethernet/EthernetLayer.cs
View file @
bb3f755e
using
System
;
using
System
;
using
PcapDotNet.Base
;
using
PcapDotNet.Packets.Arp
;
using
PcapDotNet.Packets.Arp
;
namespace
PcapDotNet.Packets.Ethernet
namespace
PcapDotNet.Packets.Ethernet
...
@@ -114,7 +115,7 @@ namespace PcapDotNet.Packets.Ethernet
...
@@ -114,7 +115,7 @@ namespace PcapDotNet.Packets.Ethernet
public
override
int
GetHashCode
()
public
override
int
GetHashCode
()
{
{
return
base
.
GetHashCode
()
^
return
base
.
GetHashCode
()
^
S
ource
.
GetHashCode
()
^
Destination
.
GetHashCode
()
^
EtherType
.
GetHashCode
(
);
S
equence
.
GetHashCode
(
Source
,
Destination
,
EtherType
);
}
}
/// <summary>
/// <summary>
...
...
PcapDotNet/src/PcapDotNet.Packets/Ethernet/MacAddress.cs
View file @
bb3f755e
...
@@ -44,12 +44,8 @@ namespace PcapDotNet.Packets.Ethernet
...
@@ -44,12 +44,8 @@ namespace PcapDotNet.Packets.Ethernet
if
(
hexes
.
Length
!=
6
)
if
(
hexes
.
Length
!=
6
)
throw
new
ArgumentException
(
"Failed parsing "
+
address
+
" as mac address. Expected 6 hexes and got "
+
hexes
.
Length
+
" hexes"
,
"address"
);
throw
new
ArgumentException
(
"Failed parsing "
+
address
+
" as mac address. Expected 6 hexes and got "
+
hexes
.
Length
+
" hexes"
,
"address"
);
_value
=
(
UInt48
)(((
long
)
Convert
.
ToByte
(
hexes
[
0
],
16
)
<<
40
)
|
_value
=
BitSequence
.
Merge
(
Convert
.
ToByte
(
hexes
[
0
],
16
),
Convert
.
ToByte
(
hexes
[
1
],
16
),
Convert
.
ToByte
(
hexes
[
2
],
16
),
((
long
)
Convert
.
ToByte
(
hexes
[
1
],
16
)
<<
32
)
|
Convert
.
ToByte
(
hexes
[
3
],
16
),
Convert
.
ToByte
(
hexes
[
4
],
16
),
Convert
.
ToByte
(
hexes
[
5
],
16
));
((
long
)
Convert
.
ToByte
(
hexes
[
2
],
16
)
<<
24
)
|
((
long
)
Convert
.
ToByte
(
hexes
[
3
],
16
)
<<
16
)
|
((
long
)
Convert
.
ToByte
(
hexes
[
4
],
16
)
<<
8
)
|
Convert
.
ToByte
(
hexes
[
5
],
16
));
}
}
/// <summary>
/// <summary>
...
...
PcapDotNet/src/PcapDotNet.Packets/Gre/GreLayer.cs
View file @
bb3f755e
using
System
;
using
System
;
using
System.Collections.ObjectModel
;
using
System.Collections.ObjectModel
;
using
System.Linq
;
using
System.Linq
;
using
PcapDotNet.Base
;
using
PcapDotNet.Packets.Ethernet
;
using
PcapDotNet.Packets.Ethernet
;
using
PcapDotNet.Packets.IpV4
;
using
PcapDotNet.Packets.IpV4
;
...
@@ -80,7 +81,7 @@ namespace PcapDotNet.Packets.Gre
...
@@ -80,7 +81,7 @@ namespace PcapDotNet.Packets.Gre
/// <param name="keyCallId">(Low 2 octets of Key) Contains the Peer's Call ID for the session to which this packet belongs.</param>
/// <param name="keyCallId">(Low 2 octets of Key) Contains the Peer's Call ID for the session to which this packet belongs.</param>
public
void
SetKey
(
ushort
keyPayloadLength
,
ushort
keyCallId
)
public
void
SetKey
(
ushort
keyPayloadLength
,
ushort
keyCallId
)
{
{
Key
=
(
uint
)((
keyPayloadLength
<<
16
)
|
keyCallId
);
Key
=
BitSequence
.
Merge
(
keyPayloadLength
,
keyCallId
);
}
}
/// <summary>
/// <summary>
...
...
PcapDotNet/src/PcapDotNet.Packets/Gre/GreSourceRouteEntry.cs
View file @
bb3f755e
using
System
;
using
System
;
using
PcapDotNet.Base
;
using
PcapDotNet.Packets.IpV4
;
using
PcapDotNet.Packets.IpV4
;
namespace
PcapDotNet.Packets.Gre
namespace
PcapDotNet.Packets.Gre
...
@@ -78,7 +79,7 @@ namespace PcapDotNet.Packets.Gre
...
@@ -78,7 +79,7 @@ namespace PcapDotNet.Packets.Gre
/// </summary>
/// </summary>
public
sealed
override
int
GetHashCode
()
public
sealed
override
int
GetHashCode
()
{
{
return
AddressFamily
.
GetHashCode
()
^
Length
.
GetHashCode
()
^
PayloadOffset
.
GetHashCode
(
)
^
PayloadHashCode
;
return
Sequence
.
GetHashCode
(
AddressFamily
,
Length
,
PayloadOffset
)
^
PayloadHashCode
;
}
}
/// <summary>
/// <summary>
...
...
PcapDotNet/src/PcapDotNet.Packets/Http/HttpFieldParameters.cs
View file @
bb3f755e
...
@@ -91,7 +91,7 @@ namespace PcapDotNet.Packets.Http
...
@@ -91,7 +91,7 @@ namespace PcapDotNet.Packets.Http
{
{
return
return
_parameters
.
Select
(
pair
=>
new
KeyValuePair
<
string
,
string
>(
pair
.
Key
.
ToUpperInvariant
(),
pair
.
Value
))
_parameters
.
Select
(
pair
=>
new
KeyValuePair
<
string
,
string
>(
pair
.
Key
.
ToUpperInvariant
(),
pair
.
Value
))
.
Xor
(
pair
=>
pair
.
Key
.
GetHashCode
()
^
pair
.
Value
.
GetHashCode
(
));
.
Xor
(
pair
=>
Sequence
.
GetHashCode
(
pair
.
Key
,
pair
.
Value
));
}
}
/// <summary>
/// <summary>
...
...
PcapDotNet/src/PcapDotNet.Packets/Http/HttpVersion.cs
View file @
bb3f755e
...
@@ -82,7 +82,7 @@ namespace PcapDotNet.Packets.Http
...
@@ -82,7 +82,7 @@ namespace PcapDotNet.Packets.Http
/// </summary>
/// </summary>
public
override
int
GetHashCode
()
public
override
int
GetHashCode
()
{
{
return
Minor
.
GetHashCode
()
^
Major
.
GetHashCode
(
);
return
Sequence
.
GetHashCode
(
Minor
,
Major
);
}
}
internal
void
Write
(
byte
[]
buffer
,
ref
int
offset
)
internal
void
Write
(
byte
[]
buffer
,
ref
int
offset
)
...
...
PcapDotNet/src/PcapDotNet.Packets/Icmp/IcmpIdentifiedLayer.cs
View file @
bb3f755e
using
PcapDotNet.Base
;
namespace
PcapDotNet.Packets.Icmp
namespace
PcapDotNet.Packets.Icmp
{
{
/// <summary>
/// <summary>
...
@@ -20,7 +22,7 @@ namespace PcapDotNet.Packets.Icmp
...
@@ -20,7 +22,7 @@ namespace PcapDotNet.Packets.Icmp
/// </summary>
/// </summary>
protected
sealed
override
uint
Variable
protected
sealed
override
uint
Variable
{
{
get
{
return
(
uint
)((
Identifier
<<
16
)
|
SequenceNumber
);
}
get
{
return
BitSequence
.
Merge
(
Identifier
,
SequenceNumber
);
}
}
}
}
}
}
}
\ No newline at end of file
PcapDotNet/src/PcapDotNet.Packets/Icmp/IcmpLayer.cs
View file @
bb3f755e
using
PcapDotNet.Base
;
using
PcapDotNet.Packets.IpV4
;
using
PcapDotNet.Packets.IpV4
;
namespace
PcapDotNet.Packets.Icmp
namespace
PcapDotNet.Packets.Icmp
...
@@ -27,7 +28,7 @@ namespace PcapDotNet.Packets.Icmp
...
@@ -27,7 +28,7 @@ namespace PcapDotNet.Packets.Icmp
/// </summary>
/// </summary>
public
IcmpMessageTypeAndCode
MessageTypeAndCode
public
IcmpMessageTypeAndCode
MessageTypeAndCode
{
{
get
{
return
(
IcmpMessageTypeAndCode
)
(((
ushort
)
MessageType
<<
8
)
|
CodeValue
);
}
get
{
return
(
IcmpMessageTypeAndCode
)
BitSequence
.
Merge
((
byte
)
MessageType
,
CodeValue
);
}
}
}
/// <summary>
/// <summary>
...
@@ -133,7 +134,7 @@ namespace PcapDotNet.Packets.Icmp
...
@@ -133,7 +134,7 @@ namespace PcapDotNet.Packets.Icmp
public
sealed
override
int
GetHashCode
()
public
sealed
override
int
GetHashCode
()
{
{
return
base
.
GetHashCode
()
^
return
base
.
GetHashCode
()
^
MessageTypeAndCode
.
GetHashCode
()
^
Checksum
.
GetHashCode
()
^
Variable
.
GetHashCode
();
Sequence
.
GetHashCode
(
MessageTypeAndCode
,
Variable
)
^
Checksum
.
GetHashCode
();
}
}
/// <summary>
/// <summary>
...
...
PcapDotNet/src/PcapDotNet.Packets/Icmp/IcmpRouterAdvertisementEntry.cs
View file @
bb3f755e
using
System
;
using
System
;
using
PcapDotNet.Base
;
using
PcapDotNet.Packets.IpV4
;
using
PcapDotNet.Packets.IpV4
;
namespace
PcapDotNet.Packets.Icmp
namespace
PcapDotNet.Packets.Icmp
...
@@ -59,7 +60,7 @@ namespace PcapDotNet.Packets.Icmp
...
@@ -59,7 +60,7 @@ namespace PcapDotNet.Packets.Icmp
/// </summary>
/// </summary>
public
override
int
GetHashCode
()
public
override
int
GetHashCode
()
{
{
return
RouterAddress
.
GetHashCode
()
^
RouterAddressPreference
.
GetHashCode
(
);
return
Sequence
.
GetHashCode
(
RouterAddress
,
RouterAddressPreference
);
}
}
private
readonly
IpV4Address
_routerAddress
;
private
readonly
IpV4Address
_routerAddress
;
...
...
PcapDotNet/src/PcapDotNet.Packets/Igmp/IgmpGroupRecord.cs
View file @
bb3f755e
...
@@ -136,8 +136,7 @@ namespace PcapDotNet.Packets.Igmp
...
@@ -136,8 +136,7 @@ namespace PcapDotNet.Packets.Igmp
/// </summary>
/// </summary>
public
override
int
GetHashCode
()
public
override
int
GetHashCode
()
{
{
return
RecordType
.
GetHashCode
()
^
MulticastAddress
.
GetHashCode
()
^
SourceAddresses
.
SequenceGetHashCode
()
^
return
Sequence
.
GetHashCode
(
RecordType
,
MulticastAddress
)
^
SourceAddresses
.
SequenceGetHashCode
()
^
AuxiliaryData
.
BytesSequenceGetHashCode
();
AuxiliaryData
.
BytesSequenceGetHashCode
();
}
}
}
}
}
}
\ No newline at end of file
PcapDotNet/src/PcapDotNet.Packets/Igmp/IgmpLayer.cs
View file @
bb3f755e
...
@@ -63,7 +63,7 @@ namespace PcapDotNet.Packets.Igmp
...
@@ -63,7 +63,7 @@ namespace PcapDotNet.Packets.Igmp
public
override
int
GetHashCode
()
public
override
int
GetHashCode
()
{
{
return
base
.
GetHashCode
()
^
return
base
.
GetHashCode
()
^
MessageType
.
GetHashCode
()
^
QueryVersion
.
GetHashCode
(
);
Sequence
.
GetHashCode
(
MessageType
,
QueryVersion
);
}
}
/// <summary>
/// <summary>
...
...
PcapDotNet/src/PcapDotNet.Packets/Igmp/IgmpQueryVersion3Layer.cs
View file @
bb3f755e
...
@@ -114,8 +114,7 @@ namespace PcapDotNet.Packets.Igmp
...
@@ -114,8 +114,7 @@ namespace PcapDotNet.Packets.Igmp
public
override
int
GetHashCode
()
public
override
int
GetHashCode
()
{
{
return
base
.
GetHashCode
()
^
return
base
.
GetHashCode
()
^
GroupAddress
.
GetHashCode
()
^
Sequence
.
GetHashCode
(
GroupAddress
,
BitSequence
.
Merge
(
IsSuppressRouterSideProcessing
.
ToByte
(),
QueryRobustnessVariable
))
^
((
IsSuppressRouterSideProcessing
?
0
:
(
1
<<
8
))
+
QueryRobustnessVariable
)
^
SourceAddresses
.
SequenceGetHashCode
();
SourceAddresses
.
SequenceGetHashCode
();
}
}
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV4/IpV4Address.cs
View file @
bb3f755e
using
System
;
using
System
;
using
System.Globalization
;
using
System.Globalization
;
using
System.Text
;
using
System.Text
;
using
PcapDotNet.Base
;
namespace
PcapDotNet.Packets.IpV4
namespace
PcapDotNet.Packets.IpV4
{
{
...
@@ -52,10 +53,10 @@ namespace PcapDotNet.Packets.IpV4
...
@@ -52,10 +53,10 @@ namespace PcapDotNet.Packets.IpV4
throw
new
ArgumentNullException
(
"value"
);
throw
new
ArgumentNullException
(
"value"
);
string
[]
values
=
value
.
Split
(
'.'
);
string
[]
values
=
value
.
Split
(
'.'
);
_value
=
(
uint
)((
byte
.
Parse
(
values
[
0
],
CultureInfo
.
InvariantCulture
)
<<
24
)
+
_value
=
BitSequence
.
Merge
(
byte
.
Parse
(
values
[
0
],
CultureInfo
.
InvariantCulture
),
(
byte
.
Parse
(
values
[
1
],
CultureInfo
.
InvariantCulture
)
<<
16
)
+
byte
.
Parse
(
values
[
1
],
CultureInfo
.
InvariantCulture
),
(
byte
.
Parse
(
values
[
2
],
CultureInfo
.
InvariantCulture
)
<<
8
)
+
byte
.
Parse
(
values
[
2
],
CultureInfo
.
InvariantCulture
),
(
byte
.
Parse
(
values
[
3
],
CultureInfo
.
InvariantCulture
)
));
byte
.
Parse
(
values
[
3
],
CultureInfo
.
InvariantCulture
));
}
}
/// <summary>
/// <summary>
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV4/IpV4Layer.cs
View file @
bb3f755e
using
System
;
using
System
;
using
PcapDotNet.Base
;
using
PcapDotNet.Packets.Ethernet
;
using
PcapDotNet.Packets.Ethernet
;
namespace
PcapDotNet.Packets.IpV4
namespace
PcapDotNet.Packets.IpV4
...
@@ -183,13 +184,8 @@ namespace PcapDotNet.Packets.IpV4
...
@@ -183,13 +184,8 @@ namespace PcapDotNet.Packets.IpV4
public
override
int
GetHashCode
()
public
override
int
GetHashCode
()
{
{
return
base
.
GetHashCode
()
^
return
base
.
GetHashCode
()
^
((
TypeOfService
<<
24
)
+
(
Identification
<<
8
)
+
Ttl
)
^
Sequence
.
GetHashCode
(
BitSequence
.
Merge
(
TypeOfService
,
Identification
,
Ttl
),
Fragmentation
.
GetHashCode
()
^
Fragmentation
,
Source
,
Destination
,
Options
)
^
Protocol
.
GetHashCode
()
^
HeaderChecksum
.
GetHashCode
();
Protocol
.
GetHashCode
()
^
HeaderChecksum
.
GetHashCode
()
^
Source
.
GetHashCode
()
^
Destination
.
GetHashCode
()
^
Options
.
GetHashCode
();
}
}
/// <summary>
/// <summary>
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV4/IpV4OptionBasicSecurity.cs
View file @
bb3f755e
using
System
;
using
System
;
using
PcapDotNet.Base
;
namespace
PcapDotNet.Packets.IpV4
namespace
PcapDotNet.Packets.IpV4
{
{
...
@@ -175,7 +176,7 @@ namespace PcapDotNet.Packets.IpV4
...
@@ -175,7 +176,7 @@ namespace PcapDotNet.Packets.IpV4
public
override
int
GetHashCode
()
public
override
int
GetHashCode
()
{
{
return
base
.
GetHashCode
()
^
return
base
.
GetHashCode
()
^
((((
byte
)
ClassificationLevel
)
<<
16
)
|
(((
byte
)
ProtectionAuthorities
)
<<
8
)
|
Length
).
GetHashCode
();
BitSequence
.
Merge
((
byte
)
ClassificationLevel
,
(
byte
)
ProtectionAuthorities
,(
byte
)
Length
).
GetHashCode
();
}
}
/// <summary>
/// <summary>
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV4/IpV4OptionQuickStart.cs
View file @
bb3f755e
using
System
;
using
System
;
using
PcapDotNet.Base
;
namespace
PcapDotNet.Packets.IpV4
namespace
PcapDotNet.Packets.IpV4
{
{
...
@@ -225,8 +226,7 @@ namespace PcapDotNet.Packets.IpV4
...
@@ -225,8 +226,7 @@ namespace PcapDotNet.Packets.IpV4
public
override
int
GetHashCode
()
public
override
int
GetHashCode
()
{
{
return
base
.
GetHashCode
()
^
return
base
.
GetHashCode
()
^
((((
byte
)
Function
|
Rate
)
<<
8
)
|
Ttl
).
GetHashCode
()
^
Sequence
.
GetHashCode
(
BitSequence
.
Merge
((
byte
)((
byte
)
Function
|
Rate
),
Ttl
),
Nonce
);
Nonce
.
GetHashCode
();
}
}
/// <summary>
/// <summary>
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV4/IpV4OptionTimedAddress.cs
View file @
bb3f755e
using
System
;
using
System
;
using
PcapDotNet.Base
;
namespace
PcapDotNet.Packets.IpV4
namespace
PcapDotNet.Packets.IpV4
{
{
...
@@ -73,8 +74,7 @@ namespace PcapDotNet.Packets.IpV4
...
@@ -73,8 +74,7 @@ namespace PcapDotNet.Packets.IpV4
/// </summary>
/// </summary>
public
override
int
GetHashCode
()
public
override
int
GetHashCode
()
{
{
return
_address
.
GetHashCode
()
^
return
Sequence
.
GetHashCode
(
_address
,
_timeOfDay
);
_timeOfDay
.
GetHashCode
();
}
}
private
readonly
IpV4Address
_address
;
private
readonly
IpV4Address
_address
;
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV4/IpV4OptionTimestamp.cs
View file @
bb3f755e
using
System
;
using
System
;
using
PcapDotNet.Base
;
namespace
PcapDotNet.Packets.IpV4
namespace
PcapDotNet.Packets.IpV4
{
{
...
@@ -205,8 +206,7 @@ namespace PcapDotNet.Packets.IpV4
...
@@ -205,8 +206,7 @@ namespace PcapDotNet.Packets.IpV4
public
override
int
GetHashCode
()
public
override
int
GetHashCode
()
{
{
return
base
.
GetHashCode
()
^
return
base
.
GetHashCode
()
^
(((
byte
)
TimestampType
<<
16
)
|
(
Overflow
<<
8
)).
GetHashCode
()
^
Sequence
.
GetHashCode
(
BitSequence
.
Merge
((
byte
)
TimestampType
,
Overflow
),
PointedIndex
);
PointedIndex
.
GetHashCode
();
}
}
internal
sealed
override
void
Write
(
byte
[]
buffer
,
ref
int
offset
)
internal
sealed
override
void
Write
(
byte
[]
buffer
,
ref
int
offset
)
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV4/IpV4OptionTraceRoute.cs
View file @
bb3f755e
using
System
;
using
System
;
using
PcapDotNet.Base
;
namespace
PcapDotNet.Packets.IpV4
namespace
PcapDotNet.Packets.IpV4
{
{
...
@@ -166,9 +167,7 @@ namespace PcapDotNet.Packets.IpV4
...
@@ -166,9 +167,7 @@ namespace PcapDotNet.Packets.IpV4
public
override
int
GetHashCode
()
public
override
int
GetHashCode
()
{
{
return
base
.
GetHashCode
()
^
return
base
.
GetHashCode
()
^
Identification
.
GetHashCode
()
^
Sequence
.
GetHashCode
(
Identification
,
BitSequence
.
Merge
(
OutboundHopCount
,
ReturnHopCount
),
OriginatorIpAddress
);
((
OutboundHopCount
<<
16
)
|
(
ReturnHopCount
<<
16
)).
GetHashCode
()
^
OriginatorIpAddress
.
GetHashCode
();
}
}
...
...
PcapDotNet/src/PcapDotNet.Packets/Layer.cs
View file @
bb3f755e
using
System
;
using
System
;
using
PcapDotNet.Base
;
namespace
PcapDotNet.Packets
namespace
PcapDotNet.Packets
{
{
...
...
PcapDotNet/src/PcapDotNet.Packets/Transport/TcpOptionPartialOrderServiceProfile.cs
View file @
bb3f755e
using
System
;
using
System
;
using
PcapDotNet.Base
;
namespace
PcapDotNet.Packets.Transport
namespace
PcapDotNet.Packets.Transport
{
{
...
@@ -108,7 +109,7 @@ namespace PcapDotNet.Packets.Transport
...
@@ -108,7 +109,7 @@ namespace PcapDotNet.Packets.Transport
/// </summary>
/// </summary>
public
override
int
GetHashCode
()
public
override
int
GetHashCode
()
{
{
return
base
.
GetHashCode
()
^
((
IsStart
?
1
:
0
)
<<
1
)
^
(
IsEnd
?
1
:
0
);
return
base
.
GetHashCode
()
^
BitSequence
.
Merge
(
IsStart
,
IsEnd
).
GetHashCode
(
);
}
}
/// <summary>
/// <summary>
...
...
PcapDotNet/src/PcapDotNet.Packets/Transport/TcpOptionSelectiveAcknowledgmentBlock.cs
View file @
bb3f755e
using
System
;
using
System
;
using
PcapDotNet.Base
;
namespace
PcapDotNet.Packets.Transport
namespace
PcapDotNet.Packets.Transport
{
{
...
@@ -89,7 +90,7 @@ namespace PcapDotNet.Packets.Transport
...
@@ -89,7 +90,7 @@ namespace PcapDotNet.Packets.Transport
/// </summary>
/// </summary>
public
override
int
GetHashCode
()
public
override
int
GetHashCode
()
{
{
return
LeftEdge
.
GetHashCode
()
^
RightEdge
.
GetHashCode
(
);
return
Sequence
.
GetHashCode
(
LeftEdge
,
RightEdge
);
}
}
}
}
}
}
\ No newline at end of file
PcapDotNet/src/PcapDotNet.Packets/Transport/TransportLayer.cs
View file @
bb3f755e
using
System
;
using
System
;
using
PcapDotNet.Base
;
using
PcapDotNet.Packets.IpV4
;
using
PcapDotNet.Packets.IpV4
;
namespace
PcapDotNet.Packets.Transport
namespace
PcapDotNet.Packets.Transport
...
@@ -81,8 +82,7 @@ namespace PcapDotNet.Packets.Transport
...
@@ -81,8 +82,7 @@ namespace PcapDotNet.Packets.Transport
public
sealed
override
int
GetHashCode
()
public
sealed
override
int
GetHashCode
()
{
{
return
base
.
GetHashCode
()
^
return
base
.
GetHashCode
()
^
Checksum
.
GetHashCode
()
^
Checksum
.
GetHashCode
()
^
BitSequence
.
Merge
(
SourcePort
,
DestinationPort
).
GetHashCode
();
((
SourcePort
<<
16
)
+
DestinationPort
);
}
}
/// <summary>
/// <summary>
...
...
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