wired

package
v0.0.0-...-2269899 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration8021x

type Configuration8021x struct {
	// Name is used to identify the configuration.
	Name string

	// 802.1x configuration field.
	EAP           string
	KeyManagement string
	Identity      string
	Password      string
	Phase1        string
	Phase2        string
	CaCert        []byte
	ClientCert    []byte
	PrivKey       []byte
	PrivKeyPasswd string
}

Configuration8021x represents authentication information for a wired network with 802.1x.

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager is used to manage a wired network interface.

func NewManager

func NewManager(ifname string) (*Manager, error)

NewManager returns a Manager for a specified wired interface.

func (*Manager) Authenticate8021x

func (m *Manager) Authenticate8021x(cfg Configuration8021x) (State, error)

func (*Manager) Close

func (m *Manager) Close() error

func (*Manager) IPAddress

func (m *Manager) IPAddress() string

IPAddress returns a dotted decimal string representation of the Interface's IP address. If it has no IP, an empty string is returned.

func (*Manager) IfaceName

func (m *Manager) IfaceName() string

IfaceName returns the name of the network interface managed by a Manager

func (*Manager) OperState

func (m *Manager) OperState() OperState

func (*Manager) State

func (m *Manager) State() State

State returns the current state of the network interface managed by manager.

type OperState

type OperState int32

OperState represents the operational state of the wired interface as per RFC2863.

const (
	// OperStateInvalid represents an OperState that is not defined.
	OperStateInvalid OperState = iota
	OperStateUnknown
	OperStateDown
	OperStateUp
	OperStateNotPresent
	OperStateLowerLayerDown
	OperStateTesting
	OperStateDormant
)

func (OperState) String

func (o OperState) String() string

String returns the string representation of OperState in the same manner as the Linux sysfs.If OperState is not a defined constant, String returns "<invalid>".

type State

type State int32

State represents a connection state when the operational state is "up", i.e. OperStateUp.

const (
	Disconnected State = iota
	Connected
	Connecting
	Failed
)

Possible values of type State:

Disconnected
Connected
Connecting
Failed

func (State) String

func (s State) String() string

String returns the string represetation of the state.

Jump to

Keyboard shortcuts

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