IBR-DTNSuite  0.10
dtn::net::LOWPANDatagramService Class Reference

#include <LOWPANDatagramService.h>

Inheritance diagram for dtn::net::LOWPANDatagramService:
Inheritance graph
Collaboration diagram for dtn::net::LOWPANDatagramService:
Collaboration graph

Public Member Functions

 LOWPANDatagramService (const ibrcommon::vinterface &iface, uint16_t panid)
 
virtual ~LOWPANDatagramService ()
 
virtual void bind () throw (DatagramException)
 
virtual void shutdown ()
 
virtual void send (const char &type, const char &flags, const unsigned int &seqno, const std::string &address, const char *buf, size_t length) throw (DatagramException)
 
virtual void send (const char &type, const char &flags, const unsigned int &seqno, const char *buf, size_t length) throw (DatagramException)
 
virtual size_t recvfrom (char *buf, size_t length, char &type, char &flags, unsigned int &seqno, std::string &address) throw (DatagramException)
 
virtual const std::string getServiceTag () const
 
virtual const std::string getServiceDescription () const
 
virtual const
ibrcommon::vinterface
getInterface () const
 
virtual dtn::core::Node::Protocol getProtocol () const
 
virtual const
DatagramService::Parameter
getParameter () const
 
- Public Member Functions inherited from dtn::net::DatagramService
virtual ~DatagramService ()=0
 

Static Public Attributes

static const std::string TAG = "LOWPANDatagramService"
 

Additional Inherited Members

- Public Types inherited from dtn::net::DatagramService
enum  FLOWCONTROL { FLOW_NONE = 0, FLOW_STOPNWAIT = 1 }
 
enum  HEADER_FLAGS { SEGMENT_FIRST = 0x02, SEGMENT_LAST = 0x01, SEGMENT_MIDDLE = 0x00 }
 

Detailed Description

Definition at line 33 of file LOWPANDatagramService.h.

Constructor & Destructor Documentation

dtn::net::LOWPANDatagramService::~LOWPANDatagramService ( )
virtual

Definition at line 57 of file LOWPANDatagramService.cpp.

References ibrcommon::vsocket::destroy().

Here is the call graph for this function:

Member Function Documentation

void dtn::net::LOWPANDatagramService::bind ( ) throw (DatagramException)
virtual

Bind to the local socket.

Exceptions
Ifthe bind fails, an DatagramException is thrown.

Implements dtn::net::DatagramService.

Definition at line 67 of file LOWPANDatagramService.cpp.

References ibrcommon::vsocket::add(), ibrcommon::vsocket::destroy(), and ibrcommon::vsocket::up().

Here is the call graph for this function:

const ibrcommon::vinterface & dtn::net::LOWPANDatagramService::getInterface ( ) const
virtual

The used interface as vinterface object.

Returns
A vinterface object.

Implements dtn::net::DatagramService.

Definition at line 306 of file LOWPANDatagramService.cpp.

const DatagramService::Parameter & dtn::net::LOWPANDatagramService::getParameter ( ) const
virtual

Returns the parameter for the connection.

Returns

Implements dtn::net::DatagramService.

Definition at line 320 of file LOWPANDatagramService.cpp.

dtn::core::Node::Protocol dtn::net::LOWPANDatagramService::getProtocol ( ) const
virtual

The protocol identifier for this type of service.

Returns

Implements dtn::net::DatagramService.

Definition at line 315 of file LOWPANDatagramService.cpp.

References dtn::core::Node::CONN_DGRAM_LOWPAN.

const std::string dtn::net::LOWPANDatagramService::getServiceDescription ( ) const
virtual

Get the service description for this convergence layer. This data is used to contact this node.

Returns
The service description as string.

Implements dtn::net::DatagramService.

Definition at line 291 of file LOWPANDatagramService.cpp.

References ibrcommon::lowpansocket::getAddress().

Here is the call graph for this function:

const std::string dtn::net::LOWPANDatagramService::getServiceTag ( ) const
virtual

Get the tag for this service used in discovery messages.

Returns
The tag as string.

Implements dtn::net::DatagramService.

Definition at line 281 of file LOWPANDatagramService.cpp.

size_t dtn::net::LOWPANDatagramService::recvfrom ( char *  buf,
size_t  length,
char &  type,
char &  flags,
unsigned int &  seqno,
std::string &  address 
) throw (DatagramException)
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.

Implements dtn::net::DatagramService.

Definition at line 214 of file LOWPANDatagramService.cpp.

References dtn::net::DatagramConvergenceLayer::HEADER_ACK, dtn::net::DatagramConvergenceLayer::HEADER_BROADCAST, dtn::net::DatagramConvergenceLayer::HEADER_NACK, dtn::net::DatagramConvergenceLayer::HEADER_SEGMENT, IBRCOMMON_LOGGER_DEBUG_TAG, IBRCOMMON_LOGGER_ENDL, ibrcommon::lowpansocket::recvfrom(), dtn::net::DatagramService::SEGMENT_FIRST, dtn::net::DatagramService::SEGMENT_LAST, and TAG.

Here is the call graph for this function:

void dtn::net::LOWPANDatagramService::send ( const char &  type,
const char &  flags,
const unsigned int &  seqno,
const std::string &  identifier,
const char *  buf,
size_t  length 
) throw (DatagramException)
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.

Implements dtn::net::DatagramService.

Definition at line 95 of file LOWPANDatagramService.cpp.

References ibrcommon::LogLevel::error, dtn::net::DatagramConvergenceLayer::HEADER_ACK, dtn::net::DatagramConvergenceLayer::HEADER_BROADCAST, dtn::net::DatagramConvergenceLayer::HEADER_NACK, dtn::net::DatagramConvergenceLayer::HEADER_SEGMENT, IBRCOMMON_LOGGER_DEBUG_TAG, IBRCOMMON_LOGGER_ENDL, IBRCOMMON_LOGGER_TAG, dtn::net::DatagramService::SEGMENT_FIRST, dtn::net::DatagramService::SEGMENT_LAST, ibrcommon::lowpansocket::sendto(), and TAG.

Here is the call graph for this function:

void dtn::net::LOWPANDatagramService::send ( const char &  type,
const char &  flags,
const unsigned int &  seqno,
const char *  buf,
size_t  length 
) throw (DatagramException)
virtual
void dtn::net::LOWPANDatagramService::shutdown ( )
virtual

Shutdown the socket. Unblock all calls on the socket (recv, send, etc.)

Implements dtn::net::DatagramService.

Definition at line 83 of file LOWPANDatagramService.cpp.

References ibrcommon::vsocket::down().

Here is the call graph for this function:

Member Data Documentation

const std::string dtn::net::LOWPANDatagramService::TAG = "LOWPANDatagramService"
static

Definition at line 36 of file LOWPANDatagramService.h.

Referenced by recvfrom(), and send().


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