dtn::EndpointID Class Reference

#include <EndpointID.h>

Inheritance diagram for dtn::EndpointID:

oasys::SerializableObject dtn::EndpointIDPattern dtn::TcaEndpointID List of all members.

Detailed Description

Definition at line 32 of file EndpointID.h.

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 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 parse it.
bool assign (const char *str, size_t len)
 Set the string and parse it.
bool assign (const std::string &scheme, const std::string &ssp)
 Set the string from component pieces and parse 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 assign (const dtn_endpoint_id_t *eid)
 Set the string from the API type dtn_endpoint_id_t.
bool append_service_tag (const char *tag)
 Append the specified service tag (in a scheme-specific manner) to the ssp.
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 std::string & str () const
 Accessors and wrappers around the various fields.
const std::string & scheme_str () const
 Accessors and wrappers around the various fields.
const std::string & ssp () const
 Accessors and wrappers around the various fields.
Schemescheme () const
 Accessors and wrappers around the various fields.
bool valid () const
 Accessors and wrappers around the various fields.
bool is_pattern () const
 Accessors and wrappers around the various fields.
const char * c_str () const
 Accessors and wrappers around the various fields.
const char * data () const
 Accessors and wrappers around the various fields.
size_t length () const
 Accessors and wrappers around the various fields.

Static Public Member Functions

static const EndpointID NULL_EID ()
 Return the special endpoint id used for the null endpoint, namely "dtn:none".
static const EndpointID WILDCARD_EID ()
 Return the special wildcard Endpoint ID.

Protected Member Functions

bool parse ()
 Extract and look up the scheme and ssp.

Protected Attributes

std::string str_
std::string scheme_str_
std::string ssp_
Schemescheme_
bool valid_
bool is_pattern_


Constructor & Destructor Documentation

dtn::EndpointID::EndpointID (  )  [inline]

Default constructor.

Definition at line 37 of file EndpointID.h.

Referenced by NULL_EID(), and WILDCARD_EID().

dtn::EndpointID::EndpointID ( const oasys::Builder  )  [inline]

Constructor for deserialization.

Definition at line 42 of file EndpointID.h.

dtn::EndpointID::EndpointID ( const std::string &  str  )  [inline]

Construct the endpoint id from the given string.

Definition at line 48 of file EndpointID.h.

References parse().

dtn::EndpointID::EndpointID ( const EndpointID other  )  [inline]

Construct the endpoint id from another.

Definition at line 57 of file EndpointID.h.

References assign().

virtual dtn::EndpointID::~EndpointID (  )  [inline, virtual]

Destructor.

Definition at line 67 of file EndpointID.h.


Member Function Documentation

bool dtn::EndpointID::assign ( const EndpointID other  )  [inline]

Assign this endpoint ID as a copy of the other.

Definition at line 72 of file EndpointID.h.

References is_pattern_, scheme_, scheme_str_, ssp_, str_, and valid_.

Referenced by dtn::BundleDaemon::accept_custody(), dtn::BundleDaemon::BundleDaemon(), dtn::PreviousHopBlockProcessor::consume(), dtn::AnnounceBundle::create_announce_bundle(), dtn::ProphetTLV::create_bundle(), dtn::CustodySignal::create_custody_signal(), dtn::BundleStatusReport::create_status_report(), dtn::ProphetTLV::deserialize(), dtn::HelloTLV::deserialize(), dtn::Prophet::eid_to_route(), dtn::Prophet::eid_to_routeid(), EndpointID(), dtn::EndpointIDPattern::EndpointIDPattern(), dtnsim::NodeCommand::exec(), dtn::BundleCommand::exec(), dtn::PrimaryBlockProcessor::extract_dictionary_eid(), dtn::BundleDaemon::handle_bundle_inject(), dtn::StreamConvergenceLayer::Connection::handle_contact_initiation(), dtn::ProphetNode::operator=(), dtn::IPDiscovery::parse_advertisement(), dtn::AnnounceBundle::parse_announce_bundle(), dtn::CustodySignal::parse_custody_signal(), dtn::BundleStatusReport::parse_status_report(), dtn::ProphetController::ProphetController(), dtn::RIBDTLV::read_ras_entry(), dtn::BundleDaemon::release_custody(), dtn::LinkStateRouter::send_announcement(), dtnsim::TrAgent::send_bundle(), dtn::ProphetNode::set_eid(), dtn::BundleDaemon::set_local_eid(), dtn::Link::set_remote_eid(), and dtn::TcaEndpointID::TcaEndpointID().

bool dtn::EndpointID::assign ( const std::string &  str  )  [inline]

Set the string and parse it.

Returns:
true if the string is a valid id, false if not.

Definition at line 87 of file EndpointID.h.

References parse(), and str_.

