network

package
v0.0.0-...-7b7dccf Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package network contains all rendered network oriented resources for Nimbess

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeGateMap

func MakeGateMap() map[Gate]PipelineModule

Create a Gate Map - will include init for default gates later

Types

type EgressPort

type EgressPort struct {
	Module
	*Port
}

EgressPort represents the TX side of a network interface

type Gate

type Gate uint64

Gate is a virtual port for a module for traffic to ingress or egress

type IngressPort

type IngressPort struct {
	Module
	*Port
}

IngressPort represents the RX side of a network interface

type L2FIBCommand

type L2FIBCommand struct {
	Command   string
	MAC       string
	Permanent bool
	Setage    int64
	Port      string
}

type Module

type Module struct {
	Meta   string
	Name   string
	IGates map[Gate]PipelineModule
	EGates map[Gate]PipelineModule
}

Module represents a generic Network Function. It contains ingress gates and egress gates for traffic flow, which map to the next connected module. Meta field is used to store the name of the Meta Pipeline Module from which this module was created

func (*Module) Connect

func (m *Module) Connect(module PipelineModule, egress bool, gate *Gate) Gate

Connect creates a connection between modules in either ingress/egress direction. module argument should be a pointer to Module type egress defines if this connection should apply to egress or ingress gate map gate defines a specific gate to use and not automatically get next gate

func (*Module) Disconnect

func (m *Module) Disconnect(gate Gate, egress bool)

Disconnect removes the connection in a Module's Egress or Ingress Gate Map

func (*Module) GetEGate

func (m *Module) GetEGate(module PipelineModule) *Gate

GetEGate gets the corresponding gate

func (Module) GetEGateMap

func (m Module) GetEGateMap() map[Gate]PipelineModule

GetEGateMap returns the Egress Gate Map for Module

func (*Module) GetIGate

func (m *Module) GetIGate(module PipelineModule) *Gate

GetIGate gets the corresponding gate

func (Module) GetIGateMap

func (m Module) GetIGateMap() map[Gate]PipelineModule

GetIGateMap returns the Ingress Gate Map for Module

func (*Module) GetMeta

func (m *Module) GetMeta() string

GetMeta gets the name of the Meta Pipeline Module used to create this Module

func (*Module) GetName

func (m *Module) GetName() string

GetName returns the Module's name

func (Module) GetNextEGate

func (m Module) GetNextEGate() Gate

GetNextEGate returns the next unused Egress gate

func (Module) GetNextIGate

func (m Module) GetNextIGate() Gate

GetNextIGate returns the next unused Ingress gate

func (*Module) SetEGateMap

func (m *Module) SetEGateMap(gMap map[Gate]PipelineModule)

SetEGateMap sets the Egress Gate Map for a Module

func (*Module) SetIGateMap

func (m *Module) SetIGateMap(gMap map[Gate]PipelineModule)

SetIGateMap sets the Ingress Gate Map for a Module

func (*Module) SetMeta

func (m *Module) SetMeta(s string)

SetMeta sets the name of the Meta Pipeline Module used to create this Module

func (*Module) SetName

func (m *Module) SetName(s string)

SetName sets the Module's name

type Pipeline

type Pipeline interface {
	GetModule(name string) PipelineModule
}

Pipeline is a generic network pipeline of network modules

type PipelineModule

type PipelineModule interface {
	Connect(module PipelineModule, egress bool, gate *Gate) Gate
	Disconnect(gate Gate, egress bool)
	GetNextIGate() Gate
	GetNextEGate() Gate
	GetName() string
	SetName(s string)
	GetIGateMap() map[Gate]PipelineModule
	SetIGateMap(m map[Gate]PipelineModule)
	GetEGateMap() map[Gate]PipelineModule
	SetEGateMap(m map[Gate]PipelineModule)
	SetMeta(s string)
	GetMeta() string
	GetIGate(module PipelineModule) *Gate
	GetEGate(module PipelineModule) *Gate
}

PipelineModule type to implement module updates

type Port

type Port struct {
	PortName   string
	Virtual    bool
	DPDK       bool
	UnixSocket bool
	IfaceName  string
	Network    string
	NamesSpace string
	IPAddr     string
	MacAddr    string
	Gateway    string
	SocketPath string
}

Port represents a network interface

type Switch

type Switch struct {
	Module
	L2FIB map[string]Gate
}

Switch represents an L2 network switch. Extends Module and defines L2FIB table which holds a map of map to output Gates EGate 999 is always reserved in Switch for connecting to replicator

type URLFilter

type URLFilter struct {
	Module
	v1.URLFilter
}

URLFilter

Jump to

Keyboard shortcuts

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