xorp

MribTable Class Reference

Base class for the Multicast Routing Information Base Table. More...

#include <mrib_table.hh>

Inheritance diagram for MribTable:
PimMribTable

List of all members.

Classes

class  PendingTransaction

Public Types

typedef MribTableIterator iterator

Public Member Functions

 MribTable (int family)
 Constructor for table of a given address family.
 ~MribTable ()
 Destructor.
int family () const
 Get the address family.
void clear ()
 Remove all entries and pending transactions (make the container empty).
void remove_all_entries ()
 Remove all entries.
list< Mrib * > & removed_mrib_entries ()
 Get a reference to the list with removed Mrib entries.
bool is_preserving_removed_mrib_entries () const
 Test if the removed Mrib entries are preserved or deleted.
void set_is_preserving_removed_mrib_entries (bool v)
 Enable or disable the preserving of the removed Mrib entries.
Mribinsert (const Mrib &mrib)
 Insert a copy of a Mrib entry.
void remove (const IPvXNet &dest_prefix)
 Remove from the table a Mrib entry for a given destination prefix.
void remove (const Mrib &mrib)
 Remove a Mrib entry from the table.
Mribfind (const IPvX &address) const
 Find the longest prefix match for an address.
Mribfind_exact (const IPvXNet &dest_prefix) const
 Find an exact match for a network address prefix.
iterator begin () const
 Get an iterator for the first element.
iterator end () const
 Get an iterator for the last element.
void update_entry_vif_index (const IPvXNet &dest_prefix, uint32_t vif_index)
 Update the vif index of a Mrib entry.
void add_pending_insert (uint32_t tid, const Mrib &mrib)
 Add a pending transaction to insert a Mrib entry from the table.
void add_pending_remove (uint32_t tid, const Mrib &mrib)
 Add a pending transaction to remove a Mrib entry from the table.
void add_pending_remove_all_entries (uint32_t tid)
 Add a pending transaction to remove all Mrib entries from the table.
void commit_pending_transactions (uint32_t tid)
 Commit pending transactions for adding or removing Mrib entries for a given transaction ID.
void abort_pending_transactions (uint32_t tid)
 Abort pending transactions for adding or removing Mrib entries for a given transaction ID.
void abort_all_pending_transactions ()
 Abort all pending transactions for adding or remove Mrib entries.
size_t size () const
 Get the number of Mrib entries in the table.

Private Member Functions

void remove_mrib_entry (Mrib *mrib)
 Remove a Mrib entry from the table.
MribLookupfind_prefix_mrib_lookup (const IPvXNet &addr_prefix) const
 Find an exact MribLookip match.
void remove_mrib_lookup (MribLookup *mrib_lookup)
 Remove a subtree of entries in the table.

Private Attributes

int _family
MribLookup_mrib_lookup_root
size_t _mrib_lookup_size
size_t _mrib_size
list< PendingTransaction_mrib_pending_transactions
bool _is_preserving_removed_mrib_entries
list< Mrib * > _removed_mrib_entries

Detailed Description

Base class for the Multicast Routing Information Base Table.


Constructor & Destructor Documentation

MribTable::MribTable ( int  family)

Constructor for table of a given address family.

MribTable::MribTable: : The address family (e.g., AF_INET or AF_INET6).

Parameters:
familythe address family.

MribTable constructor.

MribTable::~MribTable ( )

Destructor.

MribTable::~MribTable: @:

MribTable destructor. Remove and delete all MRIB entries and cleanup.


Member Function Documentation

void MribTable::abort_pending_transactions ( uint32_t  tid)

Abort pending transactions for adding or removing Mrib entries for a given transaction ID.

Parameters:
tidthe transaction ID of the entries to abort.
void MribTable::add_pending_insert ( uint32_t  tid,
const Mrib mrib 
)

Add a pending transaction to insert a Mrib entry from the table.

The operation is added to the list of pending transactions, but the entry itself is not added to the table (until MribTable::commit_pending_transactions() is called).

Parameters:
tidthe transaction ID.
mribthe Mrib entry that contains the information about the entry to add.
void MribTable::add_pending_remove ( uint32_t  tid,
const Mrib mrib 
)

Add a pending transaction to remove a Mrib entry from the table.

the operation is added to the list of pending transaction, but the entry itself is not removed from the table (until MribTable::commit_pending_transactions() is called).

