probev6

package
v0.4.3-0...-f9b1853 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2024 License: BSD-2-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProbeResponseUDPv6

type ProbeResponseUDPv6 struct {
	// payload of the received IPv6 packet (expected ICMPv6 -> IPv6 -> UDP)
	Data []byte
	// time the packet is received at
	Timestamp time.Time
	// sender IP address
	Addr net.IP
	// contains filtered or unexported fields
}

ProbeResponseUDPv6 represents a received probe response with its metadata

func (*ProbeResponseUDPv6) ICMPv6

func (pr *ProbeResponseUDPv6) ICMPv6() *inet.ICMPv6

ICMPv6 returns the ICMPv6 layer of the probe.

func (*ProbeResponseUDPv6) InnerIPv6

func (pr *ProbeResponseUDPv6) InnerIPv6() *ipv6.Header

InnerIPv6 returns the IP layer of the inner packet of the probe.

func (*ProbeResponseUDPv6) InnerPayload

func (pr *ProbeResponseUDPv6) InnerPayload() []byte

InnerPayload returns the payload of the inner UDP packet

func (*ProbeResponseUDPv6) InnerUDP

func (pr *ProbeResponseUDPv6) InnerUDP() *inet.UDP

InnerUDP returns the UDP layer of the inner packet of the probe.

func (ProbeResponseUDPv6) Matches

func (pr ProbeResponseUDPv6) Matches(pi probes.Probe) bool

Matches returns true if this probe response matches the given probe. Both probes must have been already validated with Validate, this function may panic otherwise.

func (*ProbeResponseUDPv6) Validate

func (pr *ProbeResponseUDPv6) Validate() error

Validate verifies that the probe response has the expected structure, and returns an error if not

type ProbeUDPv6

type ProbeUDPv6 struct {
	// Payload of the sent IPv6 packet
	Payload []byte
	// HopLimit value when the packet was sent
	HopLimit int
	// time the packet is set at
	Timestamp time.Time
	// local address of the packet sender
	LocalAddr, RemoteAddr net.IP
	// contains filtered or unexported fields
}

ProbeUDPv6 represents a sent probe packet with its metadata

func (ProbeUDPv6) UDP

func (p ProbeUDPv6) UDP() *inet.UDP

UDP returns the UDP layer of the probe. If not decoded yet, will return nil.

func (*ProbeUDPv6) Validate

func (p *ProbeUDPv6) Validate() error

Validate verifies that the probe has the expected structure, and returns an error if not

type UDPv6

type UDPv6 struct {
	Target      net.IP
	SrcPort     uint16
	DstPort     uint16
	UseSrcPort  bool
	NumPaths    uint16
	MinHopLimit uint8
	MaxHopLimit uint8
	Delay       time.Duration
	Timeout     time.Duration
	BrokenNAT   bool
}

UDPv6 is a probe type based on IPv6 and UDP

func (UDPv6) ListenFor

func (d UDPv6) ListenFor(conn *ipv6.PacketConn, howLong time.Duration) ([]probes.ProbeResponse, error)

ListenFor waits for ICMP packets until the timeout expires

func (UDPv6) Match

func (d UDPv6) Match(sent []probes.Probe, received []probes.ProbeResponse) results.Results

Match compares the sent and received packets and finds the matching ones. It returns a Results structure

func (UDPv6) SendReceive

func (d UDPv6) SendReceive() ([]probes.Probe, []probes.ProbeResponse, error)

SendReceive sends all the packets to the target address, respecting the configured inter-packet delay

func (UDPv6) Traceroute

func (d UDPv6) Traceroute() (*results.Results, error)

Traceroute sends the probes and returns a Results structure or an error

func (*UDPv6) Validate

func (d *UDPv6) Validate() error

Validate checks that the probe is configured correctly and it is safe to subsequently run the Traceroute() method

Jump to

Keyboard shortcuts

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