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
e18d30c8
Commit
e18d30c8
authored
Aug 22, 2010
by
Brickner_cp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Datagram auto properties
parent
f0e4f8f6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
23 deletions
+11
-23
Datagram.cs
PcapDotNet/src/PcapDotNet.Packets/Datagram.cs
+11
-23
No files found.
PcapDotNet/src/PcapDotNet.Packets/Datagram.cs
View file @
e18d30c8
...
...
@@ -25,9 +25,9 @@ namespace PcapDotNet.Packets
if
(
buffer
==
null
)
throw
new
ArgumentNullException
(
"buffer"
);
_b
uffer
=
buffer
;
_s
tartOffset
=
0
;
_l
ength
=
buffer
.
Length
;
B
uffer
=
buffer
;
S
tartOffset
=
0
;
L
ength
=
buffer
.
Length
;
}
/// <summary>
...
...
@@ -38,9 +38,9 @@ namespace PcapDotNet.Packets
/// <param name="length">The number of bytes to take.</param>
public
Datagram
(
byte
[]
buffer
,
int
offset
,
int
length
)
{
_b
uffer
=
buffer
;
_s
tartOffset
=
offset
;
_l
ength
=
length
;
B
uffer
=
buffer
;
S
tartOffset
=
offset
;
L
ength
=
length
;
}
/// <summary>
...
...
@@ -55,10 +55,7 @@ namespace PcapDotNet.Packets
/// <summary>
/// The number of bytes in this datagram.
/// </summary>
public
int
Length
{
get
{
return
_length
;
}
}
public
int
Length
{
get
;
private
set
;
}
/// <summary>
/// The value of the byte in the given offset in the datagram.
...
...
@@ -66,7 +63,7 @@ namespace PcapDotNet.Packets
/// <param name="offset">The offset in the datagram to take the byte from.</param>
public
byte
this
[
int
offset
]
{
get
{
return
_b
uffer
[
StartOffset
+
offset
];
}
get
{
return
B
uffer
[
StartOffset
+
offset
];
}
}
/// <summary>
...
...
@@ -161,25 +158,19 @@ namespace PcapDotNet.Packets
internal
void
Write
(
byte
[]
buffer
,
int
offset
)
{
_b
uffer
.
BlockCopy
(
StartOffset
,
buffer
,
offset
,
Length
);
B
uffer
.
BlockCopy
(
StartOffset
,
buffer
,
offset
,
Length
);
}
/// <summary>
/// The original buffer that holds all the data for the datagram.
/// </summary>
[
System
.
Diagnostics
.
CodeAnalysis
.
SuppressMessage
(
"Microsoft.Performance"
,
"CA1819:PropertiesShouldNotReturnArrays"
)]
internal
byte
[]
Buffer
{
get
{
return
_buffer
;
}
}
internal
byte
[]
Buffer
{
get
;
private
set
;
}
/// <summary>
/// The offset of the first byte of the datagram in the buffer.
/// </summary>
internal
int
StartOffset
{
get
{
return
_startOffset
;
}
}
internal
int
StartOffset
{
get
;
private
set
;
}
/// <summary>
/// The default validity check always returns true.
...
...
@@ -324,9 +315,6 @@ namespace PcapDotNet.Packets
}
private
static
readonly
Datagram
_empty
=
new
Datagram
(
new
byte
[
0
],
0
,
0
);
private
readonly
byte
[]
_buffer
;
private
readonly
int
_startOffset
;
private
readonly
int
_length
;
private
bool
?
_isValid
;
}
}
\ 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