DESERT 3.5.1
Loading...
Searching...
No Matches
packerUwpolling Class Reference

#include <packer-uwpolling.h>

Inheritance diagram for packerUwpolling:
Collaboration diagram for packerUwpolling:

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_
 

Detailed Description

Class to map a Uwpolling header into a bit stream, and vice-versa.

Definition at line 49 of file packer-uwpolling.h.

Member Enumeration Documentation

◆ nbits_index

Enumerator
T_IN 
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 

Definition at line 96 of file packer-uwpolling.h.

Constructor & Destructor Documentation

◆ packerUwpolling()

packerUwpolling::packerUwpolling ( )

Class constructor.

Definition at line 49 of file packer-uwpolling.cpp.

◆ ~packerUwpolling()

packerUwpolling::~packerUwpolling ( )

Class destructor.

Definition at line 97 of file packer-uwpolling.cpp.

Member Function Documentation

◆ init()

void packerUwpolling::init ( )
privatevirtual

Init the Packer.

Reimplemented from packer.

Definition at line 102 of file packer-uwpolling.cpp.

◆ packMyHdr()

size_t packerUwpolling::packMyHdr ( Packet *  p,
unsigned char *  buf,
size_t  offset 
)
privatevirtual

Method to transform the headers of Uwpolling into a stream of bits.

Parameters
Pointerto the packet to serialize
Pointerto the buffer
Offsetfrom the begin of the buffer
Returns
New offset after packing the headers of the packets

Reimplemented from packer.

Definition at line 129 of file packer-uwpolling.cpp.

◆ printMyHdrFields()

void packerUwpolling::printMyHdrFields ( Packet *  p)
privatevirtual

Method used for debug purposes.

It prints the value of the headers of a packet

Parameters
Pointerof the packet

Reimplemented from packer.

Definition at line 365 of file packer-uwpolling.cpp.

◆ printMyHdrMap()

void packerUwpolling::printMyHdrMap ( )
privatevirtual

Method used for debug purposes.

It prints the number of bits for each header serialized

Reimplemented from packer.

Definition at line 418 of file packer-uwpolling.cpp.

◆ unpackMyHdr()

size_t packerUwpolling::unpackMyHdr ( unsigned char *  buf,
size_t  offset,
Packet *  p 
)
privatevirtual

Method responsible to take the informations from the received buffer and store it into the headers of the packet.

Parameters
Pointerto the buffer received
Offsetfrom the begin of the buffer
Pointerto the new packet
Returns
New offset after unpacking the headers

Reimplemented from packer.

Definition at line 235 of file packer-uwpolling.cpp.

Member Data Documentation

◆ ack_array_el_Bits

size_t packerUwpolling::ack_array_el_Bits
private

number of Bits used for each ACK on ACK_SINK header

Definition at line 138 of file packer-uwpolling.h.

◆ ack_array_size

size_t packerUwpolling::ack_array_size
private

Maximum number of elements for the ACK vector.

Definition at line 139 of file packer-uwpolling.h.

◆ ack_array_size_Bits

size_t packerUwpolling::ack_array_size_Bits
private

number of Bits used for number of ACKs on ACK_SINK header

Definition at line 137 of file packer-uwpolling.h.

◆ backoff_time_Bits

size_t packerUwpolling::backoff_time_Bits
private

number of Bits used for backoff field on PROBE header

Definition at line 124 of file packer-uwpolling.h.

◆ id_node_Bits

size_t packerUwpolling::id_node_Bits
private

number of Bits used for id_node field on PROBE header

Definition at line 128 of file packer-uwpolling.h.

◆ id_polled_Bits

size_t packerUwpolling::id_polled_Bits
private

number of Bits used for id_polled field on POLL header

Definition at line 123 of file packer-uwpolling.h.

◆ n_pkts_Bits

size_t packerUwpolling::n_pkts_Bits
private

number of Bits used for n_pkts field on PROBE header

Definition at line 126 of file packer-uwpolling.h.

◆ poll_time_Bits

size_t packerUwpolling::poll_time_Bits
private

number of Bits used for POLL_time field on POLL header

Definition at line 130 of file packer-uwpolling.h.

◆ sink_mac

int packerUwpolling::sink_mac
private

Mac addres of the destination that need AUV_MULE hdr.

Definition at line 141 of file packer-uwpolling.h.

◆ t_fin_Bits

size_t packerUwpolling::t_fin_Bits
private

number of Bits used for t_fin field on TRIGGER header

Definition at line 121 of file packer-uwpolling.h.

◆ t_in_Bits

size_t packerUwpolling::t_in_Bits
private

number of Bits used for t_in field on TRIGGER header

Definition at line 120 of file packer-uwpolling.h.

◆ ts_Bits

size_t packerUwpolling::ts_Bits
private

number of Bits used for ts field on PROBE header

Definition at line 125 of file packer-uwpolling.h.

◆ uid_ack_Bits

size_t packerUwpolling::uid_ack_Bits
private

number of Bits used for id_ack_ field on PROBE_SINK header

Definition at line 133 of file packer-uwpolling.h.

◆ uid_acks_Bits

size_t packerUwpolling::uid_acks_Bits
private

Definition at line 136 of file packer-uwpolling.h.

◆ uid_last_packet_Bits

size_t packerUwpolling::uid_last_packet_Bits
private

number of Bits used for last_pkt_uid_ field on AUV_MULE header

Definition at line 135 of file packer-uwpolling.h.

◆ uid_packet_Bits

size_t packerUwpolling::uid_packet_Bits
private

number of Bits used for pkt_uid_ field on AUV_MULE header

Definition at line 134 of file packer-uwpolling.h.

◆ uid_poll_Bits

size_t packerUwpolling::uid_poll_Bits
private

number of Bits used for uid field on POLL header

Definition at line 129 of file packer-uwpolling.h.

◆ uid_probe_Bits

size_t packerUwpolling::uid_probe_Bits
private

number of Bits used for uid field on PROBE header

Definition at line 127 of file packer-uwpolling.h.

◆ uid_probe_sink_Bits

size_t packerUwpolling::uid_probe_sink_Bits
private

number of Bits used for PROBE_uid_ field on PROBE_SINK header

Definition at line 132 of file packer-uwpolling.h.

◆ uid_sink_Bits

size_t packerUwpolling::uid_sink_Bits
private

number of Bits used for id_sink_ field on PROBE_SINK header

Definition at line 131 of file packer-uwpolling.h.

◆ uid_trigger_Bits

size_t packerUwpolling::uid_trigger_Bits
private

number of Bits used for uid field on TRIGGER header

Definition at line 122 of file packer-uwpolling.h.


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