|
DESERT 4.0.0
|
#include <packer-uwpolling.h>


Public Member Functions | |
| packerUwpolling () | |
| ~packerUwpolling () | |
Public Member Functions inherited from packer | |
| packer (bool) | |
| ~packer () | |
| int | command (int, const char *const *) |
| size_t | getPayloadBytesLength () |
| size_t | getHdrBytesLength () |
| size_t | getPayloadBinLength () |
| size_t | getHdrBinLength () |
| std::string | packPayload (Packet *) |
| std::string | packHdr (Packet *) |
| Packet * | unpackPayload (Packet *) |
| Packet * | unpackHdr (Packet *) |
| void | printMap () |
Private Types | |
| enum | nbits_index { T_IN = 0 , T_FIN , UID_TRIGGER , ID_POLLED , BACKOFF_TIME , TS_BITS , N_PKTS , UID_PROBE , ID_NODE , UID_POLL , POLL_TIME , UID_SINK , UID_PROBE_SINK , UID_ACK , UID_PACKET , UID_LAST_PACKET , UID_ACKS , ACK_ARRAY_SIZE , ACK_ELEM_BITS , LAST_ELEM } |
Private Member Functions | |
| void | init () |
| size_t | packMyHdr (Packet *, unsigned char *, size_t) |
| size_t | unpackMyHdr (unsigned char *, size_t, Packet *) |
| void | printMyHdrMap () |
| void | printMyHdrFields (Packet *) |
Private Attributes | |
| size_t | t_in_Bits |
| size_t | t_fin_Bits |
| size_t | uid_trigger_Bits |
| size_t | id_polled_Bits |
| size_t | backoff_time_Bits |
| size_t | ts_Bits |
| size_t | n_pkts_Bits |
| size_t | uid_probe_Bits |
| size_t | id_node_Bits |
| size_t | uid_poll_Bits |
| size_t | poll_time_Bits |
| size_t | uid_sink_Bits |
| size_t | uid_probe_sink_Bits |
| size_t | uid_ack_Bits |
| size_t | uid_packet_Bits |
| size_t | uid_last_packet_Bits |
| size_t | uid_acks_Bits |
| size_t | ack_array_size_Bits |
| size_t | ack_array_el_Bits |
| size_t | ack_array_size |
| int | sink_mac |
Additional Inherited Members | |
Static Public Member Functions inherited from packer | |
| template<typename T > | |
| static T | restoreSignedValue (T _header_field, const uint32_t &_num_compressed_bits) |
| static std::string | hexdump_nice (std::string) |
| static std::string | hexdump_nice (const char *, size_t) |
| static std::string | hexdump (std::string) |
| static std::string | hex_bytes (float) |
| static std::string | hex_bytes (double) |
| static std::string | hex_bytes (const char &, const uint32_t &) |
| static std::string | hex_bytes (const int8_t &, const uint32_t &) |
| static std::string | hex_bytes (const int16_t &, const uint32_t &) |
| static std::string | hex_bytes (const int32_t &, const uint32_t &) |
| static std::string | hex_bytes (const int64_t &, const uint32_t &) |
| static std::string | hex_bytes (const uint8_t &, const uint32_t &) |
| static std::string | hex_bytes (const uint16_t &, const uint32_t &) |
| static std::string | hex_bytes (const uint32_t &, const uint32_t &) |
| static std::string | hex_bytes (const uint64_t &, const uint32_t &) |
| static std::string | hexdump (const char *, size_t) |
| static std::string | bindump (std::string) |
| static std::string | bindump (const char *, size_t) |
Protected Member Functions inherited from packer | |
| virtual void | printMyHdrField (Packet *, int) |
| size_t | getMyHdrBinLength () |
| size_t | get (unsigned char *buffer, size_t offset, void *val, size_t h) |
| size_t | put (unsigned char *buffer, size_t offset, void *val, size_t h) |
Protected Attributes inherited from packer | |
| std::vector< size_t > | n_bits |
| int | debug_ |
Class to map a Uwpolling header into a bit stream, and vice-versa.
|
private |
| packerUwpolling::packerUwpolling | ( | ) |
Class constructor.
References ack_array_el_Bits, ack_array_size, ack_array_size_Bits, backoff_time_Bits, id_node_Bits, id_polled_Bits, init(), n_pkts_Bits, poll_time_Bits, sink_mac, t_fin_Bits, t_in_Bits, ts_Bits, uid_ack_Bits, uid_acks_Bits, uid_last_packet_Bits, uid_packet_Bits, uid_poll_Bits, uid_probe_Bits, uid_probe_sink_Bits, uid_sink_Bits, and uid_trigger_Bits.

