cases

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BrTransit

func BrTransit(payload string, mac hash.Hash) (string, string, []byte)

BrTransit generates one packet of "br_transit" traffic over the router under test. The outcome is a raw packet which the test must feed to the router. The flowID field is 0.

func DeviceName

func DeviceName(AS int, intf int) string

interfaceName returns the name of the host interface that this test must use in order to exchange traffic with the interface designated by the given AS and interface indices.

func FakeMAC

func FakeMAC(AS byte) hash.Hash

func HostAddr

func HostAddr(ip netip.Addr) addr.Host

hostAddr returns a the SCION Hosts addresse that corresponds to the given underlay address. Except for SVC addresses (which we do not support here), this is a restating of the underlay address.

func ISDAS

func ISDAS(AS byte) addr.IA

isdAS returns a complete string form ISD/AS number for the given AS index. All are in ISD-1, except AS 4.

func In

func In(payload string, mac hash.Hash) (string, string, []byte)

oneIn generates one packet of incoming traffic into AS1 at br1a. The outcome is a raw packet that the test must feed into the router. The flow ID is 0.

func InTransit

func InTransit(payload string, mac hash.Hash) (string, string, []byte)

oneInTransit generates one packet of "in_transit" traffic over the router under test. The outcome is a raw packet that the test must feed into the router. The flow ID is 0.

func InitInterfaces

func InitInterfaces(pairs []string)

InitInterfaces collects the names and mac addresses for the interfaces setup by the invoker according to instructions given via listInterfaces(). This information is indexed by our own interface labels.

func InternalIP

func InternalIP(AS byte, routerIndex byte) netip.Addr

internalIP returns the IP address that is assigned to the internal interface of the given router in the AS of the given index.

func InternalIPPort

func InternalIPPort(AS byte, routerIndex byte) (netip.Addr, layers.UDPPort)

internalIPPort returns internalIP and the UDPPort to go with.

func ListInterfaces

func ListInterfaces() string

ListInterfaces outputs a string describing the interfaces of the router under test. The invoker of this test gets this when using the show-interfaces command and is expected to set up the network accordingly before executing the test without that option. We do not choose interface names or mac addresses those will be provided by the invoker via the --interfaces options.

func MACAddr

func MACAddr(ip netip.Addr) net.HardwareAddr

macAddr returns the mac address assigned to the interface that has the given IP address. if that address is imposed by our environment it is listed in the macAddrs map and that is what this function returns. Else, the address is made-up according to our scheme.

func Out

func Out(payload string, mac hash.Hash) (string, string, []byte)

oneOut generates one packet of outgoing traffic from AS1 at br1a. The outcome is a raw packet that the test must feed into the router. The flow ID is 0.

func OutTransit

func OutTransit(payload string, mac hash.Hash) (string, string, []byte)

oneOutTransit generates one packet of "out_transit" traffic over the router under test. The outcome is a raw packet that the test must feed to the router. The flow ID is 0.

func PublicIP

func PublicIP(localAS byte, remoteAS byte) netip.Addr

publicIP returns the IP address that is assigned to external interface designated by the given AS index and the peer AS (that is, the AS that this interface connects to). Per our scheme, the subnet number is the largest of the two AS numbers and the host is always the local AS. This works if there are no cycles. Else there could be subnet number collisions.

func PublicIPPort

func PublicIPPort(localAS byte, remoteAS byte) (netip.Addr, layers.UDPPort)

publicIP returns the IP address that is assigned to external interface designated by the given AS index and the peer AS, plus the port to go with.

func Underlay

func Underlay(
	srcIP netip.Addr,
	srcPort layers.UDPPort,
	dstIP netip.Addr,
	dstPort layers.UDPPort) (*layers.Ethernet, *layers.IPv4, *layers.UDP)

Types

This section is empty.

Jump to

Keyboard shortcuts

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