options

package
v2.11.2 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SouthBound = Group(g.DeviceGroupSouthBound)
	NorthBound = Group(g.DeviceGroupNorthBound)
)
View Source
const HostNamespace = ExistingNetworkNamespace("host")

HostNamespace creates the node using the network namespace of the calling process

Variables

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

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

Functions

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 aging 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 ExistingNetworkNamespace added in v2.10.0

type ExistingNetworkNamespace string

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

func (ExistingNetworkNamespace) ApplyBaseNode added in v2.10.0

func (e ExistingNetworkNamespace) 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 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 *g.BaseNode)

func (RedirectToLog) ApplyCmd

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

func (RedirectToLog) ApplyNetwork

func (l RedirectToLog) ApplyNetwork(n *g.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 Slice added in v2.10.0

type Slice string

Slice set the systemd slice / CGroup in which all processes of this node, network or command are started.

func (Slice) ApplyBaseNode added in v2.10.0

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

func (Slice) ApplyCmd added in v2.10.0

func (e Slice) ApplyCmd(c *g.Cmd)

func (Slice) ApplyNetwork added in v2.10.0

func (e Slice) ApplyNetwork(n *g.Network)

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