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

#include <packer_uwUFetch.h>

Inheritance diagram for packer_uwUFetch:
Collaboration diagram for packer_uwUFetch:

Public Member Functions

 packer_uwUFetch ()
 
 ~packer_uwUFetch ()
 
- 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_BCK_MAX_PROBE = 0 , T_BCK_MIN_PROBE , N_CBEACON_TX , T_BCK_CHOICE_SENSOR ,
  N_PCK_SENSOR_WANT_TX , MAC_ADDR_SENSOR_POLLED , N_PCK_HN_WANT_RX , MAX_CBEACON_TX_HN ,
  T_BCK_MAX_RTS , T_BCK_MIN_RTS , N_PCK_AUV_WANT_RX , NUM_DATA_PCKS ,
  BACKOFF_TIME_RTS , NUM_DATA_PCKS_MAX_RX , MAC_ADDR_HN_CTSED
}
 

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_bck_max_probe_Bits
 
size_t t_bck_min_probe_Bits
 
size_t n_cbeacon_tx_Bits
 
size_t t_bck_choice_sensor_Bits
 
size_t n_pck_sensor_want_tx_Bits
 
size_t mac_addr_sensor_polled_Bits
 
size_t n_pck_hn_want_tx_Bits
 
size_t max_cbeacon_tx_hn_Bits
 
size_t t_bck_max_rts_Bits
 
size_t t_bck_min_rts_Bits
 
size_t max_pck_want_rx_Bits
 
size_t num_DATA_pcks_Bits
 
size_t backoff_time_RTS_Bits
 
size_t num_DATA_pcks_MAX_rx_Bits
 
size_t mac_addr_HN_ctsed_Bits
 

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 ns2 mac header into a bit stream, and vice-versa.

Definition at line 47 of file packer_uwUFetch.h.

Member Enumeration Documentation

◆ nbits_index

Enumerator
T_BCK_MAX_PROBE 

Upper bound of the time interval from which the sensor node choice the backoff time before to transmit probe.

T_BCK_MIN_PROBE 

Lower bound of the time interval from which the sensor node choice the backoff time before to transmit probe.

N_CBEACON_TX 

Maximum number of CBEACON that the head node can transmit.

T_BCK_CHOICE_SENSOR 

Backoff time choose by the sensor node before to transmit the probe packet.

N_PCK_SENSOR_WANT_TX 

Number of the packets that the sensor node would like to transmit to the head node.

MAC_ADDR_SENSOR_POLLED 

Mac address of the sensor node from which the head node want to receive the data packet.

N_PCK_HN_WANT_RX 

Maximum number of data packet that the head node want to receive from the sensor node polled.

MAX_CBEACON_TX_HN 

Maximum number of CBEACON that the head node can transmit.

T_BCK_MAX_RTS 

Upper bound of the time interval from which the sensor node choice the backoff time before to transmit rts.

T_BCK_MIN_RTS 

Lower bound of the time interval from which the sensor node choice the backoff time before to transmit rts

N_PCK_AUV_WANT_RX 

Maximum number of packets that AUV want receive from the HN.

NUM_DATA_PCKS 

Number of DATA packets that HN would like to transmit to the AUV.

BACKOFF_TIME_RTS 

Backoff time choice by the HN before to transmit a RTS packet.

NUM_DATA_PCKS_MAX_RX 

Exact number of DATA packets that AUV want to receive from the HN.

MAC_ADDR_HN_CTSED 

MAC address of the HN from which AUV want to receive DATA packet.

Definition at line 104 of file packer_uwUFetch.h.

Constructor & Destructor Documentation

◆ packer_uwUFetch()

packer_uwUFetch::packer_uwUFetch ( )

Constructor packer_uwUFetch class.

Definition at line 49 of file packer_uwUFetch.cc.

◆ ~packer_uwUFetch()

packer_uwUFetch::~packer_uwUFetch ( )

Destructor packer_uwUFetch class.

Definition at line 97 of file packer_uwUFetch.cc.

Member Function Documentation

◆ init()

void packer_uwUFetch::init ( )
privatevirtual

Init the packer for uwUFetch prototocol.

Reimplemented from packer.

Definition at line 101 of file packer_uwUFetch.cc.

◆ packMyHdr()

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

Method to transform the headers of UFetch protocol into a stream of bits.

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

Reimplemented from packer.

Definition at line 132 of file packer_uwUFetch.cc.

◆ printMyHdrFields()

void packer_uwUFetch::printMyHdrFields ( Packet *  p)
privatevirtual

