This commit is contained in:
crusader
2018-09-05 05:25:04 +09:00
parent b9ac5b2a71
commit 1aa43cf403
3 changed files with 45 additions and 48 deletions

View File

@@ -9,7 +9,6 @@ import (
"github.com/google/gopacket"
"github.com/google/gopacket/layers"
"github.com/google/gopacket/pcap"
deadlock "github.com/sasha-s/go-deadlock"
)
func NewPCapScanner(zone *omd.Zone) PCapScanner {
@@ -49,24 +48,19 @@ type pCapScan struct {
pCapHandle *pcap.Handle
zone *omd.Zone
// arpListenerChanMtx sync.RWMutex
arpListenerChanMtx deadlock.RWMutex
arpListenerChanMtx sync.RWMutex
arpListenerChans []chan *layers.ARP
// icmp4ListenerChanMtx sync.RWMutex
icmp4ListenerChanMtx deadlock.RWMutex
icmp4ListenerChanMtx sync.RWMutex
icmp4ListenerChans []chan gopacket.Packet
// icmp6ListenerChanMtx sync.RWMutex
icmp6ListenerChanMtx deadlock.RWMutex
icmp6ListenerChanMtx sync.RWMutex
icmp6ListenerChans []chan gopacket.Packet
// tcpListenerChanMtx sync.RWMutex
tcpListenerChanMtx deadlock.RWMutex
tcpListenerChanMtx sync.RWMutex
tcpListenerChans map[string][]chan *layers.TCP
// udpListenerChanMtx sync.RWMutex
udpListenerChanMtx deadlock.RWMutex
udpListenerChanMtx sync.RWMutex
udpListenerChans map[string][]chan gopacket.Packet
refCount int