#include <EndpointID.h>
Public Types | |
enum | singleton_info_t { UNKNOWN, SINGLETON, MULTINODE } |
Typedef for the return value possibilities from is_singleton. More... | |
Public Member Functions | |
EndpointID () | |
Default constructor. | |
EndpointID (const oasys::Builder &) | |
Constructor for deserialization. | |
EndpointID (const std::string &str) | |
Construct the endpoint id from the given string. | |
EndpointID (const char *str, size_t len) | |
Construct the endpoint id from the given string. | |
EndpointID (const EndpointID &other) | |
Construct the endpoint id from another. | |
virtual | ~EndpointID () |
Destructor. | |
bool | assign (const EndpointID &other) |
Assign this endpoint ID as a copy of the other. | |
bool | assign (const std::string &str) |
Set the string and validate it. | |
bool | assign (const char *str, size_t len) |
Set the string and validate it. | |
bool | assign (const std::string &scheme, const std::string &ssp) |
Set the string from component pieces and validate it. | |
bool | equals (const EndpointID &other) const |
Simple equality test function. | |
bool | operator== (const EndpointID &other) const |
Operator overload for equality syntactic sugar. | |
bool | operator!= (const EndpointID &other) const |
Operator overload for inequality syntactic sugar. | |
bool | operator< (const EndpointID &other) const |
Operator overload for STL comparison-based data structures (such as a std::map). | |
int | compare (const EndpointID &other) const |
Three way lexographical comparison. | |
bool | assign (const dtn_endpoint_id_t *eid) |
Set the string from the API type dtn_endpoint_id_t. | |
bool | subsume (const EndpointID &other) const |
@ return true if the given EndpointID is contained within this EndpointID; otherwise false. | |
bool | append_service_tag (const char *tag) |
Append the specified service tag (in a scheme-specific manner) to the ssp. | |
bool | append_service_wildcard () |
Append a wildcard (in a scheme-specific manner) to form a route pattern. | |
bool | remove_service_tag () |
Reduce EndpointID to routing endpoint. | |
singleton_info_t | is_singleton () const |
Return whether or not this endpoint id is a singleton or a multi-node endpoint. | |
void | copyto (dtn_endpoint_id_t *eid) const |
Copy the endpoint id contents out to the API type dtn_endpoint_id_t. | |
bool | known_scheme () const |
Return an indication of whether or not the scheme is known. | |
virtual void | serialize (oasys::SerializeAction *a) |
Virtual from SerializableObject. | |
const URI & | uri () const |
const std::string & | str () const |
const std::string | scheme_str () const |
const std::string | ssp () const |
Scheme * | scheme () const |
bool | valid () const |
bool | is_pattern () const |
const char * | c_str () const |
const char * | data () const |
size_t | length () const |
Static Public Member Functions | |
static const EndpointID & | NULL_EID () |
Return the special endpoint id used for the null endpoint, namely "dtn:none". | |
Static Public Attributes | |
static singleton_info_t | is_singleton_default_ = EndpointID::MULTINODE |
Default setting for endpoint ids in unknown schemes. | |
static bool | glob_unknown_schemes_ = true |
Bit to control how to match unknown schemes. | |
static const size_t | MAX_EID_PART_LENGTH = 1023 |
The scheme and SSP parts each must not exceed this length. | |
Protected Member Functions | |
bool | validate () |
Extract and look up the scheme and ssp. | |
Protected Attributes | |
URI | uri_ |
Scheme * | scheme_ |
bool | valid_ |
bool | is_pattern_ |
Definition at line 35 of file EndpointID.h.
Typedef for the return value possibilities from is_singleton.
Definition at line 206 of file EndpointID.h.
dtn::EndpointID::EndpointID | ( | ) | [inline] |
dtn::EndpointID::EndpointID | ( | const oasys::Builder & | ) | [inline] |
dtn::EndpointID::EndpointID | ( | const std::string & | str | ) | [inline] |
Construct the endpoint id from the given string.
Definition at line 51 of file EndpointID.h.
References validate().
dtn::EndpointID::EndpointID | ( | const char * | str, | |
size_t | len | |||
) | [inline] |
Construct the endpoint id from the given string.
Definition at line 60 of file EndpointID.h.
References uri_, and validate().
dtn::EndpointID::EndpointID | ( | const EndpointID & | other | ) | [inline] |
Construct the endpoint id from another.
Definition at line 69 of file EndpointID.h.
References assign().
virtual dtn::EndpointID::~EndpointID | ( | ) | [inline, virtual] |
bool dtn::EndpointID::append_service_tag | ( | const char * | tag | ) |
Append the specified service tag (in a scheme-specific manner) to the ssp.
Definition at line 80 of file EndpointID.cc.
References dtn::Scheme::append_service_tag(), log_err_p, scheme_, and uri_.
Referenced by dtn::APIClient::handle_local_eid(), dtn::DTLSRRouter::initialize(), dtn::BundleDaemon::load_registrations(), and dtn::ProphetBundleCore::prophet_id().
bool dtn::EndpointID::append_service_wildcard | ( | ) |
Append a wildcard (in a scheme-specific manner) to form a route pattern.
Definition at line 105 of file EndpointID.cc.
References dtn::Scheme::append_service_wildcard(), log_err_p, scheme_, and uri_.
Referenced by dtn::ProphetBundleCore::get_route_pattern().
bool dtn::EndpointID::assign | ( | const dtn_endpoint_id_t * | eid | ) |
Set the string from the API type dtn_endpoint_id_t.
Definition at line 171 of file EndpointID.cc.
References dtn_endpoint_id_t::uri, uri_, and validate().
bool dtn::EndpointID::assign | ( | const std::string & | scheme, | |
const std::string & | ssp | |||
) | [inline] |
Set the string from component pieces and validate it.
Definition at line 117 of file EndpointID.h.
References uri_, and validate().
bool dtn::EndpointID::assign | ( | const char * | str, | |
size_t | len | |||
) | [inline] |
Set the string and validate it.
Definition at line 107 of file EndpointID.h.
References uri_, and validate().
bool dtn::EndpointID::assign | ( | const std::string & | str | ) | [inline] |
Set the string and validate it.
Definition at line 97 of file EndpointID.h.
References uri_, and validate().
bool dtn::EndpointID::assign | ( | const EndpointID & | other | ) | [inline] |
Assign this endpoint ID as a copy of the other.
Definition at line 84 of file EndpointID.h.
References is_pattern_, scheme_, uri_, and valid_.
Referenced by dtn::BundleDaemon::accept_custody(), dtn::BundleDaemon::BundleDaemon(), dtn::SessionBlockProcessor::consume(), dtn::ProphetBundleCore::create_bundle(), dtn::CustodySignal::create_custody_signal(), dtn::BundleStatusReport::create_status_report(), EndpointID(), dtn::EndpointIDPattern::EndpointIDPattern(), dtn::RouteCommand::exec(), dtnsim::NodeCommand::exec(), dtn::BundleCommand::exec(), dtn::Dictionary::extract_eid(), dtn::DTLSRRouter::generate_link_state(), dtn::TableBasedRouter::get_session_for_bundle(), dtn::BundleDaemon::handle_bundle_inject(), dtn::BundleDaemon::handle_bundle_received(), dtn::StreamConvergenceLayer::StreamConvergenceLayer::Connection::handle_contact_initiation(), dtn::APIClient::handle_find_registration(), dtn::APIClient::handle_register(), NULL_EID(), dtn::IPDiscovery::parse_advertisement(), dtn::CustodySignal::parse_custody_signal(), dtn::BundleStatusReport::parse_status_report(), dtn::BundleDaemon::release_custody(), dtn::ProphetNode::remote_eid(), dtnsim::TrAgent::send_bundle(), dtn::ProphetNode::serialize(), dtn::TcaEndpointID::set_app(), dtn::ProphetNode::set_eid(), dtn::TcaEndpointID::set_host(), dtn::BundleDaemon::set_local_eid(), dtn::Link::set_remote_eid(), dtn::TableBasedRouter::subscribe_to_session(), dtn::TcaEndpointID::TcaEndpointID(), and dtn::EndpointIDPattern::WILDCARD_EID().
const char* dtn::EndpointID::c_str | ( | ) | const [inline] |
Accessors and wrappers around the various fields.
Definition at line 264 of file EndpointID.h.
References uri_.
Referenced by dtn::RegistrationTable::add(), dtn::ForwardingLog::add_entry(), dtn::TableBasedRouter::add_subscriber(), dtn::BundleDaemon::check_and_deliver_to_registrations(), dtn::CustodySignal::create_custody_signal(), dtn::RouteTable::del_entry(), dtnsim::SimRegistration::deliver_bundle(), dtn::PingRegistration::deliver_bundle(), dtn::APIRegistration::deliver_bundle(), dtn::AdminRegistration::deliver_bundle(), dtn::BundleDaemon::deliver_to_registration(), dtn::SessionTable::dump(), dtn::Link::dump(), dtn::ForwardingLog::dump(), dtn::BundleCommand::exec(), dtn::Dictionary::extract_eid(), dtn::ContactManager::find_link_to(), dtn::TableBasedRouter::find_session_upstream(), dtn::Subscriber::format(), dtn::EndpointIDShim::format(), dtn::Link::format(), dtn::Bundle::format(), dtn::IPAnnounce::format_advertisement(), dtn::Bundle::format_verbose(), dtn::TcaRouter::fwd_to_all(), dtn::TcaRouter::fwd_to_matching_r(), dtn::ProphetStore::get(), dtn::FragmentManager::get_hash_key(), dtn::ProphetBundleCore::get_link(), dtn::RouteTable::get_matching(), dtn::RegistrationTable::get_matching(), dtn::RouteTable::get_matching_helper(), dtn::DTLSRRouter::handle_bundle_expired(), dtn::BundleDaemon::handle_bundle_received(), dtn::StreamConvergenceLayer::StreamConvergenceLayer::Connection::handle_contact_initiation(), dtn::BundleDaemon::handle_custody_signal(), dtn::DTLSRRouter::handle_lsa(), dtn::BundleDaemon::handle_registration_added(), dtn::BundleDaemon::handle_registration_removed(), dtn::BundleDaemon::handle_route_del(), dtn::TableBasedRouter::handle_session_bundle(), dtn::APIClient::handle_session_update(), dtn::TcaRouter::handle_tca_unbound_bundle(), dtn::DTLSRRouter::initialize(), is_singleton(), dtn::log_bundle(), dtnsim::SimLog::log_entry(), dtn::LoggingRegistration::LoggingRegistration(), dtn::EndpointIDPattern::match(), dtn::ContactManager::new_opportunistic_link(), dtn::TcaRouter::on_coa_transmitted(), dtn::TcaRouter::post_bundle(), dtnsim::TrAgent::send_bundle(), dtn::ProphetNode::serialize(), dtn::Session::Session(), dtn::TableBasedRouter::subscribe_to_session(), dtn::TcaRouter::TcaRouter(), dtn::TableBasedRouter::tcl_dump_state(), dtn::TclRegistration::TclRegistration(), dtn::RegistrationTable::update(), and dtn::Bundle::validate().
int dtn::EndpointID::compare | ( | const EndpointID & | other | ) | const [inline] |
void dtn::EndpointID::copyto | ( | dtn_endpoint_id_t * | eid | ) | const |
Copy the endpoint id contents out to the API type dtn_endpoint_id_t.
Definition at line 179 of file EndpointID.cc.
References ASSERT, DTN_MAX_ENDPOINT_ID, dtn_endpoint_id_t::uri, and uri_.
Referenced by dtn::APIClient::handle_local_eid(), dtn::APIClient::handle_recv(), and dtn::APIClient::handle_session_update().
const char* dtn::EndpointID::data | ( | ) | const [inline] |
Accessors and wrappers around the various fields.
Definition at line 265 of file EndpointID.h.
References uri_.
Referenced by dtn::StreamConvergenceLayer::StreamConvergenceLayer::Connection::initiate_contact(), and dtn::TclRegistration::parse_bundle_data().
bool dtn::EndpointID::equals | ( | const EndpointID & | other | ) | const [inline] |
Simple equality test function.
Definition at line 126 of file EndpointID.h.
References uri_.
Referenced by dtn::BundleDaemon::accept_custody(), dtn::CustodySignal::create_custody_signal(), dtn::BundleStatusReport::create_status_report(), dtn::RouteTable::del_entry(), dtn::GbofId::equals(), dtn::BundleDaemon::find_duplicate(), dtn::BundleDaemon::generate_custody_signal(), dtn::RegistrationTable::get(), dtn::BundleDaemon::handle_bundle_delivered(), dtn::RouteEntry::RouteEntry::DestMatches::operator()(), and dtn::IPDiscovery::run().
bool dtn::EndpointID::is_pattern | ( | ) | const [inline] |
Accessors and wrappers around the various fields.
Definition at line 263 of file EndpointID.h.
References is_pattern_.
EndpointID::singleton_info_t dtn::EndpointID::is_singleton | ( | ) | const |
Return whether or not this endpoint id is a singleton or a multi-node endpoint.
Definition at line 154 of file EndpointID.cc.
References c_str(), dtn::Scheme::is_singleton(), is_singleton_default_, known_scheme(), MULTINODE, scheme_, scheme_str(), SINGLETON, and uri_.
Referenced by dtn::BundleCommand::exec().
bool dtn::EndpointID::known_scheme | ( | ) | const [inline] |
Return an indication of whether or not the scheme is known.
Definition at line 233 of file EndpointID.h.
References scheme_.
Referenced by dtn::BundleCommand::exec(), is_singleton(), dtn::TCAScheme::match(), dtn::SessionScheme::match(), dtn::EndpointIDPattern::match(), and dtn::DTNScheme::match().
size_t dtn::EndpointID::length | ( | ) | const [inline] |
Accessors and wrappers around the various fields.
Definition at line 266 of file EndpointID.h.
References uri_.
Referenced by dtn::CustodySignal::create_custody_signal(), dtn::RouteTable::dump(), dtn::IPAnnounce::format_advertisement(), dtn::SessionBlockProcessor::generate(), dtn::RouteTable::get_matching_helper(), dtn::TableBasedRouter::get_session_for_bundle(), dtn::StreamConvergenceLayer::StreamConvergenceLayer::Connection::initiate_contact(), dtn::TcaEndpointID::parse(), dtn::TclRegistration::parse_bundle_data(), dtn::TcaRouter::post_bundle(), dtn::SessionBlockProcessor::prepare(), and validate().
const EndpointID & dtn::EndpointID::NULL_EID | ( | ) | [inline, static] |
Return the special endpoint id used for the null endpoint, namely "dtn:none".
Definition at line 358 of file EndpointID.h.
References assign(), dtn::GlobalEndpointIDs::null_eid_, and scheme_.
Referenced by dtn::BundleDaemon::accept_custody(), dtn::TableBasedRouter::add_nexthop_route(), dtn::BundleDaemon::BundleDaemon(), dtn::ProphetBundleCore::create_bundle(), dtn::CustodySignal::create_custody_signal(), dtn::BundleStatusReport::create_status_report(), dtn::PingRegistration::deliver_bundle(), dtn::Registration::deliver_if_not_duplicate(), dtn::BundleCommand::exec(), dtn::ContactManager::find_link_to(), dtn::TableBasedRouter::find_session_upstream(), dtn::BundleDaemon::generate_custody_signal(), dtn::ForwardingLog::get_latest_entry(), dtn::BundleDaemon::handle_bundle_delivered(), dtn::BundleDaemon::handle_bundle_inject(), dtn::TableBasedRouter::handle_bundle_received(), dtn::BundleDaemon::handle_bundle_received(), dtn::StreamConvergenceLayer::StreamConvergenceLayer::Connection::handle_contact_initiation(), dtn::DTLSRRouter::handle_contact_up(), dtn::APIClient::handle_send(), dtn::TableBasedRouter::handle_session_bundle(), dtn::Subscriber::is_null(), dtn::DTND::main(), dtn::SessionBlockProcessor::prepare(), dtn::UDPConvergenceLayer::UDPConvergenceLayer::Receiver::process_data(), dtn::BundleDaemon::release_custody(), dtn::DTLSRRouter::send_lsa(), dtn::TableBasedRouter::should_fwd(), dtn::BundleRouter::should_fwd(), dtn::TableBasedRouter::subscribe_to_session(), dtn::ForwardingLog::update(), and dtn::PrimaryBlockProcessor::validate().
bool dtn::EndpointID::operator!= | ( | const EndpointID & | other | ) | const [inline] |
Operator overload for inequality syntactic sugar.
Definition at line 142 of file EndpointID.h.
References uri_.
bool dtn::EndpointID::operator< | ( | const EndpointID & | other | ) | const [inline] |
Operator overload for STL comparison-based data structures (such as a std::map).
Definition at line 151 of file EndpointID.h.
References uri_.
bool dtn::EndpointID::operator== | ( | const EndpointID & | other | ) | const [inline] |
Operator overload for equality syntactic sugar.
Definition at line 134 of file EndpointID.h.
References uri_.
bool dtn::EndpointID::remove_service_tag | ( | ) |
Reduce EndpointID to routing endpoint.
Definition at line 130 of file EndpointID.cc.
References log_err_p, dtn::Scheme::remove_service_tag(), scheme_, and uri_.
Referenced by dtn::ProphetBundleCore::get_route().
Scheme* dtn::EndpointID::scheme | ( | ) | const [inline] |
Accessors and wrappers around the various fields.
Definition at line 261 of file EndpointID.h.
References scheme_.
Referenced by dtn::WildcardScheme::match(), dtn::TCAScheme::match(), dtn::StringScheme::match(), dtn::SessionScheme::match(), dtn::EndpointIDPattern::match(), and dtn::DTNScheme::match().
const std::string dtn::EndpointID::scheme_str | ( | ) | const [inline] |
Accessors and wrappers around the various fields.
Definition at line 259 of file EndpointID.h.
References uri_.
Referenced by dtn::Dictionary::add_eid(), dtn::TcaRouter::create_link(), dtn::Dictionary::extract_eid(), dtn::TcaRouter::get_forwarding_rule(), dtn::Dictionary::get_offsets(), dtn::TcaRouter::handle_bundle_received(), dtn::TcaRouter::handle_bundle_transmitted(), dtn::DTLSRRouter::initialize(), is_singleton(), dtn::TcaEndpointID::parse(), and validate().
void dtn::EndpointID::serialize | ( | oasys::SerializeAction * | a | ) | [virtual] |
Virtual from SerializableObject.
Definition at line 187 of file EndpointID.cc.
References uri_, and validate().
const std::string dtn::EndpointID::ssp | ( | ) | const [inline] |
Accessors and wrappers around the various fields.
Definition at line 260 of file EndpointID.h.
References uri_.
Referenced by dtn::Dictionary::add_eid(), dtn::TcaRouter::create_link(), dtn::Dictionary::extract_eid(), dtn::Dictionary::get_offsets(), dtn::TcaRouter::handle_bundle_received(), dtn::TCAScheme::match(), dtn::DTNScheme::match(), dtn::TcaEndpointID::parse(), and validate().
const std::string& dtn::EndpointID::str | ( | ) | const [inline] |
Accessors and wrappers around the various fields.
Definition at line 258 of file EndpointID.h.
References uri_.
Referenced by dtn::BundleCommand::exec(), dtn::ProphetBundleList::find(), dtn::TableBasedRouter::find_session_upstream(), dtn::TcaRouter::get_forwarding_rule(), dtn::ProphetBundleCore::get_route(), dtn::ProphetBundleCore::get_route_pattern(), dtn::TableBasedRouter::get_session_for_bundle(), dtn::TcaRouter::handle_ask(), dtn::BundleDaemon::handle_bundle_inject(), dtn::BundleDaemon::handle_bundle_received(), dtn::StreamConvergenceLayer::StreamConvergenceLayer::Connection::handle_contact_initiation(), dtn::DTLSRRouter::handle_lsa(), dtn::TcaRouter::handle_register(), dtn::DTLSRRouter::handle_registration_added(), dtn::APIClient::handle_send(), dtn::TableBasedRouter::handle_session_bundle(), dtn::TcaRouter::handle_tca_unbound_bundle(), dtn::DTLSRRouter::initialize(), dtn::log_bundle(), dtn::StringScheme::match(), dtn::RouteEntry::next_hop_str(), dtn::TcaRouter::on_adv_transmitted(), dtn::TcaRouter::on_ask_transmitted(), dtn::TcaRouter::on_coa_transmitted(), dtn::ProphetBundleCore::prophet_id(), dtn::TcaRouter::push_wrapped_bundle(), dtn::ProphetNode::set_eid(), dtn::GbofId::str(), and dtn::TableBasedRouter::subscribe_to_session().
bool dtn::EndpointID::subsume | ( | const EndpointID & | other | ) | const [inline] |
@ return true if the given EndpointID is contained within this EndpointID; otherwise false.
Definition at line 175 of file EndpointID.h.
References uri_.
Referenced by dtn::BundleDaemon::check_local_delivery(), and dtn::DTLSRRouter::handle_registration_added().
const URI& dtn::EndpointID::uri | ( | ) | const [inline] |
Accessors and wrappers around the various fields.
Definition at line 257 of file EndpointID.h.
References uri_.
Referenced by dtn::BundleCommand::exec(), dtn::BundleDaemon::handle_bundle_inject(), dtn::DTLSRRouter::handle_lsa(), dtn::TCAScheme::match(), dtn::SessionScheme::match(), dtn::EndpointIDPattern::match(), and dtn::DTNScheme::match().
bool dtn::EndpointID::valid | ( | ) | const [inline] |
Accessors and wrappers around the various fields.
Definition at line 262 of file EndpointID.h.
References valid_.
Referenced by dtn::RouteCommand::exec(), dtn::RegistrationCommand::exec(), dtnsim::NodeCommand::exec(), dtn::Dictionary::extract_eid(), dtn::FloodBundleRouter::FloodBundleRouter(), dtn::TableBasedRouter::get_session_for_bundle(), dtn::BundleDaemon::handle_bundle_inject(), dtn::APIClient::handle_find_registration(), dtn::APIClient::handle_register(), dtn::SequenceID::parse(), dtn::PrimaryBlockProcessor::validate(), and dtn::Bundle::validate().
bool dtn::EndpointID::validate | ( | ) | [protected] |
Extract and look up the scheme and ssp.
Definition at line 44 of file EndpointID.cc.
References is_pattern_, length(), dtn::log, log_err_p, MAX_EID_PART_LENGTH, scheme_, scheme_str(), ssp(), uri_, valid_, and dtn::Scheme::validate().
Referenced by assign(), EndpointID(), dtn::EndpointIDPattern::EndpointIDPattern(), and serialize().
bool dtn::EndpointID::glob_unknown_schemes_ = true [static] |
Bit to control how to match unknown schemes.
Definition at line 222 of file EndpointID.h.
Referenced by dtn::EndpointIDPattern::match(), and dtn::ParamCommand::ParamCommand().
bool dtn::EndpointID::is_pattern_ [protected] |
Definition at line 282 of file EndpointID.h.
Referenced by assign(), dtn::EndpointIDPattern::EndpointIDPattern(), is_pattern(), and validate().
EndpointID::singleton_info_t dtn::EndpointID::is_singleton_default_ = EndpointID::MULTINODE [static] |
Default setting for endpoint ids in unknown schemes.
Definition at line 217 of file EndpointID.h.
Referenced by dtn::BundleCommand::exec(), dtn::APIClient::handle_send(), is_singleton(), and dtn::ParamCommand::ParamCommand().
const size_t dtn::EndpointID::MAX_EID_PART_LENGTH = 1023 [static] |
The scheme and SSP parts each must not exceed this length.
Definition at line 247 of file EndpointID.h.
Referenced by validate().
Scheme* dtn::EndpointID::scheme_ [protected] |
Definition at line 279 of file EndpointID.h.
Referenced by append_service_tag(), append_service_wildcard(), assign(), is_singleton(), known_scheme(), NULL_EID(), remove_service_tag(), scheme(), validate(), and dtn::EndpointIDPattern::WILDCARD_EID().
URI dtn::EndpointID::uri_ [protected] |
Definition at line 277 of file EndpointID.h.
Referenced by append_service_tag(), append_service_wildcard(), assign(), c_str(), compare(), copyto(), data(), EndpointID(), dtn::EndpointIDPattern::EndpointIDPattern(), equals(), is_singleton(), length(), dtn::EndpointIDPattern::match(), operator!=(), operator<(), operator==(), remove_service_tag(), scheme_str(), serialize(), ssp(), str(), subsume(), uri(), and validate().
bool dtn::EndpointID::valid_ [protected] |
Definition at line 281 of file EndpointID.h.
Referenced by assign(), dtn::TcaEndpointID::parse(), valid(), and validate().