#include <InterfaceTable.h>
Inheritance diagram for dtn::InterfaceTable:
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[]) |
Create and add a new interface to the table. | |
bool | del (const std::string &name) |
Remove the specified interface. | |
void | list (oasys::StringBuffer *buf) |
Dumps the interface table into a string. | |
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_ |
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[] | |||
) |
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).
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 | ) |
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.
Definition at line 41 of file InterfaceTable.cc.
References iflist_, and dtn::Interface::name().
InterfaceTable * dtn::InterfaceTable::instance_ [static, protected] |
InterfaceList dtn::InterfaceTable::iflist_ [protected] |