/// <summary> /// Constructor /// </summary> /// <param name="device"> /// A <see cref="LibPcapLiveDevice"/> /// </param> /// <param name="captureFilename"> /// A <see cref="System.String"/> /// </param> public CaptureFileWriterDevice(LibPcapLiveDevice device, string captureFilename) : this((PacketDotNet.LinkLayers)LibPcapSafeNativeMethods.pcap_datalink(device.PcapHandle), LibPcapSafeNativeMethods.pcap_snapshot(device.PcapHandle), captureFilename, FileMode.OpenOrCreate) { }
/// <summary> /// Open the device. To start capturing call the 'StartCapture' function /// </summary> /// <param name="configuration"> /// A <see cref="DeviceConfiguration"/> /// </param> public virtual void Open(DeviceConfiguration configuration) { // Caches linkType value. // Open refers to the device being "created" // This method is called by sub-classes in the override method int dataLink = 0; if (Opened) { dataLink = LibPcapSafeNativeMethods.pcap_datalink(Handle); } if (dataLink >= 0) { linkType = (PacketDotNet.LinkLayers)dataLink; } }