xorp

Mrt< E > Class Template Reference

Template class for Multicast Routing Table. More...

#include <mrt.hh>

List of all members.

Public Types

typedef map< MreSgKey, E * > SgMap
typedef map< MreGsKey, E * > GsMap
typedef SgMap::iterator sg_iterator
typedef GsMap::iterator gs_iterator
typedef SgMap::const_iterator const_sg_iterator
typedef GsMap::const_iterator const_gs_iterator

Public Member Functions

 Mrt ()
 Default constructor.
virtual ~Mrt ()
 Destructor.
void clear ()
 Remove all multicast routing entries from the table.
E * insert (E *mre)
 Insert a multicast routing entry that was already created.
int remove (E *mre)
 Remove a multicast routing entry from the table.
E * find (const IPvX &source_addr, const IPvX &group_addr) const
 Find a multicast routing entry from the table.
E * find_source (const IPvX &source_addr) const
 Find the first multicast routing entry for a source address.
E * find_group (const IPvX &group_addr) const
 Find the first multicast routing entry for a group address.
E * find_source_by_prefix (const IPvXNet &prefix_s) const
 Find the first multicast routing entry for a source address prefix.
E * find_group_by_prefix (const IPvXNet &prefix_g) const
 Find the first multicast routing entry for a group address prefix.
size_t size () const
 Get the number of multicast routing entries in the table.
const_sg_iterator sg_begin () const
 Get an iterator for the first element in the source-group table.
const_gs_iterator gs_begin () const
 Get an iterator for the first element in the group-source table.
const_sg_iterator sg_end () const
 Get an iterator for the last element in the source-group table.
const_gs_iterator gs_end () const
 Get an iterator for the last element in the group-source table.
const_sg_iterator source_by_prefix_begin (const IPvXNet &prefix_s) const
 Find the source iterator for the first multicast routing entry for a source address prefix.
const_sg_iterator source_by_prefix_end (const IPvXNet &prefix_s) const
 Find the source iterator for the one-after-the-last multicast routing entry for a source address prefix.
const_gs_iterator group_by_prefix_begin (const IPvXNet &prefix_g) const
 Find the group iterator for the first multicast routing entry for a group address prefix.
const_gs_iterator group_by_prefix_end (const IPvXNet &prefix_g) const
 Find the group iterator for the one-after-the-last multicast routing entry for a group address prefix.
const_sg_iterator source_by_addr_begin (const IPvX &source_addr) const
 Find the source iterator for the first multicast routing entry for a source address.
const_sg_iterator source_by_addr_end (const IPvX &source_addr) const
 Find the source iterator for the one-after-the-last multicast routing entry for a source address.
const_gs_iterator group_by_addr_begin (const IPvX &group_addr) const
 Find the group iterator for the first multicast routing entry for a group address.
const_gs_iterator group_by_addr_end (const IPvX &group_addr) const
 Find the group iterator for the one-after-the-last multicast routing entry for a group address.
const_gs_iterator group_source_by_addr_begin (const IPvX &source_addr, const IPvX &group_addr) const
 Find the group iterator for the multicast routing entry for a source and a group address.
const_sg_iterator source_group_by_addr_begin (const IPvX &source_addr, const IPvX &group_addr) const
 Find the source iterator for the multicast routing entry for a source and a group address.

Private Attributes

SgMap _sg_table
GsMap _gs_table

Detailed Description

template<class E>
class Mrt< E >

Template class for Multicast Routing Table.


Member Function Documentation

template<class E>
void Mrt< E >::clear ( ) [inline]

Remove all multicast routing entries from the table.

Note that the entries themselves are also deleted.

template<class E>
E* Mrt< E >::find ( const IPvX source_addr,
const IPvX group_addr 
) const [inline]

Find a multicast routing entry from the table.

Parameters:
source_addrthe source address to search for.
group_addrthe group address to search for.
Returns:
the multicast routing entry for source source_addr and group group_addr if found, otherwise NULL.
template<class E>
E* Mrt< E >::find_group ( const IPvX group_addr) const [inline]

Find the first multicast routing entry for a group address.

Parameters:
group_addrthe group address to search for.
Returns:
the first multicast routing entry for group group_addr if found, otherwise NULL.
template<class E>
E* Mrt< E >::find_group_by_prefix ( const IPvXNet prefix_g) const [inline]

Find the first multicast routing entry for a group address prefix.

Parameters:
prefix_gthe group address prefix to search for.
Returns:
the first multicast routing entry for group address prefix prefix_g if found, otherwise NULL.
template<class E>
E* Mrt< E >::find_source ( const IPvX source_addr) const [inline]

Find the first multicast routing entry for a source address.

Parameters:
source_addrthe source address to search for.
Returns:
the first multicast routing entry for source source_addr if found, otherwise NULL.
template<class E>
E* Mrt< E >::find_source_by_prefix ( const IPvXNet prefix_s) const [inline]

Find the first multicast routing entry for a source address prefix.

Parameters:
prefix_sthe source address prefix to search for.
Returns:
the first multicast routing entry for source address prefix prefix_s if found, otherwise NULL.
template<class E>
const_gs_iterator Mrt< E >::group_by_addr_begin ( const IPvX group_addr) const [inline]

