NS-3 based Named Data Networking (NDN) simulator
ndnSIM: NDN, CCN, CCNx, content centric networks
API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
ns3::ndn::fib::FibImpl Class Reference

Class implementing FIB functionality. More...

#include <ndn-fib-impl.h>

Inheritance diagram for ns3::ndn::fib::FibImpl:
Collaboration diagram for ns3::ndn::fib::FibImpl:

Public Types

typedef
ndnSIM::trie_with_policy< Name,
ndnSIM::smart_pointer_payload_traits
< EntryImpl >
, ndnSIM::counting_policy_traits
super
 

Public Member Functions

 FibImpl ()
 Constructor.
 
virtual Ptr< EntryLongestPrefixMatch (const Interest &interest)
 Perform longest prefix match. More...
 
virtual Ptr< fib::EntryFind (const Name &prefix)
 Get FIB entry for the prefix (exact match) More...
 
virtual Ptr< EntryAdd (const Name &prefix, Ptr< Face > face, int32_t metric)
 Add or update FIB entry. More...
 
virtual Ptr< EntryAdd (const Ptr< const Name > &prefix, Ptr< Face > face, int32_t metric)
 Add or update FIB entry using smart pointer to prefix. More...
 
virtual void Remove (const Ptr< const Name > &prefix)
 Remove FIB entry. More...
 
virtual void InvalidateAll ()
 Invalidate all FIB entries.
 
virtual void RemoveFromAll (Ptr< Face > face)
 Remove all references to a face from FIB. More...
 
virtual void Print (std::ostream &os) const
 Print out entries in FIB.
 
virtual uint32_t GetSize () const
 Get number of entries in FIB.
 
virtual Ptr< const EntryBegin () const
 Return first element of FIB (no order guaranteed)
 
virtual Ptr< EntryBegin ()
 Return first element of FIB (no order guaranteed)
 
virtual Ptr< const EntryEnd () const
 Return item next after last (no order guaranteed)
 
virtual Ptr< EntryEnd ()
 Return item next after last (no order guaranteed)
 
virtual Ptr< const EntryNext (Ptr< const Entry > item) const
 
virtual Ptr< EntryNext (Ptr< Entry > item)
 
- Public Member Functions inherited from ns3::ndn::Fib
 Fib ()
 Default constructor.
 
virtual ~Fib ()
 Virtual destructor.
 
virtual Ptr< const fib::EntryNext (Ptr< const fib::Entry >) const =0
 Advance the iterator.
 
virtual Ptr< fib::EntryNext (Ptr< fib::Entry >)=0
 Advance the iterator.
 

Static Public Member Functions

static TypeId GetTypeId ()
 Interface ID. More...
 
- Static Public Member Functions inherited from ns3::ndn::Fib
static TypeId GetTypeId ()
 Interface ID. More...
 
static Ptr< FibGetFib (Ptr< Object > node)
 Static call to cheat python bindings.
 

Protected Member Functions

virtual void NotifyNewAggregate ()
 Notify when object is aggregated.
 
virtual void DoDispose ()
 Perform cleanup.
 
- Protected Member Functions inherited from ns3::ndn::ndnSIM::trie_with_policy< Name, ndnSIM::smart_pointer_payload_traits< EntryImpl >, ndnSIM::counting_policy_traits >
 trie_with_policy (size_t bucketSize=1, size_t bucketIncrement=1)
 
std::pair< iterator, bool > insert (const Name &key, typename ndnSIM::smart_pointer_payload_traits< EntryImpl >::insert_type payload)
 
void erase (const Name &key)
 
void erase (iterator node)
 
void clear ()
 
bool modify (iterator position, Modifier mod)
 
iterator find_exact (const Name &key)
 Find a node that has the exact match with the key.
 
iterator longest_prefix_match (const Name &key)
 Find a node that has the longest common prefix with key (FIB/PIT lookup)
 
iterator longest_prefix_match_if (const Name &key, Predicate pred)
 Find a node that has the longest common prefix with key (FIB/PIT lookup)
 
iterator deepest_prefix_match (const Name &key)
 Const version of the longest common prefix match (semi-const, because there could be update of the policy anyways) More...
 
iterator deepest_prefix_match_if (const Name &key, Predicate pred)
 Find a node that has prefix at least as the key.
 
iterator deepest_prefix_match_if_next_level (const Name &key, Predicate pred)
 Find a node that has prefix at least as the key. More...
 
iterator end () const
 
const parent_triegetTrie () const
 
parent_triegetTrie ()
 
const policy_container & getPolicy () const
 
policy_container & getPolicy ()
 

Additional Inherited Members

