private void ProcessCurrentUDPFlow() { var tcpFlow = this.CurrentUDPFlow; this.CurrentUDPFlow = null; this.UDPFlowReassembler.ProcessUDPFlow(tcpFlow); }
public IEnumerable <L7Conversation> ProcessPmFrame(PmFrameBase frame) { lock (this.UDPFlowReassembler) { IEnumerable <L7Conversation> l7Conversations = null; if (this.CurrentUDPFlow.LastSeen == null || frame.TimeStamp.Subtract((DateTime)this.CurrentUDPFlow.LastSeen).Duration() < this._udpSessionAliveTimeout) { } else { this.ProcessCurrentUDPFlow(); this.CurrentUDPFlow = new FramesFirstSeenSortedCollection(); l7Conversations = this.FlowStore.PairFlowsAndCreateAndAddConversations(); } this.CurrentUDPFlow.Add(frame); return(l7Conversations); } }
public void ProcessUDPFlow(FramesFirstSeenSortedCollection udpFlowFrames) { var udpFlow = this.FlowStore.CreateAndAddFlow(this.FlowDirection); if (!udpFlowFrames.Any()) { return; } foreach (var frame in udpFlowFrames.Values) //.Where(frame => frame.L7PayloadLength > 0) { if (frame.L7PayloadLength <= 0) { udpFlow.NonDataFrames.Add(frame); continue; } var l7PDU = udpFlow.CreateL7PDU(); // var currentPDU = new L7PDU(bidirectionalFlow, frame.TimeStamp, frame.L7PayloadLength, flowDirection); //In case that frame is IPv4 fragmented if (!frame.Ipv4FMf) { l7PDU.AddFrame(frame); l7PDU.ExtractedBytes = frame.L7PayloadLength; continue; } Int64 extractedBytes; var defragmentedFrames = this.FindFragments(frame, out extractedBytes); if (defragmentedFrames == null) { continue; } l7PDU.AddFrameRange(defragmentedFrames); l7PDU.ExtractedBytes = extractedBytes; } }