2016-11-28 05:15:31 +00:00
|
|
|
package events
|
2016-11-28 05:25:11 +00:00
|
|
|
|
2016-11-28 06:00:12 +00:00
|
|
|
import "loafle.com/overflow/collector/discovery/types"
|
|
|
|
|
2016-11-28 05:34:04 +00:00
|
|
|
//////////////////////////////////////////////////////////////////////// Port Event Start
|
2016-11-28 05:25:11 +00:00
|
|
|
type PortStartEvent struct {
|
|
|
|
Zone int64
|
2016-11-28 05:32:04 +00:00
|
|
|
PortCount uint16
|
2016-11-28 05:25:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (i PortStartEvent) GetUrl() string {
|
2016-11-28 05:32:04 +00:00
|
|
|
return PORT_START
|
2016-11-28 05:25:11 +00:00
|
|
|
}
|
|
|
|
|
2016-11-28 05:32:04 +00:00
|
|
|
func NewPortStartEvent(zone int64, portCount uint16) *PortStartEvent {
|
2016-11-28 05:25:11 +00:00
|
|
|
return &PortStartEvent{
|
|
|
|
Zone: zone,
|
|
|
|
PortCount: portCount,
|
|
|
|
}
|
|
|
|
}
|
2016-11-28 05:32:04 +00:00
|
|
|
|
2016-11-28 05:34:04 +00:00
|
|
|
//////////////////////////////////////////////////////////////////////// Port Event Found
|
2016-11-28 05:32:04 +00: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 05:34:04 +00:00
|
|
|
//////////////////////////////////////////////////////////////////////// Port Event Found
|
2016-11-28 05:32:04 +00:00
|
|
|
type PortEndEvent struct {
|
2016-11-28 06:00:12 +00:00
|
|
|
Zone int64
|
|
|
|
Host int64
|
|
|
|
Histories []*types.PortScanHistory
|
2016-11-28 05:32:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (i PortEndEvent) GetUrl() string {
|
|
|
|
return PORT_START
|
|
|
|
}
|
|
|
|
|
2016-11-28 06:00:12 +00:00
|
|
|
func NewPortEndEvent(zone int64, host int64, history []*types.PortScanHistory) *PortEndEvent {
|
2016-11-28 05:32:04 +00:00
|
|
|
return &PortEndEvent{
|
2016-11-28 06:00:12 +00:00
|
|
|
Zone: zone,
|
|
|
|
Host: host,
|
|
|
|
Histories: history,
|
2016-11-28 05:32:04 +00:00
|
|
|
}
|
|
|
|
}
|