fwdtable

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package fwdtable contains routines and types to manage forwarding tables.

A forwarding table is a mapping of entries to a set of actions. Packets are matched to entries within the table using an algorithm specific to the table. Lucius has a variety of forwarding tables (implemented by various types). All ports are created by provisioning.

This package defines the following mechanisms to manage tables

  1. It allows different types of tables to register builders during package initialization.
  2. Provisioning can create tables using the registered builders.
  3. It defines an interface that can be used to operate on a table.

Index

Constants

This section is empty.

Variables

CounterList is a set of counters incremented by tables.

Functions

func GetID

func GetID(table Table) *fwdpb.TableId

GetID returns the TableID for the given port.

func MakeID

func MakeID(id fwdobject.ID) *fwdpb.TableId

MakeID makes a TableID corresponding to the specified object ID.

func Register

func Register(tableType fwdpb.TableType, builder Builder)

Register registers a builder for a table type. Note that builders are expected to be registered during package initialization.

func Release

func Release(table Table) error

Release releases a reference to a table.

Types

type Builder

type Builder interface {
	// Build builds a table.
	Build(ctx *fwdcontext.Context, desc *fwdpb.TableDesc) (Table, error)
}

A Builder can build a Table of the specified type.

type Table

type Table interface {
	fwdobject.Object

	// Process processes the packet using the specified counters.
	// Process returns an updated processing state for the packet.
	// It may also return new Actions that are used to process the packet.
	// Process assumes that counters are always valid (not nil).
	Process(packet fwdpacket.Packet, counters fwdobject.Counters) (fwdaction.Actions, fwdaction.State)

	// Add adds or updates a table entry.
	AddEntry(entryDesc *fwdpb.EntryDesc, descs []*fwdpb.ActionDesc) error

	// Remove removes a table entry.
	RemoveEntry(entryDesc *fwdpb.EntryDesc) error

	// Entries lists all entries in a table.
	Entries() []string

	// Clear removes all entries in the table.
	Clear()
}

A Table is a mapping of entries to a set of actions. It is used to match entries to packets to determine the actions to be performed on the packet.

Tables are always created by provisioning.

func Acquire

func Acquire(ctx *fwdcontext.Context, id *fwdpb.TableId) (Table, error)

Acquire acquires a reference to a table.

func Find

func Find(ctx *fwdcontext.Context, id *fwdpb.TableId) (Table, error)

Find finds a table.

func New

func New(ctx *fwdcontext.Context, desc *fwdpb.TableDesc) (Table, error)

New creates a new table.

Directories

Path Synopsis
Package bridge implements an exact match table that operates on the packet's mac address.
Package bridge implements an exact match table that operates on the packet's mac address.
Package exact implements a Lucius table that performs packet matches using an exact match match and satisfies the interface fwdtable.Table.
Package exact implements a Lucius table that performs packet matches using an exact match match and satisfies the interface fwdtable.Table.
Package flow implements a Lucius table that performs packet matches using an flow matching and satisfies the interface fwdtable.Table.
Package flow implements a Lucius table that performs packet matches using an flow matching and satisfies the interface fwdtable.Table.
Package mock_fwdpacket is a generated GoMock package.
Package mock_fwdpacket is a generated GoMock package.
Package prefix implements a Lucius table that performs packet matches using the longest prefix match and satisfies the interface fwdtable.Table.
Package prefix implements a Lucius table that performs packet matches using the longest prefix match and satisfies the interface fwdtable.Table.
Package tabletestutil consists of routines used to test Lucius tables like prefix match, exact match and flow match tables.
Package tabletestutil consists of routines used to test Lucius tables like prefix match, exact match and flow match tables.
Package tableutil contains utilites used to implement tables in Lucius like prefix, flow and exact match.
Package tableutil contains utilites used to implement tables in Lucius like prefix, flow and exact match.

Jump to

Keyboard shortcuts

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