This file is indexed.

/usr/include/ns3.26/ns3/wimax-helper.h is in libns3-dev 3.26+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
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
 * Copyright (c) 2007,2008, 2009 INRIA, UDCAST
 *
 * 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
 *
 * Authors: Jahanzeb Farooq <jahanzeb.farooq@sophia.inria.fr>
 *          Amine Ismail <amine.ismail@sophia.inria.fr>
 */

#ifndef WIMAX_HELPER_H
#define WIMAX_HELPER_H

#include <string>
#include "ns3/object-factory.h"
#include "ns3/node-container.h"
#include "ns3/net-device-container.h"
#include "ns3/bs-net-device.h"
#include "ns3/ss-net-device.h"
#include "ns3/service-flow.h"
#include "ns3/propagation-loss-model.h"
#include "ns3/simple-ofdm-wimax-channel.h"
#include "ns3/bs-uplink-scheduler.h"
#include "ns3/bs-uplink-scheduler-mbqos.h"
#include "ns3/bs-uplink-scheduler-simple.h"
#include "ns3/bs-uplink-scheduler-rtps.h"
#include "ns3/bs-scheduler.h"
#include "ns3/bs-scheduler-simple.h"
#include "ns3/bs-scheduler-rtps.h"
#include "ns3/trace-helper.h"

namespace ns3 {

class WimaxChannel;
class WimaxPhy;
class UplinkScheduler;


/**
 * \brief helps to manage and create WimaxNetDevice objects
 *
 * This class can help to create a large set of similar
 * WimaxNetDevice objects and to configure their attributes
 * during creation.
 */

class WimaxHelper : public PcapHelperForDevice, public AsciiTraceHelperForDevice
{
public:
  /**
   * Net Device Type
   * Distinguish a subscriber station(SS) device from base station(BS) device
   */
  enum NetDeviceType
  {
    DEVICE_TYPE_SUBSCRIBER_STATION, /**< Subscriber station(SS) device */
    DEVICE_TYPE_BASE_STATION
    /**< Base station(BS) device */
  };

  /**
   * WiMAX Physical layer
   * WiMAX Physical layers with different levels of detail
   */
  enum PhyType
  {
    SIMPLE_PHY_TYPE_OFDM
  };

  /**
   * Scheduler Type
   * Different implementations of uplink/downlink scheduler
   */
  enum SchedulerType
  {
    SCHED_TYPE_SIMPLE, /**< A simple priority-based FCFS scheduler */
    SCHED_TYPE_RTPS, /**< A simple scheduler - rtPS based scheduler */
    SCHED_TYPE_MBQOS
    /**< An migration-based uplink scheduler */

  };
  /**
   * \brief Create a Wimax helper in an empty state.
   */
  WimaxHelper (void);
  ~WimaxHelper (void);
  /**
   *  \brief Enable ascii trace output on the indicated net device for a given connection
   *  \param oss The output stream object to use when logging ascii traces.
   *  \param nodeid the id of the node for which you want to enable tracing.
   *  \param deviceid the id of the net device for which you want to enable tracing.
   *  \param netdevice the type of net device for which you want to enable tracing (SubscriberStationNetDevice,
   *   BaseStationNetDevice or WimaxNetDevice)
   *  \param connection the connection for which you want to enable tracing (InitialRangingConnection,
   *   BroadcastConnection, BasicConnection, PrimaryConnection).
   */
  static void EnableAsciiForConnection (Ptr<OutputStreamWrapper> oss,
                                        uint32_t nodeid,
                                        uint32_t deviceid,
                                        char *netdevice,
                                        char *connection);

  /**
   * \param phyType WiMAX Physical layer type
   * \return WiMAX Phy object
   *
   * Creates a physical layer object to be used in simulation.
   */
  Ptr<WimaxPhy> CreatePhy (PhyType phyType);

  /**
   * \param schedulerType Scheduling mechanism
   * \return Uplink scheduler
   *
   * Creates a uplink scheduler to be used by base station
   * according to selected scheduling mechanism.
   */
  Ptr<UplinkScheduler> CreateUplinkScheduler (SchedulerType schedulerType);

  /**
   * \param schedulerType Scheduling mechanism
   * \return Downlink scheduler
   *
   * Creates a downlink scheduler to be used by base station
   * according to selected scheduling mechanism.
   */
  Ptr<BSScheduler> CreateBSScheduler (SchedulerType schedulerType);

  /**
   * \param c a set of nodes
   * \param type device type to create
   * \param phyType a phy to use
   * \param schedulerType the type of the scheduling algorithm to install
   *
   * For each of the input nodes, a new WiMAX net device (either
   * ns3::SubscriberStationNetDevice or ns3::BaseStationNetDevice
   * depending on the type parameter) is attached to the shared input channel.
   */
  NetDeviceContainer Install (NodeContainer c, NetDeviceType type, PhyType phyType, SchedulerType schedulerType);

  /**
   * \param c A set of nodes.
   * \param deviceType Device type to create.
   * \param phyType PHY type to create.
   * \param channel A channel to use.
   * \param schedulerType The scheduling mechanism.
   *
   * For each of the input nodes, a new WiMAX net device (either
   * ns3::SubscriberStationNetDevice or ns3::BaseStationNetDevice
   * depending on the type parameter) is attached to the shared input channel.
   */
  NetDeviceContainer Install (NodeContainer c,
                              NetDeviceType deviceType,
                              PhyType phyType,
                              Ptr<WimaxChannel> channel,
                              SchedulerType schedulerType);
  /**
   * \param c A set of nodes.
   * \param deviceType Device type to create.
   * \param phyType PHY type to create.
   * \param schedulerType The scheduling mechanism.
   * \param frameDuration the farme duration in seconds
   *
   * For each of the input nodes, a new WiMAX net device (either
   * ns3::SubscriberStationNetDevice or ns3::BaseStationNetDevice
   * depending on the type parameter) is attached to the shared input channel.
   */
  NetDeviceContainer Install (NodeContainer c,
                              NetDeviceType deviceType,
                              PhyType phyType,
                              SchedulerType schedulerType,
                              double frameDuration);

  /**
   * \brief Set the propagation and loss model of the channel. By default the channel
   *  uses a COST231 propagation and loss model.
   * \param propagationModel The propagation and loss model to set
   */
  void SetPropagationLossModel (SimpleOfdmWimaxChannel::PropModel propagationModel);

  /**
   * \param phyType WiMAX Physical layer type
   * \return WiMAX Phy object
   *
   * Creates a physical layer without a channel
   */
  Ptr<WimaxPhy> CreatePhyWithoutChannel (PhyType phyType);

  /**
   * \param phyType WiMAX Physical layer type
   * \param SNRTraceFilePath of the repository containing the SNR traces files
   * \param activateLoss set to 1 to activate losses 0 otherwise
   * \return WiMAX Phy object
   *
   * Creates a physical layer without creating a channel
   */
  Ptr<WimaxPhy> CreatePhyWithoutChannel (PhyType phyType, char * SNRTraceFilePath, bool activateLoss);

  /**
   * \param phyType WiMAX Physical layer type
   * \param SNRTraceFilePath the path to the repository containing the SNR traces files
   * \param activateLoss set to 1 if you want ton activate losses 0 otherwise
   * \return WiMAX Phy object
   *
   * Creates a physical layer
   */
  Ptr<WimaxPhy> CreatePhy (PhyType phyType, char * SNRTraceFilePath, bool activateLoss);
  /**
   * \param node Node to be installed.
   * \param deviceType Device type to create.
   * \param phyType PHY type to create.
   * \param channel A channel to use.
   * \param schedulerType The scheduling mechanism to install on the device.
   *
   * For each of the input nodes, a new WiMAX net device (either
   * ns3::SubscriberStationNetDevice or ns3::BaseStationNetDevice
   * depending on the type parameter) is attached to the shared input channel.
   */
  Ptr<WimaxNetDevice> Install (Ptr<Node> node,
                               NetDeviceType deviceType,
                               PhyType phyType,
                               Ptr<WimaxChannel> channel,
                               SchedulerType schedulerType);

  /**
   * \brief Creates a transport service flow.
   * \param direction the direction of the service flow: UP or DOWN.
   * \param schedulinType The service scheduling type to be used: UGS, RTPS, NRTPS, BE
   * \param classifier The classifier to be used for this service flow
   *
   */
  ServiceFlow CreateServiceFlow (ServiceFlow::Direction direction,
                                 ServiceFlow::SchedulingType schedulinType,
                                 IpcsClassifierRecord classifier);

  /**
   * Helper to enable all WimaxNetDevice log components with one statement
   */
  static void EnableLogComponents (void);

 /**
  * Assign a fixed random variable stream number to the random variables
  * used by this model.  Return the number of streams (possibly zero) that
  * have been assigned.
  *
  * \param stream first stream index to use
  * \return the number of stream indices assigned by this model
  */
  int64_t AssignStreams (int64_t stream);

  /**
  * Assign a fixed random variable stream number to the random variables
  * used by this model. Return the number of streams (possibly zero) that
  * have been assigned. The Install() method should have previously been
  * called by the user.
  *
  * \param c NetDeviceContainer of the set of net devices for which the 
  *          WimaxNetDevice should be modified to use a fixed stream
  * \param stream first stream index to use
  * \return the number of stream indices assigned by this helper
  */
  int64_t AssignStreams (NetDeviceContainer c, int64_t stream);

private:
  static void AsciiRxEvent (Ptr<OutputStreamWrapper> stream, std::string path, Ptr<const Packet> packet, const Mac48Address &source);
  static void AsciiTxEvent (Ptr<OutputStreamWrapper> stream, std::string path, Ptr<const Packet> packet, const Mac48Address &dest);
  /**
   * \brief Enable pcap output on the indicated net device.
   *
   * NetDevice-specific implementation mechanism for hooking the trace and
   * writing to the trace file.
   *
   * \param prefix Filename prefix to use for pcap files.
   * \param nd Net device for which you want to enable tracing.
   * \param explicitFilename Treat the prefix as an explicit filename if true
   * \param promiscuous If true capture all possible packets available at the device.
   */
  virtual void EnablePcapInternal (std::string prefix, Ptr<NetDevice> nd, bool explicitFilename, bool promiscuous);

  /**
   * \brief Enable ascii trace output on the indicated net device.
   *
   * NetDevice-specific implementation mechanism for hooking the trace and
   * writing to the trace file.
   *
   * \param stream The output stream object to use when logging ascii traces.
   * \param prefix Filename prefix to use for ascii trace files.
   * \param nd Net device for which you want to enable tracing.
   * \param explicitFilename Treat the prefix as an explicit filename if true
   */
  virtual void EnableAsciiInternal (Ptr<OutputStreamWrapper> stream,
                                    std::string prefix,
                                    Ptr<NetDevice> nd,
                                    bool explicitFilename);

  Ptr<WimaxChannel> m_channel;
};

} // namespace ns3

#endif /* WIMAX_HELPER_H */