Example #1
0
func NewPcapLogger(logDir, archiveDir string, flow *types.TcpIpFlow, pcapLogNum int, pcapQuota int) types.PacketLogger {
	p := PcapLogger{
		packetChan: make(chan TimedPacket),
		stopChan:   make(chan bool),
		Flow:       flow,
		LogDir:     logDir,
		ArchiveDir: archiveDir,
		pcapLogNum: pcapLogNum,
		pcapQuota:  pcapQuota,
	}
	return types.PacketLogger(&p)
}
func NewDummyPacketLogger(str string, flow *types.TcpIpFlow, pcapNum int, pcapSize int) types.PacketLogger {
	m := DummyPacketLogger{}
	return types.PacketLogger(&m)
}
Example #3
0
func NewMockPacketLogger(str string, flow *types.TcpIpFlow, pcapNum int, pcapSize int) types.PacketLogger {
	m := MockPacketLogger{
		packetObserverChan: make(chan bool, 0),
	}
	return types.PacketLogger(&m)
}