DESERT 4.0.0
uw-aloha-q-sink.h
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#ifndef UW_ALOHA_Q_SINK_H
40#define UW_ALOHA_Q_SINK_H
41
42#include <mmac.h>
43#include <iostream>
44#include <assert.h>
45#include <string>
46
47#include <mphy.h>
48
49
50extern packet_t PT_MMAC_ACK;
51
55class UwAloha_Q_SINK : public MMac
56{
57
58public:
63
67 virtual ~UwAloha_Q_SINK();
68
69 virtual int recvSyncClMsg(ClMessage* m);
70
71protected:
76
82 virtual void recvFromUpperLayers(Packet *p);
88 virtual void Phy2MacEndRx(Packet *p);
89
90 virtual int getLayerIdFromTag(const std::string& tag);
91
97 virtual void Phy2MacStartRx(const Packet *p);
103 //virtual void Mac2PhyStartTx(Packet *p);
109 virtual void Phy2MacEndTx(const Packet *p);
110
114 virtual void txAck(int dest_addr);
115
121 virtual void initPkt(Packet *p, int dest_adrr);
122
134 virtual int command(int argc, const char *const *argv);
139
148 int debug_;
153 std::deque<Packet *> buffer;
156 //bool enable;
157
158 std::string phy_ack_tag;
159
160
161};
162
163#endif
Definition uw-aloha-q-sink.h:56
std::deque< Packet * > buffer
Definition uw-aloha-q-sink.h:153
UwAloha_Q_SINK()
Definition uw-aloha-q-sink.cpp:76
virtual int recvSyncClMsg(ClMessage *m)
Definition uw-aloha-q-sink.cpp:273
virtual void Phy2MacEndRx(Packet *p)
Definition uw-aloha-q-sink.cpp:169
int ACK_size
Definition uw-aloha-q-sink.h:151
std::string phy_ack_tag
Definition uw-aloha-q-sink.h:158
int HDR_size
Definition uw-aloha-q-sink.h:152
UWALOHAQ_PKT_TYPE
Definition uw-aloha-q-sink.h:72
@ UWALOHAQ_ACK_PKT
Definition uw-aloha-q-sink.h:73
@ UWALOHAQ_DATA_PKT
Definition uw-aloha-q-sink.h:74
int packet_sent_curr_slot_
Definition uw-aloha-q-sink.h:143
int ack_phy_id
Definition uw-aloha-q-sink.h:155
UWALOHAQ_SINK_STATUS sink_status
Definition uw-aloha-q-sink.h:141
UWALOHAQ_SINK_STATUS
Definition uw-aloha-q-sink.h:138
@ IDLE
Definition uw-aloha-q-sink.h:138
@ RECEIVING
Definition uw-aloha-q-sink.h:138
@ TRANSMITTING
Definition uw-aloha-q-sink.h:138
virtual void initPkt(Packet *p, int dest_adrr)
Definition uw-aloha-q-sink.cpp:216
virtual void Phy2MacStartRx(const Packet *p)
Definition uw-aloha-q-sink.cpp:152
virtual int command(int argc, const char *const *argv)
Definition uw-aloha-q-sink.cpp:230
int sea_trial_
Definition uw-aloha-q-sink.h:150
virtual void recvFromUpperLayers(Packet *p)
Definition uw-aloha-q-sink.cpp:100
virtual ~UwAloha_Q_SINK()
Definition uw-aloha-q-sink.cpp:96
int debug_
Definition uw-aloha-q-sink.h:148
virtual void txAck(int dest_addr)
Definition uw-aloha-q-sink.cpp:122
virtual void Phy2MacEndTx(const Packet *p)
Definition uw-aloha-q-sink.cpp:139
virtual int getLayerIdFromTag(const std::string &tag)
Definition uw-aloha-q-sink.cpp:107
packet_t PT_MMAC_ACK
Definition initlib.cpp:44