communicate/events/event_port.go

66 lines
1.4 KiB
Go
Raw Normal View History

2016-11-28 14:15:31 +09:00
package events
2016-11-28 14:25:11 +09:00
2016-11-28 15:00:12 +09:00
import "loafle.com/overflow/collector/discovery/types"
2016-11-28 14:34:04 +09:00
//////////////////////////////////////////////////////////////////////// Port Event Start
2016-11-28 14:25:11 +09:00
type PortStartEvent struct {
Zone int64
2016-11-28 17:33:28 +09:00
Host int64
2016-11-28 14:32:04 +09:00
PortCount uint16
2016-11-30 15:37:34 +09:00
Type string
2016-11-28 14:25:11 +09:00
}
func (i PortStartEvent) GetUrl() string {
2016-11-28 14:32:04 +09:00
return PORT_START
2016-11-28 14:25:11 +09:00
}
2016-11-30 15:37:34 +09:00
func NewPortStartEvent(zone int64, host int64, portCount uint16, t string) *PortStartEvent {
2016-11-28 14:25:11 +09:00
return &PortStartEvent{
Zone: zone,
PortCount: portCount,
2016-11-30 15:37:34 +09:00
Type: t,
2016-11-28 14:25:11 +09:00
}
}
2016-11-28 14:32:04 +09:00
2016-11-28 14:34:04 +09:00
//////////////////////////////////////////////////////////////////////// Port Event Found
2016-11-28 14:32:04 +09:00
type PortFoundEvent struct {
Zone int64
Host int64
Port uint16
Type string
}
func (i PortFoundEvent) GetUrl() string {
return PORT_FOUND
}
func NewPortFoundEvent(zone int64, host int64, port uint16, t string) *PortFoundEvent {
return &PortFoundEvent{
Zone: zone,
Host: host,
Port: port,
Type: t,
}
}
2016-11-28 14:34:04 +09:00
//////////////////////////////////////////////////////////////////////// Port Event Found
2016-11-28 14:32:04 +09:00
type PortEndEvent struct {
2016-11-28 15:00:12 +09:00
Zone int64
Host int64
Histories []*types.PortScanHistory
2016-11-30 15:37:34 +09:00
Type string
2016-11-28 14:32:04 +09:00
}
func (i PortEndEvent) GetUrl() string {
return PORT_START
}
2016-11-30 15:37:34 +09:00
func NewPortEndEvent(zone int64, host int64, history []*types.PortScanHistory, t string) *PortEndEvent {
2016-11-28 14:32:04 +09:00
return &PortEndEvent{
2016-11-28 15:00:12 +09:00
Zone: zone,
Host: host,
Histories: history,
2016-11-30 15:37:34 +09:00
Type: t,
2016-11-28 14:32:04 +09:00
}
}