engine

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Overview

Package engine contains funcs for interacting with the forwarding engine.

Index

Constants

View Source
const (
	DefaultContextID = "default"
)

Variables

This section is empty.

Functions

func AddIPRoute

func AddIPRoute(ctx context.Context, c fwdpb.ServiceClient, v4 bool, ip, mask []byte, nextHops []*dpb.NextHop) error

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

func AddLayer3PuntRule

func AddLayer3PuntRule(ctx context.Context, c fwdpb.ServiceClient, portName string, ip []byte) error

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

func AddNeighbor

func AddNeighbor(ctx context.Context, c fwdpb.ServiceClient, ip, mac []byte) error

AddNeighbor adds a neighbor to the neighbor table.

func CreateExternalPort

func CreateExternalPort(ctx context.Context, c fwdpb.ServiceClient, name string) error

CreateExternalPort creates an external port (connected to other devices). TODO: layer3 punt behavior.

func CreateLocalPort

func CreateLocalPort(ctx context.Context, c fwdpb.ServiceClient, name string, fd int) error

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

func DeleteIPRoute

func DeleteIPRoute(ctx context.Context, c fwdpb.ServiceClient, v4 bool, ip, mask []byte) error

DeleteIPRoute deletes a route from the FIB.

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 RemoveNeighbor

func RemoveNeighbor(ctx context.Context, c fwdpb.ServiceClient, ip []byte) error

RemoveNeighbor removes a neighbor from the neighbor table.

func SetupForwardingTables

func SetupForwardingTables(ctx context.Context, c fwdpb.ServiceClient) error

SetupForwardingTables creates the forwarding tables.

func TapNameToIntfName

func TapNameToIntfName(name string) string

TapNameToIntfName returns connected external interface from a tap interface.

func UpdatePortSrcMAC

func UpdatePortSrcMAC(ctx context.Context, c fwdpb.ServiceClient, portName string, mac []byte) error

UpdatePortSrcMAC updates a port's source mac address.

Types

This section is empty.

Jump to

Keyboard shortcuts

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