/usr/include/ns3.27/ns3/lte-ccm-mac-sap.h is in libns3-dev 3.27+dfsg-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 | /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2015 Danilo Abrignani
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Danilo Abrignani <danilo.abrignani@unibo.it>
*
*/
#ifndef LTE_CCM_MAC_SAP_H
#define LTE_CCM_MAC_SAP_H
#include <ns3/lte-rrc-sap.h>
#include <ns3/eps-bearer.h>
#include <ns3/lte-enb-cmac-sap.h>
#include <ns3/lte-mac-sap.h>
#include <ns3/ff-mac-common.h>
namespace ns3 {
/**
* \ingroup lte
*
* \brief Service Access Point (SAP) offered by the component carrier manager (CCM)
* by MAC to CCM.
*
* This is the *Component Carrier Manager SAP Provider*, i.e., the part of the SAP
* that contains the MAC methods called by the eNodeB CCM
* instance.
*/
class LteCcmMacSapProvider
{
public:
virtual ~LteCcmMacSapProvider ();
/**
* \brief Add the Buffer Status Report to the list.
* \param bsr LteEnbComponentCarrierManager used this function to
* send back an uplink BSR to some of the MAC instances
*/
virtual void ReportMacCeToScheduler (MacCeListElement_s bsr) = 0;
}; // end of class LteCcmMacSapProvider
/**
* \ingroup lte
*
* \brief Service Access Point (SAP) offered by MAC to the
* component carrier manager (CCM).
*
*
* This is the *CCM MAC SAP User*, i.e., the part of the SAP
* that contains the component carrier manager methods called
* by the eNodeB MAC instance.
*/
class LteCcmMacSapUser : public LteMacSapUser
{
public:
virtual ~LteCcmMacSapUser ();
/**
* \brief When the Primary Component carrier receive a buffer status report
* it is sent to the CCM.
* \param bsr Buffer Status Report received from a Ue
* \param componentCarrierId
*/
virtual void UlReceiveMacCe (MacCeListElement_s bsr, uint8_t componentCarrierId) = 0;
/**
* \brief Notifies component carrier manager about physical resource block occupancy
* \param prbOccupancy The physical resource block occupancy
* \param componentCarrierId The component carrier id
*/
virtual void NotifyPrbOccupancy (double prbOccupancy, uint8_t componentCarrierId) = 0;
}; // end of class LteCcmMacSapUser
/// MemberLteCcmMacSapProvider class
template <class C>
class MemberLteCcmMacSapProvider : public LteCcmMacSapProvider
{
public:
/**
* Constructor
*
* \param owner the owner class
*/
MemberLteCcmMacSapProvider (C* owner);
// inherited from LteCcmRrcSapProvider
virtual void ReportMacCeToScheduler (MacCeListElement_s bsr);
private:
C* m_owner; ///< the owner class
};
template <class C>
MemberLteCcmMacSapProvider<C>::MemberLteCcmMacSapProvider (C* owner)
: m_owner (owner)
{
}
template <class C>
void MemberLteCcmMacSapProvider<C>::ReportMacCeToScheduler (MacCeListElement_s bsr)
{
m_owner->DoReportMacCeToScheduler (bsr);
}
/// MemberLteCcmMacSapUser class
template <class C>
class MemberLteCcmMacSapUser : public LteCcmMacSapUser
{
public:
/**
* Constructor
*
* \param owner the owner class
*/
MemberLteCcmMacSapUser (C* owner);
// inherited from LteCcmRrcSapUser
virtual void UlReceiveMacCe (MacCeListElement_s bsr, uint8_t componentCarrierId);
virtual void NotifyPrbOccupancy (double prbOccupancy, uint8_t componentCarrierId);
// inherited from LteMacSapUser
virtual void NotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid);
virtual void ReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid);
virtual void NotifyHarqDeliveryFailure ();
private:
C* m_owner; ///< the owner class
};
template <class C>
MemberLteCcmMacSapUser<C>::MemberLteCcmMacSapUser (C* owner)
: m_owner (owner)
{
}
template <class C>
void MemberLteCcmMacSapUser<C>::UlReceiveMacCe (MacCeListElement_s bsr, uint8_t componentCarrierId)
{
m_owner->DoUlReceiveMacCe (bsr, componentCarrierId);
}
template <class C>
void MemberLteCcmMacSapUser<C>::NotifyPrbOccupancy (double prbOccupancy, uint8_t componentCarrierId)
{
m_owner->DoNotifyPrbOccupancy (prbOccupancy, componentCarrierId);
}
template <class C>
void MemberLteCcmMacSapUser<C>::NotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid)
{
m_owner->DoNotifyTxOpportunity (bytes, layer, harqId, componentCarrierId, rnti, lcid);
}
template <class C>
void MemberLteCcmMacSapUser<C>::ReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid)
{
m_owner->DoReceivePdu (p, rnti, lcid);
}
template <class C>
void MemberLteCcmMacSapUser<C>::NotifyHarqDeliveryFailure ()
{
m_owner->DoNotifyHarqDeliveryFailure ();
}
} // end of namespace ns3
#endif /* LTE_CCM_MAC_SAP_H */
|