diff options
author | Emiliano Ciavatta | 2020-04-03 10:47:23 +0000 |
---|---|---|
committer | Emiliano Ciavatta | 2020-04-03 10:47:23 +0000 |
commit | 9883cd346f694ad09aac839f9ddc4a25df0e0b0a (patch) | |
tree | 7a5bfdf282b273ffc410a9e8c758fb8db73072c7 /pcap_importer.go | |
parent | b02ee06a2dad56650f539f69df5660a88e442059 (diff) |
Add connection_handler and stream_handler
Diffstat (limited to 'pcap_importer.go')
-rw-r--r-- | pcap_importer.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/pcap_importer.go b/pcap_importer.go index 9428b29..c6260de 100644 --- a/pcap_importer.go +++ b/pcap_importer.go @@ -24,7 +24,7 @@ const importedPcapsCollectionName = "imported_pcaps" type PcapImporter struct { - storage *Storage + storage Storage streamPool *tcpassembly.StreamPool assemblers []*tcpassembly.Assembler sessions map[string]context.CancelFunc @@ -36,10 +36,11 @@ type PcapImporter struct { type flowCount [2]int -func NewPcapImporter(storage *Storage, serverIp string) *PcapImporter { +func NewPcapImporter(storage Storage, serverIp net.IP) *PcapImporter { + serverEndpoint := layers.NewIPEndpoint(serverIp) streamFactory := &BiDirectionalStreamFactory{ storage: storage, - serverIp: serverIp, + serverIp: serverEndpoint, } streamPool := tcpassembly.NewStreamPool(streamFactory) @@ -50,7 +51,7 @@ func NewPcapImporter(storage *Storage, serverIp string) *PcapImporter { sessions: make(map[string]context.CancelFunc), mAssemblers: sync.Mutex{}, mSessions: sync.Mutex{}, - serverIp: layers.NewIPEndpoint(net.ParseIP(serverIp)), + serverIp: serverEndpoint, } } |