2016-11-28 05:15:31 +00:00
|
|
|
package events
|
2016-11-28 05:25:11 +00:00
|
|
|
|
2017-05-29 10:53:29 +00:00
|
|
|
import "git.loafle.net/overflow/collector/discovery/types"
|
2016-11-28 06:00:12 +00:00
|
|
|
|
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 08:33:28 +00:00
|
|
|
Host int64
|
2016-11-28 05:32:04 +00:00
|
|
|
PortCount uint16
|
2016-11-30 06:37:34 +00:00
|
|
|
Type string
|
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-30 06:37:34 +00:00
|
|
|
func NewPortStartEvent(zone int64, host int64, portCount uint16, t string) *PortStartEvent {
|
2016-11-28 05:25:11 +00:00
|
|
|
return &PortStartEvent{
|
|
|
|
Zone: zone,
|
2016-11-30 07:12:28 +00:00
|
|
|
Host: host,
|
2016-11-28 05:25:11 +00:00
|
|
|
PortCount: portCount,
|
2016-11-30 06:37:34 +00:00
|
|
|
Type: t,
|
2016-11-28 05:25:11 +00:00
|
|
|
}
|
|
|
|
}
|
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-30 06:37:34 +00:00
|
|
|
Type string
|
2016-11-28 05:32:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (i PortEndEvent) GetUrl() string {
|
2016-11-30 07:26:53 +00:00
|
|
|
return PORT_END
|
2016-11-28 05:32:04 +00:00
|
|
|
}
|
|
|
|
|
2016-11-30 06:37:34 +00:00
|
|
|
func NewPortEndEvent(zone int64, host int64, history []*types.PortScanHistory, t string) *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-30 06:37:34 +00:00
|
|
|
Type: t,
|
2016-11-28 05:32:04 +00:00
|
|
|
}
|
|
|
|
}
|