Documentation ¶
Index ¶
Constants ¶
View Source
const ( ProtocolICMP = 1 ProtocolTCP = 6 ProtocolUDP = 17 ProtocolIPv6ICMP = 58 )
IANA Assigned Internet Protocol Numbers
View Source
const BackTraceVersion = "0.0.1"
Variables ¶
View Source
var DefaultConfig = Config{ Delay: 50 * time.Millisecond, Timeout: 500 * time.Millisecond, MaxHops: 15, Count: 1, Networks: []string{"ip4:icmp", "ip4:ip"}, }
DefaultConfig is the default configuration for Tracer.
View Source
var DefaultTracer = &Tracer{ Config: DefaultConfig, }
DefaultTracer is a tracer with DefaultConfig.
Functions ¶
Types ¶
type Config ¶
type Config struct { Delay time.Duration Timeout time.Duration MaxHops int Count int Networks []string Addr *net.IPAddr }
Config is a configuration for Tracer.
type Hop ¶
Hop is a set of detected nodes.
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session is a tracer session.
type Tracer ¶
type Tracer struct { Config // contains filtered or unexported fields }
Tracer is a traceroute tool based on raw IP packets. It can handle multiple sessions simultaneously.
func (*Tracer) Close ¶
func (t *Tracer) Close()
Close closes listening socket. Tracer can not be used after Close is called.
func (*Tracer) NewSession ¶
NewSession returns new tracer session.
Click to show internal directories.
Click to hide internal directories.