neighbors

package
v0.0.0-...-8049898 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2017 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NeighborDetails

type NeighborDetails struct {
	PortID          string      `json:"portid,omitempty"`
	PortDescription string      `json:"portdesc,omitempty"`
	SysName         string      `json:"hostname,omitempty"`
	SysDesc         string      `json:"description,omitempty"`
	Address         string      `json:"address,omitempty"`
	Vlan            string      `json:"vlan,omitempty"`
	Type            string      `json:"type,omitempty"`
	TTL             *time.Timer `json:"-"`
}

NeighborDetails stores relevent information to identify a neighboring node

type Neighbors

type Neighbors struct {
	Rw         sync.RWMutex                          `json:"-"`
	NetDevList []net.Interface                       `json:"-"`
	Interfaces map[string]map[string]NeighborDetails `json:"connections,omitempty"`
	ChassisID  string                                `json:"host,omitempty"`
	SysName    string                                `json:"hostname,omitempty"`
	SysDesc    string                                `json:"description,omitempty"`
	Address    string                                `json:"address,omitempty"`
	Type       string                                `json:"type,omitempty"`
}

Neighbors stores the local neighbors topology

func NewNeighbors

func NewNeighbors() (*Neighbors, error)

NewNeighbors creates the Neighbors data storage object and returns it to the LLDP Plugin

func (*Neighbors) GetInterfaceDetails

func (n *Neighbors) GetInterfaceDetails(ctx context.Context, in *lldp.Interface) (*lldp.Interface, error)

GetInterfaceDetails provides details indofmration about each interface

func (*Neighbors) ListInterfaceNeighbors

func (n *Neighbors) ListInterfaceNeighbors(in *lldp.Interface, stream lldp.Lldp_ListInterfaceNeighborsServer) error

ListInterfaceNeighbors shows the neighbors attached to a specific interface

func (*Neighbors) ListInterfaces

func (n *Neighbors) ListInterfaces(in *lldp.EmptyMessage, stream lldp.Lldp_ListInterfacesServer) error

ListInterfaces provides a list of all active interfaces

func (*Neighbors) ListNeighbors

func (n *Neighbors) ListNeighbors(in *lldp.EmptyMessage, stream lldp.Lldp_ListNeighborsServer) error

ListNeighbors shows all neighbors attached to all active interfaces on the host

func (*Neighbors) ProcessPacket

func (n *Neighbors) ProcessPacket(wg *sync.WaitGroup, in Packet)

ProcessPacket takes a cpatured packet

type Packet

type Packet struct {
	Iface  net.Interface
	Packet gopacket.Packet
}

Packet encodes the ingress interface with the receives LLDP packet

Jump to

Keyboard shortcuts

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