61 lines
1.3 KiB
Go
61 lines
1.3 KiB
Go
package events
|
|
|
|
import "loafle.com/overflow/collector/discovery/types"
|
|
|
|
//////////////////////////////////////////////////////////////////////// Port Event Start
|
|
type PortStartEvent struct {
|
|
Zone int64
|
|
PortCount uint16
|
|
}
|
|
|
|
func (i PortStartEvent) GetUrl() string {
|
|
return PORT_START
|
|
}
|
|
|
|
func NewPortStartEvent(zone int64, portCount uint16) *PortStartEvent {
|
|
return &PortStartEvent{
|
|
Zone: zone,
|
|
PortCount: portCount,
|
|
}
|
|
}
|
|
|
|
//////////////////////////////////////////////////////////////////////// Port Event Found
|
|
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,
|
|
}
|
|
}
|
|
|
|
//////////////////////////////////////////////////////////////////////// Port Event Found
|
|
type PortEndEvent struct {
|
|
Zone int64
|
|
Host int64
|
|
Histories []*types.PortScanHistory
|
|
}
|
|
|
|
func (i PortEndEvent) GetUrl() string {
|
|
return PORT_START
|
|
}
|
|
|
|
func NewPortEndEvent(zone int64, host int64, history []*types.PortScanHistory) *PortEndEvent {
|
|
return &PortEndEvent{
|
|
Zone: zone,
|
|
Host: host,
|
|
Histories: history,
|
|
}
|
|
}
|