probe

package
v1.0.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package probe runs network measurements and knows nothing about the central.

Index

Constants

View Source
const DenyNone = "none"

DenyNone is the --deny value that denies nothing.

Variables

View Source
var DefaultDeny = []string{
	"127.0.0.0/8", "::1/128",
	"169.254.0.0/16", "fe80::/10",
	"0.0.0.0/8", "::/128",
	"224.0.0.0/4", "ff00::/8",

	"100.100.100.200/32", "192.0.0.192/32", "168.63.129.16/32", "fd00:ec2::254/128",
}

DefaultDeny are the ranges an edge never connects to unless told otherwise: loopback, link-local, unspecified, multicast and the metadata services of the clouds. Private ranges are allowed: probing an intranet is the point.

Functions

This section is empty.

Types

type Outcome added in v1.1.0

type Outcome struct {
	OK  bool
	RTT time.Duration
	Err string
}

Outcome is the result of one measurement.

type Policy added in v1.1.0

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

Policy lists the address ranges a probe must not connect to. The zero value denies nothing.

func DefaultPolicy added in v1.1.0

func DefaultPolicy() Policy

DefaultPolicy is the policy of DefaultDeny.

func ParseDeny added in v1.1.0

func ParseDeny(value string) (Policy, error)

ParseDeny reads CIDR ranges separated by commas, or "none".

func ParsePolicy added in v1.1.0

func ParsePolicy(cidrs []string) (Policy, error)

ParsePolicy builds a policy from CIDR prefixes.

func (Policy) Control added in v1.1.0

func (p Policy) Control(_, address string, _ syscall.RawConn) error

Control is a net.Dialer hook. It sees the address that is about to be dialed, after name resolution, so it also covers redirects and DNS answers that point at a denied range.

func (Policy) Denies added in v1.1.0

func (p Policy) Denies(ip netip.Addr) bool

Denies reports whether the policy forbids connecting to ip.

type Prober

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

Prober runs measurements. Every connection it opens goes through the policy.

func New

func New(policy Policy, timeout time.Duration) *Prober

New builds a prober whose measurements stop after timeout.

func (*Prober) HTTP added in v1.1.0

func (p *Prober) HTTP(ctx context.Context, target string) Outcome

HTTP measures the time until the response headers of a GET arrive. A status of 400 or more is a failure.

func (*Prober) TCP added in v1.1.0

func (p *Prober) TCP(ctx context.Context, target string) Outcome

TCP measures the time to open a connection to host:port.

Jump to

Keyboard shortcuts

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