payload

package module
v0.71.1-rc.1 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2025 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Overview

Package payload contains Network Path payload

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPathtraceID

func NewPathtraceID() string

NewPathtraceID creates a new pathtrace id

Types

type ICMPMode added in v0.71.0

type ICMPMode string

ICMPMode determines whether dynamic paths will run ICMP traceroutes for TCP/UDP traffic (instead of TCP/UDP traceroutes)

const (
	// ICMPModeNone means to never use ICMP in dynamic path
	ICMPModeNone ICMPMode = "none"
	// ICMPModeTCP means to replace TCP traceroutes with ICMP
	ICMPModeTCP ICMPMode = "tcp"
	// ICMPModeUDP means to replace UDP traceroutes with ICMP
	ICMPModeUDP ICMPMode = "udp"
	// ICMPModeAll means to replace all traceroutes with ICMP
	ICMPModeAll ICMPMode = "all"
)
const ICMPDefaultMode ICMPMode = ICMPModeNone

ICMPDefaultMode is what mode to use when nothing is specified

func MakeICMPMode added in v0.71.0

func MakeICMPMode(method string) ICMPMode

MakeICMPMode converts config strings into ICMPModes

func (ICMPMode) ShouldUseICMP added in v0.71.0

func (m ICMPMode) ShouldUseICMP(protocol Protocol) bool

ShouldUseICMP returns whether ICMP mode should overwrite the given protocol

type NetworkPath

type NetworkPath struct {
	Timestamp    int64                  `json:"timestamp"`
	AgentVersion string                 `json:"agent_version"`
	Namespace    string                 `json:"namespace"` // namespace used to resolve NDM resources
	PathtraceID  string                 `json:"pathtrace_id"`
	Origin       PathOrigin             `json:"origin"`
	Protocol     Protocol               `json:"protocol"`
	Source       NetworkPathSource      `json:"source"`
	Destination  NetworkPathDestination `json:"destination"`
	Hops         []NetworkPathHop       `json:"hops"`
	Tags         []string               `json:"tags,omitempty"`
}

NetworkPath encapsulates data that defines a path between two hosts as mapped by the agent

type NetworkPathDestination

type NetworkPathDestination struct {
	Hostname           string `json:"hostname"`
	IPAddress          string `json:"ip_address"`
	Port               uint16 `json:"port"`
	Service            string `json:"service,omitempty"`
	ReverseDNSHostname string `json:"reverse_dns_hostname,omitempty"`
}

NetworkPathDestination encapsulates information about the destination of a path

type NetworkPathHop

type NetworkPathHop struct {
	TTL       int    `json:"ttl"`
	IPAddress string `json:"ip_address"`

	// hostname is the reverse DNS of the ip_address
	// TODO (separate PR): we might want to rename it to reverse_dns_hostname for consistency with destination.reverse_dns_hostname
	Hostname string `json:"hostname,omitempty"`

	RTT       float64 `json:"rtt,omitempty"`
	Reachable bool    `json:"reachable"`
}

NetworkPathHop encapsulates the data for a single hop within a path

type NetworkPathSource

type NetworkPathSource struct {
	Hostname    string       `json:"hostname"`
	Via         *payload.Via `json:"via,omitempty"`
	NetworkID   string       `json:"network_id,omitempty"` // Today this will be a VPC ID since we only resolve AWS resources
	Service     string       `json:"service,omitempty"`
	ContainerID string       `json:"container_id,omitempty"`
}

NetworkPathSource encapsulates information about the source of a path

type PathOrigin

type PathOrigin string

PathOrigin origin of the path e.g. network_traffic, network_path_integration

const (
	// PathOriginNetworkTraffic correspond to traffic from network traffic (NPM).
	PathOriginNetworkTraffic PathOrigin = "network_traffic"
	// PathOriginNetworkPathIntegration correspond to traffic from network_path integration.
	PathOriginNetworkPathIntegration PathOrigin = "network_path_integration"
)

type Protocol

type Protocol string

Protocol defines supported network protocols Please define new protocols based on the Keyword from: https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml

const (
	// ProtocolTCP is the TCP protocol.
	ProtocolTCP Protocol = "TCP"
	// ProtocolUDP is the UDP protocol.
	ProtocolUDP Protocol = "UDP"
	// ProtocolICMP is the ICMP protocol.
	ProtocolICMP Protocol = "ICMP"
)

type TCPMethod added in v0.66.0

type TCPMethod string

TCPMethod is the method used to run a TCP traceroute.

const (
	// TCPConfigSYN means to only perform SYN traceroutes
	TCPConfigSYN TCPMethod = "syn"
	// TCPConfigSACK means to only perform SACK traceroutes
	TCPConfigSACK TCPMethod = "sack"
	// TCPConfigPreferSACK means to try SACK, and fall back to SYN if the remote doesn't support SACK
	TCPConfigPreferSACK TCPMethod = "prefer_sack"
	// TCPConfigSYNSocket means to use a SYN with TCP socket options to perform the traceroute (windows only)
	TCPConfigSYNSocket TCPMethod = "syn_socket"
)
const TCPDefaultMethod TCPMethod = TCPConfigSYN

TCPDefaultMethod is what method to use when nothing is specified

func MakeTCPMethod added in v0.66.0

func MakeTCPMethod(method string) TCPMethod

MakeTCPMethod converts a TCP traceroute method from config into a TCPMethod

Jump to

Keyboard shortcuts

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