Documentation
¶
Index ¶
Constants ¶
const DefaultMaxHops = 32
const DefaultPort = 33434
const DefaultRetries = 2
const DefaultStartTTL = 1
const DefaultTimeoutMs = 200
Variables ¶
This section is empty.
Functions ¶
func Run ¶
Run uses the given dest (hostname) and options to execute a traceroute to the remote host. Run is unblocked and returns a communication channel where the caller should read the Hop data On finish or error the communication channel will be closed Outbound packets are UDP packets and inbound packets are ICMP.
Types ¶
type Addr ¶
type Addr struct { // Host is the host (ie, DNS) name of the node. Host string // IP is the IP address of the node. IP net.IP }
Addr is a network address stored as a pair of domain name and ip address
func (*Addr) HostOrAddr ¶
type BPF ¶
type BPF []bpf.Instruction
type Hop ¶
type Hop struct { // Success is a boolean value was the response received or not Success bool // Src is the source (ie, local) address. Src Addr // Dst is the destination (ie, remote) address. Dst Addr // Node is the node at this step of the route. Node Addr // Step is the location of this node in the route, ie the TTL value used. Step int // ID is a unique ID that is used to match the original request with the ICMP response. // It can be derived from either the request or the response. ID int // DstPort is the destination port targeted. DstPort int // Sent is the time the query began. Sent time.Time // Received is the time the query completed. Received time.Time // Elapsed is the duration of the query. Elapsed time.Duration // IcmpType is the received ICMP packet type value. IcmpType int }
Hop is a step in the network route between a source and destination address.
func RunBlock ¶
RunBlock uses the given dest (hostname) and options to execute a traceroute to the remote host. RunBlock is blocked until traceroute finished and returns a Result which contains an array of hops. Each hop includes the elapsed time and its IP address. Outbound packets are UDP packets and inbound packets are ICMP.