public SnooperExportCollection ProcessConversation(IL7Conversation conversation, Boolean stopProcessingAfterError = true) { this.CurrentL7Conversation = conversation; this.PduReader = this.CreatePduReader(); var snooperExports = new List <SnooperExportBase>(); using (var snooperExportsEnumerator = this.ProcessConversation().GetEnumerator()) { try { while (snooperExportsEnumerator.MoveNext()) { var snooperExport = snooperExportsEnumerator.Current; snooperExports.Add(snooperExport); if (stopProcessingAfterError && snooperExport.ParsingFailed) { break; } } } catch (Exception e) { var unhandledExceptionExport = new SnooperUnhandledExceptionExport(this.PduReader, e); snooperExports.Add(unhandledExceptionExport); } } var snooperExportCollection = new SnooperExportCollection(this, snooperExports); return(snooperExportCollection); }
protected SnooperExportBase(IPduReader reader) { this.ConversationId = reader.CurrentConversation.Id; this.Timestamp = reader.CurrentPdu.FirstSeen; this.Direction = reader.CurrentPdu.Direction; #if DEBUG this.Conversation = reader.CurrentConversation; this.Pdu = reader.CurrentPdu; #else this.Conversation = reader.CurrentConversation.ToString(); this.Pdu = reader.CurrentPdu.ToString(); #endif }
public SnooperUnhandledExceptionExport(IPduReader pduReader, Exception exception) : base(pduReader) => this.ParsingError = exception;