neighbor

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: Apache-2.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 NeighborCacheEntry

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

type NeighborMonitor

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

NeighborMonitor - Receive neighbor update messages from kernel and propagate them to subscribers.

func NewNeighborMonitor

func NewNeighborMonitor(ctx context.Context, options ...Option) (*NeighborMonitor, error)

NewNeighborMonitor - Creates a new neighbor monitor. Monitor is kept open until either Close() is called or the context is closed.

func (*NeighborMonitor) Close

func (nm *NeighborMonitor) Close()

Close -

func (*NeighborMonitor) Subscribe

func (nm *NeighborMonitor) Subscribe(subscriber NeighborMonitorSubscriber)

Subscribe -

func (*NeighborMonitor) UnSubscribe

func (nm *NeighborMonitor) UnSubscribe(subscriber NeighborMonitorSubscriber)

UnSubscribe -

type NeighborMonitorSubscriber

type NeighborMonitorSubscriber interface {
	NeighborUpdated(netlink.NeighUpdate)
}

type NeighborReachabilityDetector

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

NeighborReachabilityDetector - NeighborReachabilityDetector keeps track of certain neighbor entries for registered IPs to determine if neighbor address resolution is successful. If there is a change in reachability it triggers a logging event. In order to receive neighbor updates NeighborReachabilityDetector relies on NeighborMonitor. Note: Only neighbor updates with states REACHABLE and FAILED are processed.

func NewNeighborReachabilityDetector

func NewNeighborReachabilityDetector(ctx context.Context, name string, neighborMonitor *NeighborMonitor) (*NeighborReachabilityDetector, error)

NewNeighborReachabilityDetector - NewNeighborReachabilityDetector creates a new NeighborReachabilityDetector and registers it at the neighbor monitor.

func (*NeighborReachabilityDetector) Close

func (nrd *NeighborReachabilityDetector) Close()

Close - Close unsubscribes the detector from the neighbor monitor.

func (*NeighborReachabilityDetector) NeighborUpdated

func (nrd *NeighborReachabilityDetector) NeighborUpdated(neighborUpdate netlink.NeighUpdate)

NeighborUpdated - Process neighbor updates of interest referring to stored IPs. Checks if neighbor reachability changes (incuding MAC address update), and logs such events. Only FAILED <-> REACHABLE transitions are logged to keep track of MAC address resolution outcome.

Note: Must NOT spam logs with reachable printouts in case of intermittent traffic causing recurring neighbor entry timeouts etc.

func (*NeighborReachabilityDetector) Register

func (nrd *NeighborReachabilityDetector) Register(ips ...string)

Register - Registers IP addresses for which neighbor updates should be kept track of. Accepts IPs of both 192.0.2.1/24 and 192.0.2.1 format (but strips mask).

func (*NeighborReachabilityDetector) Unregister

func (nrd *NeighborReachabilityDetector) Unregister(ips ...string)

Unregister -

type Option

type Option func(o *neighOptions)

func WithStateMask

func WithStateMask(stateMask int) Option

WithStateMask - WithStateMask returns a new Option with the given state.

Jump to

Keyboard shortcuts

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