47 TclObject*
create(
int,
const char*
const*) {
58 std::cout <<
"Initialization (from constructor) of n_bits for the UWFLOODING packer " << std::endl;
73 std::cout <<
"Re-initialization of n_bits for the UWFLOODING packer " << std::endl;
86 offset +=
put(buf, offset, &(hflooding->
ttl()),
n_bits[field_idx++]);
89 printf(
"\033[1;37;46m TX UWFLOODING packer hdr \033[0m \n");
102 memset(&(hflooding->
ttl()), 0, sizeof (hflooding->
ttl()));
103 offset +=
get(buf, offset, &(hflooding->
ttl()),
n_bits[field_idx++]);
106 printf(
"\033[1;37;46m RX UWFLOODING packer hdr \033[0m \n");
114 std::cout <<
"\033[1;37;46m" <<
" Packer Name " <<
"\033[0m" <<
" UWFLOODING" << std::endl;
115 std::cout <<
"\033[1;37;46m 1st field " <<
"\033[0m" <<
" ttl: " <<
ttl_Bits <<
" bits" << std::endl;
123 std::cout <<
"\033[1;37;46m ttl:\033[0m " <<
static_cast<uint32_t
>(hflooding->
ttl()) <<
" " <<
hex_bytes(hflooding->
ttl(),
n_bits[0]) << std::endl;
#define HDR_UWFLOODING(p)
Class exploited by the Uwal module to map an NS-Miracle packet into a bit stream, and vice-versa.
size_t unpackMyHdr(unsigned char *, size_t, Packet *)
Method responsible to take the informations from the received buffer and store it into the headers of...
size_t packMyHdr(Packet *, unsigned char *, size_t)
Method to transform the headers of Uwpolling into a stream of bits.
void printMyHdrMap()
Method used for debug purposes.
void printMyHdrFields(Packet *)
Method used for debug purposes.
void init()
Init the Packer.
~PackerUwFlooding()
Class destructor.
PackerUwFlooding()
Class constructor.
Class to create the Otcl shadow object for an object of the class packer.
TclObject * create(int, const char *const *)
Class exploited by the Uwal module to map an NS-Miracle packet into a bit stream, and vice-versa.
std::vector< size_t > n_bits
Vector of elements containing the indication of the number of bits to consider for each header field.
size_t put(unsigned char *buffer, size_t offset, void *val, size_t h)
Method used to map in a certain number of bits, contained in a buffer of chars, a given variable.
static std::string hex_bytes(float)
size_t get(unsigned char *buffer, size_t offset, void *val, size_t h)
Method used to retrieve a given variable from a certain number of bits contained in a buffer of chars...
int debug_
Flag to enable debug messages.
PackerUwfloodingClass class_module_PackerUwflooding
hdr_uwflooding describes packets used by UWFLOODING.
uint8_t & ttl()
Reference to the uid_ variable.