コード例 #1
0
ファイル: SnooperBase.cs プロジェクト: nesfit/NTPAC
        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);
        }
コード例 #2
0
ファイル: SnooperExportBase.cs プロジェクト: nesfit/NTPAC
        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
        }
コード例 #3
0
 public SnooperUnhandledExceptionExport(IPduReader pduReader, Exception exception) : base(pduReader)
     => this.ParsingError = exception;