Exemplo n.º 1
0
        public IReadOnlyList <String> RecognizeApplicationProtocolsTags(IApplicationRecognizer applicationRecognizer)
        {
            var toxanomies = this.RecognizeApplicationProtocols(applicationRecognizer).ToList();

            toxanomies.Sort(NBARProtocolPortDatabase.ProtocolTaxonomyPortComparison);
            return(toxanomies.Select(t => t.name).ToList());
        }
Exemplo n.º 2
0
        private void RecognizeConversation(IApplicationRecognizer recognizer, FwCaptureContext capture, Conversation conversation)
        {
            if (recognizer != null && conversation != null)
            {
                var fwConv = capture.Capture.GetConversation(conversation.Index);
                if (fwConv != null)
                {
                    var tags = fwConv.RecognizeApplicationProtocolsTags(recognizer);

                    if (tags != null && tags.Any())
                    {
                        conversation.AutoSave        = false;
                        conversation.ApplicationTags = new string[tags.Count(s => !string.IsNullOrEmpty(s))];
                        var i = 0;
                        foreach (var tag in tags)
                        {
                            if (!string.IsNullOrEmpty(tag))
                            {
                                conversation.ApplicationTags[i++] = tag.ToUpper();
                            }
                        }

                        fwConv.ReTagApplicationProtocols(tags);
                        conversation.PersistenceProvider.Update(conversation);
                        conversation.AutoSave = true;
                    }
                }
            }
        }
Exemplo n.º 3
0
 public FlowStore(IL7ConversationFactory l7ConversationFactory, IApplicationRecognizer applicationRecognizer, L4Conversation l4Conversation, TimeSpan flowMatchingTimeSpan)
 {
     this.L7ConversationFactory = l7ConversationFactory;
     this.ApplicationRecognizer = applicationRecognizer;
     this.L4Conversation        = l4Conversation;
     this.FlowMatchingTimeSpan  = flowMatchingTimeSpan;
 }
Exemplo n.º 4
0
        public IReadOnlyList <NBAR2TaxonomyProtocol> RecognizeApplicationProtocols(IApplicationRecognizer applicationRecognizer)
        {
            var appReco = applicationRecognizer as ApplicationRecognizerBase;

            if (appReco == null)
            {
                throw new ArgumentException("applicationRecognizer", @"Selected application recognizer do not exists.");
            }
            return(appReco.RecognizeConversation(this));
        }