trace

package
v1.1.8 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2023 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidMethod      = errors.New("invalid method")
	ErrTracerouteExecuted = errors.New("traceroute already executed")
	ErrHopLimitTimeout    = errors.New("hop timeout")
)

Functions

func GenerateQuicPayloadWithRandomIds

func GenerateQuicPayloadWithRandomIds() []byte

func HopPrinter

func HopPrinter(h Hop)

Types

type Config

type Config struct {
	SrcAddr          string
	BeginHop         int
	MaxHops          int
	NumMeasurements  int
	PktSize          int
	ParallelRequests int
	Timeout          time.Duration
	DestIP           net.IP
	DestPort         int
	Quic             bool
	IPGeoSource      ipgeo.Source
	RDns             bool
	AlwaysWaitRDNS   bool
	PacketInterval   int
	TTLInterval      int
	Lang             string
	DN42             bool
	RealtimePrinter  func(res *Result, ttl int)
	AsyncPrinter     func(res *Result)
}

type Hop

type Hop struct {
	Success  bool
	Address  net.Addr
	Hostname string
	TTL      int
	RTT      time.Duration
	Error    error
	Geo      *ipgeo.IPGeoData
	Lang     string
	RetType  icmp.Type
}

type ICMPTracer

type ICMPTracer struct {
	Config
	// contains filtered or unexported fields
}

func (*ICMPTracer) Execute

func (t *ICMPTracer) Execute() (*Result, error)

func (*ICMPTracer) PrintFunc

func (t *ICMPTracer) PrintFunc()

type ICMPTracerv6

type ICMPTracerv6 struct {
	Config
	// contains filtered or unexported fields
}

func (*ICMPTracerv6) Execute

func (t *ICMPTracerv6) Execute() (*Result, error)

func (*ICMPTracerv6) PrintFunc

func (t *ICMPTracerv6) PrintFunc()

type Method

type Method string
const (
	ICMPTrace Method = "icmp"
	UDPTrace  Method = "udp"
	TCPTrace  Method = "tcp"
)

type PacketListener

type PacketListener struct {
	Conn     net.PacketConn
	Messages chan ReceivedMessage
	// contains filtered or unexported fields
}

func NewPacketListener

func NewPacketListener(conn net.PacketConn, ctx context.Context) *PacketListener

func (*PacketListener) Start

func (l *PacketListener) Start()

type ReceivedMessage

type ReceivedMessage struct {
	N    *int
	Peer net.Addr
	Msg  []byte
	Err  error
}

type Result

type Result struct {
	Hops [][]Hop
	// contains filtered or unexported fields
}

func Traceroute

func Traceroute(method Method, config Config) (*Result, error)

type TCPTracer

type TCPTracer struct {
	Config

	SrcIP net.IP
	// contains filtered or unexported fields
}

func (*TCPTracer) Execute

func (t *TCPTracer) Execute() (*Result, error)

type TCPTracerv6

type TCPTracerv6 struct {
	Config

	SrcIP net.IP
	// contains filtered or unexported fields
}

func (*TCPTracerv6) Execute

func (t *TCPTracerv6) Execute() (*Result, error)

type Tracer

type Tracer interface {
	Execute() (*Result, error)
}

type UDPTracer

type UDPTracer struct {
	Config
	// contains filtered or unexported fields
}

func (*UDPTracer) Execute

func (t *UDPTracer) Execute() (*Result, error)

Jump to

Keyboard shortcuts

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