#include <Link.h>
a one way communication channel to a next hop node in the DTN overlay.
The state of a link (regarding its availability) is described by the Link::state_t enumerated type.
All links in the OPEN state have an associated contact that represents an actual connection.
Every link has a unique name associated with it which is used to identify it. The name is configured explicitly when the link is created.
Creating new links: Links are created explicitly in the configuration file. Syntax is:
See servlib/cmd/LinkCommand.cc for implementation of this TCL cmd.----------------------------------------------------------
Links are of three types as discussed in the DTN architecture ONDEMAND, SCHEDULED, OPPORTUNISTIC.
The key differences from an implementation perspective are "who" and "when" manipulates the link state regarding availability.
ONDEMAND links are initializd in the AVAILABLE state, as one would expect. It remains in this state until a router explicitly opens it.
An ONDEMAND link can then be closed either due to connection failure or because the link has been idle for too long, both triggered by the convergence layer. If an ONDEMAND link is closed due to connection failure, then the contact manager is notified of this event and periodically tries to re-establish the link.
For OPPORTUNISTIC links the availability state is set by the code which detects that there is a new link available to be used.
SCHEDULED links have their availability dictated by the schedule implementation.
----------------------------------------------------------
Links are used for input and/or output. In other words, for connection-oriented convergence layers like TCP, a link object is created whenever a new connection is made to a peer or when a connection arrives from a peer.
Definition at line 103 of file contacts/Link.h.
Public Types | |
enum | link_type_t { LINK_INVALID = -1, ALWAYSON = 1, ONDEMAND = 2, SCHEDULED = 3, OPPORTUNISTIC = 4 } |
Valid types for a link. More... | |
enum | state_t { UNAVAILABLE = 1, AVAILABLE = 2, OPENING = 4, OPEN = 8, CLOSED = 16 } |
The possible states for a link. More... | |
Public Member Functions | |
Link (const std::string &name, link_type_t type, ConvergenceLayer *cl, const char *nexthop) | |
Constructor / Destructor. | |
Link (const oasys::Builder &b) | |
Constructor for unserialization. | |
virtual void | delete_link () |
Handle and mark deleted link. | |
virtual bool | reconfigure_link (int argc, const char *argv[]) |
Reconfigure the link parameters. | |
virtual void | reconfigure_link (AttributeVector ¶ms) |
void | serialize (oasys::SerializeAction *action) |
Virtual from SerializableObject. | |
virtual int | parse_args (int argc, const char *argv[], const char **invalidp=NULL) |
Hook for subclass to parse arguments. | |
virtual void | set_initial_state () |
Hook for subclass to post events to control the initial link state, after all initialization is complete. | |
link_type_t | type () const |
Return the type of the link. | |
const char * | type_str () const |
Return the string for of the link. | |
bool | isopen () const |
Return whether or not the link is open. | |
bool | isavailable () const |
Return the availability state of the link. | |
bool | isopening () const |
Return whether the link is in the process of opening. | |
bool | isdeleted () const |
Returns true if the link has been deleted; otherwise returns false. | |
state_t | state () const |
Return the actual state. | |
void | set_state (state_t state) |
Sets the state of the link. | |
void | set_create_pending (bool create_pending=true) |
Set/get the create_pending_ flag on the link. | |
bool | is_create_pending () const |
void | set_usable (bool usable=true) |
Set/get the usable_ flag on the link. | |
bool | is_usable () const |
const ContactRef & | contact () const |
Return the current contact information (if any). | |
void | set_contact (Contact *contact) |
Set the contact information. | |
void | set_cl_info (CLInfo *cl_info) |
Store convergence layer state associated with the link. | |
CLInfo * | cl_info () const |
Accessor to the convergence layer state. | |
void | set_router_info (RouterInfo *router_info) |
Store router state associated with the link. | |
RouterInfo * | router_info () const |
Accessor to the convergence layer state. | |
ConvergenceLayer * | clayer () const |
Accessor to this contact's convergence layer. | |
const char * | name () const |
Accessor to this links name. | |
const std::string & | name_str () const |
Accessor to this links name as a c++ string. | |
const char * | nexthop () const |
Accessor to next hop string. | |
const std::string & | nexthop_str () const |
Accessor to next hop string. | |
void | set_nexthop (const std::string &nexthop) |
Override for the next hop string. | |
bool | is_reliable () const |
Accessor to the reliability bit. | |
void | set_reliable (bool r) |
Accessor to set the reliability bit when the link is created. | |
void | set_remote_eid (const EndpointID &remote) |
Accessor to set the remote endpoint id. | |
const EndpointID & | remote_eid () |
Accessor to the remote endpoint id. | |
const BundleList * | queue () |
Accessor for the link's queue of bundles that are awaiting transmission. | |
bool | queue_is_full () const |
Return whether or not the queue is full, based on the configured queue limits. | |
bool | queue_has_space () const |
Return whether or not the queue has space, based on the configured queue limits. | |
const BundleList * | inflight () |
Accessor for the link's list of bundles that have been transmitted but for which the convergence layer is awaiting acknowledgement. | |
int | format (char *buf, size_t sz) const |
Virtual from formatter. | |
void | dump (oasys::StringBuffer *buf) |
Debugging printout. | |
const Params & | params () const |
Accessor for the parameter structure. | |
Params & | params () |
Stats * | stats () |
Accessor for the stats structure. | |
void | reset_stats () const |
Reset the stats. | |
void | dump_stats (oasys::StringBuffer *buf) |
Dump a printable version of the stats. | |
oasys::Lock * | lock () |
Accessor for the Link state lock. | |
bool | add_to_queue (const BundleRef &bundle, size_t total_len) |
Accessor functions to add/remove bundles from the link queue and inflight list, keeping the statistics in-sync with the state of the lists. | |
bool | del_from_queue (const BundleRef &bundle, size_t total_len) |
Accessor functions to add/remove bundles from the link queue and inflight list, keeping the statistics in-sync with the state of the lists. | |
bool | add_to_inflight (const BundleRef &bundle, size_t total_len) |
Accessor functions to add/remove bundles from the link queue and inflight list, keeping the statistics in-sync with the state of the lists. | |
bool | del_from_inflight (const BundleRef &bundle, size_t total_len) |
Accessor functions to add/remove bundles from the link queue and inflight list, keeping the statistics in-sync with the state of the lists. | |
u_int | bundles_queued () |
Accessors for the link queue stats. | |
u_int | bytes_queued () |
Accessors for the link queue stats. | |
u_int | bundles_inflight () |
Accessors for the link queue stats. | |
u_int | bytes_inflight () |
Accessors for the link queue stats. | |
Static Public Member Functions | |
static const char * | link_type_to_str (link_type_t type) |
Link type string conversion. | |
static link_type_t | str_to_link_type (const char *str) |
static const char * | state_to_str (state_t state) |
Convert a link state into a string. | |
static LinkRef | create_link (const std::string &name, link_type_t type, ConvergenceLayer *cl, const char *nexthop, int argc, const char *argv[], const char **invalid_argp=NULL) |
Static function to create appropriate link object from link type. | |
Public Attributes | |
u_int | retry_interval_ |
Seconds to wait between attempts to re-open an unavailable link. | |
Protected Member Functions | |
virtual void | open () |
Open the link. | |
virtual void | close () |
Close the link. | |
virtual | ~Link () |
Destructor -- protected since links shouldn't be deleted. | |
Protected Attributes | |
int | type_ |
Type of the link. | |
u_int32_t | state_ |
State of the link. | |
bool | deleted_ |
Flag, that when set to true, indicates that the link has been deleted. | |
bool | create_pending_ |
Flag, that when set to true, indicates that the creation of the link is pending; the convergence layer will post a creation event when the creation is complete. | |
bool | usable_ |
Flag, that when set to true, indicates that the link is allowed to be used to transmit bundles. | |
std::string | nexthop_ |
Next hop address. | |
std::string | name_ |
Internal name of the link. | |
bool | reliable_ |
Whether or not this link is reliable. | |
Params | params_ |
Parameters of the link. | |
oasys::SpinLock | lock_ |
Lock to protect internal data structures and state. | |
BundleList | queue_ |
Queue of bundles currently active or pending transmission on the Link. | |
BundleList | inflight_ |
Queue of bundles that have been sent but not yet acknowledged. | |
Stats | stats_ |
Stats for the link. | |
ContactRef | contact_ |
Current contact. contact_ != null iff link is open. | |
ConvergenceLayer * | clayer_ |
Pointer to convergence layer. | |
CLInfo * | cl_info_ |
Convergence layer specific info, if needed. | |
RouterInfo * | router_info_ |
Router specific info, if needed. | |
EndpointID | remote_eid_ |
Remote's endpoint ID (eg, dtn://hostname.dtn). | |
u_int | bundles_queued_ |
u_int | bytes_queued_ |
u_int | bundles_inflight_ |
u_int | bytes_inflight_ |
Static Protected Attributes | |
static Params | default_params_ |
Default parameters of the link. | |
Friends | |
class | BundleActions |
class | BundleDaemon |
class | ContactManager |
class | ParamCommand |
Classes | |
struct | Params |
struct | Stats |
Valid types for a link.
Definition at line 110 of file contacts/Link.h.
enum dtn::Link::state_t |
The possible states for a link.
These are defined as distinct bitfield values so that various functions can match on a set of states (e.g. see ContactManager::find_link_to).
UNAVAILABLE |
The link is closed and not able to be opened currently.
|
AVAILABLE |
The link is closed but is able to be opened, either because it is an on demand link, or because an opportunistic peer node is in close proximity but no convergence layer session has yet been opened.
|
OPENING |
A convergence layer session is in the process of being established.
|
OPEN |
A convergence layer session has been established, and the link has capacity for a bundle to be sent on it.
This may be because no bundle is currently being sent, or because the convergence layer can handle multiple simultaneous bundle transmissions. |
CLOSED | Bogus state that's never actually used in the Link state_ variable, but is used for signalling the daemon thread with a LinkStateChangeRequest. |
Definition at line 183 of file contacts/Link.h.
dtn::Link::Link | ( | const std::string & | name, | |
link_type_t | type, | |||
ConvergenceLayer * | cl, | |||
const char * | nexthop | |||
) |
Constructor / Destructor.
Definition at line 107 of file Link.cc.
References ASSERT, clayer_, default_params_, params_, retry_interval_, and stats_.
dtn::Link::Link | ( | const oasys::Builder & | b | ) |
dtn::Link::~Link | ( | ) | [protected, virtual] |
static const char* dtn::Link::link_type_to_str | ( | link_type_t | type | ) | [inline, static] |
Link type string conversion.
Definition at line 149 of file contacts/Link.h.
References ALWAYSON, ONDEMAND, OPPORTUNISTIC, and SCHEDULED.
Referenced by dump(), dtn::ContactManager::find_link_to(), format(), serialize(), and type_str().
static link_type_t dtn::Link::str_to_link_type | ( | const char * | str | ) | [inline, static] |
Definition at line 161 of file contacts/Link.h.
References ALWAYSON, LINK_INVALID, ONDEMAND, OPPORTUNISTIC, and SCHEDULED.
Referenced by dtn::LinkCommand::exec(), and serialize().
static const char* dtn::Link::state_to_str | ( | state_t | state | ) | [inline, static] |
Convert a link state into a string.
Definition at line 216 of file contacts/Link.h.
References AVAILABLE, CLOSED, OPEN, OPENING, and UNAVAILABLE.
Referenced by dump(), dtn::LinkCommand::exec(), format(), dtn::BundleDaemon::handle_link_state_change_request(), open(), dtn::ContactManager::reopen_link(), dtn::TableBasedRouter::reroute_bundles(), and set_state().
LinkRef dtn::Link::create_link | ( | const std::string & | name, | |
link_type_t | type, | |||
ConvergenceLayer * | cl, | |||
const char * | nexthop, | |||
int | argc, | |||
const char * | argv[], | |||
const char ** | invalid_argp = NULL | |||
) | [static] |
Static function to create appropriate link object from link type.
Definition at line 58 of file Link.cc.
References ALWAYSON, ASSERT, count, ONDEMAND, OPPORTUNISTIC, and SCHEDULED.
Referenced by dtn::TcaRouter::create_link(), dtn::LinkCommand::exec(), dtn::BundleDaemon::handle_link_create(), and dtn::ContactManager::new_opportunistic_link().
void dtn::Link::delete_link | ( | ) | [virtual] |
Handle and mark deleted link.
Definition at line 169 of file Link.cc.
References ASSERT, clayer_, dtn::ConvergenceLayer::delete_link(), deleted_, isdeleted(), and lock_.
bool dtn::Link::reconfigure_link | ( | int | argc, | |
const char * | argv[] | |||
) | [virtual] |
Reconfigure the link parameters.
Definition at line 190 of file Link.cc.
References ASSERT, clayer_, isdeleted(), lock_, name(), and dtn::ConvergenceLayer::reconfigure_link().
void dtn::Link::reconfigure_link | ( | AttributeVector & | params | ) | [virtual] |
Definition at line 207 of file Link.cc.
References ASSERT, clayer_, dtn::Link::Params::idle_close_time_, isdeleted(), lock_, dtn::Link::Params::max_retry_interval_, dtn::Link::Params::min_retry_interval_, name(), params_, dtn::Link::Params::potential_downtime_, dtn::ConvergenceLayer::reconfigure_link(), set_nexthop(), and set_usable().
void dtn::Link::serialize | ( | oasys::SerializeAction * | action | ) |
Virtual from SerializableObject.
Definition at line 260 of file Link.cc.
References ASSERT, clayer_, contact_, dtn::Link::Params::cost_, deleted_, dtn::ConvergenceLayer::find_clayer(), dtn::Link::Params::idle_close_time_, LINK_INVALID, link_type_to_str(), dtn::Link::Params::max_retry_interval_, dtn::Link::Params::min_retry_interval_, dtn::ConvergenceLayer::name(), name_, nexthop_, OPEN, params_, dtn::Link::Params::potential_downtime_, reliable_, remote_eid_, state_, str_to_link_type(), type(), type_, type_str(), and usable_.
int dtn::Link::parse_args | ( | int | argc, | |
const char * | argv[], | |||
const char ** | invalidp = NULL | |||
) | [virtual] |
Hook for subclass to parse arguments.
Definition at line 308 of file Link.cc.
References ALWAYSON, dtn::Link::Params::cost_, dtn::Link::Params::idle_close_time_, dtn::Link::Params::max_retry_interval_, dtn::Link::Params::min_retry_interval_, dtn::Link::Params::mtu_, nexthop_, params_, dtn::Link::Params::potential_downtime_, dtn::Link::Params::prevhop_hdr_, dtn::Link::Params::qlimit_bundles_high_, dtn::Link::Params::qlimit_bundles_low_, dtn::Link::Params::qlimit_bytes_high_, dtn::Link::Params::qlimit_bytes_low_, reliable_, remote_eid_, and type_.
void dtn::Link::set_initial_state | ( | ) | [virtual] |
Hook for subclass to post events to control the initial link state, after all initialization is complete.
Reimplemented in dtn::AlwaysOnLink, and dtn::OndemandLink.
link_type_t dtn::Link::type | ( | ) | const [inline] |
Return the type of the link.
Definition at line 280 of file contacts/Link.h.
References type_.
Referenced by dump(), format(), serialize(), and type_str().
const char* dtn::Link::type_str | ( | ) | const [inline] |
Return the string for of the link.
Definition at line 285 of file contacts/Link.h.
References link_type_to_str(), and type().
Referenced by serialize().
bool dtn::Link::isopen | ( | ) | const [inline] |
Return whether or not the link is open.
Definition at line 290 of file contacts/Link.h.
Referenced by ~Link().
bool dtn::Link::isavailable | ( | ) | const [inline] |
Return the availability state of the link.
Definition at line 295 of file contacts/Link.h.
References state_, and UNAVAILABLE.
bool dtn::Link::isopening | ( | ) | const [inline] |
Return whether the link is in the process of opening.
Definition at line 300 of file contacts/Link.h.
bool dtn::Link::isdeleted | ( | ) | const |
Returns true if the link has been deleted; otherwise returns false.
Definition at line 182 of file Link.cc.
References deleted_, and lock_.
Referenced by delete_link(), dump(), dump_stats(), open(), and reconfigure_link().
state_t dtn::Link::state | ( | ) | const [inline] |
Return the actual state.
Definition at line 310 of file contacts/Link.h.
References state_.
Referenced by dump(), format(), open(), and set_state().
void dtn::Link::set_state | ( | state_t | state | ) |
Sets the state of the link.
Performs various assertions to ensure the state transitions are legal.
This function should only ever be called by the main BundleDaemon thread and helper classes. All other threads must use a LinkStateChangeRequest event to cause changes in the link state.
The function isn't protected since some callers (i.e. convergence layers) are not friend classes but some functions are run by the BundleDaemon thread.
Definition at line 374 of file Link.cc.
References ASSERT_STATE, AVAILABLE, OPEN, OPENING, state(), state_, state_to_str(), and UNAVAILABLE.
Referenced by dtn::AlwaysOnLink::AlwaysOnLink(), dtn::OndemandLink::OndemandLink(), and open().
void dtn::Link::set_create_pending | ( | bool | create_pending = true |
) | [inline] |
Set/get the create_pending_ flag on the link.
Definition at line 330 of file contacts/Link.h.
References create_pending_.
bool dtn::Link::is_create_pending | ( | ) | const [inline] |
void dtn::Link::set_usable | ( | bool | usable = true |
) | [inline] |
Set/get the usable_ flag on the link.
Definition at line 337 of file contacts/Link.h.
References usable_.
Referenced by reconfigure_link().
bool dtn::Link::is_usable | ( | ) | const [inline] |
const ContactRef& dtn::Link::contact | ( | ) | const [inline] |
Return the current contact information (if any).
Definition at line 343 of file contacts/Link.h.
References contact_.
void dtn::Link::set_contact | ( | Contact * | contact | ) | [inline] |
void dtn::Link::set_cl_info | ( | CLInfo * | cl_info | ) | [inline] |
Store convergence layer state associated with the link.
Definition at line 358 of file contacts/Link.h.
CLInfo* dtn::Link::cl_info | ( | ) | const [inline] |
Accessor to the convergence layer state.
Definition at line 369 of file contacts/Link.h.
References cl_info_.
void dtn::Link::set_router_info | ( | RouterInfo * | router_info | ) | [inline] |
Store router state associated with the link.
Definition at line 374 of file contacts/Link.h.
References ASSERT, and router_info_.
RouterInfo* dtn::Link::router_info | ( | ) | const [inline] |
Accessor to the convergence layer state.
Definition at line 385 of file contacts/Link.h.
References router_info_.
ConvergenceLayer* dtn::Link::clayer | ( | ) | const [inline] |
const char* dtn::Link::name | ( | ) | const [inline] |
Accessor to this links name.
Definition at line 395 of file contacts/Link.h.
References name_.
Referenced by dump(), dump_stats(), format(), reconfigure_link(), and ~Link().
const std::string& dtn::Link::name_str | ( | ) | const [inline] |
Accessor to this links name as a c++ string.
Definition at line 400 of file contacts/Link.h.
References name_.
const char* dtn::Link::nexthop | ( | ) | const [inline] |
const std::string& dtn::Link::nexthop_str | ( | ) | const [inline] |
void dtn::Link::set_nexthop | ( | const std::string & | nexthop | ) | [inline] |
Override for the next hop string.
Definition at line 415 of file contacts/Link.h.
References nexthop_.
Referenced by reconfigure_link().
bool dtn::Link::is_reliable | ( | ) | const [inline] |
Accessor to the reliability bit.
Definition at line 420 of file contacts/Link.h.
References reliable_.
void dtn::Link::set_reliable | ( | bool | r | ) | [inline] |
Accessor to set the reliability bit when the link is created.
Definition at line 425 of file contacts/Link.h.
References reliable_.
void dtn::Link::set_remote_eid | ( | const EndpointID & | remote | ) | [inline] |
Accessor to set the remote endpoint id.
Definition at line 430 of file contacts/Link.h.
References dtn::EndpointID::assign(), and remote_eid_.
const EndpointID& dtn::Link::remote_eid | ( | ) | [inline] |
Accessor to the remote endpoint id.
Definition at line 437 of file contacts/Link.h.
References remote_eid_.
Referenced by dtn::ProphetBundleCore::get_link().
const BundleList* dtn::Link::queue | ( | ) | [inline] |
Accessor for the link's queue of bundles that are awaiting transmission.
Definition at line 443 of file contacts/Link.h.
References queue_.
bool dtn::Link::queue_is_full | ( | ) | const |
Return whether or not the queue is full, based on the configured queue limits.
Definition at line 465 of file Link.cc.
References bundles_queued_, bytes_queued_, params_, dtn::Link::Params::qlimit_bundles_high_, and dtn::Link::Params::qlimit_bytes_high_.
bool dtn::Link::queue_has_space | ( | ) | const |
Return whether or not the queue has space, based on the configured queue limits.
Definition at line 473 of file Link.cc.
References bundles_queued_, bytes_queued_, params_, dtn::Link::Params::qlimit_bundles_low_, and dtn::Link::Params::qlimit_bytes_low_.
const BundleList* dtn::Link::inflight | ( | ) | [inline] |
Accessor for the link's list of bundles that have been transmitted but for which the convergence layer is awaiting acknowledgement.
Definition at line 462 of file contacts/Link.h.
References inflight_.
Accessor functions to add/remove bundles from the link queue and inflight list, keeping the statistics in-sync with the state of the lists.
Definition at line 481 of file Link.cc.
References bundles_queued_, bytes_queued_, dtn::BundleList::contains(), lock_, name_, dtn::BundleList::push_back(), and queue_.
Accessor functions to add/remove bundles from the link queue and inflight list, keeping the statistics in-sync with the state of the lists.
Definition at line 502 of file Link.cc.
References ASSERT, bundles_queued_, bytes_queued_, dtn::BundleList::erase(), lock_, and queue_.
Accessor functions to add/remove bundles from the link queue and inflight list, keeping the statistics in-sync with the state of the lists.
Definition at line 529 of file Link.cc.
References bundles_inflight_, bytes_inflight_, inflight_, lock_, name_, and dtn::BundleList::push_back().
Accessor functions to add/remove bundles from the link queue and inflight list, keeping the statistics in-sync with the state of the lists.
Definition at line 552 of file Link.cc.
References ASSERT, bundles_inflight_, bytes_inflight_, dtn::BundleList::erase(), inflight_, and lock_.
int dtn::Link::format | ( | char * | buf, | |
size_t | sz | |||
) | const |
Virtual from formatter.
Definition at line 580 of file Link.cc.
References dtn::EndpointID::c_str(), clayer(), link_type_to_str(), dtn::ConvergenceLayer::name(), name(), nexthop(), remote_eid_, state(), state_to_str(), and type().
void dtn::Link::dump | ( | oasys::StringBuffer * | buf | ) |
Debugging printout.
Definition at line 591 of file Link.cc.
References ASSERT, dtn::EndpointID::c_str(), clayer_, deleted_, dtn::ConvergenceLayer::dump_link(), dtn::Link::Params::idle_close_time_, isdeleted(), link_type_to_str(), lock_, dtn::Link::Params::max_retry_interval_, dtn::Link::Params::min_retry_interval_, dtn::Link::Params::mtu_, dtn::ConvergenceLayer::name(), name(), nexthop(), params_, dtn::Link::Params::potential_downtime_, dtn::Link::Params::prevhop_hdr_, remote_eid_, state(), state_to_str(), and type().
const Params& dtn::Link::params | ( | ) | const [inline] |
Accessor for the parameter structure.
Definition at line 577 of file contacts/Link.h.
References params_.
Params& dtn::Link::params | ( | ) | [inline] |
Stats* dtn::Link::stats | ( | ) | [inline] |
Accessor for the stats structure.
Definition at line 634 of file contacts/Link.h.
References stats_.
void dtn::Link::reset_stats | ( | ) | const [inline] |
void dtn::Link::dump_stats | ( | oasys::StringBuffer * | buf | ) |
Dump a printable version of the stats.
Definition at line 633 of file Link.cc.
References dtn::Link::Stats::bundles_cancelled_, bundles_inflight_, bundles_queued_, dtn::Link::Stats::bundles_transmitted_, bytes_inflight_, bytes_queued_, dtn::Link::Stats::bytes_transmitted_, contact_, dtn::Link::Stats::contact_attempts_, dtn::Link::Stats::contacts_, dtn::RouterInfo::dump_stats(), isdeleted(), lock_, name(), router_info_, stats_, and dtn::Link::Stats::uptime_.
u_int dtn::Link::bundles_queued | ( | ) | [inline] |
Accessors for the link queue stats.
Definition at line 650 of file contacts/Link.h.
References bundles_queued_.
u_int dtn::Link::bytes_queued | ( | ) | [inline] |
Accessors for the link queue stats.
Definition at line 651 of file contacts/Link.h.
References bytes_queued_.
u_int dtn::Link::bundles_inflight | ( | ) | [inline] |
Accessors for the link queue stats.
Definition at line 652 of file contacts/Link.h.
References bundles_inflight_.
u_int dtn::Link::bytes_inflight | ( | ) | [inline] |
Accessors for the link queue stats.
Definition at line 653 of file contacts/Link.h.
References bytes_inflight_.
oasys::Lock* dtn::Link::lock | ( | ) | [inline] |
void dtn::Link::open | ( | ) | [protected, virtual] |
Open the link.
Protected to make sure only the friend components can call it and virtual to allow subclasses to override it.
Definition at line 415 of file Link.cc.
References ASSERT, AVAILABLE, clayer(), contact_, dtn::Link::Stats::contact_attempts_, isdeleted(), dtn::ConvergenceLayer::open_contact(), OPENING, set_state(), state(), state_, state_to_str(), and stats_.
void dtn::Link::close | ( | ) | [protected, virtual] |
friend class BundleActions [friend] |
Definition at line 662 of file contacts/Link.h.
friend class BundleDaemon [friend] |
Definition at line 663 of file contacts/Link.h.
friend class ContactManager [friend] |
Definition at line 664 of file contacts/Link.h.
friend class ParamCommand [friend] |
Definition at line 665 of file contacts/Link.h.
Seconds to wait between attempts to re-open an unavailable link.
Initially set to min_retry_interval_, then doubles up to max_retry_interval_.
Definition at line 572 of file contacts/Link.h.
Referenced by Link().
int dtn::Link::type_ [protected] |
Type of the link.
Definition at line 682 of file contacts/Link.h.
Referenced by parse_args(), serialize(), and type().
u_int32_t dtn::Link::state_ [protected] |
State of the link.
Definition at line 685 of file contacts/Link.h.
Referenced by isavailable(), isopen(), isopening(), open(), serialize(), set_state(), and state().
bool dtn::Link::deleted_ [protected] |
Flag, that when set to true, indicates that the link has been deleted.
Definition at line 688 of file contacts/Link.h.
Referenced by delete_link(), dump(), isdeleted(), and serialize().
bool dtn::Link::create_pending_ [protected] |
Flag, that when set to true, indicates that the creation of the link is pending; the convergence layer will post a creation event when the creation is complete.
While creation is pending, the link cannot be opened nor can bundles be queued for it.
Definition at line 694 of file contacts/Link.h.
Referenced by is_create_pending(), and set_create_pending().
bool dtn::Link::usable_ [protected] |
Flag, that when set to true, indicates that the link is allowed to be used to transmit bundles.
Definition at line 698 of file contacts/Link.h.
Referenced by is_usable(), serialize(), and set_usable().
std::string dtn::Link::nexthop_ [protected] |
Next hop address.
Definition at line 701 of file contacts/Link.h.
Referenced by nexthop(), nexthop_str(), parse_args(), serialize(), and set_nexthop().
std::string dtn::Link::name_ [protected] |
Internal name of the link.
Definition at line 704 of file contacts/Link.h.
Referenced by add_to_inflight(), add_to_queue(), name(), name_str(), and serialize().
bool dtn::Link::reliable_ [protected] |
Whether or not this link is reliable.
Definition at line 707 of file contacts/Link.h.
Referenced by is_reliable(), parse_args(), serialize(), and set_reliable().
Params dtn::Link::params_ [protected] |
Parameters of the link.
Definition at line 710 of file contacts/Link.h.
Referenced by dump(), Link(), dtn::OndemandLink::OndemandLink(), params(), parse_args(), queue_has_space(), queue_is_full(), reconfigure_link(), and serialize().
Link::Params dtn::Link::default_params_ [static, protected] |
Default parameters of the link.
Definition at line 713 of file contacts/Link.h.
Referenced by Link(), and dtn::ParamCommand::ParamCommand().
oasys::SpinLock dtn::Link::lock_ [protected] |
Lock to protect internal data structures and state.
Definition at line 716 of file contacts/Link.h.
Referenced by add_to_inflight(), add_to_queue(), del_from_inflight(), del_from_queue(), delete_link(), dump(), dump_stats(), isdeleted(), lock(), and reconfigure_link().
BundleList dtn::Link::queue_ [protected] |
Queue of bundles currently active or pending transmission on the Link.
Definition at line 719 of file contacts/Link.h.
Referenced by add_to_queue(), del_from_queue(), and queue().
BundleList dtn::Link::inflight_ [protected] |
Queue of bundles that have been sent but not yet acknowledged.
Definition at line 722 of file contacts/Link.h.
Referenced by add_to_inflight(), del_from_inflight(), and inflight().
u_int dtn::Link::bundles_queued_ [protected] |
Data counters about the link queues, both in terms of bundles and bytes.
*_queued: the link queue size *_inflight: transmitted but not yet acknowledged
Definition at line 732 of file contacts/Link.h.
Referenced by add_to_queue(), bundles_queued(), del_from_queue(), dump_stats(), queue_has_space(), and queue_is_full().
u_int dtn::Link::bytes_queued_ [protected] |
Data counters about the link queues, both in terms of bundles and bytes.
*_queued: the link queue size *_inflight: transmitted but not yet acknowledged
Definition at line 733 of file contacts/Link.h.
Referenced by add_to_queue(), bytes_queued(), del_from_queue(), dump_stats(), queue_has_space(), and queue_is_full().
u_int dtn::Link::bundles_inflight_ [protected] |
Data counters about the link queues, both in terms of bundles and bytes.
*_queued: the link queue size *_inflight: transmitted but not yet acknowledged
Definition at line 734 of file contacts/Link.h.
Referenced by add_to_inflight(), bundles_inflight(), del_from_inflight(), and dump_stats().
u_int dtn::Link::bytes_inflight_ [protected] |
Data counters about the link queues, both in terms of bundles and bytes.
*_queued: the link queue size *_inflight: transmitted but not yet acknowledged
Definition at line 735 of file contacts/Link.h.
Referenced by add_to_inflight(), bytes_inflight(), del_from_inflight(), and dump_stats().
Stats dtn::Link::stats_ [mutable, protected] |
Stats for the link.
Definition at line 739 of file contacts/Link.h.
Referenced by dump_stats(), Link(), open(), reset_stats(), and stats().
ContactRef dtn::Link::contact_ [protected] |
Current contact. contact_ != null iff link is open.
Definition at line 742 of file contacts/Link.h.
Referenced by close(), contact(), dump_stats(), open(), serialize(), and set_contact().
ConvergenceLayer* dtn::Link::clayer_ [protected] |
Pointer to convergence layer.
Definition at line 745 of file contacts/Link.h.
Referenced by clayer(), delete_link(), dump(), Link(), reconfigure_link(), and serialize().
CLInfo* dtn::Link::cl_info_ [protected] |
Convergence layer specific info, if needed.
Definition at line 748 of file contacts/Link.h.
Referenced by cl_info(), set_cl_info(), and ~Link().
RouterInfo* dtn::Link::router_info_ [protected] |
Router specific info, if needed.
Definition at line 751 of file contacts/Link.h.
Referenced by dump_stats(), router_info(), set_router_info(), and ~Link().
EndpointID dtn::Link::remote_eid_ [protected] |
Remote's endpoint ID (eg, dtn://hostname.dtn).
Definition at line 754 of file contacts/Link.h.
Referenced by dump(), format(), parse_args(), remote_eid(), serialize(), and set_remote_eid().