node

package
v0.0.0-...-a34aaee Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ZiffyHexa signs zi(0xff)y PTP packets
	ZiffyHexa = 0xff
	// Ipv6HeaderSize is ipv6 header size
	Ipv6HeaderSize = 40
	// UDPHeaderSize is udp header size
	UDPHeaderSize = 8
	// ICMPHeaderSize is icmp ipv6 header size
	ICMPHeaderSize = 8
	// PTPUnusedSize received from sender
	PTPUnusedSize = 10
)
View Source
const (
	// Promiscuous sets the pcap handle promiscuous flag
	Promiscuous = false
	// RecvTimeout sets the resolution for the listener
	RecvTimeout = 1 * time.Microsecond
	// SnapshotLen sets max length of packets
	SnapshotLen = 1024
)
View Source
const (
	// RackMaskBits identifies the rack ipv6 prefix
	RackMaskBits = 64
	// FaceHexaTop is the upper byte of 0xface
	FaceHexaTop = 0xfa
	// FaceHexaBot is the lower byte of 0xface
	FaceHexaBot = 0xce
	// LLDPTypeStr Ether type string
	LLDPTypeStr = "0x88cc"
)

Variables

This section is empty.

Functions

func CsvPrint

func CsvPrint(routes []PathInfo, path string, cfThreshold ptp.Correction)

CsvPrint outputs the data in a csv file

func PrettyPrint

func PrettyPrint(routes []PathInfo, cfThreshold ptp.Correction)

PrettyPrint formats and prints the output to stdout

Types

type Config

type Config struct {
	Mode               string
	LogLevel           string
	Device             string
	CsvFile            string
	DestinationAddress string
	DestinationPort    int
	SourcePort         int
	PortCount          int
	HopMax             int
	HopMin             int
	IPCount            int
	DSCP               int
	PTPRecvHandlers    int
	ContReached        bool
	IcmpTimeout        time.Duration
	MessageType        ptp.MessageType
	LLDPWaitTime       time.Duration
	IcmpReplyTime      time.Duration

	// QueueCap used to store ICMP messages. Capacity is the number of late messages
	// stored until the queue is cleared. After each traceRoute, sender clears the queue.
	// For worst case scenario maximum capacity should be (HopMax - HopMin + 1) * PortCount * IPCount
	QueueCap int
}

Config is the Ziffy config struct

type PathInfo

type PathInfo struct {
	// contains filtered or unexported fields
}

PathInfo contains the list of switches in a path

type Receiver

type Receiver struct {
	Config *Config

	*sync.Mutex
	// contains filtered or unexported fields
}

Receiver listens for PTP packets

func (*Receiver) Start

func (r *Receiver) Start() error

Start listens for PTP packets and reply to sender

type Sender

type Sender struct {
	Config *Config
	// contains filtered or unexported fields
}

Sender sweeps the network with PTP packets

func (*Sender) Start

func (s *Sender) Start() ([]PathInfo, error)

Start sending PTP packets

type SwitchPrintInfo

type SwitchPrintInfo struct {
	// contains filtered or unexported fields
}

SwitchPrintInfo contains print information for switches

type SwitchTrafficInfo

type SwitchTrafficInfo struct {
	// contains filtered or unexported fields
}

SwitchTrafficInfo contains information about a switch

Jump to

Keyboard shortcuts

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