options

package
v1.6.4 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2023 License: Apache-2.0 Imports: 7 Imported by: 2

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

This section is empty.

Functions

func Capture added in v1.2.0

func Capture(opts ...g.Option) *g.Capture

func Customize added in v1.5.0

func Customize(opts []g.Option, extraOptions ...g.Option) []g.Option

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

func Filter added in v0.3.0

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

func Interface

func Interface(name string, opts ...g.Option) *g.Interface

Types

type Address

type Address net.IPNet

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

func AddressIP added in v0.1.0

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

func AddressIPv4

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

func (Address) Apply

func (a Address) Apply(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) Apply

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

type CaptureNetwork added in v1.2.0

type CaptureNetwork struct {
	*g.Capture
}

func CaptureAll added in v1.2.0

func CaptureAll(opts ...g.Option) CaptureNetwork

func (CaptureNetwork) Apply added in v1.2.0

func (c CaptureNetwork) Apply(n *g.Network)

type EmptyDir added in v1.4.0

type EmptyDir string

Mount an empty dir to shadow parts of the root filesystem

func (EmptyDir) Apply added in v1.4.0

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

type ExistingDockerContainer added in v0.1.0

type ExistingDockerContainer string

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

func (ExistingDockerContainer) Apply added in v0.1.0

func (d ExistingDockerContainer) Apply(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) Apply

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

type ExtraEnv added in v1.6.0

type ExtraEnv struct {
	Name  string
	Value any
}

Extra environment variable for processes started in the nodes network namespace

func (ExtraEnv) Apply added in v1.6.0

func (ev ExtraEnv) Apply(n *g.BaseNode)

type FullyRandomNAT added in v1.5.0

type FullyRandomNAT bool

func (FullyRandomNAT) Apply added in v1.5.0

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

type Group

type Group g.DeviceGroup

func (Group) Apply

func (h Group) Apply(p *g.Interface)

type HardwareAddress

type HardwareAddress net.HardwareAddr

func AddressMAC added in v0.2.0

func AddressMAC(s string) HardwareAddress

func AddressMACBytes added in v0.2.0

func AddressMACBytes(b []byte) HardwareAddress

func (HardwareAddress) Apply

func (a HardwareAddress) Apply(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) Apply

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

type LogToDebug added in v1.1.0

type LogToDebug bool

Log output of sub-processes to debug log-level

func (LogToDebug) Apply added in v1.1.0

func (l LogToDebug) Apply(n *g.BaseNode)

type MTU

type MTU int

func (MTU) Apply

func (m MTU) Apply(la *nl.LinkAttrs)

type MulticastSnooping

type MulticastSnooping bool

MulticastSnooping configures multicast snooping.

func (MulticastSnooping) Apply

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

type NSPrefix added in v0.1.0

type NSPrefix string

func (NSPrefix) Apply added in v0.1.0

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

type Netem added in v0.1.0

type Netem nl.NetemQdiscAttrs

func WithNetem added in v0.1.0

func WithNetem(opts ...NetemOption) Netem

func (Netem) Apply added in v0.1.0

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

type NetemOption added in v0.1.0

type NetemOption interface {
	Apply(n *Netem)
}

type PeerHardwareAddress

type PeerHardwareAddress net.HardwareAddr

func (PeerHardwareAddress) Apply added in v0.1.0

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

type Persistent

type Persistent bool

Persistent keeps a network from beeing torn down.

func (Persistent) Apply

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

type PersistentNAT added in v1.5.0

type PersistentNAT bool

func (PersistentNAT) Apply added in v1.5.0

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

type RandomNAT added in v1.5.0

type RandomNAT bool

func (RandomNAT) Apply added in v1.5.0

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

type Route added in v0.2.3

type Route struct {
	nl.Route
}

func DefaultGatewayIP added in v0.2.3

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

func DefaultGatewayIPv4 added in v0.2.3

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

func RouteNet added in v1.6.2

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

func (Route) Apply added in v1.6.2

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

type SourcePortRange added in v1.5.0

type SourcePortRange struct {
	Min int
	Max int
}

func (SourcePortRange) Apply added in v1.5.0

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

type Tbf added in v0.1.0

type Tbf nl.Tbf

func WithTbf added in v0.1.0

func WithTbf(opts ...TbfOption) Tbf

func (Tbf) Apply added in v0.1.0

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

type TbfOption added in v0.1.0

type TbfOption interface {
	Apply(t *Tbf)
}

type TxQLen added in v0.2.0

type TxQLen int

func (TxQLen) Apply added in v0.2.0

func (l TxQLen) Apply(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) Apply

func (vf VLANFiltering) Apply(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