forwarding

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: 35 Imported by: 0

Documentation

Overview

Package forwarding manages forwarding contexts and forwarding objects.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttributeInfo

func AttributeInfo(ctx *fwdcontext.Context, arg interface{}) string

AttributeInfo returns the attributes from the global, context and arg as specified..

func ContextInfo

func ContextInfo(ctx *fwdcontext.Context, _ interface{}) string

ContextInfo returns the details of the specified context as a string.

func CounterInfo

func CounterInfo(obj fwdobject.Object) string

CounterInfo returns the counters of an object formatted as string.

func ObjectInfo

func ObjectInfo(ctx *fwdcontext.Context, arg interface{}) string

ObjectInfo returns the details of the specified object as a string.

func TableInfo

func TableInfo(ctx *fwdcontext.Context, arg interface{}) string

TableInfo returns the details of the specified Table as a string.

Types

type Engine

type Engine struct {
	fwdpb.UnimplementedServiceServer
	fwdpb.UnimplementedInfoServer
	fwdpb.UnimplementedPacketSinkServer
	// contains filtered or unexported fields
}

A Engine is an instance of the forwarding engine. It contains a set of forwarding contexts, each of which contain forwarding objects such as tables, ports and actions.

func New

func New(name string) *Engine

New creates a new forwarding instance using the specified name.

func (*Engine) AttributeList

AttributeList lists all attributes.

func (*Engine) AttributeUpdate

func (e *Engine) AttributeUpdate(_ context.Context, request *fwdpb.AttributeUpdateRequest) (*fwdpb.AttributeUpdateReply, error)

AttributeUpdate updates attributes in a forwarding context.

func (*Engine) ContextCreate

func (e *Engine) ContextCreate(_ context.Context, request *fwdpb.ContextCreateRequest) (*fwdpb.ContextCreateReply, error)

ContextCreate creates a new context. Note that if the packet sink and/or notification services are specified but not reachable, the context creation fails.

func (*Engine) ContextDelete

func (e *Engine) ContextDelete(_ context.Context, request *fwdpb.ContextDeleteRequest) (*fwdpb.ContextDeleteReply, error)

ContextDelete deletes a context if it exists.

func (*Engine) ContextList

func (e *Engine) ContextList(_ context.Context, request *fwdpb.ContextListRequest) (*fwdpb.ContextListReply, error)

ContextList lists all the contexts in the system.

func (*Engine) ContextUpdate

func (e *Engine) ContextUpdate(_ context.Context, request *fwdpb.ContextUpdateRequest) (*fwdpb.ContextUpdateReply, error)

ContextUpdate updates a forwarding context. Note that if the packet sink and/or notification services are specified but not reachable, the context update fails.

func (*Engine) FindContext

func (e *Engine) FindContext(contextID *fwdpb.ContextId) (*fwdcontext.Context, error)

FindContext finds the specified context.

func (*Engine) FlowCounterCreate

func (e *Engine) FlowCounterCreate(_ context.Context, request *fwdpb.FlowCounterCreateRequest) (*fwdpb.FlowCounterCreateReply, error)

FlowCounterCreate creates a flow counter with specified ObjectId in the specified context.

func (*Engine) FlowCounterQuery

func (e *Engine) FlowCounterQuery(_ context.Context, request *fwdpb.FlowCounterQueryRequest) (*fwdpb.FlowCounterQueryReply, error)

FlowCounterQuery queries for the values of specified counters.

func (*Engine) GetNotificationCallback

func (e *Engine) GetNotificationCallback(address string) (fwdcontext.NotificationCallback, error)

GetNotificationCallback returns a callback that posts notifications to the specified address. If the address is "", the returned callback ignores all events.

func (*Engine) GetPacketSinkCallback

func (e *Engine) GetPacketSinkCallback(address string) (fwdcontext.PacketCallback, error)

GetPacketSinkCallback returns a callback that posts packets to a packet sink service at the specified address. If the address is "", the packet sink service is disabled for the context.

func (*Engine) InfoElement

func (e *Engine) InfoElement(_ context.Context, request *fwdpb.InfoElementRequest) (*fwdpb.InfoElementReply, error)

InfoElement retrieves the contents of a specific information element.

func (*Engine) InfoList

InfoList retrieves a list of all information elements.

func (*Engine) ObjectCounters

func (e *Engine) ObjectCounters(_ context.Context, request *fwdpb.ObjectCountersRequest) (*fwdpb.ObjectCountersReply, error)

ObjectCounters retrieves all the counters associated on the object.

func (*Engine) ObjectDelete

func (e *Engine) ObjectDelete(_ context.Context, request *fwdpb.ObjectDeleteRequest) (*fwdpb.ObjectDeleteReply, error)

