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
03f5e460
Commit
03f5e460
authored
May 18, 2010
by
Brickner_cp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code Analysis
parent
0a706f68
Show whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
112 additions
and
11 deletions
+112
-11
FuncExtensions.cs
PcapDotNet/src/PcapDotNet.Base/FuncExtensions.cs
+3
-0
IEnumerableExtensions.cs
PcapDotNet/src/PcapDotNet.Base/IEnumerableExtensions.cs
+6
-0
PropertyInfoExtensions.cs
PcapDotNet/src/PcapDotNet.Base/PropertyInfoExtensions.cs
+4
-0
TypeExtensions.cs
PcapDotNet/src/PcapDotNet.Base/TypeExtensions.cs
+3
-0
UInt128.cs
PcapDotNet/src/PcapDotNet.Base/UInt128.cs
+3
-0
LivePacketDeviceTests.cs
PcapDotNet/src/PcapDotNet.Core.Test/LivePacketDeviceTests.cs
+1
-1
BerkeleyPacketFilter.cpp
PcapDotNet/src/PcapDotNet.Core/BerkeleyPacketFilter.cpp
+3
-0
LivePacketCommunicator.cpp
PcapDotNet/src/PcapDotNet.Core/LivePacketCommunicator.cpp
+5
-1
PacketCommunicator.cpp
PcapDotNet/src/PcapDotNet.Core/PacketCommunicator.cpp
+12
-3
PacketDumpFile.cpp
PcapDotNet/src/PcapDotNet.Core/PacketDumpFile.cpp
+7
-1
PacketSendBuffer.cpp
PcapDotNet/src/PcapDotNet.Core/PacketSendBuffer.cpp
+4
-1
ByteArrayExtensions.cs
PcapDotNet/src/PcapDotNet.Packets/ByteArrayExtensions.cs
+16
-0
Datagram.cs
PcapDotNet/src/PcapDotNet.Packets/Datagram.cs
+10
-2
MacAddress.cs
PcapDotNet/src/PcapDotNet.Packets/Ethernet/MacAddress.cs
+3
-0
IcmpDatagram.cs
PcapDotNet/src/PcapDotNet.Packets/Icmp/IcmpDatagram.cs
+3
-0
IgmpGroupRecord.cs
PcapDotNet/src/PcapDotNet.Packets/Igmp/IgmpGroupRecord.cs
+3
-0
IpV4Address.cs
PcapDotNet/src/PcapDotNet.Packets/IpV4/IpV4Address.cs
+4
-0
IpV4OptionBasicSecurity.cs
...et/src/PcapDotNet.Packets/IpV4/IpV4OptionBasicSecurity.cs
+3
-0
IpV4OptionQuickStart.cs
...otNet/src/PcapDotNet.Packets/IpV4/IpV4OptionQuickStart.cs
+3
-0
IpV4OptionRoute.cs
PcapDotNet/src/PcapDotNet.Packets/IpV4/IpV4OptionRoute.cs
+3
-0
IpV6Address.cs
PcapDotNet/src/PcapDotNet.Packets/IpV6/IpV6Address.cs
+3
-0
Packet.cs
PcapDotNet/src/PcapDotNet.Packets/Packet.cs
+4
-1
PacketBuilder.cs
PcapDotNet/src/PcapDotNet.Packets/PacketBuilder.cs
+3
-0
TcpOptionMd5Signature.cs
...src/PcapDotNet.Packets/Transport/TcpOptionMd5Signature.cs
+3
-0
PcapDotNet.ruleset
PcapDotNet/src/PcapDotNet.ruleset
+0
-1
No files found.
PcapDotNet/src/PcapDotNet.Base/FuncExtensions.cs
View file @
03f5e460
...
...
@@ -18,6 +18,9 @@ namespace PcapDotNet.Base
/// <returns>An array of a given size with elements generated by the given delegate.</returns>
public
static
T
[]
GenerateArray
<
T
>(
this
Func
<
T
>
generator
,
int
size
)
{
if
(
generator
==
null
)
throw
new
ArgumentNullException
(
"generator"
);
T
[]
array
=
new
T
[
size
];
for
(
int
i
=
0
;
i
!=
size
;
++
i
)
array
[
i
]
=
generator
.
Invoke
();
...
...
PcapDotNet/src/PcapDotNet.Base/IEnumerableExtensions.cs
View file @
03f5e460
...
...
@@ -18,6 +18,9 @@ namespace PcapDotNet.Base
/// </summary>
public
static
bool
IsEmpty
<
T
>(
this
IEnumerable
<
T
>
sequence
)
{
if
(
sequence
==
null
)
throw
new
ArgumentNullException
(
"sequence"
);
return
!
sequence
.
GetEnumerator
().
MoveNext
();
}
...
...
@@ -44,6 +47,9 @@ namespace PcapDotNet.Base
/// <returns>A string of all the elements.</returns>
public
static
string
SequenceToString
<
T
>(
this
IEnumerable
<
T
>
sequence
,
string
separator
,
string
prefix
,
string
suffix
)
{
if
(
sequence
==
null
)
throw
new
ArgumentNullException
(
"sequence"
);
StringBuilder
stringBuilder
=
new
StringBuilder
();
stringBuilder
.
Append
(
prefix
);
bool
isFirst
=
true
;
...
...
PcapDotNet/src/PcapDotNet.Base/PropertyInfoExtensions.cs
View file @
03f5e460
using
System
;
using
System.Reflection
;
namespace
PcapDotNet.Base
...
...
@@ -12,6 +13,9 @@ namespace PcapDotNet.Base
/// </summary>
public
static
object
GetValue
(
this
PropertyInfo
propertyInfo
,
object
instanceWithProperty
)
{
if
(
propertyInfo
==
null
)
throw
new
ArgumentNullException
(
"propertyInfo"
);
return
propertyInfo
.
GetValue
(
instanceWithProperty
,
null
);
}
}
...
...
PcapDotNet/src/PcapDotNet.Base/TypeExtensions.cs
View file @
03f5e460
...
...
@@ -33,6 +33,9 @@ namespace PcapDotNet.Base
/// <returns>A sequence of custom attributes applied to this member, or a sequence with zero (0) elements if no attributes have been applied.</returns>
public
static
IEnumerable
<
T
>
GetCustomAttributes
<
T
>(
this
MemberInfo
memberInfo
,
bool
inherit
)
where
T
:
Attribute
{
if
(
memberInfo
==
null
)
throw
new
ArgumentNullException
(
"memberInfo"
);
return
memberInfo
.
GetCustomAttributes
(
typeof
(
T
),
inherit
).
Cast
<
T
>();
}
}
...
...
PcapDotNet/src/PcapDotNet.Base/UInt128.cs
View file @
03f5e460
...
...
@@ -71,6 +71,9 @@ namespace PcapDotNet.Base
/// <returns>A 128-bit unsigned integer equivalent to the number specified in s.</returns>
public
static
UInt128
Parse
(
string
value
,
NumberStyles
style
,
IFormatProvider
provider
)
{
if
(
value
==
null
)
throw
new
ArgumentNullException
(
"value"
);
if
(
style
!=
NumberStyles
.
HexNumber
)
throw
new
NotSupportedException
(
"Only "
+
NumberStyles
.
HexNumber
+
" style is supported"
);
...
...
PcapDotNet/src/PcapDotNet.Core.Test/LivePacketDeviceTests.cs
View file @
03f5e460
...
...
@@ -130,7 +130,7 @@ namespace PcapDotNet.Core.Test
TestReceivePackets
(
NumPacketsToSend
,
NumPacketsToSend
/
2
,
int
.
MaxValue
,
2
,
PacketSize
,
PacketCommunicatorReceiveResult
.
Ok
,
NumPacketsToSend
/
2
,
0
,
0.02
);
// Wait for more packets
TestReceivePackets
(
NumPacketsToSend
,
0
,
int
.
MaxValue
,
2
,
PacketSize
,
PacketCommunicatorReceiveResult
.
None
,
NumPacketsToSend
,
2
,
2.0
43
);
TestReceivePackets
(
NumPacketsToSend
,
0
,
int
.
MaxValue
,
2
,
PacketSize
,
PacketCommunicatorReceiveResult
.
None
,
NumPacketsToSend
,
2
,
2.0
55
);
TestReceivePackets
(
NumPacketsToSend
,
-
1
,
int
.
MaxValue
,
2
,
PacketSize
,
PacketCommunicatorReceiveResult
.
None
,
NumPacketsToSend
,
2
,
2.3
);
TestReceivePackets
(
NumPacketsToSend
,
NumPacketsToSend
+
1
,
int
.
MaxValue
,
2
,
PacketSize
,
PacketCommunicatorReceiveResult
.
None
,
NumPacketsToSend
,
2
,
2.051
);
...
...
PcapDotNet/src/PcapDotNet.Core/BerkeleyPacketFilter.cpp
View file @
03f5e460
...
...
@@ -22,6 +22,9 @@ BerkeleyPacketFilter::BerkeleyPacketFilter(String^ filterValue, int snapshotLeng
bool
BerkeleyPacketFilter
::
Test
([
Out
]
int
%
snapshotLength
,
Packet
^
packet
)
{
if
(
packet
==
nullptr
)
throw
gcnew
ArgumentNullException
(
"packet"
);
pcap_pkthdr
pcapHeader
;
PacketHeader
::
GetPcapHeader
(
pcapHeader
,
packet
);
pin_ptr
<
Byte
>
unmanagedPacketBytes
=
&
packet
->
Buffer
[
0
];
...
...
PcapDotNet/src/PcapDotNet.Core/LivePacketCommunicator.cpp
View file @
03f5e460
...
...
@@ -2,6 +2,7 @@
#include "Pcap.h"
using
namespace
System
;
using
namespace
PcapDotNet
::
Core
;
LivePacketCommunicator
::
LivePacketCommunicator
(
const
char
*
source
,
int
snapshotLength
,
PacketDeviceOpenAttributes
attributes
,
int
readTimeout
,
pcap_rmtauth
*
auth
,
SocketAddress
^
netmask
)
...
...
@@ -21,5 +22,8 @@ PacketTotalStatistics^ LivePacketCommunicator::TotalStatistics::get()
void
LivePacketCommunicator
::
Transmit
(
PacketSendBuffer
^
sendBuffer
,
bool
isSync
)
{
if
(
sendBuffer
==
nullptr
)
throw
gcnew
ArgumentNullException
(
"sendBuffer"
);
sendBuffer
->
Transmit
(
PcapDescriptor
,
isSync
);
}
PcapDotNet/src/PcapDotNet.Core/PacketCommunicator.cpp
View file @
03f5e460
...
...
@@ -118,6 +118,9 @@ void PacketCommunicator::SetKernelMinimumBytesToCopy(int size)
void
PacketCommunicator
::
SetSamplingMethod
(
SamplingMethod
^
method
)
{
if
(
method
==
nullptr
)
throw
gcnew
ArgumentNullException
(
"method"
);
pcap_samp
*
pcapSamplingMethod
=
pcap_setsampling
(
_pcapDescriptor
);
pcapSamplingMethod
->
method
=
method
->
Method
;
pcapSamplingMethod
->
value
=
method
->
Value
;
...
...
@@ -239,6 +242,9 @@ void PacketCommunicator::Break()
void
PacketCommunicator
::
SendPacket
(
Packet
^
packet
)
{
if
(
packet
==
nullptr
)
throw
gcnew
ArgumentNullException
(
"packet"
);
if
(
packet
->
Length
==
0
)
return
;
pin_ptr
<
Byte
>
unamangedPacketBytes
=
&
packet
->
Buffer
[
0
];
...
...
@@ -253,6 +259,9 @@ BerkeleyPacketFilter^ PacketCommunicator::CreateFilter(String^ filterValue)
void
PacketCommunicator
::
SetFilter
(
BerkeleyPacketFilter
^
filter
)
{
if
(
filter
==
nullptr
)
throw
gcnew
ArgumentNullException
(
"filter"
);
filter
->
SetFilter
(
_pcapDescriptor
);
}
...
...
PcapDotNet/src/PcapDotNet.Core/PacketDumpFile.cpp
View file @
03f5e460
...
...
@@ -13,6 +13,9 @@ using namespace PcapDotNet::Packets;
// static
void
PacketDumpFile
::
Dump
(
String
^
fileName
,
PcapDataLink
dataLink
,
int
snapshotLength
,
IEnumerable
<
Packet
^>^
packets
)
{
if
(
packets
==
nullptr
)
throw
gcnew
ArgumentNullException
(
"packets"
);
pcap_t
*
pcapDescriptor
=
pcap_open_dead
(
dataLink
.
Value
,
snapshotLength
);
if
(
pcapDescriptor
==
NULL
)
throw
gcnew
InvalidOperationException
(
"Unable to open open a dead capture"
);
...
...
@@ -40,6 +43,9 @@ void PacketDumpFile::Dump(String^ fileName, PcapDataLink dataLink, int snapshotL
void
PacketDumpFile
::
Dump
(
Packet
^
packet
)
{
if
(
packet
==
nullptr
)
throw
gcnew
ArgumentNullException
(
"packet"
);
pcap_pkthdr
header
;
PacketHeader
::
GetPcapHeader
(
header
,
packet
);
std
::
string
unmanagedFilename
=
MarshalingServices
::
ManagedToUnmanagedString
(
_filename
);
...
...
PcapDotNet/src/PcapDotNet.Core/PacketSendBuffer.cpp
View file @
03f5e460
...
...
@@ -14,6 +14,9 @@ PacketSendBuffer::PacketSendBuffer(unsigned int capacity)
void
PacketSendBuffer
::
Enqueue
(
Packet
^
packet
)
{
if
(
packet
==
nullptr
)
throw
gcnew
ArgumentNullException
(
"packet"
);
pcap_pkthdr
pcapHeader
;
PacketHeader
::
GetPcapHeader
(
pcapHeader
,
packet
);
pin_ptr
<
Byte
>
unmanagedPacketBytes
=
&
packet
->
Buffer
[
0
];
...
...
PcapDotNet/src/PcapDotNet.Packets/ByteArrayExtensions.cs
View file @
03f5e460
...
...
@@ -35,6 +35,8 @@ namespace PcapDotNet.Packets
/// <returns>The value read from the buffer.</returns>
public
static
byte
ReadByte
(
this
byte
[]
buffer
,
int
offset
)
{
if
(
buffer
==
null
)
throw
new
ArgumentNullException
(
"buffer"
);
return
buffer
[
offset
];
}
...
...
@@ -334,6 +336,9 @@ namespace PcapDotNet.Packets
/// <param name="value">The value to write.</param>
public
static
void
Write
(
this
byte
[]
buffer
,
int
offset
,
byte
value
)
{
if
(
buffer
==
null
)
throw
new
ArgumentNullException
(
"buffer"
);
buffer
[
offset
]
=
value
;
}
...
...
@@ -357,6 +362,11 @@ namespace PcapDotNet.Packets
/// <param name="value">The value to write.</param>
public
static
void
Write
(
this
byte
[]
buffer
,
ref
int
offset
,
IEnumerable
<
byte
>
value
)
{
if
(
buffer
==
null
)
throw
new
ArgumentNullException
(
"buffer"
);
if
(
value
==
null
)
throw
new
ArgumentNullException
(
"value"
);
foreach
(
byte
b
in
value
)
buffer
.
Write
(
offset
++,
b
);
}
...
...
@@ -514,6 +524,9 @@ namespace PcapDotNet.Packets
/// <param name="value">The value to write.</param>
public
static
void
Write
(
this
byte
[]
buffer
,
int
offset
,
Datagram
value
)
{
if
(
value
==
null
)
throw
new
ArgumentNullException
(
"value"
);
value
.
Write
(
buffer
,
offset
);
}
...
...
@@ -525,6 +538,9 @@ namespace PcapDotNet.Packets
/// <param name="value">The value to write.</param>
public
static
void
Write
(
this
byte
[]
buffer
,
ref
int
offset
,
Datagram
value
)
{
if
(
value
==
null
)
throw
new
ArgumentNullException
(
"value"
);
value
.
Write
(
buffer
,
offset
);
offset
+=
value
.
Length
;
}
...
...
PcapDotNet/src/PcapDotNet.Packets/Datagram.cs
View file @
03f5e460
...
...
@@ -21,8 +21,13 @@ namespace PcapDotNet.Packets
/// </summary>
/// <param name="buffer">The buffer to take as a datagram.</param>
public
Datagram
(
byte
[]
buffer
)
:
this
(
buffer
,
0
,
buffer
.
Length
)
{
if
(
buffer
==
null
)
throw
new
ArgumentNullException
(
"buffer"
);
_buffer
=
buffer
;
_startOffset
=
0
;
_length
=
buffer
.
Length
;
}
/// <summary>
...
...
@@ -116,7 +121,7 @@ namespace PcapDotNet.Packets
/// </summary>
public
bool
Equals
(
Datagram
other
)
{
if
(
Length
!=
other
.
Length
)
if
(
other
==
null
||
Length
!=
other
.
Length
)
return
false
;
for
(
int
i
=
0
;
i
!=
Length
;
++
i
)
...
...
@@ -296,6 +301,9 @@ namespace PcapDotNet.Packets
/// <returns>A value equals to the sum of all 16 bits big endian values of the given bytes.</returns>
protected
static
uint
Sum16Bits
(
byte
[]
buffer
,
int
offset
,
int
length
)
{
if
(
buffer
==
null
)
throw
new
ArgumentNullException
(
"buffer"
);
int
endOffset
=
offset
+
length
;
uint
sum
=
0
;
while
(
offset
<
endOffset
-
1
)
...
...
PcapDotNet/src/PcapDotNet.Packets/Ethernet/MacAddress.cs
View file @
03f5e460
...
...
@@ -37,6 +37,9 @@ namespace PcapDotNet.Packets.Ethernet
/// <param name="address">The string value in hexadecimal format. Every two digits are separated by a colon.</param>
public
MacAddress
(
string
address
)
{
if
(
address
==
null
)
throw
new
ArgumentNullException
(
"address"
);
string
[]
hexes
=
address
.
Split
(
':'
);
if
(
hexes
.
Length
!=
6
)
throw
new
ArgumentException
(
"Failed parsing "
+
address
+
" as mac address. Expected 6 hexes and got "
+
hexes
.
Length
+
" hexes"
,
"address"
);
...
...
PcapDotNet/src/PcapDotNet.Packets/Icmp/IcmpDatagram.cs
View file @
03f5e460
...
...
@@ -180,6 +180,9 @@ namespace PcapDotNet.Packets.Icmp
/// <returns>An IcmpDatagram according to the Icmp message type.</returns>
public
static
IcmpDatagram
CreateDatagram
(
byte
[]
buffer
,
int
offset
,
int
length
)
{
if
(
buffer
==
null
)
throw
new
ArgumentNullException
(
"buffer"
);
if
(
length
<=
Offset
.
Type
)
return
new
IcmpUnknownDatagram
(
buffer
,
offset
,
length
);
...
...
PcapDotNet/src/PcapDotNet.Packets/Igmp/IgmpGroupRecord.cs
View file @
03f5e460
...
...
@@ -31,6 +31,9 @@ namespace PcapDotNet.Packets.Igmp
/// </param>
public
IgmpGroupRecord
(
IgmpRecordType
recordType
,
IpV4Address
multicastAddress
,
ReadOnlyCollection
<
IpV4Address
>
sourceAddresses
,
Datagram
auxiliaryData
)
{
if
(
auxiliaryData
==
null
)
throw
new
ArgumentNullException
(
"auxiliaryData"
);
if
(
auxiliaryData
.
Length
%
4
!=
0
)
throw
new
ArgumentException
(
"Auxiliary data length must divide by 4 and can't be "
+
auxiliaryData
.
Length
,
"auxiliaryData"
);
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV4/IpV4Address.cs
View file @
03f5e460
using
System
;
using
System.Globalization
;
using
System.Text
;
...
...
@@ -47,6 +48,9 @@ namespace PcapDotNet.Packets.IpV4
/// </summary>
public
IpV4Address
(
string
value
)
{
if
(
value
==
null
)
throw
new
ArgumentNullException
(
"value"
);
string
[]
values
=
value
.
Split
(
'.'
);
_value
=
(
uint
)((
byte
.
Parse
(
values
[
0
],
CultureInfo
.
InvariantCulture
)
<<
24
)
+
(
byte
.
Parse
(
values
[
1
],
CultureInfo
.
InvariantCulture
)
<<
16
)
+
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV4/IpV4OptionBasicSecurity.cs
View file @
03f5e460
...
...
@@ -188,6 +188,9 @@ namespace PcapDotNet.Packets.IpV4
/// <returns>On success - the complex option read. On failure - null.</returns>
public
Option
CreateInstance
(
byte
[]
buffer
,
ref
int
offset
,
byte
valueLength
)
{
if
(
buffer
==
null
)
throw
new
ArgumentNullException
(
"buffer"
);
if
(
valueLength
<
OptionValueMinimumLength
)
return
null
;
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV4/IpV4OptionQuickStart.cs
View file @
03f5e460
...
...
@@ -238,6 +238,9 @@ namespace PcapDotNet.Packets.IpV4
/// <returns>On success - the complex option read. On failure - null.</returns>
public
Option
CreateInstance
(
byte
[]
buffer
,
ref
int
offset
,
byte
valueLength
)
{
if
(
buffer
==
null
)
throw
new
ArgumentNullException
(
"buffer"
);
if
(
valueLength
!=
OptionValueLength
)
return
null
;
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV4/IpV4OptionRoute.cs
View file @
03f5e460
...
...
@@ -109,6 +109,9 @@ namespace PcapDotNet.Packets.IpV4
protected
static
bool
TryRead
(
out
IpV4Address
[]
addresses
,
out
byte
pointedAddressIndex
,
byte
[]
buffer
,
ref
int
offset
,
byte
valueLength
)
{
if
(
buffer
==
null
)
throw
new
ArgumentNullException
(
"buffer"
);
addresses
=
null
;
pointedAddressIndex
=
0
;
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV6/IpV6Address.cs
View file @
03f5e460
...
...
@@ -42,6 +42,9 @@ namespace PcapDotNet.Packets.IpV6
/// </summary>
public
IpV6Address
(
string
value
)
{
if
(
value
==
null
)
throw
new
ArgumentNullException
(
"value"
);
string
cannonizedValue
=
value
;
// Handle ...:1.2.3.4
...
...
PcapDotNet/src/PcapDotNet.Packets/Packet.cs
View file @
03f5e460
...
...
@@ -19,6 +19,9 @@ namespace PcapDotNet.Packets
/// </summary>
public
static
Packet
FromHexadecimalString
(
string
value
,
DateTime
timestamp
,
DataLinkKind
dataLink
)
{
if
(
value
==
null
)
throw
new
ArgumentNullException
(
"value"
);
byte
[]
bytes
=
new
byte
[
value
.
Length
/
2
];
for
(
int
i
=
0
;
i
<
value
.
Length
;
i
+=
2
)
...
...
@@ -94,7 +97,7 @@ namespace PcapDotNet.Packets
/// <returns>True iff the packets have equal data.</returns>
public
bool
Equals
(
Packet
other
)
{
return
(
Length
==
other
.
Length
&&
this
.
SequenceEqual
(
other
));
return
(
other
!=
null
&&
Length
==
other
.
Length
&&
this
.
SequenceEqual
(
other
));
}
/// <summary>
...
...
PcapDotNet/src/PcapDotNet.Packets/PacketBuilder.cs
View file @
03f5e460
...
...
@@ -73,6 +73,9 @@ namespace PcapDotNet.Packets
/// <param name="layers">The layers to build the packet accordingly and by their order.</param>
public
PacketBuilder
(
params
ILayer
[]
layers
)
{
if
(
layers
==
null
)
throw
new
ArgumentNullException
(
"layers"
);
if
(
layers
.
Length
==
0
)
throw
new
ArgumentException
(
"At least one layer must be given"
,
"layers"
);
...
...
PcapDotNet/src/PcapDotNet.Packets/Transport/TcpOptionMd5Signature.cs
View file @
03f5e460
...
...
@@ -44,6 +44,9 @@ namespace PcapDotNet.Packets.Transport
public
TcpOptionMd5Signature
(
IList
<
byte
>
data
)
:
base
(
TcpOptionType
.
Md5Signature
)
{
if
(
data
==
null
)
throw
new
ArgumentNullException
(
"data"
);
if
(
data
.
Count
!=
OptionValueLength
)
throw
new
ArgumentException
(
"data must be "
+
OptionValueLength
+
" bytes and not "
+
data
.
Count
+
" bytes"
,
"data"
);
...
...
PcapDotNet/src/PcapDotNet.ruleset
View file @
03f5e460
...
...
@@ -14,6 +14,5 @@
<Rule
Id=
"CA1710"
Action=
"None"
/>
<Rule
Id=
"CA2000"
Action=
"None"
/>
<Rule
Id=
"CA2004"
Action=
"None"
/>
<Rule
Id=
"CA2204"
Action=
"None"
/>
</Rules>
</RuleSet>
\ No newline at end of file
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