scanners

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 18, 2021 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAddressesForNet

func GetAddressesForNet(n *net.IPNet) (out []net.IP)

func ScanTCPPort

func ScanTCPPort(targetAddress string, targetPort int, timeout time.Duration) (bool, error)

func ScanUDPPort

func ScanUDPPort(targetAddress string, targetPort int, timeout time.Duration, packetGetter func(port int) ([]byte, error)) (bool, error)

Types

type DiscoveredNode

type DiscoveredNode struct {
	IPAddress  net.IP
	MACAddress net.HardwareAddr
}

type NodeScanner

type NodeScanner struct {
	// contains filtered or unexported fields
}

func NewNodeScanner

func NewNodeScanner(device string) *NodeScanner

func (*NodeScanner) Open

func (s *NodeScanner) Open() ([]*net.IPNet, error)

func (*NodeScanner) Read

func (s *NodeScanner) Read() *DiscoveredNode

func (*NodeScanner) Receive

func (s *NodeScanner) Receive(ctx context.Context) error

func (*NodeScanner) Transmit

func (s *NodeScanner) Transmit() error

type PortScanner

type PortScanner struct {
	// contains filtered or unexported fields
}

func NewPortScanner

func NewPortScanner(target string, startPort int, endPort int, timeout time.Duration, protocols []string, semaphore *semaphore.Weighted, packetGetter func(port int) ([]byte, error)) *PortScanner

func (*PortScanner) Read

func (s *PortScanner) Read() *ScannedPort

func (*PortScanner) Transmit

func (s *PortScanner) Transmit() error

type ScannedNode

type ScannedNode struct {
	MacAddress string
	Awake      bool
}

type ScannedPort

type ScannedPort struct {
	Target   string
	Port     int
	Protocol string
	Open     bool
}

type WakeScanner

type WakeScanner struct {
	// contains filtered or unexported fields
}

func NewWakeScanner

func NewWakeScanner(macAddress string, deviceName string, timeout time.Duration, getIPAddress func(string) (string, error)) *WakeScanner

func (*WakeScanner) Open

func (w *WakeScanner) Open() error

func (*WakeScanner) Read

func (w *WakeScanner) Read() *ScannedNode

func (*WakeScanner) Transmit

func (w *WakeScanner) Transmit() error

Jump to

Keyboard shortcuts

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