ObjectDelete deletes an object.

func (*Engine) ObjectList

func (e *Engine) ObjectList(_ context.Context, request *fwdpb.ObjectListRequest) (*fwdpb.ObjectListReply, error)

ObjectList lists all the objects in the system.

func (*Engine) Operation

func (e *Engine) Operation(stream fwdpb.Service_OperationServer) error

Operation processes incoming OperationRequests and extracts the contained Request.

func (*Engine) PacketInject

func (e *Engine) PacketInject(_ context.Context, request *fwdpb.PacketInjectRequest) (*fwdpb.PacketInjectReply, error)

PacketInject injects a packet in the specified forwarding context and port.

func (*Engine) PortCreate

func (e *Engine) PortCreate(_ context.Context, request *fwdpb.PortCreateRequest) (*fwdpb.PortCreateReply, error)

PortCreate creates a port.

func (*Engine) PortState

func (e *Engine) PortState(_ context.Context, request *fwdpb.PortStateRequest) (*fwdpb.PortStateReply, error)

PortState controls and queries the port state.

func (*Engine) PortUpdate

func (e *Engine) PortUpdate(_ context.Context, request *fwdpb.PortUpdateRequest) (*fwdpb.PortUpdateReply, error)

PortUpdate updates a port.

func (*Engine) SetCreate

func (e *Engine) SetCreate(_ context.Context, request *fwdpb.SetCreateRequest) (*fwdpb.SetCreateReply, error)

SetCreate creates a new set.

func (*Engine) SetUpdate

func (e *Engine) SetUpdate(_ context.Context, request *fwdpb.SetUpdateRequest) (*fwdpb.SetUpdateReply, error)

SetUpdate updates a set.

func (*Engine) TableCreate

func (e *Engine) TableCreate(_ context.Context, request *fwdpb.TableCreateRequest) (*fwdpb.TableCreateReply, error)

TableCreate creates an empty table.

func (*Engine) TableEntryAdd

func (e *Engine) TableEntryAdd(_ context.Context, request *fwdpb.TableEntryAddRequest) (*fwdpb.TableEntryAddReply, error)

TableEntryAdd adds (or updates) an entry in a table.

func (*Engine) TableEntryRemove

func (e *Engine) TableEntryRemove(_ context.Context, request *fwdpb.TableEntryRemoveRequest) (*fwdpb.TableEntryRemoveReply, error)

TableEntryRemove removes an entry from the table.

func (*Engine) TableList

func (e *Engine) TableList(_ context.Context, request *fwdpb.TableListRequest) (*fwdpb.TableListReply, error)

TableList lists all the entries in the specified table.

func (*Engine) UpdateNotification

func (e *Engine) UpdateNotification(contextID *fwdpb.ContextId, notification fwdcontext.NotificationCallback, address string) error

UpdateNotification updates the notification service for a context. If the notification is set to nil, no notifications are generated for the context. The address is the address of the notification service (used in queries) in the host:port format.

func (*Engine) UpdatePacketSink

func (e *Engine) UpdatePacketSink(contextID *fwdpb.ContextId, packet fwdcontext.PacketCallback, address string) error

UpdatePacketSink updates the packet sink service for a context. If the service is set to nil, no packets are delivered externally for the context. The address is the address of the packet service (used in queries) in the host:port format.

type Handler

type Handler func(*fwdcontext.Context, interface{}) string

A Handler returns the contents of an info element.

type InfoList

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

An InfoList stores info elements for each forwarding object. Each info element is identified by a string name and is associated with a handler and reference to the actual object itself.

func NewInfoList

func NewInfoList() *InfoList

NewInfoList returns a new information list.

func (*InfoList) AddContext

func (l *InfoList) AddContext(ctx *fwdcontext.Context)

AddContext adds an info element for a forwarding context.

func (*InfoList) AddObject

func (l *InfoList) AddObject(ctx *fwdcontext.Context, obj fwdobject.Object)

AddObject adds an info element for an object.

func (*InfoList) Element

func (l *InfoList) Element(name string, infoType fwdpb.InfoType, frame []byte, start fwdpb.PacketHeaderId) (string, error)

Element retrieves the contents of a specific information element.

func (*InfoList) List

func (l *InfoList) List() []string

List retrieves a list of all information elements.

func (*InfoList) RemoveContext

func (l *InfoList) RemoveContext(ctx *fwdcontext.Context)

RemoveContext removes an info element corresponding to the specified context.

func (*InfoList) RemoveObject

func (l *InfoList) RemoveObject(ctx *fwdcontext.Context, oid *fwdpb.ObjectId)

