lldp

package
v0.0.0-...-1d39891 Latest Latest
Warning

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

Go to latest
Published: May 12, 2020 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SwitchUP           string = "UP"
	SwitchInaccessible string = "INACCESSIBLE"
	SwitchDOWN         string = "DOWN"
)
View Source
const (
	LinkActive   string = "ACTIVE"
	LinkInactive string = "INACTIVE"
)

Variables

This section is empty.

Functions

func MetadataDecoder

func MetadataDecoder(raw json.RawMessage) (common.Getter, error)

MetadataDecoder implements the JSON raw decoder for LLDP metadata

Types

type LinkAggregationMetadata

type LinkAggregationMetadata struct {
	Enabled   bool  `json:"Enabled"`
	PortID    int64 `json:"PortID,omitempty"`
	Supported bool  `json:"Supported"`
}

LinkAggregationMetadata describes the LLDP link aggregation metadata easyjson:json gendecoder

type Metadata

type Metadata struct {
	Description     string                   `json:"Description,omitempty"`
	ChassisID       string                   `json:"ChassisID,omitempty"`
	ChassisIDType   string                   `json:"ChassisIDType,omitempty"`
	SysName         string                   `json:"SysName,omitempty"`
	MgmtAddress     string                   `json:"MgmtAddress,omitempty"`
	PVID            int64                    `json:"PVID,omitempty"`
	VIDUsageDigest  int64                    `json:"VIDUsageDigest,omitempty"`
	ManagementVID   int64                    `json:"ManagementVID,omitempty"`
	PortID          string                   `json:"PortID,omitempty"`
	PortIDType      string                   `json:"PortIDType,omitempty"`
	LinkAggregation *LinkAggregationMetadata `json:"LinkAgggregation,omitempty"`
	VLANNames       []VLANNameMetadata       `json:"VLANNames,omitempty"`
	PPVIDs          []PPVIDMetadata          `json:"PPVIDs,omitempty"`
}

Metadata describes the LLDP chassis metadata easyjson:json gendecoder

type PPVIDMetadata

type PPVIDMetadata struct {
	Enabled   bool  `json:"Enabled"`
	ID        int64 `json:"ID"`
	Supported bool  `json:"Supported"`
}

PPVIDMetadata describes the LLDP link PPVID metadata easyjson:json gendecoder

type Probe

type Probe struct {
	sync.RWMutex
	graph.DefaultGraphListener
	Ctx tp.Context
	// contains filtered or unexported fields
}

Probe describes the probe that is in charge of listening for LLDP packets on interfaces and create the corresponding chassis and port nodes

func (*Probe) Init

func (p *Probe) Init(ctx tp.Context, bundle *probe.Bundle) (probe.Handler, error)

Init initializes a new LLDP probe

func (*Probe) OnEdgeAdded

func (p *Probe) OnEdgeAdded(e *graph.Edge)

OnEdgeAdded is called when a new edge was created on the graph

func (*Probe) OnNodeUpdated

func (p *Probe) OnNodeUpdated(n *graph.Node)

OnNodeUpdated is called when a new node was updated on the graph

func (*Probe) Start

func (p *Probe) Start()

Start capturing LLDP packets

func (*Probe) Stop

func (p *Probe) Stop()

Stop capturing LLDP packets

type VLANNameMetadata

type VLANNameMetadata struct {
	ID   int64  `json:"ID"`
	Name string `json:"Name"`
}

VLANNameMetadata describes the LLDP VLAN metadata easyjson:json gendecoder

type Watcher

type Watcher struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*Watcher) DropElement

func (w *Watcher) DropElement(id graph.Identifier)

func (*Watcher) Start

func (w *Watcher) Start(g *graph.Graph, wg *sync.WaitGroup)

func (*Watcher) Stop

func (w *Watcher) Stop()

func (*Watcher) UpdateElement

func (w *Watcher) UpdateElement(id graph.Identifier)

Jump to

Keyboard shortcuts

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