tracer

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 25, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PerformOption

type PerformOption func(options *performOptions)

func WithFirstTTL

func WithFirstTTL(firstTTL int) PerformOption

func WithInterface

func WithInterface(iface string) PerformOption

func WithMaxTTL

func WithMaxTTL(maxTTL int) PerformOption

func WithNetwork

func WithNetwork(network string) PerformOption

func WithPacketSize

func WithPacketSize(packetSize int) PerformOption

func WithQueries

func WithQueries(queries int) PerformOption

func WithTOS

func WithTOS(tos int) PerformOption

func WithTimeout

func WithTimeout(timeout time.Duration) PerformOption

type Tracer

type Tracer interface {
	ListenConn(options *performOptions) (net.PacketConn, error)
	SendConn(options *performOptions) (net.PacketConn, error)
	SetTTLAndTOS(ttl, tos int)
	EchoPacket(id, seq uint16, packetSize int) ([]byte, error)
	CheckEchoReply(byte []byte, id, seq uint16) bool
}

func NewIPTracer

func NewIPTracer(preferIPv6 bool) Tracer

type TracerouteHop

type TracerouteHop struct {
	Success     bool
	From        net.Addr
	N, TTL      int
	ElapsedTime time.Duration
}

type TracerouteResult

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

func Traceroute

func Traceroute(target *net.IPAddr, recvCh chan<- *TracerouteHop, option ...PerformOption) (result TracerouteResult, err error)

Jump to

Keyboard shortcuts

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