void ProcessReceivedData(byte[] bBacketData, WinPcapCaptureHeader wpcHeader) { EthernetFrame fFrame = new EthernetFrame(bBacketData); if (!(bExcludeLocalHostTraffic && IsLocalHostTraffic(fFrame)) && (bPromiscousMode || IsAddressedForThisInterface(fFrame))) { TrafficDescriptionFrame tdf = new TrafficDescriptionFrame(this, wpcHeader.Timestamp); tdf.EncapsulatedFrame = fFrame; AnalyzeARP(tdf); AnalyzeICMP(tdf); InvokeFrameForwarded(); InvokePacketCaptured(tdf); if (OutputHandler != null) { NotifyNext(tdf); } if (AutoAnswerARPRequests) { HandleARP(fFrame); HandleICMP(fFrame); } } }
internal void OnBytesCaptured(WinPcapCaptureHeader wpcHeader, byte[] bPacketData, object sender) { if (!bShutdownPending) { try { InvokeBytesCaptured(bPacketData); ProcessReceivedData(bPacketData, wpcHeader); } catch (Exception ex) { InvokeExceptionThrown(ex); } } }