IBR-DTNSuite
0.8
|
#include <DatagramConvergenceLayer.h>
Public Types | |
enum | FLOWCONTROL { FLOW_NONE = 0, FLOW_STOPNWAIT = 1 } |
Public Member Functions | |
virtual | ~DatagramService () |
virtual void | bind ()=0 throw (DatagramException) |
virtual void | shutdown ()=0 |
virtual void | send (const char &type, const char &flags, const unsigned int &seqno, const std::string &address, const char *buf, size_t length)=0 throw (DatagramException) |
virtual void | send (const char &type, const char &flags, const unsigned int &seqno, const char *buf, size_t length)=0 throw (DatagramException) |
virtual size_t | recvfrom (char *buf, size_t length, char &type, char &flags, unsigned int &seqno, std::string &address)=0 throw (DatagramException) |
virtual const std::string | getServiceTag () const =0 |
virtual const std::string | getServiceDescription () const =0 |
virtual const ibrcommon::vinterface & | getInterface () const =0 |
virtual dtn::core::Node::Protocol | getProtocol () const =0 |
virtual const DatagramConnectionParameter & | getParameter () const =0 |
Definition at line 26 of file DatagramConvergenceLayer.h.
Definition at line 29 of file DatagramConvergenceLayer.h.
virtual dtn::net::DatagramService::~DatagramService | ( | ) | [inline, virtual] |
Definition at line 35 of file DatagramConvergenceLayer.h.
virtual void dtn::net::DatagramService::bind | ( | ) | throw (DatagramException) [pure virtual] |
Bind to the local socket.
If | the bind fails, an DatagramException is thrown. |
Implemented in dtn::net::UDPDatagramService, and dtn::net::LOWPANDatagramService.
Referenced by dtn::net::DatagramConvergenceLayer::componentUp().
virtual const ibrcommon::vinterface& dtn::net::DatagramService::getInterface | ( | ) | const [pure virtual] |
The used interface as vinterface object.
Implemented in dtn::net::UDPDatagramService, and dtn::net::LOWPANDatagramService.
Referenced by dtn::net::DatagramConvergenceLayer::componentUp().
virtual const DatagramConnectionParameter& dtn::net::DatagramService::getParameter | ( | ) | const [pure virtual] |
Returns the parameter for the connection.
Implemented in dtn::net::UDPDatagramService, and dtn::net::LOWPANDatagramService.
Referenced by dtn::net::DatagramConvergenceLayer::componentRun().
virtual dtn::core::Node::Protocol dtn::net::DatagramService::getProtocol | ( | ) | const [pure virtual] |
The protocol identifier for this type of service.
Implemented in dtn::net::UDPDatagramService, and dtn::net::LOWPANDatagramService.
Referenced by dtn::net::DatagramConvergenceLayer::componentRun(), dtn::net::DatagramConvergenceLayer::getDiscoveryProtocol(), and dtn::net::DatagramConvergenceLayer::queue().
virtual const std::string dtn::net::DatagramService::getServiceDescription | ( | ) | const [pure virtual] |
Get the service description for this convergence layer. This data is used to contact this node.
Implemented in dtn::net::UDPDatagramService, and dtn::net::LOWPANDatagramService.
virtual const std::string dtn::net::DatagramService::getServiceTag | ( | ) | const [pure virtual] |
Get the tag for this service used in discovery messages.
Implemented in dtn::net::UDPDatagramService, and dtn::net::LOWPANDatagramService.
virtual size_t dtn::net::DatagramService::recvfrom | ( | char * | buf, |
size_t | length, | ||
char & | type, | ||
char & | flags, | ||
unsigned int & | seqno, | ||
std::string & | address | ||
) | throw (DatagramException) [pure virtual] |
Receive an incoming datagram.
buf | A buffer to catch the incoming data. |
length | The length of the buffer. |
address | A buffer for the address of the sender. |
If | the receive call failed for any reason, an DatagramException is thrown. |
Implemented in dtn::net::UDPDatagramService, and dtn::net::LOWPANDatagramService.
Referenced by dtn::net::DatagramConvergenceLayer::componentRun().
virtual void dtn::net::DatagramService::send | ( | const char & | type, |
const char & | flags, | ||
const unsigned int & | seqno, | ||
const std::string & | address, | ||
const char * | buf, | ||
size_t | length | ||
) | throw (DatagramException) [pure virtual] |
Send the payload as datagram to a defined destination
address | The destination address encoded as string. |
buf | The buffer to send. |
length | The number of available bytes in the buffer. |
If | the transmission wasn't successful this method will throw an exception. |
Implemented in dtn::net::UDPDatagramService, and dtn::net::LOWPANDatagramService.
Referenced by dtn::net::DatagramConvergenceLayer::sendAnnoucement().
virtual void dtn::net::DatagramService::send | ( | const char & | type, |
const char & | flags, | ||
const unsigned int & | seqno, | ||
const char * | buf, | ||
size_t | length | ||
) | throw (DatagramException) [pure virtual] |
Send the payload as datagram to all neighbors (broadcast)
buf | The buffer to send. |
length | The number of available bytes in the buffer. |
If | the transmission wasn't successful this method will throw an exception. |
Implemented in dtn::net::UDPDatagramService, and dtn::net::LOWPANDatagramService.
virtual void dtn::net::DatagramService::shutdown | ( | ) | [pure virtual] |
Shutdown the socket. Unblock all calls on the socket (recv, send, etc.)
Implemented in dtn::net::UDPDatagramService, and dtn::net::LOWPANDatagramService.
Referenced by dtn::net::DatagramConvergenceLayer::__cancellation().