Documentation ¶
Overview ¶
Package pit implements the Pending Interest Table.
Index ¶
- Variables
- type Counters
- type DnRecord
- type Entry
- type FindResult
- type Pit
- func (pit *Pit) Erase(entry *Entry)
- func (pit *Pit) FindByData(data *ndni.Packet) FindResult
- func (pit *Pit) FindByNack(nack *ndni.Packet) *Entry
- func (pit *Pit) Insert(interest *ndni.Packet, fibEntry *fibreplica.Entry) (pitEntry *Entry, csEntry *cs.Entry)
- func (pit *Pit) Len() int
- func (pit *Pit) ReadCounters() (cnt Counters)
- func (pit *Pit) TriggerTimeoutSched()
- type SuppressConfig
- type UpRecord
Constants ¶
This section is empty.
Variables ¶
var GqlCountersType = graphql.NewObject(graphql.ObjectConfig{ Name: "PitCounters", Fields: graphql.BindFields(Counters{}), })
GqlCountersType is the GraphQL type for Counters.
Functions ¶
This section is empty.
Types ¶
type Counters ¶
type Counters struct { NEntries uint64 `json:"nEntries"` // current number of entries NInsert uint64 `json:"nInsert"` // how many inserts created a new PIT entry NFound uint64 `json:"nFound"` // how many inserts found an existing PIT entry NCsMatch uint64 `json:"nCsMatch"` // how many inserts matched a CS entry NAllocErr uint64 `json:"nAllocErr"` // how many inserts failed due to allocation error NDataHit uint64 `json:"nDataHit"` // how many find-by-Data found PIT entry/entries NDataMiss uint64 `json:"nDataMiss"` // how many find-by-Data did not find PIT entry NNackHit uint64 `json:"nNackHit"` // how many find-by-Nack found PIT entry NNackMiss uint64 `json:"nNackMiss"` // how many find-by-Nack did not found PIT entry NExpired uint64 `json:"nExpired"` // how many entries expired }
Counters contains PIT counters.
type DnRecord ¶
type DnRecord struct {
// contains filtered or unexported fields
}
DnRecord represents a PIT downstream record.
type Entry ¶
Entry represents a PIT entry.
func EntryFromPtr ¶
EntryFromPtr converts *C.PitEntry to Entry.
func (*Entry) FibSeqNum ¶
FibSeqNum returns the FIB insertion sequence number recorded in this entry.
func (*Entry) InsertDnRecord ¶
InsertDnRecord inserts new downstream record, or update existing downstream record.
type FindResult ¶
type FindResult C.PitFindResult
FindResult represents the result of Pit.FindByData.
func (FindResult) CopyToCPitFindResult ¶
func (fr FindResult) CopyToCPitFindResult(ptr unsafe.Pointer)
CopyToCPitFindResult copies this result to *C.PitFindResult.
func (FindResult) ListEntries ¶
func (fr FindResult) ListEntries() (entries []*Entry)
ListEntries returns matched PIT entries.
func (FindResult) NeedDataDigest ¶
func (fr FindResult) NeedDataDigest() bool
NeedDataDigest returns true if the result indicates that Data digest computation is needed.
type Pit ¶
Pit represents a Pending Interest Table (PIT).
func (*Pit) FindByData ¶
func (pit *Pit) FindByData(data *ndni.Packet) FindResult
FindByData searches for PIT entries matching a Data.
func (*Pit) FindByNack ¶
FindByNack searches for PIT entries matching a Nack.
func (*Pit) Insert ¶
func (pit *Pit) Insert(interest *ndni.Packet, fibEntry *fibreplica.Entry) (pitEntry *Entry, csEntry *cs.Entry)
Insert attempts to insert a PIT entry for the given Interest. It returns either a new or existing PIT entry, or a CS entry that satisfies the Interest.
func (*Pit) ReadCounters ¶
ReadCounters reads counters from this PIT.
func (*Pit) TriggerTimeoutSched ¶
func (pit *Pit) TriggerTimeoutSched()
TriggerTimeoutSched triggers the internal timeout scheduler.
type SuppressConfig ¶
type SuppressConfig struct { Min nnduration.Nanoseconds `json:"min,omitempty"` Max nnduration.Nanoseconds `json:"max,omitempty"` Multiplier float64 `json:"multiplier,omitempty"` }
SuppressConfig contains PIT suppression configuration.
func (SuppressConfig) CopyToC ¶
func (sc SuppressConfig) CopyToC(ptr unsafe.Pointer)
CopyToC copies this configuration to *C.PitSuppressConfig.