dtn::InterfaceTable Class Reference

#include <InterfaceTable.h>

Inheritance diagram for dtn::InterfaceTable:

oasys::Logger

List of all members.


Detailed Description

Class for the in-memory interface table.

Definition at line 38 of file InterfaceTable.h.


Public Member Functions

 InterfaceTable ()
 Constructor.
virtual ~InterfaceTable ()
 Destructor.
bool add (const std::string &name, ConvergenceLayer *cl, const char *proto, int argc, const char *argv[])
 Add a new interface to the table.
bool del (const std::string &name)
 Remove the specified interface.
void list (oasys::StringBuffer *buf)
 List the current interfaces.

Static Public Member Functions

static InterfaceTableinstance ()
 Singleton instance accessor.
static void init ()
 Boot time initializer that takes as a parameter the actual storage instance to use.

Protected Member Functions

bool find (const std::string &name, InterfaceList::iterator *iter)
 Internal method to find the location of the given interface in the list.

Protected Attributes

InterfaceList iflist_
 All interfaces are tabled in-memory in a flat list.

Static Protected Attributes

static InterfaceTableinstance_ = NULL

Constructor & Destructor Documentation

dtn::InterfaceTable::InterfaceTable (  ) 

Constructor.

Definition at line 26 of file InterfaceTable.cc.

Referenced by init().

dtn::InterfaceTable::~InterfaceTable (  )  [virtual]

Destructor.

Definition at line 31 of file InterfaceTable.cc.

References NOTREACHED.


Member Function Documentation

static InterfaceTable* dtn::InterfaceTable::instance (  )  [inline, static]

Singleton instance accessor.

Definition at line 43 of file InterfaceTable.h.

References instance_.

Referenced by dtn::InterfaceCommand::exec().

static void dtn::InterfaceTable::init (  )  [inline, static]

Boot time initializer that takes as a parameter the actual storage instance to use.

Definition at line 54 of file InterfaceTable.h.

References instance_, and InterfaceTable().

Referenced by dtn::DTNServer::init_components().

bool dtn::InterfaceTable::add ( const std::string &  name,
ConvergenceLayer cl,
const char *  proto,
int  argc,
const char *  argv[] 
)

Add a new interface to the table.

Create and add a new interface to the table.

Returns true if the interface is successfully added, false if the interface specification is invalid (or it already exists).

Returns true if the interface is successfully added, false if the interface specification is invalid.

Definition at line 62 of file InterfaceTable.cc.

References find(), iflist_, dtn::ConvergenceLayer::interface_up(), log_err, and log_info.

bool dtn::InterfaceTable::del ( const std::string &  name  ) 

Remove the specified interface.

Definition at line 92 of file InterfaceTable.cc.

References dtn::Interface::clayer(), find(), iflist_, dtn::ConvergenceLayer::interface_down(), log_err, and log_info.

void dtn::InterfaceTable::list ( oasys::StringBuffer buf  ) 

List the current interfaces.

Dumps the interface table into a string.

Definition at line 125 of file InterfaceTable.cc.

References oasys::StringBuffer::append(), oasys::StringBuffer::appendf(), dtn::Interface::clayer(), dtn::ConvergenceLayer::dump_interface(), iflist_, dtn::Interface::name(), and dtn::Interface::proto().

Referenced by dtn::InterfaceCommand::exec().

bool dtn::InterfaceTable::find ( const std::string &  name,
InterfaceList::iterator *  iter 
) [protected]

Internal method to find the location of the given interface in the list.

Internal method to find the location of the given interface in the list.

Definition at line 41 of file InterfaceTable.cc.

References iflist_, and dtn::Interface::name().

Referenced by add(), and del().


Member Data Documentation

InterfaceTable * dtn::InterfaceTable::instance_ = NULL [static, protected]

Definition at line 90 of file InterfaceTable.h.

Referenced by init(), and instance().

InterfaceList dtn::InterfaceTable::iflist_ [protected]

All interfaces are tabled in-memory in a flat list.

It's non-obvious what else would be better since we need to do a prefix match on demux strings in matching_interfaces.

Definition at line 97 of file InterfaceTable.h.

Referenced by add(), del(), find(), and list().


The documentation for this class was generated from the following files:
Generated on Sat Sep 8 08:36:21 2007 for DTN Reference Implementation by  doxygen 1.5.3