Documentation
¶
Index ¶
- Variables
- func DummyProc(proc pipeline.PipelineProcess, msg pipeline.PipelineMessage) pipeline.PipelineMessage
- func RegisterLayerProc(layer int, name string, pair ControlProcessFuncPair)
- func StoreMessage(msg ControlMessage) []byte
- type ControlMessage
- type ControlProcessFuncPair
- type LayerStor
- type ProcStor
- type Switch
- func (sw *Switch) AddSwitchPort(name string, swCfg config.SwitchPortConfig) (*dataplane.SwitchPort, error)
- func (sw *Switch) ConsumerLoop()
- func (sw *Switch) DelSwitchPort(name string)
- func (sw *Switch) DownPort(name string)
- func (sw *Switch) SendFrame(frame *ethernet.Frame, OutPorts ...*dataplane.SwitchPort)
- func (sw *Switch) Start()
- func (sw *Switch) Stop()
- func (sw *Switch) SwitchLoop()
- func (sw *Switch) UpPort(name string)
- type SwitchProcStor
Constants ¶
This section is empty.
Variables ¶
View Source
var ControlProcs map[int]map[string]ControlProcessFuncPair
View Source
var (
MessageStore sync.Map
)
Functions ¶
func DummyProc ¶
func DummyProc(proc pipeline.PipelineProcess, msg pipeline.PipelineMessage) pipeline.PipelineMessage
func RegisterLayerProc ¶
func RegisterLayerProc(layer int, name string, pair ControlProcessFuncPair)
func StoreMessage ¶
func StoreMessage(msg ControlMessage) []byte
StoreMessage saves the ControlMessage and returns an 8-byte ID for the Pipeline payload
Types ¶
type ControlMessage ¶
type ControlMessage struct {
InFrame *dataplane.IncomingFrame
PreMessage interface{} // To be able to reconstruct the packet again
LayerPayload interface{} // To separate each leayer payload
OutPorts []*dataplane.SwitchPort
ParentSwitch *Switch
NextHop string // IP address of the next hop (in case of routed traffic)
}
func DropMessage ¶
func DropMessage(payload []byte) (ControlMessage, bool)
DropMessage deletes the message mapping when fully consumed by the Dataplane natively
func FetchMessage ¶
func FetchMessage(payload []byte) (ControlMessage, bool)
FetchMessage retrieves the original ControlMessage using the byte slice payload
type ControlProcessFuncPair ¶
type ControlProcessFuncPair struct {
InFunc func(proc pipeline.PipelineProcess, msg pipeline.PipelineMessage) pipeline.PipelineMessage
OutFunc func(proc pipeline.PipelineProcess, msg pipeline.PipelineMessage) pipeline.PipelineMessage
Init func(sw *Switch)
}
type Switch ¶
type Switch struct {
Name string
Ports map[string]*dataplane.SwitchPort
Stor SwitchProcStor
// contains filtered or unexported fields
}
func (*Switch) AddSwitchPort ¶
func (sw *Switch) AddSwitchPort(name string, swCfg config.SwitchPortConfig) (*dataplane.SwitchPort, error)
func (*Switch) ConsumerLoop ¶
func (sw *Switch) ConsumerLoop()
func (*Switch) DelSwitchPort ¶
func (*Switch) SendFrame ¶
func (sw *Switch) SendFrame(frame *ethernet.Frame, OutPorts ...*dataplane.SwitchPort)
func (*Switch) SwitchLoop ¶
func (sw *Switch) SwitchLoop()
type SwitchProcStor ¶
Click to show internal directories.
Click to hide internal directories.