switchr

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2024 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Switch

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

Switch handles packets based on switch labels.

func New

func New(instance instance, upstreamHandler chan frame.Frame) *Switch

New returns a new switch.

func (*Switch) ForwardByLabel

func (s *Switch) ForwardByLabel(f frame.Frame, nextHopLabel m.SwitchLabel) error

ForwardByLabel forwards a frame by the given switch label.

func (*Switch) ForwardByPeer

func (s *Switch) ForwardByPeer(f frame.Frame, peerIP netip.Addr) error

ForwardByPeer forwards a frame by the given peer IP.

func (*Switch) Input

func (s *Switch) Input() chan frame.Frame

Input returns the input channel for the switch.

func (*Switch) Start

func (s *Switch) Start(mgr *mgr.Manager) error

Start starts the switch.

func (*Switch) Stop

func (s *Switch) Stop(mgr *mgr.Manager) error

Stop stops the switch.

Jump to

Keyboard shortcuts

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