IBR-DTNSuite  0.8
dtn::net::DatagramService Class Reference

#include <DatagramConvergenceLayer.h>

Inheritance diagram for dtn::net::DatagramService:

List of all members.

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

Detailed Description

Definition at line 26 of file DatagramConvergenceLayer.h.


Member Enumeration Documentation

Enumerator:
FLOW_NONE 
FLOW_STOPNWAIT 

Definition at line 29 of file DatagramConvergenceLayer.h.


Constructor & Destructor Documentation

virtual dtn::net::DatagramService::~DatagramService ( ) [inline, virtual]

Definition at line 35 of file DatagramConvergenceLayer.h.


Member Function Documentation

virtual void dtn::net::DatagramService::bind ( ) throw (DatagramException) [pure virtual]

Bind to the local socket.

Exceptions:
Ifthe 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.

Returns:
A vinterface object.

Implemented in dtn::net::UDPDatagramService, and dtn::net::LOWPANDatagramService.

Referenced by dtn::net::DatagramConvergenceLayer::componentUp().

Returns the parameter for the connection.

Returns:

Implemented in dtn::net::UDPDatagramService, and dtn::net::LOWPANDatagramService.

Referenced by dtn::net::DatagramConvergenceLayer::componentRun().

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.

Returns:
The service description as string.

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.

Returns:
The tag as string.

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.

Parameters:
bufA buffer to catch the incoming data.
lengthThe length of the buffer.
addressA buffer for the address of the sender.
Exceptions:
Ifthe receive call failed for any reason, an DatagramException is thrown.
Returns:
The number of received bytes.

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

Parameters:
addressThe destination address encoded as string.
bufThe buffer to send.
lengthThe number of available bytes in the buffer.
Exceptions:
Ifthe 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)

Parameters:
bufThe buffer to send.
lengthThe number of available bytes in the buffer.
Exceptions:
Ifthe 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().


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