bool dtn::EndpointID::assign ( const char *  str,
size_t  len 
) [inline]

Set the string and parse it.

Returns:
true if the string is a valid id, false if not.

Definition at line 97 of file EndpointID.h.

References parse(), and str_.

bool dtn::EndpointID::assign ( const std::string &  scheme,
const std::string &  ssp 
) [inline]

Set the string from component pieces and parse it.

Returns:
true if the string is a valid id, false if not.

Definition at line 107 of file EndpointID.h.

References parse(), and str_.

bool dtn::EndpointID::equals ( const EndpointID other  )  const [inline]

Simple equality test function.

Definition at line 116 of file EndpointID.h.

References str_.

Referenced by dtn::BundleDaemon::accept_custody(), dtn::ProphetDictionary::assign(), dtn::CustodySignal::create_custody_signal(), dtn::BundleStatusReport::create_status_report(), dtn::RouteTable::del_entries(), dtn::RouteTable::del_entry(), dtn::ProphetDictionary::find(), dtn::ProphetTable::find(), dtn::BundleDaemon::find_duplicate(), dtn::BundleDaemon::generate_custody_signal(), dtn::RegistrationTable::get(), dtn::BundleDaemon::handle_bundle_delivered(), dtn::ProphetController::handle_bundle_received(), dtn::ProphetEncounter::handle_bundle_tlv(), dtn::ProphetRouter::handle_link_created(), dtn::ProphetEncounter::handle_rib_tlv(), dtn::ProphetDictionary::insert(), dtn::ProphetDictionary::is_assigned(), dtn::ProphetController::new_neighbor(), dtn::ProphetAck::operator<(), dtn::ProphetAck::ProphetAck(), dtn::ProphetDictionary::ProphetDictionary(), dtn::ProphetEncounter::ProphetEncounter(), dtn::RIBDTLV::read_ras_entry(), dtn::IPDiscovery::run(), and dtn::RIBDTLV::write_ras_entry().

bool dtn::EndpointID::operator== ( const EndpointID other  )  const [inline]

Operator overload for equality syntactic sugar.

Definition at line 124 of file EndpointID.h.

References str_.

bool dtn::EndpointID::operator!= ( const EndpointID other  )  const [inline]

Operator overload for inequality syntactic sugar.

Definition at line 132 of file EndpointID.h.

References str_.

bool dtn::EndpointID::assign ( const dtn_endpoint_id_t eid  ) 

Set the string from the API type dtn_endpoint_id_t.

Returns:
true if the string is a valid id, false if not.

Definition at line 116 of file EndpointID.cc.

References parse(), str_, and dtn_endpoint_id_t::uri.

bool dtn::EndpointID::append_service_tag ( const char *  tag  ) 

Append the specified service tag (in a scheme-specific manner) to the ssp.

Returns:
true if successful, false if the scheme doesn't support service tags

Definition at line 95 of file EndpointID.cc.

References dtn::Scheme::append_service_tag(), scheme_, scheme_str_, ssp_, and str_.

Referenced by dtn::ProphetTLV::create_bundle(), dtn::APIClient::handle_local_eid(), dtn::BundleDaemon::load_registrations(), and dtn::ProphetController::ProphetController().

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 127 of file EndpointID.cc.

References ASSERT, DTN_MAX_ENDPOINT_ID, str_, and dtn_endpoint_id_t::uri.

Referenced by dtn::APIClient::handle_local_eid(), and dtn::APIClient::handle_recv().

bool dtn::EndpointID::known_scheme (  )  const [inline]

Return an indication of whether or not the scheme is known.

Definition at line 162 of file EndpointID.h.

References scheme_.

Referenced by dtn::TCAScheme::match(), dtn::EndpointIDPattern::match(), and dtn::DTNScheme::match().

static const EndpointID dtn::EndpointID::NULL_EID (  )  [inline, static]

Return the special endpoint id used for the null endpoint, namely "dtn:none".

Definition at line 171 of file EndpointID.h.

References EndpointID().

Referenced by dtn::BundleDaemon::accept_custody(), dtn::ProphetDictionary::assign(), dtn::AnnounceBundle::create_announce_bundle(), dtn::ProphetTLV::create_bundle(), dtn::CustodySignal::create_custody_signal(), dtn::BundleStatusReport::create_status_report(), dtn::PingRegistration::deliver_bundle(), dtn::BundleCommand::exec(), dtn::ProphetDictionary::find(), dtn::ProphetTable::find(), dtn::ContactManager::find_link_to(), dtn::BundleDaemon::generate_custody_signal(), dtn::BundleDaemon::handle_bundle_delivered(), dtn::BundleDaemon::handle_bundle_inject(), dtn::ProphetEncounter::handle_bundle_tlv(), dtn::ProphetRouter::handle_link_created(), dtn::ProphetEncounter::handle_rib_tlv(), dtn::APIClient::handle_send(), dtn::ProphetDictionary::insert(), dtn::ProphetDictionary::is_assigned(), dtn::ProphetController::new_neighbor(), dtn::ProphetAck::ProphetAck(), dtn::ProphetDictionary::ProphetDictionary(), dtn::ProphetEncounter::ProphetEncounter(), dtn::RIBDTLV::read_ras_entry(), dtn::BundleDaemon::release_custody(), dtn::LinkStateRouter::send_announcement(), dtn::ProphetTable::update(), and dtn::RIBDTLV::write_ras_entry().