Method used for debug purposes.

It prints the value of the headers of a packet

Parameters
Pointerof the packet
Index bits

Reimplemented from packer.

Definition at line 378 of file packer_uwUFetch.cc.

◆ printMyHdrMap()

void packer_uwUFetch::printMyHdrMap ( )
privatevirtual

Method used for debug purposes.

It prints the number of bits for each header serialized

Reimplemented from packer.

Definition at line 342 of file packer_uwUFetch.cc.

◆ unpackMyHdr()

size_t packer_uwUFetch::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
size_t New offset after unpacking the headers

Reimplemented from packer.

Definition at line 224 of file packer_uwUFetch.cc.

Member Data Documentation

◆ backoff_time_RTS_Bits

size_t packer_uwUFetch::backoff_time_RTS_Bits
private

number of bits used for backoff_time_RTS_ field on TRIGGER header

Definition at line 134 of file packer_uwUFetch.h.

◆ mac_addr_HN_ctsed_Bits

size_t packer_uwUFetch::mac_addr_HN_ctsed_Bits
private

number of bits used for mac_addr_HN_ctsed_ field on CTS header

Definition at line 136 of file packer_uwUFetch.h.

◆ mac_addr_sensor_polled_Bits

size_t packer_uwUFetch::mac_addr_sensor_polled_Bits
private

number of bits used for mac_addr_sensor_polled_ field on POLL header

Definition at line 127 of file packer_uwUFetch.h.

◆ max_cbeacon_tx_hn_Bits

size_t packer_uwUFetch::max_cbeacon_tx_hn_Bits
private

number of bits used for max_cbeacon_tx_hn_ field on CBEACON header

Definition at line 129 of file packer_uwUFetch.h.

◆ max_pck_want_rx_Bits

size_t packer_uwUFetch::max_pck_want_rx_Bits
private

number of bits used for max_pck_want_rx_ field on TRIGGER header

Definition at line 132 of file packer_uwUFetch.h.

◆ n_cbeacon_tx_Bits

size_t packer_uwUFetch::n_cbeacon_tx_Bits
private

number of bits used for n_cbeacon_tx_ field on BEACON header

Definition at line 124 of file packer_uwUFetch.h.

◆ n_pck_hn_want_tx_Bits

size_t packer_uwUFetch::n_pck_hn_want_tx_Bits
private

number of bits used for n_pck_hn_want_tx_ field on POLL header

Definition at line 128 of file packer_uwUFetch.h.

◆ n_pck_sensor_want_tx_Bits

size_t packer_uwUFetch::n_pck_sensor_want_tx_Bits
private

number of bits used for n_pck_sensor_want_tx_ field on PROBE header

Definition at line 126 of file packer_uwUFetch.h.

◆ num_DATA_pcks_Bits

size_t packer_uwUFetch::num_DATA_pcks_Bits
private

number of bits used for num_DATA_pcks_ field on TRIGGER header

Definition at line 133 of file packer_uwUFetch.h.

◆ num_DATA_pcks_MAX_rx_Bits

size_t packer_uwUFetch::num_DATA_pcks_MAX_rx_Bits
private

number of bits used for num_DATA_pcks_MAX_rx_ field on RTSheader

Definition at line 135 of file packer_uwUFetch.h.

◆ t_bck_choice_sensor_Bits

size_t packer_uwUFetch::t_bck_choice_sensor_Bits
private

number of bits used for t_bck_choice_sensor_ field on PROBE header

Definition at line 125 of file packer_uwUFetch.h.

◆ t_bck_max_probe_Bits

size_t packer_uwUFetch::t_bck_max_probe_Bits
private

number of bits used for t_bck_max_probe_ field on BEACON header

Definition at line 122 of file packer_uwUFetch.h.

◆ t_bck_max_rts_Bits

size_t packer_uwUFetch::t_bck_max_rts_Bits
private

number of bits used for t_bck_max_rts_ field on CBEACON header

Definition at line 130 of file packer_uwUFetch.h.

◆ t_bck_min_probe_Bits

size_t packer_uwUFetch::t_bck_min_probe_Bits
private

number of bits used for t_bck_min_probe_ field on BEACON header

Definition at line 123 of file packer_uwUFetch.h.

◆ t_bck_min_rts_Bits

size_t packer_uwUFetch::t_bck_min_rts_Bits
private

number of bits used for t_bck_min_rts_ field on CBEACON header

Definition at line 131 of file packer_uwUFetch.h.


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