TcaController Class Reference

#include <TcaController.h>

List of all members.

Public Types

enum  Role { TCA_MOBILE, TCA_ROUTER, TCA_GATEWAY }

Public Member Functions

 TcaController (Role role, const std::string &link_id, const std::string &ask_addr, const std::string &adv_str, int registry_ttl, int control_ttl)
virtual ~TcaController ()
bool init (bool tidy)
void run ()
bool send_bundle (const dtn_bundle_spec_t &spec, const std::string &payload)
bool recv_bundle (dtn_bundle_spec_t &spec, std::string &payload, unsigned int timeout=0)
bool send_bundle (const std::string &dest, const std::string &payload)

Protected Member Functions

bool dtn_reg (dtn_endpoint_id_t &eid, dtn_reg_id_t &id)
bool handle_bundle_received (const dtn_bundle_spec_t &spec, const std::string &payload)
bool handle_reg_received (const dtn_bundle_spec_t &spec, const dtn::TcaControlBundle &cb)
bool route_reg (const dtn_bundle_spec_t &spec, const dtn::TcaControlBundle &cb)
bool gate_reg (const dtn_bundle_spec_t &spec, const dtn::TcaControlBundle &cb)
bool handle_unb (const dtn_bundle_spec_t &spec, const dtn::TcaControlBundle &cb)
bool handle_coa_sent (const dtn_bundle_spec_t &spec, const dtn::TcaControlBundle &cb)
bool handle_link_announce (const dtn_bundle_spec_t &spec, const dtn::TcaControlBundle &cb)
bool handle_ask (const dtn_bundle_spec_t &spec, const dtn::TcaControlBundle &cb)
bool handle_ask_received (const dtn_bundle_spec_t &spec, const dtn::TcaControlBundle &cb)
bool handle_ask_sent (const dtn_bundle_spec_t &spec, const dtn::TcaControlBundle &cb)
bool handle_adv (const dtn_bundle_spec_t &spec, const dtn::TcaControlBundle &cb)
bool handle_adv_sent (const dtn_bundle_spec_t &spec, const dtn::TcaControlBundle &cb)
bool handle_routes (const dtn_bundle_spec_t &spec, const dtn::TcaControlBundle &cb)
bool ask (const std::string &link)
bool get_routes ()
bool add_route (const std::string &route_pattern, const std::string &link)
bool del_route (const std::string &route_pattern)
bool get_registration (const TcaEndpointID &eid, RegRecord &rr)
bool do_registration (const TcaEndpointID &eid, const std::string &link_addr)
bool test_all ()
void eat_bundles (bool verbose=true)

Protected Attributes

Role role_
std::string link_id_
std::string ask_addr_
std::string adv_str_
int registry_ttl_
int control_ttl_
TcaRegistry registry_
dtn_handle_t handle_
dtn_endpoint_id_t local_eid_


Detailed Description

Definition at line 32 of file TcaController.h.


Member Enumeration Documentation

Enumerator:
TCA_MOBILE 
TCA_ROUTER 
TCA_GATEWAY 

Definition at line 36 of file TcaController.h.


Constructor & Destructor Documentation

TcaController::TcaController ( TcaController::Role  role,
const std::string &  link_id,
const std::string &  ask_addr,
const std::string &  adv_str,
int  registry_ttl,
int  control_ttl 
)

Definition at line 107 of file TcaController.cc.

TcaController::~TcaController (  )  [virtual]

Definition at line 121 of file TcaController.cc.

References dtn_close(), and handle_.


Member Function Documentation

bool TcaController::add_route ( const std::string &  route_pattern,
const std::string &  link 
) [protected]

bool TcaController::ask ( const std::string &  link  )  [protected]

Definition at line 679 of file TcaController.cc.

References add_route(), link_id_, pattern(), and send_bundle().

Referenced by handle_link_announce(), and run().

bool TcaController::del_route ( const std::string &  route_pattern  )  [protected]

Definition at line 744 of file TcaController.cc.

References send_bundle().

Referenced by handle_adv_sent(), handle_ask_sent(), handle_coa_sent(), route_reg(), and test_all().

bool TcaController::do_registration ( const TcaEndpointID eid,
const std::string &  link_addr 
) [protected]

bool TcaController::dtn_reg ( dtn_endpoint_id_t eid,
dtn_reg_id_t id 
) [protected]

void TcaController::eat_bundles ( bool  verbose = true  )  [protected]

Definition at line 819 of file TcaController.cc.

References dtn_errno(), DTN_ETIMEOUT, DTN_PAYLOAD_MEM, dtn_recv(), dtn_strerror(), handle_, and recv_bundle().

Referenced by init().

bool TcaController::gate_reg ( const dtn_bundle_spec_t spec,
const dtn::TcaControlBundle cb 
) [protected]

bool TcaController::get_registration ( const TcaEndpointID eid,
RegRecord rr 
) [protected]

bool TcaController::get_routes (  )  [protected]

Definition at line 711 of file TcaController.cc.

References send_bundle().

Referenced by test_all().

bool TcaController::handle_adv ( const dtn_bundle_spec_t spec,
const dtn::TcaControlBundle cb 
) [protected]

Definition at line 457 of file TcaController.cc.

Referenced by handle_bundle_received().

bool TcaController::handle_adv_sent ( const dtn_bundle_spec_t spec,
const dtn::TcaControlBundle cb 
) [protected]

bool TcaController::handle_ask ( const dtn_bundle_spec_t spec,
const dtn::TcaControlBundle cb 
) [protected]

Definition at line 402 of file TcaController.cc.

Referenced by handle_bundle_received().

bool TcaController::handle_ask_received ( const dtn_bundle_spec_t spec,
const dtn::TcaControlBundle cb 
) [protected]

bool TcaController::handle_ask_sent ( const dtn_bundle_spec_t spec,
const dtn::TcaControlBundle cb 
) [protected]

bool TcaController::handle_bundle_received ( const dtn_bundle_spec_t spec,
const std::string &  payload 
) [protected]

bool TcaController::handle_coa_sent ( const dtn_bundle_spec_t spec,
const dtn::TcaControlBundle cb 
) [protected]

bool TcaController::handle_link_announce ( const dtn_bundle_spec_t spec,
const dtn::TcaControlBundle cb 
) [protected]

Definition at line 387 of file TcaController.cc.

References dtn::TcaControlBundle::args_, ask(), and check_nargs().

Referenced by handle_bundle_received().

bool TcaController::handle_reg_received ( const dtn_bundle_spec_t spec,
const dtn::TcaControlBundle cb 
) [protected]

Definition at line 289 of file TcaController.cc.

References gate_reg(), role_, route_reg(), TCA_GATEWAY, TCA_MOBILE, and TCA_ROUTER.

Referenced by handle_bundle_received().

bool TcaController::handle_routes ( const dtn_bundle_spec_t spec,
const dtn::TcaControlBundle cb 
) [protected]

Definition at line 491 of file TcaController.cc.

References dtn::TcaControlBundle::args_.

Referenced by handle_bundle_received().

bool TcaController::handle_unb ( const dtn_bundle_spec_t spec,
const dtn::TcaControlBundle cb 
) [protected]

bool TcaController::init ( bool  tidy  ) 

bool TcaController::recv_bundle ( dtn_bundle_spec_t spec,
std::string &  payload,
unsigned int  timeout = 0 
)

bool TcaController::route_reg ( const dtn_bundle_spec_t spec,
const dtn::TcaControlBundle cb 
) [protected]

void TcaController::run (  ) 

Definition at line 205 of file TcaController.cc.

References ask(), ask_addr_, handle_bundle_received(), recv_bundle(), and RECV_TIMEOUT.

Referenced by main().

bool TcaController::send_bundle ( const std::string &  dest,
const std::string &  payload 
)

bool TcaController::send_bundle ( const dtn_bundle_spec_t spec,
const std::string &  payload 
)

bool TcaController::test_all (  )  [protected]

Definition at line 800 of file TcaController.cc.

References add_route(), del_route(), and get_routes().


Member Data Documentation

std::string TcaController::adv_str_ [protected]

Definition at line 63 of file TcaController.h.

Referenced by handle_ask_received().

std::string TcaController::ask_addr_ [protected]

Definition at line 62 of file TcaController.h.

Referenced by run().

int TcaController::control_ttl_ [protected]

Definition at line 65 of file TcaController.h.

Referenced by gate_reg(), and send_bundle().

Definition at line 68 of file TcaController.h.

Referenced by dtn_reg(), eat_bundles(), init(), recv_bundle(), send_bundle(), and ~TcaController().

std::string TcaController::link_id_ [protected]

Definition at line 61 of file TcaController.h.

Referenced by ask(), gate_reg(), handle_coa_sent(), and route_reg().

Definition at line 69 of file TcaController.h.

Referenced by gate_reg(), handle_coa_sent(), init(), and send_bundle().

Definition at line 67 of file TcaController.h.

Referenced by do_registration(), get_registration(), and init().

Definition at line 64 of file TcaController.h.

Referenced by do_registration().

Definition at line 60 of file TcaController.h.

Referenced by handle_coa_sent(), handle_reg_received(), handle_unb(), init(), and route_reg().


The documentation for this class was generated from the following files:

Generated on Fri Jan 30 09:27:01 2009 for DTN Reference Implementation by  doxygen 1.5.8