options

package
v2.4.2 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package options contains all the general options for configuring the general objects like hosts, switches, routers and interfaces

Index

Constants

View Source
const (
	SouthBound = Group(g.DeviceGroupSouthBound)
	NorthBound = Group(g.DeviceGroupNorthBound)
)

Variables

View Source
var BuildFlagsDebug = GoBuildFlags{"-gcflags", "-N -l"} //nolint:gochecknoglobals

BuildFlagsDebug builds the Go binary without compiler optimizations like inlining to improve debugging.

Functions

func Customize

func Customize[T any](opts []T, extraOptions ...T) []T

Customize clones and extends a list of options without altering the list of base options.

func Filter

func Filter(h g.FilterHook, stmts ...filters.Statement) g.FilterRule

Types

type Address

type Address net.IPNet

Address assigns an network address (IP layer) to the interface.

func AddressIP

func AddressIP(fmts string, args ...any) Address

func AddressIPv4

func AddressIPv4(a, b, c, d byte, m int) Address

func (Address) ApplyInterface

func (a Address) ApplyInterface(i *g.Interface)

type AgingTime

type AgingTime time.Duration

AgingTime configures the bridge's FDB entries ageing time, ie the number of seconds a MAC address will be kept in the FDB after a packet has been received from that address. After this time has passed, entries are cleaned up.

func (AgingTime) ApplyBridge

func (at AgingTime) ApplyBridge(b *nl.Bridge)

type EmptyDir

type EmptyDir string

Mount an empty dir to shadow parts of the root filesystem

func (EmptyDir) ApplyBaseNode

func (ed EmptyDir) ApplyBaseNode(n *g.BaseNode)

type ExistingDockerContainer

type ExistingDockerContainer string

Name of an existing Docker container which is used for this node

func (ExistingDockerContainer) ApplyBaseNode

func (d ExistingDockerContainer) ApplyBaseNode(n *g.BaseNode)

type ExistingNamespace

type ExistingNamespace string

The name of an existing network namespace which is used instead of creating a new one.

func (ExistingNamespace) ApplyBaseNode

func (e ExistingNamespace) ApplyBaseNode(n *g.BaseNode)

type FullyRandomNAT

type FullyRandomNAT bool

func (FullyRandomNAT) ApplyNAT

func (frn FullyRandomNAT) ApplyNAT(n *g.NAT)

type GoBuildFlags

type GoBuildFlags []string

func BuildFlags

func BuildFlags(flags ...string) GoBuildFlags

func (GoBuildFlags) ApplyGoBuildFlags

func (bf GoBuildFlags) ApplyGoBuildFlags(d *g.GoBuildFlags)

type Group

type Group g.DeviceGroup
func (h Group) ApplyLink(la *nl.LinkAttrs)

type HardwareAddress

type HardwareAddress net.HardwareAddr

func AddressMAC

func AddressMAC(s string) HardwareAddress

func AddressMACBytes

func AddressMACBytes(b []byte) HardwareAddress
func (a HardwareAddress) ApplyLink(la *nl.LinkAttrs)

type HelloTime

type HelloTime time.Duration

HelloTime sets the time in seconds between hello packets sent by the bridge, when it is a root bridge or a designated bridges. Only relevant if STP is enabled. Valid values are between 1 and 10 seconds.

func (HelloTime) ApplyBridge

func (ht HelloTime) ApplyBridge(b *nl.Bridge)

type MTU

type MTU int
func (m MTU) ApplyLink(la *nl.LinkAttrs)

type MulticastSnooping

type MulticastSnooping bool

MulticastSnooping configures multicast snooping.

func (MulticastSnooping) ApplyBridge

func (mcs MulticastSnooping) ApplyBridge(b *nl.Bridge)

type NSPrefix

type NSPrefix string

func (NSPrefix) ApplyNetwork

func (pfx NSPrefix) ApplyNetwork(n *g.Network)

type Netem

type Netem nl.NetemQdiscAttrs

func WithNetem

func WithNetem(opts ...NetemOption) Netem

func (Netem) ApplyInterface

func (ne Netem) ApplyInterface(p *g.Interface)

type NetemOption

type NetemOption interface {
	ApplyNetem(n *Netem)
}

type PeerHardwareAddress

type PeerHardwareAddress net.HardwareAddr

func (PeerHardwareAddress) ApplyVeth

func (p PeerHardwareAddress) ApplyVeth(v *nl.Veth)

type Persistent

type Persistent bool

Persistent keeps a network from being torn down.

func (Persistent) ApplyNetwork

func (p Persistent) ApplyNetwork(n *g.Network)

type PersistentNAT

type PersistentNAT bool

func (PersistentNAT) ApplyNAT

func (pn PersistentNAT) ApplyNAT(n *g.NAT)

type RandomNAT

type RandomNAT bool

func (RandomNAT) ApplyNAT

func (rn RandomNAT) ApplyNAT(n *g.NAT)

type RedirectToLog

type RedirectToLog bool

Redirect output of sub-processes to log

func (RedirectToLog) ApplyBaseNode

func (l RedirectToLog) ApplyBaseNode(n *gont.BaseNode)

func (RedirectToLog) ApplyCmd

func (l RedirectToLog) ApplyCmd(c *gont.Cmd)

func (RedirectToLog) ApplyNetwork

func (l RedirectToLog) ApplyNetwork(n *gont.Network)

type Route

type Route struct {
	nl.Route
}

func DefaultGatewayIP

func DefaultGatewayIP(fmts string, args ...any) Route

func DefaultGatewayIPv4

func DefaultGatewayIPv4(a, b, c, d byte) Route

func RouteNet

func RouteNet(network net.IPNet, gw net.IP) Route

func (Route) ApplyHost

func (r Route) ApplyHost(h *g.Host)

type SourcePortRange

type SourcePortRange struct {
	Min int
	Max int
}

func (SourcePortRange) ApplyNAT

func (spr SourcePortRange) ApplyNAT(n *g.NAT)

type Tbf

type Tbf nl.Tbf

func WithTbf

func WithTbf(opts ...TbfOption) Tbf

func (Tbf) ApplyInterface

func (tbf Tbf) ApplyInterface(p *g.Interface)

type TbfOption

type TbfOption interface {
	ApplyTbf(t *Tbf)
}

type TxQLen

type TxQLen int
func (l TxQLen) ApplyLink(la *nl.LinkAttrs)

type VLANFiltering

type VLANFiltering bool

VLANfiltering configures VLAN filtering. When disabled, the bridge will not consider the VLAN tag when handling packets

func (VLANFiltering) ApplyBridge

func (vf VLANFiltering) ApplyBridge(b *nl.Bridge)

Directories

Path Synopsis
Package capture contains the options to configure to packet capturing
Package capture contains the options to configure to packet capturing
Package filters contains the options for configuring NFTables filtering
Package filters contains the options for configuring NFTables filtering
Package tc contains the options for configuring per-interface Traffic Control (TC) queuing disciplines
Package tc contains the options for configuring per-interface Traffic Control (TC) queuing disciplines

Jump to

Keyboard shortcuts

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