A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
lte-mac-sap.h
Go to the documentation of this file.
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Nicola Baldo <nbaldo@cttc.es>
19  */
20 
21 #ifndef LTE_MAC_SAP_H
22 #define LTE_MAC_SAP_H
23 
24 #include <ns3/packet.h>
25 
26 namespace ns3 {
27 
28 
29 
37 {
38 public:
39  virtual ~LteMacSapProvider ();
40 
46  {
48  uint16_t rnti;
49  uint8_t lcid;
50  uint8_t layer;
51  };
52 
57  virtual void TransmitPdu (TransmitPduParameters params) = 0;
58 
59 
66  {
67  uint16_t rnti;
68  uint8_t lcid;
69  uint32_t txQueueSize;
70  uint16_t txQueueHolDelay;
71  uint32_t retxQueueSize;
72  uint16_t retxQueueHolDelay;
73  uint16_t statusPduSize;
74  };
75 
81  virtual void ReportBufferStatus (ReportBufferStatusParameters params) = 0;
82 
83 
84 };
85 
86 
94 {
95 public:
96  virtual ~LteMacSapUser ();
104  virtual void NotifyTxOpportunity (uint32_t bytes, uint8_t layer) = 0;
105 
112  virtual void NotifyHarqDeliveryFailure () = 0;
113 
114 
120  virtual void ReceivePdu (Ptr<Packet> p) = 0;
121 
122 };
123 
125 
126 template <class C>
128 {
129 public:
131 
132  // inherited from LteMacSapProvider
133  virtual void TransmitPdu (TransmitPduParameters params);
134  virtual void ReportBufferStatus (ReportBufferStatusParameters params);
135 
136 private:
137  C* m_mac;
138 };
139 
140 
141 template <class C>
143  : m_mac (mac)
144 {
145 }
146 
147 template <class C>
149 {
150  m_mac->DoTransmitPdu (params);
151 }
152 
153 template <class C>
155 {
156  m_mac->DoReportBufferStatus (params);
157 }
158 
159 
160 } // namespace ns3
161 
162 
163 #endif // LTE_MAC_SAP_H