| packerUwpolling::~packerUwpolling | ( | ) |
Class destructor.
|
privatevirtual |
Init the Packer
Reimplemented from packer.
References ack_array_el_Bits, ACK_ARRAY_SIZE, ack_array_size_Bits, ACK_ELEM_BITS, BACKOFF_TIME, backoff_time_Bits, ID_NODE, id_node_Bits, ID_POLLED, id_polled_Bits, LAST_ELEM, packer::n_bits, N_PKTS, n_pkts_Bits, POLL_TIME, poll_time_Bits, T_FIN, t_fin_Bits, T_IN, t_in_Bits, TS_BITS, ts_Bits, UID_ACK, uid_ack_Bits, UID_ACKS, uid_acks_Bits, UID_LAST_PACKET, uid_last_packet_Bits, UID_PACKET, uid_packet_Bits, UID_POLL, uid_poll_Bits, UID_PROBE, uid_probe_Bits, UID_PROBE_SINK, uid_probe_sink_Bits, UID_SINK, uid_sink_Bits, UID_TRIGGER, and uid_trigger_Bits.
Referenced by packerUwpolling().
|
privatevirtual |
Method to transform the headers of Uwpolling into a stream of bits
| Pointer | to the packet to serialize |
| Pointer | to the buffer |
| Offset | from the begin of the buffer |
Reimplemented from packer.
References ACK_ARRAY_SIZE, ack_array_size, ACK_ELEM_BITS, packer::debug_, hdr_POLL::id_, hdr_PROBE_SINK::id_ack_, hdr_ACK_SINK::id_ack_, ID_NODE, hdr_PROBE::id_node_, ID_POLLED, hdr_PROBE_SINK::id_sink_, hdr_AUV_MULE::last_pkt_uid_, packer::n_bits, N_PKTS, hdr_PROBE::n_pkts_, hdr_AUV_MULE::pkt_uid_, POLL_TIME, hdr_POLL::POLL_time_, hdr_POLL::POLL_uid_, printMyHdrFields(), hdr_PROBE::PROBE_uid_, hdr_PROBE_SINK::PROBE_uid_, PT_ACK_SINK, PT_POLL, PT_PROBE, PT_PROBE_SINK, PT_TRIGGER, packer::put(), sink_mac, T_FIN, hdr_TRIGGER::t_fin_, T_IN, hdr_TRIGGER::t_in_, hdr_TRIGGER::TRIGGER_uid_, hdr_PROBE::ts_, TS_BITS, UID_ACK, UID_LAST_PACKET, UID_PACKET, UID_POLL, UID_PROBE, UID_PROBE_SINK, UID_SINK, and UID_TRIGGER.

