Documentation ¶
Overview ¶
Package entries contains implementation of various P4 entitites such as tables, groups, meters, etc.
Index ¶
- type Action
- type BatchSender
- type Counter
- type Counters
- type Meter
- type Meters
- type ReadType
- type Row
- type Table
- func (t *Table) Entries() []*p4api.TableEntry
- func (t *Table) ID() uint32
- func (t *Table) ModifyDirectCounterEntry(entry *p4api.DirectCounterEntry) error
- func (t *Table) ModifyDirectMeterEntry(entry *p4api.DirectMeterEntry) error
- func (t *Table) ModifyTableEntry(entry *p4api.TableEntry, insert bool) error
- func (t *Table) Name() string
- func (t *Table) ReadTableEntries(request *p4api.TableEntry, readType ReadType, sender BatchSender) error
- func (t *Table) RemoveTableEntry(entry *p4api.TableEntry) error
- func (t *Table) Size() int
- type Tables
- func (ts *Tables) ModifyDirectCounterEntry(entry *p4api.DirectCounterEntry, insert bool) error
- func (ts *Tables) ModifyDirectMeterEntry(entry *p4api.DirectMeterEntry, insert bool) error
- func (ts *Tables) ModifyTableEntry(entry *p4api.TableEntry, insert bool) error
- func (ts *Tables) NewTable(table *p4info.Table) *Table
- func (ts *Tables) ReadTableEntries(request *p4api.TableEntry, readType ReadType, sender BatchSender) error
- func (ts *Tables) RemoveTableEntry(entry *p4api.TableEntry) error
- func (ts *Tables) Table(id uint32) *Table
- func (ts *Tables) Tables() []*Table
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatchSender ¶
BatchSender is an abstract function for returning batches of read entities
type Counter ¶
type Counter struct {
// contains filtered or unexported fields
}
Counter represents all cells of a specific counter
func (*Counter) Cell ¶
func (c *Counter) Cell(index int64) *p4api.CounterEntry
Cell returns the specified cell of the counter
type Counters ¶
type Counters struct {
// contains filtered or unexported fields
}
Counters represents a set of P4 counters
func NewCounters ¶
NewCounters creates a new counters store
func (*Counters) ModifyCounterEntry ¶
func (cs *Counters) ModifyCounterEntry(entry *p4api.CounterEntry, insert bool) error
ModifyCounterEntry modifies the specified counter entry cell
type Meter ¶
type Meter struct {
// contains filtered or unexported fields
}
Meter represents all cells of a specific meter
type Meters ¶
type Meters struct {
// contains filtered or unexported fields
}
Meters represents a set of P4 meters
func (*Meters) ModifyMeterEntry ¶
func (ms *Meters) ModifyMeterEntry(entry *p4api.MeterEntry, insert bool) error
ModifyMeterEntry modifies the specified meter entry cell
type ReadType ¶
type ReadType byte
ReadType specifies whether to read table entry, its direct counter or its direct meter
const ( // ReadTableEntry specified that reads should return entities with TableEntry ReadTableEntry ReadType = iota // ReadDirectCounter specified that reads should return entities with DirectCounterEntry ReadDirectCounter // ReadDirectMeter specified that reads should return entities with DirectMeterEntry ReadDirectMeter )
type Row ¶
type Row struct {
// contains filtered or unexported fields
}
Row represents table row entry and its mutable direct resources
type Table ¶
type Table struct {
// contains filtered or unexported fields
}
Table represents a single P4 table
func (*Table) Entries ¶ added in v0.1.2
func (t *Table) Entries() []*p4api.TableEntry
Entries returns a copy of the table entries; in no particular order
func (*Table) ModifyDirectCounterEntry ¶
func (t *Table) ModifyDirectCounterEntry(entry *p4api.DirectCounterEntry) error
ModifyDirectCounterEntry modifies the specified direct counter entry data
func (*Table) ModifyDirectMeterEntry ¶
func (t *Table) ModifyDirectMeterEntry(entry *p4api.DirectMeterEntry) error
ModifyDirectMeterEntry modifies the specified direct meter entry data
func (*Table) ModifyTableEntry ¶
func (t *Table) ModifyTableEntry(entry *p4api.TableEntry, insert bool) error
ModifyTableEntry inserts or modifies the specified entry
func (*Table) ReadTableEntries ¶
func (t *Table) ReadTableEntries(request *p4api.TableEntry, readType ReadType, sender BatchSender) error
ReadTableEntries reads the table entries matching the specified table entry request
func (*Table) RemoveTableEntry ¶
func (t *Table) RemoveTableEntry(entry *p4api.TableEntry) error
RemoveTableEntry removes the specified table entry and any direct counter data and meter configs for that entry
type Tables ¶
type Tables struct {
// contains filtered or unexported fields
}
Tables represents a set of P4 tables
func (*Tables) ModifyDirectCounterEntry ¶
func (ts *Tables) ModifyDirectCounterEntry(entry *p4api.DirectCounterEntry, insert bool) error
ModifyDirectCounterEntry modifies the specified direct counter entry in its appropriate table
func (*Tables) ModifyDirectMeterEntry ¶
func (ts *Tables) ModifyDirectMeterEntry(entry *p4api.DirectMeterEntry, insert bool) error
ModifyDirectMeterEntry modifies the specified direct meter entry in its appropriate table
func (*Tables) ModifyTableEntry ¶
func (ts *Tables) ModifyTableEntry(entry *p4api.TableEntry, insert bool) error
ModifyTableEntry modifies the specified table entry in its appropriate table
func (*Tables) ReadTableEntries ¶
func (ts *Tables) ReadTableEntries(request *p4api.TableEntry, readType ReadType, sender BatchSender) error
ReadTableEntries reads the table entries matching the specified table entry, from the appropriate table
func (*Tables) RemoveTableEntry ¶
func (ts *Tables) RemoveTableEntry(entry *p4api.TableEntry) error
RemoveTableEntry removes the specified table entry from its appropriate table