DESERT 3.5.1
Loading...
Searching...
No Matches
uw-csma-ca.cpp
Go to the documentation of this file.
1//
2// Copyright (c) 2017 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//
29
39#include "uw-csma-ca.h"
40#include "uw-csma-ca-hdrs.h"
41#include <queue>
42#include <string>
43#include <stdio.h>
44#include <stdlib.h>
45#include "mac.h"
46#include "mmac.h"
47#include "rng.h"
48
49extern packet_t PT_CA_CTS;
50extern packet_t PT_CA_RTS;
51
52static class CSMACAModuleClass : public TclClass
53{
54public:
59 : TclClass("Module/UW/CSMA_CA")
60 {
61 }
66 TclObject *
67 create(int, const char *const *)
68 {
69 return (new CsmaCa());
70 }
72
73int
74CsmaCa::command(int argc, const char *const *argv)
75{
76 Tcl &tcl = Tcl::instance();
77 switch (argc) {
78 case 2:
79 if (!strcasecmp(argv[1], "initialize")) {
81 return TCL_OK;
82 }
83 if (!strcasecmp(argv[1], "setAckMode")) {
85 return TCL_OK;
86 }
87 if (!strcasecmp(argv[1], "setNoAckMode")) {
89 return TCL_OK;
90 }
91 if (!strcasecmp(argv[1], "getCTSDropped")) {
92 tcl.resultf("%d", cts_pkt_dropped);
93 return TCL_OK;
94 }
95 if (!strcasecmp(argv[1], "getRTSDropped")) {
96 tcl.resultf("%d", rts_pkt_dropped);
97 return TCL_OK;
98 }
99 if (!strcasecmp(argv[1], "getDataDropped")) {
100 tcl.resultf("%d", data_pkt_dropped);
101 return TCL_OK;
102 }
103 if (!strcasecmp(argv[1], "getQueueSize")) {
104 tcl.resultf("%d", getQueueSize());
105 return TCL_OK;
106 }
107 if (!strcasecmp(argv[1], "getUpDataRx")) {
108 tcl.resultf("%d", up_data_pkts_rx);
109 return TCL_OK;
110 }
111 if (!strcasecmp(argv[1], "getRTSRx")) {
112 tcl.resultf("%d", n_rts_rx);
113 return TCL_OK;
114 }
115 if (!strcasecmp(argv[1], "getCTSRx")) {
116 tcl.resultf("%d", n_cts_rx);
117 return TCL_OK;
118 }
119 break;
120 case 3:
121 if (!strcasecmp(argv[1], "setMacAddr")) {
122 addr = atoi(argv[2]);
123 return TCL_OK;
124 }
125 break;
126 }
127 return MMac::command(argc, argv);
128}
129
131 : max_queue_size(10)
132 , backoff_timer(this, CSMA_CA_BACKOFF_TIMER)
133 , cts_timer(this, CSMA_CA_CTS_TIMER)
134 , data_timer(this, CSMA_CA_DATA_TIMER)
135 , ack_timer(this, CSMA_CA_ACK_TIMER)
136 , backoff_delta(0)
137 , ack_mode(CSMA_CA_NO_ACK_MODE)
138 , state(CSMA_CA_IDLE)
139 , previous_state(CSMA_CA_IDLE)
140 , n_rts_rx(0)
141 , n_cts_rx(0)
142 , data_pkt_dropped(0)
143 , cts_pkt_dropped(0)
144 , rts_pkt_dropped(0)
145 , ack_pkt_dropped(0)
147 , actual_data_packet(0)
148 , logfile("/dev/null")
149{
150 bind("queue_size_", (int *) &max_queue_size);
151 bind("backoff_delta_", (int *) &backoff_delta);
152 bind("backoff_max", (int *) &backoff_max);
153 bind("data_size_", (int *) &data_size);
154 bind("bitrate_", (int *) &bitrate);
155 bind("cts_wait_val_", (int *) &cts_wait_val);
156 bind("data_wait_val_", (int *) &data_wait_val);
157 bind("ack_wait_val_", (int *) &ack_wait_val);
158 bind("log_level_", (int *) &log_level);
159}
160
162{
163}
164
165void
167{
168 switch (timer_type) {
170 module->data_timer_fired();
171 break;
173 module->backoff_timer_fired();
174 break;
176 module->cts_timer_fired();
177 break;
179 module->ack_timer_fired();
180 break;
181 }
182}
183
184void
186{
187 if (state != CSMA_CA_WAIT_ACK) {
188 LOGERR("Ack timer fired but not waiting for an ACK\n");
189 }
190 state_Idle();
191}
192
193void
195{
196 if (getState() == CSMA_CA_BACKOFF) {
197 LOGINFO("Backoff end");
198 state_Idle();
199 } else {
200 LOGERR("Backoff timer expired but not in backoff");
201 }
202}
203
204void
206{
207 if (getState() == CSMA_CA_WAIT_CTS) {
208 LOGINFO("CTS Timer expired");
209 // state_Idle();
210 state_Backoff(1);
211 } else {
212 LOGERR("CTS timer expired but not waiting for a CTS");
213 }
214}
215
216void
218{
219 if (getState() == CSMA_CA_WAIT_DATA) {
220 LOGINFO("Data timer expired ");
221 state_Idle();
222 } else {
223 LOGERR("Data timer expired but not waiting for a DATA");
224 }
225}
226
227void
229{
230 stringstream strs("");
231 strs << "CSMA_CA_" << addr;
232 strs >> logfile;
233
234 outLog.open(logfile.c_str());
235 if (!outLog) {
236 cout << "Error creating log for Csma-Ca" << endl;
237 }
238}
239
240void
242{
243 MMac::Mac2PhyStartTx(p);
244}
245
246void
248{
249 hdr_cmn *ch = HDR_CMN(p);
250 packet_t rx_pkt_type = ch->ptype();
251 hdr_mac *mach = HDR_MAC(p);
252 hdr_ca_RTS *rts;
253 hdr_ca_CTS *cts;
254 int rx_data_ret = 0;
255
256 LOGINFO("Phy2MacEndRx");
257 if (ch->error()) {
258 LOGWRN("Drop packet due to error");
259 drop(p, 1, "REASON_ERROR");
260 } else {
261 if (rx_pkt_type == PT_CA_RTS) {
262 int rts_ret = 0;
263 rts = CA_RTS_HDR_ACCESS(p);
264 n_rts_rx++;
265 rts_ret = stateRxRTS(rts, mach->macSA(), mach->macDA());
266 switch (rts_ret) {
267 case -2:
269 break;
270 case -1:
272 break;
273 case 0:
274 /* not a drop, just freeing the memory */
275 Packet::free(p);
276 break;
277 default:
279 }
280 } else if (rx_pkt_type == PT_CA_CTS) {
281 cts = CA_CTS_HDR_ACCESS(p);
282 int cts_ret = 0;
283 cts_ret = stateRxCTS(cts, mach->macSA(), mach->macDA());
284 n_cts_rx++;
285 switch (cts_ret) {
286 case -1:
288 break;
289 case 0:
290 Packet::free(p);
291 break;
292 default:
294 }
295 } else if (rx_pkt_type == PT_CA_ACK) {
296 int ack_ret = 0;
297 ack_ret = stateRxACK(p);
298 switch (ack_ret) {
299 case -1:
301 break;
302 case -2:
304 break;
305 case 0:
306 default:
307 Packet::free(p);
308 }
309 } else {
310 rx_data_ret = stateRxData(p);
311 if (rx_data_ret == -1) {
313 } else if (rx_data_ret == -2) {
315 }
316 }
317 }
318}
319
320int
322{
323 hdr_mac *mac = HDR_MAC(ack);
324 if (mac->macDA() == addr) {
325 if (state == CSMA_CA_WAIT_ACK) {
326 LOGINFO("Ack received\n");
327 ack_timer.force_cancel();
328 state_Idle();
329 return (0);
330 } else {
331 LOGERR("Received an ACK but not waiting for it\n");
332 return (-2);
333 }
334 } else if ((uint32_t) mac->macDA() == MAC_BROADCAST) {
335 LOGERR("Received a broadcast ACK\n");
336 return (-1);
337 } else {
338 LOGWRN("Received an ACK not for us\n");
339 return (-1);
340 }
341}
342
343void
345{
347 Packet *ack = buildPacket(mac_dst, CSMA_CA_ACK, 0);
348 Mac2PhyStartTx(ack);
349}
350
351int
353{
354 LOGINFO("State Rx Data\n");
355 hdr_mac *mach = HDR_MAC(p);
356 if (mach->macDA() == addr) {
357 if (getState() == CSMA_CA_WAIT_DATA) {
358 data_timer.force_cancel();
359 incrDataPktsRx();
360 sendUp(p);
361 if (ack_mode == CSMA_CA_ACK_MODE) {
362 LOGDBG("Sending ACK for Data\n");
363 stateTxAck(mach->macSA());
364 } else {
365 LOGDBG("No ACK Mode Activated\n");
366 state_Idle();
367 }
368 return (0);
369 } else {
370 LOGWRN("Received a Data Packet while not waiting for it");
371 return (-1);
372 }
373 } else {
374 LOGWRN("Received a Data Packet not for me");
375 return (-2);
376 }
377}
378
379int
380CsmaCa::stateRxRTS(hdr_ca_RTS *rts, int mac_src, int mac_dst)
381{
382 const int WRONG_STATE = -1;
383 const int NOT_FOR_US = -2;
384 const int ERROR = -3;
385 LOGINFO("stateRxRTS");
386 if (mac_dst == addr) {
387 actual_mac_data_src = mac_src;
389 if (actual_expected_tx_time <= 0) {
392 LOGERR("Actual actual_expected_tx_time is 0");
393 return (ERROR);
394 }
396 if (getState() == CSMA_CA_BACKOFF)
397 backoff_timer.force_cancel();
398 stateTxCTS();
399 return (0);
400 } else {
403 LOGWRN("Received an RTS and not in state IDLE");
404 return (WRONG_STATE);
405 }
406 } else if ((uint32_t) mac_dst == MAC_BROADCAST) {
407 LOGERR("Just received a broadcast RTS");
408 return (NOT_FOR_US);
409 } else {
410 LOGDBG("Received an RTS not for us");
411 return (NOT_FOR_US);
412 }
413}
414
415void
417{
418 LOGINFO("Tx CTS");
421 state_Idle();
422 LOGERR("Error sending CTS ");
423 }
424}
425
426void
428{
429 LOGINFO("State IDLE");
431 if (data_q.size() > 0) {
433 }
434}
435
436int
437CsmaCa::stateRxCTS(hdr_ca_CTS *cts, int mac_src, int mac_dst)
438{
439 const int NOT_FOR_ME = -1;
440 LOGINFO("State RX_CTS");
441 if (mac_dst == addr && getState() == CSMA_CA_WAIT_CTS) {
442 cts_timer.force_cancel();
443 stateTxData();
444 return (0);
445 } else if (getState() == CSMA_CA_IDLE) {
447 return (0);
448 } else {
449 LOGERR("Overheared a CTS not for me and not in IDLE. Discarding \
450 and not setting up backoff");
451 return (NOT_FOR_ME);
452 }
453}
454
455int
461
462void
464{
465 LOGINFO("State Backoff");
467 int random = RNG::defaultrng()->uniform(backoff_max) + (int) (tx_time + backoff_delta);
468 backoff_timer.resched(random);
469}
470
471void
473{
474 LOGDBG("Starting Rx a Packet");
475 MMac::Phy2MacStartRx(p);
476}
477
478void
480{
481 LOGINFO("Waiting for ACK\n");
483 ack_timer.resched(ack_wait_val);
484}
485
486void
487CsmaCa::Phy2MacEndTx(const Packet *p)
488{
489 LOGINFO("Phy2MacEndTx");
490 hdr_cmn *ch = HDR_CMN(p);
491 if (ch->ptype() == PT_CA_CTS) {
493 } else if (ch->ptype() == PT_CA_RTS) {
495 } else if (ch->ptype() == PT_CA_ACK) {
496 state_Idle();
497 } else {
498 if (ack_mode == CSMA_CA_ACK_MODE) {
501 } else {
503 state_Idle();
504 }
505 }
506}
507
508void
510{
511 incrUpperDataRx();
512 if (getQueueSize() <= max_queue_size) {
513 data_q.push(p);
514 if (state == CSMA_CA_IDLE) {
515 state_Idle();
516 }
517 } else {
518 dropPacket(p, CSMA_CA_DATA, "Buffer full");
519 }
520}
521
522void
524{
525 LOGINFO("Extracting Data Packet from queue and sending RTS");
526 if (!actual_data_packet) {
527 actual_data_packet = data_q.front();
528 data_q.pop();
529 }
530 hdr_mac *mach = HDR_MAC(actual_data_packet);
531 if (!txRTS(mach->macDA())) {
532 LOGERR("Error sending RTS");
533 }
534}
535
536void
537CsmaCa::dropPacket(Packet *p, csma_ca_pkt_type_t type, char *reason)
538{
539 drop(p, 1, reason);
540 switch (type) {
541 case CSMA_CA_RTS:
543 break;
544 case CSMA_CA_CTS:
546 break;
547 case CSMA_CA_DATA:
549 break;
550 case CSMA_CA_ACK:
552 break;
553 default:
554 break;
555 }
556}
557
558int
559CsmaCa::txRTS(int mac_dest)
560{
561 Packet *rts;
562 rts = buildPacket(mac_dest, CSMA_CA_RTS, computeTxTime());
563
564 if (!rts) {
565 return (0);
566 }
567 Mac2PhyStartTx(rts);
568 return (1);
569}
570
571int
572CsmaCa::txCTS(int mac_dest)
573{
574 Packet *cts;
576
577 if (!cts) {
578 return (0);
579 }
580
581 Mac2PhyStartTx(cts);
582 return (1);
583}
584
585int
587{
588
589 if (!actual_data_packet) {
590 return (0);
591 }
592
594 incrDataPktsTx();
595 return (1);
596}
597
598void
600{
601 LOGINFO("Waiting for CTS");
603 cts_timer.resched((double) cts_wait_val);
604}
605
606void
608{
609 LOGINFO("Waiting for DATA Packet");
611 data_timer.resched((double) data_wait_val);
612}
613
614void
615CsmaCa::buildRTShdr(hdr_ca_RTS **rts, uint8_t tx_time)
616{
617 (*rts)->set_tx_time(tx_time);
618}
619
620void
621CsmaCa::buildCTShdr(hdr_ca_CTS **cts, uint8_t tx_time)
622{
623 (*cts)->set_tx_time(tx_time);
624}
625
626Packet *
627CsmaCa::buildPacket(int mac_dest, csma_ca_pkt_type_t type, uint8_t tx_time)
628{
629 Packet *p;
630 switch (type) {
631 case CSMA_CA_RTS: {
632 p = Packet::alloc();
633 hdr_cmn *ch_r = hdr_cmn::access(p);
634 hdr_mac *mac_r = HDR_MAC(p);
635 ch_r->ptype() = PT_CA_RTS;
636 ch_r->size() = sizeof(hdr_ca_RTS); // 8; /* 8 bit for tx_time */
637 mac_r->set(MF_CONTROL, addr, mac_dest);
639 buildRTShdr(&rts, tx_time);
640 } break;
641 case CSMA_CA_CTS: {
642 p = Packet::alloc();
643 hdr_cmn *ch_c = hdr_cmn::access(p);
644 hdr_mac *mac_c = HDR_MAC(p);
645 ch_c->ptype() = PT_CA_CTS;
646 ch_c->size() = sizeof(hdr_ca_CTS); // 8; /* 8 bit for tx_time */
647 mac_c->set(MF_CONTROL, addr, mac_dest);
649 buildCTShdr(&cts, tx_time);
650 } break;
651 case CSMA_CA_ACK: {
652 p = Packet::alloc();
653 hdr_cmn *ch_c = hdr_cmn::access(p);
654 hdr_mac *mac_c = HDR_MAC(p);
655 ch_c->ptype() = PT_CA_ACK;
656 ch_c->size() = 1;
657 mac_c->set(MF_CONTROL, addr, mac_dest);
658 break;
659 }
660 default:
661 LOGERR("Called buidPacket for unknown packet type");
662 p = NULL;
663 }
664 return p;
665}
666
667void
669{
670 csma_ca_log_level_t actual_log_level = getLogLevel();
671 if (actual_log_level >= log_level) {
672 outLog.open((getLogFile()).c_str(), ios::app);
673 outLog << left << "[" << getEpoch() << "]::" << NOW << "::"
674 << "(" << addr << ")::" << log_level_string[level] << "::" << log
675 << endl;
676 outLog.flush();
677 outLog.close();
678 }
679}
CSMACAModuleClass()
Constructor of the class.
TclObject * create(int, const char *const *)
Creates the TCL object needed for the tcl language interpretation.
CsmaCa *csma_ca_timers_t timer_type
Definition uw-csma-ca.h:112
virtual void expire(Event *e)
Class that describes a CsmaAloha module.
Definition uw-csma-ca.h:97
string logfile
File name of log.
Definition uw-csma-ca.h:399
int cts_wait_val
Timer duration of CTS.
Definition uw-csma-ca.h:383
int max_queue_size
Maximum dimension of Queue.
Definition uw-csma-ca.h:378
void extractDataPacket()
Extract data packet from queue.
int cts_pkt_dropped
CTS packet dropped.
Definition uw-csma-ca.h:405
Packet * buildPacket(int mac_dest, csma_ca_pkt_type_t type, uint8_t tx_time)
Build a generic packet.
virtual void state_Wait_ACK()
Wait for an ACK after a data transmission.
time_t getEpoch()
Return the system epoch.
Definition uw-csma-ca.h:209
virtual int stateTxData()
Transmission of a DATA packet.
csma_ca_states_t state
Current state of the protocol.
Definition uw-csma-ca.h:393
int n_rts_rx
RTS received.
Definition uw-csma-ca.h:402
int n_cts_rx
CTS received.
Definition uw-csma-ca.h:403
virtual int stateRxACK(Packet *ack)
Reception of an ACK packet.
int data_pkt_dropped
DATA packet dropped.
Definition uw-csma-ca.h:404
virtual void initializeLog()
Initializes the protocol at the beginning of the simulation.
int data_wait_val
Timer duration of DATA.
Definition uw-csma-ca.h:384
void ack_timer_fired()
ACK timer is expired.
int txData()
Actually transmit a DATA packet.
void data_timer_fired()
data timer is expired
virtual void Phy2MacStartRx(const Packet *p)
Method called when the Phy Layer start to receive a Packet.
CsmaCaTimer ack_timer
ACK timer.
Definition uw-csma-ca.h:292
std::queue< Packet * > data_q
Size of DATA packet.
Definition uw-csma-ca.h:391
virtual void state_Backoff(int tx_time)
Backoff state.
string getLogFile()
Return name of the log file.
Definition uw-csma-ca.h:218
int actual_mac_data_src
Source MAC of DATA packet we are handling.
Definition uw-csma-ca.h:388
virtual int stateRxCTS(hdr_ca_CTS *cts, int mac_src, int mac_dst)
Reception of an CTS packet.
virtual void state_Idle()
Protocol in IDLE state.
void buildRTShdr(hdr_ca_RTS **rts, uint8_t tx_time)
Build an RTS header.
void backoff_timer_fired()
backoff timer is expired
void buildCTShdr(hdr_ca_CTS **cts, uint8_t tx_time)
Build an CTS header.
void printonLog(csma_ca_log_level_t level, string log)
Print a message on log file.
virtual void dropPacket(Packet *p, csma_ca_pkt_type_t type, char *reason)
Drop the packet logging the reason and incrementing the counters.
virtual void state_Wait_CTS()
Waiting for CTS packet.
virtual int stateRxData(Packet *p)
Transmit a data packet.
int getQueueSize()
Return the size of the data packet queue.
Definition uw-csma-ca.h:200
virtual void stateTxCTS()
Transmission of a CTS packet.
int data_size
Size of DATA packet.
Definition uw-csma-ca.h:379
CsmaCaTimer backoff_timer
Backoff timer.
Definition uw-csma-ca.h:289
int txRTS(int mac_dest)
Actually transmit a RTS packet.
Packet * actual_data_packet
Pointer to DATA packet we are handling.
Definition uw-csma-ca.h:390
int ack_pkt_dropped
ACK packet dropped.
Definition uw-csma-ca.h:407
int backoff_max
Maximum value in range of backoff.
Definition uw-csma-ca.h:382
virtual ~CsmaCa()
virtual int stateRxRTS(hdr_ca_RTS *rts, int mac_src, int mac_dst)
Reception of an RTS packet.
int actual_expected_tx_time
Tx time of DATA packet we are handling.
Definition uw-csma-ca.h:389
csma_ca_log_level_t getLogLevel()
Return the current log level of the protocol.
Definition uw-csma-ca.h:191
virtual void stateTxAck(int mac_dst)
Tranmission of an ACK.
int computeTxTime()
Compute transmission time of a packet using known bitrate.
Definition uw-csma-ca.h:351
int ack_wait_val
Timer duration of ACK.
Definition uw-csma-ca.h:385
CsmaCaTimer data_timer
Data timer.
Definition uw-csma-ca.h:291
virtual void Mac2PhyStartTx(Packet *p)
Pass the packet to the PHY layer.
virtual int command(int argc, const char *const *argv)
TCL command interpreter.
virtual void state_Wait_Data()
Waiting for DATA packet.
int bitrate
Bit rate adopted.
Definition uw-csma-ca.h:380
int txCTS(int mac_dest)
Actually transmit a CTS packet.
virtual void Phy2MacEndRx(Packet *p)
Method called when the Phy Layer finish to receive a Packet.
virtual void Phy2MacEndTx(const Packet *p)
Method called when the PHY layer finish to transmit the packet.
std::ofstream outLog
Stdout stream of log.
Definition uw-csma-ca.h:397
int backoff_delta
Delta value (configurable) to be added to backoff.
Definition uw-csma-ca.h:381
void cts_timer_fired()
CTS timer is expired.
CsmaCaTimer cts_timer
CTS timer.
Definition uw-csma-ca.h:290
virtual void recvFromUpperLayers(Packet *p)
Receives the packet from the upper layer (e.g.
void updateState(csma_ca_states_t s)
Update the state of the protocol.
Definition uw-csma-ca.h:181
ack_modes_t ack_mode
ACK mode (configurable.
Definition uw-csma-ca.h:392
csma_ca_states_t getState()
Get the state of the protocol.
Definition uw-csma-ca.h:172
int rts_pkt_dropped
RTS packet dropped.
Definition uw-csma-ca.h:406
uint8_t & get_tx_time()
uint8_t & get_tx_time()
Provides the headers of ctrl packets of uw-csma-ca module.
#define CA_CTS_HDR_ACCESS(p)
#define CA_RTS_HDR_ACCESS(p)
CSMACAModuleClass class_module_csmaca
Provides the description of CsmaCa Class.
#define DROP_REASON_GENERICERROR
Definition uw-csma-ca.h:55
#define LOGINFO(log)
Definition uw-csma-ca.h:299
@ CSMA_CA_RTS
Definition uw-csma-ca.h:80
@ CSMA_CA_DATA
Definition uw-csma-ca.h:80
@ CSMA_CA_CTS
Definition uw-csma-ca.h:80
@ CSMA_CA_ACK
Definition uw-csma-ca.h:80
@ CSMA_CA_DATA_TIMER
Definition uw-csma-ca.h:58
@ CSMA_CA_CTS_TIMER
Definition uw-csma-ca.h:60
@ CSMA_CA_ACK_TIMER
Definition uw-csma-ca.h:61
@ CSMA_CA_BACKOFF_TIMER
Definition uw-csma-ca.h:59
#define DROP_REASON_NOTRIGHTSTATE
Definition uw-csma-ca.h:54
#define LOGWRN(log)
Definition uw-csma-ca.h:298
@ CSMA_CA_NO_ACK_MODE
Definition uw-csma-ca.h:64
@ CSMA_CA_ACK_MODE
Definition uw-csma-ca.h:64
enum CSMA_CA_PKT_TYPE csma_ca_pkt_type_t
Definition uw-csma-ca.h:82
#define LOGERR(log)
Definition uw-csma-ca.h:296
#define LOGDBG(log)
Definition uw-csma-ca.h:297
#define DROP_REASON_NOTFORME
Definition uw-csma-ca.h:53
enum log_level csma_ca_log_level_t
Definition uw-csma-ca.h:88
@ CSMA_CA_BACKOFF
Definition uw-csma-ca.h:70
@ CSMA_CA_WAIT_ACK
Definition uw-csma-ca.h:76
@ CSMA_CA_TX_ACK
Definition uw-csma-ca.h:77
@ CSMA_CA_TX_DATA
Definition uw-csma-ca.h:73
@ CSMA_CA_IDLE
Definition uw-csma-ca.h:69
@ CSMA_CA_TX_CTS
Definition uw-csma-ca.h:72
@ CSMA_CA_WAIT_DATA
Definition uw-csma-ca.h:75
@ CSMA_CA_WAIT_CTS
Definition uw-csma-ca.h:74
log_level
Definition uw-csma-ca.h:86
@ CSMA_CA_ERROR
Definition uw-csma-ca.h:86
string log_level_string[]
Definition uw-csma-ca.h:92