Documentation ¶
Overview ¶
Package prefix implements a Lucius table that performs packet matches using the longest prefix match and satisfies the interface fwdtable.Table. All entries in the prefix tree are maintained in network order.
Index ¶
- func Calculate(byteCount int) int
- func Count(bs []byte) int
- 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) Process(packet fwdpacket.Packet, counters 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 ¶
Types ¶
type EntryDesc ¶
type EntryDesc []*fwdpb.PacketFieldMaskedBytes
A EntryDesc describes a table entry as a set of packet field ids and the corresponding mask and value.
type Table ¶
A Table is a table which is looked up using a longest prefix 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.
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 and reallocating an empty root.
func (*Table) Process ¶
func (t *Table) Process(packet fwdpacket.Packet, counters 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.