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
711226ee
Commit
711226ee
authored
Jul 05, 2009
by
Brickner_cp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
b3fe733f
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
189 additions
and
124 deletions
+189
-124
PacketCommunicator.cpp
PcapDotNet/src/PcapDotNet.Core/PacketCommunicator.cpp
+0
-55
PacketCommunicator.h
PcapDotNet/src/PcapDotNet.Core/PacketCommunicator.h
+1
-69
SamplingMethod.h
PcapDotNet/src/PcapDotNet.Core/SamplingMethod.h
+18
-0
SamplingMethodFirstAfterInterval.cpp
.../src/PcapDotNet.Core/SamplingMethodFirstAfterInterval.cpp
+33
-0
SamplingMethodFirstAfterInterval.h
...et/src/PcapDotNet.Core/SamplingMethodFirstAfterInterval.h
+27
-0
SamplingMethodNone.cpp
PcapDotNet/src/PcapDotNet.Core/SamplingMethodNone.cpp
+14
-0
SamplingMethodNone.h
PcapDotNet/src/PcapDotNet.Core/SamplingMethodNone.h
+20
-0
SamplingMethodOneEveryN.cpp
PcapDotNet/src/PcapDotNet.Core/SamplingMethodOneEveryN.cpp
+22
-0
SamplingMethodOneEveryN.h
PcapDotNet/src/PcapDotNet.Core/SamplingMethodOneEveryN.h
+26
-0
WinPCapDotNet.Core.vcproj
PcapDotNet/src/PcapDotNet.Core/WinPCapDotNet.Core.vcproj
+28
-0
No files found.
PcapDotNet/src/PcapDotNet.Core/PacketCommunicator.cpp
View file @
711226ee
...
@@ -13,61 +13,6 @@ using namespace System::Collections::Generic;
...
@@ -13,61 +13,6 @@ using namespace System::Collections::Generic;
using
namespace
Packets
;
using
namespace
Packets
;
using
namespace
PcapDotNet
::
Core
;
using
namespace
PcapDotNet
::
Core
;
int
SamplingMethodNone
::
Method
::
get
()
{
return
PCAP_SAMP_NOSAMP
;
}
int
SamplingMethodNone
::
Value
::
get
()
{
return
0
;
}
SamplingMethodOneEveryN
::
SamplingMethodOneEveryN
(
int
n
)
{
if
(
n
<=
0
)
throw
gcnew
ArgumentOutOfRangeException
(
"n"
,
n
,
"Must be positive"
);
_n
=
n
;
}
int
SamplingMethodOneEveryN
::
Method
::
get
()
{
return
PCAP_SAMP_1_EVERY_N
;
}
int
SamplingMethodOneEveryN
::
Value
::
get
()
{
return
_n
;
}
SamplingMethodFirstAfterInterval
::
SamplingMethodFirstAfterInterval
(
int
intervalInMs
)
{
if
(
intervalInMs
<
0
)
throw
gcnew
ArgumentOutOfRangeException
(
"intervalInMs"
,
intervalInMs
,
"Must be non negative"
);
_intervalInMs
=
intervalInMs
;
}
SamplingMethodFirstAfterInterval
::
SamplingMethodFirstAfterInterval
(
TimeSpan
interval
)
{
double
intervalInMs
=
interval
.
TotalMilliseconds
;
if
(
intervalInMs
>
Int32
::
MaxValue
)
throw
gcnew
ArgumentOutOfRangeException
(
"interval"
,
interval
,
"Must be smaller than "
+
TimeSpan
::
FromMilliseconds
(
Int32
::
MaxValue
).
ToString
());
if
(
intervalInMs
<
0
)
throw
gcnew
ArgumentOutOfRangeException
(
"interval"
,
interval
,
"Must be non negative"
);
_intervalInMs
=
(
int
)
intervalInMs
;
}
int
SamplingMethodFirstAfterInterval
::
Method
::
get
()
{
return
PCAP_SAMP_FIRST_AFTER_N_MS
;
}
int
SamplingMethodFirstAfterInterval
::
Value
::
get
()
{
return
_intervalInMs
;
}
PacketCommunicator
::
PacketCommunicator
(
const
char
*
source
,
int
snapshotLength
,
PacketDeviceOpenFlags
flags
,
int
readTimeout
,
pcap_rmtauth
*
auth
,
SocketAddress
^
netmask
)
PacketCommunicator
::
PacketCommunicator
(
const
char
*
source
,
int
snapshotLength
,
PacketDeviceOpenFlags
flags
,
int
readTimeout
,
pcap_rmtauth
*
auth
,
SocketAddress
^
netmask
)
{
{
// Open the device
// Open the device
...
...
PcapDotNet/src/PcapDotNet.Core/PacketCommunicator.h
View file @
711226ee
...
@@ -10,78 +10,10 @@
...
@@ -10,78 +10,10 @@
#include "PacketSendQueue.h"
#include "PacketSendQueue.h"
#include "PacketCommunicatorMode.h"
#include "PacketCommunicatorMode.h"
#include "PacketCommunicatorReceiveResult.h"
#include "PacketCommunicatorReceiveResult.h"
#include "SamplingMethod.h"
namespace
PcapDotNet
{
namespace
Core
namespace
PcapDotNet
{
namespace
Core
{
{
public
ref
class
SamplingMethod
abstract
{
internal
:
virtual
property
int
Method
{
int
get
()
=
0
;
}
virtual
property
int
Value
{
int
get
()
=
0
;
}
};
public
ref
class
SamplingMethodNone
:
SamplingMethod
{
internal
:
virtual
property
int
Method
{
int
get
()
override
;
}
virtual
property
int
Value
{
int
get
()
override
;
}
};
public
ref
class
SamplingMethodOneEveryN
:
SamplingMethod
{
public
:
SamplingMethodOneEveryN
(
int
n
);
internal
:
virtual
property
int
Method
{
int
get
()
override
;
}
virtual
property
int
Value
{
int
get
()
override
;
}
private
:
int
_n
;
};
public
ref
class
SamplingMethodFirstAfterInterval
:
SamplingMethod
{
public
:
SamplingMethodFirstAfterInterval
(
int
intervalInMs
);
SamplingMethodFirstAfterInterval
(
System
::
TimeSpan
interval
);
internal
:
virtual
property
int
Method
{
int
get
()
override
;
}
virtual
property
int
Value
{
int
get
()
override
;
}
private
:
int
_intervalInMs
;
};
public
ref
class
PacketCommunicator
abstract
:
System
::
IDisposable
public
ref
class
PacketCommunicator
abstract
:
System
::
IDisposable
{
{
public
:
public
:
...
...
PcapDotNet/src/PcapDotNet.Core/SamplingMethod.h
0 → 100644
View file @
711226ee
#pragma once
namespace
PcapDotNet
{
namespace
Core
{
public
ref
class
SamplingMethod
abstract
{
internal
:
virtual
property
int
Method
{
int
get
()
=
0
;
}
virtual
property
int
Value
{
int
get
()
=
0
;
}
};
}}
\ No newline at end of file
PcapDotNet/src/PcapDotNet.Core/SamplingMethodFirstAfterInterval.cpp
0 → 100644
View file @
711226ee
#include "SamplingMethodFirstAfterInterval.h"
#include "Pcap.h"
using
namespace
System
;
using
namespace
PcapDotNet
::
Core
;
SamplingMethodFirstAfterInterval
::
SamplingMethodFirstAfterInterval
(
int
intervalInMs
)
{
if
(
intervalInMs
<
0
)
throw
gcnew
ArgumentOutOfRangeException
(
"intervalInMs"
,
intervalInMs
,
"Must be non negative"
);
_intervalInMs
=
intervalInMs
;
}
SamplingMethodFirstAfterInterval
::
SamplingMethodFirstAfterInterval
(
TimeSpan
interval
)
{
double
intervalInMs
=
interval
.
TotalMilliseconds
;
if
(
intervalInMs
>
Int32
::
MaxValue
)
throw
gcnew
ArgumentOutOfRangeException
(
"interval"
,
interval
,
"Must be smaller than "
+
TimeSpan
::
FromMilliseconds
(
Int32
::
MaxValue
).
ToString
());
if
(
intervalInMs
<
0
)
throw
gcnew
ArgumentOutOfRangeException
(
"interval"
,
interval
,
"Must be non negative"
);
_intervalInMs
=
(
int
)
intervalInMs
;
}
int
SamplingMethodFirstAfterInterval
::
Method
::
get
()
{
return
PCAP_SAMP_FIRST_AFTER_N_MS
;
}
int
SamplingMethodFirstAfterInterval
::
Value
::
get
()
{
return
_intervalInMs
;
}
PcapDotNet/src/PcapDotNet.Core/SamplingMethodFirstAfterInterval.h
0 → 100644
View file @
711226ee
#pragma once
#include "SamplingMethod.h"
namespace
PcapDotNet
{
namespace
Core
{
public
ref
class
SamplingMethodFirstAfterInterval
:
SamplingMethod
{
public
:
SamplingMethodFirstAfterInterval
(
int
intervalInMs
);
SamplingMethodFirstAfterInterval
(
System
::
TimeSpan
interval
);
internal
:
virtual
property
int
Method
{
int
get
()
override
;
}
virtual
property
int
Value
{
int
get
()
override
;
}
private
:
int
_intervalInMs
;
};
}}
\ No newline at end of file
PcapDotNet/src/PcapDotNet.Core/SamplingMethodNone.cpp
0 → 100644
View file @
711226ee
#include "SamplingMethodNone.h"
#include "Pcap.h"
using
namespace
PcapDotNet
::
Core
;
int
SamplingMethodNone
::
Method
::
get
()
{
return
PCAP_SAMP_NOSAMP
;
}
int
SamplingMethodNone
::
Value
::
get
()
{
return
0
;
}
PcapDotNet/src/PcapDotNet.Core/SamplingMethodNone.h
0 → 100644
View file @
711226ee
#pragma once
#include "SamplingMethod.h"
namespace
PcapDotNet
{
namespace
Core
{
public
ref
class
SamplingMethodNone
:
SamplingMethod
{
internal
:
virtual
property
int
Method
{
int
get
()
override
;
}
virtual
property
int
Value
{
int
get
()
override
;
}
};
}}
\ No newline at end of file
PcapDotNet/src/PcapDotNet.Core/SamplingMethodOneEveryN.cpp
0 → 100644
View file @
711226ee
#include "SamplingMethodOneEveryN.h"
#include "Pcap.h"
using
namespace
System
;
using
namespace
PcapDotNet
::
Core
;
SamplingMethodOneEveryN
::
SamplingMethodOneEveryN
(
int
n
)
{
if
(
n
<=
0
)
throw
gcnew
ArgumentOutOfRangeException
(
"n"
,
n
,
"Must be positive"
);
_n
=
n
;
}
int
SamplingMethodOneEveryN
::
Method
::
get
()
{
return
PCAP_SAMP_1_EVERY_N
;
}
int
SamplingMethodOneEveryN
::
Value
::
get
()
{
return
_n
;
}
PcapDotNet/src/PcapDotNet.Core/SamplingMethodOneEveryN.h
0 → 100644
View file @
711226ee
#pragma once
#include "SamplingMethod.h"
namespace
PcapDotNet
{
namespace
Core
{
public
ref
class
SamplingMethodOneEveryN
:
SamplingMethod
{
public
:
SamplingMethodOneEveryN
(
int
n
);
internal
:
virtual
property
int
Method
{
int
get
()
override
;
}
virtual
property
int
Value
{
int
get
()
override
;
}
private
:
int
_n
;
};
}}
\ No newline at end of file
PcapDotNet/src/PcapDotNet.Core/WinPCapDotNet.Core.vcproj
View file @
711226ee
...
@@ -298,6 +298,34 @@
...
@@ -298,6 +298,34 @@
RelativePath=
".\PacketCommunicatorReceiveResult.h"
RelativePath=
".\PacketCommunicatorReceiveResult.h"
>
>
</File>
</File>
<File
RelativePath=
".\SamplingMethod.h"
>
</File>
<File
RelativePath=
".\SamplingMethodFirstAfterInterval.cpp"
>
</File>
<File
RelativePath=
".\SamplingMethodFirstAfterInterval.h"
>
</File>
<File
RelativePath=
".\SamplingMethodNone.cpp"
>
</File>
<File
RelativePath=
".\SamplingMethodNone.h"
>
</File>
<File
RelativePath=
".\SamplingMethodOneEveryN.cpp"
>
</File>
<File
RelativePath=
".\SamplingMethodOneEveryN.h"
>
</File>
</Filter>
</Filter>
<Filter
<Filter
Name=
"Marshaling"
Name=
"Marshaling"
...
...
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