static const EndpointID dtn::EndpointID::WILDCARD_EID (  )  [inline, static]

Return the special wildcard Endpoint ID.

This functionality is not in the bundle spec, but is used internally to this implementation.

Definition at line 178 of file EndpointID.h.

References EndpointID().

void dtn::EndpointID::serialize ( oasys::SerializeAction a  )  [virtual]

Virtual from SerializableObject.

Implements oasys::SerializableObject.

Definition at line 138 of file EndpointID.cc.

References oasys::SerializeAction::action_code(), parse(), oasys::SerializeAction::process(), str_, and oasys::Serialize::UNMARSHAL.

const std::string& dtn::EndpointID::str (  )  const [inline]

Accessors and wrappers around the various fields.

Definition at line 188 of file EndpointID.h.

References str_.

Referenced by dtn::Prophet::eid_to_route(), dtn::Prophet::eid_to_routeid(), dtn::TcaRouter::get_forwarding_rule(), dtn::TcaRouter::handle_ask(), dtn::TableBasedRouter::handle_link_created(), dtn::TcaRouter::handle_register(), dtn::TcaRouter::handle_tca_unbound_bundle(), dtn::log_bundle(), dtn::TCAScheme::match(), dtn::StringScheme::match(), dtn::DTNScheme::match(), dtn::TcaRouter::on_adv_transmitted(), dtn::TcaRouter::on_ask_transmitted(), dtn::TcaRouter::on_coa_transmitted(), dtn::less_eid_::operator()(), dtn::ProphetAck::operator<(), dtn::TcaRouter::push_wrapped_bundle(), dtn::CustodySignalEvent::serialize(), and dtn::RouteDelEvent::serialize().

const std::string& dtn::EndpointID::scheme_str (  )  const [inline]

Accessors and wrappers around the various fields.

Definition at line 189 of file EndpointID.h.

References scheme_str_.

Referenced by dtn::PrimaryBlockProcessor::add_to_dictionary(), dtn::TcaRouter::create_link(), dtn::Prophet::eid_to_routeid(), dtn::PrimaryBlockProcessor::extract_dictionary_eid(), dtn::PrimaryBlockProcessor::get_dictionary_offsets(), dtn::TcaRouter::get_forwarding_rule(), dtn::TcaRouter::handle_bundle_received(), dtn::TcaRouter::handle_bundle_transmitted(), and dtn::TableBasedRouter::handle_link_created().

const std::string& dtn::EndpointID::ssp (  )  const [inline]

Accessors and wrappers around the various fields.

Definition at line 190 of file EndpointID.h.

References ssp_.

Referenced by dtn::PrimaryBlockProcessor::add_to_dictionary(), dtn::TcaRouter::create_link(), dtn::PrimaryBlockProcessor::extract_dictionary_eid(), dtn::PrimaryBlockProcessor::get_dictionary_offsets(), dtn::TcaRouter::get_forwarding_rule(), dtn::TcaRouter::handle_bundle_received(), dtn::TableBasedRouter::handle_link_created(), dtn::TCAScheme::match(), and dtn::DTNScheme::match().

Scheme* dtn::EndpointID::scheme (  )  const [inline]

Accessors and wrappers around the various fields.

Definition at line 191 of file EndpointID.h.

References scheme_.

Referenced by dtn::TCAScheme::match(), dtn::EndpointIDPattern::match(), and dtn::DTNScheme::match().

bool dtn::EndpointID::valid (  )  const [inline]

Accessors and wrappers around the various fields.

Definition at line 192 of file EndpointID.h.

References valid_.

Referenced by dtn::RouteCommand::exec(), dtn::RegistrationCommand::exec(), dtnsim::NodeCommand::exec(), dtn::PrimaryBlockProcessor::extract_dictionary_eid(), dtn::FloodBundleRouter::FloodBundleRouter(), and dtn::Bundle::validate().

bool dtn::EndpointID::is_pattern (  )  const [inline]

Accessors and wrappers around the various fields.

Definition at line 193 of file EndpointID.h.

References is_pattern_.

