private PcapNgInterface _iface; // holds link to interface to which frame belongs /// <summary> /// Constructor used when indexing /// </summary> public PmFramePcapNg( PmCaptureBase pmCapture, Int64 fraIndex, Int64 fraOffset, PmLinkType pmLinkType, DateTime timeStamp, Int64 oriLength, Int64 incLength, FrameBLockType type, PcapNgInterface iface) : base(pmCapture, pmLinkType, timeStamp, incLength, PmFrameType.PcapNg, fraIndex, oriLength) { this.FrameOffset = fraOffset; this._blockType = type; this._iface = iface; UInt32 startOffset = 0; switch (this._blockType) { case FrameBLockType.EnhancedPacket: startOffset = 28; break; case FrameBLockType.SimplePacket: startOffset = 12; break; case FrameBLockType.PacketBlock: startOffset = 28; break; } this.L2Offset = this.FrameOffset + startOffset; }
protected PmCaptureProcessorBlockBase(PmCaptureBase pmCapture) { this.PmCapture = pmCapture; this.IndexMetaFramesBlock = this.CreateIndexMetaFramesBlock(); this.PmMetaFramesBufferBlock.LinkTo(this.IndexMetaFramesBlock); this.IndexMetaFramesBlock.LinkTo(this.PmParsedFramesBufferBlock); this.PmMetaFramesBufferBlock.Completion.ContinueWith(t => { if (t.IsFaulted) { ((IDataflowBlock)this.IndexMetaFramesBlock).Fault(t.Exception); } else { this.IndexMetaFramesBlock.Complete(); } }); this.IndexMetaFramesBlock.Completion.ContinueWith(t => { if (t.IsFaulted) { ((IDataflowBlock)this.PmParsedFramesBufferBlock).Fault(t.Exception); } else { this.PmParsedFramesBufferBlock.Complete(); } }); }
/// <summary> /// Constructor when adding new frame that has no L2 and above information filles /// </summary> protected PmFrameBase(PmCaptureBase pmCapture, PmLinkType pmLinkType, DateTime timeStamp, Int64 incLength) { this.PmCapture = pmCapture; this.PmLinkType = pmLinkType; this.TimeStamp = timeStamp; this.IncludedLength = incLength; this.PmCapture.Frames.Add(this); }
public PmFrameVirtual( PmCaptureBase pmCapture, Int64 fraIndex, DateTime timeStamp, Int64 incLength, Int64 l2Offset) : base(pmCapture, PmLinkType.Raw, timeStamp, incLength) { this.L2Offset = l2Offset; this.FrameOffset = l2Offset; this.FrameIndex = fraIndex; }
public PmFrameVirtual( PmCaptureBase pmCapture, Int64 fraIndex, DateTime timeStamp, Int64 incLength, Int64 l2Offset) : base(pmCapture, PmLinkType.Raw, timeStamp, incLength, PmFrameType.Virtual, fraIndex, incLength) { // NOTE: value of incLength passed to base constructor also as originalLength this.L2Offset = l2Offset; this.FrameOffset = l2Offset; }
/// <summary> /// Constructor used when indexing /// </summary> public PmFramePcap( PmCaptureBase pmCapture, Int64 fraIndex, Int64 fraOffset, PmLinkType pmLinkType, DateTime timeStamp, Int64 oriLength, Int64 incLength) : base(pmCapture, pmLinkType, timeStamp, incLength, PmFrameType.Pcap, fraIndex, oriLength) { this.FrameOffset = fraOffset; this.L2Offset = this.FrameOffset + 16; }
/// <summary> /// Constructor when adding new frame that has no L2 and above information filles /// </summary> protected PmFrameBase(PmCaptureBase pmCapture, PmLinkType pmLinkType, DateTime timeStamp, Int64 incLength, PmFrameType frameType, long frameIndex, long originalLength) { this.PmCapture = pmCapture; this.PmLinkType = pmLinkType; this.TimeStamp = timeStamp; this.IncludedLength = incLength; this.PmFrameType = frameType; this.FrameIndex = frameIndex; this.OriginalLength = originalLength; this.PmCapture.Frames.Add(this); }
/// <summary> /// Constructor used when indexing /// </summary> public PmFrameMnm( PmCaptureBase pmCapture, UInt32 fraIndex, UInt32 fraOffset, PmLinkType pmLinkType, DateTime timeStamp, Int32 oriLength, Int32 incLength) : base(pmCapture, pmLinkType, timeStamp, incLength, PmFrameType.Mnm, fraIndex, oriLength) { this.FrameOffset = fraOffset; this.L2Offset = this.FrameOffset + 16; }
public async Task RemoveCaptureAsync(PmCaptureBase capture) { await Task.Run(() => { if (capture == null) { return; } try { this.Logger?.Info("InvestigationVm delete not implemented."); } catch (Exception ex) { this.Logger?.Error("Remove capture failed", ex); } }); }
public readonly ImmutableList <IFragment> Fragments; // NOTE: Current implementation uses copied data instead of offsets in capture file. private PmFrameEncapsulated( PmCaptureBase pmCapture, PmLinkType pmLinkType, DateTime timeStamp, long frameIndex, long incLength, long originalLength, ImmutableList <IFragment> fragments) : base(pmCapture, pmLinkType, timeStamp, incLength, PmFrameType.Encapsulated, frameIndex, originalLength) { this.Fragments = fragments ?? throw new ArgumentNullException(nameof(fragments)); // copy data from fragments to array in memory // NOTE: Current implementation uses copied data instead of offsets in capture file. var data = new List <Byte>(); foreach (var fragment in fragments) { data.AddRange(fragment.Payload); } this.L2DataEncapsulated = data.ToArray(); }
public CaptureL4(PmCaptureBase capture) { this.OriginalCapture = capture; }
public Task RemoveCaptureAsync(PmCaptureBase capture) { return(Task.CompletedTask); }