IBR-DTNSuite
0.12
|
#include <lowpansocket.h>
Public Member Functions | |
lowpansocket (const uint16_t &panid, const vinterface &iface) | |
~lowpansocket () | |
void | up () throw (socket_exception) |
void | down () throw (socket_exception) |
void | setAutoAck (bool enable) throw (socket_exception) |
virtual ssize_t | recvfrom (char *buf, size_t buflen, int flags, ibrcommon::vaddress &addr) throw (socket_exception) |
virtual void | sendto (const char *buf, size_t buflen, int flags, const ibrcommon::vaddress &addr) throw (socket_exception) |
Public Member Functions inherited from ibrcommon::datagramsocket | |
virtual | ~datagramsocket ()=0 |
Public Member Functions inherited from ibrcommon::basesocket | |
virtual | ~basesocket ()=0 |
virtual int | fd () const throw (socket_exception) |
virtual int | release () throw (socket_exception) |
void | close () throw (socket_exception) |
void | shutdown (int how) throw (socket_exception) |
bool | ready () const |
sa_family_t | get_family () const throw (socket_exception) |
Static Public Member Functions | |
static void | getAddress (const vinterface &iface, const std::string &panid, ibrcommon::vaddress &addr) |
static void | getAddress (struct ieee802154_addr *ret, const vinterface &iface) |
Additional Inherited Members | |
Static Public Attributes inherited from ibrcommon::basesocket | |
static int | DEFAULT_SOCKET_FAMILY = AF_INET6 |
static int | DEFAULT_SOCKET_FAMILY_ALTERNATIVE = AF_INET |
Protected Types inherited from ibrcommon::basesocket | |
enum | socketstate { SOCKET_DOWN, SOCKET_UP, SOCKET_UNMANAGED, SOCKET_DESTROYED } |
Protected Member Functions inherited from ibrcommon::datagramsocket | |
datagramsocket () | |
datagramsocket (int fd) | |
Protected Attributes inherited from ibrcommon::basesocket | |
socketstate | _state |
int | _fd |
sa_family_t | _family |
Definition at line 35 of file lowpansocket.h.
ibrcommon::lowpansocket::lowpansocket | ( | const uint16_t & | panid, |
const vinterface & | iface | ||
) |
Definition at line 50 of file lowpansocket.cpp.
ibrcommon::lowpansocket::~lowpansocket | ( | ) |
Definition at line 55 of file lowpansocket.cpp.
|
virtual |
Close and destroy the file descriptor of this socket assignment.
socket_exception | if the action has failed |
Implements ibrcommon::datagramsocket.
Definition at line 86 of file lowpansocket.cpp.
References ibrcommon::basesocket::_state, ibrcommon::basesocket::close(), ibrcommon::basesocket::SOCKET_DESTROYED, and ibrcommon::basesocket::SOCKET_DOWN.
|
static |
Definition at line 150 of file lowpansocket.cpp.
References sockaddr_ieee802154::addr, ieee802154_addr::addr_type, sockaddr_ieee802154::family, IEEE802154_ADDR_SHORT, ieee802154_addr::pan_id, and ieee802154_addr::short_addr.
Referenced by dtn::net::LOWPANDatagramService::getServiceDescription(), dtn::net::LOWPANConvergenceLayer::onUpdateBeacon(), and up().
|
static |
Definition at line 163 of file lowpansocket.cpp.
References ieee802154_addr::addr_type, IEEE802154_ADDR_SHORT, IEEE802154_ATTR_DEV_NAME, IEEE802154_ATTR_MAX, IEEE802154_ATTR_PAN_ID, IEEE802154_ATTR_SHORT_ADDR, IEEE802154_LIST_IFACE, ieee802154_policy, ieee802154_addr::pan_id, ieee802154_addr::short_addr, and ibrcommon::vinterface::toString().
|
virtual |
Reimplemented from ibrcommon::datagramsocket.
Definition at line 102 of file lowpansocket.cpp.
References sockaddr_ieee802154::addr, ieee802154_addr::pan_id, and ieee802154_addr::short_addr.
Referenced by dtn::net::LOWPANConvergenceLayer::componentRun(), and dtn::net::LOWPANDatagramService::recvfrom().
|
virtual |
Reimplemented from ibrcommon::datagramsocket.
Definition at line 125 of file lowpansocket.cpp.
References sockaddr_ieee802154::addr, ieee802154_addr::addr_type, AF_IEEE802154, bzero, sockaddr_ieee802154::family, IEEE802154_ADDR_SHORT, ieee802154_addr::pan_id, and ieee802154_addr::short_addr.
Referenced by dtn::net::LOWPANDatagramService::send(), and dtn::net::LOWPANConvergenceLayer::send_cb().
void ibrcommon::lowpansocket::setAutoAck | ( | bool | enable) | ||
throw | ( | socket_exception | |||
) |
If set to true, the auto-ack request is set on each message
Definition at line 94 of file lowpansocket.cpp.
References SOL_IEEE802154, and WPAN_WANTACK.
Referenced by dtn::net::LOWPANDatagramService::send(), and dtn::net::LOWPANConvergenceLayer::send_cb().
|
virtual |
Create the file descriptor for this socket and bind to the interface if necessary.
socket_exception | if the action has failed |
Implements ibrcommon::datagramsocket.
Definition at line 60 of file lowpansocket.cpp.
References ibrcommon::basesocket::_fd, ibrcommon::basesocket::_state, sockaddr_ieee802154::addr, ieee802154_addr::addr_type, AF_IEEE802154, ibrcommon::basesocket::bind(), bzero, sockaddr_ieee802154::family, getAddress(), IEEE802154_ADDR_SHORT, ibrcommon::basesocket::init_socket(), ieee802154_addr::pan_id, PF_IEEE802154, ibrcommon::basesocket::SOCKET_DOWN, and ibrcommon::basesocket::SOCKET_UP.