- Protected Types inherited from ns3::ndn::ndnSIM::trie_with_policy< Name, ndnSIM::smart_pointer_payload_traits< EntryImpl >, ndnSIM::counting_policy_traits >
typedef trie< Name,
ndnSIM::smart_pointer_payload_traits
< EntryImpl >, typename
ndnSIM::counting_policy_traits::policy_hook_type
parent_trie
 
typedef parent_trie::iterator iterator
 
typedef parent_trie::const_iterator const_iterator
 
typedef
ndnSIM::counting_policy_traits::template
policy< trie_with_policy< Name,
ndnSIM::smart_pointer_payload_traits
< EntryImpl >
, ndnSIM::counting_policy_traits >
, parent_trie, typename
ndnSIM::counting_policy_traits::template
container_hook< parent_trie >
::type >::type 
policy_container
 
- Static Protected Member Functions inherited from ns3::ndn::ndnSIM::trie_with_policy< Name, ndnSIM::smart_pointer_payload_traits< EntryImpl >, ndnSIM::counting_policy_traits >
static iterator s_iterator_to (typename parent_trie::iterator item)
 

Detailed Description

Class implementing FIB functionality.

Definition at line 70 of file ndn-fib-impl.h.

Member Function Documentation

Ptr< Entry > ns3::ndn::fib::FibImpl::Add ( const Name prefix,
Ptr< Face face,
int32_t  metric 
)
virtual

Add or update FIB entry.

If the entry exists, metric will be updated. Otherwise, new entry will be created

Parameters
namePrefix
faceForwarding face
metricRouting metric

Implements ns3::ndn::Fib.

Definition at line 99 of file ndn-fib-impl.cc.

Ptr< Entry > ns3::ndn::fib::FibImpl::Add ( const Ptr< const Name > &  prefix,
Ptr< Face face,
int32_t  metric 
)
virtual

Add or update FIB entry using smart pointer to prefix.

If the entry exists, metric will be updated. Otherwise, new entry will be created

Parameters
nameSmart pointer to prefix
faceForwarding face
metricRouting metric

Implements ns3::ndn::Fib.

Definition at line 105 of file ndn-fib-impl.cc.

References ns3::ndn::fib::Entry::AddOrUpdateRoutingMetric().

Ptr< fib::Entry > ns3::ndn::fib::FibImpl::Find ( const Name prefix)
virtual

Get FIB entry for the prefix (exact match)

Parameters
prefixName for FIB entry
Returns
If entry is found, a valid iterator (Ptr<fib::Entry>) will be returned. Otherwise End () (==0)

Implements ns3::ndn::Fib.

Definition at line 87 of file ndn-fib-impl.cc.

References ns3::ndn::ndnSIM::trie_with_policy< Name, ndnSIM::smart_pointer_payload_traits< EntryImpl >, ndnSIM::counting_policy_traits >::find_exact().

TypeId ns3::ndn::fib::FibImpl::GetTypeId ( void  )
static

Interface ID.

Returns
interface ID

Definition at line 46 of file ndn-fib-impl.cc.

Ptr< Entry > ns3::ndn::fib::FibImpl::LongestPrefixMatch ( const Interest interest)
virtual

Perform longest prefix match.

Todo:
Implement exclude filters
Parameters
interestInterest packet header
Returns
If entry found a valid iterator (Ptr<fib::Entry>) will be returned, otherwise End () (==0)

Implements ns3::ndn::Fib.

Definition at line 75 of file ndn-fib-impl.cc.

References ns3::ndn::Interest::GetName(), and ns3::ndn::ndnSIM::trie_with_policy< Name, ndnSIM::smart_pointer_payload_traits< EntryImpl >, ndnSIM::counting_policy_traits >::longest_prefix_match().

void ns3::ndn::fib::FibImpl::Remove ( const Ptr< const Name > &  prefix)
virtual

Remove FIB entry.

! ATTENTION ! Use with caution. All PIT entries referencing the corresponding FIB entry will become invalid. So, simulation may crash.

Parameters
nameSmart pointer to prefix

Implements ns3::ndn::Fib.

Definition at line 137 of file ndn-fib-impl.cc.

References ns3::ndn::ndnSIM::trie_with_policy< Name, ndnSIM::smart_pointer_payload_traits< EntryImpl >, ndnSIM::counting_policy_traits >::find_exact().

void ns3::ndn::fib::FibImpl::RemoveFromAll ( Ptr< Face face)
virtual

Remove all references to a face from FIB.

If for some enty that face was the only element, this FIB entry will be removed.

Implements ns3::ndn::Fib.

Definition at line 196 of file ndn-fib-impl.cc.

References Begin(), and End().


The documentation for this class was generated from the following files: