dtn::IPAnnounce Class Reference

#include <IPAnnounce.h>

Inheritance diagram for dtn::IPAnnounce:

dtn::Announce oasys::Logger List of all members.

Detailed Description

Helper class that 1) formats outbound beacons to advertise this CL instance via neighbor discovery, and 2) responds to inbound advertisements by creating a new Contact.

Definition at line 31 of file IPAnnounce.h.

Public Member Functions

void handle_neighbor_discovered (const std::string &nexthop, const EndpointID &remote_eid)
 Upon receipt of a beacon, the parent Discovery will deliver details to this callback method so that TCPCL or UDPCL can initiate contact to the advertising node.
size_t format_advertisement (u_char *buf, size_t len)
 Serialize announcement out to buffer.

Protected Types

typedef IPDiscovery::DiscoveryHeader DiscoveryHeader

Protected Member Functions

 IPAnnounce ()
 Constructor.
bool configure (const std::string &name, ConvergenceLayer *cl, int argc, const char *argv[])
 Deserialize parameters for configuration.

Protected Attributes

in_addr_t cl_addr_
 next hop info for CL to be advertised
u_int16_t cl_port_

Friends

class Announce


Member Typedef Documentation

typedef IPDiscovery::DiscoveryHeader dtn::IPAnnounce::DiscoveryHeader [protected]

Definition at line 50 of file IPAnnounce.h.


Constructor & Destructor Documentation

dtn::IPAnnounce::IPAnnounce (  )  [protected]

Constructor.

Definition at line 27 of file IPAnnounce.cc.


Member Function Documentation

void dtn::IPAnnounce::handle_neighbor_discovered ( const std::string &  nexthop,
const EndpointID remote_eid 
) [virtual]

Upon receipt of a beacon, the parent Discovery will deliver details to this callback method so that TCPCL or UDPCL can initiate contact to the advertising node.

Implements dtn::Announce.

Definition at line 103 of file IPAnnounce.cc.

References ASSERT, dtn::Announce::cl_, dtn::ContactManager::find_link_to(), log_warn, oasys::Logger::logpath_, dtn::TCPConvergenceLayer::new_connection(), dtn::TCPConvergenceLayer::new_link_params(), dtn::IPConvergenceLayerUtils::parse_nexthop(), dtn::TCPConvergenceLayer::TCPLinkParams::remote_addr_, dtn::TCPConvergenceLayer::TCPLinkParams::remote_port_, oasys::Thread::start(), and dtn::Announce::type().

size_t dtn::IPAnnounce::format_advertisement ( u_char *  buf,
size_t  len 
) [virtual]

Serialize announcement out to buffer.

Implements dtn::Announce.

Definition at line 79 of file IPAnnounce.cc.

References dtn::EndpointID::c_str(), cl_addr_, cl_port_, dtn::Announce::data_sent_, FOUR_BYTE_ALIGN, dtnsim::gettimeofday(), dtn::Announce::interval_, dtn::EndpointID::length(), dtn::IPDiscovery::str_to_type(), and dtn::Announce::type().

bool dtn::IPAnnounce::configure ( const std::string &  name,
ConvergenceLayer cl,
int  argc,
const char *  argv[] 
) [protected, virtual]

Deserialize parameters for configuration.

Implements dtn::Announce.

Definition at line 33 of file IPAnnounce.cc.

References oasys::OptParser::addopt(), oasys::StringBuffer::c_str(), dtn::Announce::cl_, cl_addr_, cl_port_, dtn::Announce::interval_, intoa, dtn::Announce::local_, log_err, dtn::ConvergenceLayer::name(), dtn::Announce::name_, oasys::OptParser::parse(), and dtn::Announce::type_.


Friends And Related Function Documentation

friend class Announce [friend]

Definition at line 48 of file IPAnnounce.h.


Member Data Documentation

in_addr_t dtn::IPAnnounce::cl_addr_ [protected]

next hop info for CL to be advertised

Definition at line 66 of file IPAnnounce.h.

Referenced by configure(), and format_advertisement().

u_int16_t dtn::IPAnnounce::cl_port_ [protected]

Definition at line 67 of file IPAnnounce.h.

Referenced by configure(), and format_advertisement().


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