ifgroup

package
v0.0.0-...-af941b8 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2025 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const Group = 0xe1f1

Group is a group to be used within the application while it works

Variables

View Source
var (
	// ErrAlreadySet defines that NetlinkManager is already set.
	ErrAlreadySet = errors.New("already set")
	// ErrNotSet defines that NetlinkManager is not set yet.
	ErrNotSet = errors.New("not set")
)

Functions

This section is empty.

Types

type Manager

type Manager interface {
	Set() error
	Unset() error
}

Manager is responsible for managing groups of network interfaces

type NetlinkManager

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

NetlinkManager is responsible for setting ifgroup to all of the network interfaces given by a deviceList function and reverting the changes when needed.

func NewNetlinkManager

func NewNetlinkManager(deviceList func() ([]net.Interface, error)) *NetlinkManager

NewNetlinkManager is a default constructor for NetlinkManager

func (*NetlinkManager) Set

func (s *NetlinkManager) Set() error

Set sets the ifgroup for all of the network interfaces given by deviceList and stores their group IDs as a backup to be used for unset.

func (*NetlinkManager) Unset

func (s *NetlinkManager) Unset() error

Jump to

Keyboard shortcuts

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