Esempio n. 1
0
 public static Props Props(ICaptureInfo info,
                           IActorRef contractor,
                           IL3ConversationTrackingActorFactory l3ConversationTrackingActorFactory,
                           IL7ConversationStorageActorFactory l7ConversationStorageActorFactory,
                           IApplicationProtocolExportActorFactory applicationProtocolExportActorFactory) =>
 Akka.Actor.Props.Create <CaptureTrackingActor>(info, contractor, l3ConversationTrackingActorFactory,
                                                l7ConversationStorageActorFactory, applicationProtocolExportActorFactory);
Esempio n. 2
0
        public CaptureTrackingActor(CaptureInfo captureInfo,
                                    IActorRef contractor,
                                    IL3ConversationTrackingActorFactory l3ConversationTrackingActorFactory,
                                    IL7ConversationStorageActorFactory l7ConversationStorageActorFactory)
        {
            this._captureInfo = captureInfo;
            this._contractor  = contractor;
            this._l3ConversationTrackingActorFactory = l3ConversationTrackingActorFactory;
            this._l7ConversationStorageActorFactory  = l7ConversationStorageActorFactory;
            this._ipv4DefragmentationEngine          =
                new Ipv4DefragmentationEngine(new AkkaLoggingAdapter <Ipv4DefragmentationEngine>(this._logger));

            this._logger.Info($"Started for {captureInfo.Uri.AbsoluteUri}");
            this._l7ConversationStorageActor = this.CreateL7ConversationStorageActor();

            this.Become(this.AnalysisBehavior);
        }
Esempio n. 3
0
        public CaptureTrackingActor(ICaptureInfo captureInfo,
                                    IActorRef contractor,
                                    IL3ConversationTrackingActorFactory l3ConversationTrackingActorFactory,
                                    IL7ConversationStorageActorFactory l7ConversationStorageActorFactory,
                                    IApplicationProtocolExportActorFactory applicationProtocolExportActorFactory)
        {
            this._logger.Debug($"Started for {captureInfo.Uri.AbsoluteUri}");

            this._captureInfo = captureInfo;
            this._contractor  = contractor;
            this._l3ConversationTrackingActorFactory = l3ConversationTrackingActorFactory;
            this._ipv4DefragmentationEngine          =
                new Ipv4DefragmentationEngine(new AkkaLoggingAdapter <Ipv4DefragmentationEngine>(this._logger));

            this._l7ConversationHandlerActors = this.CreateL7ConversationHandlerActors(l7ConversationStorageActorFactory, applicationProtocolExportActorFactory);

            this.Become(this.AnalysisBehavior);
        }
Esempio n. 4
0
        private List <IActorRef> CreateL7ConversationHandlerActors(IL7ConversationStorageActorFactory l7ConversationStorageActorFactory,
                                                                   IApplicationProtocolExportActorFactory applicationProtocolExportActorFactory)
        {
            var l7ConversationFilter = new Predicate <IL7Conversation>(
                l7c => l7c.ProtocolType == IPProtocolType.TCP && l7c.DestinationEndPoint.Port == 80 ||
                l7c.ProtocolType == IPProtocolType.UDP && l7c.DestinationEndPoint.Port == 53);

            // Register L7 conversation handlers
            var l7ConversationHandlerActors = new List <IActorRef>
            {
                l7ConversationStorageActorFactory.Create(Context, this.Self, this._captureInfo),
                applicationProtocolExportActorFactory.Create(Context, this.Self, l7ConversationFilter)
            };

            foreach (var l7conversationHandlerActor in l7ConversationHandlerActors)
            {
                Context.Watch(l7conversationHandlerActor);
            }
            return(l7ConversationHandlerActors);
        }