SharpPcap : SharpPcap.LibPcap Namespace

CaptureFileReaderDevice Class

Read a pcap capture file

Syntax

public class CaptureFileReaderDevice : 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

Members

See Also: Inherited members from PcapDevice.

Public Constructors

Protected Fields

captureThread System.Threading.Thread . Thread that is performing the background packet capture (Inherited from PcapDevice.)
m_pcapAdapterHandle IntPtr . Handle to a pcap adapter, not equal to IntPtr.Zero if an adapter is open (Inherited from PcapDevice.)
m_pcapIf PcapInterface . Low level interface object that contains device specific information (Inherited from PcapDevice.)
m_pcapPacketCount int . Number of packets that this adapter should capture (Inherited from PcapDevice.)
shouldCaptureThreadStop bool . Flag that indicates that a capture thread should stop (Inherited from PcapDevice.)

Public Properties

[read-only]
override
Description string . Documentation for this section has not yet been entered.
[read-only]
abstract
Description string . Description (Inherited from PcapDevice.)
[read-only]
FileName string . The underlying pcap file name
[read-only]
FileSize long . Documentation for this section has not yet been entered.
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 (Inherited from PcapDevice.)
[read-only]
Interface PcapInterface . Documentation for this section has not yet been entered. (Inherited from PcapDevice.)
[read-only]
LastError string . The last pcap error associated with this pcap device (Inherited from PcapDevice.)
[read-only]
LinkType PacketDotNet.LinkLayers . Link type in terms of PacketDotNet.LinkLayers (Inherited from PcapDevice.)
MacAddress System.Net.NetworkInformation.PhysicalAddress . Mac address of the physical device (Inherited from PcapDevice.)
[read-only]
override
Name string . Documentation for this section has not yet been entered.
[read-only]
abstract
Name string . Device name (Inherited from PcapDevice.)
[read-only]
Opened bool . Return a value indicating if this adapter is opened (Inherited from PcapDevice.)
[read-only]
Started bool . Return a value indicating if the capturing process of this adapter is started (Inherited from PcapDevice.)
[read-only]
override
Statistics SharpPcap.ICaptureStatistics . Retrieves pcap statistics
[read-only]
abstract
Statistics SharpPcap.ICaptureStatistics . Retrieves pcap statistics (Inherited from PcapDevice.)
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. (Inherited from PcapDevice.)

Public Methods

Capture ()
Synchronously capture packets on this device. Method blocks forever. (Inherited from PcapDevice.)
Capture (int)
Synchronously captures packets on this network device. This method will block until capturing is finished. (Inherited from PcapDevice.)
Close ()
Closes this adapter (Inherited from PcapDevice.)
GetNextPacket () : SharpPcap.RawCapture
Gets the next packet captured on this device (Inherited from PcapDevice.)
GetNextPacket (out SharpPcap.RawCapture) : int
Gets the next packet captured on this device (Inherited from PcapDevice.)
GetNextPacketPointers (ref IntPtr, ref IntPtr) : int
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. (Inherited from PcapDevice.)
override
Open ()
Open the device
abstract
Open ()
Open the device with class specific options (Inherited from PcapDevice.)
Open (SharpPcap.DeviceMode)
Open the device. To start capturing call the 'StartCapture' function (Inherited from PcapDevice.)
Open (SharpPcap.DeviceMode, int)
Open the device. To start capturing call the 'StartCapture' function (Inherited from PcapDevice.)
SendPacket (PacketDotNet.Packet)
Sends a raw packet throgh this device (Inherited from PcapDevice.)
SendPacket (byte[])
Sends a raw packet throgh this device (Inherited from PcapDevice.)
SendPacket (PacketDotNet.Packet, int)
Sends a raw packet throgh this device (Inherited from PcapDevice.)
SendPacket (byte[], int)
Sends a raw packet throgh this device (Inherited from PcapDevice.)
StartCapture ()
Starts the capturing process via a background thread OnPacketArrival() will be called for each captured packet (Inherited from PcapDevice.)
StopCapture ()
Stops the capture process Throws an exception if the stop capture timeout is exceeded and the capture thread was aborted (Inherited from PcapDevice.)
override
ToString () : string
Override the default ToString() implementation (Inherited from PcapDevice.)

Protected Methods

CaptureThread ()
The capture thread (Inherited from PcapDevice.)
MarshalRawPacket (IntPtr, IntPtr) : SharpPcap.RawCapture
Convert an unmanaged packet into a managed PacketDotNet.RawPacket (Inherited from PcapDevice.)
PacketHandler (IntPtr, IntPtr, IntPtr)
Pcap_loop callback method. (Inherited from PcapDevice.)
SendCaptureStoppedEvent (SharpPcap.CaptureStoppedEventStatus)
Notify the delegates that are subscribed to the capture stopped event (Inherited from PcapDevice.)
SendPacketArrivalEvent (SharpPcap.RawCapture)
Notify the OnPacketArrival delegates about a newly captured packet (Inherited from PcapDevice.)
SetFilter (string)
Assign a filter to this device given a filterExpression (Inherited from PcapDevice.)
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 (Inherited from PcapDevice.)

Public Events

OnCaptureStopped Fired when the capture process of this pcap device is stopped (Inherited from PcapDevice.)
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. (Inherited from PcapDevice.)

Member Details

CaptureFileReaderDevice Constructor

Syntax

public CaptureFileReaderDevice (string captureFilename)

Parameters

captureFilename
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

Description Property

Documentation for this section has not yet been entered.

Syntax

public override string Description { get; }

Value

Description of the device

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

FileName Property

The underlying pcap file name

Syntax

public string FileName { 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

FileSize Property

Documentation for this section has not yet been entered.

Syntax

public long FileSize { get; }

Value

Number of bytes in the capture file

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

Name Property

Documentation for this section has not yet been entered.

Syntax

public override string Name { get; }

Value

The name of the capture file

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 Method

Open the device

Syntax

public override 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

Statistics Property

Retrieves pcap statistics

Syntax

public override SharpPcap.ICaptureStatistics Statistics { get; }

Value

A SharpPcap.LibPcap.PcapStatistics

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