dataplanetest

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package dataplanetest runs a data plane for the tests of what rides it: a node of the smallest topology that carries SCION packets, one internal and one external link, on loopback sockets of the caller's host. Two nodes started with each other's external addresses share a direct link, so traffic crosses the data plane exactly as between two deployed nodes.

Index

Constants

View Source
const IfID = 1

IfID is the interface ID of every node's external link.

Variables

This section is empty.

Functions

func FreeUDPAddr

func FreeUDPAddr(t testing.TB, host netip.Addr) string

FreeUDPAddr returns a UDP address on host with a port picked by the kernel and released for the caller's bind. Each package's tests reserve on a loopback host of their own: go test runs the packages in parallel, and on a shared host a released reservation could be taken before its rebind.

Types

type Node

type Node struct {
	// IA is the node's ISD-AS, and Neighbor the ISD-AS across its link.
	IA, Neighbor addr.IA
	// ControlIP is the host the node's sockets bind, and Internal the
	// internal link's address they send through.
	ControlIP netip.Addr
	Internal  string
	// MACKey is the node's forwarding key, which the sockets' one-hop
	// paths are authenticated with.
	MACKey []byte
	// Provider is the node's underlay, which holds its service table.
	Provider *dataplane.UDPProvider
}

Node is one running node and the facts a SCION socket of it needs.

func StartNode

func StartNode(t *testing.T, host netip.Addr, ia, neighbor addr.IA, extLocal, extRemote string) *Node

StartNode starts a node on host; extRemote must be the neighbor node's extLocal. The node serves until the test ends.

func (n *Node) Links() *bus.Topic[bus.LinkState]

Links returns a link state topic holding the node's one external link up, for its sockets.

func (*Node) MapService

func (n *Node) MapService(t testing.TB, svc addr.SVC, port uint16)

MapService registers svc at port on the node's host, where the data plane's service routing delivers what is addressed to the service.

Jump to

Keyboard shortcuts

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