nic

package
v0.3.0-alpha.5 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2019 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Bond = iota
	Single

	// https://tools.ietf.org/html/rfc791
	MinimumMTU = 68
	MaximumMTU = 65536
)

TODO: Probably should put together some map here to map number with string()

Variables

This section is empty.

Functions

This section is empty.

Types

type NetworkInterface

type NetworkInterface struct {
	Ignore        bool
	Name          string
	Type          int
	MTU           uint32
	Index         uint32
	SubInterfaces []string
	AddressMethod []address.Addressing
}

NetworkInterface provides an abstract configuration representation for a network interface

func Create

func Create(link *net.Interface, setters ...Option) (*NetworkInterface, error)

Create returns a NetworkInterface with all of the given setter options applied

func (*NetworkInterface) IsIgnored

func (n *NetworkInterface) IsIgnored() bool

IsIgnored checks the network interface to see if it should be ignored and not configured

type Option

type Option func(*NetworkInterface) error

Option is the functional option func.

func WithAddressing

func WithAddressing(a address.Addressing) Option

WithAddressing defines how the addressing for a given interface should be configured

func WithIgnore

func WithIgnore() Option

WithIgnore indicates that the interface should not be processed by talos.

func WithIndex

func WithIndex(o uint32) Option

WithIndex sets the interface index

func WithMTU

func WithMTU(mtu uint32) Option

WithMTU defines the MTU for the interface TODO: I think we should drop this since MTU is getting set by address configuration method ( either via dhcp or config )

func WithName

func WithName(o string) Option

WithName sets the name of the interface to the given name.

func WithSubInterface

func WithSubInterface(o string) Option

WithSubInterface defines which interfaces make up the bond

func WithType

func WithType(o int) Option

WithType defines how the interface should be configured - bonded or single.

Jump to

Keyboard shortcuts

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