results

package
v0.4.3-0...-b136db8 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: BSD-2-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ICMP

type ICMP struct {
	Code        uint8           `json:"code"`
	Type        uint8           `json:"type"`
	Description string          `json:"description"`
	Extensions  []ICMPExtension `json:"extensions"`
	MPLSLabels  []MPLSLabel     `json:"mpls_labels"`
}

ICMP represents some information from the ICMP header.

type ICMPExtension

type ICMPExtension struct {
	Class   uint8  `json:"class"`
	Type    uint8  `json:"type"`
	Payload []byte `json:"payload"`
	Size    uint8  `json:"size"`
}

ICMPExtension represents the ICMP extension header.

type IP

type IP struct {
	SrcIP net.IP `json:"src"`
	DstIP net.IP `json:"dst"`
	ID    uint16 `json:"id"`
	TTL   uint8  `json:"ttl"`
}

IP represents some information from the IP header.

type MPLSLabel

type MPLSLabel struct {
	BottomOfStack uint8  `json:"bottom_of_stack"`
	Experimental  uint8  `json:"experimental"`
	Label         uint32 `json:"label"`
	TTL           uint8  `json:"ttl"`
}

MPLSLabel represents an MPLS label in an ICMP header.

type Packet

type Packet struct {
	Timestamp UnixUsec `json:"timestamp"`
	IP        IP       `json:"ip"`
	UDP       *UDP     `json:"udp,omitempty"`
	ICMP      *ICMP    `json:"icmp,omitempty"`
}

Packet represents some information of a sent or received packet.

type Probe

type Probe struct {
	Flowhash             uint16  `json:"flowhash"`
	IsLast               bool    `json:"is_last"`
	Name                 string  `json:"name"`
	NATID                uint16  `json:"nat_id"`
	RttUsec              uint64  `json:"rtt_usec"`
	Sent                 Packet  `json:"sent"`
	Received             *Packet `json:"received"`
	ZeroTTLForwardingBug bool    `json:"zerottl_forwarding_bug"`
}

Probe holds information about a dublin-traceroute probe.

type Results

type Results struct {
	Flows map[uint16][]Probe `json:"flows"`
	// contains filtered or unexported fields
}

Results is the main container type for a dublin-traceroute set of results.

func (*Results) ToDOT

func (r *Results) ToDOT() (string, error)

ToDOT encodes a Results object to a DOT file suitable for GraphViz

func (*Results) ToJSON

func (r *Results) ToJSON(compress bool, indent string) (string, error)

ToJSON encodes a Results object to a JSON string.

type UDP

type UDP struct {
	SrcPort uint16 `json:"sport"`
	DstPort uint16 `json:"dport"`
}

UDP represents some information from the UDP header.

type UnixUsec

type UnixUsec time.Time

UnixUsec is UNIX time in the form sec.usec

func (UnixUsec) MarshalJSON

func (um UnixUsec) MarshalJSON() ([]byte, error)

MarshalJSON serializes an UnixUsec object into a seconds.microseconds representation.

func (*UnixUsec) UnmarshalJSON

func (um *UnixUsec) UnmarshalJSON(b []byte) error

UnmarshalJSON deserializes a seconds.microseconds timestamp into an UnixUsec object. The timestamp can be optionally surrounded by double quotes.

Jump to

Keyboard shortcuts

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