Find the group iterator for the first multicast routing entry for a group address.

Parameters:
group_addrthe group address to search for.
Returns:
the iterator for first entry with group address that matches group_addr. If no matching entry is found, the return value is group_by_addr_end().
template<class E>
const_gs_iterator Mrt< E >::group_by_addr_end ( const IPvX group_addr) const [inline]

Find the group iterator for the one-after-the-last multicast routing entry for a group address.

Parameters:
group_addrthe group address prefix to search for.
Returns:
the iterator for one-after-the-last entry with group address that matches group_addr. If no such entry exists, the return value is gs_end().
template<class E>
const_gs_iterator Mrt< E >::group_by_prefix_begin ( const IPvXNet prefix_g) const [inline]

Find the group iterator for the first multicast routing entry for a group address prefix.

Parameters:
prefix_gthe group address prefix to search for.
Returns:
the iterator for first entry with group address that matches prefix_g. If no matching entry is found, the return value is group_by_prefix_end().
template<class E>
const_gs_iterator Mrt< E >::group_by_prefix_end ( const IPvXNet prefix_g) const [inline]

Find the group iterator for the one-after-the-last multicast routing entry for a group address prefix.

Parameters:
prefix_gthe group address prefix to search for.
Returns:
the iterator for one-after-the-last entry with group address that matches prefix_g. If no such entry exists, the return value is gs_end().
template<class E>
const_gs_iterator Mrt< E >::group_source_by_addr_begin ( const IPvX source_addr,
const IPvX group_addr 
) const [inline]

Find the group iterator for the multicast routing entry for a source and a group address.

Parameters:
source_addrthe source address to search for.
group_addrthe group address to search for.
Returns:
the iterator for entry with source and group address that matches source_addr and group_addr. If no matching entry is found, the return value is the next entry.
template<class E>
const_gs_iterator Mrt< E >::gs_begin ( ) const [inline]

Get an iterator for the first element in the group-source table.

Returns:
the iterator for the first element in the group-source table.
template<class E>
const_gs_iterator Mrt< E >::gs_end ( ) const [inline]

Get an iterator for the last element in the group-source table.

Returns:
the iterator for the last element in the group-source table.
template<class E>
E* Mrt< E >::insert ( E *  mre) [inline]

Insert a multicast routing entry that was already created.

Note that we insert a pointer to the mre, hence mre should not be deleted without removing it first from the table.

Parameters:
mrethe multicast routing entry to insert.
Returns:
the multicast routing entry that was inserted on success, otherwise NULL.
template<class E>
int Mrt< E >::remove ( E *  mre) [inline]

Remove a multicast routing entry from the table.

Note that the entry itself is not deleted.

Parameters:
mrethe multicast routing entry to delete from the table.
Returns:
XORP_OK if the entry was in the table and was successfully removed, otherwise XORP_ERROR.
template<class E>
const_sg_iterator Mrt< E >::sg_begin ( ) const [inline]

Get an iterator for the first element in the source-group table.

Returns:
the iterator for the first element in the source-group table.
template<class E>
const_sg_iterator Mrt< E >::sg_end ( ) const [inline]

Get an iterator for the last element in the source-group table.

Returns:
the iterator for the last element in the source-group table.
template<class E>
size_t Mrt< E >::size ( ) const [inline]

Get the number of multicast routing entries in the table.

Returns:
the number of multicast routing entries.
template<class E>
const_sg_iterator Mrt< E >::source_by_addr_begin ( const IPvX source_addr) const [inline]

Find the source iterator for the first multicast routing entry for a source address.

Parameters:
source_addrthe source address to search for.
Returns:
the iterator for first entry with source address that matches source_addr. If no matching entry is found, the return value is source_by_addr_end().
template<class E>
const_sg_iterator Mrt< E >::source_by_addr_end ( const IPvX source_addr) const [inline]

Find the source iterator for the one-after-the-last multicast routing entry for a source address.

Parameters:
source_addrthe source address to search for.
Returns:
the iterator for one-after-the-last entry with source address that matches source_addr. If no such entry exists, the return value is sg_end().
template<class E>
const_sg_iterator Mrt< E >::source_by_prefix_begin ( const IPvXNet prefix_s) const [inline]

Find the source iterator for the first multicast routing entry for a source address prefix.

Parameters:
prefix_sthe source address prefix to search for.
Returns:
the iterator for first entry with source address that matches prefix_s. If no matching entry is found, the return value is source_by_prefix_end().
template<class E>
const_sg_iterator Mrt< E >::source_by_prefix_end ( const IPvXNet prefix_s) const [inline]

Find the source iterator for the one-after-the-last multicast routing entry for a source address prefix.

Parameters:
prefix_sthe source address prefix to search for.
Returns:
the iterator for one-after-the-last entry with source address that matches prefix_s. If no such entry exists, the return value is sg_end().
template<class E>
const_sg_iterator Mrt< E >::source_group_by_addr_begin ( const IPvX source_addr,
const IPvX group_addr 
) const [inline]

Find the source iterator for the multicast routing entry for a source and a group address.

Parameters:
source_addrthe source address to search for.
group_addrthe group address to search for.
Returns:
the iterator for entry with source and group address that matches source_addr and group_addr. If no matching entry is found, the return value is the next entry.

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