Documentation ¶
Overview ¶
Package exact implements a Lucius table that performs packet matches using an exact match match and satisfies the interface fwdtable.Table.
Index ¶
- type Entry
- type EntryDesc
- type Table
- func (t *Table) AddEntry(ed *fwdpb.EntryDesc, ad []*fwdpb.ActionDesc) error
- func (t *Table) Cleanup()
- func (t *Table) Clear()
- func (t *Table) Entries() []string
- func (t *Table) Find(key tableutil.Key) *Entry
- func (t *Table) Process(packet fwdpacket.Packet, _ fwdobject.Counters) (fwdaction.Actions, fwdaction.State)
- func (t *Table) RemoveEntry(ed *fwdpb.EntryDesc) error
- func (t *Table) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Entry ¶
type Entry struct {
// contains filtered or unexported fields
}
An Entry is an entry in an exact-match table. It maps a key to Actions. An entry is a part of a hash table collision list and an optional stale entry list.
type EntryDesc ¶
type EntryDesc []*fwdpb.PacketFieldBytes
EntryDesc describes a table entry as a set of pairs of packet-field-ids and packet-field-values.
type Table ¶
A Table is a table that matches packets to entries using exact-match. Entries in the table are described by a keyDesc. Packets match an entry if the key made from the packet is equal to the key made from the entry. The table also has a set of actions which are used to process packets that do not match any entry in the table.
The forwarding infrastructure calls the AddEntry, RemoveEntry and Entries methods while holding a write lock on the context, and calls the Process function while holding a read lock on the context. The stale list monitor goroutine calls the Remove method while holding the write lock on the context. Since the stale list can be manipulated simultaneously by the monitor and packet processing goroutines, the table has a mutex to protect stale list operations.
func New ¶
New creates a new exact-match table. The table also has a stale list if a timeout is specified for transient entries.
func (*Table) Cleanup ¶
func (t *Table) Cleanup()
Cleanup releases all references held by the table and its entries.
func (*Table) Clear ¶
func (t *Table) Clear()
Clear removes all entries in the table by walking all entries in the table and deleting them.
func (*Table) Entries ¶
Entries lists all entries in a table. Note that the order of entries is non-deterministic.
func (*Table) Process ¶
func (t *Table) Process(packet fwdpacket.Packet, _ fwdobject.Counters) (fwdaction.Actions, fwdaction.State)
Process matches the packet to the entries within the table to determine the actions to be performed. If the packet does not match any entries, the default actions are used. In case of errors, the packet is dropped.
func (*Table) RemoveEntry ¶
RemoveEntry removes an entry.