tcp

package
v0.0.0-...-45a9bcf Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package tcp adds a TCP traceroute implementation to the agent

Package tcp adds a TCP traceroute implementation to the agent

Index

Constants

View Source
const (
	// ACK is the acknowledge TCP flag
	ACK = 1 << 4
	// RST is the reset TCP flag
	RST = 1 << 2
	// SYN is the synchronization TCP flag
	SYN = 1 << 1

	// IPProtoICMP is the ICMP protocol number
	IPProtoICMP = 1
	// IPProtoTCP is the TCP protocol number
	IPProtoTCP = 6
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Hop

type Hop struct {
	IP       net.IP
	Port     uint16
	ICMPType layers.ICMPv4TypeCode
	RTT      time.Duration
	IsDest   bool
}

Hop encapsulates information about a single hop in a TCP traceroute

type Results

type Results struct {
	Source     net.IP
	SourcePort uint16
	Target     net.IP
	DstPort    uint16
	Hops       []*Hop
}

Results encapsulates a response from the TCP traceroute

type TCPv4

type TCPv4 struct {
	Target net.IP

	DestPort uint16
	NumPaths uint16
	MinTTL   uint8
	MaxTTL   uint8
	Delay    time.Duration // delay between sending packets (not applicable if we go the serial send/receive route)
	Timeout  time.Duration // full timeout for all packets
	// contains filtered or unexported fields
}

TCPv4 encapsulates the data needed to run a TCPv4 traceroute

func (*TCPv4) Close

func (t *TCPv4) Close() error

Close doesn't to anything yet, but we should use this to close out long running sockets when we're done with a path test

func (*TCPv4) TracerouteSequential

func (t *TCPv4) TracerouteSequential() (*Results, error)

TracerouteSequential runs a traceroute sequentially where a packet is sent and we wait for a response before sending the next packet

Jump to

Keyboard shortcuts

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