Documentation ¶
Index ¶
- Constants
- Variables
- func Configure()
- func SetCsCapacity(capacity int)
- type CsEntry
- type CsLRU
- type CsReplacementPolicy
- type DeadNonceList
- type FibNextHopEntry
- type FibStrategyEntry
- func (f *FibStrategyEntry) AddNexthop(name *ndn.Name, nexthop uint64, cost uint64)
- func (f *FibStrategyEntry) ClearNexthops(name *ndn.Name)
- func (f *FibStrategyEntry) GetAllFIBEntries() []*FibStrategyEntry
- func (f *FibStrategyEntry) GetAllStrategyChoices() []*FibStrategyEntry
- func (f *FibStrategyEntry) GetNexthops() []*FibNextHopEntry
- func (f *FibStrategyEntry) GetStrategy() *ndn.Name
- func (f *FibStrategyEntry) LongestPrefixNexthops(name *ndn.Name) []*FibNextHopEntry
- func (f *FibStrategyEntry) LongestPrefixStrategy(name *ndn.Name) *ndn.Name
- func (f *FibStrategyEntry) RemoveNexthop(name *ndn.Name, nexthop uint64)
- func (f *FibStrategyEntry) SetStrategy(name *ndn.Name, strategy *ndn.Name)
- func (f *FibStrategyEntry) UnsetStrategy(name *ndn.Name)
- type PitCs
- func (p *PitCs) CsSize() int
- func (p *PitCs) FindMatchingDataCS(interest *ndn.Interest) *CsEntry
- func (p *PitCs) FindOrInsertPIT(interest *ndn.Interest, hint *ndn.Delegation, inFace uint64) (*PitEntry, bool)
- func (p *PitCs) FindPITFromData(data *ndn.Data, token *uint32) []*PitEntry
- func (p *PitCs) InsertDataCS(data *ndn.Data)
- func (p *PitCs) IsCsAdmitting() bool
- func (p *PitCs) IsCsServing() bool
- func (p *PitCs) PitSize() int
- func (p *PitCs) RemovePITEntry(pitEntry *PitEntry) bool
- type PitCsNode
- type PitEntry
- func (e *PitEntry) ClearInRecords()
- func (e *PitEntry) ClearOutRecords()
- func (e *PitEntry) FindOrInsertInRecord(interest *ndn.Interest, face uint64, incomingPitToken []byte) (*PitInRecord, bool)
- func (e *PitEntry) FindOrInsertOutRecord(interest *ndn.Interest, face uint64) *PitOutRecord
- func (e *PitEntry) SetExpirationTimerToNow()
- func (e *PitEntry) UpdateExpirationTimer()
- type PitInRecord
- type PitOutRecord
- type RibEntry
- type Route
Constants ¶
const ( RouteFlagChildInherit uint64 = 0x01 RouteFlagCapture uint64 = 0x02 )
Route flags.
const ( RouteOriginApp uint64 = 0 RouteOriginStatic uint64 = 255 RouteOriginNLSR uint64 = 128 RouteOriginPrefixAnn uint64 = 129 RouteOriginClient uint64 = 65 RouteOriginAutoreg uint64 = 64 RouteOriginAutoconf uint64 = 66 )
Route origins.
Variables ¶
var Measurements *measurements
Measurements contains the global measurements table,
var NetworkRegion *networkRegionTable
NetworkRegion contains producer region names for this forwarder..
Functions ¶
func SetCsCapacity ¶
func SetCsCapacity(capacity int)
SetCsCapacity sets the CS capacity from management.
Types ¶
type CsEntry ¶
type CsEntry struct { Data *ndn.Data StaleTime time.Time // contains filtered or unexported fields }
CsEntry is an entry in a thread's CS.
type CsLRU ¶
type CsLRU struct {
// contains filtered or unexported fields
}
CsLRU is a least recently used (LRU) replacement policy for the Content Store.
func (*CsLRU) AfterInsert ¶
AfterInsert is called after a new entry is inserted into the Content Store.
func (*CsLRU) AfterRefresh ¶
AfterRefresh is called after a new data packet refreshes an existing entry in the Content Store.
func (*CsLRU) BeforeErase ¶
BeforeErase is called before an entry is erased from the Content Store through management.
func (*CsLRU) BeforeUse ¶
BeforeUse is called before an entry in the Content Store is used to satisfy a pending Interest.
func (*CsLRU) EvictEntries ¶
func (l *CsLRU) EvictEntries()
EvictEntries is called to instruct the policy to evict enough entries to reduce the Content Store size below its size limit.
type CsReplacementPolicy ¶
type CsReplacementPolicy interface { // AfterInsert is called after a new entry is inserted into the Content Store. AfterInsert(index uint64, data *ndn.Data) // AfterRefresh is called after a new data packet refreshes an existing entry in the Content Store. AfterRefresh(index uint64, data *ndn.Data) // BeforeErase is called before an entry is erased from the Content Store through management. BeforeErase(index uint64, data *ndn.Data) // BeforeUse is called before an entry in the Content Store is used to satisfy a pending Interest. BeforeUse(index uint64, data *ndn.Data) // EvictEntries is called to instruct the policy to evict enough entries to reduce the Content Store size below its size limit. EvictEntries() }
CsReplacementPolicy represents a cache replacement policy for the Content Store.
type DeadNonceList ¶
type DeadNonceList struct { ExpirationTimer chan bool // contains filtered or unexported fields }
DeadNonceList represents the Dead Nonce List for a forwarding thread.
func NewDeadNonceList ¶
func NewDeadNonceList() *DeadNonceList
NewDeadNonceList creates a new Dead Nonce List for a forwarding thread.
func (*DeadNonceList) Find ¶
func (d *DeadNonceList) Find(name *ndn.Name, nonce []byte) bool
Find returns whether the specified name and nonce combination are present in the Dead Nonce List.
func (*DeadNonceList) Insert ¶
func (d *DeadNonceList) Insert(name *ndn.Name, nonce []byte) bool
Insert inserts an entry in the Dead Nonce List with the specified name and nonce. Returns whether nonce already present.
func (*DeadNonceList) RemoveExpiredEntry ¶
func (d *DeadNonceList) RemoveExpiredEntry()
RemoveExpiredEntry removes the front entry from Dead Nonce List.
type FibNextHopEntry ¶
FibNextHopEntry represents a nexthop in a FIB entry.
type FibStrategyEntry ¶
FibStrategyEntry represents an entry in the FIB-Strategy table.
var FibStrategyTable *FibStrategyEntry
FibStrategyTable is a table containing FIB and Strategy entries for given prefixes.
func (*FibStrategyEntry) AddNexthop ¶
func (f *FibStrategyEntry) AddNexthop(name *ndn.Name, nexthop uint64, cost uint64)
AddNexthop adds or updates a nexthop entry for the specified prefix.
func (*FibStrategyEntry) ClearNexthops ¶
func (f *FibStrategyEntry) ClearNexthops(name *ndn.Name)
ClearNexthops clears all nexthops for the specified prefix.
func (*FibStrategyEntry) GetAllFIBEntries ¶
func (f *FibStrategyEntry) GetAllFIBEntries() []*FibStrategyEntry
GetAllFIBEntries returns all nexthop entries in the FIB.
func (*FibStrategyEntry) GetAllStrategyChoices ¶
func (f *FibStrategyEntry) GetAllStrategyChoices() []*FibStrategyEntry
GetAllStrategyChoices returns all strategy choice entries in the Strategy Table.
func (*FibStrategyEntry) GetNexthops ¶
func (f *FibStrategyEntry) GetNexthops() []*FibNextHopEntry
GetNexthops gets nexthops in the specified entry.
func (*FibStrategyEntry) GetStrategy ¶
func (f *FibStrategyEntry) GetStrategy() *ndn.Name
GetStrategy gets the strategy set at the current node.
func (*FibStrategyEntry) LongestPrefixNexthops ¶
func (f *FibStrategyEntry) LongestPrefixNexthops(name *ndn.Name) []*FibNextHopEntry
LongestPrefixNexthops returns the longest-prefix matching nexthop(s) matching the specified name.
func (*FibStrategyEntry) LongestPrefixStrategy ¶
func (f *FibStrategyEntry) LongestPrefixStrategy(name *ndn.Name) *ndn.Name
LongestPrefixStrategy returns the longest-prefix matching strategy choice entry for the specified name.
func (*FibStrategyEntry) RemoveNexthop ¶
func (f *FibStrategyEntry) RemoveNexthop(name *ndn.Name, nexthop uint64)
RemoveNexthop removes the specified nexthop entry from the specified prefix.
func (*FibStrategyEntry) SetStrategy ¶
func (f *FibStrategyEntry) SetStrategy(name *ndn.Name, strategy *ndn.Name)
SetStrategy sets the strategy for the specified prefix.
func (*FibStrategyEntry) UnsetStrategy ¶
func (f *FibStrategyEntry) UnsetStrategy(name *ndn.Name)
UnsetStrategy unsets the strategy for the specified prefix.
type PitCs ¶
type PitCs struct { ExpiringPitEntries chan *PitEntry // contains filtered or unexported fields }
PitCs represents the PIT-CS tree for a thread.
func NewPitCS ¶
func NewPitCS() *PitCs
NewPitCS creates a new combined PIT-CS for a forwarding thread.
func (*PitCs) FindMatchingDataCS ¶
FindMatchingDataCS finds the best matching entry in the CS (if any). If MustBeFresh is set to true in the Interest, only non-stale CS entries will be returned.
func (*PitCs) FindOrInsertPIT ¶
func (p *PitCs) FindOrInsertPIT(interest *ndn.Interest, hint *ndn.Delegation, inFace uint64) (*PitEntry, bool)
FindOrInsertPIT inserts an entry in the PIT upon receipt of an Interest. Returns tuple of PIT entry and whether the Nonce is a duplicate.
func (*PitCs) FindPITFromData ¶
FindPITFromData finds the PIT entries matching a Data packet. Note that this does not consider the effect of MustBeFresh.
func (*PitCs) InsertDataCS ¶
InsertDataCS inserts a Data packet into the Content Store.
func (*PitCs) IsCsAdmitting ¶
IsCsAdmitting returns whether the CS is admitting contents.
func (*PitCs) IsCsServing ¶
IsCsServing returns whether the CS is serving contents.
func (*PitCs) RemovePITEntry ¶
RemovePITEntry removes the specified PIT entry.
type PitCsNode ¶
type PitCsNode struct {
// contains filtered or unexported fields
}
PitCsNode represents an entry in a PIT-CS tree.
type PitEntry ¶
type PitEntry struct { Name *ndn.Name CanBePrefix bool MustBeFresh bool ForwardingHint *ndn.Delegation // Interests must match in terms of Forwarding Hint to be aggregated in PIT. InRecords map[uint64]*PitInRecord // Key is face ID OutRecords map[uint64]*PitOutRecord // Key is face ID ExpirationTime time.Time Satisfied bool Token uint32 // contains filtered or unexported fields }
PitEntry is an entry in a thread's PIT.
func (*PitEntry) ClearInRecords ¶
func (e *PitEntry) ClearInRecords()
ClearInRecords removes all in-records from the PIT entry.
func (*PitEntry) ClearOutRecords ¶
func (e *PitEntry) ClearOutRecords()
ClearOutRecords removes all out-records from the PIT entry.
func (*PitEntry) FindOrInsertInRecord ¶
func (e *PitEntry) FindOrInsertInRecord(interest *ndn.Interest, face uint64, incomingPitToken []byte) (*PitInRecord, bool)
FindOrInsertInRecord finds or inserts an InRecord for the face, updating the metadata and returning whether there was already an in-record in the entry.
func (*PitEntry) FindOrInsertOutRecord ¶
func (e *PitEntry) FindOrInsertOutRecord(interest *ndn.Interest, face uint64) *PitOutRecord
FindOrInsertOutRecord finds or inserts an OutRecord for the face, updating the metadata.
func (*PitEntry) SetExpirationTimerToNow ¶
func (e *PitEntry) SetExpirationTimerToNow()
SetExpirationTimerToNow updates the expiration timer to the current time.
func (*PitEntry) UpdateExpirationTimer ¶
func (e *PitEntry) UpdateExpirationTimer()
UpdateExpirationTimer updates the expiration timer to the latest expiration time of any in or out record in the entry.
type PitInRecord ¶
type PitInRecord struct { Face uint64 LatestNonce []byte LatestTimestamp time.Time LatestInterest *ndn.Interest ExpirationTime time.Time PitToken []byte }
PitInRecord records an incoming Interest on a given face.
type PitOutRecord ¶
type PitOutRecord struct { Face uint64 LatestNonce []byte LatestTimestamp time.Time LatestInterest *ndn.Interest ExpirationTime time.Time }
PitOutRecord records an outgoing Interest on a given face.
type RibEntry ¶
RibEntry represents an entry in the RIB table.
var Rib *RibEntry
Rib is a table containing the RIB.
func (*RibEntry) AddRoute ¶
func (r *RibEntry) AddRoute(name *ndn.Name, faceID uint64, origin uint64, cost uint64, flags uint64, expirationPeriod *time.Duration)
AddRoute adds or updates a RIB entry for the specified prefix.
func (*RibEntry) GetAllEntries ¶
GetAllEntries returns all routes in the FIB.