const char* dtn::EndpointID::c_str (  )  const [inline]

Accessors and wrappers around the various fields.

Definition at line 194 of file EndpointID.h.

References str_.

Referenced by dtn::RegistrationTable::add(), dtn::CustodySignal::create_custody_signal(), dtn::BundleStatusReport::create_status_report(), dtn::RouteTable::del_entries(), 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::RouteEntry::dump(), dtn::HelloTLV::dump(), dtn::ProphetNode::dump(), dtn::Link::dump(), dtn::ProphetEncounter::dump_state(), dtnsim::NodeCommand::exec(), dtn::BundleCommand::exec(), dtn::PrimaryBlockProcessor::extract_dictionary_eid(), dtn::ProphetController::find_instance(), dtn::ContactManager::find_link_to(), dtn::RouteEntry::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::FragmentManager::get_hash_key(), dtn::RouteTable::get_matching(), dtn::RegistrationTable::get_matching(), dtn::BundleDaemon::handle_bundle_delivered(), dtn::LinkStateRouter::handle_bundle_received(), dtn::BundleDaemon::handle_bundle_received(), dtn::StreamConvergenceLayer::Connection::handle_contact_initiation(), dtn::BundleDaemon::handle_custody_signal(), dtn::BundleDaemon::handle_registration_added(), dtn::BundleDaemon::handle_registration_removed(), dtn::BundleDaemon::handle_route_del(), dtn::TcaRouter::handle_tca_unbound_bundle(), dtn::log_bundle(), dtn::LoggingRegistration::LoggingRegistration(), dtn::TCAScheme::match(), dtn::DTNScheme::match(), dtn::ContactManager::new_opportunistic_link(), dtn::TcaRouter::on_coa_transmitted(), dtn::TcaRouter::post_bundle(), dtn::BluetoothDiscovery::run(), dtnsim::TrAgent::send_bundle(), dtn::HelloTLV::serialize(), dtn::TcaRouter::TcaRouter(), dtn::TclRegistration::TclRegistration(), dtn::RegistrationTable::update(), dtn::Bundle::validate(), and dtn::RIBDTLV::write_ras_entry().

const char* dtn::EndpointID::data (  )  const [inline]

Accessors and wrappers around the various fields.

Definition at line 195 of file EndpointID.h.

References str_.

Referenced by dtn::StreamConvergenceLayer::Connection::initiate_contact().

size_t dtn::EndpointID::length (  )  const [inline]

Accessors and wrappers around the various fields.

Definition at line 196 of file EndpointID.h.

References str_.

Referenced by dtn::CustodySignal::create_custody_signal(), dtn::BundleStatusReport::create_status_report(), dtn::RouteEntry::dump(), dtn::IPAnnounce::format_advertisement(), dtn::HelloTLV::HelloTLV(), dtn::StreamConvergenceLayer::Connection::initiate_contact(), dtn::HelloTLV::serialize(), and dtn::RIBDTLV::write_ras_entry().

bool dtn::EndpointID::parse (  )  [protected]

Extract and look up the scheme and ssp.

Returns:
true if the string is a valid endpoint id, false if not.

Reimplemented in dtn::TcaEndpointID.

Definition at line 33 of file EndpointID.cc.

References is_pattern_, scheme_, scheme_str_, ssp_, str_, valid_, and dtn::Scheme::validate().

Referenced by assign(), EndpointID(), and serialize().


Member Data Documentation

std::string dtn::EndpointID::str_ [protected]

Definition at line 207 of file EndpointID.h.

Referenced by append_service_tag(), assign(), c_str(), copyto(), data(), equals(), length(), operator!=(), operator==(), parse(), serialize(), and str().

std::string dtn::EndpointID::scheme_str_ [protected]

Definition at line 208 of file EndpointID.h.

Referenced by append_service_tag(), assign(), parse(), and scheme_str().

std::string dtn::EndpointID::ssp_ [protected]

Definition at line 209 of file EndpointID.h.

Referenced by append_service_tag(), assign(), parse(), and ssp().

Scheme* dtn::EndpointID::scheme_ [protected]

Definition at line 210 of file EndpointID.h.

Referenced by append_service_tag(), assign(), known_scheme(), parse(), and scheme().

bool dtn::EndpointID::valid_ [protected]

Definition at line 211 of file EndpointID.h.

Referenced by assign(), parse(), and valid().

bool dtn::EndpointID::is_pattern_ [protected]

Definition at line 212 of file EndpointID.h.

Referenced by assign(), dtn::EndpointIDPattern::EndpointIDPattern(), is_pattern(), and parse().


The documentation for this class was generated from the following files:
Generated on Thu Jun 7 16:56:57 2007 for DTN Reference Implementation by  doxygen 1.5.1