cmn

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultInterval = 1 * time.Second
	DefaultTimeout  = 2 * time.Second
	MaxEchoes       = 1 << 16
)

Variables

View Source
var (
	// Flag vars
	Count       uint
	Interactive bool
	Interval    time.Duration
	Timeout     time.Duration
	Remote      snet.UDPAddr
)
View Source
var (
	LocalIA   addr.IA
	LocalIP   net.IP
	Conn      net.PacketConn
	Mtu       uint16
	PathEntry snet.Path
	Stats     *ScmpStats
	Start     time.Time
)

Functions

func Fatal

func Fatal(msg string, a ...interface{})

func NewSCMPPkt

func NewSCMPPkt(t scmp.Type, info scmp.Info, ext common.Extension) *spkt.ScnPkt

func NextHopAddr

func NextHopAddr() net.Addr

func ParseFlags

func ParseFlags(version *bool) string

func Rand

func Rand() uint64

func SetupSignals

func SetupSignals(f func())

func UpdatePktTS

func UpdatePktTS(pkt *spkt.ScnPkt, ts time.Time)

func Validate added in v0.4.0

func Validate(pkt *spkt.ScnPkt) (*scmp.Hdr, *scmp.Payload, error)

func ValidateFlags

func ValidateFlags()

Types

type ScmpStats

type ScmpStats struct {
	// sent is the number of sent packets
	Sent uint
	// recv is the number of received packets
	Recv uint
}

Jump to

Keyboard shortcuts

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