This file is indexed.

/usr/include/ns3.27/ns3/channel-manager.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
/* -*- 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_MANAGER_H
#define CHANNEL_MANAGER_H
#include <map>
#include <vector>
#include "ns3/object.h"
#include "ns3/wifi-mode.h"
#include "ns3/wifi-preamble.h"

namespace ns3 {

/**
 * \ingroup wave
 *
 * WAVE channels
 * channel number             |   172   |   174   |   176   |   178   |   180   |   182   |   184   |
 * channel bandwidth          10MHz  10MHz  10MHz  10MHz 10MHz  10MHz  10MHz
 * channel name                      SCH1     SCH2     SCH3     CCH       SCH4     SCH5     SCH6
 * another name                     CH172   CH174   CH176   CH178   CH180  CH182   CH184
 *
 * not support
 * channel 175 : combine channel 174 and 176
 * channel 181 : combine channel 180 and 182
 */
#define CH172 172
#define CH174 174
#define CH176 176
#define CH178 178
#define CH180 180
#define CH182 182
#define CH184 184

#define SCH1 172
#define SCH2 174
#define SCH3 176
#define CCH  178
#define SCH4 180
#define SCH5 182
#define SCH6 184

/**
 * \ingroup wave
 * \brief manage 7 WaveChannels and the tx information such as data rate and txPowerLevel.
 * for transmitting VSA management frames.
 */
class ChannelManager : public Object
{
public:
  /**
   * \brief Get the type ID.
   * \return the object TypeId
   */
  static TypeId GetTypeId (void);
  ChannelManager ();
  virtual ~ChannelManager ();

  /**
   * \return the channel number of WAVE CCH.
   */
  static uint32_t GetCch (void);
  /**
   * \return the channel number set of WAVE SCHs.
   */
  static std::vector<uint32_t> GetSchs (void);
  /**
    * \return the channel number set of WAVE channels.
    *
    * The sequence is CCH, SCH1, SCH2, SCH3, SCH4, SCH5 and SCH6.
    */
  static std::vector<uint32_t> GetWaveChannels (void);
  /**
   * \return the number of WAVE channels.
   */
  static uint32_t GetNumberOfWaveChannels (void);
  /**
   * \param channelNumber the specific channel
   * \return whether channel is valid CCH channel
   */
  static bool IsCch (uint32_t channelNumber);
  /**
   * \param channelNumber the specific channel
   * \return whether channel is valid SCH channel
   */
  static bool IsSch (uint32_t channelNumber);
  /**
   * \param channelNumber the specific channel
   * \return whether channel is valid WAVE channel
   */
  static bool IsWaveChannel (uint32_t channelNumber);

  /**
   * \param channelNumber the specific channel
   * \return the operating class on this channel
   *
   * the operating class is unused in the simulation
   */
  uint32_t GetOperatingClass (uint32_t channelNumber);
  /**
   * \param channelNumber the specific channel
   * \return the adaptable mode for management frames
   */
  bool GetManagementAdaptable (uint32_t channelNumber);
  /**
   * \param channelNumber the specific channel
   * \return the data rate for management frames
   */
  WifiMode GetManagementDataRate (uint32_t channelNumber);
  /**
   * \param channelNumber the specific channel
   * \return the preamble for management frames
   */
  WifiPreamble GetManagementPreamble (uint32_t channelNumber);
  /**
   * \param channelNumber the specific channel
   * \return the tx power level for management frames
   */
  uint32_t GetManagementPowerLevel (uint32_t channelNumber);

private:
  /// 1609.4-2010 Annex H
  static const uint32_t  DEFAULT_OPERATING_CLASS = 17;

  /// WaveChannel structure
  struct WaveChannel
  {
    uint32_t channelNumber; ///< channel number
    uint32_t operatingClass; ///< operating class
    bool adaptable; ///< adaptable?
    WifiMode dataRate; ///< data rate
    WifiPreamble preamble; ///< preamble
    uint32_t txPowerLevel; ///< transmit power level

    /**
     * initializor
     * \param channel the channel number
     */
    WaveChannel (uint32_t channel)
      : channelNumber (channel),
        operatingClass (DEFAULT_OPERATING_CLASS),
        adaptable (true),
        dataRate (WifiMode ("OfdmRate6MbpsBW10MHz")),
        preamble (WIFI_PREAMBLE_LONG),
        txPowerLevel (4)
    {
    }
  };
  std::map<uint32_t, WaveChannel *> m_channels; ///< list of channels
};

}
#endif /* CHANNEL_MANAGER_H */