dataplane

package
v0.0.0-...-7296722 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2026 License: MIT Imports: 5 Imported by: 2

Documentation

Index

Constants

View Source
const ETH_P_ALL = 0x0003
View Source
const IFACE_BUFFER_SIZE = 50
View Source
const TYPE_802_1Q = 0x8100

Variables

This section is empty.

Functions

This section is empty.

Types

type Iface

type Iface interface {
	SendLoop(chan int)
	RecvLoop(chan IncomingFrame, chan int)
	Out([]byte) error
}

type IncomingFrame

type IncomingFrame struct {
	FRAME    *ethernet.Frame
	SRC_ADDR net.Addr
	IN_PORT  *SwitchPort
}

type SwitchPort

type SwitchPort struct {
	Name         string
	IFI          *net.Interface
	Conn         *raw.Conn
	VLAN         int
	Status       bool
	OutBuf       chan *ethernet.Frame
	Trunk        bool
	AllowedVLANs []int
	// contains filtered or unexported fields
}

func NewSwitchPort

func NewSwitchPort(ifname string, isTrunk bool, vlans ...int) (SwitchPort, error)

func (*SwitchPort) Down

func (s *SwitchPort) Down() error

func (*SwitchPort) Out

func (s *SwitchPort) Out(frame *ethernet.Frame)

func (*SwitchPort) RecvLoop

func (s *SwitchPort) RecvLoop(controlChannel chan IncomingFrame, close chan int)

func (*SwitchPort) SendLoop

func (s *SwitchPort) SendLoop(close chan int)

func (*SwitchPort) Up

func (s *SwitchPort) Up(controlChannel chan IncomingFrame) error

Jump to

Keyboard shortcuts

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