RemoveObject removes an info element corresponding to the specified objectID.

Directories

Path Synopsis
Package fwdaction contains routines and types to manage forwarding actions.
Package fwdaction contains routines and types to manage forwarding actions.
actions
Package actions implements various types of actions supported within Lucius.
Package actions implements various types of actions supported within Lucius.
mock_fwdpacket
Package mock_fwdpacket is a generated GoMock package.
Package mock_fwdpacket is a generated GoMock package.
mock_fwdport
Package mock_fwdport is a generated GoMock package.
Package mock_fwdport is a generated GoMock package.
mock_fwdtable
Package mock_fwdtable is a generated GoMock package.
Package mock_fwdtable is a generated GoMock package.
Package fwdport contains routines and types to manage forwarding ports.
Package fwdport contains routines and types to manage forwarding ports.
mock_fwdpacket
Package mock_fwdpacket is a generated GoMock package.
Package mock_fwdpacket is a generated GoMock package.
ports
Package ports implements various types of ports supported within Lucius.
Package ports implements various types of ports supported within Lucius.
porttestutil
Package porttestutil contains routines used to create and manage ports for test cases.
Package porttestutil contains routines used to create and manage ports for test cases.
Package fwdtable contains routines and types to manage forwarding tables.
Package fwdtable contains routines and types to manage forwarding tables.
bridge
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.
exact
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.
flow
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.
mock_fwdpacket
Package mock_fwdpacket is a generated GoMock package.
Package mock_fwdpacket is a generated GoMock package.
prefix
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.
tabletestutil
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.
tableutil
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.
infra
deadlock
Package deadlock is a set of simple utilities meant to detect deadlocks based on timeouts.
Package deadlock is a set of simple utilities meant to detect deadlocks based on timeouts.
fwdattribute
Package fwdattribute provides types and mechanisms used to manage attributes for forwarding objects.
Package fwdattribute provides types and mechanisms used to manage attributes for forwarding objects.
fwdcontext
Package fwdcontext contains routines for managing the context of the forwarding engine.
Package fwdcontext contains routines for managing the context of the forwarding engine.
fwdflowcounter
Package fwdflowcounter implements the functionality of Flow Counters.
Package fwdflowcounter implements the functionality of Flow Counters.
fwdobject
Package fwdobject contains routines and interfaces used to implement various forwarding objects.
Package fwdobject contains routines and interfaces used to implement various forwarding objects.
fwdpacket
Package fwdpacket contains routines and types for manipulating packets.
Package fwdpacket contains routines and types for manipulating packets.
fwdset
Package fwdset implements a set of members.
Package fwdset implements a set of members.
Package protocol enables Lucius to uniformly query and mutate network packets containing various protocols.
Package protocol enables Lucius to uniformly query and mutate network packets containing various protocols.
arp
Package arp implements the ARP header.
Package arp implements the ARP header.
ethernet
Package ethernet implements the Ethernet header.
Package ethernet implements the Ethernet header.
icmp
Package icmp implements the ICMP header support in Lucius.
Package icmp implements the ICMP header support in Lucius.
ip
Package ip handles the IP L3 portion of the packet.
Package ip handles the IP L3 portion of the packet.
metadata
Package metadata implements the metadata packet header.
Package metadata implements the metadata packet header.
opaque
Package opaque implements the opaque packet header.
Package opaque implements the opaque packet header.
packettestutil
Package packettestutil contains a set of routines used to test the processing of packet headers and fields.
Package packettestutil contains a set of routines used to test the processing of packet headers and fields.
tcp
Package tcp implements the TCP header support in Lucius.
Package tcp implements the TCP header support in Lucius.
udp
Package udp implements the UDP header support in Lucius.
Package udp implements the UDP header support in Lucius.
util
frame
Package frame contains utilities to implement various network protocols and describe their relationship within Lucius.
Package frame contains utilities to implement various network protocols and describe their relationship within Lucius.
hash/crc16
Package crc16 computes the 16 bit checksum over a series of bytes.
Package crc16 computes the 16 bit checksum over a series of bytes.
hash/csum16
Package csum16 computes the 16 bit Internet checksum.
Package csum16 computes the 16 bit Internet checksum.
hash/hash16
Package hash16 provides interfaces for functions computing 16 bit hashes.
Package hash16 provides interfaces for functions computing 16 bit hashes.
queue
Package queue provides a queue to processes elements in FIFO order using a specified handler, while allowing non-blocking writes to the queue.
Package queue provides a queue to processes elements in FIFO order using a specified handler, while allowing non-blocking writes to the queue.
stats
Package stats implements Stats that collects data.
Package stats implements Stats that collects data.

Jump to

Keyboard shortcuts

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