Documentation ¶
Overview ¶
Package network implements adapters wrapping resources/network to provide additional functionality.
Index ¶
- func BondMasterSpec(r *network.BondMasterSpec) bondMaster
- func BridgeMasterSpec(r *network.BridgeMasterSpec) bridgeMaster
- func BuildIPSet(include, exclude []netip.Prefix) (*netipx.IPSet, error)
- func NfTablesRule(r *network.NfTablesRule) nftablesRule
- func SplitIPSet(set *netipx.IPSet) (ipv4, ipv6 []netipx.IPRange)
- func VLANSpec(r *network.VLANSpec) vlanSpec
- func WireguardSpec(r *network.WireguardSpec) wireguardSpec
- type NfTablesCompiled
- type NfTablesSet
- type SetKind
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BondMasterSpec ¶
func BondMasterSpec(r *network.BondMasterSpec) bondMaster
BondMasterSpec adapter provides encoding/decoding to netlink structures.
func BridgeMasterSpec ¶
func BridgeMasterSpec(r *network.BridgeMasterSpec) bridgeMaster
BridgeMasterSpec adapter provides encoding/decoding to netlink structures.
func BuildIPSet ¶ added in v1.6.0
BuildIPSet builds an IPSet from the given include and exclude prefixes.
func NfTablesRule ¶ added in v1.6.0
func NfTablesRule(r *network.NfTablesRule) nftablesRule
NfTablesRule adapter provides encoding to nftables instructions.
func SplitIPSet ¶ added in v1.6.0
SplitIPSet splits the given IPSet into IPv4 and IPv6 ranges.
func WireguardSpec ¶
func WireguardSpec(r *network.WireguardSpec) wireguardSpec
WireguardSpec adapter provides encoding/decoding to netlink structures.
Types ¶
type NfTablesCompiled ¶ added in v1.6.0
type NfTablesCompiled struct { Rules [][]expr.Any Sets []NfTablesSet }
NfTablesCompiled is a compiled representation of the rule.
type NfTablesSet ¶ added in v1.6.0
type NfTablesSet struct { Kind SetKind Addresses []netipx.IPRange Ports [][2]uint16 Strings [][]byte ConntrackStates []nethelpers.ConntrackState }
NfTablesSet is a compiled representation of the set.
func (NfTablesSet) IsInterval ¶ added in v1.6.0
func (set NfTablesSet) IsInterval() bool
IsInterval returns true if the set is an interval set.
func (NfTablesSet) KeyType ¶ added in v1.6.0
func (set NfTablesSet) KeyType() nftables.SetDatatype
KeyType returns the type of the set.
func (NfTablesSet) SetElements ¶ added in v1.6.0
func (set NfTablesSet) SetElements() []nftables.SetElement
SetElements returns the set elements.