#include <InterfaceTable.h>
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 InterfaceTable * | instance () |
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 InterfaceTable * | instance_ = NULL |
dtn::InterfaceTable::InterfaceTable | ( | ) |
dtn::InterfaceTable::~InterfaceTable | ( | ) | [virtual] |
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 65 of file InterfaceTable.cc.
References find(), iflist_, and dtn::ConvergenceLayer::interface_up().
bool dtn::InterfaceTable::del | ( | const std::string & | name | ) |
Remove the specified interface.
Definition at line 95 of file InterfaceTable.cc.
References dtn::Interface::clayer(), find(), iflist_, and dtn::ConvergenceLayer::interface_down().
void dtn::InterfaceTable::list | ( | oasys::StringBuffer * | buf | ) |
List the current interfaces.
Dumps the interface table into a string.
Definition at line 128 of file InterfaceTable.cc.
References 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 44 of file InterfaceTable.cc.
References iflist_, and dtn::Interface::name().
InterfaceTable * dtn::InterfaceTable::instance_ = NULL [static, protected] |
InterfaceList dtn::InterfaceTable::iflist_ [protected] |