DESERT 3.5.1
Loading...
Searching...
No Matches
packer-uwpolling.cpp
Go to the documentation of this file.
1//
2// Copyright (c) 2013 Regents of the SIGNET lab, University of Padova.
3// All rights reserved.
4//
5// Redistribution and use in source and binary forms, with or without
6// modification, are permitted provided that the following conditions
7// are met:
8// 1. Redistributions of source code must retain the above copyright
9// notice, this list of conditions and the following disclaimer.
10// 2. Redistributions in binary form must reproduce the above copyright
11// notice, this list of conditions and the following disclaimer in the
12// documentation and/or other materials provided with the distribution.
13// 3. Neither the name of the University of Padova (SIGNET lab) nor the
14// names of its contributors may be used to endorse or promote products
15// derived from this software without specific prior written permission.
16//
17// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
19// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
20// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
21// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
24// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
25// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
26// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
27// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
36 #include "packer-uwpolling.h"
37
38 static class PackerUwpollingClass : public TclClass {
39public:
40
41 PackerUwpollingClass() : TclClass("NS2/MAC/Uwpolling/Packer") {
42 }
43
44 TclObject* create(int, const char*const*) {
45 return (new packerUwpolling());
46 }
48
50 t_in_Bits(0),
51 t_fin_Bits(0),
52 uid_trigger_Bits(0),
53 id_polled_Bits(0),
54 backoff_time_Bits(0),
55 ts_Bits(0),
56 n_pkts_Bits(0),
57 uid_probe_Bits(0),
58 id_node_Bits(0),
59 uid_poll_Bits(0),
60 poll_time_Bits(0),
61 uid_sink_Bits(0),
62 uid_probe_sink_Bits(0),
63 uid_ack_Bits(0),
64 uid_packet_Bits(0),
65 uid_last_packet_Bits(0),
66 uid_acks_Bits(0),
67 ack_array_size_Bits(0),
68 ack_array_el_Bits(0),
69 ack_array_size(0),
70 sink_mac(0)
71{
72 bind("t_in_Bits", (int*) &t_in_Bits);
73 bind("t_fin_Bits", (int*) &t_fin_Bits);
74 bind("uid_TRIGGER_Bits", (int*) &uid_trigger_Bits);
75 bind("id_polled_Bits", (int*) &id_polled_Bits);
76 bind("backoff_time_Bits", (int*) &backoff_time_Bits);
77 bind("ts_Bits", (int*) &ts_Bits);
78 bind("n_pkts_Bits", (int*) &n_pkts_Bits);
79 bind("uid_PROBE_Bits", (int*) &uid_probe_Bits);
80 bind("id_node_Bits", (int*) &id_node_Bits);
81 bind("uid_POLL_Bits", (int*) &uid_poll_Bits);
82 bind("poll_time_Bits", (int*) &poll_time_Bits);
83 bind("uid_sink_Bits", (int*) &uid_sink_Bits);
84 bind("uid_probe_sink_Bits", (int*) &uid_probe_sink_Bits);
85 bind("uid_ack_Bits", (int*) &uid_ack_Bits);
86 bind("uid_packet_Bits", (int*) &uid_packet_Bits);
87 bind("uid_last_packet_Bits", (int*) &uid_last_packet_Bits);
88 bind("uid_acks_Bits", (int*) &uid_acks_Bits);
89 bind("ack_array_size_Bits", (int*) &ack_array_size_Bits);
90 bind("ack_array_el_Bits", (int*) &ack_array_el_Bits);
91 bind("ack_array_size", (int*) &ack_array_size);
92 bind("sink_mac_", (int*) &sink_mac);
93 this->init();
94
95}
96
98{
99 //nothing to do
100}
101
127
128
129size_t packerUwpolling::packMyHdr(Packet* p, unsigned char* buf, size_t offset)
130{
131 hdr_cmn* ch = HDR_CMN(p);
132
133 if (ch->ptype() == PT_TRIGGER)
134 {
135 hdr_TRIGGER* triggerh = HDR_TRIGGER(p);
136
137 offset += put(buf, offset, &(triggerh->t_in_), n_bits[T_IN]);
138 offset += put(buf, offset, &(triggerh->t_fin_),n_bits[T_FIN]);
139 offset += put(buf, offset, &(triggerh->TRIGGER_uid_),n_bits[UID_TRIGGER]);
140
141 if (debug_)
142 {
143 cout << "\033[1;37;45m (TX) UWPOLLING::TRIGGER packer hdr \033[0m" << std::endl;
145 }
146 }
147 else if ( ch->ptype() == PT_POLL)
148 {
149 hdr_POLL* pollh = HDR_POLL(p);
150
151
152 offset += put(buf, offset, &(pollh->id_), n_bits[ID_POLLED]);
153 offset += put(buf, offset, &(pollh->POLL_uid_),n_bits[UID_POLL]);
154 offset += put(buf, offset, &(pollh->POLL_time_),n_bits[POLL_TIME]);
155
156 if (debug_)
157 {
158 cout << "\033[1;37;45m (TX) UWPOLLING::POLL packer hdr \033[0m" << std::endl;
160 }
161 }
162 else if (ch->ptype() == PT_PROBE)
163 {
164 hdr_PROBE* probeh = HDR_PROBE(p);
165
166 //offset += put(buf, offset,&(probeh->backoff_time_), n_bits[BACKOFF_TIME]);
167 offset += put(buf, offset,&(probeh->ts_), n_bits[TS_BITS]);
168 offset += put(buf,offset,&(probeh->n_pkts_),n_bits[N_PKTS]);
169 offset += put(buf,offset,&(probeh->id_node_),n_bits[ID_NODE]);
170 offset += put(buf,offset,&(probeh->PROBE_uid_),n_bits[UID_PROBE]);
171 if (debug_)
172 {
173 cout << "\033[1;37;45m (TX) UWPOLLING::PROBE packer hdr \033[0m" << std::endl;
175 }
176
177 }
178 else if (ch->ptype() == PT_PROBE_SINK)
179 {
180 hdr_PROBE_SINK* probes_hdr = HDR_PROBE_SINK(p);
181
182 offset += put(buf, offset, &(probes_hdr->id_sink_), n_bits[UID_SINK]);
183 offset += put(buf, offset, &(probes_hdr->PROBE_uid_), n_bits[UID_PROBE_SINK]);
184 offset += put(buf, offset, &(probes_hdr->id_ack_), n_bits[UID_ACK]);
185 if (debug_)
186 {
187 cout << "\033[1;37;45m (TX) UWPOLLING::PROBE_SINK packer hdr \033[0m" << std::endl;
189 }
190 }
191 else if (ch->ptype() == PT_ACK_SINK) {
192 hdr_ACK_SINK *ackh = HDR_ACK_SINK(p);
193 uint16_t uid_acks_array[ack_array_size];
194 std::vector<uint16_t>::iterator ack_id_it;
195 size_t fix_array_it = 0;
196 for (ack_id_it = ackh->id_ack_.begin(); ack_id_it != ackh->id_ack_.end(); ++ack_id_it) {
197 uid_acks_array[fix_array_it] = (uint16_t)*ack_id_it;
198 fix_array_it++;
199 if ( fix_array_it >= (ack_array_size+1)) {
200 break;
201 }
202 }
203
204 size_t actual_size = fix_array_it;
205 offset += put(buf, offset, &(actual_size), n_bits[ACK_ARRAY_SIZE]);
206 fix_array_it = 0;
207 for (fix_array_it = 0; fix_array_it < actual_size; fix_array_it++) {
208 offset += put(buf, offset, &(uid_acks_array[fix_array_it]), n_bits[ACK_ELEM_BITS]);
209 }
210 if (debug_)
211 {
212 cout << "\033[1;37;45m (TX) UWPOLLING::ACK_SINK packer hdr \033[0m" << std::endl;
214 }
215 }
216 else
217 {
218 hdr_AUV_MULE *auv_mule_hdr = HDR_AUV_MULE(p);
219 hdr_mac *mach = HDR_MAC(p);
220
221 if (mach->macDA() == sink_mac) {
222 offset += put(buf, offset, &(auv_mule_hdr->pkt_uid_), n_bits[UID_PACKET]);
223 offset += put(buf, offset, &(auv_mule_hdr->last_pkt_uid_), n_bits[UID_LAST_PACKET]);
224 if (debug_)
225 {
226 cout << "\033[1;37;45m (TX) UWPOLLING::AUV_MULE packer hdr \033[0m" << std::endl;
228 }
229
230 }
231 }
232 return offset;
233}
234
235size_t packerUwpolling::unpackMyHdr(unsigned char* buf, size_t offset, Packet* p) {
236 hdr_cmn* ch = HDR_CMN(p);
237
238 if ( ch->ptype() == PT_TRIGGER )
239 {
240 hdr_TRIGGER* triggerh = HDR_TRIGGER(p);
241
242 memset(&(triggerh->t_in_),0,sizeof(triggerh->t_in_));
243 offset += get(buf,offset,&(triggerh->t_in_),n_bits[T_IN]);
244
245 memset(&(triggerh->t_fin_),0,sizeof(triggerh->t_fin_));
246 offset += get(buf,offset,&(triggerh->t_fin_),n_bits[T_FIN]);
247
248 memset(&(triggerh->TRIGGER_uid_),0,sizeof(triggerh->TRIGGER_uid_));
249 offset += get(buf,offset,&(triggerh->TRIGGER_uid_),n_bits[UID_TRIGGER]);
250
251 if (debug_)
252 {
253 cout << "\033[1;32;40m (RX) UWPOLLING::TRIGGER packer hdr \033[0m" << std::endl;
255 }
256
257 }
258 else if (ch->ptype() == PT_POLL)
259 {
260 hdr_POLL* pollh = HDR_POLL(p);
261
262 memset(&(pollh->id_),0,sizeof(pollh->id_));
263 offset += get(buf,offset,&(pollh->id_),n_bits[ID_NODE]);
264
265 memset(&(pollh->POLL_uid_),0,sizeof(pollh->POLL_uid_));
266 offset += get(buf,offset,&(pollh->POLL_uid_),n_bits[UID_POLL]);
267
268 memset(&(pollh->POLL_time_),0,sizeof(pollh->POLL_time_));
269 offset += get(buf,offset,&(pollh->POLL_time_),n_bits[POLL_TIME]);
270
271 if (debug_)
272 {
273 cout << "\033[1;32;40m (RX) UWPOLLING::POLL packer hdr \033[0m" << std::endl;
275 }
276 }
277 else if (ch->ptype() == PT_PROBE)
278 {
279 hdr_PROBE* probeh = HDR_PROBE(p);
280
281 //memset(&(probeh->backoff_time_),0,sizeof(probeh->backoff_time_));
282 //offset += get(buf,offset,&(probeh->backoff_time_),n_bits[BACKOFF_TIME]);
283
284 memset(&(probeh->ts_),0,sizeof(probeh->ts_));
285 offset += get(buf,offset,&(probeh->ts_),n_bits[TS_BITS]);
286
287 memset(&(probeh->n_pkts_),0,sizeof(probeh->n_pkts_));
288 offset += get(buf,offset,&(probeh->n_pkts_),n_bits[N_PKTS]);
289
290 memset(&(probeh->id_node_),0,sizeof(probeh->id_node_));
291 offset += get(buf,offset,&(probeh->id_node_),n_bits[ID_NODE]);
292
293 memset(&(probeh->PROBE_uid_),0,sizeof(probeh->PROBE_uid_));
294 offset += get(buf,offset,&(probeh->PROBE_uid_),n_bits[UID_PROBE]);
295
296 if (debug_)
297 {
298 cout << "\033[1;32;40m (RX) UWPOLLING::PROBE packer hdr \033[0m" << std::endl;
300 }
301
302 }
303 else if (ch->ptype() == PT_PROBE_SINK)
304 {
305 hdr_PROBE_SINK* probes_hdr = HDR_PROBE_SINK(p);
306
307 memset(&(probes_hdr->id_sink_),0,sizeof(probes_hdr->id_sink_));
308 offset += get(buf, offset, &(probes_hdr->id_sink_), n_bits[UID_SINK]);
309
310 memset(&(probes_hdr->PROBE_uid_),0,sizeof(probes_hdr->PROBE_uid_));
311 offset += get(buf, offset, &(probes_hdr->PROBE_uid_), n_bits[UID_PROBE_SINK]);
312
313 memset(&(probes_hdr->id_ack_),0,sizeof(probes_hdr->id_ack_));
314 offset += get(buf, offset, &(probes_hdr->id_ack_), n_bits[UID_ACK]);
315
316 if (debug_)
317 {
318 cout << "\033[1;32;40m (RX) UWPOLLING::PROBE_SINK packer hdr \033[0m" << std::endl;
320 }
321
322 }
323 else if (ch->ptype() == PT_ACK_SINK)
324 {
325 hdr_ACK_SINK *ackh = HDR_ACK_SINK(p);
326 int array_size = 0;
327 uint16_t app;
328 offset += get(buf, offset, &(array_size), n_bits[ACK_ARRAY_SIZE]);
329 for (int i=0; i < array_size; i++) {
330 app = 0;
331 offset += get(buf, offset, &(app), n_bits[ACK_ELEM_BITS]);
332 ackh->id_ack_.push_back(app);
333 }
334
335 if (debug_)
336 {
337 cout << "\033[1;32;40m (RX) UWPOLLING::ACK_SINK packer hdr \033[0m" << std::endl;
339 }
340 }
341 else
342 {
343 hdr_AUV_MULE *auv_mule_hdr = HDR_AUV_MULE(p);
344 hdr_mac *mach = HDR_MAC(p);
345 if (mach->macDA() == sink_mac) {
346
347 memset(&(auv_mule_hdr->pkt_uid_),0,sizeof(auv_mule_hdr->pkt_uid_));
348 offset += get(buf, offset, &(auv_mule_hdr->pkt_uid_), n_bits[UID_PACKET]);
349
350 memset(&(auv_mule_hdr->last_pkt_uid_),0,sizeof(auv_mule_hdr->last_pkt_uid_));
351 offset += get(buf, offset, &(auv_mule_hdr->last_pkt_uid_), n_bits[UID_LAST_PACKET]);
352
353 if (debug_)
354 {
355 cout << "\033[1;32;40m (RX) UWPOLLING::AUV_MULE packer hdr \033[0m" << std::endl;
357 }
358 }
359 }
360
361 return offset;
362
363}
364
366{
367 hdr_cmn* ch = HDR_CMN(p);
368
369 if (ch->ptype() == PT_TRIGGER)
370 {
371 hdr_TRIGGER* triggerh = HDR_TRIGGER(p);
372 cout << "\033[1;37;41m 1st field \033[0m, t_in_: " << triggerh->t_in_ << std::endl
373 << "\033[1;37;41m 2nd field \033[0m, t_fin_: " << triggerh->t_fin_ << std::endl
374 << "\033[1;37;41m 3rd field \033[0m, TRIGGER_uid: " << triggerh->TRIGGER_uid_ << std::endl;
375
376 }
377 else if ( ch->ptype() == PT_PROBE)
378 {
379 hdr_PROBE* probeh = HDR_PROBE(p);
380 cout << "\033[1;37;41m 2nd field \033[0m, ts_: " << probeh->ts_ << std::endl
381 << "\033[1;37;41m 3rd field \033[0m, n_pkts_: " << (unsigned int) probeh->n_pkts_ << std::endl
382 << "\033[1;37;41m 4th field \033[0m, id_node_: " << (unsigned int) probeh->id_node_ << std::endl
383 << "\033[1;37;41m 5th field \033[0m, PROBE_uid: " << (unsigned int) probeh->PROBE_uid_ << std::endl;
384 }
385 else if ( ch ->ptype() == PT_POLL)
386 {
387 hdr_POLL* pollh = HDR_POLL(p);
388 cout << "\033[1;37;41m 1st field \033[0m, id_polled_: " << pollh->id_ << std::endl
389 << "\033[1;37;41m 2nd field \033[0m, POLL_uid: " << pollh->POLL_uid_ << std::endl
390 << "\033[1;37;41m 3rd field \033[0m, POLL_time_: " << pollh->POLL_time_ << std::endl;
391 }
392 else if ( ch->ptype() == PT_PROBE_SINK)
393 {
394 hdr_PROBE_SINK* probe_sink_hdr = HDR_PROBE_SINK(p);
395 cout << "\033[1;37;41m 1st field \033[0m, id_sink: " << probe_sink_hdr->id_sink_ << std::endl
396 << "\033[1;37;41m 2nd field \033[0m, PROBE_uid_: " << probe_sink_hdr->PROBE_uid_ << std::endl
397 << "\033[1;37;41m 3rd field \033[0m, id_ack_: " << probe_sink_hdr->id_ack_ << std::endl;
398 }
399 else if ( ch->ptype() == PT_ACK_SINK)
400 {
401 hdr_ACK_SINK* ackh = HDR_ACK_SINK(p);
402 std::vector<uint16_t>::iterator ack_id_it;
403 uint count = 0;
404 for (ack_id_it = ackh->id_ack_.begin(); ack_id_it != ackh->id_ack_.end(); ++ack_id_it) {
405 count++;
406 cout << "\033[1;37;41m 1st field \033[0m, ack_id " << count << " : "
407 << (uint16_t)*ack_id_it << std::endl;
408 }
409 }
410 else// ( ch->ptype() == PT_AUV_MULE)
411 {
412 hdr_AUV_MULE* auv_mule_hdr = HDR_AUV_MULE(p);
413 cout << "\033[1;37;41m 1st field \033[0m, pkt_uid_: " << auv_mule_hdr->pkt_uid_ << std::endl
414 << "\033[1;37;41m 2nd field \033[0m, last_pkt_uid_: " << auv_mule_hdr->last_pkt_uid_ << std::endl;
415 }
416}
417
419{
420 cout << "\033[0;46;30m Packer Name \033[0m: UWCBR" << std::endl;
421 cout << "** TRIGGER header fields" << std::endl;
422 cout << "\033[0;46;30m minimum backoff: \033[0m" << t_in_Bits << " bits" << std::endl;
423 cout << "\033[0;46;30m maximum backoff: \033[0m" << t_fin_Bits << " bits" << std::endl;
424 cout << "\033[0;46;30m trigger packet unique id: \033[0m" << uid_trigger_Bits << " bits" << std::endl;
425
426 cout << "** POLL header fields" << std::endl;
427 cout << "\033[0;46;30m polled node id: \033[0m" << id_polled_Bits << " bits" << std::endl;
428 cout << "\033[0;46;30m poll packet unique id: \033[0m" << uid_poll_Bits << " bits" << std::endl;
429 cout << "\033[0;46;30m poll time: \033[0m" << poll_time_Bits << " bits" << std::endl;
430
431 cout << "** PROBE header fields" << std::endl;
432 cout << "\033[0;46;30m timestemp: \033[0m" << ts_Bits << " bits" << std::endl;
433 cout << "\033[0;46;30m number of packets: \033[0m" << n_pkts_Bits << " bits" << std::endl;
434 cout << "\033[0;46;30m node id: \033[0m" << id_node_Bits << " bits" << std::endl;
435 cout << "\033[0;46;30m probe packets unique id: \033[0m" << uid_probe_Bits << " bits" << std::endl;
436
437 cout << "** PROBE SINK header fields" << std::endl;
438 cout << "\033[0;46;30m sink node id: \033[0m" << uid_sink_Bits << " bits" << std::endl;
439 cout << "\033[0;46;30m sink probe packets unique id: \033[0m" << uid_probe_sink_Bits << " bits" << std::endl;
440 cout << "\033[0;46;30m probe ack id: \033[0m" << uid_ack_Bits << " bits" << std::endl;
441
442 cout << "** AUV header fields" << std::endl;
443 cout << "\033[0;46;30m data packet unique id: \033[0m" << uid_packet_Bits << " bits" << std::endl;
444 cout << "\033[0;46;30m last tx packet unique id: \033[0m" << uid_last_packet_Bits << " bits" << std::endl;
445
446 cout << "** ACK SINK header fields" << std::endl;
447 cout << "\033[0;46;30m max number of ACKs: \033[0m" << ack_array_size_Bits << " bits" << std::endl;
448 cout << "\033[0;46;30m ack id: \033[0m" << ack_array_el_Bits << " bits per element" << std::endl;
449}
450
451
452
453
454
455
456
TclObject * create(int, const char *const *)
Class to map a Uwpolling header into a bit stream, and vice-versa.
size_t uid_probe_sink_Bits
number of Bits used for PROBE_uid_ field on PROBE_SINK header
size_t t_fin_Bits
number of Bits used for t_fin field on TRIGGER header
size_t id_polled_Bits
number of Bits used for id_polled field on POLL header
size_t poll_time_Bits
number of Bits used for POLL_time field on POLL header
size_t uid_ack_Bits
number of Bits used for id_ack_ field on PROBE_SINK header
size_t uid_trigger_Bits
number of Bits used for uid field on TRIGGER header
size_t n_pkts_Bits
number of Bits used for n_pkts field on PROBE header
int sink_mac
Mac addres of the destination that need AUV_MULE hdr.
size_t ts_Bits
number of Bits used for ts field on PROBE header
void printMyHdrMap()
Method used for debug purposes.
~packerUwpolling()
Class destructor.
size_t uid_poll_Bits
number of Bits used for uid field on POLL header
void printMyHdrFields(Packet *)
Method used for debug purposes.
size_t t_in_Bits
number of Bits used for t_in field on TRIGGER header
size_t backoff_time_Bits
number of Bits used for backoff field on PROBE header
void init()
Init the Packer.
size_t uid_packet_Bits
number of Bits used for pkt_uid_ field on AUV_MULE header
size_t id_node_Bits
number of Bits used for id_node field on PROBE header
size_t ack_array_size_Bits
number of Bits used for number of ACKs on ACK_SINK header
size_t uid_sink_Bits
number of Bits used for id_sink_ field on PROBE_SINK header
packerUwpolling()
Class constructor.
size_t ack_array_el_Bits
number of Bits used for each ACK on ACK_SINK header
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 uid_probe_Bits
number of Bits used for uid field on PROBE header
size_t packMyHdr(Packet *, unsigned char *, size_t)
Method to transform the headers of Uwpolling into a stream of bits.
size_t ack_array_size
Maximum number of elements for the ACK vector.
size_t uid_last_packet_Bits
number of Bits used for last_pkt_uid_ field on AUV_MULE header
Class exploited by the Uwal module to map an NS-Miracle packet into a bit stream, and vice-versa.
Definition packer.h:57
std::vector< size_t > n_bits
Vector of elements containing the indication of the number of bits to consider for each header field.
Definition packer.h:224
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.
Definition packer.cpp:685
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...
Definition packer.cpp:673
int debug_
Flag to enable debug messages.
Definition packer.h:227
PackerUwpollingClass class_module_packerUwpolling
Header of the class responsible to map the ns2 packet of Uwpolling into a bit stream,...
Header of the ACK sent by the SINK.
std::vector< uint16_t > id_ack_
ACK is the id of the wrong packets.
Header of the data sent from AUV MULE to SINK.
uint16_t pkt_uid_
unique ID of the transmitted packet by the AUV node
Header of the POLL message.
int id_
ID of the POLLED node.
uint16_t POLL_time_
Time needed by the AUV to poll all the nodes.
uint POLL_uid_
POLL packet unique ID.
Header of the PROBE message.
uint id_sink_
ID of the sink.
uint16_t id_ack_
ID used for ack purpose.
uint PROBE_uid_
Unique ID of the PROBE packet.
Header of the PROBE message.
uint PROBE_uid_
Unique ID of the PROBE packet.
uint16_t ts_
Timestamp of the most recent data packet.
uint id_node_
ID of the node.
int n_pkts_
Number of packets that the node wish to transmit to the AUV.
Header of the TRIGGER message.
uint TRIGGER_uid_
TRIGGER packet unique ID.
uint16_t t_in_
Minimum value in which the node can choose his backoff time.
uint16_t t_fin_
Maximum value in which the node can choose his backoff time.
#define HDR_PROBE_SINK(p)
alias defined to access the ACK SINK HEADER
#define HDR_ACK_SINK(p)
alias defined to access the ACK SINK HEADER
#define HDR_POLL(p)
alias defined to access the POLL HEADER
#define HDR_AUV_MULE(p)
alias defined to access the AUV MULE HEADER
#define HDR_TRIGGER(p)
alias defined to access the TRIGGER HEADER \
#define HDR_PROBE(p)
alias defined to access the PROBE HEADER