Documentation
¶
Overview ¶
Package forwarding manages forwarding contexts and forwarding objects.
Index ¶
- func AttributeInfo(ctx *fwdcontext.Context, arg interface{}) string
- func ContextInfo(ctx *fwdcontext.Context, _ interface{}) string
- func CounterInfo(obj fwdobject.Object) string
- func ObjectInfo(ctx *fwdcontext.Context, arg interface{}) string
- func PortInfo(_ *fwdcontext.Context, arg interface{}) (*fwdpb.PortElementInfo, error)
- func TableInfo(ctx *fwdcontext.Context, arg interface{}) string
- type Handler
- type InfoList
- func (l *InfoList) AddContext(ctx *fwdcontext.Context)
- func (l *InfoList) AddObject(ctx *fwdcontext.Context, obj fwdobject.Object)
- func (l *InfoList) Element(name string, infoType fwdpb.InfoType, frame []byte, start fwdpb.PacketHeaderId) (*fwdpb.InfoElementReply, error)
- func (l *InfoList) List() []string
- func (l *InfoList) RemoveContext(ctx *fwdcontext.Context)
- func (l *InfoList) RemoveObject(ctx *fwdcontext.Context, oid *fwdpb.ObjectId)
- type Server
- func (*Server) AttributeList(context.Context, *fwdpb.AttributeListRequest) (*fwdpb.AttributeListReply, error)
- func (e *Server) AttributeQuery(_ context.Context, request *fwdpb.AttributeQueryRequest) (*fwdpb.AttributeQueryReply, error)
- func (e *Server) AttributeUpdate(_ context.Context, request *fwdpb.AttributeUpdateRequest) (*fwdpb.AttributeUpdateReply, error)
- func (e *Server) ContextCreate(_ context.Context, request *fwdpb.ContextCreateRequest) (*fwdpb.ContextCreateReply, error)
- func (e *Server) ContextDelete(_ context.Context, request *fwdpb.ContextDeleteRequest) (*fwdpb.ContextDeleteReply, error)
- func (e *Server) ContextList(_ context.Context, request *fwdpb.ContextListRequest) (*fwdpb.ContextListReply, error)
- func (e *Server) FindContext(contextID *fwdpb.ContextId) (*fwdcontext.Context, error)
- func (e *Server) FlowCounterCreate(_ context.Context, request *fwdpb.FlowCounterCreateRequest) (*fwdpb.FlowCounterCreateReply, error)
- func (e *Server) FlowCounterQuery(_ context.Context, request *fwdpb.FlowCounterQueryRequest) (*fwdpb.FlowCounterQueryReply, error)
- func (e *Server) InfoElement(_ context.Context, request *fwdpb.InfoElementRequest) (*fwdpb.InfoElementReply, error)
- func (e *Server) InfoList(context.Context, *fwdpb.InfoListRequest) (*fwdpb.InfoListReply, error)
- func (e *Server) InjectPacket(contextID *fwdpb.ContextId, id *fwdpb.PortId, hid fwdpb.PacketHeaderId, ...) error
- func (e *Server) NotifySubscribe(sub *fwdpb.NotifySubscribeRequest, srv fwdpb.Forwarding_NotifySubscribeServer) error
- func (e *Server) ObjectCounters(_ context.Context, request *fwdpb.ObjectCountersRequest) (*fwdpb.ObjectCountersReply, error)
- func (e *Server) ObjectDelete(_ context.Context, request *fwdpb.ObjectDeleteRequest) (*fwdpb.ObjectDeleteReply, error)
- func (e *Server) ObjectList(_ context.Context, request *fwdpb.ObjectListRequest) (*fwdpb.ObjectListReply, error)
- func (e *Server) ObjectNID(_ context.Context, request *fwdpb.ObjectNIDRequest) (*fwdpb.ObjectNIDReply, error)
- func (e *Server) Operation(stream fwdpb.Forwarding_OperationServer) error
- func (e *Server) PacketInject(srv fwdpb.Forwarding_PacketInjectServer) error
- func (e *Server) PortCreate(_ context.Context, request *fwdpb.PortCreateRequest) (*fwdpb.PortCreateReply, error)
- func (e *Server) PortState(_ context.Context, request *fwdpb.PortStateRequest) (*fwdpb.PortStateReply, error)
- func (e *Server) PortUpdate(_ context.Context, request *fwdpb.PortUpdateRequest) (*fwdpb.PortUpdateReply, error)
- func (e *Server) SetCreate(_ context.Context, request *fwdpb.SetCreateRequest) (*fwdpb.SetCreateReply, error)
- func (e *Server) SetUpdate(_ context.Context, request *fwdpb.SetUpdateRequest) (*fwdpb.SetUpdateReply, error)
- func (e *Server) TableCreate(_ context.Context, request *fwdpb.TableCreateRequest) (*fwdpb.TableCreateReply, error)
- func (e *Server) TableEntryAdd(_ context.Context, request *fwdpb.TableEntryAddRequest) (*fwdpb.TableEntryAddReply, error)
- func (e *Server) TableEntryRemove(_ context.Context, request *fwdpb.TableEntryRemoveRequest) (*fwdpb.TableEntryRemoveReply, error)
- func (e *Server) TableList(_ context.Context, request *fwdpb.TableListRequest) (*fwdpb.TableListReply, error)
- func (e *Server) UpdateNotification(contextID *fwdpb.ContextId, notification fwdcontext.NotificationCallback) error
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 ¶
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 PortInfo ¶ added in v0.4.0
func PortInfo(_ *fwdcontext.Context, arg interface{}) (*fwdpb.PortElementInfo, error)
PortInfo returns the details of the specified Port.
func TableInfo ¶
func TableInfo(ctx *fwdcontext.Context, arg interface{}) string
TableInfo returns the details of the specified Table as a string.
Types ¶
type Handler ¶
type Handler func(*fwdcontext.Context, interface{}) string
A Handler returns the contents of an info element.
TODO(dgrau): Handler should return a *fwdpb.InfoElementReply so there can be structured infomation per entry/arg type.
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 (*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) (*fwdpb.InfoElementReply, error)
Element retrieves the contents of a specific information element.
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.
type Server ¶ added in v0.4.0
type Server struct {
fwdpb.UnimplementedForwardingServer
fwdpb.UnimplementedInfoServer
// contains filtered or unexported fields
}
A Server is an instance of the forwarding server. It contains a set of forwarding contexts, each of which contain forwarding objects such as tables, ports and actions.
func (*Server) AttributeList ¶ added in v0.4.0
func (*Server) AttributeList(context.Context, *fwdpb.AttributeListRequest) (*fwdpb.AttributeListReply, error)
AttributeList lists all attributes.
func (*Server) AttributeQuery ¶ added in v0.4.0
func (e *Server) AttributeQuery(_ context.Context, request *fwdpb.AttributeQueryRequest) (*fwdpb.AttributeQueryReply, error)
AttributeQuery queries attributes in a forwarding context.
func (*Server) AttributeUpdate ¶ added in v0.4.0
func (e *Server) AttributeUpdate(_ context.Context, request *fwdpb.AttributeUpdateRequest) (*fwdpb.AttributeUpdateReply, error)
AttributeUpdate updates attributes in a forwarding context.
func (*Server) ContextCreate ¶ added in v0.4.0
func (e *Server) 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 (*Server) ContextDelete ¶ added in v0.4.0
func (e *Server) ContextDelete(_ context.Context, request *fwdpb.ContextDeleteRequest) (*fwdpb.ContextDeleteReply, error)
ContextDelete deletes a context if it exists.
func (*Server) ContextList ¶ added in v0.4.0
func (e *Server) ContextList(_ context.Context, request *fwdpb.ContextListRequest) (*fwdpb.ContextListReply, error)
ContextList lists all the contexts in the system.
func (*Server) FindContext ¶ added in v0.4.0
FindContext finds the specified context.
func (*Server) FlowCounterCreate ¶ added in v0.4.0
func (e *Server) FlowCounterCreate(_ context.Context, request *fwdpb.FlowCounterCreateRequest) (*fwdpb.FlowCounterCreateReply, error)
FlowCounterCreate creates a flow counter with specified ObjectId in the specified context.
func (*Server) FlowCounterQuery ¶ added in v0.4.0
func (e *Server) FlowCounterQuery(_ context.Context, request *fwdpb.FlowCounterQueryRequest) (*fwdpb.FlowCounterQueryReply, error)
FlowCounterQuery queries for the values of specified counters.
func (*Server) InfoElement ¶ added in v0.4.0
func (e *Server) InfoElement(_ context.Context, request *fwdpb.InfoElementRequest) (*fwdpb.InfoElementReply, error)
InfoElement retrieves the contents of a specific information element.
func (*Server) InfoList ¶ added in v0.4.0
func (e *Server) InfoList(context.Context, *fwdpb.InfoListRequest) (*fwdpb.InfoListReply, error)
InfoList retrieves a list of all information elements.
func (*Server) InjectPacket ¶ added in v0.4.0
func (e *Server) InjectPacket(contextID *fwdpb.ContextId, id *fwdpb.PortId, hid fwdpb.PacketHeaderId, frame []byte, preActions []*fwdpb.ActionDesc, debug bool, dir fwdpb.PortAction) error
InjectPacket inserts a packet in the forwarding pipeline, orginating from the specified port.
func (*Server) NotifySubscribe ¶ added in v0.4.0
func (e *Server) NotifySubscribe(sub *fwdpb.NotifySubscribeRequest, srv fwdpb.Forwarding_NotifySubscribeServer) error
NotifySubscribe subscribes to notification for a forwarding context. TODO: Only one notification client is supported per forwarding context.
func (*Server) ObjectCounters ¶ added in v0.4.0
func (e *Server) ObjectCounters(_ context.Context, request *fwdpb.ObjectCountersRequest) (*fwdpb.ObjectCountersReply, error)
ObjectCounters retrieves all the counters associated on the object.
func (*Server) ObjectDelete ¶ added in v0.4.0
func (e *Server) ObjectDelete(_ context.Context, request *fwdpb.ObjectDeleteRequest) (*fwdpb.ObjectDeleteReply, error)
ObjectDelete deletes an object.
func (*Server) ObjectList ¶ added in v0.4.0
func (e *Server) ObjectList(_ context.Context, request *fwdpb.ObjectListRequest) (*fwdpb.ObjectListReply, error)
ObjectList lists all the objects in the system.
func (*Server) ObjectNID ¶ added in v0.4.0
func (e *Server) ObjectNID(_ context.Context, request *fwdpb.ObjectNIDRequest) (*fwdpb.ObjectNIDReply, error)
ObjectNID returns the numeric id for the object id if it exists.
func (*Server) Operation ¶ added in v0.4.0
func (e *Server) Operation(stream fwdpb.Forwarding_OperationServer) error
Operation processes incoming OperationRequests and extracts the contained Request.
func (*Server) PacketInject ¶ added in v0.4.0
func (e *Server) PacketInject(srv fwdpb.Forwarding_PacketInjectServer) error
PacketInject is a streaming RPC to inject a packets in the specified forwarding context and port.
func (*Server) PortCreate ¶ added in v0.4.0
func (e *Server) PortCreate(_ context.Context, request *fwdpb.PortCreateRequest) (*fwdpb.PortCreateReply, error)
PortCreate creates a port.
func (*Server) PortState ¶ added in v0.4.0
func (e *Server) PortState(_ context.Context, request *fwdpb.PortStateRequest) (*fwdpb.PortStateReply, error)
PortState controls and queries the port state.
func (*Server) PortUpdate ¶ added in v0.4.0
func (e *Server) PortUpdate(_ context.Context, request *fwdpb.PortUpdateRequest) (*fwdpb.PortUpdateReply, error)
PortUpdate updates a port.
func (*Server) SetCreate ¶ added in v0.4.0
func (e *Server) SetCreate(_ context.Context, request *fwdpb.SetCreateRequest) (*fwdpb.SetCreateReply, error)
SetCreate creates a new set.
func (*Server) SetUpdate ¶ added in v0.4.0
func (e *Server) SetUpdate(_ context.Context, request *fwdpb.SetUpdateRequest) (*fwdpb.SetUpdateReply, error)
SetUpdate updates a set.
func (*Server) TableCreate ¶ added in v0.4.0
func (e *Server) TableCreate(_ context.Context, request *fwdpb.TableCreateRequest) (*fwdpb.TableCreateReply, error)
TableCreate creates an empty table.
func (*Server) TableEntryAdd ¶ added in v0.4.0
func (e *Server) TableEntryAdd(_ context.Context, request *fwdpb.TableEntryAddRequest) (*fwdpb.TableEntryAddReply, error)
TableEntryAdd adds (or updates) an entry in a table.
func (*Server) TableEntryRemove ¶ added in v0.4.0
func (e *Server) TableEntryRemove(_ context.Context, request *fwdpb.TableEntryRemoveRequest) (*fwdpb.TableEntryRemoveReply, error)
TableEntryRemove removes an entry from the table.
func (*Server) TableList ¶ added in v0.4.0
func (e *Server) TableList(_ context.Context, request *fwdpb.TableListRequest) (*fwdpb.TableListReply, error)
TableList lists all the entries in the specified table.
func (*Server) UpdateNotification ¶ added in v0.4.0
func (e *Server) UpdateNotification(contextID *fwdpb.ContextId, notification fwdcontext.NotificationCallback) 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.
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 fwdconfig contains builders for varius proto types.
|
Package fwdconfig contains builders for varius proto types. |
|
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. |