vxlan

package
v1.13.2 Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package vxlan helps with creating transient VXLAN network interfaces for testing purposes. It leverages the Ginkgo testing framework and matching (erm, sic!) Gomega matchers.

These VXLAN network interfaces are transient because they automatically get removed at the end of the a test (spec, block/group, suite, et cetera) using Ginkgo's DeferCleanup.

Index

Constants

View Source
const VxlanPrefix = "vxl-"

VxlanPrefix is the name prefix used for transient VXLAN network interfaces.

Variables

This section is empty.

Functions

func NewTransient

func NewTransient(underlay netlink.Link, opts ...Opt) netlink.Link

NewTransient creates and returns a new (and transient) VXLAN network interface attached to the specified underlay network interface (which must be a hardware network interface, including the dummy kind). NewTransient automatically defers proper automatic removal of the VXLAN network interface.

Types

type Opt

type Opt func(*link.Link) error

Opt is a configuration option when creating a new VXLAN network interface.

func InNamespace

func InNamespace(fdref int) Opt

InNamespace configures a VXLAN network interface to be created in the network namespace referenced by fdref, instead of creating it in the current network namespace.

func WithDestinationPort

func WithDestinationPort(port uint16) Opt

WithDestinationPort configures the UDP destination port for communicating to the remote VXLAN tunnel endpoint.

func WithID

func WithID(id int) Opt

WithID configures the VXLAN ID.

func WithLinkNamespace

func WithLinkNamespace(fdref int) Opt

WithLinkNamespace specifies the “reference” or “link” network namespace other than the current network namespace when creating a new network interface.

func WithSourcePorts

func WithSourcePorts(minport, maxport uint16) Opt

WithSourcePorts configures the range of port numbers to use as UDP source ports when communicating to the remote VXLAN tunnel endpoint.

func WithTTL

func WithTTL(ttl uint8) Opt

WithTTL configures the TTL value to use in outgoing packets.

Jump to

Keyboard shortcuts

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