bridge

package
v0.0.0-...-2854774 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotImplemented = errors.New("bridge: not implemented")
)

errors about bridge

Functions

func DialFdbMonitor

func DialFdbMonitor() (*netlink.Conn, error)

Types

type Client

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

A Client can manipulate the bridge netlink interface.

func New

func New(conn *netlink.Conn) *Client

New creates a Client which can issue bridger commands.

func (*Client) ListFdb

func (c *Client) ListFdb() ([]*FdbEntry, error)

ListFdb dumps the fdb records from the kernel.

func (*Client) MonitorFdb

func (c *Client) MonitorFdb(fdbHandler func(*FdbEntry)) error

MonitorFdb monitors bridge fdb entry's adding and deleting.

type FdbActionType

type FdbActionType int

FdbActionType is the type for the fdb entry's action.

const (
	// FdbActionAdd indicates a fdb entry was added.
	FdbActionAdd FdbActionType = iota
	// FdbActionDel indicates a fdb entry was deleted.
	FdbActionDel
)

type FdbEntry

type FdbEntry struct {
	Action  FdbActionType
	State   iproute2.NudState
	Flag    iproute2.NtfFlag
	Ifindex int
	Lladdr  net.HardwareAddr
	Vlan    int
	Master  int
}

FdbEntry contains fdb messages for bridge fdb.

Jump to

Keyboard shortcuts

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