/usr/include/ns3.27/ns3/channel-scheduler.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 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* 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: Junling Bu <linlinjavaer@gmail.com>
*/
#ifndef CHANNEL_SCHEDULER_H
#define CHANNEL_SCHEDULER_H
#include <map>
#include "wave-net-device.h"
namespace ns3 {
class WaveNetDevice;
/**
* \ingroup wave
* EdcaParameter structure
*/
struct EdcaParameter
{
uint32_t cwmin; ///< minimum
uint32_t cwmax; ///< maximum
uint32_t aifsn; ///< AIFSN
};
/**
* \ingroup wave
* EDCA parameters typedef
*/
typedef std::map<AcIndex,EdcaParameter> EdcaParameters;
/**
* \ingroup wave
* EDCA parameters iterator typedef
*/
typedef std::map<AcIndex,EdcaParameter>::const_iterator EdcaParametersI;
#define EXTENDED_ALTERNATING 0x00
#define EXTENDED_CONTINUOUS 0xff
/**
* \ingroup wave
*
* \param channelNumber channel number that the SCH service
* can be made available for communications.
* \param operationalRateSet OperationalRateSet if present, as specified in IEEE Std 802.11.
* valid range: 1-127.
* \param immediateAccess Indicates that the MLME should provide immediate
* access to the SCH and not wait until the next SCH interval.
* \param extendedAccess Indicates that the MLME should provide continuous
* access (during both SCH interval and CCH interval) to the SCH for ExtendedAccess
* control channel intervals. A value of 255 indicates indefinite access.
* \param edcaParameters If present, as specified in IEEE Std 802.11.
*/
struct SchInfo
{
uint32_t channelNumber; ///< channel number
//OperationalRateSet operationalRateSet; // not supported
bool immediateAccess; ///< immediate access
uint8_t extendedAccess; ///< extended access
EdcaParameters edcaParameters; ///< EDCA parameters
/// Initializer
SchInfo ()
: channelNumber (SCH1),
immediateAccess (false),
extendedAccess (EXTENDED_ALTERNATING)
{
}
/**
* Initializer
* \param channel the channel number
* \param immediate true if immediate access
* \param channelAccess
*/
SchInfo (uint32_t channel, bool immediate, uint32_t channelAccess)
: channelNumber (channel),
immediateAccess (immediate),
extendedAccess (channelAccess)
{
}
/**
* Initializer
* \param channel the channel number
* \param immediate true if immediate access
* \param channelAccess
* \param edca the EDCA parameters
*/
SchInfo (uint32_t channel, bool immediate, uint32_t channelAccess, EdcaParameters edca)
: channelNumber (channel),
immediateAccess (immediate),
extendedAccess (channelAccess),
edcaParameters (edca)
{
}
};
/// ChannelAccess enumeration
enum ChannelAccess
{
ContinuousAccess, // continuous access for SCHs
AlternatingAccess, //alternating CCH and SCH access
ExtendedAccess, // extended access in SCHs
DefaultCchAccess, // default continuous CCH access
NoAccess, // no channel access assigned
};
/**
* \ingroup wave
* \brief This class will assign channel access for requests from higher layers.
* The channel access options include (1) continuous access for SCHs, (2) alternating
* CCH and SCH access, (3) extended access for SCHs and (4) default continuous CCH
* access. The options except (4) have an immediate parameter to enable immediate
* access assignment without the need for waiting.
* Its sub-class can use different mechanism to assign the channel access.
*/
class ChannelScheduler : public Object
{
public:
/**
* \brief Get the type ID.
* \return the object TypeId
*/
static TypeId GetTypeId (void);
ChannelScheduler ();
virtual ~ChannelScheduler ();
/**
* \param device enable channel scheduler associated with WaveNetDevice
*/
virtual void SetWaveNetDevice (Ptr<WaveNetDevice> device);
/**
* \return whether CCH channel access is assigned.
*/
bool IsCchAccessAssigned (void) const;
/**
* \return whether SCH channel access is assigned.
*/
bool IsSchAccessAssigned (void) const;
/**
* \param channelNumber the specified channel number
* \return whether channel access is assigned for the channel.
*/
bool IsChannelAccessAssigned (uint32_t channelNumber) const;
/**
* \param channelNumber the specified channel number
* \return whether the continuous access is assigned for the specific channel.
*/
bool IsContinuousAccessAssigned (uint32_t channelNumber) const;
/**
* \param channelNumber the specified channel number
* \return whether the continuous access is assigned for the specific channel.
*/
bool IsAlternatingAccessAssigned (uint32_t channelNumber) const;
/**
* \param channelNumber the specified channel number
* \return whether the continuous access is assigned for the specific channel.
*/
bool IsExtendedAccessAssigned (uint32_t channelNumber) const;
/**
* \return whether the continuous access is assigned for CCHl.
*/
bool IsDefaultCchAccessAssigned (void) const;
/**
* \param channelNumber the specified channel number
* \return the type of current assigned channel access for the specific channel.
*/
virtual enum ChannelAccess GetAssignedAccessType (uint32_t channelNumber) const = 0;
/**
* \param schInfo the request information for assigning SCH access.
* \return whether the channel access is assigned successfully.
*
* This method is called to assign channel access for sending packets.
*/
bool StartSch (const SchInfo & schInfo);
/**
* \param channelNumber indicating which channel should release
* the assigned channel access resource.
* \return true if successful.
*/
bool StopSch (uint32_t channelNumber);
protected:
virtual void DoInitialize (void);
/**
* \param channelNumber the specific channel
* \param immediate indicate whether channel switch to channel
* \return whether the channel access is assigned successfully
*
* This method will assign alternating access for SCHs and CCH.
*/
virtual bool AssignAlternatingAccess (uint32_t channelNumber, bool immediate) = 0;
/**
* \param channelNumber the specific channel
* \param immediate indicate whether channel switch to channel
* \return whether the channel access is assigned successfully
*
* This method will assign continuous access CCH.
*/
virtual bool AssignContinuousAccess (uint32_t channelNumber, bool immediate) = 0;
/**
* \param channelNumber the specific channel
* \param immediate indicate whether channel switch to channel
* \return whether the channel access is assigned successfully
*
* This method will assign extended access for SCHs.
*/
virtual bool AssignExtendedAccess (uint32_t channelNumber, uint32_t extends, bool immediate) = 0;
/**
* This method will assign default CCH access for CCH.
* \return whether the channel access is assigned successfully
*/
virtual bool AssignDefaultCchAccess (void) = 0;
/**
* \param channelNumber indicating for which channel should release
* the assigned channel access resource.
* \return whether the channel access is released successfully
*/
virtual bool ReleaseAccess (uint32_t channelNumber) = 0;
Ptr<WaveNetDevice> m_device; ///< the device
};
}
#endif /* CHANNEL_SCHEDULER_H */
|