Base class for all pcap devices
See Also: Inherited members from object.
|
PcapDevice
()
|
Documentation for this section has not yet been entered. |
|
captureThread | System.Threading.Thread . Thread that is performing the background packet capture |
|
m_pcapAdapterHandle | IntPtr . Handle to a pcap adapter, not equal to IntPtr.Zero if an adapter is open |
|
m_pcapIf | PcapInterface . Low level interface object that contains device specific information |
|
m_pcapPacketCount | int . Number of packets that this adapter should capture |
|
shouldCaptureThreadStop | bool . Flag that indicates that a capture thread should stop |
[read-only] abstract |
Description | string . Description |
|
Filter | string . Kernel level filtering expression associated with this device. For more info on filter expression syntax, see: http://www.winpcap.org/docs/docs31/html/group__language.html |
[read-only] | Interface | PcapInterface . Documentation for this section has not yet been entered. |
[read-only] | LastError | string . The last pcap error associated with this pcap device |
[read-only] | LinkType | PacketDotNet.LinkLayers . Link type in terms of PacketDotNet.LinkLayers |
|
MacAddress | System.Net.NetworkInformation.PhysicalAddress . Mac address of the physical device |
[read-only] abstract |
Name | string . Device name |
[read-only] | Opened | bool . Return a value indicating if this adapter is opened |
[read-only] | Started | bool . Return a value indicating if the capturing process of this adapter is started |
[read-only] abstract |
Statistics | SharpPcap.ICaptureStatistics . Retrieves pcap statistics |
|
StopCaptureTimeout | TimeSpan . Maximum time within which the capture thread must join the main thread (on PcapDevice.StopCapture) or else the thread is aborted and an exception thrown. |
|
Capture
()Synchronously capture packets on this device. Method blocks forever. |
|
|
Capture
(int)Synchronously captures packets on this network device. This method will block until capturing is finished. |
|
static
|
CheckFilter
(string, out string)Returns true if the filter expression was able to be compiled into a program without errors |
|
|
Close
()Closes this adapter |
|
|
GetNextPacket
()Gets the next packet captured on this device |
|
|
GetNextPacket
(out SharpPcap.RawCapture)Gets the next packet captured on this device |
|
|
GetNextPacketPointers
(ref IntPtr, ref IntPtr)Gets pointers to the next PCAP header and packet data. Data is only valid until next call to GetNextPacketNative. Advanced use only. Intended to allow unmanaged code to avoid the overhead of marshalling PcapHeader and packet contents to allocated memory. |
|
abstract
|
Open
()Open the device with class specific options |
|
|
Open
(SharpPcap.DeviceMode)Open the device. To start capturing call the 'StartCapture' function |
|
|
Open
(SharpPcap.DeviceMode, int)Open the device. To start capturing call the 'StartCapture' function |
|
|
SendPacket
(PacketDotNet.Packet)Sends a raw packet throgh this device |
|
|
SendPacket
(byte[])Sends a raw packet throgh this device |
|
|
SendPacket
(PacketDotNet.Packet, int)Sends a raw packet throgh this device |
|
|
SendPacket
(byte[], int)Sends a raw packet throgh this device |
|
|
StartCapture
()Starts the capturing process via a background thread OnPacketArrival() will be called for each captured packet |
|
|
StopCapture
()Stops the capture process Throws an exception if the stop capture timeout is exceeded and the capture thread was aborted |
|
override
|
ToString
()Override the default ToString() implementation |
|
CaptureThread
()The capture thread |
|
|
MarshalRawPacket
(IntPtr, IntPtr)Convert an unmanaged packet into a managed PacketDotNet.RawPacket |
|
|
PacketHandler
(IntPtr, IntPtr, IntPtr)Pcap_loop callback method. |
|
|
SendCaptureStoppedEvent
(SharpPcap.CaptureStoppedEventStatus)Notify the delegates that are subscribed to the capture stopped event |
|
|
SendPacketArrivalEvent
(SharpPcap.RawCapture)Notify the OnPacketArrival delegates about a newly captured packet |
|
|
SetFilter
(string)Assign a filter to this device given a filterExpression |
|
|
ThrowIfNotOpen
(string)Helper method for checking that the adapter is open, throws an exception with a string of ExceptionString if the device isn't open |
|
OnCaptureStopped | Fired when the capture process of this pcap device is stopped |
|
OnPacketArrival | Fires whenever a new packet is processed, either when the packet arrives from the network device or when the packet is read from the on-disk file. For network captured packets this event is invoked only when working in "PcapMode.Capture" mode. |
Documentation for this section has not yet been entered.
Syntax
protected PcapDevice ()Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: SharpPcap.LibPcap
Assembly: SharpPcap (in SharpPcap.dll)
Assembly Versions: 4.0.1.0
Synchronously capture packets on this device. Method blocks forever.
Syntax
public void Capture ()Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: SharpPcap.LibPcap
Assembly: SharpPcap (in SharpPcap.dll)
Assembly Versions: 4.0.1.0
Synchronously captures packets on this network device. This method will block until capturing is finished.
Syntax
Parameters
- packetCount
- The number of packets to be captured. -1 means capture indefiniately
Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: SharpPcap.LibPcap
Assembly: SharpPcap (in SharpPcap.dll)
Assembly Versions: 4.0.1.0
Thread that is performing the background packet capture
Syntax
protected System.Threading.Thread captureThreadRemarks
Documentation for this section has not yet been entered.Requirements
Namespace: SharpPcap.LibPcap
Assembly: SharpPcap (in SharpPcap.dll)
Assembly Versions: 4.0.1.0
The capture thread
Syntax
protected virtual void CaptureThread ()Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: SharpPcap.LibPcap
Assembly: SharpPcap (in SharpPcap.dll)
Assembly Versions: 4.0.1.0
Returns true if the filter expression was able to be compiled into a program without errors
Syntax
Parameters
- filterExpression
- Documentation for this section has not yet been entered.
- errorString
- Documentation for this section has not yet been entered.
Returns
Documentation for this section has not yet been entered.Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: SharpPcap.LibPcap
Assembly: SharpPcap (in SharpPcap.dll)
Assembly Versions: 4.0.1.0
Closes this adapter
Syntax
public virtual void Close ()Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: SharpPcap.LibPcap
Assembly: SharpPcap (in SharpPcap.dll)
Assembly Versions: 4.0.1.0
Description
Syntax
public abstract string Description { get; }Value
Documentation for this section has not yet been entered.Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: SharpPcap.LibPcap
Assembly: SharpPcap (in SharpPcap.dll)
Assembly Versions: 4.0.1.0
Kernel level filtering expression associated with this device. For more info on filter expression syntax, see: http://www.winpcap.org/docs/docs31/html/group__language.html
Syntax
public virtual string Filter { get; set; }Value
Documentation for this section has not yet been entered.Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: SharpPcap.LibPcap
Assembly: SharpPcap (in SharpPcap.dll)
Assembly Versions: 4.0.1.0
Gets the next packet captured on this device
Syntax
public virtual SharpPcap.RawCapture GetNextPacket ()Returns
The next packet captured on this deviceRemarks
Documentation for this section has not yet been entered.Requirements
Namespace: SharpPcap.LibPcap
Assembly: SharpPcap (in SharpPcap.dll)
Assembly Versions: 4.0.1.0
Gets the next packet captured on this device
Syntax
public virtual int GetNextPacket (out SharpPcap.RawCapture p)Parameters
Returns
A int that contains the result codeRemarks
Documentation for this section has not yet been entered.Requirements
Namespace: SharpPcap.LibPcap
Assembly: SharpPcap (in SharpPcap.dll)
Assembly Versions: 4.0.1.0
Gets pointers to the next PCAP header and packet data. Data is only valid until next call to GetNextPacketNative. Advanced use only. Intended to allow unmanaged code to avoid the overhead of marshalling PcapHeader and packet contents to allocated memory.
Syntax
Parameters
- header
- Documentation for this section has not yet been entered.
- data
- Documentation for this section has not yet been entered.
Returns
Documentation for this section has not yet been entered.Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: SharpPcap.LibPcap
Assembly: SharpPcap (in SharpPcap.dll)
Assembly Versions: 4.0.1.0
Documentation for this section has not yet been entered.
Syntax
public PcapInterface Interface { get; }Value
Low level pcap device valuesRemarks
Documentation for this section has not yet been entered.Requirements
Namespace: SharpPcap.LibPcap
Assembly: SharpPcap (in SharpPcap.dll)
Assembly Versions: 4.0.1.0
The last pcap error associated with this pcap device
Syntax
public virtual string LastError { get; }Value
Documentation for this section has not yet been entered.Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: SharpPcap.LibPcap
Assembly: SharpPcap (in SharpPcap.dll)
Assembly Versions: 4.0.1.0
Link type in terms of PacketDotNet.LinkLayers
Syntax
public virtual PacketDotNet.LinkLayers LinkType { get; }Value
Documentation for this section has not yet been entered.Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: SharpPcap.LibPcap
Assembly: SharpPcap (in SharpPcap.dll)
Assembly Versions: 4.0.1.0
Handle to a pcap adapter, not equal to IntPtr.Zero if an adapter is open
Syntax
protected IntPtr m_pcapAdapterHandleRemarks
Documentation for this section has not yet been entered.Requirements
Namespace: SharpPcap.LibPcap
Assembly: SharpPcap (in SharpPcap.dll)
Assembly Versions: 4.0.1.0
Low level interface object that contains device specific information
Syntax
protected PcapInterface m_pcapIfRemarks
Documentation for this section has not yet been entered.Requirements
Namespace: SharpPcap.LibPcap
Assembly: SharpPcap (in SharpPcap.dll)
Assembly Versions: 4.0.1.0
Number of packets that this adapter should capture
Syntax
protected int m_pcapPacketCountRemarks
Documentation for this section has not yet been entered.Requirements
Namespace: SharpPcap.LibPcap
Assembly: SharpPcap (in SharpPcap.dll)
Assembly Versions: 4.0.1.0
Mac address of the physical device
Syntax
public virtual System.Net.NetworkInformation.PhysicalAddress MacAddress { get; set; }Value
Documentation for this section has not yet been entered.Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: SharpPcap.LibPcap
Assembly: SharpPcap (in SharpPcap.dll)
Assembly Versions: 4.0.1.0
Convert an unmanaged packet into a managed PacketDotNet.RawPacket
Syntax
Parameters
Returns
A SharpPcap.RawCaptureRemarks
Documentation for this section has not yet been entered.Requirements
Namespace: SharpPcap.LibPcap
Assembly: SharpPcap (in SharpPcap.dll)
Assembly Versions: 4.0.1.0
Device name
Syntax
public abstract string Name { get; }Value
Documentation for this section has not yet been entered.Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: SharpPcap.LibPcap
Assembly: SharpPcap (in SharpPcap.dll)
Assembly Versions: 4.0.1.0
Fired when the capture process of this pcap device is stopped
Syntax
public event SharpPcap.CaptureStoppedEventHandler OnCaptureStoppedRemarks
Documentation for this section has not yet been entered.Requirements
Namespace: SharpPcap.LibPcap
Assembly: SharpPcap (in SharpPcap.dll)
Assembly Versions: 4.0.1.0
Fires whenever a new packet is processed, either when the packet arrives from the network device or when the packet is read from the on-disk file. For network captured packets this event is invoked only when working in "PcapMode.Capture" mode.
Syntax
public event SharpPcap.PacketArrivalEventHandler OnPacketArrivalRemarks
Documentation for this section has not yet been entered.Requirements
Namespace: SharpPcap.LibPcap
Assembly: SharpPcap (in SharpPcap.dll)
Assembly Versions: 4.0.1.0
Open the device with class specific options
Syntax
public abstract void Open ()Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: SharpPcap.LibPcap
Assembly: SharpPcap (in SharpPcap.dll)
Assembly Versions: 4.0.1.0
Open the device. To start capturing call the 'StartCapture' function
Syntax
public virtual void Open (SharpPcap.DeviceMode mode)Parameters
- mode
- A SharpPcap.DeviceMode
Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: SharpPcap.LibPcap
Assembly: SharpPcap (in SharpPcap.dll)
Assembly Versions: 4.0.1.0
Open the device. To start capturing call the 'StartCapture' function
Syntax
Parameters
- mode
- A SharpPcap.DeviceMode
- read_timeout
- A int
Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: SharpPcap.LibPcap
Assembly: SharpPcap (in SharpPcap.dll)
Assembly Versions: 4.0.1.0
Return a value indicating if this adapter is opened
Syntax
public virtual bool Opened { get; }Value
Documentation for this section has not yet been entered.Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: SharpPcap.LibPcap
Assembly: SharpPcap (in SharpPcap.dll)
Assembly Versions: 4.0.1.0
Pcap_loop callback method.
Syntax
Parameters
- param
- Documentation for this section has not yet been entered.
- header
- Documentation for this section has not yet been entered.
- data
- Documentation for this section has not yet been entered.
Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: SharpPcap.LibPcap
Assembly: SharpPcap (in SharpPcap.dll)
Assembly Versions: 4.0.1.0
Notify the delegates that are subscribed to the capture stopped event
Syntax
protected void SendCaptureStoppedEvent (SharpPcap.CaptureStoppedEventStatus status)Parameters
- status
- A SharpPcap.CaptureStoppedEventStatus
Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: SharpPcap.LibPcap
Assembly: SharpPcap (in SharpPcap.dll)
Assembly Versions: 4.0.1.0
Sends a raw packet throgh this device
Syntax
public virtual void SendPacket (PacketDotNet.Packet p)Parameters
- p
- The packet to send
Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: SharpPcap.LibPcap
Assembly: SharpPcap (in SharpPcap.dll)
Assembly Versions: 4.0.1.0
Sends a raw packet throgh this device
Syntax
Parameters
- p
- The packet bytes to send
Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: SharpPcap.LibPcap
Assembly: SharpPcap (in SharpPcap.dll)
Assembly Versions: 4.0.1.0
Sends a raw packet throgh this device
Syntax
Parameters
- p
- The packet to send
- size
- The number of bytes to send
Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: SharpPcap.LibPcap
Assembly: SharpPcap (in SharpPcap.dll)
Assembly Versions: 4.0.1.0
Sends a raw packet throgh this device
Syntax
Parameters
- p
- The packet bytes to send
- size
- The number of bytes to send
Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: SharpPcap.LibPcap
Assembly: SharpPcap (in SharpPcap.dll)
Assembly Versions: 4.0.1.0
Notify the OnPacketArrival delegates about a newly captured packet
Syntax
protected virtual void SendPacketArrivalEvent (SharpPcap.RawCapture p)Parameters
Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: SharpPcap.LibPcap
Assembly: SharpPcap (in SharpPcap.dll)
Assembly Versions: 4.0.1.0
Assign a filter to this device given a filterExpression
Syntax
Parameters
- filterExpression
- The filter expression to compile
Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: SharpPcap.LibPcap
Assembly: SharpPcap (in SharpPcap.dll)
Assembly Versions: 4.0.1.0
Flag that indicates that a capture thread should stop
Syntax
protected bool shouldCaptureThreadStopRemarks
Documentation for this section has not yet been entered.Requirements
Namespace: SharpPcap.LibPcap
Assembly: SharpPcap (in SharpPcap.dll)
Assembly Versions: 4.0.1.0
Starts the capturing process via a background thread OnPacketArrival() will be called for each captured packet
Syntax
public virtual void StartCapture ()Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: SharpPcap.LibPcap
Assembly: SharpPcap (in SharpPcap.dll)
Assembly Versions: 4.0.1.0
Return a value indicating if the capturing process of this adapter is started
Syntax
public virtual bool Started { get; }Value
Documentation for this section has not yet been entered.Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: SharpPcap.LibPcap
Assembly: SharpPcap (in SharpPcap.dll)
Assembly Versions: 4.0.1.0
Retrieves pcap statistics
Syntax
public abstract SharpPcap.ICaptureStatistics Statistics { get; }Value
A SharpPcap.LibPcap.PcapStatisticsRemarks
Documentation for this section has not yet been entered.Requirements
Namespace: SharpPcap.LibPcap
Assembly: SharpPcap (in SharpPcap.dll)
Assembly Versions: 4.0.1.0
Stops the capture process Throws an exception if the stop capture timeout is exceeded and the capture thread was aborted
Syntax
public virtual void StopCapture ()Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: SharpPcap.LibPcap
Assembly: SharpPcap (in SharpPcap.dll)
Assembly Versions: 4.0.1.0
Maximum time within which the capture thread must join the main thread (on PcapDevice.StopCapture) or else the thread is aborted and an exception thrown.
Syntax
public TimeSpan StopCaptureTimeout { get; set; }Value
Documentation for this section has not yet been entered.Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: SharpPcap.LibPcap
Assembly: SharpPcap (in SharpPcap.dll)
Assembly Versions: 4.0.1.0
Helper method for checking that the adapter is open, throws an exception with a string of ExceptionString if the device isn't open
Syntax
Parameters
- ExceptionString
- A string
Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: SharpPcap.LibPcap
Assembly: SharpPcap (in SharpPcap.dll)
Assembly Versions: 4.0.1.0
Override the default ToString() implementation
Syntax
public override string ToString ()Returns
A stringRemarks
Documentation for this section has not yet been entered.Requirements
Namespace: SharpPcap.LibPcap
Assembly: SharpPcap (in SharpPcap.dll)
Assembly Versions: 4.0.1.0