|
privatevirtual |
Method used for debug purposes. It prints the value of the headers of a packet
| Pointer | of the packet |
Reimplemented from packer.
References hdr_POLL::id_, hdr_PROBE_SINK::id_ack_, hdr_ACK_SINK::id_ack_, hdr_PROBE::id_node_, hdr_PROBE_SINK::id_sink_, hdr_AUV_MULE::last_pkt_uid_, hdr_PROBE::n_pkts_, hdr_AUV_MULE::pkt_uid_, hdr_POLL::POLL_time_, hdr_POLL::POLL_uid_, hdr_PROBE::PROBE_uid_, hdr_PROBE_SINK::PROBE_uid_, PT_ACK_SINK, PT_POLL, PT_PROBE, PT_PROBE_SINK, PT_TRIGGER, hdr_TRIGGER::t_fin_, hdr_TRIGGER::t_in_, hdr_TRIGGER::TRIGGER_uid_, and hdr_PROBE::ts_.
Referenced by packMyHdr(), and unpackMyHdr().
|
privatevirtual |
Method used for debug purposes. It prints the number of bits for each header serialized
Reimplemented from packer.
References ack_array_el_Bits, ack_array_size_Bits, id_node_Bits, id_polled_Bits, n_pkts_Bits, poll_time_Bits, t_fin_Bits, t_in_Bits, ts_Bits, uid_ack_Bits, uid_last_packet_Bits, uid_packet_Bits, uid_poll_Bits, uid_probe_Bits, uid_probe_sink_Bits, uid_sink_Bits, and uid_trigger_Bits.
|
privatevirtual |
Method responsible to take the informations from the received buffer and store it into the headers of the packet
| Pointer | to the buffer received |
| Offset | from the begin of the buffer |
| Pointer | to the new packet |
Reimplemented from packer.
References ACK_ARRAY_SIZE, ACK_ELEM_BITS, packer::debug_, packer::get(), hdr_POLL::id_, hdr_PROBE_SINK::id_ack_, hdr_ACK_SINK::id_ack_, ID_NODE, hdr_PROBE::id_node_, hdr_PROBE_SINK::id_sink_, hdr_AUV_MULE::last_pkt_uid_, packer::n_bits, N_PKTS, hdr_PROBE::n_pkts_, hdr_AUV_MULE::pkt_uid_, POLL_TIME, hdr_POLL::POLL_time_, hdr_POLL::POLL_uid_, printMyHdrFields(), hdr_PROBE::PROBE_uid_, hdr_PROBE_SINK::PROBE_uid_, PT_ACK_SINK, PT_POLL, PT_PROBE, PT_PROBE_SINK, PT_TRIGGER, sink_mac, T_FIN, hdr_TRIGGER::t_fin_, T_IN, hdr_TRIGGER::t_in_, hdr_TRIGGER::TRIGGER_uid_, hdr_PROBE::ts_, TS_BITS, UID_ACK, UID_LAST_PACKET, UID_PACKET, UID_POLL, UID_PROBE, UID_PROBE_SINK, UID_SINK, and UID_TRIGGER.

|
private |
number of Bits used for each ACK on ACK_SINK header
Referenced by init(), packerUwpolling(), and printMyHdrMap().
|
private |
Maximum number of elements for the ACK vector
Referenced by packerUwpolling(), and packMyHdr().
|
private |
number of Bits used for number of ACKs on ACK_SINK header
Referenced by init(), packerUwpolling(), and printMyHdrMap().
|
private |
number of Bits used for backoff field on PROBE header
Referenced by init(), and packerUwpolling().
|
private |
number of Bits used for id_node field on PROBE header
Referenced by init(), packerUwpolling(), and printMyHdrMap().
|
private |
number of Bits used for id_polled field on POLL header
Referenced by init(), packerUwpolling(), and printMyHdrMap().
|
private |
number of Bits used for n_pkts field on PROBE header
Referenced by init(), packerUwpolling(), and printMyHdrMap().
|
private |
number of Bits used for POLL_time field on POLL header
Referenced by init(), packerUwpolling(), and printMyHdrMap().
|
private |
Mac addres of the destination that need AUV_MULE hdr
Referenced by packerUwpolling(), packMyHdr(), and unpackMyHdr().
|
private |
number of Bits used for t_fin field on TRIGGER header
Referenced by init(), packerUwpolling(), and printMyHdrMap().
|
private |
number of Bits used for t_in field on TRIGGER header
Referenced by init(), packerUwpolling(), and printMyHdrMap().
|
private |
number of Bits used for ts field on PROBE header
Referenced by init(), packerUwpolling(), and printMyHdrMap().
|
private |
number of Bits used for id_ack_ field on PROBE_SINK header
Referenced by init(), packerUwpolling(), and printMyHdrMap().
|
private |
Referenced by init(), and packerUwpolling().
|
private |
number of Bits used for last_pkt_uid_ field on AUV_MULE header
Referenced by init(), packerUwpolling(), and printMyHdrMap().
|
private |
number of Bits used for pkt_uid_ field on AUV_MULE header
Referenced by init(), packerUwpolling(), and printMyHdrMap().
|
private |
number of Bits used for uid field on POLL header
Referenced by init(), packerUwpolling(), and printMyHdrMap().
|
private |
number of Bits used for uid field on PROBE header
Referenced by init(), packerUwpolling(), and printMyHdrMap().
|
private |
number of Bits used for PROBE_uid_ field on PROBE_SINK header
Referenced by init(), packerUwpolling(), and printMyHdrMap().
|
private |
number of Bits used for id_sink_ field on PROBE_SINK header
Referenced by init(), packerUwpolling(), and printMyHdrMap().
|
private |
number of Bits used for uid field on TRIGGER header
Referenced by init(), packerUwpolling(), and printMyHdrMap().