Documentation
¶
Overview ¶
Package vlan helps with creating transient VLAN network interfaces for testing purposes. It leverages the Ginkgo testing framework and matching (erm, sic!) Gomega matchers.
These VLAN 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
- func NewTransient(vid uint16, lnk netlink.Link, opts ...Opt) netlink.Link
- type Opt
- func InNamespace(fdref int) Opt
- func With8021AD() Opt
- func With8021Q() Opt
- func WithGVRP() Opt
- func WithLinkNamespace(fdref int) Opt
- func WithLooseBinding() Opt
- func WithMVRP() Opt
- func WithReorderingHeaders() Opt
- func WithTightBinding() Opt
- func WithoutGVRP() Opt
- func WithoutMVRP() Opt
- func WithoutReorderingHeaders() Opt
Constants ¶
const VlanPrefix = "vln-"
VlanPrefix is the name prefix used for transient VLAN network interfaces.
Variables ¶
This section is empty.
Functions ¶
func NewTransient ¶
NewTransient creates and returns a new (and transient) VLAN network interface with VLAN ID passed in vid, and attached to the specified network interface. NewTransient automatically defers proper automatic removal of the VLAN network interface.
Types ¶
type Opt ¶
Opt is a configuration option when creating a new VLAN network interface.
func InNamespace ¶
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 WithGVRP ¶
func WithGVRP() Opt
WithGVRP configures that this VLAN is to be registered using the GARP VLAN Registration Protocol.
func WithLinkNamespace ¶
WithLinkNamespace specifies the “reference” or “link” network namespace other than the current network namespace when creating a new network interface.
func WithLooseBinding ¶
func WithLooseBinding() Opt
WithLooseBinding configures the VLAN device state to be independent from the state of the bound network interface.
func WithMVRP ¶
func WithMVRP() Opt
WithMVRP configures that this VLAN is to be registered using the Multiple VLAN Registration Protocol.
func WithReorderingHeaders ¶
func WithReorderingHeaders() Opt
WithReorderingHeaders configures reordering of Ethernet headers.
func WithTightBinding ¶
func WithTightBinding() Opt
WithTightBinding configures the VLAN device state to be tightly coupled to the state of the bound network interface.
func WithoutGVRP ¶
func WithoutGVRP() Opt
WithoutGVRP configures that this VLAN must not be registered using the GARP VLAN Registration Protocol.
func WithoutMVRP ¶
func WithoutMVRP() Opt
WithoutMVRP configures that this VLAN must not be registered using the Multiple VLAN Registration Protocol.
func WithoutReorderingHeaders ¶
func WithoutReorderingHeaders() Opt
WithoutReorderingHeaders configures to not reorder Ethernet headers.