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
28625c92
Commit
28625c92
authored
May 20, 2010
by
Brickner_cp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactoring - make all IOptionComplexFactory.CreateInstance() implementations internal
parent
0808ef5b
Hide whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
30 additions
and
148 deletions
+30
-148
IpV4Tests.cs
PcapDotNet/src/PcapDotNet.Packets.Test/IpV4Tests.cs
+0
-38
TcpTests.cs
PcapDotNet/src/PcapDotNet.Packets.Test/TcpTests.cs
+0
-14
IcmpDatagram.cs
PcapDotNet/src/PcapDotNet.Packets/Icmp/IcmpDatagram.cs
+0
-63
IpV4OptionBasicSecurity.cs
...et/src/PcapDotNet.Packets/IpV4/IpV4OptionBasicSecurity.cs
+3
-3
IpV4OptionLooseSourceRouting.cs
...c/PcapDotNet.Packets/IpV4/IpV4OptionLooseSourceRouting.cs
+1
-1
IpV4OptionQuickStart.cs
...otNet/src/PcapDotNet.Packets/IpV4/IpV4OptionQuickStart.cs
+3
-3
IpV4OptionRecordRoute.cs
...tNet/src/PcapDotNet.Packets/IpV4/IpV4OptionRecordRoute.cs
+1
-1
IpV4OptionRoute.cs
PcapDotNet/src/PcapDotNet.Packets/IpV4/IpV4OptionRoute.cs
+1
-4
IpV4OptionRouterAlert.cs
...tNet/src/PcapDotNet.Packets/IpV4/IpV4OptionRouterAlert.cs
+1
-1
IpV4OptionStreamIdentifier.cs
...src/PcapDotNet.Packets/IpV4/IpV4OptionStreamIdentifier.cs
+1
-1
IpV4OptionStrictSourceRouting.cs
.../PcapDotNet.Packets/IpV4/IpV4OptionStrictSourceRouting.cs
+1
-1
IpV4OptionTimestamp.cs
...DotNet/src/PcapDotNet.Packets/IpV4/IpV4OptionTimestamp.cs
+1
-1
IpV4OptionTraceRoute.cs
...otNet/src/PcapDotNet.Packets/IpV4/IpV4OptionTraceRoute.cs
+1
-1
TcpOptionAlternateChecksumData.cs
...otNet.Packets/Transport/TcpOptionAlternateChecksumData.cs
+1
-1
TcpOptionAlternateChecksumRequest.cs
...et.Packets/Transport/TcpOptionAlternateChecksumRequest.cs
+1
-1
TcpOptionConnectionCount.cs
.../PcapDotNet.Packets/Transport/TcpOptionConnectionCount.cs
+1
-1
TcpOptionConnectionCountEcho.cs
...pDotNet.Packets/Transport/TcpOptionConnectionCountEcho.cs
+1
-1
TcpOptionConnectionCountNew.cs
...apDotNet.Packets/Transport/TcpOptionConnectionCountNew.cs
+1
-1
TcpOptionEcho.cs
PcapDotNet/src/PcapDotNet.Packets/Transport/TcpOptionEcho.cs
+1
-1
TcpOptionEchoReply.cs
...et/src/PcapDotNet.Packets/Transport/TcpOptionEchoReply.cs
+1
-1
TcpOptionMaximumSegmentSize.cs
...apDotNet.Packets/Transport/TcpOptionMaximumSegmentSize.cs
+1
-1
TcpOptionMd5Signature.cs
...src/PcapDotNet.Packets/Transport/TcpOptionMd5Signature.cs
+1
-1
TcpOptionPartialOrderConnectionPermitted.cs
...ets/Transport/TcpOptionPartialOrderConnectionPermitted.cs
+1
-1
TcpOptionPartialOrderServiceProfile.cs
....Packets/Transport/TcpOptionPartialOrderServiceProfile.cs
+2
-2
TcpOptionSelectiveAcknowledgment.cs
...Net.Packets/Transport/TcpOptionSelectiveAcknowledgment.cs
+1
-1
TcpOptionSelectiveAcknowledgmentPermitted.cs
...ts/Transport/TcpOptionSelectiveAcknowledgmentPermitted.cs
+1
-1
TcpOptionTimestamp.cs
...et/src/PcapDotNet.Packets/Transport/TcpOptionTimestamp.cs
+1
-1
TcpOptionWindowScale.cs
.../src/PcapDotNet.Packets/Transport/TcpOptionWindowScale.cs
+1
-1
No files found.
PcapDotNet/src/PcapDotNet.Packets.Test/IpV4Tests.cs
View file @
28625c92
...
...
@@ -563,44 +563,6 @@ namespace PcapDotNet.Packets.Test
Assert
.
IsNotNull
(
layer
.
GetHashCode
());
}
[
TestMethod
]
[
ExpectedException
(
typeof
(
ArgumentNullException
),
AllowDerivedTypes
=
false
)]
public
void
IpV4OptionQuickStartCreateInstanceNullBufferTest
()
{
int
offset
=
0
;
Assert
.
IsNotNull
(
new
IpV4OptionQuickStart
().
CreateInstance
(
null
,
ref
offset
,
0
));
}
[
TestMethod
]
[
ExpectedException
(
typeof
(
ArgumentNullException
),
AllowDerivedTypes
=
false
)]
public
void
IpV4OptionBasicSecurityCreateInstanceNullBufferTest
()
{
int
offset
=
0
;
Assert
.
IsNotNull
(
new
IpV4OptionBasicSecurity
().
CreateInstance
(
null
,
ref
offset
,
0
));
Assert
.
Fail
();
}
[
TestMethod
]
[
ExpectedException
(
typeof
(
ArgumentNullException
),
AllowDerivedTypes
=
false
)]
public
void
IpV4OptionLooseSourceRoutingCreateInstanceNullBufferTest
()
{
int
offset
=
0
;
Assert
.
IsNotNull
(
new
IpV4OptionLooseSourceRouting
().
CreateInstance
(
null
,
ref
offset
,
0
));
Assert
.
Fail
();
}
[
TestMethod
]
public
void
IpV4OptionCreateInstanceBadValueLengthTest
()
{
int
offset
=
0
;
Assert
.
IsNull
(
new
IpV4OptionQuickStart
().
CreateInstance
(
new
byte
[
0
],
ref
offset
,
0
));
Assert
.
IsNull
(
new
IpV4OptionTraceRoute
().
CreateInstance
(
new
byte
[
0
],
ref
offset
,
123
));
Assert
.
IsNull
(
new
IpV4OptionRecordRoute
().
CreateInstance
(
new
byte
[
0
],
ref
offset
,
0
));
Assert
.
IsNull
(
new
IpV4OptionRouterAlert
().
CreateInstance
(
new
byte
[
0
],
ref
offset
,
123
));
Assert
.
IsNull
(
new
IpV4OptionStreamIdentifier
().
CreateInstance
(
new
byte
[
0
],
ref
offset
,
123
));
Assert
.
IsNull
(
new
IpV4OptionStrictSourceRouting
().
CreateInstance
(
new
byte
[
0
],
ref
offset
,
0
));
}
private
static
Packet
HexToPacket
(
string
hexString
,
DataLinkKind
dataLinkKind
)
{
return
Packet
.
FromHexadecimalString
(
hexString
,
DateTime
.
MinValue
,
dataLinkKind
);
...
...
PcapDotNet/src/PcapDotNet.Packets.Test/TcpTests.cs
View file @
28625c92
...
...
@@ -180,19 +180,5 @@ namespace PcapDotNet.Packets.Test
Assert
.
IsNotNull
(
new
TcpOptionMd5Signature
(
null
));
Assert
.
Fail
();
}
[
TestMethod
]
public
void
TcpOptionCreateInstanceBadValueLengthTest
()
{
int
offset
=
0
;
Assert
.
IsNull
(
new
TcpOptionPartialOrderServiceProfile
().
CreateInstance
(
new
byte
[
0
],
ref
offset
,
123
));
Assert
.
IsNull
(
new
TcpOptionTimestamp
().
CreateInstance
(
new
byte
[
0
],
ref
offset
,
123
));
Assert
.
IsNull
(
new
TcpOptionAlternateChecksumRequest
().
CreateInstance
(
new
byte
[
0
],
ref
offset
,
123
));
Assert
.
IsNull
(
new
TcpOptionConnectionCount
().
CreateInstance
(
new
byte
[
0
],
ref
offset
,
123
));
Assert
.
IsNull
(
new
TcpOptionConnectionCountEcho
().
CreateInstance
(
new
byte
[
0
],
ref
offset
,
123
));
Assert
.
IsNull
(
new
TcpOptionEcho
().
CreateInstance
(
new
byte
[
0
],
ref
offset
,
123
));
Assert
.
IsNull
(
new
TcpOptionSelectiveAcknowledgment
().
CreateInstance
(
new
byte
[
0
],
ref
offset
,
1
));
Assert
.
IsNull
(
new
TcpOptionWindowScale
().
CreateInstance
(
new
byte
[
0
],
ref
offset
,
123
));
}
}
}
\ No newline at end of file
PcapDotNet/src/PcapDotNet.Packets/Icmp/IcmpDatagram.cs
View file @
28625c92
...
...
@@ -189,69 +189,6 @@ namespace PcapDotNet.Packets.Icmp
IcmpMessageType
messageType
=
(
IcmpMessageType
)
buffer
[
offset
+
Offset
.
Type
];
return
IcmpDatagramFactory
.
CreateInstance
(
messageType
,
buffer
,
offset
,
length
);
// switch (messageType)
// {
// case IcmpMessageType.DestinationUnreachable:
// return new IcmpDestinationUnreachableDatagram(buffer, offset, length);
//
// case IcmpMessageType.TimeExceeded:
// return new IcmpTimeExceededDatagram(buffer, offset, length);
//
// case IcmpMessageType.SourceQuench:
// return new IcmpSourceQuenchDatagram(buffer, offset, length);
//
// case IcmpMessageType.ParameterProblem:
// return new IcmpParameterProblemDatagram(buffer, offset, length);
//
// case IcmpMessageType.Redirect:
// return new IcmpRedirectDatagram(buffer, offset, length);
//
// case IcmpMessageType.Echo:
// return new IcmpEchoDatagram(buffer, offset, length);
//
// case IcmpMessageType.EchoReply:
// return new IcmpEchoReplyDatagram(buffer, offset, length);
//
// case IcmpMessageType.Timestamp:
// return new IcmpTimestampDatagram(buffer, offset, length);
//
// case IcmpMessageType.TimestampReply:
// return new IcmpTimestampReplyDatagram(buffer, offset, length);
//
// case IcmpMessageType.InformationRequest:
// return new IcmpInformationRequestDatagram(buffer, offset, length);
//
// case IcmpMessageType.InformationReply:
// return new IcmpInformationReplyDatagram(buffer, offset, length);
//
// case IcmpMessageType.DomainNameRequest:
// return new IcmpDomainNameRequestDatagram(buffer, offset, length);
//
// case IcmpMessageType.RouterAdvertisement:
// return new IcmpRouterAdvertisementDatagram(buffer, offset, length);
//
// case IcmpMessageType.AddressMaskRequest:
// return new IcmpAddressMaskRequestDatagram(buffer, offset, length);
//
// case IcmpMessageType.AddressMaskReply:
// return new IcmpAddressMaskReplyDatagram(buffer, offset, length);
//
// case IcmpMessageType.TraceRoute:
// return new IcmpTraceRouteDatagram(buffer, offset, length);
//
// case IcmpMessageType.ConversionFailed:
// return new IcmpConversionFailedDatagram(buffer, offset, length);
//
// case IcmpMessageType.SecurityFailures:
// return new IcmpSecurityFailuresDatagram(buffer, offset, length);
//
// case IcmpMessageType.RouterSolicitation:
// return new IcmpRouterSolicitationDatagram(buffer, offset, length);
//
// case IcmpMessageType.DomainNameReply: // Domain Name Reply is unsupported
// default:
// return new IcmpUnknownDatagram(buffer, offset, length);
// }
}
internal
abstract
IcmpDatagram
CreateInstance
(
byte
[]
buffer
,
int
offset
,
int
length
);
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV4/IpV4OptionBasicSecurity.cs
View file @
28625c92
...
...
@@ -186,10 +186,10 @@ namespace PcapDotNet.Packets.IpV4
/// <param name="offset">The offset to the first byte to read the buffer. Will be incremented by the number of bytes read.</param>
/// <param name="valueLength">The number of bytes the option value should take according to the length field that was already read.</param>
/// <returns>On success - the complex option read. On failure - null.</returns>
public
Option
CreateInstance
(
byte
[]
buffer
,
ref
int
offset
,
byte
valueLength
)
Option
IOptionComplexFactory
.
CreateInstance
(
byte
[]
buffer
,
ref
int
offset
,
byte
valueLength
)
{
if
(
buffer
==
null
)
throw
new
ArgumentNullException
(
"buffer"
);
//
if (buffer == null)
//
throw new ArgumentNullException("buffer");
if
(
valueLength
<
OptionValueMinimumLength
)
return
null
;
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV4/IpV4OptionLooseSourceRouting.cs
View file @
28625c92
...
...
@@ -86,7 +86,7 @@ namespace PcapDotNet.Packets.IpV4
/// <param name="offset">The offset to the first byte to read the buffer. Will be incremented by the number of bytes read.</param>
/// <param name="valueLength">The number of bytes the option value should take according to the length field that was already read.</param>
/// <returns>On success - the complex option read. On failure - null.</returns>
public
Option
CreateInstance
(
byte
[]
buffer
,
ref
int
offset
,
byte
valueLength
)
Option
IOptionComplexFactory
.
CreateInstance
(
byte
[]
buffer
,
ref
int
offset
,
byte
valueLength
)
{
IpV4Address
[]
addresses
;
byte
pointedAddressIndex
;
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV4/IpV4OptionQuickStart.cs
View file @
28625c92
...
...
@@ -236,10 +236,10 @@ namespace PcapDotNet.Packets.IpV4
/// <param name="offset">The offset to the first byte to read the buffer. Will be incremented by the number of bytes read.</param>
/// <param name="valueLength">The number of bytes the option value should take according to the length field that was already read.</param>
/// <returns>On success - the complex option read. On failure - null.</returns>
public
Option
CreateInstance
(
byte
[]
buffer
,
ref
int
offset
,
byte
valueLength
)
Option
IOptionComplexFactory
.
CreateInstance
(
byte
[]
buffer
,
ref
int
offset
,
byte
valueLength
)
{
if
(
buffer
==
null
)
throw
new
ArgumentNullException
(
"buffer"
);
//
if (buffer == null)
//
throw new ArgumentNullException("buffer");
if
(
valueLength
!=
OptionValueLength
)
return
null
;
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV4/IpV4OptionRecordRoute.cs
View file @
28625c92
...
...
@@ -91,7 +91,7 @@ namespace PcapDotNet.Packets.IpV4
/// <param name="offset">The offset to the first byte to read the buffer. Will be incremented by the number of bytes read.</param>
/// <param name="valueLength">The number of bytes the option value should take according to the length field that was already read.</param>
/// <returns>On success - the complex option read. On failure - null.</returns>
public
Option
CreateInstance
(
byte
[]
buffer
,
ref
int
offset
,
byte
valueLength
)
Option
IOptionComplexFactory
.
CreateInstance
(
byte
[]
buffer
,
ref
int
offset
,
byte
valueLength
)
{
IpV4Address
[]
addresses
;
byte
pointedAddressIndex
;
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV4/IpV4OptionRoute.cs
View file @
28625c92
...
...
@@ -106,12 +106,9 @@ namespace PcapDotNet.Packets.IpV4
/// <param name="offset">The offset in the buffer to start reading the value from.</param>
/// <param name="valueLength">The number of bytes that the value should be.</param>
/// <returns>True iff the read was successful.</returns>
protected
static
bool
TryRead
(
out
IpV4Address
[]
addresses
,
out
byte
pointedAddressIndex
,
internal
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/IpV4/IpV4OptionRouterAlert.cs
View file @
28625c92
...
...
@@ -119,7 +119,7 @@ namespace PcapDotNet.Packets.IpV4
/// <param name="offset">The offset to the first byte to read the buffer. Will be incremented by the number of bytes read.</param>
/// <param name="valueLength">The number of bytes the option value should take according to the length field that was already read.</param>
/// <returns>On success - the complex option read. On failure - null.</returns>
public
Option
CreateInstance
(
byte
[]
buffer
,
ref
int
offset
,
byte
valueLength
)
Option
IOptionComplexFactory
.
CreateInstance
(
byte
[]
buffer
,
ref
int
offset
,
byte
valueLength
)
{
if
(
valueLength
!=
OptionHeaderLength
)
return
null
;
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV4/IpV4OptionStreamIdentifier.cs
View file @
28625c92
...
...
@@ -99,7 +99,7 @@ namespace PcapDotNet.Packets.IpV4
/// <param name="offset">The offset to the first byte to read the buffer. Will be incremented by the number of bytes read.</param>
/// <param name="valueLength">The number of bytes the option value should take according to the length field that was already read.</param>
/// <returns>On success - the complex option read. On failure - null.</returns>
public
Option
CreateInstance
(
byte
[]
buffer
,
ref
int
offset
,
byte
valueLength
)
Option
IOptionComplexFactory
.
CreateInstance
(
byte
[]
buffer
,
ref
int
offset
,
byte
valueLength
)
{
if
(
valueLength
!=
OptionHeaderLength
)
return
null
;
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV4/IpV4OptionStrictSourceRouting.cs
View file @
28625c92
...
...
@@ -87,7 +87,7 @@ namespace PcapDotNet.Packets.IpV4
/// <param name="offset">The offset to the first byte to read the buffer. Will be incremented by the number of bytes read.</param>
/// <param name="valueLength">The number of bytes the option value should take according to the length field that was already read.</param>
/// <returns>On success - the complex option read. On failure - null.</returns>
public
Option
CreateInstance
(
byte
[]
buffer
,
ref
int
offset
,
byte
valueLength
)
Option
IOptionComplexFactory
.
CreateInstance
(
byte
[]
buffer
,
ref
int
offset
,
byte
valueLength
)
{
IpV4Address
[]
addresses
;
byte
pointedAddressIndex
;
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV4/IpV4OptionTimestamp.cs
View file @
28625c92
...
...
@@ -75,7 +75,7 @@ namespace PcapDotNet.Packets.IpV4
[
OptionTypeRegistration
(
typeof
(
IpV4OptionType
),
IpV4OptionType
.
InternetTimestamp
)]
internal
class
IpV4OptionTimestampFactory
:
IOptionComplexFactory
{
public
Option
CreateInstance
(
byte
[]
buffer
,
ref
int
offset
,
byte
valueLength
)
Option
IOptionComplexFactory
.
CreateInstance
(
byte
[]
buffer
,
ref
int
offset
,
byte
valueLength
)
{
if
(
valueLength
<
OptionValueMinimumLength
||
valueLength
%
4
!=
2
)
return
null
;
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV4/IpV4OptionTraceRoute.cs
View file @
28625c92
...
...
@@ -179,7 +179,7 @@ namespace PcapDotNet.Packets.IpV4
/// <param name="offset">The offset to the first byte to read the buffer. Will be incremented by the number of bytes read.</param>
/// <param name="valueLength">The number of bytes the option value should take according to the length field that was already read.</param>
/// <returns>On success - the complex option read. On failure - null.</returns>
public
Option
CreateInstance
(
byte
[]
buffer
,
ref
int
offset
,
byte
valueLength
)
Option
IOptionComplexFactory
.
CreateInstance
(
byte
[]
buffer
,
ref
int
offset
,
byte
valueLength
)
{
if
(
valueLength
!=
OptionValueLength
)
return
null
;
...
...
PcapDotNet/src/PcapDotNet.Packets/Transport/TcpOptionAlternateChecksumData.cs
View file @
28625c92
...
...
@@ -118,7 +118,7 @@ namespace PcapDotNet.Packets.Transport
/// <param name="offset">The offset to the first byte to read the buffer. Will be incremented by the number of bytes read.</param>
/// <param name="valueLength">The number of bytes the option value should take according to the length field that was already read.</param>
/// <returns>On success - the complex option read. On failure - null.</returns>
public
Option
CreateInstance
(
byte
[]
buffer
,
ref
int
offset
,
byte
valueLength
)
Option
IOptionComplexFactory
.
CreateInstance
(
byte
[]
buffer
,
ref
int
offset
,
byte
valueLength
)
{
if
(
valueLength
<
OptionValueMinimumLength
)
return
null
;
...
...
PcapDotNet/src/PcapDotNet.Packets/Transport/TcpOptionAlternateChecksumRequest.cs
View file @
28625c92
...
...
@@ -112,7 +112,7 @@ namespace PcapDotNet.Packets.Transport
/// <param name="offset">The offset to the first byte to read the buffer. Will be incremented by the number of bytes read.</param>
/// <param name="valueLength">The number of bytes the option value should take according to the length field that was already read.</param>
/// <returns>On success - the complex option read. On failure - null.</returns>
public
Option
CreateInstance
(
byte
[]
buffer
,
ref
int
offset
,
byte
valueLength
)
Option
IOptionComplexFactory
.
CreateInstance
(
byte
[]
buffer
,
ref
int
offset
,
byte
valueLength
)
{
if
(
valueLength
!=
OptionValueLength
)
return
null
;
...
...
PcapDotNet/src/PcapDotNet.Packets/Transport/TcpOptionConnectionCount.cs
View file @
28625c92
...
...
@@ -41,7 +41,7 @@ namespace PcapDotNet.Packets.Transport
/// <param name="offset">The offset to the first byte to read the buffer. Will be incremented by the number of bytes read.</param>
/// <param name="valueLength">The number of bytes the option value should take according to the length field that was already read.</param>
/// <returns>On success - the complex option read. On failure - null.</returns>
public
Option
CreateInstance
(
byte
[]
buffer
,
ref
int
offset
,
byte
valueLength
)
Option
IOptionComplexFactory
.
CreateInstance
(
byte
[]
buffer
,
ref
int
offset
,
byte
valueLength
)
{
uint
connectionCount
;
if
(!
TryRead
(
out
connectionCount
,
buffer
,
ref
offset
,
valueLength
))
...
...
PcapDotNet/src/PcapDotNet.Packets/Transport/TcpOptionConnectionCountEcho.cs
View file @
28625c92
...
...
@@ -45,7 +45,7 @@ namespace PcapDotNet.Packets.Transport
/// <param name="offset">The offset to the first byte to read the buffer. Will be incremented by the number of bytes read.</param>
/// <param name="valueLength">The number of bytes the option value should take according to the length field that was already read.</param>
/// <returns>On success - the complex option read. On failure - null.</returns>
public
Option
CreateInstance
(
byte
[]
buffer
,
ref
int
offset
,
byte
valueLength
)
Option
IOptionComplexFactory
.
CreateInstance
(
byte
[]
buffer
,
ref
int
offset
,
byte
valueLength
)
{
uint
connectionCount
;
if
(!
TryRead
(
out
connectionCount
,
buffer
,
ref
offset
,
valueLength
))
...
...
PcapDotNet/src/PcapDotNet.Packets/Transport/TcpOptionConnectionCountNew.cs
View file @
28625c92
...
...
@@ -42,7 +42,7 @@ namespace PcapDotNet.Packets.Transport
/// <param name="offset">The offset to the first byte to read the buffer. Will be incremented by the number of bytes read.</param>
/// <param name="valueLength">The number of bytes the option value should take according to the length field that was already read.</param>
/// <returns>On success - the complex option read. On failure - null.</returns>
public
Option
CreateInstance
(
byte
[]
buffer
,
ref
int
offset
,
byte
valueLength
)
Option
IOptionComplexFactory
.
CreateInstance
(
byte
[]
buffer
,
ref
int
offset
,
byte
valueLength
)
{
uint
connectionCount
;
if
(!
TryRead
(
out
connectionCount
,
buffer
,
ref
offset
,
valueLength
))
...
...
PcapDotNet/src/PcapDotNet.Packets/Transport/TcpOptionEcho.cs
View file @
28625c92
...
...
@@ -105,7 +105,7 @@ namespace PcapDotNet.Packets.Transport
/// <param name="offset">The offset to the first byte to read the buffer. Will be incremented by the number of bytes read.</param>
/// <param name="valueLength">The number of bytes the option value should take according to the length field that was already read.</param>
/// <returns>On success - the complex option read. On failure - null.</returns>
public
Option
CreateInstance
(
byte
[]
buffer
,
ref
int
offset
,
byte
valueLength
)
Option
IOptionComplexFactory
.
CreateInstance
(
byte
[]
buffer
,
ref
int
offset
,
byte
valueLength
)
{
if
(
valueLength
!=
OptionValueLength
)
return
null
;
...
...
PcapDotNet/src/PcapDotNet.Packets/Transport/TcpOptionEchoReply.cs
View file @
28625c92
...
...
@@ -112,7 +112,7 @@ namespace PcapDotNet.Packets.Transport
/// <param name="offset">The offset to the first byte to read the buffer. Will be incremented by the number of bytes read.</param>
/// <param name="valueLength">The number of bytes the option value should take according to the length field that was already read.</param>
/// <returns>On success - the complex option read. On failure - null.</returns>
public
Option
CreateInstance
(
byte
[]
buffer
,
ref
int
offset
,
byte
valueLength
)
Option
IOptionComplexFactory
.
CreateInstance
(
byte
[]
buffer
,
ref
int
offset
,
byte
valueLength
)
{
if
(
valueLength
!=
OptionValueLength
)
return
null
;
...
...
PcapDotNet/src/PcapDotNet.Packets/Transport/TcpOptionMaximumSegmentSize.cs
View file @
28625c92
...
...
@@ -103,7 +103,7 @@ namespace PcapDotNet.Packets.Transport
/// <param name="offset">The offset to the first byte to read the buffer. Will be incremented by the number of bytes read.</param>
/// <param name="valueLength">The number of bytes the option value should take according to the length field that was already read.</param>
/// <returns>On success - the complex option read. On failure - null.</returns>
public
Option
CreateInstance
(
byte
[]
buffer
,
ref
int
offset
,
byte
valueLength
)
Option
IOptionComplexFactory
.
CreateInstance
(
byte
[]
buffer
,
ref
int
offset
,
byte
valueLength
)
{
if
(
valueLength
!=
OptionValueLength
)
return
null
;
...
...
PcapDotNet/src/PcapDotNet.Packets/Transport/TcpOptionMd5Signature.cs
View file @
28625c92
...
...
@@ -116,7 +116,7 @@ namespace PcapDotNet.Packets.Transport
/// <param name="offset">The offset to the first byte to read the buffer. Will be incremented by the number of bytes read.</param>
/// <param name="valueLength">The number of bytes the option value should take according to the length field that was already read.</param>
/// <returns>On success - the complex option read. On failure - null.</returns>
public
Option
CreateInstance
(
byte
[]
buffer
,
ref
int
offset
,
byte
valueLength
)
Option
IOptionComplexFactory
.
CreateInstance
(
byte
[]
buffer
,
ref
int
offset
,
byte
valueLength
)
{
if
(
valueLength
!=
OptionValueLength
)
return
null
;
...
...
PcapDotNet/src/PcapDotNet.Packets/Transport/TcpOptionPartialOrderConnectionPermitted.cs
View file @
28625c92
...
...
@@ -70,7 +70,7 @@ namespace PcapDotNet.Packets.Transport
/// <param name="offset">The offset to the first byte to read the buffer. Will be incremented by the number of bytes read.</param>
/// <param name="valueLength">The number of bytes the option value should take according to the length field that was already read.</param>
/// <returns>On success - the complex option read. On failure - null.</returns>
public
Option
CreateInstance
(
byte
[]
buffer
,
ref
int
offset
,
byte
valueLength
)
Option
IOptionComplexFactory
.
CreateInstance
(
byte
[]
buffer
,
ref
int
offset
,
byte
valueLength
)
{
if
(
valueLength
!=
OptionValueLength
)
return
null
;
...
...
PcapDotNet/src/PcapDotNet.Packets/Transport/TcpOptionPartialOrderServiceProfile.cs
View file @
28625c92
...
...
@@ -106,7 +106,7 @@ namespace PcapDotNet.Packets.Transport
/// <summary>
/// The hash code of the partial order service profile option is the hash code of the option type xored with a combination of the IsStart and IsEnd values.
/// </summary>
public
override
int
GetHashCode
()
public
override
int
GetHashCode
()
{
return
base
.
GetHashCode
()
^
((
IsStart
?
1
:
0
)
<<
1
)
^
(
IsEnd
?
1
:
0
);
}
...
...
@@ -118,7 +118,7 @@ namespace PcapDotNet.Packets.Transport
/// <param name="offset">The offset to the first byte to read the buffer. Will be incremented by the number of bytes read.</param>
/// <param name="valueLength">The number of bytes the option value should take according to the length field that was already read.</param>
/// <returns>On success - the complex option read. On failure - null.</returns>
public
Option
CreateInstance
(
byte
[]
buffer
,
ref
int
offset
,
byte
valueLength
)
Option
IOptionComplexFactory
.
CreateInstance
(
byte
[]
buffer
,
ref
int
offset
,
byte
valueLength
)
{
if
(
valueLength
!=
OptionValueLength
)
return
null
;
...
...
PcapDotNet/src/PcapDotNet.Packets/Transport/TcpOptionSelectiveAcknowledgment.cs
View file @
28625c92
...
...
@@ -141,7 +141,7 @@ namespace PcapDotNet.Packets.Transport
/// <param name="offset">The offset to the first byte to read the buffer. Will be incremented by the number of bytes read.</param>
/// <param name="valueLength">The number of bytes the option value should take according to the length field that was already read.</param>
/// <returns>On success - the complex option read. On failure - null.</returns>
public
Option
CreateInstance
(
byte
[]
buffer
,
ref
int
offset
,
byte
valueLength
)
Option
IOptionComplexFactory
.
CreateInstance
(
byte
[]
buffer
,
ref
int
offset
,
byte
valueLength
)
{
if
(
valueLength
<
OptionValueMinimumLength
||
valueLength
%
TcpOptionSelectiveAcknowledgmentBlock
.
SizeOf
!=
0
)
return
null
;
...
...
PcapDotNet/src/PcapDotNet.Packets/Transport/TcpOptionSelectiveAcknowledgmentPermitted.cs
View file @
28625c92
...
...
@@ -74,7 +74,7 @@ namespace PcapDotNet.Packets.Transport
/// <param name="offset">The offset to the first byte to read the buffer. Will be incremented by the number of bytes read.</param>
/// <param name="valueLength">The number of bytes the option value should take according to the length field that was already read.</param>
/// <returns>On success - the complex option read. On failure - null.</returns>
public
Option
CreateInstance
(
byte
[]
buffer
,
ref
int
offset
,
byte
valueLength
)
Option
IOptionComplexFactory
.
CreateInstance
(
byte
[]
buffer
,
ref
int
offset
,
byte
valueLength
)
{
if
(
valueLength
!=
OptionValueLength
)
return
null
;
...
...
PcapDotNet/src/PcapDotNet.Packets/Transport/TcpOptionTimestamp.cs
View file @
28625c92
...
...
@@ -120,7 +120,7 @@ namespace PcapDotNet.Packets.Transport
/// <param name="offset">The offset to the first byte to read the buffer. Will be incremented by the number of bytes read.</param>
/// <param name="valueLength">The number of bytes the option value should take according to the length field that was already read.</param>
/// <returns>On success - the complex option read. On failure - null.</returns>
public
Option
CreateInstance
(
byte
[]
buffer
,
ref
int
offset
,
byte
valueLength
)
Option
IOptionComplexFactory
.
CreateInstance
(
byte
[]
buffer
,
ref
int
offset
,
byte
valueLength
)
{
if
(
valueLength
!=
OptionValueLength
)
return
null
;
...
...
PcapDotNet/src/PcapDotNet.Packets/Transport/TcpOptionWindowScale.cs
View file @
28625c92
...
...
@@ -119,7 +119,7 @@ namespace PcapDotNet.Packets.Transport
/// <param name="offset">The offset to the first byte to read the buffer. Will be incremented by the number of bytes read.</param>
/// <param name="valueLength">The number of bytes the option value should take according to the length field that was already read.</param>
/// <returns>On success - the complex option read. On failure - null.</returns>
public
Option
CreateInstance
(
byte
[]
buffer
,
ref
int
offset
,
byte
valueLength
)
Option
IOptionComplexFactory
.
CreateInstance
(
byte
[]
buffer
,
ref
int
offset
,
byte
valueLength
)
{
if
(
valueLength
!=
OptionValueLength
)
return
null
;
...
...
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