engine

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package engine contains funcs for interacting with the forwarding engine.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IntfNameToTapName

func IntfNameToTapName(name string) string

IntfNameToTapName returns the connected tap interface of an interface.

func IsTap

func IsTap(name string) bool

IsTap returns wether the interface is a tap interface.

func TapNameToIntfName

func TapNameToIntfName(name string) string

TapNameToIntfName returns connected external interface from a tap interface.

Types

type Engine added in v0.2.0

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

Engine contains a routing context and methods to manage it.

func New added in v0.2.0

func New(ctx context.Context, id string, c fwdpb.ServiceClient) (*Engine, error)

New creates a new engine and sets up the forwarding tables.

func (*Engine) AddIPRoute added in v0.2.0

func (e *Engine) AddIPRoute(ctx context.Context, v4 bool, ip, mask []byte, vrf uint64, nextHops []*dpb.NextHop) error

AddIPRoute adds a route to the FIB with the input next hops.

func (*Engine) AddLayer3PuntRule added in v0.2.0

func (e *Engine) AddLayer3PuntRule(ctx context.Context, portName string, ip []byte) error

AddLayer3PuntRule adds rule to output packets to a corresponding port based on the destination IP and input port.

func (*Engine) AddNeighbor added in v0.2.0

func (e *Engine) AddNeighbor(ctx context.Context, ip, mac []byte) error

AddNeighbor adds a neighbor to the neighbor table.

func (*Engine) CreateExternalPort added in v0.2.0

func (e *Engine) CreateExternalPort(ctx context.Context, name string) error

CreateExternalPort creates an external port (connected to other devices).

func (*Engine) CreateLocalPort added in v0.2.0

func (e *Engine) CreateLocalPort(ctx context.Context, name string, fd int) error

CreateLocalPort creates an local (ie TAP) port for the given linux device name.

func (*Engine) DeleteIPRoute added in v0.2.0

func (e *Engine) DeleteIPRoute(ctx context.Context, v4 bool, ip, mask []byte, vrf uint64) error

DeleteIPRoute deletes a route from the FIB.

func (*Engine) GetCounters added in v0.2.0

func (e *Engine) GetCounters(ctx context.Context, name string) (*fwdpb.ObjectCountersReply, error)

CreateLocalPort returns the counters for the object by name.

func (*Engine) RemoveNeighbor added in v0.2.0

func (e *Engine) RemoveNeighbor(ctx context.Context, ip []byte) error

RemoveNeighbor removes a neighbor from the neighbor table.

func (*Engine) UpdatePortSrcMAC added in v0.2.0

func (e *Engine) UpdatePortSrcMAC(ctx context.Context, portName string, mac []byte) error

UpdatePortSrcMAC updates a port's source mac address.

Jump to

Keyboard shortcuts

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