icmp

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: Apache-2.0 Imports: 16 Imported by: 4

Documentation

Index

Constants

View Source
const TaskName = "ICMP_TASK"

Variables

This section is empty.

Functions

func NewTaskFromBytes

func NewTaskFromBytes(msg []byte) (t task, err error)

NewTaskFromBytes used in sensor for building the task from the received bytes

func NewTaskFromModel

func NewTaskFromModel(t models.Task) (tRes task, err error)

NewTaskFromModel used in scheduler for building the task from the db model task

Types

type IcmpPingResult

type IcmpPingResult struct {
	IPAddr       net.IP
	Sequence     int
	BytesWritten int
	BytesRead    int
	RTT          time.Duration
	Error        error
}

IcmpPingResult represents a single completed ping

type IcmpPingStats

type IcmpPingStats struct {
	IPAddr          net.IP
	PacketsSent     int
	PacketsReceived int
	BytesWritten    int
	BytesRead       int
	TotalRTT        time.Duration
	MinRTT          time.Duration
	MaxRTT          time.Duration
	AverageRTT      time.Duration
	Loss            float64
	FailureMessages []string
}

IcmpPingResult represents a completed ping with stats FailureMessages represents all errors that occurred during the ICMP task. TODO add mdev

type Opts

type Opts struct {
	// TargetDomain is not required
	TargetDomain string   `json:"TargetDomain"`
	TargetIPs    []net.IP `json:"TargetIPs"`
	Count        int      `json:"Count"`
	Payload      []byte   `json:"Payload"`
}

Opts defines the parameter payload to call PingHost Since we have pointer parameters, the struct should be also passed by pointer to avoid nasty bugs due to struct value copy

type Result

type Result struct {
	ResultPerIp map[string]IcmpPingStats
	DnsResult   dns.Result
}

Jump to

Keyboard shortcuts

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