lldp

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2020 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client consumes lldp messages.

func NewClient

func NewClient(interfaceName string) (*Client, error)

NewClient creates a new LLDP client.

func (*Client) CatchPackages

func (l *Client) CatchPackages(frameFragmentChannel chan FrameFragment)

CatchPackages searches on the configured interface for LLDP packages and pushes the optional TLV SysName and SysDescription fields of each found LLDP package into the given channel.

func (*Client) Close

func (l *Client) Close()

Close the LLDP client

func (*Client) ExtractPhoneHomeMessage

func (l *Client) ExtractPhoneHomeMessage(frameFragment *FrameFragment) *PhoneHomeMessage

ExtractPhoneHomeMessage extracts the machineID and payload of the given LLDP frame fragment. An error will be returned if the frame fragment does not contain a phone-home message.

type FrameFragment

type FrameFragment struct {
	SysName        string
	SysDescription string
}

FrameFragment holds optional TLV SysName and SysDescription fields of a real LLDP frame.

type PhoneHomeMessage

type PhoneHomeMessage struct {
	MachineID string
	Payload   string
}

PhoneHomeMessage contains a phone-home message.

Jump to

Keyboard shortcuts

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