IBR-DTNSuite
0.8
|
#include <LOWPANDatagramService.h>
Public Member Functions | |
LOWPANDatagramService (const ibrcommon::vinterface &iface, int 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 DatagramConnectionParameter & | getParameter () const |
Definition at line 19 of file LOWPANDatagramService.h.
dtn::net::LOWPANDatagramService::LOWPANDatagramService | ( | const ibrcommon::vinterface & | iface, |
int | panid | ||
) |
dtn::net::LOWPANDatagramService::~LOWPANDatagramService | ( | ) | [virtual] |
Definition at line 36 of file LOWPANDatagramService.cpp.
void dtn::net::LOWPANDatagramService::bind | ( | ) | throw (DatagramException) [virtual] |
Bind to the local socket.
If | the bind fails, an DatagramException is thrown. |
Implements dtn::net::DatagramService.
Definition at line 45 of file LOWPANDatagramService.cpp.
References ibrcommon::UnicastSocketLowpan::bind().
const ibrcommon::vinterface & dtn::net::LOWPANDatagramService::getInterface | ( | ) | const [virtual] |
The used interface as vinterface object.
Implements dtn::net::DatagramService.
Definition at line 280 of file LOWPANDatagramService.cpp.
const DatagramConnectionParameter & dtn::net::LOWPANDatagramService::getParameter | ( | ) | const [virtual] |
Returns the parameter for the connection.
Implements dtn::net::DatagramService.
Definition at line 294 of file LOWPANDatagramService.cpp.
dtn::core::Node::Protocol dtn::net::LOWPANDatagramService::getProtocol | ( | ) | const [virtual] |
The protocol identifier for this type of service.
Implements dtn::net::DatagramService.
Definition at line 289 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.
Implements dtn::net::DatagramService.
Definition at line 264 of file LOWPANDatagramService.cpp.
References sockaddr_ieee802154::addr, ieee802154_addr::addr_type, ibrcommon::lowpansocket::getAddress(), IEEE802154_ADDR_SHORT, ieee802154_addr::pan_id, and ieee802154_addr::short_addr.
const std::string dtn::net::LOWPANDatagramService::getServiceTag | ( | ) | const [virtual] |
Get the tag for this service used in discovery messages.
Implements dtn::net::DatagramService.
Definition at line 254 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.
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. |
Implements dtn::net::DatagramService.
Definition at line 205 of file LOWPANDatagramService.cpp.
References EXTENDED_MASK, dtn::net::DatagramConvergenceLayer::HEADER_SEGMENT, IBRCOMMON_LOGGER_DEBUG, and IBRCOMMON_LOGGER_ENDL.
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
address | The destination address encoded as string. |
buf | The buffer to send. |
length | The number of available bytes in the buffer. |
Implements dtn::net::DatagramService.
Definition at line 73 of file LOWPANDatagramService.cpp.
References sockaddr_ieee802154::addr, EXTENDED_MASK, dtn::net::DatagramConvergenceLayer::HEADER_SEGMENT, IBRCOMMON_LOGGER, IBRCOMMON_LOGGER_ENDL, ibrcommon::lowpansocket::peer::send(), and ieee802154_addr::short_addr.
void dtn::net::LOWPANDatagramService::send | ( | const char & | type, |
const char & | flags, | ||
const unsigned int & | seqno, | ||
const char * | buf, | ||
size_t | length | ||
) | throw (DatagramException) [virtual] |
Send the payload as datagram to all neighbors (broadcast)
buf | The buffer to send. |
length | The number of available bytes in the buffer. |
Implements dtn::net::DatagramService.
Definition at line 145 of file LOWPANDatagramService.cpp.
References sockaddr_ieee802154::addr, EXTENDED_MASK, IBRCOMMON_LOGGER, IBRCOMMON_LOGGER_ENDL, ibrcommon::lowpansocket::peer::send(), and ieee802154_addr::short_addr.
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 61 of file LOWPANDatagramService.cpp.
References ibrcommon::lowpansocket::shutdown().