lldp

package
v0.12.3 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chassis

type Chassis struct {
	Type  LinkType
	Value string
}

Chassis of a lldp Neighbor

func (Chassis) String

func (c Chassis) String() string

type Client

type Client struct {
	Source    *gopacket.PacketSource
	Handle    *pcap.Handle
	Interface *net.Interface
}

Client consumes lldp messages.

func NewClient

func NewClient(log *slog.Logger, ifi string) (*Client, error)

NewClient create a new lldp client.

func (*Client) Close

func (l *Client) Close()

Close the lldp client

func (*Client) Neighbors

func (l *Client) Neighbors(neighChan chan Neighbor)

Neighbors search on a interface for neighbors announced via lldp

type LinkType

type LinkType string

LinkType can be Interface or Mac

var (
	// Interface LinkType
	Interface LinkType = "Interface"
	// Mac LinkType
	Mac LinkType = "Mac"
	// Local LinkType
	Local LinkType = "Local"
)

type Neighbor

type Neighbor struct {
	Name            string
	Description     string
	PortDescription string
	Interface       string
	Chassis         Chassis
	Port            Port
}

Neighbor is the direct ethernet neighbor

func (Neighbor) String

func (n Neighbor) String() string

type Port

type Port struct {
	Type  LinkType
	Value string
}

Port of a lldp Neighbor

func (Port) String

func (p Port) String() string

Jump to

Keyboard shortcuts

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