public void Invoke() { var tcpCache = CacheFactory.GetOrCreateCache <FlowKey, TcpSpaceTimeModel>(m_ignite, TcpSpaceTimeCacheName); var flowCache = CacheFactory.GetOrCreateFlowCache(m_ignite, FlowCacheName); var frameCache = CacheFactory.GetFrameCacheCollection(m_ignite, FrameCacheNames); var tcpObjects = flowCache.GetLocalEntries() .Where(flowEntry => flowEntry.Key.Protocol == System.Net.Sockets.ProtocolType.Tcp && flowEntry.Key.SourcePort > flowEntry.Key.DestinationPort) .Select(flowEntry => ExtractTcpSpaceTimeModel(frameCache.GetConversation(flowEntry.Key, true), flowEntry)) .Select(tcpModel => KeyValuePair.Create(tcpModel.FlowKey, tcpModel)); tcpCache.PutAll(tcpObjects); }
void IComputeAction.Invoke() { var httpCache = CacheFactory.GetOrCreateCache <string, HttpObject>(m_ignite, HttpCacheName); var flowCache = CacheFactory.GetOrCreateFlowCache(m_ignite, FlowCacheName); var frameCache = CacheFactory.GetFrameCacheCollection(m_ignite, FrameCacheNames); var httpObjects = flowCache.GetLocalEntries() .Where(f => String.Equals(f.Value.ServiceName, "www-http", StringComparison.InvariantCultureIgnoreCase)) .Where(f => f.Key.SourcePort > f.Key.DestinationPort) .Select(f => frameCache.GetConversation(f.Key)) .SelectMany(c => ExtractHttpObjects(c)) .Select(x => KeyValuePair.Create(x.ObjectName, x)); httpCache.PutAll(httpObjects); }
public void Invoke() { m_ignite.Logger.Log(Apache.Ignite.Core.Log.LogLevel.Info, $"Extracting DNS objects from {FlowCacheName} started.", null, null, nameof(DnsExtractor), "", null); var flowCache = CacheFactory.GetOrCreateFlowCache(m_ignite, FlowCacheName).AsCacheQueryable(local: true); var frameCache = CacheFactory.GetFrameCacheCollection(m_ignite, FrameCacheNames); var dnsObjectCache = CacheFactory.GetOrCreateCache <string, DnsObject>(m_ignite, DnsCacheName); var dnsFlows = flowCache.Where(f => f.Value.ServiceName == "domain"); foreach (var dnsFlow in dnsFlows) { var frames = frameCache.GetItems(dnsFlow.Key); var dnsObjects = Inspect(dnsFlow.Key, dnsFlow.Value, frames.Select(x => x.Value)).Select(x => KeyValuePair.Create(x.ObjectName, x)).ToList(); dnsObjectCache.PutAll(dnsObjects); } m_ignite.Logger.Log(Apache.Ignite.Core.Log.LogLevel.Info, $"Extracting DNS objects from {FlowCacheName} completed.", null, null, nameof(DnsExtractor), "", null); }