Parameters:
tidthe transaction ID.
mribthe Mrib entry that contains the information about the entry to remove.

Reimplemented in PimMribTable.

void MribTable::add_pending_remove_all_entries ( uint32_t  tid)

Add a pending transaction to remove all Mrib entries from the table.

the operation is added to the list of pending transaction, but the entries themselves is not removed from the table (until MribTable::commit_pending_transactions() is called).

Parameters:
tidthe transaction ID.

Reimplemented in PimMribTable.

iterator MribTable::begin ( ) const [inline]

Get an iterator for the first element.

Returns:
the iterator for the first element.
void MribTable::commit_pending_transactions ( uint32_t  tid)

Commit pending transactions for adding or removing Mrib entries for a given transaction ID.

All pending transactions to add/remove Mrib entries for a given transaction ID are processes (see MribTable::add_pending_insert() and MribTable::add_pending_remove() and MribTable::add_pending_remove_all_entries()).

Parameters:
tidthe transaction ID of the entries to commit.

Reimplemented in PimMribTable.

iterator MribTable::end ( ) const [inline]

Get an iterator for the last element.

Returns:
the iterator for the last element.
int MribTable::family ( ) const [inline]

Get the address family.

Returns:
the address family ((e.g., AF_INET or AF_INET6 for IPv4 and IPv6 respectively).
Mrib * MribTable::find ( const IPvX address) const

Find the longest prefix match for an address.

Parameters:
addressthe lookup address.
Returns:
a pointer to the longest prefix Mrib match for address if exists, otherwise NULL.

Reimplemented in PimMribTable.

Mrib * MribTable::find_exact ( const IPvXNet dest_prefix) const

Find an exact match for a network address prefix.

Parameters:
dest_prefixthe lookup network address prefix.
Returns:
a pointer to the exact Mrib match for dest_prefix if exists, otherwise NULL.
MribLookup * MribTable::find_prefix_mrib_lookup ( const IPvXNet addr_prefix) const [private]

Find an exact MribLookip match.

Parameters:
addr_prefixthe lookup network address prefix.
Returns:
a pointer to the exact MribLookup match for addr_prefix if exists, otherwise NULL.
Mrib * MribTable::insert ( const Mrib mrib)

Insert a copy of a Mrib entry.

Note: if there is an existing Mrib entry for the same prefix, the old entry is deleted.

Parameters:
mribthe entry to insert.
Returns:
a pointer to the inserted entry on success, otherwise NULL.
bool MribTable::is_preserving_removed_mrib_entries ( ) const [inline]

Test if the removed Mrib entries are preserved or deleted.

Returns:
true if the removed Mrib entries are preserved, otherwise false.
void MribTable::remove ( const IPvXNet dest_prefix)

Remove from the table a Mrib entry for a given destination prefix.

Parameters:
dest_prefixthe destination prefix of the entry to remove.
void MribTable::remove ( const Mrib mrib)

Remove a Mrib entry from the table.

Parameters:
mriba Mrib with information about the entry to remove.
void MribTable::remove_mrib_entry ( Mrib mrib) [private]

Remove a Mrib entry from the table.

The Mrib entry itself is either deleted or added to the list with removed entries.

Parameters:
mribthe Mrib entry to remove.
void MribTable::remove_mrib_lookup ( MribLookup mrib_lookup) [private]

Remove a subtree of entries in the table.

Remove recursively all MribLookup below and including the given mrib_lookup entry.

Parameters:
mrib_lookupthe MribLookup entry that is the root of the subtree to remove.
list<Mrib *>& MribTable::removed_mrib_entries ( ) [inline]

Get a reference to the list with removed Mrib entries.

Returns:
a reference to the list with removed Mrib entries.
void MribTable::set_is_preserving_removed_mrib_entries ( bool  v) [inline]

Enable or disable the preserving of the removed Mrib entries.

Parameters:
vif true, then the removed Mrib entries are preserved otherwise they are deleted.
size_t MribTable::size ( ) const [inline]

Get the number of Mrib entries in the table.

Returns:
the number of Mrib entries in the table.
void MribTable::update_entry_vif_index ( const IPvXNet dest_prefix,
uint32_t  vif_index 
)

Update the vif index of a Mrib entry.

Parameters:
dest_prefixthe destination prefix of the Mrib entry to update.
vif_indexthe new vif index of the Mrib entry.

The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations