data

package
v0.0.0-...-e9ab6a4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 12, 2023 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package data provides data types used throughout the application.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ControlMessage

type ControlMessage int

ControlMessage is a symbolic constant signifying a message send to the Nexus.

const (
	CtlMsgStop ControlMessage = iota
	CtlMsgShutdown
	CtlMsgStatus
	CtlMsgSpawn
	CtlMsgBye
)

CtlMsgStop tells the Nexus to shut down. CtlMsgStatus asks the Nexus for information on its current status.

type Host

type Host struct {
	ID      krylib.ID
	Source  HostSource
	Address net.IP
	Name    string
	Added   time.Time
}

Host is a host somewhere on the Internet.

type HostSource

type HostSource int

HostSource indicates how a Host ended up in the database.

const (
	HostSourceUser HostSource = iota
	HostSourceGen
	HostSourceA
	HostSourceMx
	HostSourceNs
)

HostSourceUser indicates a host was manually added by the user. HostSourceGen indicates it was added by the HostGenerator. HostSourceA indicates it was gathered from an address record in a zone transfer. HostSourceMx and HostSourceNs indicate a Host was gathered from the respective records in a zone transfer.

type HostWithPorts

type HostWithPorts struct {
	Host  Host
	Ports []Port
}

HostWithPorts is a Host along with all the Ports that have been scanned on that Host.

type Port

type Port struct {
	ID        krylib.ID
	HostID    krylib.ID
	Port      uint16
	Timestamp time.Time
	Reply     *string
}

Port is a TCP/UDP port that was scanned on a given host.

func (*Port) ReplyString

func (p *Port) ReplyString() string

ReplyString returns the Reply gathered from the Port or an empty string.

type ScanRequest

type ScanRequest struct {
	Host Host
	Port uint16
}

ScanRequest is a request to scan a specific port on a given host

type ScanResult

type ScanResult struct {
	Host  Host
	Port  uint16
	Reply *string
	Stamp time.Time
	Err   error
}

ScanResult represents the result of scanning a single port.

func (*ScanResult) Address

func (res *ScanResult) Address() string

Address returns the IP address of the scanned host as a string.

func (*ScanResult) HostName

func (res *ScanResult) HostName() string

HostName returns the hostname of the scanned Host.

func (*ScanResult) ReplyString

func (res *ScanResult) ReplyString() string

ReplyString returns the reply gathered from the scanned port.

type XFR

type XFR struct {
	ID     krylib.ID
	Zone   string
	Start  time.Time
	End    time.Time
	Status xfrstatus.XfrStatus
}

XFR represents a DNS zone transfer.

func XfrNew

func XfrNew(zone string) *XFR

XfrNew creates a new XFR.

func (*XFR) IsFinished

func (x *XFR) IsFinished() bool

IsFinished returns true if the XFR has been finished (successfully or not).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL