This file is indexed.

/usr/include/ns3.26/ns3/wimax-net-device.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
313
314
315
316
317
/* -*- 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>
 *          Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
 */

#ifndef WIMAX_NET_DEVICE_H
#define WIMAX_NET_DEVICE_H

#include "ns3/net-device.h"
#include "ns3/event-id.h"
#include "ns3/mac48-address.h"
#include "cid.h"
#include "wimax-connection.h"
#include "cid-factory.h"
#include "mac-messages.h"
#include "dl-mac-messages.h"
#include "ul-mac-messages.h"
#include "ns3/traced-callback.h"
#include "ns3/nstime.h"
#include "ns3/log.h"
#include "wimax-phy.h"
#include "wimax-mac-header.h"

namespace ns3 {

class Node;
class Packet;
class TraceContext;
class TraceResolver;
class Channel;
class WimaxChannel;
class PacketBurst;
class BurstProfileManager;
class ConnectionManager;
class ServiceFlowManager;
class BandwidthManager;
class UplinkScheduler;

/**
 * \defgroup wimax WiMAX Models
 *
 * This section documents the API of the ns-3 wimax module. For a generic functional description, please refer to the ns-3 manual.
 */

/**
 * \brief Hold together all Wimax-related objects in a NetDevice.
 * \ingroup wimax
 *
 * This class holds together ns3::WimaxPhy, ns3::WimaxConnection,
 * ns3::ConectionManager, ns3::BurstProfileManager, and 
 * ns3::BandwidthManager.
 */
class WimaxNetDevice : public NetDevice
{
public:
  enum Direction
  {
    DIRECTION_DOWNLINK, DIRECTION_UPLINK
  };

  enum RangingStatus
  {
    RANGING_STATUS_EXPIRED, RANGING_STATUS_CONTINUE, RANGING_STATUS_ABORT, RANGING_STATUS_SUCCESS
  };

  static TypeId GetTypeId (void);
  WimaxNetDevice (void);
  virtual ~WimaxNetDevice (void);
  /**
   * \param ttg transmit/receive transition gap
   */
  void SetTtg (uint16_t ttg);
  /**
   * \returns transmit/receive transition gap
   */
  uint16_t GetTtg (void) const;
  /**
   * \param rtg receive/transmit transition gap
   */
  void SetRtg (uint16_t rtg);
  /**
   * \returns receive/transmit transition gap
   */
  uint16_t GetRtg (void) const;
  void Attach (Ptr<WimaxChannel> channel);
  /**
   * \param phy the phy layer to use.
   */
  void SetPhy (Ptr<WimaxPhy> phy);
  /**
   * \returns a pointer to the physical layer.
   */
  Ptr<WimaxPhy> GetPhy (void) const;

  /**
   * \param wimaxChannel the channel to be used
   */
  void SetChannel (Ptr<WimaxChannel> wimaxChannel);

  uint64_t GetChannel (uint8_t index) const;

  void SetNrFrames (uint32_t nrFrames);
  uint32_t GetNrFrames (void) const;
  /**
   * \param address the mac address of the net device
   */
  void SetMacAddress (Mac48Address address);
  /**
   * \returns the mac address of the net device
   */
  Mac48Address GetMacAddress (void) const;
  void SetState (uint8_t state);
  uint8_t GetState (void) const;
  /**
   * \returns the initial ranging connection
   */
  Ptr<WimaxConnection> GetInitialRangingConnection (void) const;
  /**
    * \returns the broadcast connection
    */
  Ptr<WimaxConnection> GetBroadcastConnection (void) const;

  void SetCurrentDcd (Dcd dcd);
  Dcd GetCurrentDcd (void) const;
  void SetCurrentUcd (Ucd ucd);
  Ucd GetCurrentUcd (void) const;
  /**
   * \returns the connection manager of the device
   */
  Ptr<ConnectionManager> GetConnectionManager (void) const;

  /**
   * \param  connectionManager the commection manager to be installed in the device
   */
  virtual void SetConnectionManager (Ptr<ConnectionManager> connectionManager );

  /**
   * \returns the burst profile manager currently installed in the device
   */
  Ptr<BurstProfileManager> GetBurstProfileManager (void) const;

  /**
   * \param burstProfileManager the burst profile manager to be installed on the device
   */
  void SetBurstProfileManager (Ptr<BurstProfileManager> burstProfileManager);

  /**
   * \returns the bandwidth manager installed on the device
   */
  Ptr<BandwidthManager> GetBandwidthManager (void) const;

  /**
   * \param bandwidthManager the bandwidth manager to be installed on the device
   */
  void SetBandwidthManager (Ptr<BandwidthManager> bandwidthManager);

  /**
   * \brief Creates the initial ranging and broadcast connections
   */
  void CreateDefaultConnections (void);

  virtual void Start (void) = 0;
  virtual void Stop (void) = 0;

  void SetReceiveCallback (void);

  void ForwardUp (Ptr<Packet> packet, const Mac48Address &source, const Mac48Address &dest);

  virtual bool Enqueue (Ptr<Packet> packet, const MacHeaderType &hdrType, Ptr<WimaxConnection> connection) = 0;
  void ForwardDown (Ptr<PacketBurst> burst, WimaxPhy::ModulationType modulationType);

  // temp, shall be private
  static uint8_t m_direction; // downlink or uplink

  static Time m_frameStartTime; // temp, to determine the frame start time at SS side, shall actually be determined by frame start preamble

  virtual void SetName (const std::string name);
  virtual std::string GetName (void) const;
  virtual void SetIfIndex (const uint32_t index);
  virtual uint32_t GetIfIndex (void) const;
  virtual Ptr<Channel> GetPhyChannel (void) const;
  virtual Ptr<Channel> GetChannel (void) const;
  virtual void SetAddress (Address address);
  virtual Address GetAddress (void) const;
  virtual bool SetMtu (const uint16_t mtu);
  virtual uint16_t GetMtu (void) const;
  virtual bool IsLinkUp (void) const;
  virtual void SetLinkChangeCallback (Callback<void> callback);
  virtual bool IsBroadcast (void) const;
  virtual Address GetBroadcast (void) const;
  virtual bool IsMulticast (void) const;
  virtual Address GetMulticast (void) const;
  virtual Address MakeMulticastAddress (Ipv4Address multicastGroup) const;
  virtual bool IsPointToPoint (void) const;
  virtual bool Send (Ptr<Packet> packet, const Address& dest, uint16_t protocolNumber);
  virtual void SetNode (Ptr<Node> node);
  virtual Ptr<Node> GetNode (void) const;
  virtual bool NeedsArp (void) const;
  virtual void SetReceiveCallback (NetDevice::ReceiveCallback cb);
  virtual void AddLinkChangeCallback (Callback<void> callback);
  virtual bool SendFrom (Ptr<Packet> packet, const Address& source, const Address& dest, uint16_t protocolNumber);
  virtual void SetPromiscReceiveCallback (PromiscReceiveCallback cb);
  NetDevice::PromiscReceiveCallback GetPromiscReceiveCallback (void);
  virtual bool SupportsSendFrom (void) const;

  /**
   * TracedCallback signature for packet and Mac48Address.
   *
   * \param [in] packet The packet.
   * \param [in] mac The Mac48Address.
   * \deprecated The `const Mac48Address &` argument is deprecated
   * and will be changed to \c Mac48Address in a future release.
   * The TracedCallback signature will then match \c Packet::Mac48Address
   * and this typedef can be removed.
   */
  typedef void (* TxRxTracedCallback)
    (Ptr<const Packet> packet, const Mac48Address & mac);
  /**
   * \deprecated The `const Mac48Address &` argument is deprecated
   * and will be changed to \c Mac48Address in a future release.
   * The TracedCallback signature will then match \c Packet::Mac48Address
   * and this typedef can be removed.
   * \todo This member variable should be private.
   */
  TracedCallback<Ptr<const Packet>, const Mac48Address &> m_traceRx;
  /**
   * \deprecated The `const Mac48Address &` argument is deprecated
   * and will be changed to \c Mac48Address in a future release.
   * The TracedCallback signature will then match \c Packet::Mac48Address
   * and this typedef can be removed.
   * \todo This member variable should be private.
   */
  TracedCallback<Ptr<const Packet>, const Mac48Address &> m_traceTx;

  virtual void DoDispose (void);
  virtual Address GetMulticast (Ipv6Address addr) const;
  virtual Address GetMulticast (Ipv4Address multicastGroup) const;
  virtual bool IsBridge (void) const;

  bool IsPromisc (void);
  void NotifyPromiscTrace (Ptr<Packet> p);

private:
  WimaxNetDevice (const WimaxNetDevice &);
  WimaxNetDevice & operator= (const WimaxNetDevice &);

  static const uint16_t MAX_MSDU_SIZE = 1500;
  // recommended by wimax forum.
  static const uint16_t DEFAULT_MSDU_SIZE = 1400;

  virtual bool DoSend (Ptr<Packet> packet,
                       const Mac48Address& source,
                       const Mac48Address& dest,
                       uint16_t protocolNumber) = 0;
  virtual void DoReceive (Ptr<Packet> packet) = 0;
  virtual Ptr<WimaxChannel> DoGetChannel (void) const;
  void Receive (Ptr<const PacketBurst> burst);
  void InitializeChannels (void);

  Ptr<Node> m_node;
  Ptr<WimaxPhy> m_phy;
  NetDevice::ReceiveCallback m_forwardUp;
  NetDevice::PromiscReceiveCallback m_promiscRx;

  uint32_t m_ifIndex;
  std::string m_name;
  bool m_linkUp;
  Callback<void> m_linkChange;
  mutable uint16_t m_mtu;

  // temp, shall be in BS. defined here to allow SS to access. SS shall actually determine it from DLFP, shall be moved to BS after DLFP is implemented
  static uint32_t m_nrFrames;

  // not sure if it shall be included here
  std::vector<uint64_t> m_dlChannels;

  Mac48Address m_address;
  uint8_t m_state;
  uint32_t m_symbolIndex;

  // length of TTG and RTG, in units of PSs
  uint16_t m_ttg;
  uint16_t m_rtg;

  Dcd m_currentDcd;
  Ucd m_currentUcd;

  Ptr<WimaxConnection> m_initialRangingConnection;
  Ptr<WimaxConnection> m_broadcastConnection;

  Ptr<ConnectionManager> m_connectionManager;
  Ptr<BurstProfileManager> m_burstProfileManager;
  Ptr<BandwidthManager> m_bandwidthManager;

  Ptr<Object> m_mobility;

};

} // namespace ns3

#endif /* WIMAX_NET_DEVICE_H */