View | Details | Raw Unified | Return to bug 938
Collapse All | Expand All

(-)a/doc/doxygen.conf (-9 / +36 lines)
 Lines 25-31    Link Here 
25
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
25
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
26
# by quotes) that should identify the project.
26
# by quotes) that should identify the project.
27
27
28
PROJECT_NAME           = "NS-3 "
28
PROJECT_NAME           = "ns-3 "
29
29
30
# The PROJECT_NUMBER tag can be used to enter a project or revision number.
30
# The PROJECT_NUMBER tag can be used to enter a project or revision number.
31
# This could be handy for archiving the generated documentation or
31
# This could be handy for archiving the generated documentation or
 Lines 590-597    Link Here 
590
# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
590
# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
591
591
592
FILE_PATTERNS          = *.h \
592
FILE_PATTERNS          = *.h \
593
                         *.tcc \
593
                         *.cc
594
                         node-list.cc
595
594
596
# The RECURSIVE tag can be used to turn specify whether or not subdirectories
595
# The RECURSIVE tag can be used to turn specify whether or not subdirectories
597
# should be searched for input files as well. Possible values are YES and NO.
596
# should be searched for input files as well. Possible values are YES and NO.
 Lines 603-613    Link Here 
603
# excluded from the INPUT source files. This way you can easily exclude a
602
# excluded from the INPUT source files. This way you can easily exclude a
604
# subdirectory from a directory tree whose root is specified with the INPUT tag.
603
# subdirectory from a directory tree whose root is specified with the INPUT tag.
605
604
606
EXCLUDE                = src/olsr/model/olsr-state.h \
605
EXCLUDE                =
607
                         src/olsr/model/olsr-repositories.h \
608
                         src/core/model/high-precision.h \
609
                         src/core/model/high-precision-128.h \
610
                         src/core/model/high-precision-double.h
611
606
612
# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
607
# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
613
# directories that are symbolic links (a Unix filesystem feature) are excluded
608
# directories that are symbolic links (a Unix filesystem feature) are excluded
 Lines 635-641    Link Here 
635
# directories that contain example code fragments that are included (see
630
# directories that contain example code fragments that are included (see
636
# the \include command).
631
# the \include command).
637
632
638
EXAMPLE_PATH           = 
633
EXAMPLE_PATH           = src/aodv/examples \
634
                         src/bridge/examples \
635
                         src/click/examples \
636
                         src/config-store/examples \
637
                         src/core/examples \
638
                         src/csma/examples \
639
                         src/csma-layout/examples \
640
                         src/dsdv/examples \
641
                         src/emu/examples \
642
                         src/energy/examples \
643
                         src/flow-monitor/examples \
644
                         src/internet/examples \
645
                         src/lte/examples \
646
                         src/mesh/examples \
647
                         src/mobility/examples \
648
                         src/mpi/examples \
649
                         src/netanim/examples \
650
                         src/network/examples \
651
                         src/nix-vector-routing/examples \
652
                         src/olsr/examples \
653
                         src/openflow/examples \
654
                         src/point-to-point/examples \
655
                         src/propagation/examples \
656
                         src/spectrum/examples \
657
                         src/tap-bridge/examples \
658
                         src/template/examples \
659
                         src/tools/examples \
660
                         src/topology-read/examples \
661
                         src/uan/examples \
662
                         src/virtual-net-device/examples \
663
                         src/visualizer/examples \
664
                         src/wifi/examples \
665
                         src/wimax/examples
639
666
640
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
667
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
641
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
668
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
(-)a/src/click/helper/click-internet-stack-helper.h (-11 / +11 lines)
 Lines 157-168    Link Here 
157
  void SetRoutingTableElement (Ptr<Node> node, std::string rt);
157
  void SetRoutingTableElement (Ptr<Node> node, std::string rt);
158
private:
158
private:
159
  /**
159
  /**
160
   * @brief Enable pcap output the indicated Ipv4 and interface pair.
160
   * \brief Enable pcap output the indicated Ipv4 and interface pair.
161
   * @internal
161
   * \internal
162
   *
162
   *
163
   * @param prefix Filename prefix to use for pcap files.
163
   * \param prefix Filename prefix to use for pcap files.
164
   * @param ipv4 Ptr to the Ipv4 interface on which you want to enable tracing.
164
   * \param ipv4 Ptr to the Ipv4 interface on which you want to enable tracing.
165
   * @param interface Interface ID on the Ipv4 on which you want to enable tracing.
165
   * \param interface Interface ID on the Ipv4 on which you want to enable tracing.
166
   */
166
   */
167
  virtual void EnablePcapIpv4Internal (std::string prefix,
167
  virtual void EnablePcapIpv4Internal (std::string prefix,
168
                                       Ptr<Ipv4> ipv4,
168
                                       Ptr<Ipv4> ipv4,
 Lines 170-183    Link Here 
170
                                       bool explicitFilename);
170
                                       bool explicitFilename);
171
171
172
  /**
172
  /**
173
   * @brief Enable ascii trace output on the indicated Ipv4 and interface pair.
173
   * \brief Enable ascii trace output on the indicated Ipv4 and interface pair.
174
   * @internal
174
   * \internal
175
   *
175
   *
176
   * @param stream An OutputStreamWrapper representing an existing file to use
176
   * \param stream An OutputStreamWrapper representing an existing file to use
177
   *               when writing trace data.
177
   *               when writing trace data.
178
   * @param prefix Filename prefix to use for ascii trace files.
178
   * \param prefix Filename prefix to use for ascii trace files.
179
   * @param ipv4 Ptr to the Ipv4 interface on which you want to enable tracing.
179
   * \param ipv4 Ptr to the Ipv4 interface on which you want to enable tracing.
180
   * @param interface Interface ID on the Ipv4 on which you want to enable tracing.
180
   * \param interface Interface ID on the Ipv4 on which you want to enable tracing.
181
   */
181
   */
182
  virtual void EnableAsciiIpv4Internal (Ptr<OutputStreamWrapper> stream,
182
  virtual void EnableAsciiIpv4Internal (Ptr<OutputStreamWrapper> stream,
183
                                        std::string prefix,
183
                                        std::string prefix,
(-)a/src/core/model/cairo-wideint.c (-1 / +1 lines)
 Lines 659-665    Link Here 
659
 * dividend and 64 bit divisor.  If the quotient doesn't fit into 32
659
 * dividend and 64 bit divisor.  If the quotient doesn't fit into 32
660
 * bits then the returned remainder is equal to the divisor, and the
660
 * bits then the returned remainder is equal to the divisor, and the
661
 * quotient is the largest representable 64 bit integer.  It is an
661
 * quotient is the largest representable 64 bit integer.  It is an
662
 * error to call this function with the high 32 bits of @num being
662
 * error to call this function with the high 32 bits of \num being
663
 * non-zero. */
663
 * non-zero. */
664
cairo_uquorem64_t
664
cairo_uquorem64_t
665
_cairo_uint_96by64_32x64_divrem (cairo_uint128_t num,
665
_cairo_uint_96by64_32x64_divrem (cairo_uint128_t num,
(-)a/src/core/model/command-line.h (-3 / +9 lines)
 Lines 37-45    Link Here 
37
 * CommandLine::AddValue but the most important functionality
37
 * CommandLine::AddValue but the most important functionality
38
 * provided by this class is that it can be used to set the
38
 * provided by this class is that it can be used to set the
39
 * 'initial value' of every attribute in the system with the
39
 * 'initial value' of every attribute in the system with the
40
 * '\--TypeIdName::AttributeName=value' syntax and it can be used
40
 * \verbatim
41
 * to set the value of every GlobalValue in the system with
41
 *   --TypeIdName::AttributeName=value
42
 * the \--GlobalValueName=value syntax.
42
 * \endverbatim
43
 * syntax and it can be used to set the value of every GlobalValue
44
 * in the system with the
45
 * \verbatim
46
 *   --GlobalValueName=value
47
 * \endverbatim
48
 * syntax.
43
 */
49
 */
44
class CommandLine
50
class CommandLine
45
{
51
{
(-)a/src/core/model/global-value.h (-5 / +5 lines)
 Lines 121-130    Link Here 
121
  /** 
121
  /** 
122
   * finds the GlobalValue with the given name and returns its value
122
   * finds the GlobalValue with the given name and returns its value
123
   * 
123
   * 
124
   * @param name the name of the GlobalValue to be found
124
   * \param name the name of the GlobalValue to be found
125
   * @param value where to store the value of the found GlobalValue
125
   * \param value where to store the value of the found GlobalValue
126
   * 
126
   * 
127
   * @return true if the GlobalValue was found, false otherwise
127
   * \return true if the GlobalValue was found, false otherwise
128
   */
128
   */
129
  static bool GetValueByNameFailSafe (std::string name, AttributeValue &value);
129
  static bool GetValueByNameFailSafe (std::string name, AttributeValue &value);
130
130
 Lines 133-140    Link Here 
133
   * value. This method cannot fail, i.e., it will trigger a
133
   * value. This method cannot fail, i.e., it will trigger a
134
   * NS_FATAL_ERROR if the requested GlobalValue is not found.
134
   * NS_FATAL_ERROR if the requested GlobalValue is not found.
135
   * 
135
   * 
136
   * @param name the name of the GlobalValue to be found
136
   * \param name the name of the GlobalValue to be found
137
   * @param value where to store the value of the found GlobalValue
137
   * \param value where to store the value of the found GlobalValue
138
   * 
138
   * 
139
   */
139
   */
140
  static void GetValueByName (std::string name, AttributeValue &value);
140
  static void GetValueByName (std::string name, AttributeValue &value);
(-)a/src/core/model/names.cc (-2 / +2 lines)
 Lines 463-470    Link Here 
463
  NameNode *node = &m_root;
463
  NameNode *node = &m_root;
464
464
465
  //
465
  //
466
  // The string <remaining> is now composed entirely of path segments in the
466
  // The string <remaining> is now composed entirely of path segments in
467
  // /Names name space and we have eaten the leading slash. e.g., 
467
  // the /Names name space and we have eaten the leading slash. e.g., 
468
  // remaining = "ClientNode/eth0"
468
  // remaining = "ClientNode/eth0"
469
  //
469
  //
470
  // The start of the search is always at the root of the name space.
470
  // The start of the search is always at the root of the name space.
(-)a/src/core/model/nstime.h (-8 / +10 lines)
 Lines 256-262    Link Here 
256
  }
256
  }
257
257
258
  /**
258
  /**
259
   * \returns an approximation in seconds of the time stored in this
259
   * \return an approximation in seconds of the time stored in this
260
   *          instance.
260
   *          instance.
261
   */
261
   */
262
  inline double GetSeconds (void) const
262
  inline double GetSeconds (void) const
 Lines 265-271    Link Here 
265
  }
265
  }
266
266
267
  /**
267
  /**
268
   * \returns an approximation in milliseconds of the time stored in this
268
   * \return an approximation in milliseconds of the time stored in this
269
   *          instance.
269
   *          instance.
270
   */
270
   */
271
  inline int64_t GetMilliSeconds (void) const
271
  inline int64_t GetMilliSeconds (void) const
 Lines 273-279    Link Here 
273
    return ToInteger (Time::MS);
273
    return ToInteger (Time::MS);
274
  }
274
  }
275
  /**
275
  /**
276
   * \returns an approximation in microseconds of the time stored in this
276
   * \return an approximation in microseconds of the time stored in this
277
   *          instance.
277
   *          instance.
278
   */
278
   */
279
  inline int64_t GetMicroSeconds (void) const
279
  inline int64_t GetMicroSeconds (void) const
 Lines 281-287    Link Here 
281
    return ToInteger (Time::US);
281
    return ToInteger (Time::US);
282
  }
282
  }
283
  /**
283
  /**
284
   * \returns an approximation in nanoseconds of the time stored in this
284
   * \return an approximation in nanoseconds of the time stored in this
285
   *          instance.
285
   *          instance.
286
   */
286
   */
287
  inline int64_t GetNanoSeconds (void) const
287
  inline int64_t GetNanoSeconds (void) const
 Lines 289-295    Link Here 
289
    return ToInteger (Time::NS);
289
    return ToInteger (Time::NS);
290
  }
290
  }
291
  /**
291
  /**
292
   * \returns an approximation in picoseconds of the time stored in this
292
   * \return an approximation in picoseconds of the time stored in this
293
   *          instance.
293
   *          instance.
294
   */
294
   */
295
  inline int64_t GetPicoSeconds (void) const
295
  inline int64_t GetPicoSeconds (void) const
 Lines 297-303    Link Here 
297
    return ToInteger (Time::PS);
297
    return ToInteger (Time::PS);
298
  }
298
  }
299
  /**
299
  /**
300
   * \returns an approximation in femtoseconds of the time stored in this
300
   * \return an approximation in femtoseconds of the time stored in this
301
   *          instance.
301
   *          instance.
302
   */
302
   */
303
  inline int64_t GetFemtoSeconds (void) const
303
  inline int64_t GetFemtoSeconds (void) const
 Lines 305-311    Link Here 
305
    return ToInteger (Time::FS);
305
    return ToInteger (Time::FS);
306
  }
306
  }
307
  /**
307
  /**
308
   * \returns an approximation of the time stored in this
308
   * \return an approximation of the time stored in this
309
   *          instance in the units specified in m_tsPrecision.
309
   *          instance in the units specified in m_tsPrecision.
310
   */
310
   */
311
  inline int64_t GetTimeStep (void) const
311
  inline int64_t GetTimeStep (void) const
 Lines 331-337    Link Here 
331
   */
331
   */
332
  static void SetResolution (enum Unit resolution);
332
  static void SetResolution (enum Unit resolution);
333
  /**
333
  /**
334
   * \returns the current global resolution.
334
   * \return the current global resolution.
335
   */
335
   */
336
  static enum Unit GetResolution (void);
336
  static enum Unit GetResolution (void);
337
  /**
337
  /**
 Lines 359-364    Link Here 
359
  }
359
  }
360
  /**
360
  /**
361
   * \param timeUnit the unit of the value to return
361
   * \param timeUnit the unit of the value to return
362
   * \return int64_t time value
362
   *
363
   *
363
   * Convert the input time into an integer value according to the requested
364
   * Convert the input time into an integer value according to the requested
364
   * time unit.
365
   * time unit.
 Lines 390-395    Link Here 
390
  }
391
  }
391
  /**
392
  /**
392
   * \param timeUnit the unit of the value to return
393
   * \param timeUnit the unit of the value to return
394
   * \return double time value
393
   *
395
   *
394
   * Convert the input time into a floating point value according to the requested
396
   * Convert the input time into a floating point value according to the requested
395
   * time unit.
397
   * time unit.
(-)a/src/core/model/random-variable.h (-1 / +1 lines)
 Lines 91-97    Link Here 
91
  static void SetRun (uint32_t run);
91
  static void SetRun (uint32_t run);
92
  /**
92
  /**
93
   * \returns the current run number
93
   * \returns the current run number
94
   * @sa SetRun
94
   * \sa SetRun
95
   */
95
   */
96
  static uint32_t GetRun (void);
96
  static uint32_t GetRun (void);
97
97
(-)a/src/core/model/simulator-impl.h (-5 / +5 lines)
 Lines 71-77    Link Here 
71
   * expiration time of the next event to be processed is greater than
71
   * expiration time of the next event to be processed is greater than
72
   * or equal to the stop time.  The stop time is relative to the
72
   * or equal to the stop time.  The stop time is relative to the
73
   * current simulation time.
73
   * current simulation time.
74
   * @param time the stop time, relative to the current time.
74
   * \param time the stop time, relative to the current time.
75
   */
75
   */
76
  virtual void Stop (Time const &time) = 0;
76
  virtual void Stop (Time const &time) = 0;
77
  /**
77
  /**
 Lines 118-124    Link Here 
118
   * Note that it is not possible to remove events which were scheduled
118
   * Note that it is not possible to remove events which were scheduled
119
   * for the "destroy" time. Doing so will result in a program error (crash).
119
   * for the "destroy" time. Doing so will result in a program error (crash).
120
   *
120
   *
121
   * @param ev the event to remove from the list of scheduled events.
121
   * \param ev the event to remove from the list of scheduled events.
122
   */
122
   */
123
  virtual void Remove (const EventId &ev) = 0;
123
  virtual void Remove (const EventId &ev) = 0;
124
  /**
124
  /**
 Lines 131-137    Link Here 
131
   * Note that it is not possible to cancel events which were scheduled
131
   * Note that it is not possible to cancel events which were scheduled
132
   * for the "destroy" time. Doing so will result in a program error (crash).
132
   * for the "destroy" time. Doing so will result in a program error (crash).
133
   * 
133
   * 
134
   * @param ev the event to cancel
134
   * \param ev the event to cancel
135
   */
135
   */
136
  virtual void Cancel (const EventId &ev) = 0;
136
  virtual void Cancel (const EventId &ev) = 0;
137
  /**
137
  /**
 Lines 143-150    Link Here 
143
   * which means that if the code executed by the event calls
143
   * which means that if the code executed by the event calls
144
   * this function, it will get true.
144
   * this function, it will get true.
145
   *
145
   *
146
   * @param ev the event to test for expiration
146
   * \param ev the event to test for expiration
147
   * @returns true if the event has expired, false otherwise.
147
   * \returns true if the event has expired, false otherwise.
148
   */
148
   */
149
  virtual bool IsExpired (const EventId &ev) const = 0;
149
  virtual bool IsExpired (const EventId &ev) const = 0;
150
  /**
150
  /**
(-)a/src/core/model/simulator.h (-245 / +245 lines)
 Lines 135-141    Link Here 
135
   * expiration time of the next event to be processed is greater than
135
   * expiration time of the next event to be processed is greater than
136
   * or equal to the stop time.  The stop time is relative to the
136
   * or equal to the stop time.  The stop time is relative to the
137
   * current simulation time.
137
   * current simulation time.
138
   * @param time the stop time, relative to the current time.
138
   * \param time the stop time, relative to the current time.
139
   */
139
   */
140
  static void Stop (Time const &time);
140
  static void Stop (Time const &time);
141
141
 Lines 148-283    Link Here 
148
   * When the event expires (when it becomes due to be run), the 
148
   * When the event expires (when it becomes due to be run), the 
149
   * input method will be invoked on the input object.
149
   * input method will be invoked on the input object.
150
   *
150
   *
151
   * @param time the relative expiration time of the event.
151
   * \param time the relative expiration time of the event.
152
   * @param mem_ptr member method pointer to invoke
152
   * \param mem_ptr member method pointer to invoke
153
   * @param obj the object on which to invoke the member method
153
   * \param obj the object on which to invoke the member method
154
   * @returns an id for the scheduled event.
154
   * \returns an id for the scheduled event.
155
   */
155
   */
156
  template <typename MEM, typename OBJ>
156
  template <typename MEM, typename OBJ>
157
  static EventId Schedule (Time const &time, MEM mem_ptr, OBJ obj);
157
  static EventId Schedule (Time const &time, MEM mem_ptr, OBJ obj);
158
158
159
  /**
159
  /**
160
   * @param time the relative expiration time of the event.
160
   * \param time the relative expiration time of the event.
161
   * @param mem_ptr member method pointer to invoke
161
   * \param mem_ptr member method pointer to invoke
162
   * @param obj the object on which to invoke the member method
162
   * \param obj the object on which to invoke the member method
163
   * @param a1 the first argument to pass to the invoked method
163
   * \param a1 the first argument to pass to the invoked method
164
   * @returns an id for the scheduled event.
164
   * \returns an id for the scheduled event.
165
   */
165
   */
166
  template <typename MEM, typename OBJ, typename T1>
166
  template <typename MEM, typename OBJ, typename T1>
167
  static EventId Schedule (Time const &time, MEM mem_ptr, OBJ obj, T1 a1);
167
  static EventId Schedule (Time const &time, MEM mem_ptr, OBJ obj, T1 a1);
168
168
169
  /**
169
  /**
170
   * @param time the relative expiration time of the event.
170
   * \param time the relative expiration time of the event.
171
   * @param mem_ptr member method pointer to invoke
171
   * \param mem_ptr member method pointer to invoke
172
   * @param obj the object on which to invoke the member method
172
   * \param obj the object on which to invoke the member method
173
   * @param a1 the first argument to pass to the invoked method
173
   * \param a1 the first argument to pass to the invoked method
174
   * @param a2 the second argument to pass to the invoked method
174
   * \param a2 the second argument to pass to the invoked method
175
   * @returns an id for the scheduled event.
175
   * \returns an id for the scheduled event.
176
   */
176
   */
177
  template <typename MEM, typename OBJ, typename T1, typename T2>
177
  template <typename MEM, typename OBJ, typename T1, typename T2>
178
  static EventId Schedule (Time const &time, MEM mem_ptr, OBJ obj, T1 a1, T2 a2);
178
  static EventId Schedule (Time const &time, MEM mem_ptr, OBJ obj, T1 a1, T2 a2);
179
179
180
  /**
180
  /**
181
   * @param time the relative expiration time of the event.
181
   * \param time the relative expiration time of the event.
182
   * @param mem_ptr member method pointer to invoke
182
   * \param mem_ptr member method pointer to invoke
183
   * @param obj the object on which to invoke the member method
183
   * \param obj the object on which to invoke the member method
184
   * @param a1 the first argument to pass to the invoked method
184
   * \param a1 the first argument to pass to the invoked method
185
   * @param a2 the second argument to pass to the invoked method
185
   * \param a2 the second argument to pass to the invoked method
186
   * @param a3 the third argument to pass to the invoked method
186
   * \param a3 the third argument to pass to the invoked method
187
   * @returns an id for the scheduled event.
187
   * \returns an id for the scheduled event.
188
   */
188
   */
189
  template <typename MEM, typename OBJ, 
189
  template <typename MEM, typename OBJ, 
190
            typename T1, typename T2, typename T3>
190
            typename T1, typename T2, typename T3>
191
  static EventId Schedule (Time const &time, MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3);
191
  static EventId Schedule (Time const &time, MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3);
192
192
193
  /**
193
  /**
194
   * @param time the relative expiration time of the event.
194
   * \param time the relative expiration time of the event.
195
   * @param mem_ptr member method pointer to invoke
195
   * \param mem_ptr member method pointer to invoke
196
   * @param obj the object on which to invoke the member method
196
   * \param obj the object on which to invoke the member method
197
   * @param a1 the first argument to pass to the invoked method
197
   * \param a1 the first argument to pass to the invoked method
198
   * @param a2 the second argument to pass to the invoked method
198
   * \param a2 the second argument to pass to the invoked method
199
   * @param a3 the third argument to pass to the invoked method
199
   * \param a3 the third argument to pass to the invoked method
200
   * @param a4 the fourth argument to pass to the invoked method
200
   * \param a4 the fourth argument to pass to the invoked method
201
   * @returns an id for the scheduled event.
201
   * \returns an id for the scheduled event.
202
   */
202
   */
203
  template <typename MEM, typename OBJ, 
203
  template <typename MEM, typename OBJ, 
204
            typename T1, typename T2, typename T3, typename T4>
204
            typename T1, typename T2, typename T3, typename T4>
205
  static EventId Schedule (Time const &time, MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3, T4 a4);
205
  static EventId Schedule (Time const &time, MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3, T4 a4);
206
206
207
  /**
207
  /**
208
   * @param time the relative expiration time of the event.
208
   * \param time the relative expiration time of the event.
209
   * @param mem_ptr member method pointer to invoke
209
   * \param mem_ptr member method pointer to invoke
210
   * @param obj the object on which to invoke the member method
210
   * \param obj the object on which to invoke the member method
211
   * @param a1 the first argument to pass to the invoked method
211
   * \param a1 the first argument to pass to the invoked method
212
   * @param a2 the second argument to pass to the invoked method
212
   * \param a2 the second argument to pass to the invoked method
213
   * @param a3 the third argument to pass to the invoked method
213
   * \param a3 the third argument to pass to the invoked method
214
   * @param a4 the fourth argument to pass to the invoked method
214
   * \param a4 the fourth argument to pass to the invoked method
215
   * @param a5 the fifth argument to pass to the invoked method
215
   * \param a5 the fifth argument to pass to the invoked method
216
   * @returns an id for the scheduled event.
216
   * \returns an id for the scheduled event.
217
   */
217
   */
218
  template <typename MEM, typename OBJ, 
218
  template <typename MEM, typename OBJ, 
219
            typename T1, typename T2, typename T3, typename T4, typename T5>
219
            typename T1, typename T2, typename T3, typename T4, typename T5>
220
  static EventId Schedule (Time const &time, MEM mem_ptr, OBJ obj, 
220
  static EventId Schedule (Time const &time, MEM mem_ptr, OBJ obj, 
221
                           T1 a1, T2 a2, T3 a3, T4 a4, T5 a5);
221
                           T1 a1, T2 a2, T3 a3, T4 a4, T5 a5);
222
  /**
222
  /**
223
   * @param time the relative expiration time of the event.
223
   * \param time the relative expiration time of the event.
224
   * @param f the function to invoke
224
   * \param f the function to invoke
225
   * @returns an id for the scheduled event.
225
   * \returns an id for the scheduled event.
226
   */
226
   */
227
  static EventId Schedule (Time const &time, void (*f)(void));
227
  static EventId Schedule (Time const &time, void (*f)(void));
228
228
229
  /**
229
  /**
230
   * @param time the relative expiration time of the event.
230
   * \param time the relative expiration time of the event.
231
   * @param f the function to invoke
231
   * \param f the function to invoke
232
   * @param a1 the first argument to pass to the function to invoke
232
   * \param a1 the first argument to pass to the function to invoke
233
   * @returns an id for the scheduled event.
233
   * \returns an id for the scheduled event.
234
   */
234
   */
235
  template <typename U1, typename T1>
235
  template <typename U1, typename T1>
236
  static EventId Schedule (Time const &time, void (*f)(U1), T1 a1);
236
  static EventId Schedule (Time const &time, void (*f)(U1), T1 a1);
237
237
238
  /**
238
  /**
239
   * @param time the relative expiration time of the event.
239
   * \param time the relative expiration time of the event.
240
   * @param f the function to invoke
240
   * \param f the function to invoke
241
   * @param a1 the first argument to pass to the function to invoke
241
   * \param a1 the first argument to pass to the function to invoke
242
   * @param a2 the second argument to pass to the function to invoke
242
   * \param a2 the second argument to pass to the function to invoke
243
   * @returns an id for the scheduled event.
243
   * \returns an id for the scheduled event.
244
   */
244
   */
245
  template <typename U1, typename U2, typename T1, typename T2>
245
  template <typename U1, typename U2, typename T1, typename T2>
246
  static EventId Schedule (Time const &time, void (*f)(U1,U2), T1 a1, T2 a2);
246
  static EventId Schedule (Time const &time, void (*f)(U1,U2), T1 a1, T2 a2);
247
247
248
  /**
248
  /**
249
   * @param time the relative expiration time of the event.
249
   * \param time the relative expiration time of the event.
250
   * @param f the function to invoke
250
   * \param f the function to invoke
251
   * @param a1 the first argument to pass to the function to invoke
251
   * \param a1 the first argument to pass to the function to invoke
252
   * @param a2 the second argument to pass to the function to invoke
252
   * \param a2 the second argument to pass to the function to invoke
253
   * @param a3 the third argument to pass to the function to invoke
253
   * \param a3 the third argument to pass to the function to invoke
254
   * @returns an id for the scheduled event.
254
   * \returns an id for the scheduled event.
255
   */
255
   */
256
  template <typename U1, typename U2, typename U3, typename T1, typename T2, typename T3>
256
  template <typename U1, typename U2, typename U3, typename T1, typename T2, typename T3>
257
  static EventId Schedule (Time const &time, void (*f)(U1,U2,U3), T1 a1, T2 a2, T3 a3);
257
  static EventId Schedule (Time const &time, void (*f)(U1,U2,U3), T1 a1, T2 a2, T3 a3);
258
258
259
  /**
259
  /**
260
   * @param time the relative expiration time of the event.
260
   * \param time the relative expiration time of the event.
261
   * @param f the function to invoke
261
   * \param f the function to invoke
262
   * @param a1 the first argument to pass to the function to invoke
262
   * \param a1 the first argument to pass to the function to invoke
263
   * @param a2 the second argument to pass to the function to invoke
263
   * \param a2 the second argument to pass to the function to invoke
264
   * @param a3 the third argument to pass to the function to invoke
264
   * \param a3 the third argument to pass to the function to invoke
265
   * @param a4 the fourth argument to pass to the function to invoke
265
   * \param a4 the fourth argument to pass to the function to invoke
266
   * @returns an id for the scheduled event.
266
   * \returns an id for the scheduled event.
267
   */
267
   */
268
  template <typename U1, typename U2, typename U3, typename U4, 
268
  template <typename U1, typename U2, typename U3, typename U4, 
269
            typename T1, typename T2, typename T3, typename T4>
269
            typename T1, typename T2, typename T3, typename T4>
270
  static EventId Schedule (Time const &time, void (*f)(U1,U2,U3,U4), T1 a1, T2 a2, T3 a3, T4 a4);
270
  static EventId Schedule (Time const &time, void (*f)(U1,U2,U3,U4), T1 a1, T2 a2, T3 a3, T4 a4);
271
271
272
  /**
272
  /**
273
   * @param time the relative expiration time of the event.
273
   * \param time the relative expiration time of the event.
274
   * @param f the function to invoke
274
   * \param f the function to invoke
275
   * @param a1 the first argument to pass to the function to invoke
275
   * \param a1 the first argument to pass to the function to invoke
276
   * @param a2 the second argument to pass to the function to invoke
276
   * \param a2 the second argument to pass to the function to invoke
277
   * @param a3 the third argument to pass to the function to invoke
277
   * \param a3 the third argument to pass to the function to invoke
278
   * @param a4 the fourth argument to pass to the function to invoke
278
   * \param a4 the fourth argument to pass to the function to invoke
279
   * @param a5 the fifth argument to pass to the function to invoke
279
   * \param a5 the fifth argument to pass to the function to invoke
280
   * @returns an id for the scheduled event.
280
   * \returns an id for the scheduled event.
281
   */
281
   */
282
  template <typename U1, typename U2, typename U3, typename U4, typename U5,
282
  template <typename U1, typename U2, typename U3, typename U4, typename U5,
283
            typename T1, typename T2, typename T3, typename T4, typename T5>
283
            typename T1, typename T2, typename T3, typename T4, typename T5>
 Lines 287-422    Link Here 
287
   * Schedule an event with the given context.
287
   * Schedule an event with the given context.
288
   * A context of 0xffffffff means no context is specified.
288
   * A context of 0xffffffff means no context is specified.
289
   *
289
   *
290
   * @param time the relative expiration time of the event.
290
   * \param time the relative expiration time of the event.
291
   * @param context user-specified context parameter
291
   * \param context user-specified context parameter
292
   * @param mem_ptr member method pointer to invoke
292
   * \param mem_ptr member method pointer to invoke
293
   * @param obj the object on which to invoke the member method
293
   * \param obj the object on which to invoke the member method
294
   */
294
   */
295
  template <typename MEM, typename OBJ>
295
  template <typename MEM, typename OBJ>
296
  static void ScheduleWithContext (uint32_t context, Time const &time, MEM mem_ptr, OBJ obj);
296
  static void ScheduleWithContext (uint32_t context, Time const &time, MEM mem_ptr, OBJ obj);
297
297
298
  /**
298
  /**
299
   * @param time the relative expiration time of the event.
299
   * \param time the relative expiration time of the event.
300
   * @param context user-specified context parameter
300
   * \param context user-specified context parameter
301
   * @param mem_ptr member method pointer to invoke
301
   * \param mem_ptr member method pointer to invoke
302
   * @param obj the object on which to invoke the member method
302
   * \param obj the object on which to invoke the member method
303
   * @param a1 the first argument to pass to the invoked method
303
   * \param a1 the first argument to pass to the invoked method
304
   */
304
   */
305
  template <typename MEM, typename OBJ, typename T1>
305
  template <typename MEM, typename OBJ, typename T1>
306
  static void ScheduleWithContext (uint32_t context, Time const &time, MEM mem_ptr, OBJ obj, T1 a1);
306
  static void ScheduleWithContext (uint32_t context, Time const &time, MEM mem_ptr, OBJ obj, T1 a1);
307
307
308
  /**
308
  /**
309
   * @param time the relative expiration time of the event.
309
   * \param time the relative expiration time of the event.
310
   * @param context user-specified context parameter
310
   * \param context user-specified context parameter
311
   * @param mem_ptr member method pointer to invoke
311
   * \param mem_ptr member method pointer to invoke
312
   * @param obj the object on which to invoke the member method
312
   * \param obj the object on which to invoke the member method
313
   * @param a1 the first argument to pass to the invoked method
313
   * \param a1 the first argument to pass to the invoked method
314
   * @param a2 the second argument to pass to the invoked method
314
   * \param a2 the second argument to pass to the invoked method
315
   */
315
   */
316
  template <typename MEM, typename OBJ, typename T1, typename T2>
316
  template <typename MEM, typename OBJ, typename T1, typename T2>
317
  static void ScheduleWithContext (uint32_t context, Time const &time, MEM mem_ptr, OBJ obj, T1 a1, T2 a2);
317
  static void ScheduleWithContext (uint32_t context, Time const &time, MEM mem_ptr, OBJ obj, T1 a1, T2 a2);
318
318
319
  /**
319
  /**
320
   * @param time the relative expiration time of the event.
320
   * \param time the relative expiration time of the event.
321
   * @param context user-specified context parameter
321
   * \param context user-specified context parameter
322
   * @param mem_ptr member method pointer to invoke
322
   * \param mem_ptr member method pointer to invoke
323
   * @param obj the object on which to invoke the member method
323
   * \param obj the object on which to invoke the member method
324
   * @param a1 the first argument to pass to the invoked method
324
   * \param a1 the first argument to pass to the invoked method
325
   * @param a2 the second argument to pass to the invoked method
325
   * \param a2 the second argument to pass to the invoked method
326
   * @param a3 the third argument to pass to the invoked method
326
   * \param a3 the third argument to pass to the invoked method
327
   */
327
   */
328
  template <typename MEM, typename OBJ, 
328
  template <typename MEM, typename OBJ, 
329
            typename T1, typename T2, typename T3>
329
            typename T1, typename T2, typename T3>
330
  static void ScheduleWithContext (uint32_t context, Time const &time, MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3);
330
  static void ScheduleWithContext (uint32_t context, Time const &time, MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3);
331
331
332
  /**
332
  /**
333
   * @param time the relative expiration time of the event.
333
   * \param time the relative expiration time of the event.
334
   * @param context user-specified context parameter
334
   * \param context user-specified context parameter
335
   * @param mem_ptr member method pointer to invoke
335
   * \param mem_ptr member method pointer to invoke
336
   * @param obj the object on which to invoke the member method
336
   * \param obj the object on which to invoke the member method
337
   * @param a1 the first argument to pass to the invoked method
337
   * \param a1 the first argument to pass to the invoked method
338
   * @param a2 the second argument to pass to the invoked method
338
   * \param a2 the second argument to pass to the invoked method
339
   * @param a3 the third argument to pass to the invoked method
339
   * \param a3 the third argument to pass to the invoked method
340
   * @param a4 the fourth argument to pass to the invoked method
340
   * \param a4 the fourth argument to pass to the invoked method
341
   */
341
   */
342
  template <typename MEM, typename OBJ, 
342
  template <typename MEM, typename OBJ, 
343
            typename T1, typename T2, typename T3, typename T4>
343
            typename T1, typename T2, typename T3, typename T4>
344
  static void ScheduleWithContext (uint32_t context, Time const &time, MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3, T4 a4);
344
  static void ScheduleWithContext (uint32_t context, Time const &time, MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3, T4 a4);
345
345
346
  /**
346
  /**
347
   * @param time the relative expiration time of the event.
347
   * \param time the relative expiration time of the event.
348
   * @param context user-specified context parameter
348
   * \param context user-specified context parameter
349
   * @param mem_ptr member method pointer to invoke
349
   * \param mem_ptr member method pointer to invoke
350
   * @param obj the object on which to invoke the member method
350
   * \param obj the object on which to invoke the member method
351
   * @param a1 the first argument to pass to the invoked method
351
   * \param a1 the first argument to pass to the invoked method
352
   * @param a2 the second argument to pass to the invoked method
352
   * \param a2 the second argument to pass to the invoked method
353
   * @param a3 the third argument to pass to the invoked method
353
   * \param a3 the third argument to pass to the invoked method
354
   * @param a4 the fourth argument to pass to the invoked method
354
   * \param a4 the fourth argument to pass to the invoked method
355
   * @param a5 the fifth argument to pass to the invoked method
355
   * \param a5 the fifth argument to pass to the invoked method
356
   */
356
   */
357
  template <typename MEM, typename OBJ, 
357
  template <typename MEM, typename OBJ, 
358
            typename T1, typename T2, typename T3, typename T4, typename T5>
358
            typename T1, typename T2, typename T3, typename T4, typename T5>
359
  static void ScheduleWithContext (uint32_t context, Time const &time, MEM mem_ptr, OBJ obj, 
359
  static void ScheduleWithContext (uint32_t context, Time const &time, MEM mem_ptr, OBJ obj, 
360
                                   T1 a1, T2 a2, T3 a3, T4 a4, T5 a5);
360
                                   T1 a1, T2 a2, T3 a3, T4 a4, T5 a5);
361
  /**
361
  /**
362
   * @param time the relative expiration time of the event.
362
   * \param time the relative expiration time of the event.
363
   * @param context user-specified context parameter
363
   * \param context user-specified context parameter
364
   * @param f the function to invoke
364
   * \param f the function to invoke
365
   */
365
   */
366
  static void ScheduleWithContext (uint32_t context, Time const &time, void (*f)(void));
366
  static void ScheduleWithContext (uint32_t context, Time const &time, void (*f)(void));
367
367
368
  /**
368
  /**
369
   * @param time the relative expiration time of the event.
369
   * \param time the relative expiration time of the event.
370
   * @param context user-specified context parameter
370
   * \param context user-specified context parameter
371
   * @param f the function to invoke
371
   * \param f the function to invoke
372
   * @param a1 the first argument to pass to the function to invoke
372
   * \param a1 the first argument to pass to the function to invoke
373
   */
373
   */
374
  template <typename U1, typename T1>
374
  template <typename U1, typename T1>
375
  static void ScheduleWithContext (uint32_t context, Time const &time, void (*f)(U1), T1 a1);
375
  static void ScheduleWithContext (uint32_t context, Time const &time, void (*f)(U1), T1 a1);
376
376
377
  /**
377
  /**
378
   * @param time the relative expiration time of the event.
378
   * \param time the relative expiration time of the event.
379
   * @param context user-specified context parameter
379
   * \param context user-specified context parameter
380
   * @param f the function to invoke
380
   * \param f the function to invoke
381
   * @param a1 the first argument to pass to the function to invoke
381
   * \param a1 the first argument to pass to the function to invoke
382
   * @param a2 the second argument to pass to the function to invoke
382
   * \param a2 the second argument to pass to the function to invoke
383
   */
383
   */
384
  template <typename U1, typename U2, typename T1, typename T2>
384
  template <typename U1, typename U2, typename T1, typename T2>
385
  static void ScheduleWithContext (uint32_t context, Time const &time, void (*f)(U1,U2), T1 a1, T2 a2);
385
  static void ScheduleWithContext (uint32_t context, Time const &time, void (*f)(U1,U2), T1 a1, T2 a2);
386
386
387
  /**
387
  /**
388
   * @param time the relative expiration time of the event.
388
   * \param time the relative expiration time of the event.
389
   * @param context user-specified context parameter
389
   * \param context user-specified context parameter
390
   * @param f the function to invoke
390
   * \param f the function to invoke
391
   * @param a1 the first argument to pass to the function to invoke
391
   * \param a1 the first argument to pass to the function to invoke
392
   * @param a2 the second argument to pass to the function to invoke
392
   * \param a2 the second argument to pass to the function to invoke
393
   * @param a3 the third argument to pass to the function to invoke
393
   * \param a3 the third argument to pass to the function to invoke
394
   */
394
   */
395
  template <typename U1, typename U2, typename U3, typename T1, typename T2, typename T3>
395
  template <typename U1, typename U2, typename U3, typename T1, typename T2, typename T3>
396
  static void ScheduleWithContext (uint32_t context, Time const &time, void (*f)(U1,U2,U3), T1 a1, T2 a2, T3 a3);
396
  static void ScheduleWithContext (uint32_t context, Time const &time, void (*f)(U1,U2,U3), T1 a1, T2 a2, T3 a3);
397
397
398
  /**
398
  /**
399
   * @param time the relative expiration time of the event.
399
   * \param time the relative expiration time of the event.
400
   * @param context user-specified context parameter
400
   * \param context user-specified context parameter
401
   * @param f the function to invoke
401
   * \param f the function to invoke
402
   * @param a1 the first argument to pass to the function to invoke
402
   * \param a1 the first argument to pass to the function to invoke
403
   * @param a2 the second argument to pass to the function to invoke
403
   * \param a2 the second argument to pass to the function to invoke
404
   * @param a3 the third argument to pass to the function to invoke
404
   * \param a3 the third argument to pass to the function to invoke
405
   * @param a4 the fourth argument to pass to the function to invoke
405
   * \param a4 the fourth argument to pass to the function to invoke
406
   */
406
   */
407
  template <typename U1, typename U2, typename U3, typename U4, 
407
  template <typename U1, typename U2, typename U3, typename U4, 
408
            typename T1, typename T2, typename T3, typename T4>
408
            typename T1, typename T2, typename T3, typename T4>
409
  static void ScheduleWithContext (uint32_t context, Time const &time, void (*f)(U1,U2,U3,U4), T1 a1, T2 a2, T3 a3, T4 a4);
409
  static void ScheduleWithContext (uint32_t context, Time const &time, void (*f)(U1,U2,U3,U4), T1 a1, T2 a2, T3 a3, T4 a4);
410
410
411
  /**
411
  /**
412
   * @param time the relative expiration time of the event.
412
   * \param time the relative expiration time of the event.
413
   * @param context user-specified context parameter
413
   * \param context user-specified context parameter
414
   * @param f the function to invoke
414
   * \param f the function to invoke
415
   * @param a1 the first argument to pass to the function to invoke
415
   * \param a1 the first argument to pass to the function to invoke
416
   * @param a2 the second argument to pass to the function to invoke
416
   * \param a2 the second argument to pass to the function to invoke
417
   * @param a3 the third argument to pass to the function to invoke
417
   * \param a3 the third argument to pass to the function to invoke
418
   * @param a4 the fourth argument to pass to the function to invoke
418
   * \param a4 the fourth argument to pass to the function to invoke
419
   * @param a5 the fifth argument to pass to the function to invoke
419
   * \param a5 the fifth argument to pass to the function to invoke
420
   */
420
   */
421
  template <typename U1, typename U2, typename U3, typename U4, typename U5,
421
  template <typename U1, typename U2, typename U3, typename U4, typename U5,
422
            typename T1, typename T2, typename T3, typename T4, typename T5>
422
            typename T1, typename T2, typename T3, typename T4, typename T5>
 Lines 427-543    Link Here 
427
   * to expire "Now" are scheduled FIFO, after all normal events
427
   * to expire "Now" are scheduled FIFO, after all normal events
428
   * have expired. 
428
   * have expired. 
429
   *
429
   *
430
   * @param mem_ptr member method pointer to invoke
430
   * \param mem_ptr member method pointer to invoke
431
   * @param obj the object on which to invoke the member method
431
   * \param obj the object on which to invoke the member method
432
   */
432
   */
433
  template <typename MEM, typename OBJ>
433
  template <typename MEM, typename OBJ>
434
  static EventId ScheduleNow (MEM mem_ptr, OBJ obj);
434
  static EventId ScheduleNow (MEM mem_ptr, OBJ obj);
435
435
436
  /**
436
  /**
437
   * @param mem_ptr member method pointer to invoke
437
   * \param mem_ptr member method pointer to invoke
438
   * @param obj the object on which to invoke the member method
438
   * \param obj the object on which to invoke the member method
439
   * @param a1 the first argument to pass to the invoked method
439
   * \param a1 the first argument to pass to the invoked method
440
   */
440
   */
441
  template <typename MEM, typename OBJ, 
441
  template <typename MEM, typename OBJ, 
442
            typename T1>
442
            typename T1>
443
  static EventId ScheduleNow (MEM mem_ptr, OBJ obj, T1 a1);
443
  static EventId ScheduleNow (MEM mem_ptr, OBJ obj, T1 a1);
444
444
445
  /**
445
  /**
446
   * @param mem_ptr member method pointer to invoke
446
   * \param mem_ptr member method pointer to invoke
447
   * @param obj the object on which to invoke the member method
447
   * \param obj the object on which to invoke the member method
448
   * @param a1 the first argument to pass to the invoked method
448
   * \param a1 the first argument to pass to the invoked method
449
   * @param a2 the second argument to pass to the invoked method
449
   * \param a2 the second argument to pass to the invoked method
450
   */
450
   */
451
  template <typename MEM, typename OBJ, 
451
  template <typename MEM, typename OBJ, 
452
            typename T1, typename T2>
452
            typename T1, typename T2>
453
  static EventId ScheduleNow (MEM mem_ptr, OBJ obj, T1 a1, T2 a2);
453
  static EventId ScheduleNow (MEM mem_ptr, OBJ obj, T1 a1, T2 a2);
454
454
455
  /**
455
  /**
456
   * @param mem_ptr member method pointer to invoke
456
   * \param mem_ptr member method pointer to invoke
457
   * @param obj the object on which to invoke the member method
457
   * \param obj the object on which to invoke the member method
458
   * @param a1 the first argument to pass to the invoked method
458
   * \param a1 the first argument to pass to the invoked method
459
   * @param a2 the second argument to pass to the invoked method
459
   * \param a2 the second argument to pass to the invoked method
460
   * @param a3 the third argument to pass to the invoked method
460
   * \param a3 the third argument to pass to the invoked method
461
   */
461
   */
462
  template <typename MEM, typename OBJ, 
462
  template <typename MEM, typename OBJ, 
463
            typename T1, typename T2, typename T3>
463
            typename T1, typename T2, typename T3>
464
  static EventId ScheduleNow (MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3);
464
  static EventId ScheduleNow (MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3);
465
465
466
  /**
466
  /**
467
   * @param mem_ptr member method pointer to invoke
467
   * \param mem_ptr member method pointer to invoke
468
   * @param obj the object on which to invoke the member method
468
   * \param obj the object on which to invoke the member method
469
   * @param a1 the first argument to pass to the invoked method
469
   * \param a1 the first argument to pass to the invoked method
470
   * @param a2 the second argument to pass to the invoked method
470
   * \param a2 the second argument to pass to the invoked method
471
   * @param a3 the third argument to pass to the invoked method
471
   * \param a3 the third argument to pass to the invoked method
472
   * @param a4 the fourth argument to pass to the invoked method
472
   * \param a4 the fourth argument to pass to the invoked method
473
   */
473
   */
474
  template <typename MEM, typename OBJ, 
474
  template <typename MEM, typename OBJ, 
475
            typename T1, typename T2, typename T3, typename T4>
475
            typename T1, typename T2, typename T3, typename T4>
476
  static EventId ScheduleNow (MEM mem_ptr, OBJ obj, 
476
  static EventId ScheduleNow (MEM mem_ptr, OBJ obj, 
477
                              T1 a1, T2 a2, T3 a3, T4 a4);
477
                              T1 a1, T2 a2, T3 a3, T4 a4);
478
  /**
478
  /**
479
   * @param mem_ptr member method pointer to invoke
479
   * \param mem_ptr member method pointer to invoke
480
   * @param obj the object on which to invoke the member method
480
   * \param obj the object on which to invoke the member method
481
   * @param a1 the first argument to pass to the invoked method
481
   * \param a1 the first argument to pass to the invoked method
482
   * @param a2 the second argument to pass to the invoked method
482
   * \param a2 the second argument to pass to the invoked method
483
   * @param a3 the third argument to pass to the invoked method
483
   * \param a3 the third argument to pass to the invoked method
484
   * @param a4 the fourth argument to pass to the invoked method
484
   * \param a4 the fourth argument to pass to the invoked method
485
   * @param a5 the fifth argument to pass to the invoked method
485
   * \param a5 the fifth argument to pass to the invoked method
486
   */
486
   */
487
  template <typename MEM, typename OBJ, 
487
  template <typename MEM, typename OBJ, 
488
            typename T1, typename T2, typename T3, typename T4, typename T5>
488
            typename T1, typename T2, typename T3, typename T4, typename T5>
489
  static EventId ScheduleNow (MEM mem_ptr, OBJ obj, 
489
  static EventId ScheduleNow (MEM mem_ptr, OBJ obj, 
490
                              T1 a1, T2 a2, T3 a3, T4 a4, T5 a5);
490
                              T1 a1, T2 a2, T3 a3, T4 a4, T5 a5);
491
  /**
491
  /**
492
   * @param f the function to invoke
492
   * \param f the function to invoke
493
   */
493
   */
494
  static EventId ScheduleNow (void (*f)(void));
494
  static EventId ScheduleNow (void (*f)(void));
495
495
496
  /**
496
  /**
497
   * @param f the function to invoke
497
   * \param f the function to invoke
498
   * @param a1 the first argument to pass to the function to invoke
498
   * \param a1 the first argument to pass to the function to invoke
499
   */
499
   */
500
  template <typename U1,
500
  template <typename U1,
501
            typename T1>
501
            typename T1>
502
  static EventId ScheduleNow (void (*f)(U1), T1 a1);
502
  static EventId ScheduleNow (void (*f)(U1), T1 a1);
503
503
504
  /**
504
  /**
505
   * @param f the function to invoke
505
   * \param f the function to invoke
506
   * @param a1 the first argument to pass to the function to invoke
506
   * \param a1 the first argument to pass to the function to invoke
507
   * @param a2 the second argument to pass to the function to invoke
507
   * \param a2 the second argument to pass to the function to invoke
508
   */
508
   */
509
  template <typename U1, typename U2,
509
  template <typename U1, typename U2,
510
            typename T1, typename T2>
510
            typename T1, typename T2>
511
  static EventId ScheduleNow (void (*f)(U1,U2), T1 a1, T2 a2);
511
  static EventId ScheduleNow (void (*f)(U1,U2), T1 a1, T2 a2);
512
512
513
  /**
513
  /**
514
   * @param f the function to invoke
514
   * \param f the function to invoke
515
   * @param a1 the first argument to pass to the function to invoke
515
   * \param a1 the first argument to pass to the function to invoke
516
   * @param a2 the second argument to pass to the function to invoke
516
   * \param a2 the second argument to pass to the function to invoke
517
   * @param a3 the third argument to pass to the function to invoke
517
   * \param a3 the third argument to pass to the function to invoke
518
   */
518
   */
519
  template <typename U1, typename U2, typename U3,
519
  template <typename U1, typename U2, typename U3,
520
            typename T1, typename T2, typename T3>
520
            typename T1, typename T2, typename T3>
521
  static EventId ScheduleNow (void (*f)(U1,U2,U3), T1 a1, T2 a2, T3 a3);
521
  static EventId ScheduleNow (void (*f)(U1,U2,U3), T1 a1, T2 a2, T3 a3);
522
522
523
  /**
523
  /**
524
   * @param f the function to invoke
524
   * \param f the function to invoke
525
   * @param a1 the first argument to pass to the function to invoke
525
   * \param a1 the first argument to pass to the function to invoke
526
   * @param a2 the second argument to pass to the function to invoke
526
   * \param a2 the second argument to pass to the function to invoke
527
   * @param a3 the third argument to pass to the function to invoke
527
   * \param a3 the third argument to pass to the function to invoke
528
   * @param a4 the fourth argument to pass to the function to invoke
528
   * \param a4 the fourth argument to pass to the function to invoke
529
   */
529
   */
530
  template <typename U1, typename U2, typename U3, typename U4,
530
  template <typename U1, typename U2, typename U3, typename U4,
531
            typename T1, typename T2, typename T3, typename T4>
531
            typename T1, typename T2, typename T3, typename T4>
532
  static EventId ScheduleNow (void (*f)(U1,U2,U3,U4), T1 a1, T2 a2, T3 a3, T4 a4);
532
  static EventId ScheduleNow (void (*f)(U1,U2,U3,U4), T1 a1, T2 a2, T3 a3, T4 a4);
533
533
534
  /**
534
  /**
535
   * @param f the function to invoke
535
   * \param f the function to invoke
536
   * @param a1 the first argument to pass to the function to invoke
536
   * \param a1 the first argument to pass to the function to invoke
537
   * @param a2 the second argument to pass to the function to invoke
537
   * \param a2 the second argument to pass to the function to invoke
538
   * @param a3 the third argument to pass to the function to invoke
538
   * \param a3 the third argument to pass to the function to invoke
539
   * @param a4 the fourth argument to pass to the function to invoke
539
   * \param a4 the fourth argument to pass to the function to invoke
540
   * @param a5 the fifth argument to pass to the function to invoke
540
   * \param a5 the fifth argument to pass to the function to invoke
541
   */
541
   */
542
  template <typename U1, typename U2, typename U3, typename U4, typename U5,
542
  template <typename U1, typename U2, typename U3, typename U4, typename U5,
543
            typename T1, typename T2, typename T3, typename T4, typename T5>
543
            typename T1, typename T2, typename T3, typename T4, typename T5>
 Lines 549-665    Link Here 
549
   * after all normal events have expired and only when 
549
   * after all normal events have expired and only when 
550
   * Simulator::Destroy is invoked.
550
   * Simulator::Destroy is invoked.
551
   *
551
   *
552
   * @param mem_ptr member method pointer to invoke
552
   * \param mem_ptr member method pointer to invoke
553
   * @param obj the object on which to invoke the member method
553
   * \param obj the object on which to invoke the member method
554
   */
554
   */
555
  template <typename MEM, typename OBJ>
555
  template <typename MEM, typename OBJ>
556
  static EventId ScheduleDestroy (MEM mem_ptr, OBJ obj);
556
  static EventId ScheduleDestroy (MEM mem_ptr, OBJ obj);
557
557
558
  /**
558
  /**
559
   * @param mem_ptr member method pointer to invoke
559
   * \param mem_ptr member method pointer to invoke
560
   * @param obj the object on which to invoke the member method
560
   * \param obj the object on which to invoke the member method
561
   * @param a1 the first argument to pass to the invoked method
561
   * \param a1 the first argument to pass to the invoked method
562
   */
562
   */
563
  template <typename MEM, typename OBJ, 
563
  template <typename MEM, typename OBJ, 
564
            typename T1>
564
            typename T1>
565
  static EventId ScheduleDestroy (MEM mem_ptr, OBJ obj, T1 a1);
565
  static EventId ScheduleDestroy (MEM mem_ptr, OBJ obj, T1 a1);
566
566
567
  /**
567
  /**
568
   * @param mem_ptr member method pointer to invoke
568
   * \param mem_ptr member method pointer to invoke
569
   * @param obj the object on which to invoke the member method
569
   * \param obj the object on which to invoke the member method
570
   * @param a1 the first argument to pass to the invoked method
570
   * \param a1 the first argument to pass to the invoked method
571
   * @param a2 the second argument to pass to the invoked method
571
   * \param a2 the second argument to pass to the invoked method
572
   */
572
   */
573
  template <typename MEM, typename OBJ,
573
  template <typename MEM, typename OBJ,
574
            typename T1, typename T2>
574
            typename T1, typename T2>
575
  static EventId ScheduleDestroy (MEM mem_ptr, OBJ obj, T1 a1, T2 a2);
575
  static EventId ScheduleDestroy (MEM mem_ptr, OBJ obj, T1 a1, T2 a2);
576
576
577
  /**
577
  /**
578
   * @param mem_ptr member method pointer to invoke
578
   * \param mem_ptr member method pointer to invoke
579
   * @param obj the object on which to invoke the member method
579
   * \param obj the object on which to invoke the member method
580
   * @param a1 the first argument to pass to the invoked method
580
   * \param a1 the first argument to pass to the invoked method
581
   * @param a2 the second argument to pass to the invoked method
581
   * \param a2 the second argument to pass to the invoked method
582
   * @param a3 the third argument to pass to the invoked method
582
   * \param a3 the third argument to pass to the invoked method
583
   */
583
   */
584
  template <typename MEM, typename OBJ, 
584
  template <typename MEM, typename OBJ, 
585
            typename T1, typename T2, typename T3>
585
            typename T1, typename T2, typename T3>
586
  static EventId ScheduleDestroy (MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3);
586
  static EventId ScheduleDestroy (MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3);
587
587
588
  /**
588
  /**
589
   * @param mem_ptr member method pointer to invoke
589
   * \param mem_ptr member method pointer to invoke
590
   * @param obj the object on which to invoke the member method
590
   * \param obj the object on which to invoke the member method
591
   * @param a1 the first argument to pass to the invoked method
591
   * \param a1 the first argument to pass to the invoked method
592
   * @param a2 the second argument to pass to the invoked method
592
   * \param a2 the second argument to pass to the invoked method
593
   * @param a3 the third argument to pass to the invoked method
593
   * \param a3 the third argument to pass to the invoked method
594
   * @param a4 the fourth argument to pass to the invoked method
594
   * \param a4 the fourth argument to pass to the invoked method
595
   */
595
   */
596
  template <typename MEM, typename OBJ, 
596
  template <typename MEM, typename OBJ, 
597
            typename T1, typename T2, typename T3, typename T4>
597
            typename T1, typename T2, typename T3, typename T4>
598
  static EventId ScheduleDestroy (MEM mem_ptr, OBJ obj, 
598
  static EventId ScheduleDestroy (MEM mem_ptr, OBJ obj, 
599
                                  T1 a1, T2 a2, T3 a3, T4 a4);
599
                                  T1 a1, T2 a2, T3 a3, T4 a4);
600
  /**
600
  /**
601
   * @param mem_ptr member method pointer to invoke
601
   * \param mem_ptr member method pointer to invoke
602
   * @param obj the object on which to invoke the member method
602
   * \param obj the object on which to invoke the member method
603
   * @param a1 the first argument to pass to the invoked method
603
   * \param a1 the first argument to pass to the invoked method
604
   * @param a2 the second argument to pass to the invoked method
604
   * \param a2 the second argument to pass to the invoked method
605
   * @param a3 the third argument to pass to the invoked method
605
   * \param a3 the third argument to pass to the invoked method
606
   * @param a4 the fourth argument to pass to the invoked method
606
   * \param a4 the fourth argument to pass to the invoked method
607
   * @param a5 the fifth argument to pass to the invoked method
607
   * \param a5 the fifth argument to pass to the invoked method
608
   */
608
   */
609
  template <typename MEM, typename OBJ, 
609
  template <typename MEM, typename OBJ, 
610
            typename T1, typename T2, typename T3, typename T4, typename T5>
610
            typename T1, typename T2, typename T3, typename T4, typename T5>
611
  static EventId ScheduleDestroy (MEM mem_ptr, OBJ obj, 
611
  static EventId ScheduleDestroy (MEM mem_ptr, OBJ obj, 
612
                                  T1 a1, T2 a2, T3 a3, T4 a4, T5 a5);
612
                                  T1 a1, T2 a2, T3 a3, T4 a4, T5 a5);
613
  /**
613
  /**
614
   * @param f the function to invoke
614
   * \param f the function to invoke
615
   */
615
   */
616
  static EventId ScheduleDestroy (void (*f)(void));
616
  static EventId ScheduleDestroy (void (*f)(void));
617
617
618
  /**
618
  /**
619
   * @param f the function to invoke
619
   * \param f the function to invoke
620
   * @param a1 the first argument to pass to the function to invoke
620
   * \param a1 the first argument to pass to the function to invoke
621
   */
621
   */
622
  template <typename U1,
622
  template <typename U1,
623
            typename T1>
623
            typename T1>
624
  static EventId ScheduleDestroy (void (*f)(U1), T1 a1);
624
  static EventId ScheduleDestroy (void (*f)(U1), T1 a1);
625
625
626
  /**
626
  /**
627
   * @param f the function to invoke
627
   * \param f the function to invoke
628
   * @param a1 the first argument to pass to the function to invoke
628
   * \param a1 the first argument to pass to the function to invoke
629
   * @param a2 the second argument to pass to the function to invoke
629
   * \param a2 the second argument to pass to the function to invoke
630
   */
630
   */
631
  template <typename U1, typename U2,
631
  template <typename U1, typename U2,
632
            typename T1, typename T2>
632
            typename T1, typename T2>
633
  static EventId ScheduleDestroy (void (*f)(U1,U2), T1 a1, T2 a2);
633
  static EventId ScheduleDestroy (void (*f)(U1,U2), T1 a1, T2 a2);
634
634
635
  /**
635
  /**
636
   * @param f the function to invoke
636
   * \param f the function to invoke
637
   * @param a1 the first argument to pass to the function to invoke
637
   * \param a1 the first argument to pass to the function to invoke
638
   * @param a2 the second argument to pass to the function to invoke
638
   * \param a2 the second argument to pass to the function to invoke
639
   * @param a3 the third argument to pass to the function to invoke
639
   * \param a3 the third argument to pass to the function to invoke
640
   */
640
   */
641
  template <typename U1, typename U2, typename U3,
641
  template <typename U1, typename U2, typename U3,
642
            typename T1, typename T2, typename T3>
642
            typename T1, typename T2, typename T3>
643
  static EventId ScheduleDestroy (void (*f)(U1,U2,U3), T1 a1, T2 a2, T3 a3);
643
  static EventId ScheduleDestroy (void (*f)(U1,U2,U3), T1 a1, T2 a2, T3 a3);
644
644
645
  /**
645
  /**
646
   * @param f the function to invoke
646
   * \param f the function to invoke
647
   * @param a1 the first argument to pass to the function to invoke
647
   * \param a1 the first argument to pass to the function to invoke
648
   * @param a2 the second argument to pass to the function to invoke
648
   * \param a2 the second argument to pass to the function to invoke
649
   * @param a3 the third argument to pass to the function to invoke
649
   * \param a3 the third argument to pass to the function to invoke
650
   * @param a4 the fourth argument to pass to the function to invoke
650
   * \param a4 the fourth argument to pass to the function to invoke
651
   */
651
   */
652
  template <typename U1, typename U2, typename U3, typename U4,
652
  template <typename U1, typename U2, typename U3, typename U4,
653
            typename T1, typename T2, typename T3, typename T4>
653
            typename T1, typename T2, typename T3, typename T4>
654
  static EventId ScheduleDestroy (void (*f)(U1,U2,U3,U4), T1 a1, T2 a2, T3 a3, T4 a4);
654
  static EventId ScheduleDestroy (void (*f)(U1,U2,U3,U4), T1 a1, T2 a2, T3 a3, T4 a4);
655
655
656
  /**
656
  /**
657
   * @param f the function to invoke
657
   * \param f the function to invoke
658
   * @param a1 the first argument to pass to the function to invoke
658
   * \param a1 the first argument to pass to the function to invoke
659
   * @param a2 the second argument to pass to the function to invoke
659
   * \param a2 the second argument to pass to the function to invoke
660
   * @param a3 the third argument to pass to the function to invoke
660
   * \param a3 the third argument to pass to the function to invoke
661
   * @param a4 the fourth argument to pass to the function to invoke
661
   * \param a4 the fourth argument to pass to the function to invoke
662
   * @param a5 the fifth argument to pass to the function to invoke
662
   * \param a5 the fifth argument to pass to the function to invoke
663
   */
663
   */
664
  template <typename U1, typename U2, typename U3, typename U4, typename U5,
664
  template <typename U1, typename U2, typename U3, typename U4, typename U5,
665
            typename T1, typename T2, typename T3, typename T4, typename T5>
665
            typename T1, typename T2, typename T3, typename T4, typename T5>
 Lines 674-680    Link Here 
674
   * Note that it is not possible to remove events which were scheduled
674
   * Note that it is not possible to remove events which were scheduled
675
   * for the "destroy" time. Doing so will result in a program error (crash).
675
   * for the "destroy" time. Doing so will result in a program error (crash).
676
   *
676
   *
677
   * @param id the event to remove from the list of scheduled events.
677
   * \param id the event to remove from the list of scheduled events.
678
   */
678
   */
679
  static void Remove (const EventId &id);
679
  static void Remove (const EventId &id);
680
680
 Lines 688-694    Link Here 
688
   * Note that it is not possible to cancel events which were scheduled
688
   * Note that it is not possible to cancel events which were scheduled
689
   * for the "destroy" time. Doing so will result in a program error (crash).
689
   * for the "destroy" time. Doing so will result in a program error (crash).
690
   * 
690
   * 
691
   * @param id the event to cancel
691
   * \param id the event to cancel
692
   */
692
   */
693
  static void Cancel (const EventId &id);
693
  static void Cancel (const EventId &id);
694
694
 Lines 701-708    Link Here 
701
   * which means that if the code executed by the event calls
701
   * which means that if the code executed by the event calls
702
   * this function, it will get true.
702
   * this function, it will get true.
703
   *
703
   *
704
   * @param id the event to test for expiration
704
   * \param id the event to test for expiration
705
   * @returns true if the event has expired, false otherwise.
705
   * \returns true if the event has expired, false otherwise.
706
   */
706
   */
707
  static bool IsExpired (const EventId &id);
707
  static bool IsExpired (const EventId &id);
708
708
(-)a/src/core/model/synchronizer.h (-81 / +81 lines)
 Lines 26-32    Link Here 
26
namespace ns3 {
26
namespace ns3 {
27
27
28
/**
28
/**
29
 * @brief Base class used for synchronizing the simulation events to some
29
 * \brief Base class used for synchronizing the simulation events to some
30
 * real time "wall clock."
30
 * real time "wall clock."
31
 *
31
 *
32
 * The simulation clock is maintained as a 64-bit integer in a unit specified
32
 * The simulation clock is maintained as a 64-bit integer in a unit specified
 Lines 50-73    Link Here 
50
  virtual ~Synchronizer ();
50
  virtual ~Synchronizer ();
51
51
52
/**
52
/**
53
 * @brief Return true if this synchronizer is actually synchronizing to a
53
 * \brief Return true if this synchronizer is actually synchronizing to a
54
 * realtime clock.  The simulator sometimes needs to know this.
54
 * realtime clock.  The simulator sometimes needs to know this.
55
 * @returns True if locked with realtime, false if not.
55
 * \returns True if locked with realtime, false if not.
56
 */
56
 */
57
  bool Realtime (void);
57
  bool Realtime (void);
58
58
59
/**
59
/**
60
 * @brief Retrieve the value of the origin of the underlying normalized wall
60
 * \brief Retrieve the value of the origin of the underlying normalized wall
61
 * clock time in simulator timestep units.
61
 * clock time in simulator timestep units.
62
 *
62
 *
63
 * @returns The normalized wall clock time (in simulator timestep units).
63
 * \returns The normalized wall clock time (in simulator timestep units).
64
 * @see TimeStepPrecision::Get
64
 * \see TimeStepPrecision::Get
65
 * @see Synchronizer::SetOrigin
65
 * \see Synchronizer::SetOrigin
66
 */
66
 */
67
  uint64_t GetCurrentRealtime (void);
67
  uint64_t GetCurrentRealtime (void);
68
68
69
/**
69
/**
70
 * @brief Establish a correspondence between a simulation time and the
70
 * \brief Establish a correspondence between a simulation time and the
71
 * synchronizer real time.
71
 * synchronizer real time.
72
 *
72
 *
73
 * This method is expected to be called at the "instant" before simulation
73
 * This method is expected to be called at the "instant" before simulation
 Lines 80-120    Link Here 
80
 * virtual method to do the actual real-time-clock-specific work of making the 
80
 * virtual method to do the actual real-time-clock-specific work of making the 
81
 * correspondence mentioned above.
81
 * correspondence mentioned above.
82
 *
82
 *
83
 * @param ts The simulation time we should use as the origin (in simulator
83
 * \param ts The simulation time we should use as the origin (in simulator
84
 * timestep units).
84
 * timestep units).
85
 * @see TimeStepPrecision::Get
85
 * \see TimeStepPrecision::Get
86
 * @see TimeStepPrecision::DoSetOrigin
86
 * \see TimeStepPrecision::DoSetOrigin
87
 */
87
 */
88
  void SetOrigin (uint64_t ts);
88
  void SetOrigin (uint64_t ts);
89
89
90
/**
90
/**
91
 * @brief Retrieve the value of the origin of the simulation time in 
91
 * \brief Retrieve the value of the origin of the simulation time in 
92
 * simulator timestep units.
92
 * simulator timestep units.
93
 *
93
 *
94
 * @returns The simulation time used as the origin (in simulator timestep
94
 * \returns The simulation time used as the origin (in simulator timestep
95
 * units).
95
 * units).
96
 * @see TimeStepPrecision::Get
96
 * \see TimeStepPrecision::Get
97
 * @see Synchronizer::SetOrigin
97
 * \see Synchronizer::SetOrigin
98
 */
98
 */
99
  uint64_t GetOrigin (void);
99
  uint64_t GetOrigin (void);
100
100
101
/**
101
/**
102
 * @brief Retrieve the difference between the real time clock used to 
102
 * \brief Retrieve the difference between the real time clock used to 
103
 * synchronize the simulation and the simulation time (in simulator timestep
103
 * synchronize the simulation and the simulation time (in simulator timestep
104
 * units).
104
 * units).
105
 *
105
 *
106
 * @param ts Simulation timestep from the simulator interpreted as current time
106
 * \param ts Simulation timestep from the simulator interpreted as current time
107
 * in the simulator.
107
 * in the simulator.
108
 * @returns Simulation timestep (in simulator timestep units) minus origin 
108
 * \returns Simulation timestep (in simulator timestep units) minus origin 
109
 * time (stored internally in nanosecond units).
109
 * time (stored internally in nanosecond units).
110
 * @see TimeStepPrecision::Get
110
 * \see TimeStepPrecision::Get
111
 * @see Synchronizer::SetOrigin
111
 * \see Synchronizer::SetOrigin
112
 * @see Synchronizer::DoGetDrift
112
 * \see Synchronizer::DoGetDrift
113
 */
113
 */
114
  int64_t GetDrift (uint64_t ts);
114
  int64_t GetDrift (uint64_t ts);
115
115
116
/**
116
/**
117
 * @brief Wait until the real time is in sync with the specified simulation
117
 * \brief Wait until the real time is in sync with the specified simulation
118
 * time or until the synchronizer is Sigalled.
118
 * time or until the synchronizer is Sigalled.
119
 *
119
 *
120
 * This is where the real work of synchronization is done.  The Time passed
120
 * This is where the real work of synchronization is done.  The Time passed
 Lines 128-189    Link Here 
128
 * (either busy-waiting or sleeping, or some combination thereof) until the
128
 * (either busy-waiting or sleeping, or some combination thereof) until the
129
 * requested simulation time.
129
 * requested simulation time.
130
 *
130
 *
131
 * @param tsCurrent The current simulation time (in simulator timestep units).
131
 * \param tsCurrent The current simulation time (in simulator timestep units).
132
 * @param tsDelay The simulation time we need to wait for (in simulator
132
 * \param tsDelay The simulation time we need to wait for (in simulator
133
 * timestep units).
133
 * timestep units).
134
 * @returns True if the function ran to completion, false if it was interrupted
134
 * \returns True if the function ran to completion, false if it was interrupted
135
 * by a Signal.
135
 * by a Signal.
136
 * @see TimeStepPrecision::Get
136
 * \see TimeStepPrecision::Get
137
 * @see Synchronizer::DoSynchronize
137
 * \see Synchronizer::DoSynchronize
138
 * @see Synchronizer::Signal
138
 * \see Synchronizer::Signal
139
 */
139
 */
140
  bool Synchronize (uint64_t tsCurrent, uint64_t tsDelay);
140
  bool Synchronize (uint64_t tsCurrent, uint64_t tsDelay);
141
141
142
/**
142
/**
143
 * @brief Tell a possible simulator thread waiting in the Synchronize method
143
 * \brief Tell a possible simulator thread waiting in the Synchronize method
144
 * that an event has happened which demands a reevaluation of the wait time.
144
 * that an event has happened which demands a reevaluation of the wait time.
145
 * This will cause the thread to wake and return to the simulator proper
145
 * This will cause the thread to wake and return to the simulator proper
146
 * where it can get its bearings.
146
 * where it can get its bearings.
147
 *
147
 *
148
 * @see Synchronizer::Synchronize
148
 * \see Synchronizer::Synchronize
149
 * @see Synchronizer::DoSignal
149
 * \see Synchronizer::DoSignal
150
 */
150
 */
151
  void Signal (void);
151
  void Signal (void);
152
152
153
/**
153
/**
154
 * @brief Set the condition variable that tells a possible simulator thread 
154
 * \brief Set the condition variable that tells a possible simulator thread 
155
 * waiting in the Synchronize method that an event has happened which demands
155
 * waiting in the Synchronize method that an event has happened which demands
156
 * a reevaluation of the wait time.
156
 * a reevaluation of the wait time.
157
 *
157
 *
158
 * @see Synchronizer::Signal
158
 * \see Synchronizer::Signal
159
 */
159
 */
160
  void SetCondition (bool);
160
  void SetCondition (bool);
161
161
162
/**
162
/**
163
 * @brief Ask the synchronizer to remember what time it is.  Typically used
163
 * \brief Ask the synchronizer to remember what time it is.  Typically used
164
 * with EventEnd to determine the real execution time of a simulation event.
164
 * with EventEnd to determine the real execution time of a simulation event.
165
 *
165
 *
166
 * @see Synchronizer::EventEnd
166
 * \see Synchronizer::EventEnd
167
 * @see TimeStepPrecision::Get
167
 * \see TimeStepPrecision::Get
168
 */
168
 */
169
  void EventStart (void);
169
  void EventStart (void);
170
170
171
/**
171
/**
172
 * @brief Ask the synchronizer to return the time step between the instant
172
 * \brief Ask the synchronizer to return the time step between the instant
173
 * remembered during EventStart and now.  Used in conjunction with EventStart
173
 * remembered during EventStart and now.  Used in conjunction with EventStart
174
 * to determine the real execution time of a simulation event.
174
 * to determine the real execution time of a simulation event.
175
 *
175
 *
176
 * @see Synchronizer::EventStart
176
 * \see Synchronizer::EventStart
177
 * @see TimeStepPrecision::Get
177
 * \see TimeStepPrecision::Get
178
 */
178
 */
179
  uint64_t EventEnd (void);
179
  uint64_t EventEnd (void);
180
180
181
protected:
181
protected:
182
/**
182
/**
183
 * @brief Establish a correspondence between a simulation time and a 
183
 * \brief Establish a correspondence between a simulation time and a 
184
 * wall-clock (real) time.
184
 * wall-clock (real) time.
185
 *
185
 *
186
 * @internal
186
 * \internal
187
 *
187
 *
188
 * There are three timelines involved here:  the simulation time, the 
188
 * There are three timelines involved here:  the simulation time, the 
189
 * (absolute) wall-clock time and the (relative) synchronizer real time.
189
 * (absolute) wall-clock time and the (relative) synchronizer real time.
 Lines 201-246    Link Here 
201
 * for example, this is where the differences between Time parameters and
201
 * for example, this is where the differences between Time parameters and
202
 * parameters to clock_nanosleep would be dealt with. 
202
 * parameters to clock_nanosleep would be dealt with. 
203
 *
203
 *
204
 * @param ns The simulation time we need to use as the origin (normalized to
204
 * \param ns The simulation time we need to use as the origin (normalized to
205
 * nanosecond units).
205
 * nanosecond units).
206
 * @see Synchronizer::SetOrigin
206
 * \see Synchronizer::SetOrigin
207
 * @see TimeStepPrecision::Get
207
 * \see TimeStepPrecision::Get
208
 */
208
 */
209
  virtual void DoSetOrigin (uint64_t ns) = 0;
209
  virtual void DoSetOrigin (uint64_t ns) = 0;
210
210
211
/**
211
/**
212
 * @brief Return true if this synchronizer is actually synchronizing to a
212
 * \brief Return true if this synchronizer is actually synchronizing to a
213
 * realtime clock.  The simulator sometimes needs to know this.
213
 * realtime clock.  The simulator sometimes needs to know this.
214
 *
214
 *
215
 * @internal
215
 * \internal
216
 *
216
 *
217
 * Subclasses are expected to implement this method to tell the outside world
217
 * Subclasses are expected to implement this method to tell the outside world
218
 * whether or not they are synchronizing to a realtime clock.
218
 * whether or not they are synchronizing to a realtime clock.
219
 *
219
 *
220
 * @returns True if locked with realtime, false if not.
220
 * \returns True if locked with realtime, false if not.
221
 */
221
 */
222
  virtual bool DoRealtime (void) = 0;
222
  virtual bool DoRealtime (void) = 0;
223
223
224
/**
224
/**
225
 * @brief Retrieve the value of the origin of the underlying normalized wall
225
 * \brief Retrieve the value of the origin of the underlying normalized wall
226
 * clock time in simulator timestep units.
226
 * clock time in simulator timestep units.
227
 *
227
 *
228
 * @internal
228
 * \internal
229
 *
229
 *
230
 * Subclasses are expected to implement this method to do the actual
230
 * Subclasses are expected to implement this method to do the actual
231
 * real-time-clock-specific work of getting the current time.
231
 * real-time-clock-specific work of getting the current time.
232
 *
232
 *
233
 * @returns The normalized wall clock time (in nanosecond units).
233
 * \returns The normalized wall clock time (in nanosecond units).
234
 * @see TimeStepPrecision::Get
234
 * \see TimeStepPrecision::Get
235
 * @see Synchronizer::SetOrigin
235
 * \see Synchronizer::SetOrigin
236
 */
236
 */
237
  virtual uint64_t DoGetCurrentRealtime (void) = 0;
237
  virtual uint64_t DoGetCurrentRealtime (void) = 0;
238
238
239
/**
239
/**
240
 * @brief Wait until the real time is in sync with the specified simulation
240
 * \brief Wait until the real time is in sync with the specified simulation
241
 * time.
241
 * time.
242
 *
242
 *
243
 * @internal
243
 * \internal
244
 *
244
 *
245
 * This is where the real work of synchronization is done.  The Time passed
245
 * This is where the real work of synchronization is done.  The Time passed
246
 * in as a parameter is the simulation time.  The job of Synchronize is to
246
 * in as a parameter is the simulation time.  The job of Synchronize is to
 Lines 252-299    Link Here 
252
 * real-time-clock-specific work of waiting (either busy-waiting or sleeping,
252
 * real-time-clock-specific work of waiting (either busy-waiting or sleeping,
253
 * or some combination) until the requested simulation time.
253
 * or some combination) until the requested simulation time.
254
 *
254
 *
255
 * @param nsCurrent The current simulation time (normalized to nanosecond
255
 * \param nsCurrent The current simulation time (normalized to nanosecond
256
 * units).
256
 * units).
257
 * @param nsDelay The simulation time we need to wait for (normalized to 
257
 * \param nsDelay The simulation time we need to wait for (normalized to 
258
 * nanosecond units).
258
 * nanosecond units).
259
 * @returns True if the function ran to completion, false if it was interrupted
259
 * \returns True if the function ran to completion, false if it was interrupted
260
 * by a Signal.
260
 * by a Signal.
261
 * @see Synchronizer::Synchronize
261
 * \see Synchronizer::Synchronize
262
 * @see TimeStepPrecision::Get
262
 * \see TimeStepPrecision::Get
263
 * @see Synchronizer::Signal
263
 * \see Synchronizer::Signal
264
 */
264
 */
265
  virtual bool DoSynchronize (uint64_t nsCurrent, uint64_t nsDelay) = 0;
265
  virtual bool DoSynchronize (uint64_t nsCurrent, uint64_t nsDelay) = 0;
266
266
267
/**
267
/**
268
 * @brief Declaration of the method used to tell a possible simulator thread 
268
 * \brief Declaration of the method used to tell a possible simulator thread 
269
 * waiting in the DoSynchronize method that an event has happened which
269
 * waiting in the DoSynchronize method that an event has happened which
270
 * demands a reevaluation of the wait time.
270
 * demands a reevaluation of the wait time.
271
 *
271
 *
272
 * @see Synchronizer::Signal
272
 * \see Synchronizer::Signal
273
 */
273
 */
274
  virtual void DoSignal (void) = 0;
274
  virtual void DoSignal (void) = 0;
275
275
276
/**
276
/**
277
 * @brief Declaration of the method used to set the condition variable that 
277
 * \brief Declaration of the method used to set the condition variable that 
278
 * tells a possible simulator thread waiting in the Synchronize method that an
278
 * tells a possible simulator thread waiting in the Synchronize method that an
279
 * event has happened which demands a reevaluation of the wait time.
279
 * event has happened which demands a reevaluation of the wait time.
280
 *
280
 *
281
 * @see Synchronizer::SetCondition
281
 * \see Synchronizer::SetCondition
282
 */
282
 */
283
  virtual void DoSetCondition (bool) = 0;
283
  virtual void DoSetCondition (bool) = 0;
284
284
285
/**
285
/**
286
 * @brief Declaration of method used to retrieve drift between the real time
286
 * \brief Declaration of method used to retrieve drift between the real time
287
 * clock used to synchronize the simulation and the current simulation time.
287
 * clock used to synchronize the simulation and the current simulation time.
288
 *
288
 *
289
 * @internal
289
 * \internal
290
 *
290
 *
291
 * @param ns Simulation timestep from the simulator normalized to nanosecond 
291
 * \param ns Simulation timestep from the simulator normalized to nanosecond 
292
 * steps.
292
 * steps.
293
 * @returns Drift in nanosecond units.
293
 * \returns Drift in nanosecond units.
294
 * @see TimeStepPrecision::Get
294
 * \see TimeStepPrecision::Get
295
 * @see Synchronizer::SetOrigin
295
 * \see Synchronizer::SetOrigin
296
 * @see Synchronizer::GetDrift
296
 * \see Synchronizer::GetDrift
297
 */
297
 */
298
  virtual int64_t DoGetDrift (uint64_t ns) = 0;
298
  virtual int64_t DoGetDrift (uint64_t ns) = 0;
299
299
 Lines 305-330    Link Here 
305
305
306
private:
306
private:
307
/**
307
/**
308
 * @brief Convert a simulator time step (which can be steps of time in a 
308
 * \brief Convert a simulator time step (which can be steps of time in a 
309
 * user-specified unit) to a normalized time step in nanosecond units.
309
 * user-specified unit) to a normalized time step in nanosecond units.
310
 *
310
 *
311
 * @internal
311
 * \internal
312
 *
312
 *
313
 * @param ts The simulation time step to be normalized.
313
 * \param ts The simulation time step to be normalized.
314
 * @returns The simulation time step normalized to nanosecond units.
314
 * \returns The simulation time step normalized to nanosecond units.
315
 * @see TimeStepPrecision::Get
315
 * \see TimeStepPrecision::Get
316
 */
316
 */
317
  uint64_t TimeStepToNanosecond (uint64_t ts);
317
  uint64_t TimeStepToNanosecond (uint64_t ts);
318
318
319
/**
319
/**
320
 * @brief Convert a normalized nanosecond count into a simulator time step
320
 * \brief Convert a normalized nanosecond count into a simulator time step
321
 * (which can be steps of time in a user-specified unit).
321
 * (which can be steps of time in a user-specified unit).
322
 *
322
 *
323
 * @internal
323
 * \internal
324
 *
324
 *
325
 * @param ns The nanosecond count step to be converted
325
 * \param ns The nanosecond count step to be converted
326
 * @returns The simulation time step to be interpreted in appropriate units.
326
 * \returns The simulation time step to be interpreted in appropriate units.
327
 * @see TimeStepPrecision::Get
327
 * \see TimeStepPrecision::Get
328
 */
328
 */
329
  uint64_t NanosecondToTimeStep (uint64_t ns);
329
  uint64_t NanosecondToTimeStep (uint64_t ns);
330
};
330
};
(-)a/src/core/model/system-condition.h (-1 / +1 lines)
 Lines 26-32    Link Here 
26
class SystemConditionPrivate;
26
class SystemConditionPrivate;
27
27
28
/**
28
/**
29
 * @brief A class which provides a relatively platform-independent 
29
 * \brief A class which provides a relatively platform-independent 
30
 * conditional-wait thread synchronization primitive.
30
 * conditional-wait thread synchronization primitive.
31
 *
31
 *
32
 * It is often desirable to have a mechanism by which a thread can suspend its
32
 * It is often desirable to have a mechanism by which a thread can suspend its
(-)a/src/core/model/system-mutex.h (-4 / +4 lines)
 Lines 28-34    Link Here 
28
class SystemMutexPrivate;
28
class SystemMutexPrivate;
29
29
30
/**
30
/**
31
 * @brief A class which provides a relatively platform-independent Mutual
31
 * \brief A class which provides a relatively platform-independent Mutual
32
 * Exclusion thread synchronization primitive.
32
 * Exclusion thread synchronization primitive.
33
 *
33
 *
34
 * When more than one thread needs to access a shared resource (data structure
34
 * When more than one thread needs to access a shared resource (data structure
 Lines 45-51    Link Here 
45
 * SystemThread, the calling SystemThread is blocked until the current owner
45
 * SystemThread, the calling SystemThread is blocked until the current owner
46
 * releases the SystemMutex by calling Unlock.
46
 * releases the SystemMutex by calling Unlock.
47
 *
47
 *
48
 * @see CriticalSection
48
 * \see CriticalSection
49
 */
49
 */
50
class SystemMutex 
50
class SystemMutex 
51
{
51
{
 Lines 68-74    Link Here 
68
};
68
};
69
69
70
/**
70
/**
71
 * @brief A class which provides a simple way to implement a Critical Section.
71
 * \brief A class which provides a simple way to implement a Critical Section.
72
 *
72
 *
73
 * When more than one SystemThread needs to access a shared resource, we
73
 * When more than one SystemThread needs to access a shared resource, we
74
 * control access by acquiring a SystemMutex.  The CriticalSection class uses
74
 * control access by acquiring a SystemMutex.  The CriticalSection class uses
 Lines 104-110    Link Here 
104
 * The critical section is exited when the CriticalSection object goes out of
104
 * The critical section is exited when the CriticalSection object goes out of
105
 * scope at the end of block.
105
 * scope at the end of block.
106
 *
106
 *
107
 * @see SystemMutex
107
 * \see SystemMutex
108
 */
108
 */
109
class CriticalSection
109
class CriticalSection
110
{
110
{
(-)a/src/core/model/system-thread.h (-15 / +15 lines)
 Lines 28-34    Link Here 
28
class SystemThreadImpl;
28
class SystemThreadImpl;
29
29
30
/**
30
/**
31
 * @brief A class which provides a relatively platform-independent thread
31
 * \brief A class which provides a relatively platform-independent thread
32
 * primitive.
32
 * primitive.
33
 *
33
 *
34
 * This class allows for creation of multiple threads of execution in a
34
 * This class allows for creation of multiple threads of execution in a
 Lines 46-52    Link Here 
46
{
46
{
47
public:
47
public:
48
  /**
48
  /**
49
   * @brief Create a SystemThread object.
49
   * \brief Create a SystemThread object.
50
   *
50
   *
51
   * A system thread object is not created running.  A thread of execution
51
   * A system thread object is not created running.  A thread of execution
52
   * must be explicitly started by calling the Start method.  When the 
52
   * must be explicitly started by calling the Start method.  When the 
 Lines 92-104    Link Here 
92
   * method provided to do this is Join (). If you call Join() you will block
92
   * method provided to do this is Join (). If you call Join() you will block
93
   * until the SystemThread run method returns.
93
   * until the SystemThread run method returns.
94
   *
94
   *
95
   * @param callback entry point of the thread
95
   * \param callback entry point of the thread
96
   * 
96
   * 
97
   * @warning The SystemThread uses SIGALRM to wake threads that are possibly
97
   * \warning The SystemThread uses SIGALRM to wake threads that are possibly
98
   * blocked on IO.
98
   * blocked on IO.
99
   * @see Shutdown
99
   * \see Shutdown
100
   *
100
   *
101
   * @warning I've made the system thread class look like a normal ns3 object
101
   * \warning I've made the system thread class look like a normal ns3 object
102
   * with smart pointers, and living in the heap.  This makes it very easy to
102
   * with smart pointers, and living in the heap.  This makes it very easy to
103
   * manage threads from a single master thread context.  You should be very
103
   * manage threads from a single master thread context.  You should be very
104
   * aware though that I have not made Ptr multithread safe!  This means that
104
   * aware though that I have not made Ptr multithread safe!  This means that
 Lines 110-133    Link Here 
110
  SystemThread(Callback<void> callback);
110
  SystemThread(Callback<void> callback);
111
111
112
  /**
112
  /**
113
   * @brief Destroy a SystemThread object.
113
   * \brief Destroy a SystemThread object.
114
   *
114
   *
115
   */
115
   */
116
  ~SystemThread();
116
  ~SystemThread();
117
117
118
  /**
118
  /**
119
   * @brief Start a thread of execution, running the provided callback.
119
   * \brief Start a thread of execution, running the provided callback.
120
   */
120
   */
121
  void Start (void);
121
  void Start (void);
122
122
123
  /**
123
  /**
124
   * @brief Suspend the caller until the thread of execution, running the 
124
   * \brief Suspend the caller until the thread of execution, running the 
125
   * provided callback, finishes.
125
   * provided callback, finishes.
126
   */
126
   */
127
  void Join (void);
127
  void Join (void);
128
128
129
  /**
129
  /**
130
   * @brief Indicates to a managed thread doing cooperative multithreading that
130
   * \brief Indicates to a managed thread doing cooperative multithreading that
131
   * its managing thread wants it to exit.
131
   * its managing thread wants it to exit.
132
   *
132
   *
133
   * It is often the case that we want a thread to be off doing work until such
133
   * It is often the case that we want a thread to be off doing work until such
 Lines 142-155    Link Here 
142
   * read somehow.  This method also provides that functionality, by sending a
142
   * read somehow.  This method also provides that functionality, by sending a
143
   * SIGALRM signal to the possibly blocked thread.
143
   * SIGALRM signal to the possibly blocked thread.
144
   *
144
   *
145
   * @warning Uses SIGALRM to notify threads possibly blocked on IO.  Beware
145
   * \warning Uses SIGALRM to notify threads possibly blocked on IO.  Beware
146
   * if you are using signals.
146
   * if you are using signals.
147
   * @see Break
147
   * \see Break
148
   */
148
   */
149
  void Shutdown (void);
149
  void Shutdown (void);
150
150
151
  /**
151
  /**
152
   * @brief Indicates to a thread doing cooperative multithreading that
152
   * \brief Indicates to a thread doing cooperative multithreading that
153
   * its managing thread wants it to exit.
153
   * its managing thread wants it to exit.
154
   *
154
   *
155
   * It is often the case that we want a thread to be off doing work until such
155
   * It is often the case that we want a thread to be off doing work until such
 Lines 158-165    Link Here 
158
   * Typically, the worker thread is running in a forever-loop, and will need to
158
   * Typically, the worker thread is running in a forever-loop, and will need to
159
   * "break" out of that loop to exit -- thus the name.
159
   * "break" out of that loop to exit -- thus the name.
160
   *
160
   *
161
   * @see Shutdown
161
   * \see Shutdown
162
   * @returns true if thread is expected to exit (break out of the forever-loop)
162
   * \returns true if thread is expected to exit (break out of the forever-loop)
163
   */
163
   */
164
  bool Break (void);
164
  bool Break (void);
165
165
(-)a/src/core/model/test.h (-1 / +1 lines)
 Lines 937-943    Link Here 
937
{
937
{
938
public:
938
public:
939
  /**
939
  /**
940
   * \enum TestType
940
   * \enum Type
941
   * \brief Type of test.
941
   * \brief Type of test.
942
   */
942
   */
943
  enum Type {
943
  enum Type {
(-)a/src/core/model/wall-clock-synchronizer.h (-23 / +23 lines)
 Lines 25-31    Link Here 
25
namespace ns3 {
25
namespace ns3 {
26
26
27
/**
27
/**
28
 * @brief Class used for synchronizing the simulation events to a real-time
28
 * \brief Class used for synchronizing the simulation events to a real-time
29
 * "wall clock" using Posix Clock functions.
29
 * "wall clock" using Posix Clock functions.
30
 *
30
 *
31
 * Enable this synchronizer using:
31
 * Enable this synchronizer using:
 Lines 71-108    Link Here 
71
71
72
protected:
72
protected:
73
/**
73
/**
74
 * @brief Return true if this synchronizer is actually synchronizing to a
74
 * \brief Return true if this synchronizer is actually synchronizing to a
75
 * realtime clock.  The simulator sometimes needs to know this.
75
 * realtime clock.  The simulator sometimes needs to know this.
76
 *
76
 *
77
 * @internal
77
 * \internal
78
 *
78
 *
79
 * Subclasses are expected to implement this method to tell the outside world
79
 * Subclasses are expected to implement this method to tell the outside world
80
 * whether or not they are synchronizing to a realtime clock.
80
 * whether or not they are synchronizing to a realtime clock.
81
 *
81
 *
82
 * @returns True if locked with realtime, false if not.
82
 * \returns True if locked with realtime, false if not.
83
 */
83
 */
84
  virtual bool DoRealtime (void);
84
  virtual bool DoRealtime (void);
85
85
86
/**
86
/**
87
 * @brief Retrieve the value of the origin of the underlying normalized wall
87
 * \brief Retrieve the value of the origin of the underlying normalized wall
88
 * clock time in nanosecond units.
88
 * clock time in nanosecond units.
89
 *
89
 *
90
 * @internal
90
 * \internal
91
 *
91
 *
92
 * Subclasses are expected to implement this method to do the actual
92
 * Subclasses are expected to implement this method to do the actual
93
 * real-time-clock-specific work of getting the current time.
93
 * real-time-clock-specific work of getting the current time.
94
 *
94
 *
95
 * @returns The normalized wall clock time (in nanosecond units).
95
 * \returns The normalized wall clock time (in nanosecond units).
96
 * @see TimeStepPrecision::Get
96
 * \see TimeStepPrecision::Get
97
 * @see Synchronizer::SetOrigin
97
 * \see Synchronizer::SetOrigin
98
 */
98
 */
99
  virtual uint64_t DoGetCurrentRealtime (void);
99
  virtual uint64_t DoGetCurrentRealtime (void);
100
100
101
/**
101
/**
102
 * @brief Establish a correspondence between a simulation time and a 
102
 * \brief Establish a correspondence between a simulation time and a 
103
 * wall-clock (real) time.
103
 * wall-clock (real) time.
104
 *
104
 *
105
 * @internal
105
 * \internal
106
 *
106
 *
107
 * There are three timelines involved here:  the simulation time, the 
107
 * There are three timelines involved here:  the simulation time, the 
108
 * (absolute) wall-clock time and the (relative) synchronizer real time.
108
 * (absolute) wall-clock time and the (relative) synchronizer real time.
 Lines 120-150    Link Here 
120
 * for example, this is where the differences between Time parameters and
120
 * for example, this is where the differences between Time parameters and
121
 * parameters to clock_nanosleep would be dealt with. 
121
 * parameters to clock_nanosleep would be dealt with. 
122
 *
122
 *
123
 * @param ns The simulation time we need to use as the origin (normalized to
123
 * \param ns The simulation time we need to use as the origin (normalized to
124
 * nanosecond units).
124
 * nanosecond units).
125
 */
125
 */
126
  virtual void DoSetOrigin (uint64_t ns);
126
  virtual void DoSetOrigin (uint64_t ns);
127
127
128
/**
128
/**
129
 * @brief Declaration of method used to retrieve drift between the real time
129
 * \brief Declaration of method used to retrieve drift between the real time
130
 * clock used to synchronize the simulation and the current simulation time.
130
 * clock used to synchronize the simulation and the current simulation time.
131
 *
131
 *
132
 * @internal
132
 * \internal
133
 *
133
 *
134
 * @param ns Simulation timestep from the simulator normalized to nanosecond 
134
 * \param ns Simulation timestep from the simulator normalized to nanosecond 
135
 * steps.
135
 * steps.
136
 * @returns Drift in nanosecond units.
136
 * \returns Drift in nanosecond units.
137
 * @see TimeStepPrecision::Get
137
 * \see TimeStepPrecision::Get
138
 * @see Synchronizer::SetOrigin
138
 * \see Synchronizer::SetOrigin
139
 * @see Synchronizer::GetDrift
139
 * \see Synchronizer::GetDrift
140
 */
140
 */
141
  virtual int64_t DoGetDrift (uint64_t ns);
141
  virtual int64_t DoGetDrift (uint64_t ns);
142
142
143
/**
143
/**
144
 * @brief Wait until the real time is in sync with the specified simulation
144
 * \brief Wait until the real time is in sync with the specified simulation
145
 * time.
145
 * time.
146
 *
146
 *
147
 * @internal
147
 * \internal
148
 *
148
 *
149
 * This is where the real work of synchronization is done.  The Time passed
149
 * This is where the real work of synchronization is done.  The Time passed
150
 * in as a parameter is the simulation time.  The job of Synchronize is to
150
 * in as a parameter is the simulation time.  The job of Synchronize is to
 Lines 156-164    Link Here 
156
 * real-time-clock-specific work of waiting (either busy-waiting or sleeping,
156
 * real-time-clock-specific work of waiting (either busy-waiting or sleeping,
157
 * or some combination) until the requested simulation time.
157
 * or some combination) until the requested simulation time.
158
 *
158
 *
159
 * @param ns The simulation time we need to wait for (normalized to nanosecond
159
 * \param ns The simulation time we need to wait for (normalized to nanosecond
160
 * units).
160
 * units).
161
 * @see TimeStepPrecision::Get
161
 * \see TimeStepPrecision::Get
162
 */
162
 */
163
  virtual bool DoSynchronize (uint64_t nsCurrent, uint64_t nsDelay);
163
  virtual bool DoSynchronize (uint64_t nsCurrent, uint64_t nsDelay);
164
  virtual void DoSignal (void);
164
  virtual void DoSignal (void);
(-)a/src/dsdv/model/dsdv-packet-queue.h (-20 / +20 lines)
 Lines 47-53    Link Here 
47
public:
47
public:
48
  typedef Ipv4RoutingProtocol::UnicastForwardCallback UnicastForwardCallback;
48
  typedef Ipv4RoutingProtocol::UnicastForwardCallback UnicastForwardCallback;
49
  typedef Ipv4RoutingProtocol::ErrorCallback ErrorCallback;
49
  typedef Ipv4RoutingProtocol::ErrorCallback ErrorCallback;
50
  // / c-tor
50
  /// c-tor
51
  QueueEntry (Ptr<const Packet> pa = 0, Ipv4Header const & h = Ipv4Header (),
51
  QueueEntry (Ptr<const Packet> pa = 0, Ipv4Header const & h = Ipv4Header (),
52
              UnicastForwardCallback ucb = UnicastForwardCallback (),
52
              UnicastForwardCallback ucb = UnicastForwardCallback (),
53
              ErrorCallback ecb = ErrorCallback ())
53
              ErrorCallback ecb = ErrorCallback ())
 Lines 67-73    Link Here 
67
  {
67
  {
68
    return ((m_packet == o.m_packet) && (m_header.GetDestination () == o.m_header.GetDestination ()) && (m_expire == o.m_expire));
68
    return ((m_packet == o.m_packet) && (m_header.GetDestination () == o.m_header.GetDestination ()) && (m_expire == o.m_expire));
69
  }
69
  }
70
  // /\name Fields
70
  ///\name Fields
71
  // \{
71
  // \{
72
  UnicastForwardCallback GetUnicastForwardCallback () const
72
  UnicastForwardCallback GetUnicastForwardCallback () const
73
  {
73
  {
 Lines 111-125    Link Here 
111
  }
111
  }
112
  // \}
112
  // \}
113
private:
113
private:
114
  // / Data packet
114
  /// Data packet
115
  Ptr<const Packet> m_packet;
115
  Ptr<const Packet> m_packet;
116
  // / IP header
116
  /// IP header
117
  Ipv4Header m_header;
117
  Ipv4Header m_header;
118
  // / Unicast forward callback
118
  /// Unicast forward callback
119
  UnicastForwardCallback m_ucb;
119
  UnicastForwardCallback m_ucb;
120
  // / Error callback
120
  /// Error callback
121
  ErrorCallback m_ecb;
121
  ErrorCallback m_ecb;
122
  // / Expire time for queue entry
122
  /// Expire time for queue entry
123
  Time m_expire;
123
  Time m_expire;
124
};
124
};
125
/**
125
/**
 Lines 133-156    Link Here 
133
class PacketQueue
133
class PacketQueue
134
{
134
{
135
public:
135
public:
136
  // / Default c-tor
136
  /// Default c-tor
137
  PacketQueue ()
137
  PacketQueue ()
138
  {
138
  {
139
  }
139
  }
140
  // / Push entry in queue, if there is no entry with the same packet and destination address in queue.
140
  /// Push entry in queue, if there is no entry with the same packet and destination address in queue.
141
  bool Enqueue (QueueEntry & entry);
141
  bool Enqueue (QueueEntry & entry);
142
  // / Return first found (the earliest) entry for given destination
142
  /// Return first found (the earliest) entry for given destination
143
  bool Dequeue (Ipv4Address dst, QueueEntry & entry);
143
  bool Dequeue (Ipv4Address dst, QueueEntry & entry);
144
  // / Remove all packets with destination IP address dst
144
  /// Remove all packets with destination IP address dst
145
  void DropPacketWithDst (Ipv4Address dst);
145
  void DropPacketWithDst (Ipv4Address dst);
146
  // / Finds whether a packet with destination dst exists in the queue
146
  /// Finds whether a packet with destination dst exists in the queue
147
  bool Find (Ipv4Address dst);
147
  bool Find (Ipv4Address dst);
148
  // / Get count of packets with destination dst in the queue
148
  /// Get count of packets with destination dst in the queue
149
  uint32_t
149
  uint32_t
150
  GetCountForPacketsWithDst (Ipv4Address dst);
150
  GetCountForPacketsWithDst (Ipv4Address dst);
151
  // / Number of entries
151
  /// Number of entries
152
  uint32_t GetSize ();
152
  uint32_t GetSize ();
153
  // /\name Fields
153
  ///\name Fields
154
  // \{
154
  // \{
155
  uint32_t GetMaxQueueLen () const
155
  uint32_t GetMaxQueueLen () const
156
  {
156
  {
 Lines 180-194    Link Here 
180
180
181
private:
181
private:
182
  std::vector<QueueEntry> m_queue;
182
  std::vector<QueueEntry> m_queue;
183
  // / Remove all expired entries
183
  /// Remove all expired entries
184
  void Purge ();
184
  void Purge ();
185
  // / Notify that packet is dropped from queue by timeout
185
  /// Notify that packet is dropped from queue by timeout
186
  void Drop (QueueEntry en, std::string reason);
186
  void Drop (QueueEntry en, std::string reason);
187
  // / The maximum number of packets that we allow a routing protocol to buffer.
187
  /// The maximum number of packets that we allow a routing protocol to buffer.
188
  uint32_t m_maxLen;
188
  uint32_t m_maxLen;
189
  // / The maximum number of packets that we allow per destination to buffer.
189
  /// The maximum number of packets that we allow per destination to buffer.
190
  uint32_t m_maxLenPerDst;
190
  uint32_t m_maxLenPerDst;
191
  // / The maximum period of time that a routing protocol is allowed to buffer a packet for, seconds.
191
  /// The maximum period of time that a routing protocol is allowed to buffer a packet for, seconds.
192
  Time m_queueTimeout;
192
  Time m_queueTimeout;
193
  static bool IsEqual (QueueEntry en, const Ipv4Address dst)
193
  static bool IsEqual (QueueEntry en, const Ipv4Address dst)
194
  {
194
  {
(-)a/src/dsdv/model/dsdv-packet.h (-3 / +3 lines)
 Lines 98-106    Link Here 
98
    return m_dstSeqNo;
98
    return m_dstSeqNo;
99
  }
99
  }
100
private:
100
private:
101
  Ipv4Address m_dst;     // /< Destination IP Address
101
  Ipv4Address m_dst; ///< Destination IP Address
102
  uint32_t m_hopCount;     // /< Number of Hops
102
  uint32_t m_hopCount; ///< Number of Hops
103
  uint32_t m_dstSeqNo;     // /< Destination Sequence Number
103
  uint32_t m_dstSeqNo; ///< Destination Sequence Number
104
};
104
};
105
static inline std::ostream & operator<< (std::ostream& os, const DsdvHeader & packet)
105
static inline std::ostream & operator<< (std::ostream& os, const DsdvHeader & packet)
106
{
106
{
(-)a/src/dsdv/model/dsdv-routing-protocol.cc (-3 / +3 lines)
 Lines 47-59    Link Here 
47
namespace dsdv {
47
namespace dsdv {
48
NS_OBJECT_ENSURE_REGISTERED (RoutingProtocol);
48
NS_OBJECT_ENSURE_REGISTERED (RoutingProtocol);
49
49
50
// / UDP Port for DSDV control traffic
50
/// UDP Port for DSDV control traffic
51
const uint32_t RoutingProtocol::DSDV_PORT = 269;
51
const uint32_t RoutingProtocol::DSDV_PORT = 269;
52
52
53
// / Tag used by DSDV implementation
53
/// Tag used by DSDV implementation
54
struct DeferredRouteOutputTag : public Tag
54
struct DeferredRouteOutputTag : public Tag
55
{
55
{
56
  // / Positive if output device is fixed in RouteOutput
56
  /// Positive if output device is fixed in RouteOutput
57
  int32_t oif;
57
  int32_t oif;
58
58
59
  DeferredRouteOutputTag (int32_t o = -1)
59
  DeferredRouteOutputTag (int32_t o = -1)
(-)a/src/dsdv/model/dsdv-routing-protocol.h (-43 / +42 lines)
 Lines 56-69    Link Here 
56
  GetTypeId (void);
56
  GetTypeId (void);
57
  static const uint32_t DSDV_PORT;
57
  static const uint32_t DSDV_PORT;
58
58
59
  // / c-tor
59
  /// c-tor
60
  RoutingProtocol ();
60
  RoutingProtocol ();
61
  virtual
61
  virtual
62
  ~RoutingProtocol ();
62
  ~RoutingProtocol ();
63
  virtual void
63
  virtual void
64
  DoDispose ();
64
  DoDispose ();
65
65
66
  // /\name From Ipv4RoutingProtocol
66
  ///\name From Ipv4RoutingProtocol
67
  // \{
67
  // \{
68
  Ptr<Ipv4Route> RouteOutput (Ptr<Packet> p, const Ipv4Header &header, Ptr<NetDevice> oif, Socket::SocketErrno &sockerr);
68
  Ptr<Ipv4Route> RouteOutput (Ptr<Packet> p, const Ipv4Header &header, Ptr<NetDevice> oif, Socket::SocketErrno &sockerr);
69
  bool RouteInput (Ptr<const Packet> p, const Ipv4Header &header, Ptr<const NetDevice> idev, UnicastForwardCallback ucb,
69
  bool RouteInput (Ptr<const Packet> p, const Ipv4Header &header, Ptr<const NetDevice> idev, UnicastForwardCallback ucb,
 Lines 75-81    Link Here 
75
  virtual void NotifyRemoveAddress (uint32_t interface, Ipv4InterfaceAddress address);
75
  virtual void NotifyRemoveAddress (uint32_t interface, Ipv4InterfaceAddress address);
76
  virtual void SetIpv4 (Ptr<Ipv4> ipv4);
76
  virtual void SetIpv4 (Ptr<Ipv4> ipv4);
77
  // \}
77
  // \}
78
  // /\name Methods to handle protocol parameters
78
  ///\name Methods to handle protocol parameters
79
  // \{
79
  // \{
80
  void SetEnableBufferFlag (bool f);
80
  void SetEnableBufferFlag (bool f);
81
  bool GetEnableBufferFlag () const;
81
  bool GetEnableBufferFlag () const;
 Lines 86-149    Link Here 
86
  // \}
86
  // \}
87
87
88
private:
88
private:
89
  // /\name Protocol parameters.
89
  ///\name Protocol parameters.
90
  // \{
90
  // \{
91
  // / \{Holdtimes is the multiplicative factor of PeriodicUpdateInterval for which the node waits since the last update
91
  /// Holdtimes is the multiplicative factor of PeriodicUpdateInterval for which the node waits since the last update
92
  // / before flushing a route from the routing table. If PeriodicUpdateInterval is 8s and Holdtimes is 3, the node
92
  /// before flushing a route from the routing table. If PeriodicUpdateInterval is 8s and Holdtimes is 3, the node
93
  // / waits for 24s since the last update to flush this route from its routing table. \}
93
  /// waits for 24s since the last update to flush this route from its routing table.
94
  uint32_t Holdtimes;
94
  uint32_t Holdtimes;
95
  // / \{PeriodicUpdateInterval specifies the periodic time interval between which the a node broadcasts
95
  /// PeriodicUpdateInterval specifies the periodic time interval between which the a node broadcasts
96
  // / its entire routing table.\}
96
  /// its entire routing table.
97
  Time m_periodicUpdateInterval;
97
  Time m_periodicUpdateInterval;
98
  // /\{ SettlingTime specifies the time for which a node waits before propagating an update.
98
  /// SettlingTime specifies the time for which a node waits before propagating an update.
99
  // / It waits for this time interval in hope of receiving an update with a better metric.
99
  /// It waits for this time interval in hope of receiving an update with a better metric.
100
  // /\}
101
  Time m_settlingTime;
100
  Time m_settlingTime;
102
  // /Nodes IP address
101
  /// Nodes IP address
103
  Ipv4Address m_mainAddress;
102
  Ipv4Address m_mainAddress;
104
  // / IP protocol
103
  /// IP protocol
105
  Ptr<Ipv4> m_ipv4;
104
  Ptr<Ipv4> m_ipv4;
106
  // / Raw socket per each IP interface, map socket -> iface address (IP + mask)
105
  /// Raw socket per each IP interface, map socket -> iface address (IP + mask)
107
  std::map<Ptr<Socket>, Ipv4InterfaceAddress> m_socketAddresses;
106
  std::map<Ptr<Socket>, Ipv4InterfaceAddress> m_socketAddresses;
108
  // / Loopback device used to defer route requests until a route is found
107
  /// Loopback device used to defer route requests until a route is found
109
  Ptr<NetDevice> m_lo;
108
  Ptr<NetDevice> m_lo;
110
  // / Main Routing table for the node
109
  /// Main Routing table for the node
111
  RoutingTable m_routingTable;
110
  RoutingTable m_routingTable;
112
  // / Advertised Routing table for the node
111
  /// Advertised Routing table for the node
113
  RoutingTable m_advRoutingTable;
112
  RoutingTable m_advRoutingTable;
114
  // / The maximum number of packets that we allow a routing protocol to buffer.
113
  /// The maximum number of packets that we allow a routing protocol to buffer.
115
  uint32_t m_maxQueueLen;
114
  uint32_t m_maxQueueLen;
116
  // / The maximum number of packets that we allow per destination to buffer.
115
  /// The maximum number of packets that we allow per destination to buffer.
117
  uint32_t m_maxQueuedPacketsPerDst;
116
  uint32_t m_maxQueuedPacketsPerDst;
118
  // /< The maximum period of time that a routing protocol is allowed to buffer a packet for.
117
  /// The maximum period of time that a routing protocol is allowed to buffer a packet for.
119
  Time m_maxQueueTime;
118
  Time m_maxQueueTime;
120
  // / A "drop front on full" queue used by the routing layer to buffer packets to which it does not have a route.
119
  /// A "drop front on full" queue used by the routing layer to buffer packets to which it does not have a route.
121
  PacketQueue m_queue;
120
  PacketQueue m_queue;
122
  // / Flag that is used to enable or disable buffering
121
  /// Flag that is used to enable or disable buffering
123
  bool EnableBuffering;
122
  bool EnableBuffering;
124
  // / Flag that is used to enable or disable Weighted Settling Time
123
  /// Flag that is used to enable or disable Weighted Settling Time
125
  bool EnableWST;
124
  bool EnableWST;
126
  // / This is the wighted factor to determine the weighted settling time
125
  /// This is the wighted factor to determine the weighted settling time
127
  double m_weightedFactor;
126
  double m_weightedFactor;
128
  // / This is a flag to enable route aggregation. Route aggregation will aggregate all routes for
127
  /// This is a flag to enable route aggregation. Route aggregation will aggregate all routes for
129
  // / 'RouteAggregationTime' from the time an update is received by a node and sends them as a single update .
128
  /// 'RouteAggregationTime' from the time an update is received by a node and sends them as a single update .
130
  bool EnableRouteAggregation;
129
  bool EnableRouteAggregation;
131
  // / Parameter that holds the route aggregation time interval
130
  /// Parameter that holds the route aggregation time interval
132
  Time m_routeAggregationTime;
131
  Time m_routeAggregationTime;
133
  // / Unicast callback for own packets
132
  /// Unicast callback for own packets
134
  UnicastForwardCallback m_scb;
133
  UnicastForwardCallback m_scb;
135
  // / Error callback for own packets
134
  /// Error callback for own packets
136
  ErrorCallback m_ecb;
135
  ErrorCallback m_ecb;
137
  // /\}
136
  // \}
138
137
139
private:
138
private:
140
  // / Start protocol operation
139
  /// Start protocol operation
141
  void
140
  void
142
  Start ();
141
  Start ();
143
  // / Queue packet untill we find a route
142
  /// Queue packet untill we find a route
144
  void
143
  void
145
  DeferredRouteOutput (Ptr<const Packet> p, const Ipv4Header & header, UnicastForwardCallback ucb, ErrorCallback ecb);
144
  DeferredRouteOutput (Ptr<const Packet> p, const Ipv4Header & header, UnicastForwardCallback ucb, ErrorCallback ecb);
146
  // / Look for any queued packets to send them out
145
  /// Look for any queued packets to send them out
147
  void
146
  void
148
  LookForQueuedPackets (void);
147
  LookForQueuedPackets (void);
149
  /**
148
  /**
 Lines 153-170    Link Here 
153
   */
152
   */
154
  void
153
  void
155
  SendPacketFromQueue (Ipv4Address dst, Ptr<Ipv4Route> route);
154
  SendPacketFromQueue (Ipv4Address dst, Ptr<Ipv4Route> route);
156
  // / Find socket with local interface address iface
155
  /// Find socket with local interface address iface
157
  Ptr<Socket>
156
  Ptr<Socket>
158
  FindSocketWithInterfaceAddress (Ipv4InterfaceAddress iface) const;
157
  FindSocketWithInterfaceAddress (Ipv4InterfaceAddress iface) const;
159
  // /\name Receive dsdv control packets
158
  ///\name Receive dsdv control packets
160
  // \{
159
  // \{
161
  // / Receive and process dsdv control packet
160
  /// Receive and process dsdv control packet
162
  void
161
  void
163
  RecvDsdv (Ptr<Socket> socket);
162
  RecvDsdv (Ptr<Socket> socket);
164
  // \}
163
  // \}
165
  void
164
  void
166
  Send (Ptr<Ipv4Route>, Ptr<const Packet>, const Ipv4Header &);
165
  Send (Ptr<Ipv4Route>, Ptr<const Packet>, const Ipv4Header &);
167
  // / Create loopback route for given header
166
  /// Create loopback route for given header
168
  Ptr<Ipv4Route>
167
  Ptr<Ipv4Route>
169
  LoopbackRoute (const Ipv4Header & header, Ptr<NetDevice> oif) const;
168
  LoopbackRoute (const Ipv4Header & header, Ptr<NetDevice> oif) const;
170
  /**
169
  /**
 Lines 174-193    Link Here 
174
   */
173
   */
175
  Time
174
  Time
176
  GetSettlingTime (Ipv4Address dst);
175
  GetSettlingTime (Ipv4Address dst);
177
  // / Sends trigger update from a node
176
  /// Sends trigger update from a node
178
  void
177
  void
179
  SendTriggeredUpdate ();
178
  SendTriggeredUpdate ();
180
  // / Broadcasts the entire routing table for every PeriodicUpdateInterval
179
  /// Broadcasts the entire routing table for every PeriodicUpdateInterval
181
  void
180
  void
182
  SendPeriodicUpdate ();
181
  SendPeriodicUpdate ();
183
  void
182
  void
184
  MergeTriggerPeriodicUpdates ();
183
  MergeTriggerPeriodicUpdates ();
185
  // / Notify that packet is dropped for some reason
184
  /// Notify that packet is dropped for some reason
186
  void
185
  void
187
  Drop (Ptr<const Packet>, const Ipv4Header &, Socket::SocketErrno);
186
  Drop (Ptr<const Packet>, const Ipv4Header &, Socket::SocketErrno);
188
  // / Timer to trigger periodic updates from a node
187
  /// Timer to trigger periodic updates from a node
189
  Timer m_periodicUpdateTimer;
188
  Timer m_periodicUpdateTimer;
190
  // / Timer used by the trigger updates in case of Weighted Settling Time is used
189
  /// Timer used by the trigger updates in case of Weighted Settling Time is used
191
  Timer m_triggeredExpireTimer;
190
  Timer m_triggeredExpireTimer;
192
};
191
};
193
192
(-)a/src/dsdv/model/dsdv-rtable.h (-30 / +30 lines)
 Lines 56-62    Link Here 
56
class RoutingTableEntry
56
class RoutingTableEntry
57
{
57
{
58
public:
58
public:
59
  // / c-tor
59
  /// c-tor
60
  RoutingTableEntry (Ptr<NetDevice> dev = 0, Ipv4Address dst = Ipv4Address (), u_int32_t m_seqNo = 0,
60
  RoutingTableEntry (Ptr<NetDevice> dev = 0, Ipv4Address dst = Ipv4Address (), u_int32_t m_seqNo = 0,
61
                     Ipv4InterfaceAddress iface = Ipv4InterfaceAddress (), u_int32_t hops = 0, Ipv4Address nextHop = Ipv4Address (),
61
                     Ipv4InterfaceAddress iface = Ipv4InterfaceAddress (), u_int32_t hops = 0, Ipv4Address nextHop = Ipv4Address (),
62
                     Time lifetime = Simulator::Now (), Time SettlingTime = Simulator::Now (), bool changedEntries = false);
62
                     Time lifetime = Simulator::Now (), Time SettlingTime = Simulator::Now (), bool changedEntries = false);
 Lines 180-190    Link Here 
180
  Print (Ptr<OutputStreamWrapper> stream) const;
180
  Print (Ptr<OutputStreamWrapper> stream) const;
181
181
182
private:
182
private:
183
  // /\name Fields
183
  ///\name Fields
184
  // \{
184
  // \{
185
  // / Destination Sequence Number
185
  /// Destination Sequence Number
186
  uint32_t m_seqNo;
186
  uint32_t m_seqNo;
187
  // / Hop Count (number of hops needed to reach destination)
187
  /// Hop Count (number of hops needed to reach destination)
188
  uint32_t m_hops;
188
  uint32_t m_hops;
189
  /**
189
  /**
190
   * \brief Expiration or deletion time of the route
190
   * \brief Expiration or deletion time of the route
 Lines 200-215    Link Here 
200
   *   - output device
200
   *   - output device
201
   */
201
   */
202
  Ptr<Ipv4Route> m_ipv4Route;
202
  Ptr<Ipv4Route> m_ipv4Route;
203
  // / Output interface address
203
  /// Output interface address
204
  Ipv4InterfaceAddress m_iface;
204
  Ipv4InterfaceAddress m_iface;
205
  // / Routing flags: valid, invalid or in search
205
  /// Routing flags: valid, invalid or in search
206
  RouteFlags m_flag;
206
  RouteFlags m_flag;
207
  // / Time for which the node retains an update with changed metric before broadcasting it.
207
  /// Time for which the node retains an update with changed metric before broadcasting it.
208
  // / A node does that in hope of receiving a better update.
208
  /// A node does that in hope of receiving a better update.
209
  Time m_settlingTime;
209
  Time m_settlingTime;
210
  // / Flag to show if any of the routing table entries were changed with the routing update.
210
  /// Flag to show if any of the routing table entries were changed with the routing update.
211
  uint32_t m_entriesChanged;
211
  uint32_t m_entriesChanged;
212
  // \}
212
  //\}
213
};
213
};
214
214
215
/**
215
/**
 Lines 219-225    Link Here 
219
class RoutingTable
219
class RoutingTable
220
{
220
{
221
public:
221
public:
222
  // / c-tor
222
  /// c-tor
223
  RoutingTable ();
223
  RoutingTable ();
224
  /**
224
  /**
225
   * Add routing table entry if it doesn't yet exist in routing table
225
   * Add routing table entry if it doesn't yet exist in routing table
 Lines 247-260    Link Here 
247
  LookupRoute (Ipv4Address id, RoutingTableEntry & rt, bool forRouteInput);
247
  LookupRoute (Ipv4Address id, RoutingTableEntry & rt, bool forRouteInput);
248
  /**
248
  /**
249
   * Updating the routing Table with routing table entry rt
249
   * Updating the routing Table with routing table entry rt
250
   * \param routing table entry rt
250
   * \param rt routing table entry
251
   * \return true on success
251
   * \return true on success
252
   */
252
   */
253
  bool
253
  bool
254
  Update (RoutingTableEntry & rt);
254
  Update (RoutingTableEntry & rt);
255
  /**
255
  /**
256
   * Lookup list of addresses for which nxtHp is the next Hop address
256
   * Lookup list of addresses for which nxtHp is the next Hop address
257
   * \param nexthop's address for which we want the list of destinations
257
   * \param nxtHp nexthop's address for which we want the list of destinations
258
   * \param dstList is the list that will hold all these destination addresses
258
   * \param dstList is the list that will hold all these destination addresses
259
   */
259
   */
260
  void
260
  void
 Lines 265-299    Link Here 
265
   */
265
   */
266
  void
266
  void
267
  GetListOfAllRoutes (std::map<Ipv4Address, RoutingTableEntry> & allRoutes);
267
  GetListOfAllRoutes (std::map<Ipv4Address, RoutingTableEntry> & allRoutes);
268
  // / Delete all route from interface with address iface
268
  /// Delete all route from interface with address iface
269
  void
269
  void
270
  DeleteAllRoutesFromInterface (Ipv4InterfaceAddress iface);
270
  DeleteAllRoutesFromInterface (Ipv4InterfaceAddress iface);
271
  // / Delete all entries from routing table
271
  /// Delete all entries from routing table
272
  void
272
  void
273
  Clear ()
273
  Clear ()
274
  {
274
  {
275
    m_ipv4AddressEntry.clear ();
275
    m_ipv4AddressEntry.clear ();
276
  }
276
  }
277
  // / Delete all outdated entries if Lifetime is expired
277
  /// Delete all outdated entries if Lifetime is expired
278
  void
278
  void
279
  Purge (std::map<Ipv4Address, RoutingTableEntry> & removedAddresses);
279
  Purge (std::map<Ipv4Address, RoutingTableEntry> & removedAddresses);
280
  // / Print routing table
280
  /// Print routing table
281
  void
281
  void
282
  Print (Ptr<OutputStreamWrapper> stream) const;
282
  Print (Ptr<OutputStreamWrapper> stream) const;
283
  // / Provides the number of routes present in that nodes routing table.
283
  /// Provides the number of routes present in that nodes routing table.
284
  uint32_t
284
  uint32_t
285
  RoutingTableSize ();
285
  RoutingTableSize ();
286
  /**
286
  /**
287
  * Add an event for a destination address so that the update to for that destination is sent
287
  * Add an event for a destination address so that the update to for that destination is sent
288
  * after the event is completed.
288
  * after the event is completed.
289
  * \param destination address for which this event is running.
289
  * \param address destination address for which this event is running.
290
  * \param unique eventid that was generated.
290
  * \param id unique eventid that was generated.
291
  */
291
  */
292
  bool
292
  bool
293
  AddIpv4Event (Ipv4Address, EventId);
293
  AddIpv4Event (Ipv4Address address, EventId id);
294
  /**
294
  /**
295
  * Clear up the entry from the map after the event is completed
295
  * Clear up the entry from the map after the event is completed
296
  * \param destination address for which this event is running.
296
  * \param address destination address for which this event is running.
297
  * \return true on success
297
  * \return true on success
298
  */
298
  */
299
  bool
299
  bool
 Lines 301-307    Link Here 
301
  /**
301
  /**
302
  * Force delete an update waiting for settling time to complete as a better update to
302
  * Force delete an update waiting for settling time to complete as a better update to
303
  * same destination was received.
303
  * same destination was received.
304
  * \param destination address for which this event is running.
304
  * \param address destination address for which this event is running.
305
  * \return true on success
305
  * \return true on success
306
  */
306
  */
307
  bool
307
  bool
 Lines 309-327    Link Here 
309
  /**
309
  /**
310
  * Force delete an update waiting for settling time to complete as a better update to
310
  * Force delete an update waiting for settling time to complete as a better update to
311
  * same destination was received.
311
  * same destination was received.
312
  * \param destination address for which this event is running.
312
  * \param address destination address for which this event is running.
313
  * \return true on finding out that an event is already running for that destination address.
313
  * \return true on finding out that an event is already running for that destination address.
314
  */
314
  */
315
  bool
315
  bool
316
  ForceDeleteIpv4Event (Ipv4Address address);
316
  ForceDeleteIpv4Event (Ipv4Address address);
317
  /**
317
  /**
318
    * Get the EcentId associated with that address.
318
    * Get the EcentId associated with that address.
319
    * \param destination address for which this event is running.
319
    * \param address destination address for which this event is running.
320
    * \return EventId on finding out an event is associated else return NULL.
320
    * \return EventId on finding out an event is associated else return NULL.
321
    */
321
    */
322
  EventId
322
  EventId
323
  GetEventId (Ipv4Address address);
323
  GetEventId (Ipv4Address address);
324
  // /\name Handle life time of invalid route
324
  ///\name Handle life time of invalid route
325
  // \{
325
  // \{
326
  Time Getholddowntime () const
326
  Time Getholddowntime () const
327
  {
327
  {
 Lines 334-346    Link Here 
334
  // \}
334
  // \}
335
335
336
private:
336
private:
337
  // /\name Fields
337
  ///\name Fields
338
  // \{
338
  // \{
339
  // / an entry in the routing table.
339
  /// an entry in the routing table.
340
  std::map<Ipv4Address, RoutingTableEntry> m_ipv4AddressEntry;
340
  std::map<Ipv4Address, RoutingTableEntry> m_ipv4AddressEntry;
341
  // / an entry in the event table.
341
  /// an entry in the event table.
342
  std::map<Ipv4Address, EventId> m_ipv4Events;
342
  std::map<Ipv4Address, EventId> m_ipv4Events;
343
  // /
343
  ///
344
  Time m_holddownTime;
344
  Time m_holddownTime;
345
  // \}
345
  // \}
346
};
346
};
(-)a/src/emu/model/emu-net-device.h (-12 / +12 lines)
 Lines 80-101    Link Here 
80
  /**
80
  /**
81
   * Set the Data Rate used for transmission of packets.
81
   * Set the Data Rate used for transmission of packets.
82
   *
82
   *
83
   * @see Attach ()
83
   * \see Attach ()
84
   * @param bps the data rate at which this object operates
84
   * \param bps the data rate at which this object operates
85
   */
85
   */
86
  void SetDataRate (DataRate bps);
86
  void SetDataRate (DataRate bps);
87
87
88
  /**
88
  /**
89
   * Set a start time for the device.
89
   * Set a start time for the device.
90
   *
90
   *
91
   * @param tStart the start time
91
   * \param tStart the start time
92
   */
92
   */
93
  void Start (Time tStart);
93
  void Start (Time tStart);
94
94
95
  /**
95
  /**
96
   * Set a stop time for the device.
96
   * Set a stop time for the device.
97
   *
97
   *
98
   * @param tStop the stop time
98
   * \param tStop the stop time
99
   */
99
   */
100
  void Stop (Time tStop);
100
  void Stop (Time tStop);
101
101
 Lines 105-120    Link Here 
105
   * The EmuNetDevice "owns" a queue that implements a queueing 
105
   * The EmuNetDevice "owns" a queue that implements a queueing 
106
   * method such as DropTail or RED.
106
   * method such as DropTail or RED.
107
   *
107
   *
108
   * @see Queue
108
   * \see Queue
109
   * @see DropTailQueue
109
   * \see DropTailQueue
110
   * @param queue Ptr to the new queue.
110
   * \param queue Ptr to the new queue.
111
   */
111
   */
112
  void SetQueue (Ptr<Queue> queue);
112
  void SetQueue (Ptr<Queue> queue);
113
113
114
  /**
114
  /**
115
   * Get a copy of the attached Queue.
115
   * Get a copy of the attached Queue.
116
   *
116
   *
117
   * @returns Ptr to the queue.
117
   * \returns Ptr to the queue.
118
   */
118
   */
119
  Ptr<Queue> GetQueue (void) const;
119
  Ptr<Queue> GetQueue (void) const;
120
120
 Lines 275-282    Link Here 
275
275
276
  /**
276
  /**
277
   * Start Sending a Packet Down the Wire.
277
   * Start Sending a Packet Down the Wire.
278
   * @param p packet to send
278
   * \param p packet to send
279
   * @returns true if success, false on failure
279
   * \returns true if success, false on failure
280
   */
280
   */
281
  bool TransmitStart (Ptr<Packet> p);
281
  bool TransmitStart (Ptr<Packet> p);
282
282
 Lines 286-293    Link Here 
286
   * The Queue which this EmuNetDevice uses as a packet source.
286
   * The Queue which this EmuNetDevice uses as a packet source.
287
   * Management of this Queue has been delegated to the EmuNetDevice
287
   * Management of this Queue has been delegated to the EmuNetDevice
288
   * and it has the responsibility for deletion.
288
   * and it has the responsibility for deletion.
289
   * @see class Queue
289
   * \see class Queue
290
   * @see class DropTailQueue
290
   * \see class DropTailQueue
291
   */
291
   */
292
  Ptr<Queue> m_queue;
292
  Ptr<Queue> m_queue;
293
293
(-)a/src/internet/helper/internet-stack-helper.h (-22 / +22 lines)
 Lines 180-191    Link Here 
180
180
181
private:
181
private:
182
  /**
182
  /**
183
   * @brief Enable pcap output the indicated Ipv4 and interface pair.
183
   * \brief Enable pcap output the indicated Ipv4 and interface pair.
184
   * @internal
184
   * \internal
185
   *
185
   *
186
   * @param prefix Filename prefix to use for pcap files.
186
   * \param prefix Filename prefix to use for pcap files.
187
   * @param ipv4 Ptr to the Ipv4 interface on which you want to enable tracing.
187
   * \param ipv4 Ptr to the Ipv4 interface on which you want to enable tracing.
188
   * @param interface Interface ID on the Ipv4 on which you want to enable tracing.
188
   * \param interface Interface ID on the Ipv4 on which you want to enable tracing.
189
   */
189
   */
190
  virtual void EnablePcapIpv4Internal (std::string prefix, 
190
  virtual void EnablePcapIpv4Internal (std::string prefix, 
191
                                       Ptr<Ipv4> ipv4, 
191
                                       Ptr<Ipv4> ipv4, 
 Lines 193-206    Link Here 
193
                                       bool explicitFilename);
193
                                       bool explicitFilename);
194
194
195
  /**
195
  /**
196
   * @brief Enable ascii trace output on the indicated Ipv4 and interface pair.
196
   * \brief Enable ascii trace output on the indicated Ipv4 and interface pair.
197
   * @internal
197
   * \internal
198
   *
198
   *
199
   * @param stream An OutputStreamWrapper representing an existing file to use
199
   * \param stream An OutputStreamWrapper representing an existing file to use
200
   *               when writing trace data.
200
   *               when writing trace data.
201
   * @param prefix Filename prefix to use for ascii trace files.
201
   * \param prefix Filename prefix to use for ascii trace files.
202
   * @param ipv4 Ptr to the Ipv4 interface on which you want to enable tracing.
202
   * \param ipv4 Ptr to the Ipv4 interface on which you want to enable tracing.
203
   * @param interface Interface ID on the Ipv4 on which you want to enable tracing.
203
   * \param interface Interface ID on the Ipv4 on which you want to enable tracing.
204
   */
204
   */
205
  virtual void EnableAsciiIpv4Internal (Ptr<OutputStreamWrapper> stream, 
205
  virtual void EnableAsciiIpv4Internal (Ptr<OutputStreamWrapper> stream, 
206
                                        std::string prefix, 
206
                                        std::string prefix, 
 Lines 209-220    Link Here 
209
                                        bool explicitFilename);
209
                                        bool explicitFilename);
210
210
211
  /**
211
  /**
212
   * @brief Enable pcap output the indicated Ipv4 and interface pair.
212
   * \brief Enable pcap output the indicated Ipv4 and interface pair.
213
   * @internal
213
   * \internal
214
   *
214
   *
215
   * @param prefix Filename prefix to use for pcap files.
215
   * \param prefix Filename prefix to use for pcap files.
216
   * @param ipv4 Ptr to the Ipv4 interface on which you want to enable tracing.
216
   * \param ipv4 Ptr to the Ipv4 interface on which you want to enable tracing.
217
   * @param interface Interface ID on the Ipv4 on which you want to enable tracing.
217
   * \param interface Interface ID on the Ipv4 on which you want to enable tracing.
218
   */
218
   */
219
  virtual void EnablePcapIpv6Internal (std::string prefix, 
219
  virtual void EnablePcapIpv6Internal (std::string prefix, 
220
                                       Ptr<Ipv6> ipv6, 
220
                                       Ptr<Ipv6> ipv6, 
 Lines 222-235    Link Here 
222
                                       bool explicitFilename);
222
                                       bool explicitFilename);
223
223
224
  /**
224
  /**
225
   * @brief Enable ascii trace output on the indicated Ipv4 and interface pair.
225
   * \brief Enable ascii trace output on the indicated Ipv4 and interface pair.
226
   * @internal
226
   * \internal
227
   *
227
   *
228
   * @param stream An OutputStreamWrapper representing an existing file to use
228
   * \param stream An OutputStreamWrapper representing an existing file to use
229
   *               when writing trace data.
229
   *               when writing trace data.
230
   * @param prefix Filename prefix to use for ascii trace files.
230
   * \param prefix Filename prefix to use for ascii trace files.
231
   * @param ipv4 Ptr to the Ipv4 interface on which you want to enable tracing.
231
   * \param ipv4 Ptr to the Ipv4 interface on which you want to enable tracing.
232
   * @param interface Interface ID on the Ipv4 on which you want to enable tracing.
232
   * \param interface Interface ID on the Ipv4 on which you want to enable tracing.
233
   */
233
   */
234
  virtual void EnableAsciiIpv6Internal (Ptr<OutputStreamWrapper> stream, 
234
  virtual void EnableAsciiIpv6Internal (Ptr<OutputStreamWrapper> stream, 
235
                                        std::string prefix, 
235
                                        std::string prefix, 
(-)a/src/internet/helper/internet-trace-helper.h (-171 / +171 lines)
 Lines 29-58    Link Here 
29
namespace ns3 {
29
namespace ns3 {
30
30
31
/**
31
/**
32
 * @brief Base class providing common user-level pcap operations for helpers
32
 * \brief Base class providing common user-level pcap operations for helpers
33
 * representing IPv4 protocols .
33
 * representing IPv4 protocols .
34
 */
34
 */
35
class PcapHelperForIpv4
35
class PcapHelperForIpv4
36
{
36
{
37
public:
37
public:
38
  /**
38
  /**
39
   * @brief Construct a PcapHelperForIpv4.
39
   * \brief Construct a PcapHelperForIpv4.
40
   */
40
   */
41
  PcapHelperForIpv4 () {}
41
  PcapHelperForIpv4 () {}
42
42
43
  /**
43
  /**
44
   * @brief Destroy a PcapHelperForIpv4.
44
   * \brief Destroy a PcapHelperForIpv4.
45
   */
45
   */
46
  virtual ~PcapHelperForIpv4 () {}
46
  virtual ~PcapHelperForIpv4 () {}
47
47
48
  /**
48
  /**
49
   * @brief Enable pcap output the indicated Ipv4 and interface pair.
49
   * \brief Enable pcap output the indicated Ipv4 and interface pair.
50
   * @internal
50
   * \internal
51
   *
51
   *
52
   * @param prefix Filename prefix to use for pcap files.
52
   * \param prefix Filename prefix to use for pcap files.
53
   * @param ipv4 Ptr<Ipv4> on which you want to enable tracing.
53
   * \param ipv4 Ptr<Ipv4> on which you want to enable tracing.
54
   * @param interface Interface on ipv4 on which you want to enable tracing.
54
   * \param interface Interface on ipv4 on which you want to enable tracing.
55
   * @param explicitFilename Treat the prefix as an explicit filename if true
55
   * \param explicitFilename Treat the prefix as an explicit filename if true
56
   */
56
   */
57
  virtual void EnablePcapIpv4Internal (std::string prefix, 
57
  virtual void EnablePcapIpv4Internal (std::string prefix, 
58
                                       Ptr<Ipv4> ipv4, 
58
                                       Ptr<Ipv4> ipv4, 
 Lines 60-95    Link Here 
60
                                       bool explicitFilename) = 0;
60
                                       bool explicitFilename) = 0;
61
61
62
  /**
62
  /**
63
   * @brief Enable pcap output the indicated Ipv4 and interface pair.
63
   * \brief Enable pcap output the indicated Ipv4 and interface pair.
64
   *
64
   *
65
   * @param prefix Filename prefix to use for pcap files.
65
   * \param prefix Filename prefix to use for pcap files.
66
   * @param ipv4 Ptr<Ipv4> on which you want to enable tracing.
66
   * \param ipv4 Ptr<Ipv4> on which you want to enable tracing.
67
   * @param interface Interface on ipv4 on which you want to enable tracing.
67
   * \param interface Interface on ipv4 on which you want to enable tracing.
68
   * @param explicitFilename Treat the prefix as an explicit filename if true.
68
   * \param explicitFilename Treat the prefix as an explicit filename if true.
69
   */
69
   */
70
  void EnablePcapIpv4 (std::string prefix, Ptr<Ipv4> ipv4, uint32_t interface, bool explicitFilename = false);
70
  void EnablePcapIpv4 (std::string prefix, Ptr<Ipv4> ipv4, uint32_t interface, bool explicitFilename = false);
71
71
72
  /**
72
  /**
73
   * @brief Enable pcap output the indicated Ipv4 and interface pair using a
73
   * \brief Enable pcap output the indicated Ipv4 and interface pair using a
74
   * Ptr<Ipv4> previously named using the ns-3 object name service.
74
   * Ptr<Ipv4> previously named using the ns-3 object name service.
75
   *
75
   *
76
   * @param prefix filename prefix to use for pcap files.
76
   * \param prefix filename prefix to use for pcap files.
77
   * @param ipv4Name Name of the Ptr<Ipv4> on which you want to enable tracing.
77
   * \param ipv4Name Name of the Ptr<Ipv4> on which you want to enable tracing.
78
   * @param interface Interface on ipv4 on which you want to enable tracing.
78
   * \param interface Interface on ipv4 on which you want to enable tracing.
79
   * @param explicitFilename Treat the prefix as an explicit filename if true.
79
   * \param explicitFilename Treat the prefix as an explicit filename if true.
80
   */
80
   */
81
  void EnablePcapIpv4 (std::string prefix, std::string ipv4Name, uint32_t interface, bool explicitFilename = false);
81
  void EnablePcapIpv4 (std::string prefix, std::string ipv4Name, uint32_t interface, bool explicitFilename = false);
82
82
83
  /**
83
  /**
84
   * @brief Enable pcap output on each Ipv4 and interface pair in the container.
84
   * \brief Enable pcap output on each Ipv4 and interface pair in the container.
85
   *
85
   *
86
   * @param prefix Filename prefix to use for pcap files.
86
   * \param prefix Filename prefix to use for pcap files.
87
   * @param c Ipv4InterfaceContainer of Ipv4 and interface pairs
87
   * \param c Ipv4InterfaceContainer of Ipv4 and interface pairs
88
   */
88
   */
89
  void EnablePcapIpv4 (std::string prefix, Ipv4InterfaceContainer c);
89
  void EnablePcapIpv4 (std::string prefix, Ipv4InterfaceContainer c);
90
90
91
  /**
91
  /**
92
   * @brief Enable pcap output on all Ipv4 and interface pairs existing in the
92
   * \brief Enable pcap output on all Ipv4 and interface pairs existing in the
93
   * nodes provided in the container.
93
   * nodes provided in the container.
94
   *
94
   *
95
   * \param prefix Filename prefix to use for pcap files.
95
   * \param prefix Filename prefix to use for pcap files.
 Lines 98-145    Link Here 
98
  void EnablePcapIpv4 (std::string prefix, NodeContainer n);
98
  void EnablePcapIpv4 (std::string prefix, NodeContainer n);
99
99
100
  /**
100
  /**
101
   * @brief Enable pcap output on the Ipv4 and interface pair specified by a 
101
   * \brief Enable pcap output on the Ipv4 and interface pair specified by a 
102
   * global node-id (of a previously created node) and interface.  Since there
102
   * global node-id (of a previously created node) and interface.  Since there
103
   * can be only one Ipv4 aggregated to a node, the node-id unambiguously 
103
   * can be only one Ipv4 aggregated to a node, the node-id unambiguously 
104
   * determines the Ipv4.
104
   * determines the Ipv4.
105
   *
105
   *
106
   * @param prefix Filename prefix to use for pcap files.
106
   * \param prefix Filename prefix to use for pcap files.
107
   * @param nodeid The node identifier/number of the node on which to enable tracing.
107
   * \param nodeid The node identifier/number of the node on which to enable tracing.
108
   * @param interface Interface on ipv4 on which you want to enable tracing.
108
   * \param interface Interface on ipv4 on which you want to enable tracing.
109
   * @param explicitFilename Treat the prefix as an explicit filename if true
109
   * \param explicitFilename Treat the prefix as an explicit filename if true
110
   */
110
   */
111
  void EnablePcapIpv4 (std::string prefix, uint32_t nodeid, uint32_t interface, bool explicitFilename);
111
  void EnablePcapIpv4 (std::string prefix, uint32_t nodeid, uint32_t interface, bool explicitFilename);
112
112
113
  /**
113
  /**
114
   * @brief Enable pcap output on all Ipv4 and interface pairs existing in the 
114
   * \brief Enable pcap output on all Ipv4 and interface pairs existing in the 
115
   * set of all nodes created in the simulation.
115
   * set of all nodes created in the simulation.
116
   *
116
   *
117
   * @param prefix Filename prefix to use for pcap files.
117
   * \param prefix Filename prefix to use for pcap files.
118
   */
118
   */
119
  void EnablePcapIpv4All (std::string prefix);
119
  void EnablePcapIpv4All (std::string prefix);
120
120
121
};
121
};
122
122
123
/**
123
/**
124
 * @brief Base class providing common user-level ascii trace operations for 
124
 * \brief Base class providing common user-level ascii trace operations for 
125
 * helpers representing IPv4 protocols .
125
 * helpers representing IPv4 protocols .
126
 */
126
 */
127
class AsciiTraceHelperForIpv4
127
class AsciiTraceHelperForIpv4
128
{
128
{
129
public:
129
public:
130
  /**
130
  /**
131
   * @brief Construct an AsciiTraceHelperForIpv4.
131
   * \brief Construct an AsciiTraceHelperForIpv4.
132
   */
132
   */
133
  AsciiTraceHelperForIpv4 () {}
133
  AsciiTraceHelperForIpv4 () {}
134
134
135
  /**
135
  /**
136
   * @brief Destroy an AsciiTraceHelperForIpv4
136
   * \brief Destroy an AsciiTraceHelperForIpv4
137
   */
137
   */
138
  virtual ~AsciiTraceHelperForIpv4 () {}
138
  virtual ~AsciiTraceHelperForIpv4 () {}
139
139
140
  /**
140
  /**
141
   * @brief Enable ascii trace output on the indicated Ipv4 and interface pair.
141
   * \brief Enable ascii trace output on the indicated Ipv4 and interface pair.
142
   * @internal
142
   * \internal
143
   *
143
   *
144
   * The implementation is expected to use a provided Ptr<OutputStreamWrapper>
144
   * The implementation is expected to use a provided Ptr<OutputStreamWrapper>
145
   * if it is non-null.  If the OutputStreamWrapper is null, the implementation
145
   * if it is non-null.  If the OutputStreamWrapper is null, the implementation
 Lines 155-166    Link Here 
155
   * context could be important, so the helper implementation is expected to 
155
   * context could be important, so the helper implementation is expected to 
156
   * TraceConnect.
156
   * TraceConnect.
157
   *
157
   *
158
   * @param stream An OutputStreamWrapper representing an existing file to use
158
   * \param stream An OutputStreamWrapper representing an existing file to use
159
   *               when writing trace data.
159
   *               when writing trace data.
160
   * @param prefix Filename prefix to use for ascii trace files.
160
   * \param prefix Filename prefix to use for ascii trace files.
161
   * @param ipv4 Ptr<Ipv4> on which you want to enable tracing.
161
   * \param ipv4 Ptr<Ipv4> on which you want to enable tracing.
162
   * @param interface The interface on which you want to enable tracing.
162
   * \param interface The interface on which you want to enable tracing.
163
   * @param explicitFilename Treat the prefix as an explicit filename if true.
163
   * \param explicitFilename Treat the prefix as an explicit filename if true.
164
   */
164
   */
165
  virtual void EnableAsciiIpv4Internal (Ptr<OutputStreamWrapper> stream, 
165
  virtual void EnableAsciiIpv4Internal (Ptr<OutputStreamWrapper> stream, 
166
                                        std::string prefix, 
166
                                        std::string prefix, 
 Lines 169-238    Link Here 
169
                                        bool explicitFilename) = 0;
169
                                        bool explicitFilename) = 0;
170
170
171
  /**
171
  /**
172
   * @brief Enable ascii trace output on the indicated Ipv4 and interface pair.
172
   * \brief Enable ascii trace output on the indicated Ipv4 and interface pair.
173
   *
173
   *
174
   * @param prefix Filename prefix to use for ascii files.
174
   * \param prefix Filename prefix to use for ascii files.
175
   * @param ipv4 Ptr<Ipv4> on which you want to enable tracing.
175
   * \param ipv4 Ptr<Ipv4> on which you want to enable tracing.
176
   * @param interface The interface on which you want to enable tracing.
176
   * \param interface The interface on which you want to enable tracing.
177
   * @param explicitFilename Treat the prefix as an explicit filename if true.
177
   * \param explicitFilename Treat the prefix as an explicit filename if true.
178
   */
178
   */
179
  void EnableAsciiIpv4 (std::string prefix, Ptr<Ipv4> ipv4, uint32_t interface, bool explicitFilename = false);
179
  void EnableAsciiIpv4 (std::string prefix, Ptr<Ipv4> ipv4, uint32_t interface, bool explicitFilename = false);
180
180
181
  /**
181
  /**
182
   * @brief Enable ascii trace output on the indicated Ipv4 and interface pair.
182
   * \brief Enable ascii trace output on the indicated Ipv4 and interface pair.
183
   *
183
   *
184
   * @param stream An OutputStreamWrapper representing an existing file to use
184
   * \param stream An OutputStreamWrapper representing an existing file to use
185
   *               when writing trace data.
185
   *               when writing trace data.
186
   * @param ipv4 Ptr<Ipv4> on which you want to enable tracing.
186
   * \param ipv4 Ptr<Ipv4> on which you want to enable tracing.
187
   * @param interface The interface on which you want to enable tracing.
187
   * \param interface The interface on which you want to enable tracing.
188
   */
188
   */
189
  void EnableAsciiIpv4 (Ptr<OutputStreamWrapper> stream, Ptr<Ipv4> ipv4, uint32_t interface);
189
  void EnableAsciiIpv4 (Ptr<OutputStreamWrapper> stream, Ptr<Ipv4> ipv4, uint32_t interface);
190
190
191
  /**
191
  /**
192
   * @brief Enable ascii trace output the indicated Ipv4 and interface pair
192
   * \brief Enable ascii trace output the indicated Ipv4 and interface pair
193
   * using an Ipv4 previously named using the ns-3 object name service.
193
   * using an Ipv4 previously named using the ns-3 object name service.
194
   *
194
   *
195
   * @param prefix filename prefix to use for ascii files.
195
   * \param prefix filename prefix to use for ascii files.
196
   * @param ipv4Name The name of the Ipv4 on which you want to enable tracing.
196
   * \param ipv4Name The name of the Ipv4 on which you want to enable tracing.
197
   * @param interface The interface on which you want to enable tracing.
197
   * \param interface The interface on which you want to enable tracing.
198
   * @param explicitFilename Treat the prefix as an explicit filename if true.
198
   * \param explicitFilename Treat the prefix as an explicit filename if true.
199
   */
199
   */
200
  void EnableAsciiIpv4 (std::string prefix, std::string ipv4Name, uint32_t interface, bool explicitFilename = false);
200
  void EnableAsciiIpv4 (std::string prefix, std::string ipv4Name, uint32_t interface, bool explicitFilename = false);
201
201
202
  /**
202
  /**
203
   * @brief Enable ascii trace output the indicated net device using a device 
203
   * \brief Enable ascii trace output the indicated net device using a device 
204
   * previously named using the ns-3 object name service.
204
   * previously named using the ns-3 object name service.
205
   *
205
   *
206
   * @param stream An OutputStreamWrapper representing an existing file to use
206
   * \param stream An OutputStreamWrapper representing an existing file to use
207
   *               when writing trace data.
207
   *               when writing trace data.
208
   * @param ipv4Name The name of the Ipv4 on which you want to enable tracing.
208
   * \param ipv4Name The name of the Ipv4 on which you want to enable tracing.
209
   * @param interface The interface on which you want to enable tracing.
209
   * \param interface The interface on which you want to enable tracing.
210
   */
210
   */
211
  void EnableAsciiIpv4 (Ptr<OutputStreamWrapper> stream, std::string ipv4Name, uint32_t interface);
211
  void EnableAsciiIpv4 (Ptr<OutputStreamWrapper> stream, std::string ipv4Name, uint32_t interface);
212
212
213
  /**
213
  /**
214
   * @brief Enable ascii trace output on each Ipv4 and interface pair in the 
214
   * \brief Enable ascii trace output on each Ipv4 and interface pair in the 
215
   * container
215
   * container
216
   *
216
   *
217
   * @param prefix Filename prefix to use for ascii files.
217
   * \param prefix Filename prefix to use for ascii files.
218
   * @param c Ipv4InterfaceContainer of Ipv4 and interface pairs on which to 
218
   * \param c Ipv4InterfaceContainer of Ipv4 and interface pairs on which to 
219
   *          enable tracing.
219
   *          enable tracing.
220
   */
220
   */
221
  void EnableAsciiIpv4 (std::string prefix, Ipv4InterfaceContainer c);
221
  void EnableAsciiIpv4 (std::string prefix, Ipv4InterfaceContainer c);
222
222
223
  /**
223
  /**
224
   * @brief Enable ascii trace output on each device in the container which is
224
   * \brief Enable ascii trace output on each device in the container which is
225
   * of the appropriate type.
225
   * of the appropriate type.
226
   *
226
   *
227
   * @param stream An OutputStreamWrapper representing an existing file to use
227
   * \param stream An OutputStreamWrapper representing an existing file to use
228
   *               when writing trace data.
228
   *               when writing trace data.
229
   * @param c Ipv4InterfaceContainer of Ipv4 and interface pairs on which to 
229
   * \param c Ipv4InterfaceContainer of Ipv4 and interface pairs on which to 
230
   *          enable tracing.
230
   *          enable tracing.
231
   */
231
   */
232
  void EnableAsciiIpv4 (Ptr<OutputStreamWrapper> stream, Ipv4InterfaceContainer c);
232
  void EnableAsciiIpv4 (Ptr<OutputStreamWrapper> stream, Ipv4InterfaceContainer c);
233
233
234
  /**
234
  /**
235
   * @brief Enable ascii trace output on all Ipv4 and interface pairs existing
235
   * \brief Enable ascii trace output on all Ipv4 and interface pairs existing
236
   * in the nodes provided in the container.
236
   * in the nodes provided in the container.
237
   *
237
   *
238
   * \param prefix Filename prefix to use for ascii files.
238
   * \param prefix Filename prefix to use for ascii files.
 Lines 241-305    Link Here 
241
  void EnableAsciiIpv4 (std::string prefix, NodeContainer n);
241
  void EnableAsciiIpv4 (std::string prefix, NodeContainer n);
242
242
243
  /**
243
  /**
244
   * @brief Enable ascii trace output on all Ipv4 and interface pairs existing
244
   * \brief Enable ascii trace output on all Ipv4 and interface pairs existing
245
   * in the nodes provided in the container.
245
   * in the nodes provided in the container.
246
   *
246
   *
247
   * @param stream An OutputStreamWrapper representing an existing file to use
247
   * \param stream An OutputStreamWrapper representing an existing file to use
248
   *               when writing trace data.
248
   *               when writing trace data.
249
   * \param n container of nodes.
249
   * \param n container of nodes.
250
   */
250
   */
251
  void EnableAsciiIpv4 (Ptr<OutputStreamWrapper> stream, NodeContainer n);
251
  void EnableAsciiIpv4 (Ptr<OutputStreamWrapper> stream, NodeContainer n);
252
252
253
  /**
253
  /**
254
   * @brief Enable ascii trace output on all Ipv4 and interface pairs existing
254
   * \brief Enable ascii trace output on all Ipv4 and interface pairs existing
255
   * in the set of all nodes created in the simulation.
255
   * in the set of all nodes created in the simulation.
256
   *
256
   *
257
   * @param prefix Filename prefix to use for ascii files.
257
   * \param prefix Filename prefix to use for ascii files.
258
   */
258
   */
259
  void EnableAsciiIpv4All (std::string prefix);
259
  void EnableAsciiIpv4All (std::string prefix);
260
260
261
  /**
261
  /**
262
   * @brief Enable ascii trace output on each device (which is of the
262
   * \brief Enable ascii trace output on each device (which is of the
263
   * appropriate type) in the set of all nodes created in the simulation.
263
   * appropriate type) in the set of all nodes created in the simulation.
264
   *
264
   *
265
   * @param stream An OutputStreamWrapper representing an existing file to use
265
   * \param stream An OutputStreamWrapper representing an existing file to use
266
   *               when writing trace data.
266
   *               when writing trace data.
267
   */
267
   */
268
  void EnableAsciiIpv4All (Ptr<OutputStreamWrapper> stream);
268
  void EnableAsciiIpv4All (Ptr<OutputStreamWrapper> stream);
269
269
270
  /**
270
  /**
271
   * @brief Enable pcap output on the Ipv4 and interface pair specified by a 
271
   * \brief Enable pcap output on the Ipv4 and interface pair specified by a 
272
   * global node-id (of a previously created node) and interface.  Since there
272
   * global node-id (of a previously created node) and interface.  Since there
273
   * can be only one Ipv4 aggregated to a node, the node-id unambiguously 
273
   * can be only one Ipv4 aggregated to a node, the node-id unambiguously 
274
   * determines the Ipv4.
274
   * determines the Ipv4.
275
   *
275
   *
276
   * @param prefix Filename prefix to use when creating ascii trace files
276
   * \param prefix Filename prefix to use when creating ascii trace files
277
   * @param nodeid The node identifier/number of the node on which to enable
277
   * \param nodeid The node identifier/number of the node on which to enable
278
   *               ascii tracing
278
   *               ascii tracing
279
   * @param deviceid The device identifier/index of the device on which to enable
279
   * \param deviceid The device identifier/index of the device on which to enable
280
   *                 ascii tracing
280
   *                 ascii tracing
281
   * @param explicitFilename Treat the prefix as an explicit filename if true
281
   * \param explicitFilename Treat the prefix as an explicit filename if true
282
   */
282
   */
283
  void EnableAsciiIpv4 (std::string prefix, uint32_t nodeid, uint32_t deviceid, bool explicitFilename);
283
  void EnableAsciiIpv4 (std::string prefix, uint32_t nodeid, uint32_t deviceid, bool explicitFilename);
284
284
285
  /**
285
  /**
286
   * @brief Enable pcap output on the Ipv4 and interface pair specified by a 
286
   * \brief Enable pcap output on the Ipv4 and interface pair specified by a 
287
   * global node-id (of a previously created node) and interface.  Since there
287
   * global node-id (of a previously created node) and interface.  Since there
288
   * can be only one Ipv4 aggregated to a node, the node-id unambiguously 
288
   * can be only one Ipv4 aggregated to a node, the node-id unambiguously 
289
   * determines the Ipv4.
289
   * determines the Ipv4.
290
   *
290
   *
291
   * @param stream An OutputStreamWrapper representing an existing file to use
291
   * \param stream An OutputStreamWrapper representing an existing file to use
292
   *               when writing trace data.
292
   *               when writing trace data.
293
   * @param nodeid The node identifier/number of the node on which to enable
293
   * \param nodeid The node identifier/number of the node on which to enable
294
   *               ascii tracing
294
   *               ascii tracing
295
   * @param interface The interface on which you want to enable tracing.
295
   * \param interface The interface on which you want to enable tracing.
296
   * @param explicitFilename Treat the prefix as an explicit filename if true
296
   * \param explicitFilename Treat the prefix as an explicit filename if true
297
   */
297
   */
298
  void EnableAsciiIpv4 (Ptr<OutputStreamWrapper> stream, uint32_t nodeid, uint32_t interface, bool explicitFilename);
298
  void EnableAsciiIpv4 (Ptr<OutputStreamWrapper> stream, uint32_t nodeid, uint32_t interface, bool explicitFilename);
299
299
300
private:
300
private:
301
  /**
301
  /**
302
   * @internal Avoid code duplication.
302
   * \internal Avoid code duplication.
303
   */
303
   */
304
  void EnableAsciiIpv4Impl (Ptr<OutputStreamWrapper> stream, 
304
  void EnableAsciiIpv4Impl (Ptr<OutputStreamWrapper> stream, 
305
                            std::string prefix, 
305
                            std::string prefix, 
 Lines 308-324    Link Here 
308
                            bool explicitFilename);
308
                            bool explicitFilename);
309
309
310
  /**
310
  /**
311
   * @internal Avoid code duplication.
311
   * \internal Avoid code duplication.
312
   */
312
   */
313
  void EnableAsciiIpv4Impl (Ptr<OutputStreamWrapper> stream, std::string prefix, NodeContainer n);
313
  void EnableAsciiIpv4Impl (Ptr<OutputStreamWrapper> stream, std::string prefix, NodeContainer n);
314
314
315
  /**
315
  /**
316
   * @internal Avoid code duplication.
316
   * \internal Avoid code duplication.
317
   */
317
   */
318
  void EnableAsciiIpv4Impl (Ptr<OutputStreamWrapper> stream, std::string prefix, Ipv4InterfaceContainer c);
318
  void EnableAsciiIpv4Impl (Ptr<OutputStreamWrapper> stream, std::string prefix, Ipv4InterfaceContainer c);
319
319
320
  /**
320
  /**
321
   * @internal Avoid code duplication.
321
   * \internal Avoid code duplication.
322
   */
322
   */
323
  void EnableAsciiIpv4Impl (Ptr<OutputStreamWrapper> stream, 
323
  void EnableAsciiIpv4Impl (Ptr<OutputStreamWrapper> stream, 
324
                            std::string prefix, 
324
                            std::string prefix, 
 Lines 327-333    Link Here 
327
                            bool explicitFilename);
327
                            bool explicitFilename);
328
328
329
  /**
329
  /**
330
   * @internal Avoid code duplication.
330
   * \internal Avoid code duplication.
331
   */
331
   */
332
  void EnableAsciiIpv4Impl (Ptr<OutputStreamWrapper> stream, 
332
  void EnableAsciiIpv4Impl (Ptr<OutputStreamWrapper> stream, 
333
                            std::string prefix, 
333
                            std::string prefix, 
 Lines 337-366    Link Here 
337
};
337
};
338
338
339
/**
339
/**
340
 * @brief Base class providing common user-level pcap operations for helpers
340
 * \brief Base class providing common user-level pcap operations for helpers
341
 * representing IPv6 protocols .
341
 * representing IPv6 protocols .
342
 */
342
 */
343
class PcapHelperForIpv6
343
class PcapHelperForIpv6
344
{
344
{
345
public:
345
public:
346
  /**
346
  /**
347
   * @brief Construct a PcapHelperForIpv6.
347
   * \brief Construct a PcapHelperForIpv6.
348
   */
348
   */
349
  PcapHelperForIpv6 () {}
349
  PcapHelperForIpv6 () {}
350
350
351
  /**
351
  /**
352
   * @brief Destroy a PcapHelperForIpv6
352
   * \brief Destroy a PcapHelperForIpv6
353
   */
353
   */
354
  virtual ~PcapHelperForIpv6 () {}
354
  virtual ~PcapHelperForIpv6 () {}
355
355
356
  /**
356
  /**
357
   * @brief Enable pcap output the indicated Ipv6 and interface pair.
357
   * \brief Enable pcap output the indicated Ipv6 and interface pair.
358
   * @internal
358
   * \internal
359
   *
359
   *
360
   * @param prefix Filename prefix to use for pcap files.
360
   * \param prefix Filename prefix to use for pcap files.
361
   * @param ipv6 Ptr<Ipv6> on which you want to enable tracing.
361
   * \param ipv6 Ptr<Ipv6> on which you want to enable tracing.
362
   * @param interface Interface on ipv6 on which you want to enable tracing.
362
   * \param interface Interface on ipv6 on which you want to enable tracing.
363
   * @param explicitFilename Treat the prefix as an explicit filename if true.
363
   * \param explicitFilename Treat the prefix as an explicit filename if true.
364
   */
364
   */
365
  virtual void EnablePcapIpv6Internal (std::string prefix, 
365
  virtual void EnablePcapIpv6Internal (std::string prefix, 
366
                                       Ptr<Ipv6> ipv6, 
366
                                       Ptr<Ipv6> ipv6, 
 Lines 368-403    Link Here 
368
                                       bool explicitFilename) = 0;
368
                                       bool explicitFilename) = 0;
369
369
370
  /**
370
  /**
371
   * @brief Enable pcap output the indicated Ipv6 and interface pair.
371
   * \brief Enable pcap output the indicated Ipv6 and interface pair.
372
   *
372
   *
373
   * @param prefix Filename prefix to use for pcap files.
373
   * \param prefix Filename prefix to use for pcap files.
374
   * @param ipv6 Ptr<Ipv6> on which you want to enable tracing.
374
   * \param ipv6 Ptr<Ipv6> on which you want to enable tracing.
375
   * @param interface Interface on ipv6 on which you want to enable tracing.
375
   * \param interface Interface on ipv6 on which you want to enable tracing.
376
   * @param explicitFilename Treat the prefix as an explicit filename if true.
376
   * \param explicitFilename Treat the prefix as an explicit filename if true.
377
   */
377
   */
378
  void EnablePcapIpv6 (std::string prefix, Ptr<Ipv6> ipv6, uint32_t interface, bool explicitFilename = false);
378
  void EnablePcapIpv6 (std::string prefix, Ptr<Ipv6> ipv6, uint32_t interface, bool explicitFilename = false);
379
379
380
  /**
380
  /**
381
   * @brief Enable pcap output the indicated Ipv6 and interface pair using a
381
   * \brief Enable pcap output the indicated Ipv6 and interface pair using a
382
   * Ptr<Ipv6> previously named using the ns-3 object name service.
382
   * Ptr<Ipv6> previously named using the ns-3 object name service.
383
   *
383
   *
384
   * @param prefix filename prefix to use for pcap files.
384
   * \param prefix filename prefix to use for pcap files.
385
   * @param ipv6Name Name of the Ptr<Ipv6> on which you want to enable tracing.
385
   * \param ipv6Name Name of the Ptr<Ipv6> on which you want to enable tracing.
386
   * @param interface Interface on ipv6 on which you want to enable tracing.
386
   * \param interface Interface on ipv6 on which you want to enable tracing.
387
   * @param explicitFilename Treat the prefix as an explicit filename if true.
387
   * \param explicitFilename Treat the prefix as an explicit filename if true.
388
   */
388
   */
389
  void EnablePcapIpv6 (std::string prefix, std::string ipv6Name, uint32_t interface, bool explicitFilename = false);
389
  void EnablePcapIpv6 (std::string prefix, std::string ipv6Name, uint32_t interface, bool explicitFilename = false);
390
390
391
  /**
391
  /**
392
   * @brief Enable pcap output on each Ipv6 and interface pair in the container.
392
   * \brief Enable pcap output on each Ipv6 and interface pair in the container.
393
   *
393
   *
394
   * @param prefix Filename prefix to use for pcap files.
394
   * \param prefix Filename prefix to use for pcap files.
395
   * @param c Ipv6InterfaceContainer of Ipv6 and interface pairs
395
   * \param c Ipv6InterfaceContainer of Ipv6 and interface pairs
396
   */
396
   */
397
  void EnablePcapIpv6 (std::string prefix, Ipv6InterfaceContainer c);
397
  void EnablePcapIpv6 (std::string prefix, Ipv6InterfaceContainer c);
398
398
399
  /**
399
  /**
400
   * @brief Enable pcap output on all Ipv6 and interface pairs existing in the
400
   * \brief Enable pcap output on all Ipv6 and interface pairs existing in the
401
   * nodes provided in the container.
401
   * nodes provided in the container.
402
   *
402
   *
403
   * \param prefix Filename prefix to use for pcap files.
403
   * \param prefix Filename prefix to use for pcap files.
 Lines 406-452    Link Here 
406
  void EnablePcapIpv6 (std::string prefix, NodeContainer n);
406
  void EnablePcapIpv6 (std::string prefix, NodeContainer n);
407
407
408
  /**
408
  /**
409
   * @brief Enable pcap output on the Ipv6 and interface pair specified by a 
409
   * \brief Enable pcap output on the Ipv6 and interface pair specified by a 
410
   * global node-id (of a previously created node) and interface.  Since there
410
   * global node-id (of a previously created node) and interface.  Since there
411
   * can be only one Ipv6 aggregated to a node, the node-id unambiguously 
411
   * can be only one Ipv6 aggregated to a node, the node-id unambiguously 
412
   * determines the Ipv6.
412
   * determines the Ipv6.
413
   *
413
   *
414
   * @param prefix Filename prefix to use for pcap files.
414
   * \param prefix Filename prefix to use for pcap files.
415
   * @param nodeid The node identifier/number of the node on which to enable tracing.
415
   * \param nodeid The node identifier/number of the node on which to enable tracing.
416
   * @param interface Interface on ipv6 on which you want to enable tracing.
416
   * \param interface Interface on ipv6 on which you want to enable tracing.
417
   * @param explicitFilename Treat the prefix as an explicit filename if true
417
   * \param explicitFilename Treat the prefix as an explicit filename if true
418
   */
418
   */
419
  void EnablePcapIpv6 (std::string prefix, uint32_t nodeid, uint32_t interface, bool explicitFilename);
419
  void EnablePcapIpv6 (std::string prefix, uint32_t nodeid, uint32_t interface, bool explicitFilename);
420
420
421
  /**
421
  /**
422
   * @brief Enable pcap output on all Ipv6 and interface pairs existing in the 
422
   * \brief Enable pcap output on all Ipv6 and interface pairs existing in the 
423
   * set of all nodes created in the simulation.
423
   * set of all nodes created in the simulation.
424
   *
424
   *
425
   * @param prefix Filename prefix to use for pcap files.
425
   * \param prefix Filename prefix to use for pcap files.
426
   */
426
   */
427
  void EnablePcapIpv6All (std::string prefix);
427
  void EnablePcapIpv6All (std::string prefix);
428
};
428
};
429
429
430
/**
430
/**
431
 * @brief Base class providing common user-level ascii trace operations for
431
 * \brief Base class providing common user-level ascii trace operations for
432
 * helpers representing IPv6 protocols .
432
 * helpers representing IPv6 protocols .
433
 */
433
 */
434
class AsciiTraceHelperForIpv6
434
class AsciiTraceHelperForIpv6
435
{
435
{
436
public:
436
public:
437
  /**
437
  /**
438
   * @brief Construct an AsciiTraceHelperForIpv6.
438
   * \brief Construct an AsciiTraceHelperForIpv6.
439
   */
439
   */
440
  AsciiTraceHelperForIpv6 () {}
440
  AsciiTraceHelperForIpv6 () {}
441
441
442
  /**
442
  /**
443
   * @brief Destroy an AsciiTraceHelperForIpv6
443
   * \brief Destroy an AsciiTraceHelperForIpv6
444
   */
444
   */
445
  virtual ~AsciiTraceHelperForIpv6 () {}
445
  virtual ~AsciiTraceHelperForIpv6 () {}
446
446
447
  /**
447
  /**
448
   * @brief Enable ascii trace output on the indicated Ipv6 and interface pair.
448
   * \brief Enable ascii trace output on the indicated Ipv6 and interface pair.
449
   * @internal
449
   * \internal
450
   *
450
   *
451
   * The implementation is expected to use a provided Ptr<OutputStreamWrapper>
451
   * The implementation is expected to use a provided Ptr<OutputStreamWrapper>
452
   * if it is non-null.  If the OutputStreamWrapper is null, the implementation
452
   * if it is non-null.  If the OutputStreamWrapper is null, the implementation
 Lines 462-473    Link Here 
462
   * context could be important, so the helper implementation is expected to 
462
   * context could be important, so the helper implementation is expected to 
463
   * TraceConnect.
463
   * TraceConnect.
464
   *
464
   *
465
   * @param stream An OutputStreamWrapper representing an existing file to use
465
   * \param stream An OutputStreamWrapper representing an existing file to use
466
   *               when writing trace data.
466
   *               when writing trace data.
467
   * @param prefix Filename prefix to use for ascii trace files.
467
   * \param prefix Filename prefix to use for ascii trace files.
468
   * @param ipv6 Ptr<Ipv6> on which you want to enable tracing.
468
   * \param ipv6 Ptr<Ipv6> on which you want to enable tracing.
469
   * @param interface The interface on which you want to enable tracing.
469
   * \param interface The interface on which you want to enable tracing.
470
   * @param explicitFilename Treat the prefix as an explicit filename if true.
470
   * \param explicitFilename Treat the prefix as an explicit filename if true.
471
   */
471
   */
472
  virtual void EnableAsciiIpv6Internal (Ptr<OutputStreamWrapper> stream, 
472
  virtual void EnableAsciiIpv6Internal (Ptr<OutputStreamWrapper> stream, 
473
                                        std::string prefix, 
473
                                        std::string prefix, 
 Lines 476-545    Link Here 
476
                                        bool explicitFilename) = 0;
476
                                        bool explicitFilename) = 0;
477
477
478
  /**
478
  /**
479
   * @brief Enable ascii trace output on the indicated Ipv6 and interface pair.
479
   * \brief Enable ascii trace output on the indicated Ipv6 and interface pair.
480
   *
480
   *
481
   * @param prefix Filename prefix to use for ascii files.
481
   * \param prefix Filename prefix to use for ascii files.
482
   * @param ipv6 Ptr<Ipv6> on which you want to enable tracing.
482
   * \param ipv6 Ptr<Ipv6> on which you want to enable tracing.
483
   * @param interface The interface on which you want to enable tracing.
483
   * \param interface The interface on which you want to enable tracing.
484
   * @param explicitFilename Treat the prefix as an explicit filename if true.
484
   * \param explicitFilename Treat the prefix as an explicit filename if true.
485
   */
485
   */
486
  void EnableAsciiIpv6 (std::string prefix, Ptr<Ipv6> ipv6, uint32_t interface, bool explicitFilename = false);
486
  void EnableAsciiIpv6 (std::string prefix, Ptr<Ipv6> ipv6, uint32_t interface, bool explicitFilename = false);
487
487
488
  /**
488
  /**
489
   * @brief Enable ascii trace output on the indicated Ipv6 and interface pair.
489
   * \brief Enable ascii trace output on the indicated Ipv6 and interface pair.
490
   *
490
   *
491
   * @param stream An OutputStreamWrapper representing an existing file to use
491
   * \param stream An OutputStreamWrapper representing an existing file to use
492
   *               when writing trace data.
492
   *               when writing trace data.
493
   * @param ipv6 Ptr<Ipv6> on which you want to enable tracing.
493
   * \param ipv6 Ptr<Ipv6> on which you want to enable tracing.
494
   * @param interface The interface on which you want to enable tracing.
494
   * \param interface The interface on which you want to enable tracing.
495
   */
495
   */
496
  void EnableAsciiIpv6 (Ptr<OutputStreamWrapper> stream, Ptr<Ipv6> ipv6, uint32_t interface);
496
  void EnableAsciiIpv6 (Ptr<OutputStreamWrapper> stream, Ptr<Ipv6> ipv6, uint32_t interface);
497
497
498
  /**
498
  /**
499
   * @brief Enable ascii trace output the indicated Ipv6 and interface pair
499
   * \brief Enable ascii trace output the indicated Ipv6 and interface pair
500
   * using an Ipv6 previously named using the ns-3 object name service.
500
   * using an Ipv6 previously named using the ns-3 object name service.
501
   *
501
   *
502
   * @param prefix filename prefix to use for ascii files.
502
   * \param prefix filename prefix to use for ascii files.
503
   * @param ipv6Name The name of the Ipv6 on which you want to enable tracing.
503
   * \param ipv6Name The name of the Ipv6 on which you want to enable tracing.
504
   * @param interface The interface on which you want to enable tracing.
504
   * \param interface The interface on which you want to enable tracing.
505
   * @param explicitFilename Treat the prefix as an explicit filename if true.
505
   * \param explicitFilename Treat the prefix as an explicit filename if true.
506
   */
506
   */
507
  void EnableAsciiIpv6 (std::string prefix, std::string ipv6Name, uint32_t interface, bool explicitFilename = false);
507
  void EnableAsciiIpv6 (std::string prefix, std::string ipv6Name, uint32_t interface, bool explicitFilename = false);
508
508
509
  /**
509
  /**
510
   * @brief Enable ascii trace output the indicated net device using a device 
510
   * \brief Enable ascii trace output the indicated net device using a device 
511
   * previously named using the ns-3 object name service.
511
   * previously named using the ns-3 object name service.
512
   *
512
   *
513
   * @param stream An OutputStreamWrapper representing an existing file to use
513
   * \param stream An OutputStreamWrapper representing an existing file to use
514
   *               when writing trace data.
514
   *               when writing trace data.
515
   * @param ipv6Name The name of the Ipv6 on which you want to enable tracing.
515
   * \param ipv6Name The name of the Ipv6 on which you want to enable tracing.
516
   * @param interface The interface on which you want to enable tracing.
516
   * \param interface The interface on which you want to enable tracing.
517
   */
517
   */
518
  void EnableAsciiIpv6 (Ptr<OutputStreamWrapper> stream, std::string ipv6Name, uint32_t interface); 
518
  void EnableAsciiIpv6 (Ptr<OutputStreamWrapper> stream, std::string ipv6Name, uint32_t interface); 
519
519
520
  /**
520
  /**
521
   * @brief Enable ascii trace output on each Ipv6 and interface pair in the 
521
   * \brief Enable ascii trace output on each Ipv6 and interface pair in the 
522
   * container
522
   * container
523
   *
523
   *
524
   * @param prefix Filename prefix to use for ascii files.
524
   * \param prefix Filename prefix to use for ascii files.
525
   * @param c Ipv6InterfaceContainer of Ipv6 and interface pairs on which to 
525
   * \param c Ipv6InterfaceContainer of Ipv6 and interface pairs on which to 
526
   *          enable tracing.
526
   *          enable tracing.
527
   */
527
   */
528
  void EnableAsciiIpv6 (std::string prefix, Ipv6InterfaceContainer c);
528
  void EnableAsciiIpv6 (std::string prefix, Ipv6InterfaceContainer c);
529
529
530
  /**
530
  /**
531
   * @brief Enable ascii trace output on each device in the container which is
531
   * \brief Enable ascii trace output on each device in the container which is
532
   * of the appropriate type.
532
   * of the appropriate type.
533
   *
533
   *
534
   * @param stream An OutputStreamWrapper representing an existing file to use
534
   * \param stream An OutputStreamWrapper representing an existing file to use
535
   *               when writing trace data.
535
   *               when writing trace data.
536
   * @param c Ipv6InterfaceContainer of Ipv6 and interface pairs on which to 
536
   * \param c Ipv6InterfaceContainer of Ipv6 and interface pairs on which to 
537
   *          enable tracing.
537
   *          enable tracing.
538
   */
538
   */
539
  void EnableAsciiIpv6 (Ptr<OutputStreamWrapper> stream, Ipv6InterfaceContainer c);
539
  void EnableAsciiIpv6 (Ptr<OutputStreamWrapper> stream, Ipv6InterfaceContainer c);
540
540
541
  /**
541
  /**
542
   * @brief Enable ascii trace output on all Ipv6 and interface pairs existing
542
   * \brief Enable ascii trace output on all Ipv6 and interface pairs existing
543
   * in the nodes provided in the container.
543
   * in the nodes provided in the container.
544
   *
544
   *
545
   * \param prefix Filename prefix to use for ascii files.
545
   * \param prefix Filename prefix to use for ascii files.
 Lines 548-611    Link Here 
548
  void EnableAsciiIpv6 (std::string prefix, NodeContainer n);
548
  void EnableAsciiIpv6 (std::string prefix, NodeContainer n);
549
549
550
  /**
550
  /**
551
   * @brief Enable ascii trace output on all Ipv6 and interface pairs existing
551
   * \brief Enable ascii trace output on all Ipv6 and interface pairs existing
552
   * in the nodes provided in the container.
552
   * in the nodes provided in the container.
553
   *
553
   *
554
   * @param stream An OutputStreamWrapper representing an existing file to use
554
   * \param stream An OutputStreamWrapper representing an existing file to use
555
   *               when writing trace data.
555
   *               when writing trace data.
556
   * \param n container of nodes.
556
   * \param n container of nodes.
557
   */
557
   */
558
  void EnableAsciiIpv6 (Ptr<OutputStreamWrapper> stream, NodeContainer n);
558
  void EnableAsciiIpv6 (Ptr<OutputStreamWrapper> stream, NodeContainer n);
559
559
560
  /**
560
  /**
561
   * @brief Enable pcap output on the Ipv6 and interface pair specified by a 
561
   * \brief Enable pcap output on the Ipv6 and interface pair specified by a 
562
   * global node-id (of a previously created node) and interface.  Since there
562
   * global node-id (of a previously created node) and interface.  Since there
563
   * can be only one Ipv6 aggregated to a node, the node-id unambiguously 
563
   * can be only one Ipv6 aggregated to a node, the node-id unambiguously 
564
   * determines the Ipv6.
564
   * determines the Ipv6.
565
   *
565
   *
566
   * @param prefix Filename prefix to use when creating ascii trace files
566
   * \param prefix Filename prefix to use when creating ascii trace files
567
   * @param nodeid The node identifier/number of the node on which to enable
567
   * \param nodeid The node identifier/number of the node on which to enable
568
   *               ascii tracing
568
   *               ascii tracing
569
   * @param interface The device identifier/index of the device on which to enable
569
   * \param interface The device identifier/index of the device on which to enable
570
   *               ascii tracing
570
   *               ascii tracing
571
   * @param explicitFilename Treat the prefix as an explicit filename if true.
571
   * \param explicitFilename Treat the prefix as an explicit filename if true.
572
   */
572
   */
573
  void EnableAsciiIpv6 (std::string prefix, uint32_t nodeid, uint32_t interface, bool explicitFilename);
573
  void EnableAsciiIpv6 (std::string prefix, uint32_t nodeid, uint32_t interface, bool explicitFilename);
574
574
575
  /**
575
  /**
576
   * @brief Enable pcap output on the Ipv6 and interface pair specified by a 
576
   * \brief Enable pcap output on the Ipv6 and interface pair specified by a 
577
   * global node-id (of a previously created node) and interface.  Since there
577
   * global node-id (of a previously created node) and interface.  Since there
578
   * can be only one Ipv6 aggregated to a node, the node-id unambiguously 
578
   * can be only one Ipv6 aggregated to a node, the node-id unambiguously 
579
   * determines the Ipv6.
579
   * determines the Ipv6.
580
   *
580
   *
581
   * @param stream An OutputStreamWrapper representing an existing file to use
581
   * \param stream An OutputStreamWrapper representing an existing file to use
582
   *               when writing trace data.
582
   *               when writing trace data.
583
   * @param nodeid The node identifier/number of the node on which to enable
583
   * \param nodeid The node identifier/number of the node on which to enable
584
   *               ascii tracing
584
   *               ascii tracing
585
   * @param interface The interface on which you want to enable tracing.
585
   * \param interface The interface on which you want to enable tracing.
586
   */
586
   */
587
  void EnableAsciiIpv6 (Ptr<OutputStreamWrapper> stream, uint32_t nodeid, uint32_t interface);
587
  void EnableAsciiIpv6 (Ptr<OutputStreamWrapper> stream, uint32_t nodeid, uint32_t interface);
588
588
589
  /**
589
  /**
590
   * @brief Enable ascii trace output on all Ipv6 and interface pairs existing
590
   * \brief Enable ascii trace output on all Ipv6 and interface pairs existing
591
   * in the set of all nodes created in the simulation.
591
   * in the set of all nodes created in the simulation.
592
   *
592
   *
593
   * @param prefix Filename prefix to use for ascii files.
593
   * \param prefix Filename prefix to use for ascii files.
594
   */
594
   */
595
  void EnableAsciiIpv6All (std::string prefix);
595
  void EnableAsciiIpv6All (std::string prefix);
596
596
597
  /**
597
  /**
598
   * @brief Enable ascii trace output on each device (which is of the
598
   * \brief Enable ascii trace output on each device (which is of the
599
   * appropriate type) in the set of all nodes created in the simulation.
599
   * appropriate type) in the set of all nodes created in the simulation.
600
   *
600
   *
601
   * @param stream An OutputStreamWrapper representing an existing file to use
601
   * \param stream An OutputStreamWrapper representing an existing file to use
602
   *               when writing trace data.
602
   *               when writing trace data.
603
   */
603
   */
604
  void EnableAsciiIpv6All (Ptr<OutputStreamWrapper> stream);
604
  void EnableAsciiIpv6All (Ptr<OutputStreamWrapper> stream);
605
605
606
private:
606
private:
607
  /**
607
  /**
608
   * @internal Avoid code duplication.
608
   * \internal Avoid code duplication.
609
   */
609
   */
610
  void EnableAsciiIpv6Impl (Ptr<OutputStreamWrapper> stream, 
610
  void EnableAsciiIpv6Impl (Ptr<OutputStreamWrapper> stream, 
611
                            std::string prefix, 
611
                            std::string prefix, 
 Lines 614-630    Link Here 
614
                            bool explicitFilename);
614
                            bool explicitFilename);
615
615
616
  /**
616
  /**
617
   * @internal Avoid code duplication.
617
   * \internal Avoid code duplication.
618
   */
618
   */
619
  void EnableAsciiIpv6Impl (Ptr<OutputStreamWrapper> stream, std::string prefix, NodeContainer n);
619
  void EnableAsciiIpv6Impl (Ptr<OutputStreamWrapper> stream, std::string prefix, NodeContainer n);
620
620
621
  /**
621
  /**
622
   * @internal Avoid code duplication.
622
   * \internal Avoid code duplication.
623
   */
623
   */
624
  void EnableAsciiIpv6Impl (Ptr<OutputStreamWrapper> stream, std::string prefix, Ipv6InterfaceContainer c);
624
  void EnableAsciiIpv6Impl (Ptr<OutputStreamWrapper> stream, std::string prefix, Ipv6InterfaceContainer c);
625
625
626
  /**
626
  /**
627
   * @internal Avoid code duplication.
627
   * \internal Avoid code duplication.
628
   */
628
   */
629
  void EnableAsciiIpv6Impl (Ptr<OutputStreamWrapper> stream, 
629
  void EnableAsciiIpv6Impl (Ptr<OutputStreamWrapper> stream, 
630
                            std::string prefix, 
630
                            std::string prefix, 
 Lines 633-639    Link Here 
633
                            bool explicitFilename);
633
                            bool explicitFilename);
634
634
635
  /**
635
  /**
636
   * @internal Avoid code duplication.
636
   * \internal Avoid code duplication.
637
   */
637
   */
638
  void EnableAsciiIpv6Impl (Ptr<OutputStreamWrapper> stream, 
638
  void EnableAsciiIpv6Impl (Ptr<OutputStreamWrapper> stream, 
639
                            std::string prefix, 
639
                            std::string prefix, 
(-)a/src/internet/helper/ipv4-address-helper.h (-23 / +23 lines)
 Lines 26-32    Link Here 
26
namespace ns3 {
26
namespace ns3 {
27
27
28
/**
28
/**
29
 * @brief A helper class to make life easier while doing simple IPv4 address
29
 * \brief A helper class to make life easier while doing simple IPv4 address
30
 * assignment in scripts.
30
 * assignment in scripts.
31
 *
31
 *
32
 * This class is a very simple IPv4 address generator.  You can think of it
32
 * This class is a very simple IPv4 address generator.  You can think of it
 Lines 40-58    Link Here 
40
 * We do call into the global address generator to make sure that there are
40
 * We do call into the global address generator to make sure that there are
41
 * no duplicate addresses generated.
41
 * no duplicate addresses generated.
42
 *
42
 *
43
 * @see Ipv4AddressGenerator
43
 * \see Ipv4AddressGenerator
44
 */
44
 */
45
class Ipv4AddressHelper
45
class Ipv4AddressHelper
46
{
46
{
47
public:
47
public:
48
/**
48
/**
49
 * @brief Construct a helper class to make life easier while doing simple IPv4
49
 * \brief Construct a helper class to make life easier while doing simple IPv4
50
 * address assignment in scripts.
50
 * address assignment in scripts.
51
 */
51
 */
52
  Ipv4AddressHelper ();
52
  Ipv4AddressHelper ();
53
53
54
/**
54
/**
55
 * @brief Construct a helper class to make life easier while doing simple IPv4
55
 * \brief Construct a helper class to make life easier while doing simple IPv4
56
 * address assignment in scripts.  This version sets the base and mask
56
 * address assignment in scripts.  This version sets the base and mask
57
 * in the constructor
57
 * in the constructor
58
 */
58
 */
 Lines 60-66    Link Here 
60
                     Ipv4Address base = "0.0.0.1");
60
                     Ipv4Address base = "0.0.0.1");
61
61
62
/**
62
/**
63
 * @brief Set the base network number, network mask and base address.
63
 * \brief Set the base network number, network mask and base address.
64
 *
64
 *
65
 * The address helper allocates IP addresses based on a given network number
65
 * The address helper allocates IP addresses based on a given network number
66
 * and mask combination along with an initial IP address.
66
 * and mask combination along with an initial IP address.
 Lines 79-98    Link Here 
79
 *
79
 *
80
 * and the first address generated will be 192.168.1.1.
80
 * and the first address generated will be 192.168.1.1.
81
 *
81
 *
82
 * @param network The Ipv4Address containing the initial network number to
82
 * \param network The Ipv4Address containing the initial network number to
83
 * use during allocation.  The bits outside the network mask are not used.
83
 * use during allocation.  The bits outside the network mask are not used.
84
 * @param mask The Ipv4Mask containing one bits in each bit position of the 
84
 * \param mask The Ipv4Mask containing one bits in each bit position of the 
85
 * network number.
85
 * network number.
86
 * @param base An optional Ipv4Address containing the initial address used for 
86
 * \param base An optional Ipv4Address containing the initial address used for 
87
 * IP address allocation.  Will be combined (ORed) with the network number to
87
 * IP address allocation.  Will be combined (ORed) with the network number to
88
 * generate the first IP address.  Defaults to 0.0.0.1.
88
 * generate the first IP address.  Defaults to 0.0.0.1.
89
 * @returns Nothing.
89
 * \returns Nothing.
90
 */
90
 */
91
  void SetBase (Ipv4Address network, Ipv4Mask mask, 
91
  void SetBase (Ipv4Address network, Ipv4Mask mask, 
92
                Ipv4Address base = "0.0.0.1");
92
                Ipv4Address base = "0.0.0.1");
93
93
94
/**
94
/**
95
 * @brief Increment the network number and reset the IP address counter to 
95
 * \brief Increment the network number and reset the IP address counter to 
96
 * the base value provided in the SetBase method.
96
 * the base value provided in the SetBase method.
97
 *
97
 *
98
 * The address helper allocates IP addresses based on a given network number
98
 * The address helper allocates IP addresses based on a given network number
 Lines 112-126    Link Here 
112
 * allocated addresses returned by NewAddress would be 192.168.2.3, 
112
 * allocated addresses returned by NewAddress would be 192.168.2.3, 
113
 * 192.168.2.4, etc.
113
 * 192.168.2.4, etc.
114
 *
114
 *
115
 * @returns The value of the incremented network number that will be used in
115
 * \returns The value of the incremented network number that will be used in
116
 * following address allocations.
116
 * following address allocations.
117
 * @see SetBase
117
 * \see SetBase
118
 * @see NewAddress
118
 * \see NewAddress
119
 */
119
 */
120
  Ipv4Address NewNetwork (void);
120
  Ipv4Address NewNetwork (void);
121
121
122
/**
122
/**
123
 * @brief Increment the IP address counter used to allocate IP addresses
123
 * \brief Increment the IP address counter used to allocate IP addresses
124
 *
124
 *
125
 * The address helper allocates IP addresses based on a given network number
125
 * The address helper allocates IP addresses based on a given network number
126
 * and initial IP address.  In order to separate the network number and IP 
126
 * and initial IP address.  In order to separate the network number and IP 
 Lines 139-152    Link Here 
139
 * 192.168.0.4, etc., until the 253rd call which would assert due to an address
139
 * 192.168.0.4, etc., until the 253rd call which would assert due to an address
140
 * overflow.
140
 * overflow.
141
 *
141
 *
142
 * @returns The value of the newly allocated IP address.
142
 * \returns The value of the newly allocated IP address.
143
 * @see SetBase
143
 * \see SetBase
144
 * @see NewNetwork
144
 * \see NewNetwork
145
 */
145
 */
146
  Ipv4Address NewAddress (void);
146
  Ipv4Address NewAddress (void);
147
147
148
/**
148
/**
149
 * @brief Assign IP addresses to the net devices specified in the container
149
 * \brief Assign IP addresses to the net devices specified in the container
150
 * based on the current network prefix and address base.
150
 * based on the current network prefix and address base.
151
 *
151
 *
152
 * The address helper allocates IP addresses based on a given network number
152
 * The address helper allocates IP addresses based on a given network number
 Lines 166-183    Link Here 
166
 * the addresses overflow the number of bits allocated for them by the network 
166
 * the addresses overflow the number of bits allocated for them by the network 
167
 * mask in the SetBase method, the system will NS_ASSERT and halt.
167
 * mask in the SetBase method, the system will NS_ASSERT and halt.
168
 *
168
 *
169
 * @param c The NetDeviceContainer holding the collection of net devices we
169
 * \param c The NetDeviceContainer holding the collection of net devices we
170
 * are asked to assign Ipv4 addresses to.
170
 * are asked to assign Ipv4 addresses to.
171
 *
171
 *
172
 * @returns Nothing
172
 * \returns Nothing
173
 * @see SetBase
173
 * \see SetBase
174
 * @see NewNetwork
174
 * \see NewNetwork
175
 */
175
 */
176
  Ipv4InterfaceContainer Assign (const NetDeviceContainer &c);
176
  Ipv4InterfaceContainer Assign (const NetDeviceContainer &c);
177
177
178
private:
178
private:
179
  /**
179
  /**
180
   * @internal
180
   * \internal
181
   */
181
   */
182
  uint32_t NumAddressBits (uint32_t maskbits) const;
182
  uint32_t NumAddressBits (uint32_t maskbits) const;
183
183
(-)a/src/internet/helper/ipv4-interface-container.h (-6 / +6 lines)
 Lines 26-33    Link Here 
26
 * an identical index into the Ipv4InterfaceContainer that has a std::pair with
26
 * an identical index into the Ipv4InterfaceContainer that has a std::pair with
27
 * the Ptr<Ipv4> and interface index you need to play with the interface.
27
 * the Ptr<Ipv4> and interface index you need to play with the interface.
28
 *
28
 *
29
 * @see Ipv4AddressHelper
29
 * \see Ipv4AddressHelper
30
 * @see Ipv4
30
 * \see Ipv4
31
 */
31
 */
32
class Ipv4InterfaceContainer
32
class Ipv4InterfaceContainer
33
{
33
{
 Lines 133-139    Link Here 
133
   * \param ipv4 pointer to Ipv4 object
133
   * \param ipv4 pointer to Ipv4 object
134
   * \param interface interface index of the Ipv4Interface to add to the container
134
   * \param interface interface index of the Ipv4Interface to add to the container
135
   *
135
   *
136
   * @see Ipv4InterfaceContainer
136
   * \see Ipv4InterfaceContainer
137
   */
137
   */
138
  void Add (Ptr<Ipv4> ipv4, uint32_t interface);
138
  void Add (Ptr<Ipv4> ipv4, uint32_t interface);
139
139
 Lines 143-149    Link Here 
143
   *
143
   *
144
   * \param ipInterfacePair the pair of a pointer to Ipv4 object and interface index of the Ipv4Interface to add to the container
144
   * \param ipInterfacePair the pair of a pointer to Ipv4 object and interface index of the Ipv4Interface to add to the container
145
   *
145
   *
146
   * @see Ipv4InterfaceContainer
146
   * \see Ipv4InterfaceContainer
147
   */
147
   */
148
  void Add (std::pair<Ptr<Ipv4>, uint32_t> ipInterfacePair);
148
  void Add (std::pair<Ptr<Ipv4>, uint32_t> ipInterfacePair);
149
149
 Lines 155-161    Link Here 
155
   *        has been previously named using the Object Name Service.
155
   *        has been previously named using the Object Name Service.
156
   * \param interface interface index of the Ipv4Interface to add to the container
156
   * \param interface interface index of the Ipv4Interface to add to the container
157
   *
157
   *
158
   * @see Ipv4InterfaceContainer
158
   * \see Ipv4InterfaceContainer
159
   */
159
   */
160
  void Add (std::string ipv4Name, uint32_t interface);
160
  void Add (std::string ipv4Name, uint32_t interface);
161
161
 Lines 165-171    Link Here 
165
   *
165
   *
166
   * \param i the index of the entery to retrieve.
166
   * \param i the index of the entery to retrieve.
167
   *
167
   *
168
   * @see Ipv4InterfaceContainer
168
   * \see Ipv4InterfaceContainer
169
   */
169
   */
170
  std::pair<Ptr<Ipv4>, uint32_t> Get (uint32_t i) const;
170
  std::pair<Ptr<Ipv4>, uint32_t> Get (uint32_t i) const;
171
171
(-)a/src/internet/model/candidate-queue.h (-38 / +38 lines)
 Lines 50-154    Link Here 
50
{
50
{
51
public:
51
public:
52
/**
52
/**
53
 * @brief Create an empty SPF Candidate Queue.
53
 * \brief Create an empty SPF Candidate Queue.
54
 * @internal
54
 * \internal
55
 *
55
 *
56
 * @see SPFVertex
56
 * \see SPFVertex
57
 */
57
 */
58
  CandidateQueue ();
58
  CandidateQueue ();
59
59
60
/**
60
/**
61
 * @internal Destroy an SPF Candidate Queue and release any resources held 
61
 * \internal Destroy an SPF Candidate Queue and release any resources held 
62
 * by the contents.
62
 * by the contents.
63
 * @internal
63
 * \internal
64
 *
64
 *
65
 * @see SPFVertex
65
 * \see SPFVertex
66
 */
66
 */
67
  virtual ~CandidateQueue ();
67
  virtual ~CandidateQueue ();
68
68
69
/**
69
/**
70
 * @brief Empty the Candidate Queue and release all of the resources 
70
 * \brief Empty the Candidate Queue and release all of the resources 
71
 * associated with the Shortest Path First Vertex pointers in the queue.
71
 * associated with the Shortest Path First Vertex pointers in the queue.
72
 * @internal
72
 * \internal
73
 *
73
 *
74
 * @see SPFVertex
74
 * \see SPFVertex
75
 */
75
 */
76
  void Clear (void);
76
  void Clear (void);
77
77
78
/**
78
/**
79
 * @brief Push a Shortest Path First Vertex pointer onto the queue according
79
 * \brief Push a Shortest Path First Vertex pointer onto the queue according
80
 * to the priority scheme.
80
 * to the priority scheme.
81
 * @internal
81
 * \internal
82
 * 
82
 * 
83
 * On completion, the top of the queue will hold the Shortest Path First
83
 * On completion, the top of the queue will hold the Shortest Path First
84
 * Vertex pointer that points to a vertex having lowest value of the field
84
 * Vertex pointer that points to a vertex having lowest value of the field
85
 * m_distanceFromRoot.  Remaining vertices are ordered according to 
85
 * m_distanceFromRoot.  Remaining vertices are ordered according to 
86
 * increasing distance.
86
 * increasing distance.
87
 *
87
 *
88
 * @see SPFVertex
88
 * \see SPFVertex
89
 * @param vNew The Shortest Path First Vertex to add to the queue.
89
 * \param vNew The Shortest Path First Vertex to add to the queue.
90
 */
90
 */
91
  void Push (SPFVertex *vNew);
91
  void Push (SPFVertex *vNew);
92
92
93
/**
93
/**
94
 * @brief Pop the Shortest Path First Vertex pointer at the top of the queue.
94
 * \brief Pop the Shortest Path First Vertex pointer at the top of the queue.
95
 * @internal
95
 * \internal
96
 *
96
 *
97
 * The caller is given the responsibility for releasing the resources 
97
 * The caller is given the responsibility for releasing the resources 
98
 * associated with the vertex.
98
 * associated with the vertex.
99
 *
99
 *
100
 * @see SPFVertex
100
 * \see SPFVertex
101
 * @see Top ()
101
 * \see Top ()
102
 * @returns The Shortest Path First Vertex pointer at the top of the queue.
102
 * \returns The Shortest Path First Vertex pointer at the top of the queue.
103
 */
103
 */
104
  SPFVertex* Pop (void);
104
  SPFVertex* Pop (void);
105
105
106
/**
106
/**
107
 * @brief Return the Shortest Path First Vertex pointer at the top of the 
107
 * \brief Return the Shortest Path First Vertex pointer at the top of the 
108
 * queue.
108
 * queue.
109
 * @internal
109
 * \internal
110
 *
110
 *
111
 * This method does not pop the SPFVertex* off of the queue, it simply 
111
 * This method does not pop the SPFVertex* off of the queue, it simply 
112
 * returns the pointer.
112
 * returns the pointer.
113
 *
113
 *
114
 * @see SPFVertex
114
 * \see SPFVertex
115
 * @see Pop ()
115
 * \see Pop ()
116
 * @returns The Shortest Path First Vertex pointer at the top of the queue.
116
 * \returns The Shortest Path First Vertex pointer at the top of the queue.
117
 */
117
 */
118
  SPFVertex* Top (void) const;
118
  SPFVertex* Top (void) const;
119
119
120
/**
120
/**
121
 * @brief Test the Candidate Queue to determine if it is empty.
121
 * \brief Test the Candidate Queue to determine if it is empty.
122
 * @internal
122
 * \internal
123
 *
123
 *
124
 * @returns True if the queue is empty, false otherwise.
124
 * \returns True if the queue is empty, false otherwise.
125
 */
125
 */
126
  bool Empty (void) const;
126
  bool Empty (void) const;
127
127
128
/**
128
/**
129
 * @brief Return the number of Shortest Path First Vertex pointers presently
129
 * \brief Return the number of Shortest Path First Vertex pointers presently
130
 * stored in the Candidate Queue.
130
 * stored in the Candidate Queue.
131
 * @internal
131
 * \internal
132
 *
132
 *
133
 * @see SPFVertex
133
 * \see SPFVertex
134
 * @returns The number of SPFVertex* pointers in the Candidate Queue.
134
 * \returns The number of SPFVertex* pointers in the Candidate Queue.
135
 */
135
 */
136
  uint32_t Size (void) const;
136
  uint32_t Size (void) const;
137
137
138
/**
138
/**
139
 * @brief Searches the Candidate Queue for a Shortest Path First Vertex 
139
 * \brief Searches the Candidate Queue for a Shortest Path First Vertex 
140
 * pointer that points to a vertex having the given IP address.
140
 * pointer that points to a vertex having the given IP address.
141
 * @internal
141
 * \internal
142
 *
142
 *
143
 * @see SPFVertex
143
 * \see SPFVertex
144
 * @param addr The IP address to search for.
144
 * \param addr The IP address to search for.
145
 * @returns The SPFVertex* pointer corresponding to the given IP address.
145
 * \returns The SPFVertex* pointer corresponding to the given IP address.
146
 */
146
 */
147
  SPFVertex* Find (const Ipv4Address addr) const;
147
  SPFVertex* Find (const Ipv4Address addr) const;
148
148
149
/**
149
/**
150
 * @brief Reorders the Candidate Queue according to the priority scheme.
150
 * \brief Reorders the Candidate Queue according to the priority scheme.
151
 * @internal
151
 * \internal
152
 * 
152
 * 
153
 * On completion, the top of the queue will hold the Shortest Path First
153
 * On completion, the top of the queue will hold the Shortest Path First
154
 * Vertex pointer that points to a vertex having lowest value of the field
154
 * Vertex pointer that points to a vertex having lowest value of the field
 Lines 158-164    Link Here 
158
 * This method is provided in case the values of m_distanceFromRoot change
158
 * This method is provided in case the values of m_distanceFromRoot change
159
 * during the routing calculations.
159
 * during the routing calculations.
160
 *
160
 *
161
 * @see SPFVertex
161
 * \see SPFVertex
162
 */
162
 */
163
  void Reorder (void);
163
  void Reorder (void);
164
164
(-)a/src/internet/model/global-route-manager-impl.h (-132 / +132 lines)
 Lines 40-46    Link Here 
40
class Ipv4GlobalRouting;
40
class Ipv4GlobalRouting;
41
41
42
/**
42
/**
43
 * @brief Vertex used in shortest path first (SPF) computations. See RFC 2328,
43
 * \brief Vertex used in shortest path first (SPF) computations. See RFC 2328,
44
 * Section 16.
44
 * Section 16.
45
 *
45
 *
46
 * Each router in the simulation is associated with an SPFVertex object.  When
46
 * Each router in the simulation is associated with an SPFVertex object.  When
 Lines 67-74    Link Here 
67
{
67
{
68
public:
68
public:
69
/**
69
/**
70
 * @brief Enumeration of the possible types of SPFVertex objects.
70
 * \brief Enumeration of the possible types of SPFVertex objects.
71
 * @internal
71
 * \internal
72
 *
72
 *
73
 * Currently we use VertexRouter to identify objects that represent a router 
73
 * Currently we use VertexRouter to identify objects that represent a router 
74
 * in the simulation topology, and VertexNetwork to identify objects that 
74
 * in the simulation topology, and VertexNetwork to identify objects that 
 Lines 81-89    Link Here 
81
  };
81
  };
82
82
83
/**
83
/**
84
 * @brief Construct an empty ("uninitialized") SPFVertex (Shortest Path First 
84
 * \brief Construct an empty ("uninitialized") SPFVertex (Shortest Path First 
85
 * Vertex).
85
 * Vertex).
86
 * @internal
86
 * \internal
87
 *
87
 *
88
 * The Vertex Type is set to VertexUnknown, the Vertex ID is set to 
88
 * The Vertex Type is set to VertexUnknown, the Vertex ID is set to 
89
 * 255.255.255.255, and the distance from root is set to infinity 
89
 * 255.255.255.255, and the distance from root is set to infinity 
 Lines 92-104    Link Here 
92
 * infinity, the next hop address is set to 0.0.0.0 and the list of children
92
 * infinity, the next hop address is set to 0.0.0.0 and the list of children
93
 * of the SPFVertex is initialized to empty.
93
 * of the SPFVertex is initialized to empty.
94
 *
94
 *
95
 * @see VertexType
95
 * \see VertexType
96
 */
96
 */
97
  SPFVertex();
97
  SPFVertex();
98
98
99
/**
99
/**
100
 * @brief Construct an initialized SPFVertex (Shortest Path First Vertex).
100
 * \brief Construct an initialized SPFVertex (Shortest Path First Vertex).
101
 * @internal
101
 * \internal
102
 *
102
 *
103
 * The Vertex Type is initialized to VertexRouter and the Vertex ID is found
103
 * The Vertex Type is initialized to VertexRouter and the Vertex ID is found
104
 * from the Link State ID of the Link State Advertisement (LSA) passed as a
104
 * from the Link State ID of the Link State Advertisement (LSA) passed as a
 Lines 107-156    Link Here 
107
 * these members, initialization is as in the default constructor.
107
 * these members, initialization is as in the default constructor.
108
 * of the SPFVertex is initialized to empty.
108
 * of the SPFVertex is initialized to empty.
109
 *
109
 *
110
 * @see SPFVertex::SPFVertex ()
110
 * \see SPFVertex::SPFVertex ()
111
 * @see VertexType
111
 * \see VertexType
112
 * @see GlobalRoutingLSA
112
 * \see GlobalRoutingLSA
113
 * @param lsa The Link State Advertisement used for finding initial values.
113
 * \param lsa The Link State Advertisement used for finding initial values.
114
 */
114
 */
115
  SPFVertex(GlobalRoutingLSA* lsa);
115
  SPFVertex(GlobalRoutingLSA* lsa);
116
116
117
/**
117
/**
118
 * @brief Destroy an SPFVertex (Shortest Path First Vertex).
118
 * \brief Destroy an SPFVertex (Shortest Path First Vertex).
119
 * @internal
119
 * \internal
120
 *
120
 *
121
 * The children vertices of the SPFVertex are recursively deleted.
121
 * The children vertices of the SPFVertex are recursively deleted.
122
 *
122
 *
123
 * @see SPFVertex::SPFVertex ()
123
 * \see SPFVertex::SPFVertex ()
124
 */
124
 */
125
  ~SPFVertex();
125
  ~SPFVertex();
126
126
127
/**
127
/**
128
 * @brief Get the Vertex Type field of a SPFVertex object.
128
 * \brief Get the Vertex Type field of a SPFVertex object.
129
 * @internal
129
 * \internal
130
 *
130
 *
131
 * The Vertex Type describes the kind of simulation object a given SPFVertex
131
 * The Vertex Type describes the kind of simulation object a given SPFVertex
132
 * represents.
132
 * represents.
133
 *
133
 *
134
 * @see VertexType
134
 * \see VertexType
135
 * @returns The VertexType of the current SPFVertex object.
135
 * \returns The VertexType of the current SPFVertex object.
136
 */
136
 */
137
  VertexType GetVertexType (void) const;
137
  VertexType GetVertexType (void) const;
138
138
139
/**
139
/**
140
 * @brief Set the Vertex Type field of a SPFVertex object.
140
 * \brief Set the Vertex Type field of a SPFVertex object.
141
 * @internal
141
 * \internal
142
 *
142
 *
143
 * The Vertex Type describes the kind of simulation object a given SPFVertex
143
 * The Vertex Type describes the kind of simulation object a given SPFVertex
144
 * represents.
144
 * represents.
145
 *
145
 *
146
 * @see VertexType
146
 * \see VertexType
147
 * @param type The new VertexType for the current SPFVertex object.
147
 * \param type The new VertexType for the current SPFVertex object.
148
 */
148
 */
149
  void SetVertexType (VertexType type);
149
  void SetVertexType (VertexType type);
150
150
151
/**
151
/**
152
 * @brief Get the Vertex ID field of a SPFVertex object.
152
 * \brief Get the Vertex ID field of a SPFVertex object.
153
 * @internal
153
 * \internal
154
 *
154
 *
155
 * The Vertex ID uniquely identifies the simulation object a given SPFVertex
155
 * The Vertex ID uniquely identifies the simulation object a given SPFVertex
156
 * represents.  Typically, this is the Router ID for SPFVertex objects 
156
 * represents.  Typically, this is the Router ID for SPFVertex objects 
 Lines 160-172    Link Here 
160
 * beginning at 0.0.0.0 and monotonically increasing as new routers are
160
 * beginning at 0.0.0.0 and monotonically increasing as new routers are
161
 * instantiated.
161
 * instantiated.
162
 *
162
 *
163
 * @returns The Ipv4Address Vertex ID of the current SPFVertex object.
163
 * \returns The Ipv4Address Vertex ID of the current SPFVertex object.
164
 */
164
 */
165
  Ipv4Address GetVertexId (void) const;
165
  Ipv4Address GetVertexId (void) const;
166
166
167
/**
167
/**
168
 * @brief Set the Vertex ID field of a SPFVertex object.
168
 * \brief Set the Vertex ID field of a SPFVertex object.
169
 * @internal
169
 * \internal
170
 *
170
 *
171
 * The Vertex ID uniquely identifies the simulation object a given SPFVertex
171
 * The Vertex ID uniquely identifies the simulation object a given SPFVertex
172
 * represents.  Typically, this is the Router ID for SPFVertex objects 
172
 * represents.  Typically, this is the Router ID for SPFVertex objects 
 Lines 177-219    Link Here 
177
 * instantiated.  This method is an explicit override of the automatically
177
 * instantiated.  This method is an explicit override of the automatically
178
 * generated value.
178
 * generated value.
179
 *
179
 *
180
 * @param id The new Ipv4Address Vertex ID for the current SPFVertex object.
180
 * \param id The new Ipv4Address Vertex ID for the current SPFVertex object.
181
 */
181
 */
182
  void SetVertexId (Ipv4Address id);
182
  void SetVertexId (Ipv4Address id);
183
183
184
/**
184
/**
185
 * @brief Get the Global Router Link State Advertisement returned by the 
185
 * \brief Get the Global Router Link State Advertisement returned by the 
186
 * Global Router represented by this SPFVertex during the route discovery 
186
 * Global Router represented by this SPFVertex during the route discovery 
187
 * process.
187
 * process.
188
 * @internal
188
 * \internal
189
 *
189
 *
190
 * @see GlobalRouter
190
 * \see GlobalRouter
191
 * @see GlobalRoutingLSA
191
 * \see GlobalRoutingLSA
192
 * @see GlobalRouter::DiscoverLSAs ()
192
 * \see GlobalRouter::DiscoverLSAs ()
193
 * @returns A pointer to the GlobalRoutingLSA found by the router represented
193
 * \returns A pointer to the GlobalRoutingLSA found by the router represented
194
 * by this SPFVertex object.
194
 * by this SPFVertex object.
195
 */
195
 */
196
  GlobalRoutingLSA* GetLSA (void) const;
196
  GlobalRoutingLSA* GetLSA (void) const;
197
197
198
/**
198
/**
199
 * @brief Set the Global Router Link State Advertisement returned by the 
199
 * \brief Set the Global Router Link State Advertisement returned by the 
200
 * Global Router represented by this SPFVertex during the route discovery 
200
 * Global Router represented by this SPFVertex during the route discovery 
201
 * process.
201
 * process.
202
 * @internal
202
 * \internal
203
 *
203
 *
204
 * @see SPFVertex::GetLSA ()
204
 * \see SPFVertex::GetLSA ()
205
 * @see GlobalRouter
205
 * \see GlobalRouter
206
 * @see GlobalRoutingLSA
206
 * \see GlobalRoutingLSA
207
 * @see GlobalRouter::DiscoverLSAs ()
207
 * \see GlobalRouter::DiscoverLSAs ()
208
 * @warning Ownership of the LSA is transferred to the "this" SPFVertex.  You
208
 * \warning Ownership of the LSA is transferred to the "this" SPFVertex.  You
209
 * must not delete the LSA after calling this method.
209
 * must not delete the LSA after calling this method.
210
 * @param lsa A pointer to the GlobalRoutingLSA.
210
 * \param lsa A pointer to the GlobalRoutingLSA.
211
 */
211
 */
212
  void SetLSA (GlobalRoutingLSA* lsa);
212
  void SetLSA (GlobalRoutingLSA* lsa);
213
213
214
/**
214
/**
215
 * @brief Get the distance from the root vertex to "this" SPFVertex object.
215
 * \brief Get the distance from the root vertex to "this" SPFVertex object.
216
 * @internal
216
 * \internal
217
 *
217
 *
218
 * Each router in the simulation is associated with an SPFVertex object.  When
218
 * Each router in the simulation is associated with an SPFVertex object.  When
219
 * calculating routes, each of these routers is, in turn, chosen as the "root"
219
 * calculating routes, each of these routers is, in turn, chosen as the "root"
 Lines 230-242    Link Here 
230
 * The distance is calculated during route discovery and is stored in a
230
 * The distance is calculated during route discovery and is stored in a
231
 * member variable.  This method simply fetches that value.
231
 * member variable.  This method simply fetches that value.
232
 *
232
 *
233
 * @returns The distance, in hops, from the root SPFVertex to "this" SPFVertex.
233
 * \returns The distance, in hops, from the root SPFVertex to "this" SPFVertex.
234
 */
234
 */
235
  uint32_t GetDistanceFromRoot (void) const;
235
  uint32_t GetDistanceFromRoot (void) const;
236
236
237
/**
237
/**
238
 * @brief Set the distance from the root vertex to "this" SPFVertex object.
238
 * \brief Set the distance from the root vertex to "this" SPFVertex object.
239
 * @internal
239
 * \internal
240
 *
240
 *
241
 * Each router in the simulation is associated with an SPFVertex object.  When
241
 * Each router in the simulation is associated with an SPFVertex object.  When
242
 * calculating routes, each of these routers is, in turn, chosen as the "root"
242
 * calculating routes, each of these routers is, in turn, chosen as the "root"
 Lines 250-264    Link Here 
250
 * we're asking for is the number of hops from the root vertex to the vertex
250
 * we're asking for is the number of hops from the root vertex to the vertex
251
 * in question.
251
 * in question.
252
 *
252
 *
253
 * @param distance The distance, in hops, from the root SPFVertex to "this"
253
 * \param distance The distance, in hops, from the root SPFVertex to "this"
254
 * SPFVertex.
254
 * SPFVertex.
255
 */
255
 */
256
  void SetDistanceFromRoot (uint32_t distance);
256
  void SetDistanceFromRoot (uint32_t distance);
257
257
258
/**
258
/**
259
 * @brief Set the IP address and outgoing interface index that should be used 
259
 * \brief Set the IP address and outgoing interface index that should be used 
260
 * to begin forwarding packets from the root SPFVertex to "this" SPFVertex.
260
 * to begin forwarding packets from the root SPFVertex to "this" SPFVertex.
261
 * @internal
261
 * \internal
262
 *
262
 *
263
 * Each router node in the simulation is associated with an SPFVertex object.
263
 * Each router node in the simulation is associated with an SPFVertex object.
264
 * When calculating routes, each of these routers is, in turn, chosen as the 
264
 * When calculating routes, each of these routers is, in turn, chosen as the 
 Lines 289-308    Link Here 
289
 * In this method we are telling the root node which exit direction it should send
289
 * In this method we are telling the root node which exit direction it should send
290
 * should I send a packet to the network or host represented by 'this' SPFVertex.
290
 * should I send a packet to the network or host represented by 'this' SPFVertex.
291
 *
291
 *
292
 * @see GlobalRouter
292
 * \see GlobalRouter
293
 * @see GlobalRoutingLSA
293
 * \see GlobalRoutingLSA
294
 * @see GlobalRoutingLinkRecord
294
 * \see GlobalRoutingLinkRecord
295
 * @param nextHop The IP address to use when forwarding packets to the host
295
 * \param nextHop The IP address to use when forwarding packets to the host
296
 * or network represented by "this" SPFVertex.
296
 * or network represented by "this" SPFVertex.
297
 * @param id The interface index to use when forwarding packets to the host or
297
 * \param id The interface index to use when forwarding packets to the host or
298
 * network represented by "this" SPFVertex.
298
 * network represented by "this" SPFVertex.
299
 */
299
 */
300
  void SetRootExitDirection (Ipv4Address nextHop, int32_t id = SPF_INFINITY);
300
  void SetRootExitDirection (Ipv4Address nextHop, int32_t id = SPF_INFINITY);
301
  typedef std::pair<Ipv4Address, int32_t> NodeExit_t;
301
  typedef std::pair<Ipv4Address, int32_t> NodeExit_t;
302
/**
302
/**
303
 * @brief Set the IP address and outgoing interface index that should be used 
303
 * \brief Set the IP address and outgoing interface index that should be used 
304
 * to begin forwarding packets from the root SPFVertex to "this" SPFVertex.
304
 * to begin forwarding packets from the root SPFVertex to "this" SPFVertex.
305
 * @internal
305
 * \internal
306
 *
306
 *
307
 * Each router node in the simulation is associated with an SPFVertex object.
307
 * Each router node in the simulation is associated with an SPFVertex object.
308
 * When calculating routes, each of these routers is, in turn, chosen as the 
308
 * When calculating routes, each of these routers is, in turn, chosen as the 
 Lines 333-344    Link Here 
333
 * In this method we are telling the root node which exit direction it should send
333
 * In this method we are telling the root node which exit direction it should send
334
 * should I send a packet to the network or host represented by 'this' SPFVertex.
334
 * should I send a packet to the network or host represented by 'this' SPFVertex.
335
 *
335
 *
336
 * @see GlobalRouter
336
 * \see GlobalRouter
337
 * @see GlobalRoutingLSA
337
 * \see GlobalRoutingLSA
338
 * @see GlobalRoutingLinkRecord
338
 * \see GlobalRoutingLinkRecord
339
 * @param nextHop The IP address to use when forwarding packets to the host
339
 * \param nextHop The IP address to use when forwarding packets to the host
340
 * or network represented by "this" SPFVertex.
340
 * or network represented by "this" SPFVertex.
341
 * @param exit The pair of next-hop-IP and outgoing-interface-index to use when 
341
 * \param exit The pair of next-hop-IP and outgoing-interface-index to use when 
342
 * forwarding packets to the host or network represented by "this" SPFVertex.
342
 * forwarding packets to the host or network represented by "this" SPFVertex.
343
 */
343
 */
344
  void SetRootExitDirection (SPFVertex::NodeExit_t exit);
344
  void SetRootExitDirection (SPFVertex::NodeExit_t exit);
 Lines 386-394    Link Here 
386
  uint32_t GetNRootExitDirections () const;
386
  uint32_t GetNRootExitDirections () const;
387
387
388
/**
388
/**
389
 * @brief Get a pointer to the SPFVector that is the parent of "this" 
389
 * \brief Get a pointer to the SPFVector that is the parent of "this" 
390
 * SPFVertex.
390
 * SPFVertex.
391
 * @internal
391
 * \internal
392
 *
392
 *
393
 * Each router node in the simulation is associated with an SPFVertex object.
393
 * Each router node in the simulation is associated with an SPFVertex object.
394
 * When calculating routes, each of these routers is, in turn, chosen as the 
394
 * When calculating routes, each of these routers is, in turn, chosen as the 
 Lines 401-416    Link Here 
401
 * This method returns a pointer to the parent node of "this" SPFVertex
401
 * This method returns a pointer to the parent node of "this" SPFVertex
402
 * (both of which reside in that SPF tree).
402
 * (both of which reside in that SPF tree).
403
 *
403
 *
404
 * @param i The index to one of the parents
404
 * \param i The index to one of the parents
405
 * @returns A pointer to the SPFVertex that is the parent of "this" SPFVertex
405
 * \returns A pointer to the SPFVertex that is the parent of "this" SPFVertex
406
 * in the SPF tree.
406
 * in the SPF tree.
407
 */
407
 */
408
  SPFVertex* GetParent (uint32_t i = 0) const;
408
  SPFVertex* GetParent (uint32_t i = 0) const;
409
409
410
/**
410
/**
411
 * @brief Set the pointer to the SPFVector that is the parent of "this" 
411
 * \brief Set the pointer to the SPFVector that is the parent of "this" 
412
 * SPFVertex.
412
 * SPFVertex.
413
 * @internal
413
 * \internal
414
 *
414
 *
415
 * Each router node in the simulation is associated with an SPFVertex object.
415
 * Each router node in the simulation is associated with an SPFVertex object.
416
 * When calculating routes, each of these routers is, in turn, chosen as the 
416
 * When calculating routes, each of these routers is, in turn, chosen as the 
 Lines 423-429    Link Here 
423
 * This method sets the parent pointer of "this" SPFVertex (both of which
423
 * This method sets the parent pointer of "this" SPFVertex (both of which
424
 * reside in that SPF tree).
424
 * reside in that SPF tree).
425
 *
425
 *
426
 * @param parent A pointer to the SPFVertex that is the parent of "this" 
426
 * \param parent A pointer to the SPFVertex that is the parent of "this" 
427
 * SPFVertex* in the SPF tree.
427
 * SPFVertex* in the SPF tree.
428
 */
428
 */
429
  void SetParent (SPFVertex* parent);
429
  void SetParent (SPFVertex* parent);
 Lines 437-444    Link Here 
437
  void MergeParent (const SPFVertex* v);
437
  void MergeParent (const SPFVertex* v);
438
438
439
/**
439
/**
440
 * @brief Get the number of children of "this" SPFVertex.
440
 * \brief Get the number of children of "this" SPFVertex.
441
 * @internal
441
 * \internal
442
 *
442
 *
443
 * Each router node in the simulation is associated with an SPFVertex object.
443
 * Each router node in the simulation is associated with an SPFVertex object.
444
 * When calculating routes, each of these routers is, in turn, chosen as the 
444
 * When calculating routes, each of these routers is, in turn, chosen as the 
 Lines 453-467    Link Here 
453
 * This method returns the number of children of "this" SPFVertex (which 
453
 * This method returns the number of children of "this" SPFVertex (which 
454
 * reside in the SPF tree).
454
 * reside in the SPF tree).
455
 *
455
 *
456
 * @returns The number of children of "this" SPFVertex (which reside in the
456
 * \returns The number of children of "this" SPFVertex (which reside in the
457
 * SPF tree).
457
 * SPF tree).
458
 */
458
 */
459
  uint32_t GetNChildren (void) const;
459
  uint32_t GetNChildren (void) const;
460
460
461
/**
461
/**
462
 * @brief Get a borrowed SPFVertex pointer to the specified child of "this" 
462
 * \brief Get a borrowed SPFVertex pointer to the specified child of "this" 
463
 * SPFVertex.
463
 * SPFVertex.
464
 * @internal
464
 * \internal
465
 *
465
 *
466
 * Each router node in the simulation is associated with an SPFVertex object.
466
 * Each router node in the simulation is associated with an SPFVertex object.
467
 * When calculating routes, each of these routers is, in turn, chosen as the 
467
 * When calculating routes, each of these routers is, in turn, chosen as the 
 Lines 476-496    Link Here 
476
 * This method the number of children of "this" SPFVertex (which reside in
476
 * This method the number of children of "this" SPFVertex (which reside in
477
 * the SPF tree.
477
 * the SPF tree.
478
 *
478
 *
479
 * @see SPFVertex::GetNChildren
479
 * \see SPFVertex::GetNChildren
480
 * @param n The index (from 0 to the number of children minus 1) of the 
480
 * \param n The index (from 0 to the number of children minus 1) of the 
481
 * child SPFVertex to return.
481
 * child SPFVertex to return.
482
 * @warning The pointer returned by GetChild () is a borrowed pointer.  You
482
 * \warning The pointer returned by GetChild () is a borrowed pointer.  You
483
 * do not have any ownership of the underlying object and must not delete
483
 * do not have any ownership of the underlying object and must not delete
484
 * that object.
484
 * that object.
485
 * @returns A pointer to the specified child SPFVertex (which resides in the
485
 * \returns A pointer to the specified child SPFVertex (which resides in the
486
 * SPF tree).
486
 * SPF tree).
487
 */
487
 */
488
  SPFVertex* GetChild (uint32_t n) const;
488
  SPFVertex* GetChild (uint32_t n) const;
489
489
490
/**
490
/**
491
 * @brief Get a borrowed SPFVertex pointer to the specified child of "this" 
491
 * \brief Get a borrowed SPFVertex pointer to the specified child of "this" 
492
 * SPFVertex.
492
 * SPFVertex.
493
 * @internal
493
 * \internal
494
 *
494
 *
495
 * Each router node in the simulation is associated with an SPFVertex object.
495
 * Each router node in the simulation is associated with an SPFVertex object.
496
 * When calculating routes, each of these routers is, in turn, chosen as the 
496
 * When calculating routes, each of these routers is, in turn, chosen as the 
 Lines 505-536    Link Here 
505
 * This method the number of children of "this" SPFVertex (which reside in
505
 * This method the number of children of "this" SPFVertex (which reside in
506
 * the SPF tree.
506
 * the SPF tree.
507
 *
507
 *
508
 * @see SPFVertex::GetNChildren
508
 * \see SPFVertex::GetNChildren
509
 * @warning Ownership of the pointer added to the children of "this" 
509
 * \warning Ownership of the pointer added to the children of "this" 
510
 * SPFVertex is transferred to the "this" SPFVertex.  You must not delete the
510
 * SPFVertex is transferred to the "this" SPFVertex.  You must not delete the
511
 * (now) child SPFVertex after calling this method.
511
 * (now) child SPFVertex after calling this method.
512
 * @param child A pointer to the SPFVertex (which resides in the SPF tree) to
512
 * \param child A pointer to the SPFVertex (which resides in the SPF tree) to
513
 * be added to the list of children of "this" SPFVertex.
513
 * be added to the list of children of "this" SPFVertex.
514
 * @returns The number of children of "this" SPFVertex after the addition of
514
 * \returns The number of children of "this" SPFVertex after the addition of
515
 * the new child.
515
 * the new child.
516
 */
516
 */
517
  uint32_t AddChild (SPFVertex* child);
517
  uint32_t AddChild (SPFVertex* child);
518
518
519
  /**
519
  /**
520
   * @brief Set the value of the VertexProcessed flag
520
   * \brief Set the value of the VertexProcessed flag
521
   *
521
   *
522
   * Flag to note whether vertex has been processed in stage two of 
522
   * Flag to note whether vertex has been processed in stage two of 
523
   * SPF computation
523
   * SPF computation
524
   * @param value boolean value to set the flag
524
   * \param value boolean value to set the flag
525
   */ 
525
   */ 
526
  void SetVertexProcessed (bool value);
526
  void SetVertexProcessed (bool value);
527
527
528
  /**
528
  /**
529
   * @brief Check the value of the VertexProcessed flag
529
   * \brief Check the value of the VertexProcessed flag
530
   *
530
   *
531
   * Flag to note whether vertex has been processed in stage two of 
531
   * Flag to note whether vertex has been processed in stage two of 
532
   * SPF computation
532
   * SPF computation
533
   * @returns value of underlying flag
533
   * \returns value of underlying flag
534
   */ 
534
   */ 
535
  bool IsVertexProcessed (void) const;
535
  bool IsVertexProcessed (void) const;
536
536
 Lines 552-564    Link Here 
552
  bool m_vertexProcessed; 
552
  bool m_vertexProcessed; 
553
553
554
/**
554
/**
555
 * @brief The SPFVertex copy construction is disallowed.  There's no need for
555
 * \brief The SPFVertex copy construction is disallowed.  There's no need for
556
 * it and a compiler provided shallow copy would be wrong.
556
 * it and a compiler provided shallow copy would be wrong.
557
 */
557
 */
558
  SPFVertex (SPFVertex& v);
558
  SPFVertex (SPFVertex& v);
559
559
560
/**
560
/**
561
 * @brief The SPFVertex copy assignment operator is disallowed.  There's no 
561
 * \brief The SPFVertex copy assignment operator is disallowed.  There's no 
562
 * need for it and a compiler provided shallow copy would be wrong.
562
 * need for it and a compiler provided shallow copy would be wrong.
563
 */
563
 */
564
  SPFVertex& operator= (SPFVertex& v);
564
  SPFVertex& operator= (SPFVertex& v);
 Lines 569-575    Link Here 
569
};
569
};
570
570
571
/**
571
/**
572
 * @brief The Link State DataBase (LSDB) of the Global Route Manager.
572
 * \brief The Link State DataBase (LSDB) of the Global Route Manager.
573
 *
573
 *
574
 * Each node in the simulation participating in global routing has a
574
 * Each node in the simulation participating in global routing has a
575
 * GlobalRouter interface.  The primary job of this interface is to export
575
 * GlobalRouter interface.  The primary job of this interface is to export
 Lines 585-592    Link Here 
585
{
585
{
586
public:
586
public:
587
/**
587
/**
588
 * @brief Construct an empty Global Router Manager Link State Database.
588
 * \brief Construct an empty Global Router Manager Link State Database.
589
 * @internal
589
 * \internal
590
 *
590
 *
591
 * The database map composing the Link State Database is initialized in
591
 * The database map composing the Link State Database is initialized in
592
 * this constructor.
592
 * this constructor.
 Lines 594-601    Link Here 
594
  GlobalRouteManagerLSDB ();
594
  GlobalRouteManagerLSDB ();
595
595
596
/**
596
/**
597
 * @brief Destroy an empty Global Router Manager Link State Database.
597
 * \brief Destroy an empty Global Router Manager Link State Database.
598
 * @internal
598
 * \internal
599
 *
599
 *
600
 * The database map is walked and all of the Link State Advertisements stored
600
 * The database map is walked and all of the Link State Advertisements stored
601
 * in the database are freed; then the database map itself is clear ()ed to
601
 * in the database are freed; then the database map itself is clear ()ed to
 Lines 604-666    Link Here 
604
  ~GlobalRouteManagerLSDB ();
604
  ~GlobalRouteManagerLSDB ();
605
605
606
/**
606
/**
607
 * @brief Insert an IP address / Link State Advertisement pair into the Link
607
 * \brief Insert an IP address / Link State Advertisement pair into the Link
608
 * State Database.
608
 * State Database.
609
 * @internal
609
 * \internal
610
 *
610
 *
611
 * The IPV4 address and the GlobalRoutingLSA given as parameters are converted
611
 * The IPV4 address and the GlobalRoutingLSA given as parameters are converted
612
 * to an STL pair and are inserted into the database map.
612
 * to an STL pair and are inserted into the database map.
613
 *
613
 *
614
 * @see GlobalRoutingLSA
614
 * \see GlobalRoutingLSA
615
 * @see Ipv4Address
615
 * \see Ipv4Address
616
 * @param addr The IP address associated with the LSA.  Typically the Router 
616
 * \param addr The IP address associated with the LSA.  Typically the Router 
617
 * ID.
617
 * ID.
618
 * @param lsa A pointer to the Link State Advertisement for the router.
618
 * \param lsa A pointer to the Link State Advertisement for the router.
619
 */
619
 */
620
  void Insert (Ipv4Address addr, GlobalRoutingLSA* lsa);
620
  void Insert (Ipv4Address addr, GlobalRoutingLSA* lsa);
621
621
622
/**
622
/**
623
 * @brief Look up the Link State Advertisement associated with the given
623
 * \brief Look up the Link State Advertisement associated with the given
624
 * link state ID (address).
624
 * link state ID (address).
625
 * @internal
625
 * \internal
626
 *
626
 *
627
 * The database map is searched for the given IPV4 address and corresponding
627
 * The database map is searched for the given IPV4 address and corresponding
628
 * GlobalRoutingLSA is returned.
628
 * GlobalRoutingLSA is returned.
629
 *
629
 *
630
 * @see GlobalRoutingLSA
630
 * \see GlobalRoutingLSA
631
 * @see Ipv4Address
631
 * \see Ipv4Address
632
 * @param addr The IP address associated with the LSA.  Typically the Router 
632
 * \param addr The IP address associated with the LSA.  Typically the Router 
633
 * ID.
633
 * ID.
634
 * @returns A pointer to the Link State Advertisement for the router specified
634
 * \returns A pointer to the Link State Advertisement for the router specified
635
 * by the IP address addr.
635
 * by the IP address addr.
636
 */
636
 */
637
  GlobalRoutingLSA* GetLSA (Ipv4Address addr) const;
637
  GlobalRoutingLSA* GetLSA (Ipv4Address addr) const;
638
/**
638
/**
639
 * @brief Look up the Link State Advertisement associated with the given
639
 * \brief Look up the Link State Advertisement associated with the given
640
 * link state ID (address).  This is a variation of the GetLSA call
640
 * link state ID (address).  This is a variation of the GetLSA call
641
 * to allow the LSA to be found by matching addr with the LinkData field
641
 * to allow the LSA to be found by matching addr with the LinkData field
642
 * of the TransitNetwork link record.
642
 * of the TransitNetwork link record.
643
 * @internal
643
 * \internal
644
 *
644
 *
645
 * @see GetLSA
645
 * \see GetLSA
646
 * @param addr The IP address associated with the LSA.  Typically the Router 
646
 * \param addr The IP address associated with the LSA.  Typically the Router 
647
 * @returns A pointer to the Link State Advertisement for the router specified
647
 * \returns A pointer to the Link State Advertisement for the router specified
648
 * by the IP address addr.
648
 * by the IP address addr.
649
 * ID.
649
 * ID.
650
 */
650
 */
651
  GlobalRoutingLSA* GetLSAByLinkData (Ipv4Address addr) const;
651
  GlobalRoutingLSA* GetLSAByLinkData (Ipv4Address addr) const;
652
652
653
/**
653
/**
654
 * @brief Set all LSA flags to an initialized state, for SPF computation
654
 * \brief Set all LSA flags to an initialized state, for SPF computation
655
 * @internal
655
 * \internal
656
 *
656
 *
657
 * This function walks the database and resets the status flags of all of the
657
 * This function walks the database and resets the status flags of all of the
658
 * contained Link State Advertisements to LSA_SPF_NOT_EXPLORED.  This is done
658
 * contained Link State Advertisements to LSA_SPF_NOT_EXPLORED.  This is done
659
 * prior to each SPF calculation to reset the state of the SPFVertex structures
659
 * prior to each SPF calculation to reset the state of the SPFVertex structures
660
 * that will reference the LSAs during the calculation.
660
 * that will reference the LSAs during the calculation.
661
 *
661
 *
662
 * @see GlobalRoutingLSA
662
 * \see GlobalRoutingLSA
663
 * @see SPFVertex
663
 * \see SPFVertex
664
 */
664
 */
665
  void Initialize ();
665
  void Initialize ();
666
666
 Lines 676-695    Link Here 
676
  std::vector<GlobalRoutingLSA*> m_extdatabase;
676
  std::vector<GlobalRoutingLSA*> m_extdatabase;
677
677
678
/**
678
/**
679
 * @brief GlobalRouteManagerLSDB copy construction is disallowed.  There's no 
679
 * \brief GlobalRouteManagerLSDB copy construction is disallowed.  There's no 
680
 * need for it and a compiler provided shallow copy would be wrong.
680
 * need for it and a compiler provided shallow copy would be wrong.
681
 */
681
 */
682
  GlobalRouteManagerLSDB (GlobalRouteManagerLSDB& lsdb);
682
  GlobalRouteManagerLSDB (GlobalRouteManagerLSDB& lsdb);
683
683
684
/**
684
/**
685
 * @brief The SPFVertex copy assignment operator is disallowed.  There's no 
685
 * \brief The SPFVertex copy assignment operator is disallowed.  There's no 
686
 * need for it and a compiler provided shallow copy would be wrong.
686
 * need for it and a compiler provided shallow copy would be wrong.
687
 */
687
 */
688
  GlobalRouteManagerLSDB& operator= (GlobalRouteManagerLSDB& lsdb);
688
  GlobalRouteManagerLSDB& operator= (GlobalRouteManagerLSDB& lsdb);
689
};
689
};
690
690
691
/**
691
/**
692
 * @brief A global router implementation.
692
 * \brief A global router implementation.
693
 *
693
 *
694
 * This singleton object can query interface each node in the system
694
 * This singleton object can query interface each node in the system
695
 * for a GlobalRouter interface.  For those nodes, it fetches one or
695
 * for a GlobalRouter interface.  For those nodes, it fetches one or
 Lines 705-756    Link Here 
705
  GlobalRouteManagerImpl ();
705
  GlobalRouteManagerImpl ();
706
  virtual ~GlobalRouteManagerImpl ();
706
  virtual ~GlobalRouteManagerImpl ();
707
/**
707
/**
708
 * @brief Delete all static routes on all nodes that have a
708
 * \brief Delete all static routes on all nodes that have a
709
 * GlobalRouterInterface
709
 * GlobalRouterInterface
710
 *
710
 *
711
 * TODO:  separate manually assigned static routes from static routes that
711
 * TODO:  separate manually assigned static routes from static routes that
712
 * the global routing code injects, and only delete the latter
712
 * the global routing code injects, and only delete the latter
713
 * @internal
713
 * \internal
714
 *
714
 *
715
 */
715
 */
716
  virtual void DeleteGlobalRoutes ();
716
  virtual void DeleteGlobalRoutes ();
717
717
718
/**
718
/**
719
 * @brief Build the routing database by gathering Link State Advertisements
719
 * \brief Build the routing database by gathering Link State Advertisements
720
 * from each node exporting a GlobalRouter interface.
720
 * from each node exporting a GlobalRouter interface.
721
 * @internal
721
 * \internal
722
 */
722
 */
723
  virtual void BuildGlobalRoutingDatabase ();
723
  virtual void BuildGlobalRoutingDatabase ();
724
724
725
/**
725
/**
726
 * @brief Compute routes using a Dijkstra SPF computation and populate
726
 * \brief Compute routes using a Dijkstra SPF computation and populate
727
 * per-node forwarding tables
727
 * per-node forwarding tables
728
 * @internal
728
 * \internal
729
 */
729
 */
730
  virtual void InitializeRoutes ();
730
  virtual void InitializeRoutes ();
731
731
732
/**
732
/**
733
 * @brief Debugging routine; allow client code to supply a pre-built LSDB
733
 * \brief Debugging routine; allow client code to supply a pre-built LSDB
734
 * @internal
734
 * \internal
735
 */
735
 */
736
  void DebugUseLsdb (GlobalRouteManagerLSDB*);
736
  void DebugUseLsdb (GlobalRouteManagerLSDB*);
737
737
738
/**
738
/**
739
 * @brief Debugging routine; call the core SPF from the unit tests
739
 * \brief Debugging routine; call the core SPF from the unit tests
740
 * @internal
740
 * \internal
741
 */
741
 */
742
  void DebugSPFCalculate (Ipv4Address root);
742
  void DebugSPFCalculate (Ipv4Address root);
743
743
744
private:
744
private:
745
/**
745
/**
746
 * @brief GlobalRouteManagerImpl copy construction is disallowed.
746
 * \brief GlobalRouteManagerImpl copy construction is disallowed.
747
 * There's no  need for it and a compiler provided shallow copy would be 
747
 * There's no  need for it and a compiler provided shallow copy would be 
748
 * wrong.
748
 * wrong.
749
 */
749
 */
750
  GlobalRouteManagerImpl (GlobalRouteManagerImpl& srmi);
750
  GlobalRouteManagerImpl (GlobalRouteManagerImpl& srmi);
751
751
752
/**
752
/**
753
 * @brief Global Route Manager Implementation assignment operator is
753
 * \brief Global Route Manager Implementation assignment operator is
754
 * disallowed.  There's no  need for it and a compiler provided shallow copy
754
 * disallowed.  There's no  need for it and a compiler provided shallow copy
755
 * would be hopelessly wrong.
755
 * would be hopelessly wrong.
756
 */
756
 */
(-)a/src/internet/model/global-route-manager.h (-9 / +9 lines)
 Lines 27-33    Link Here 
27
namespace ns3 {
27
namespace ns3 {
28
28
29
/**
29
/**
30
 * @brief A global global router
30
 * \brief A global global router
31
 *
31
 *
32
 * This singleton object can query interface each node in the system
32
 * This singleton object can query interface each node in the system
33
 * for a GlobalRouter interface.  For those nodes, it fetches one or
33
 * for a GlobalRouter interface.  For those nodes, it fetches one or
 Lines 41-82    Link Here 
41
{
41
{
42
public:
42
public:
43
/**
43
/**
44
 * @brief Allocate a 32-bit router ID from monotonically increasing counter.
44
 * \brief Allocate a 32-bit router ID from monotonically increasing counter.
45
 */
45
 */
46
  static uint32_t AllocateRouterId ();
46
  static uint32_t AllocateRouterId ();
47
47
48
/**
48
/**
49
 * @brief Delete all static routes on all nodes that have a 
49
 * \brief Delete all static routes on all nodes that have a 
50
 * GlobalRouterInterface
50
 * GlobalRouterInterface
51
 *
51
 *
52
 */
52
 */
53
  static void DeleteGlobalRoutes ();
53
  static void DeleteGlobalRoutes ();
54
54
55
/**
55
/**
56
 * @brief Build the routing database by gathering Link State Advertisements
56
 * \brief Build the routing database by gathering Link State Advertisements
57
 * from each node exporting a GlobalRouter interface.
57
 * from each node exporting a GlobalRouter interface.
58
 * @internal
58
 * \internal
59
 *
59
 *
60
 */
60
 */
61
  static void BuildGlobalRoutingDatabase ();
61
  static void BuildGlobalRoutingDatabase ();
62
62
63
/**
63
/**
64
 * @brief Compute routes using a Dijkstra SPF computation and populate
64
 * \brief Compute routes using a Dijkstra SPF computation and populate
65
 * per-node forwarding tables
65
 * per-node forwarding tables
66
 * @internal
66
 * \internal
67
 */
67
 */
68
  static void InitializeRoutes ();
68
  static void InitializeRoutes ();
69
69
70
private:
70
private:
71
/**
71
/**
72
 * @brief Global Route Manager copy construction is disallowed.  There's no 
72
 * \brief Global Route Manager copy construction is disallowed.  There's no 
73
 * need for it and a compiler provided shallow copy would be wrong.
73
 * need for it and a compiler provided shallow copy would be wrong.
74
 *
74
 *
75
 */
75
 */
76
  GlobalRouteManager (GlobalRouteManager& srm);
76
  GlobalRouteManager (GlobalRouteManager& srm);
77
77
78
/**
78
/**
79
 * @brief Global Router copy assignment operator is disallowed.  There's no 
79
 * \brief Global Router copy assignment operator is disallowed.  There's no 
80
 * need for it and a compiler provided shallow copy would be wrong.
80
 * need for it and a compiler provided shallow copy would be wrong.
81
 */
81
 */
82
  GlobalRouteManager& operator= (GlobalRouteManager& srm);
82
  GlobalRouteManager& operator= (GlobalRouteManager& srm);
(-)a/src/internet/model/global-router-interface.h (-145 / +145 lines)
 Lines 40-46    Link Here 
40
class Ipv4GlobalRouting;
40
class Ipv4GlobalRouting;
41
41
42
/**
42
/**
43
 * @brief A single link record for a link state advertisement.
43
 * \brief A single link record for a link state advertisement.
44
 *
44
 *
45
 * The GlobalRoutingLinkRecord is modeled after the OSPF link record field of
45
 * The GlobalRoutingLinkRecord is modeled after the OSPF link record field of
46
 * a Link State Advertisement.  Right now we will only see two types of link
46
 * a Link State Advertisement.  Right now we will only see two types of link
 Lines 51-58    Link Here 
51
public:
51
public:
52
  friend class GlobalRoutingLSA;
52
  friend class GlobalRoutingLSA;
53
/**
53
/**
54
 * @enum LinkType
54
 * \enum LinkType
55
 * @brief Enumeration of the possible types of Global Routing Link Records.
55
 * \brief Enumeration of the possible types of Global Routing Link Records.
56
 *
56
 *
57
 * These values are defined in the OSPF spec.  We currently only use 
57
 * These values are defined in the OSPF spec.  We currently only use 
58
 * PointToPoint and StubNetwork types.
58
 * PointToPoint and StubNetwork types.
 Lines 66-72    Link Here 
66
  };
66
  };
67
67
68
/**
68
/**
69
 * @brief Construct an empty ("uninitialized") Global Routing Link Record.
69
 * \brief Construct an empty ("uninitialized") Global Routing Link Record.
70
 *
70
 *
71
 * The Link ID and Link Data Ipv4 addresses are set to "0.0.0.0";
71
 * The Link ID and Link Data Ipv4 addresses are set to "0.0.0.0";
72
 * The Link Type is set to Unknown;
72
 * The Link Type is set to Unknown;
 Lines 77-89    Link Here 
77
/**
77
/**
78
 * Construct an initialized Global Routing Link Record.
78
 * Construct an initialized Global Routing Link Record.
79
 *
79
 *
80
 * @param linkType The type of link record to construct.
80
 * \param linkType The type of link record to construct.
81
 * @param linkId The link ID for the record.
81
 * \param linkId The link ID for the record.
82
 * @param linkData The link data field for the record.
82
 * \param linkData The link data field for the record.
83
 * @param metric The metric field for the record.
83
 * \param metric The metric field for the record.
84
 * @see LinkType
84
 * \see LinkType
85
 * @see SetLinkId
85
 * \see SetLinkId
86
 * @see SetLinkData
86
 * \see SetLinkData
87
 */
87
 */
88
  GlobalRoutingLinkRecord (
88
  GlobalRoutingLinkRecord (
89
    LinkType    linkType, 
89
    LinkType    linkType, 
 Lines 92-98    Link Here 
92
    uint16_t    metric);
92
    uint16_t    metric);
93
93
94
/**
94
/**
95
 * @brief Destroy a Global Routing Link Record.
95
 * \brief Destroy a Global Routing Link Record.
96
 *
96
 *
97
 * Currently does nothing.  Here as a placeholder only.
97
 * Currently does nothing.  Here as a placeholder only.
98
 */
98
 */
 Lines 107-118    Link Here 
107
 * For an OSPF type 3 link (StubNetwork), the Link ID will be the adjacent
107
 * For an OSPF type 3 link (StubNetwork), the Link ID will be the adjacent
108
 * neighbor's IP address
108
 * neighbor's IP address
109
 *
109
 *
110
 * @returns The Ipv4Address corresponding to the Link ID field of the record.
110
 * \returns The Ipv4Address corresponding to the Link ID field of the record.
111
 */
111
 */
112
  Ipv4Address GetLinkId (void) const;
112
  Ipv4Address GetLinkId (void) const;
113
113
114
/**
114
/**
115
 * @brief Set the Link ID field of the Global Routing Link Record.
115
 * \brief Set the Link ID field of the Global Routing Link Record.
116
 *
116
 *
117
 * For an OSPF type 1 link (PointToPoint) the Link ID must be the Router ID
117
 * For an OSPF type 1 link (PointToPoint) the Link ID must be the Router ID
118
 * of the neighboring router.
118
 * of the neighboring router.
 Lines 120-131    Link Here 
120
 * For an OSPF type 3 link (StubNetwork), the Link ID must be the adjacent
120
 * For an OSPF type 3 link (StubNetwork), the Link ID must be the adjacent
121
 * neighbor's IP address
121
 * neighbor's IP address
122
 *
122
 *
123
 * @param addr An Ipv4Address to store in the Link ID field of the record.
123
 * \param addr An Ipv4Address to store in the Link ID field of the record.
124
 */
124
 */
125
  void SetLinkId (Ipv4Address addr);
125
  void SetLinkId (Ipv4Address addr);
126
126
127
/**
127
/**
128
 * @brief Get the Link Data field of the Global Routing Link Record.
128
 * \brief Get the Link Data field of the Global Routing Link Record.
129
 *
129
 *
130
 * For an OSPF type 1 link (PointToPoint) the Link Data will be the IP
130
 * For an OSPF type 1 link (PointToPoint) the Link Data will be the IP
131
 * address of the node of the local side of the link.
131
 * address of the node of the local side of the link.
 Lines 133-144    Link Here 
133
 * For an OSPF type 3 link (StubNetwork), the Link Data will be the
133
 * For an OSPF type 3 link (StubNetwork), the Link Data will be the
134
 * network mask
134
 * network mask
135
 *
135
 *
136
 * @returns The Ipv4Address corresponding to the Link Data field of the record.
136
 * \returns The Ipv4Address corresponding to the Link Data field of the record.
137
 */
137
 */
138
  Ipv4Address GetLinkData (void) const;
138
  Ipv4Address GetLinkData (void) const;
139
139
140
/**
140
/**
141
 * @brief Set the Link Data field of the Global Routing Link Record.
141
 * \brief Set the Link Data field of the Global Routing Link Record.
142
 *
142
 *
143
 * For an OSPF type 1 link (PointToPoint) the Link Data must be the IP
143
 * For an OSPF type 1 link (PointToPoint) the Link Data must be the IP
144
 * address of the node of the local side of the link.
144
 * address of the node of the local side of the link.
 Lines 146-179    Link Here 
146
 * For an OSPF type 3 link (StubNetwork), the Link Data must be set to the
146
 * For an OSPF type 3 link (StubNetwork), the Link Data must be set to the
147
 * network mask
147
 * network mask
148
 *
148
 *
149
 * @param addr An Ipv4Address to store in the Link Data field of the record.
149
 * \param addr An Ipv4Address to store in the Link Data field of the record.
150
 */
150
 */
151
  void SetLinkData (Ipv4Address addr);
151
  void SetLinkData (Ipv4Address addr);
152
152
153
/**
153
/**
154
 * @brief Get the Link Type field of the Global Routing Link Record.
154
 * \brief Get the Link Type field of the Global Routing Link Record.
155
 *
155
 *
156
 * The Link Type describes the kind of link a given record represents.  The
156
 * The Link Type describes the kind of link a given record represents.  The
157
 * values are defined by OSPF.
157
 * values are defined by OSPF.
158
 *
158
 *
159
 * @see LinkType
159
 * \see LinkType
160
 * @returns The LinkType of the current Global Routing Link Record.
160
 * \returns The LinkType of the current Global Routing Link Record.
161
 */
161
 */
162
  LinkType GetLinkType (void) const;
162
  LinkType GetLinkType (void) const;
163
163
164
/**
164
/**
165
 * @brief Set the Link Type field of the Global Routing Link Record.
165
 * \brief Set the Link Type field of the Global Routing Link Record.
166
 *
166
 *
167
 * The Link Type describes the kind of link a given record represents.  The
167
 * The Link Type describes the kind of link a given record represents.  The
168
 * values are defined by OSPF.
168
 * values are defined by OSPF.
169
 *
169
 *
170
 * @see LinkType
170
 * \see LinkType
171
 * @param linkType The new LinkType for the current Global Routing Link Record.
171
 * \param linkType The new LinkType for the current Global Routing Link Record.
172
 */
172
 */
173
  void SetLinkType (LinkType linkType);
173
  void SetLinkType (LinkType linkType);
174
174
175
/**
175
/**
176
 * @brief Get the Metric Data field of the Global Routing Link Record.
176
 * \brief Get the Metric Data field of the Global Routing Link Record.
177
 *
177
 *
178
 * The metric is an abstract cost associated with forwarding a packet across
178
 * The metric is an abstract cost associated with forwarding a packet across
179
 * a link.  A sum of metrics must have a well-defined meaning.  That is, you
179
 * a link.  A sum of metrics must have a well-defined meaning.  That is, you
 Lines 181-192    Link Here 
181
 * two hops relate to the cost of sending a packet); rather you should use
181
 * two hops relate to the cost of sending a packet); rather you should use
182
 * something like delay.
182
 * something like delay.
183
 *
183
 *
184
 * @returns The metric field of the Global Routing Link Record.
184
 * \returns The metric field of the Global Routing Link Record.
185
 */
185
 */
186
  uint16_t GetMetric (void) const;
186
  uint16_t GetMetric (void) const;
187
187
188
/**
188
/**
189
 * @brief Set the Metric Data field of the Global Routing Link Record.
189
 * \brief Set the Metric Data field of the Global Routing Link Record.
190
 *
190
 *
191
 * The metric is an abstract cost associated with forwarding a packet across
191
 * The metric is an abstract cost associated with forwarding a packet across
192
 * a link.  A sum of metrics must have a well-defined meaning.  That is, you
192
 * a link.  A sum of metrics must have a well-defined meaning.  That is, you
 Lines 194-200    Link Here 
194
 * two hops relate to the cost of sending a packet); rather you should use
194
 * two hops relate to the cost of sending a packet); rather you should use
195
 * something like delay.
195
 * something like delay.
196
 *
196
 *
197
 * @param metric The new metric for the current Global Routing Link Record.
197
 * \param metric The new metric for the current Global Routing Link Record.
198
 */
198
 */
199
  void SetMetric (uint16_t metric);
199
  void SetMetric (uint16_t metric);
200
200
 Lines 241-247    Link Here 
241
};
241
};
242
242
243
/**
243
/**
244
 * @brief a Link State Advertisement (LSA) for a router, used in global 
244
 * \brief a Link State Advertisement (LSA) for a router, used in global 
245
 * routing.
245
 * routing.
246
 * 
246
 * 
247
 * Roughly equivalent to a global incarnation of the OSPF link state header
247
 * Roughly equivalent to a global incarnation of the OSPF link state header
 Lines 252-259    Link Here 
252
{
252
{
253
public:
253
public:
254
/**
254
/**
255
 * @enum LSType
255
 * \enum LSType
256
 * @brief corresponds to LS type field of RFC 2328 OSPF LSA header
256
 * \brief corresponds to LS type field of RFC 2328 OSPF LSA header
257
 */
257
 */
258
  enum LSType {
258
  enum LSType {
259
    Unknown = 0,        /**< Uninitialized Type */
259
    Unknown = 0,        /**< Uninitialized Type */
 Lines 264-271    Link Here 
264
    ASExternalLSAs
264
    ASExternalLSAs
265
  };
265
  };
266
/**
266
/**
267
 * @enum SPFStatus
267
 * \enum SPFStatus
268
 * @brief Enumeration of the possible values of the status flag in the Routing 
268
 * \brief Enumeration of the possible values of the status flag in the Routing 
269
 * Link State Advertisements.
269
 * Link State Advertisements.
270
 */
270
 */
271
  enum SPFStatus {
271
  enum SPFStatus {
 Lines 274-280    Link Here 
274
    LSA_SPF_IN_SPFTREE          /**< Vertex is in the SPF tree */
274
    LSA_SPF_IN_SPFTREE          /**< Vertex is in the SPF tree */
275
  };
275
  };
276
/**
276
/**
277
 * @brief Create a blank Global Routing Link State Advertisement.
277
 * \brief Create a blank Global Routing Link State Advertisement.
278
 *
278
 *
279
 * On completion Ipv4Address variables initialized to 0.0.0.0 and the 
279
 * On completion Ipv4Address variables initialized to 0.0.0.0 and the 
280
 * list of Link State Records is empty.
280
 * list of Link State Records is empty.
 Lines 282-317    Link Here 
282
  GlobalRoutingLSA();
282
  GlobalRoutingLSA();
283
283
284
/**
284
/**
285
 * @brief Create an initialized Global Routing Link State Advertisement.
285
 * \brief Create an initialized Global Routing Link State Advertisement.
286
 *
286
 *
287
 * On completion the list of Link State Records is empty.
287
 * On completion the list of Link State Records is empty.
288
 *
288
 *
289
 * @param status The status to of the new LSA.
289
 * \param status The status to of the new LSA.
290
 * @param linkStateId The Ipv4Address for the link state ID field.
290
 * \param linkStateId The Ipv4Address for the link state ID field.
291
 * @param advertisingRtr The Ipv4Address for the advertising router field.
291
 * \param advertisingRtr The Ipv4Address for the advertising router field.
292
 */
292
 */
293
  GlobalRoutingLSA(SPFStatus status, Ipv4Address linkStateId, 
293
  GlobalRoutingLSA(SPFStatus status, Ipv4Address linkStateId, 
294
                   Ipv4Address advertisingRtr);
294
                   Ipv4Address advertisingRtr);
295
295
296
/**
296
/**
297
 * @brief Copy constructor for a Global Routing Link State Advertisement.
297
 * \brief Copy constructor for a Global Routing Link State Advertisement.
298
 *
298
 *
299
 * Takes a piece of memory and constructs a semantically identical copy of
299
 * Takes a piece of memory and constructs a semantically identical copy of
300
 * the given LSA.
300
 * the given LSA.
301
 *
301
 *
302
 * @param lsa The existing LSA to be used as the source.
302
 * \param lsa The existing LSA to be used as the source.
303
 */
303
 */
304
  GlobalRoutingLSA (GlobalRoutingLSA& lsa);
304
  GlobalRoutingLSA (GlobalRoutingLSA& lsa);
305
305
306
/**
306
/**
307
 * @brief Destroy an existing Global Routing Link State Advertisement.
307
 * \brief Destroy an existing Global Routing Link State Advertisement.
308
 *
308
 *
309
 * Any Global Routing Link Records present in the list are freed.
309
 * Any Global Routing Link Records present in the list are freed.
310
 */
310
 */
311
  ~GlobalRoutingLSA();
311
  ~GlobalRoutingLSA();
312
312
313
/**
313
/**
314
 * @brief Assignment operator for a Global Routing Link State Advertisement.
314
 * \brief Assignment operator for a Global Routing Link State Advertisement.
315
 *
315
 *
316
 * Takes an existing Global Routing Link State Advertisement and overwrites
316
 * Takes an existing Global Routing Link State Advertisement and overwrites
317
 * it to make a semantically identical copy of a given prototype LSA.
317
 * it to make a semantically identical copy of a given prototype LSA.
 Lines 319-493    Link Here 
319
 * If there are any Global Routing Link Records present in the existing 
319
 * If there are any Global Routing Link Records present in the existing 
320
 * LSA, they are freed before the assignment happens.
320
 * LSA, they are freed before the assignment happens.
321
 *
321
 *
322
 * @param lsa The existing LSA to be used as the source.
322
 * \param lsa The existing LSA to be used as the source.
323
 * @returns Reference to the overwritten LSA.
323
 * \returns Reference to the overwritten LSA.
324
 */
324
 */
325
  GlobalRoutingLSA& operator= (const GlobalRoutingLSA& lsa);
325
  GlobalRoutingLSA& operator= (const GlobalRoutingLSA& lsa);
326
326
327
/**
327
/**
328
 * @brief Copy any Global Routing Link Records in a given Global Routing Link
328
 * \brief Copy any Global Routing Link Records in a given Global Routing Link
329
 * State Advertisement to the current LSA.
329
 * State Advertisement to the current LSA.
330
 * 
330
 * 
331
 * Existing Link Records are not deleted -- this is a concatenation of Link 
331
 * Existing Link Records are not deleted -- this is a concatenation of Link 
332
 * Records.
332
 * Records.
333
 *
333
 *
334
 * @see ClearLinkRecords ()
334
 * \see ClearLinkRecords ()
335
 * @param lsa The LSA to copy the Link Records from.
335
 * \param lsa The LSA to copy the Link Records from.
336
 */
336
 */
337
  void CopyLinkRecords (const GlobalRoutingLSA& lsa);
337
  void CopyLinkRecords (const GlobalRoutingLSA& lsa);
338
338
339
/**
339
/**
340
 * @brief Add a given Global Routing Link Record to the LSA.
340
 * \brief Add a given Global Routing Link Record to the LSA.
341
 *
341
 *
342
 * @param lr The Global Routing Link Record to be added.
342
 * \param lr The Global Routing Link Record to be added.
343
 * @returns The number of link records in the list.
343
 * \returns The number of link records in the list.
344
 */
344
 */
345
  uint32_t AddLinkRecord (GlobalRoutingLinkRecord* lr);
345
  uint32_t AddLinkRecord (GlobalRoutingLinkRecord* lr);
346
346
347
/**
347
/**
348
 * @brief Return the number of Global Routing Link Records in the LSA.
348
 * \brief Return the number of Global Routing Link Records in the LSA.
349
 *
349
 *
350
 * @returns The number of link records in the list.
350
 * \returns The number of link records in the list.
351
 */
351
 */
352
  uint32_t GetNLinkRecords (void) const;
352
  uint32_t GetNLinkRecords (void) const;
353
353
354
/**
354
/**
355
 * @brief Return a pointer to the specified Global Routing Link Record.
355
 * \brief Return a pointer to the specified Global Routing Link Record.
356
 *
356
 *
357
 * @param n The LSA number desired.
357
 * \param n The LSA number desired.
358
 * @returns The number of link records in the list.
358
 * \returns The number of link records in the list.
359
 */
359
 */
360
  GlobalRoutingLinkRecord* GetLinkRecord (uint32_t n) const;
360
  GlobalRoutingLinkRecord* GetLinkRecord (uint32_t n) const;
361
361
362
/**
362
/**
363
 * @brief Release all of the Global Routing Link Records present in the Global
363
 * \brief Release all of the Global Routing Link Records present in the Global
364
 * Routing Link State Advertisement and make the list of link records empty.
364
 * Routing Link State Advertisement and make the list of link records empty.
365
 */
365
 */
366
  void ClearLinkRecords (void);
366
  void ClearLinkRecords (void);
367
367
368
/**
368
/**
369
 * @brief Check to see if the list of Global Routing Link Records present in the
369
 * \brief Check to see if the list of Global Routing Link Records present in the
370
 * Global Routing Link State Advertisement is empty.
370
 * Global Routing Link State Advertisement is empty.
371
 *
371
 *
372
 * @returns True if the list is empty, false otherwise.
372
 * \returns True if the list is empty, false otherwise.
373
 */
373
 */
374
  bool IsEmpty (void) const;
374
  bool IsEmpty (void) const;
375
375
376
/**
376
/**
377
 * @brief Print the contents of the Global Routing Link State Advertisement and
377
 * \brief Print the contents of the Global Routing Link State Advertisement and
378
 * any Global Routing Link Records present in the list.  Quite verbose.
378
 * any Global Routing Link Records present in the list.  Quite verbose.
379
 */
379
 */
380
  void Print (std::ostream &os) const;
380
  void Print (std::ostream &os) const;
381
381
382
/**
382
/**
383
 * @brief Return the LSType field of the LSA 
383
 * \brief Return the LSType field of the LSA 
384
 */
384
 */
385
  LSType GetLSType (void) const;
385
  LSType GetLSType (void) const;
386
/**
386
/**
387
 * @brief Set the LS type field of the LSA
387
 * \brief Set the LS type field of the LSA
388
 */
388
 */
389
  void SetLSType (LSType typ);
389
  void SetLSType (LSType typ);
390
390
391
/**
391
/**
392
 * @brief Get the Link State ID as defined by the OSPF spec.  We always set it
392
 * \brief Get the Link State ID as defined by the OSPF spec.  We always set it
393
 * to the router ID of the router making the advertisement.
393
 * to the router ID of the router making the advertisement.
394
 *
394
 *
395
 * @see RoutingEnvironment::AllocateRouterId ()
395
 * \see RoutingEnvironment::AllocateRouterId ()
396
 * @see GlobalRouting::GetRouterId ()
396
 * \see GlobalRouting::GetRouterId ()
397
 * @returns The Ipv4Address stored as the link state ID.
397
 * \returns The Ipv4Address stored as the link state ID.
398
 */
398
 */
399
  Ipv4Address GetLinkStateId (void) const;
399
  Ipv4Address GetLinkStateId (void) const;
400
400
401
/**
401
/**
402
 * @brief Set the Link State ID is defined by the OSPF spec.  We always set it
402
 * \brief Set the Link State ID is defined by the OSPF spec.  We always set it
403
 * to the router ID of the router making the advertisement.
403
 * to the router ID of the router making the advertisement.
404
 * @param addr IPv4 address which will act as ID
404
 * \param addr IPv4 address which will act as ID
405
 * @see RoutingEnvironment::AllocateRouterId ()
405
 * \see RoutingEnvironment::AllocateRouterId ()
406
 * @see GlobalRouting::GetRouterId ()
406
 * \see GlobalRouting::GetRouterId ()
407
 */
407
 */
408
  void SetLinkStateId (Ipv4Address addr);
408
  void SetLinkStateId (Ipv4Address addr);
409
409
410
/**
410
/**
411
 * @brief Get the Advertising Router as defined by the OSPF spec.  We always
411
 * \brief Get the Advertising Router as defined by the OSPF spec.  We always
412
 * set it to the router ID of the router making the advertisement.
412
 * set it to the router ID of the router making the advertisement.
413
 *
413
 *
414
 * @see RoutingEnvironment::AllocateRouterId ()
414
 * \see RoutingEnvironment::AllocateRouterId ()
415
 * @see GlobalRouting::GetRouterId ()
415
 * \see GlobalRouting::GetRouterId ()
416
 * @returns The Ipv4Address stored as the advertising router.
416
 * \returns The Ipv4Address stored as the advertising router.
417
 */
417
 */
418
  Ipv4Address GetAdvertisingRouter (void) const;
418
  Ipv4Address GetAdvertisingRouter (void) const;
419
419
420
/**
420
/**
421
 * @brief Set the Advertising Router as defined by the OSPF spec.  We always
421
 * \brief Set the Advertising Router as defined by the OSPF spec.  We always
422
 * set it to the router ID of the router making the advertisement.
422
 * set it to the router ID of the router making the advertisement.
423
 *
423
 *
424
 * @param rtr ID of the router making advertisement
424
 * \param rtr ID of the router making advertisement
425
 * @see RoutingEnvironment::AllocateRouterId ()
425
 * \see RoutingEnvironment::AllocateRouterId ()
426
 * @see GlobalRouting::GetRouterId ()
426
 * \see GlobalRouting::GetRouterId ()
427
 */
427
 */
428
  void SetAdvertisingRouter (Ipv4Address  rtr);
428
  void SetAdvertisingRouter (Ipv4Address  rtr);
429
429
430
/**
430
/**
431
 * @brief For a Network LSA, set the Network Mask field that precedes
431
 * \brief For a Network LSA, set the Network Mask field that precedes
432
 * the list of attached routers.
432
 * the list of attached routers.
433
 */
433
 */
434
  void SetNetworkLSANetworkMask (Ipv4Mask mask);
434
  void SetNetworkLSANetworkMask (Ipv4Mask mask);
435
435
436
/**
436
/**
437
 * @brief For a Network LSA, get the Network Mask field that precedes
437
 * \brief For a Network LSA, get the Network Mask field that precedes
438
 * the list of attached routers.
438
 * the list of attached routers.
439
 * 
439
 * 
440
 * @returns the NetworkLSANetworkMask 
440
 * \returns the NetworkLSANetworkMask 
441
 */
441
 */
442
  Ipv4Mask GetNetworkLSANetworkMask (void) const;
442
  Ipv4Mask GetNetworkLSANetworkMask (void) const;
443
443
444
/**
444
/**
445
 * @brief Add an attached router to the list in the NetworkLSA
445
 * \brief Add an attached router to the list in the NetworkLSA
446
 *
446
 *
447
 * @param addr The Ipv4Address of the interface on the network link
447
 * \param addr The Ipv4Address of the interface on the network link
448
 * @returns The number of addresses in the list.
448
 * \returns The number of addresses in the list.
449
 */
449
 */
450
  uint32_t AddAttachedRouter (Ipv4Address addr);
450
  uint32_t AddAttachedRouter (Ipv4Address addr);
451
451
452
/**
452
/**
453
 * @brief Return the number of attached routers listed in the NetworkLSA
453
 * \brief Return the number of attached routers listed in the NetworkLSA
454
 *
454
 *
455
 * @returns The number of attached routers.
455
 * \returns The number of attached routers.
456
 */
456
 */
457
  uint32_t GetNAttachedRouters (void) const;
457
  uint32_t GetNAttachedRouters (void) const;
458
458
459
/**
459
/**
460
 * @brief Return an Ipv4Address corresponding to the specified attached router
460
 * \brief Return an Ipv4Address corresponding to the specified attached router
461
 *
461
 *
462
 * @param n The attached router number desired (number in the list).
462
 * \param n The attached router number desired (number in the list).
463
 * @returns The Ipv4Address of the requested router
463
 * \returns The Ipv4Address of the requested router
464
 */
464
 */
465
  Ipv4Address GetAttachedRouter (uint32_t n) const;
465
  Ipv4Address GetAttachedRouter (uint32_t n) const;
466
466
467
/**
467
/**
468
 * @brief Get the SPF status of the advertisement.
468
 * \brief Get the SPF status of the advertisement.
469
 *
469
 *
470
 * @see SPFStatus
470
 * \see SPFStatus
471
 * @returns The SPFStatus of the LSA.
471
 * \returns The SPFStatus of the LSA.
472
 */
472
 */
473
  SPFStatus GetStatus (void) const;
473
  SPFStatus GetStatus (void) const;
474
474
475
/**
475
/**
476
 * @brief Set the SPF status of the advertisement
476
 * \brief Set the SPF status of the advertisement
477
 * @param status SPF status to set
477
 * \param status SPF status to set
478
 * @see SPFStatus
478
 * \see SPFStatus
479
 */
479
 */
480
  void SetStatus (SPFStatus status);
480
  void SetStatus (SPFStatus status);
481
481
482
/**
482
/**
483
 * @brief Get the Node pointer of the node that originated this LSA
483
 * \brief Get the Node pointer of the node that originated this LSA
484
 * @returns Node pointer
484
 * \returns Node pointer
485
 */
485
 */
486
  Ptr<Node> GetNode (void) const;
486
  Ptr<Node> GetNode (void) const;
487
487
488
/**
488
/**
489
 * @brief Set the Node pointer of the node that originated this LSA
489
 * \brief Set the Node pointer of the node that originated this LSA
490
 * @param node Node pointer
490
 * \param node Node pointer
491
 */
491
 */
492
  void SetNode (Ptr<Node> node);
492
  void SetNode (Ptr<Node> node);
493
493
 Lines 501-508    Link Here 
501
 * The Link State ID is defined by the OSPF spec.  We always set it to the
501
 * The Link State ID is defined by the OSPF spec.  We always set it to the
502
 * router ID of the router making the advertisement.
502
 * router ID of the router making the advertisement.
503
 *
503
 *
504
 * @see RoutingEnvironment::AllocateRouterId ()
504
 * \see RoutingEnvironment::AllocateRouterId ()
505
 * @see GlobalRouting::GetRouterId ()
505
 * \see GlobalRouting::GetRouterId ()
506
 */
506
 */
507
  Ipv4Address  m_linkStateId;
507
  Ipv4Address  m_linkStateId;
508
508
 Lines 510-517    Link Here 
510
 * The Advertising Router is defined by the OSPF spec.  We always set it to 
510
 * The Advertising Router is defined by the OSPF spec.  We always set it to 
511
 * the router ID of the router making the advertisement.
511
 * the router ID of the router making the advertisement.
512
 *
512
 *
513
 * @see RoutingEnvironment::AllocateRouterId ()
513
 * \see RoutingEnvironment::AllocateRouterId ()
514
 * @see GlobalRouting::GetRouterId ()
514
 * \see GlobalRouting::GetRouterId ()
515
 */
515
 */
516
  Ipv4Address  m_advertisingRtr;
516
  Ipv4Address  m_advertisingRtr;
517
517
 Lines 528-534    Link Here 
528
 * m_linkRecords is an STL list container to hold the Link Records that have
528
 * m_linkRecords is an STL list container to hold the Link Records that have
529
 * been discovered and prepared for the advertisement.
529
 * been discovered and prepared for the advertisement.
530
 *
530
 *
531
 * @see GlobalRouting::DiscoverLSAs ()
531
 * \see GlobalRouting::DiscoverLSAs ()
532
 */
532
 */
533
  ListOfLinkRecords_t m_linkRecords;
533
  ListOfLinkRecords_t m_linkRecords;
534
534
 Lines 548-554    Link Here 
548
 * m_attachedRouters is an STL list container to hold the addresses that have
548
 * m_attachedRouters is an STL list container to hold the addresses that have
549
 * been discovered and prepared for the advertisement.
549
 * been discovered and prepared for the advertisement.
550
 *
550
 *
551
 * @see GlobalRouting::DiscoverLSAs ()
551
 * \see GlobalRouting::DiscoverLSAs ()
552
 */
552
 */
553
  ListOfAttachedRouters_t m_attachedRouters;
553
  ListOfAttachedRouters_t m_attachedRouters;
554
554
 Lines 565-571    Link Here 
565
std::ostream& operator<< (std::ostream& os, GlobalRoutingLSA& lsa);
565
std::ostream& operator<< (std::ostream& os, GlobalRoutingLSA& lsa);
566
566
567
/**
567
/**
568
 * @brief An interface aggregated to a node to provide global routing info
568
 * \brief An interface aggregated to a node to provide global routing info
569
 *
569
 *
570
 * An interface aggregated to a node that provides global routing information
570
 * An interface aggregated to a node that provides global routing information
571
 * to a global route manager.  The presence of the interface indicates that
571
 * to a global route manager.  The presence of the interface indicates that
 Lines 577-590    Link Here 
577
{
577
{
578
public:
578
public:
579
/**
579
/**
580
 * @brief The Interface ID of the Global Router interface.
580
 * \brief The Interface ID of the Global Router interface.
581
 *
581
 *
582
 * @see Object::GetObject ()
582
 * \see Object::GetObject ()
583
 */
583
 */
584
  static TypeId GetTypeId (void);
584
  static TypeId GetTypeId (void);
585
585
586
/**
586
/**
587
 * @brief Create a Global Router class 
587
 * \brief Create a Global Router class 
588
 */
588
 */
589
  GlobalRouter ();
589
  GlobalRouter ();
590
590
 Lines 593-610    Link Here 
593
  Ptr<Ipv4GlobalRouting> GetRoutingProtocol (void);
593
  Ptr<Ipv4GlobalRouting> GetRoutingProtocol (void);
594
594
595
/**
595
/**
596
 * @brief Get the Router ID associated with this Global Router.
596
 * \brief Get the Router ID associated with this Global Router.
597
 *
597
 *
598
 * The Router IDs are allocated in the RoutingEnvironment -- one per Router, 
598
 * The Router IDs are allocated in the RoutingEnvironment -- one per Router, 
599
 * starting at 0.0.0.1 and incrementing with each instantiation of a router.
599
 * starting at 0.0.0.1 and incrementing with each instantiation of a router.
600
 *
600
 *
601
 * @see RoutingEnvironment::AllocateRouterId ()
601
 * \see RoutingEnvironment::AllocateRouterId ()
602
 * @returns The Router ID associated with the Global Router.
602
 * \returns The Router ID associated with the Global Router.
603
 */
603
 */
604
  Ipv4Address GetRouterId (void) const;
604
  Ipv4Address GetRouterId (void) const;
605
605
606
/**
606
/**
607
 * @brief Walk the connected channels, discover the adjacent routers and build
607
 * \brief Walk the connected channels, discover the adjacent routers and build
608
 * the associated number of Global Routing Link State Advertisements that 
608
 * the associated number of Global Routing Link State Advertisements that 
609
 * this router can export.
609
 * this router can export.
610
 *
610
 *
 Lines 616-644    Link Here 
616
 * advertisements after a network topology change by calling DiscoverLSAs 
616
 * advertisements after a network topology change by calling DiscoverLSAs 
617
 * and then by reading those advertisements.
617
 * and then by reading those advertisements.
618
 *
618
 *
619
 * @see GlobalRoutingLSA
619
 * \see GlobalRoutingLSA
620
 * @see GlobalRouter::GetLSA ()
620
 * \see GlobalRouter::GetLSA ()
621
 * @returns The number of Global Routing Link State Advertisements.
621
 * \returns The number of Global Routing Link State Advertisements.
622
 */
622
 */
623
  uint32_t DiscoverLSAs (void);
623
  uint32_t DiscoverLSAs (void);
624
624
625
/**
625
/**
626
 * @brief Get the Number of Global Routing Link State Advertisements that this
626
 * \brief Get the Number of Global Routing Link State Advertisements that this
627
 * router can export.
627
 * router can export.
628
 *
628
 *
629
 * To get meaningful information you must have previously called DiscoverLSAs.
629
 * To get meaningful information you must have previously called DiscoverLSAs.
630
 * After you know how many LSAs are present in the router, you may call 
630
 * After you know how many LSAs are present in the router, you may call 
631
 * GetLSA () to retrieve the actual advertisement.
631
 * GetLSA () to retrieve the actual advertisement.
632
 *
632
 *
633
 * @see GlobalRouterLSA
633
 * \see GlobalRouterLSA
634
 * @see GlobalRouting::DiscoverLSAs ()
634
 * \see GlobalRouting::DiscoverLSAs ()
635
 * @see GlobalRouting::GetLSA ()
635
 * \see GlobalRouting::GetLSA ()
636
 * @returns The number of Global Routing Link State Advertisements.
636
 * \returns The number of Global Routing Link State Advertisements.
637
 */
637
 */
638
  uint32_t GetNumLSAs (void) const;
638
  uint32_t GetNumLSAs (void) const;
639
639
640
/**
640
/**
641
 * @brief Get a Global Routing Link State Advertisements that this router has 
641
 * \brief Get a Global Routing Link State Advertisements that this router has 
642
 * said that it can export.
642
 * said that it can export.
643
 *
643
 *
644
 * This is a fairly inexpensive expensive operation in that the hard work
644
 * This is a fairly inexpensive expensive operation in that the hard work
 Lines 651-709    Link Here 
651
 * The parameter n (requested LSA number) must be in the range 0 to 
651
 * The parameter n (requested LSA number) must be in the range 0 to 
652
 * GetNumLSAs() - 1.
652
 * GetNumLSAs() - 1.
653
 *
653
 *
654
 * @see GlobalRoutingLSA
654
 * \see GlobalRoutingLSA
655
 * @see GlobalRouting::GetNumLSAs ()
655
 * \see GlobalRouting::GetNumLSAs ()
656
 * @param n The index number of the LSA you want to read.
656
 * \param n The index number of the LSA you want to read.
657
 * @param lsa The GlobalRoutingLSA class to receive the LSA information.
657
 * \param lsa The GlobalRoutingLSA class to receive the LSA information.
658
 * @returns The number of Global Router Link State Advertisements.
658
 * \returns The number of Global Router Link State Advertisements.
659
 */
659
 */
660
  bool GetLSA (uint32_t n, GlobalRoutingLSA &lsa) const;
660
  bool GetLSA (uint32_t n, GlobalRoutingLSA &lsa) const;
661
661
662
/**
662
/**
663
 * @brief Inject a route to be circulated to other routers as an external
663
 * \brief Inject a route to be circulated to other routers as an external
664
 * route
664
 * route
665
 *
665
 *
666
 * @param network The Network to inject
666
 * \param network The Network to inject
667
 * @param networkMask The Network Mask to inject
667
 * \param networkMask The Network Mask to inject
668
 */
668
 */
669
  void InjectRoute (Ipv4Address network, Ipv4Mask networkMask);
669
  void InjectRoute (Ipv4Address network, Ipv4Mask networkMask);
670
670
671
/**
671
/**
672
 * @brief Get the number of injected routes that have been added
672
 * \brief Get the number of injected routes that have been added
673
 * to the routing table.
673
 * to the routing table.
674
 * @return number of injected routes
674
 * \return number of injected routes
675
 */
675
 */
676
  uint32_t GetNInjectedRoutes (void);
676
  uint32_t GetNInjectedRoutes (void);
677
677
678
/**
678
/**
679
 * @brief Return the injected route indexed by i
679
 * \brief Return the injected route indexed by i
680
 * @param i the index of the route
680
 * \param i the index of the route
681
 * @return a pointer to that Ipv4RoutingTableEntry is returned
681
 * \return a pointer to that Ipv4RoutingTableEntry is returned
682
 *
682
 *
683
 */
683
 */
684
  Ipv4RoutingTableEntry *GetInjectedRoute (uint32_t i);
684
  Ipv4RoutingTableEntry *GetInjectedRoute (uint32_t i);
685
685
686
/**
686
/**
687
 * @brief Withdraw a route from the global unicast routing table.
687
 * \brief Withdraw a route from the global unicast routing table.
688
 *
688
 *
689
 * Calling this function will cause all indexed routes numbered above
689
 * Calling this function will cause all indexed routes numbered above
690
 * index i to have their index decremented.  For instance, it is possible to
690
 * index i to have their index decremented.  For instance, it is possible to
691
 * remove N injected routes by calling RemoveInjectedRoute (0) N times.
691
 * remove N injected routes by calling RemoveInjectedRoute (0) N times.
692
 *
692
 *
693
 * @param i The index (into the injected routing list) of the route to remove.
693
 * \param i The index (into the injected routing list) of the route to remove.
694
 *
694
 *
695
 * @see GlobalRouter::WithdrawRoute ()
695
 * \see GlobalRouter::WithdrawRoute ()
696
 */
696
 */
697
  void RemoveInjectedRoute (uint32_t i);
697
  void RemoveInjectedRoute (uint32_t i);
698
698
699
/**
699
/**
700
 * @brief Withdraw a route from the global unicast routing table.
700
 * \brief Withdraw a route from the global unicast routing table.
701
 *
701
 *
702
 * @param network The Network to withdraw
702
 * \param network The Network to withdraw
703
 * @param networkMask The Network Mask to withdraw
703
 * \param networkMask The Network Mask to withdraw
704
 * @return whether the operation succeeded (will return false if no such route)
704
 * \return whether the operation succeeded (will return false if no such route)
705
 *
705
 *
706
 * @see GlobalRouter::RemoveInjectedRoute ()
706
 * \see GlobalRouter::RemoveInjectedRoute ()
707
 */
707
 */
708
  bool WithdrawRoute (Ipv4Address network, Ipv4Mask networkMask);
708
  bool WithdrawRoute (Ipv4Address network, Ipv4Mask networkMask);
709
709
 Lines 739-750    Link Here 
739
  virtual void DoDispose (void);
739
  virtual void DoDispose (void);
740
740
741
/**
741
/**
742
 * @brief Global Router copy construction is disallowed.
742
 * \brief Global Router copy construction is disallowed.
743
 */
743
 */
744
  GlobalRouter (GlobalRouter& sr);
744
  GlobalRouter (GlobalRouter& sr);
745
745
746
/**
746
/**
747
 * @brief Global Router assignment operator is disallowed.
747
 * \brief Global Router assignment operator is disallowed.
748
 */
748
 */
749
  GlobalRouter& operator= (GlobalRouter& sr);
749
  GlobalRouter& operator= (GlobalRouter& sr);
750
};
750
};
(-)a/src/internet/model/ipv4-header.h (-1 / +1 lines)
 Lines 111-117    Link Here 
111
    }; 
111
    }; 
112
  /**
112
  /**
113
   * \brief Set ECN Field
113
   * \brief Set ECN Field
114
   * \param ECN Type
114
   * \param ecn ECN Type
115
   */
115
   */
116
  void SetEcn (EcnType ecn);
116
  void SetEcn (EcnType ecn);
117
  /**
117
  /**
(-)a/src/internet/model/nsc-tcp-socket-impl.cc (-1 / +1 lines)
 Lines 136-142    Link Here 
136
       * when DeAllocate is called, it will call into
136
       * when DeAllocate is called, it will call into
137
       * Ipv4EndPointDemux::Deallocate which triggers
137
       * Ipv4EndPointDemux::Deallocate which triggers
138
       * a delete of the associated endPoint which triggers
138
       * a delete of the associated endPoint which triggers
139
       * in turn a call to the method ::Destroy below
139
       * in turn a call to the method NscTcpSocketImpl::Destroy below
140
       * will will zero the m_endPoint field.
140
       * will will zero the m_endPoint field.
141
       */
141
       */
142
      NS_ASSERT (m_endPoint != 0);
142
      NS_ASSERT (m_endPoint != 0);
(-)a/src/internet/model/sim_interface.h (-1 / +1 lines)
 Lines 125-131    Link Here 
125
125
126
  /** Simple interface to support sending any textual command to a stack
126
  /** Simple interface to support sending any textual command to a stack
127
   *
127
   *
128
   * @returns 0 on success
128
   * \returns 0 on success
129
   */
129
   */
130
  virtual int cmd (const char *)
130
  virtual int cmd (const char *)
131
  {
131
  {
(-)a/src/internet/model/udp-socket-impl.cc (-1 / +1 lines)
 Lines 84-90    Link Here 
84
       * when DeAllocate is called, it will call into
84
       * when DeAllocate is called, it will call into
85
       * Ipv4EndPointDemux::Deallocate which triggers
85
       * Ipv4EndPointDemux::Deallocate which triggers
86
       * a delete of the associated endPoint which triggers
86
       * a delete of the associated endPoint which triggers
87
       * in turn a call to the method ::Destroy below
87
       * in turn a call to the method UdpSocketImpl::Destroy below
88
       * will will zero the m_endPoint field.
88
       * will will zero the m_endPoint field.
89
       */
89
       */
90
      NS_ASSERT (m_endPoint != 0);
90
      NS_ASSERT (m_endPoint != 0);
(-)a/src/lte/model/lte-propagation-loss-model.h (-4 / +4 lines)
 Lines 67-79    Link Here 
67
67
68
private:
68
private:
69
  /**
69
  /**
70
   * @param txPower set of values vs frequency representing the
70
   * \param txPower set of values vs frequency representing the
71
   * transmission power. See SpectrumChannel for details.
71
   * transmission power. See SpectrumChannel for details.
72
   *
72
   *
73
   * @param a sender mobility
73
   * \param a sender mobility
74
   * @param b receiver mobility
74
   * \param b receiver mobility
75
   *
75
   *
76
   * @return set of values vs frequency representing the received
76
   * \return set of values vs frequency representing the received
77
   * power in the same units used for the txPower parameter.
77
   * power in the same units used for the txPower parameter.
78
   */
78
   */
79
  Ptr<SpectrumValue> DoCalcRxPowerSpectralDensity (Ptr<const SpectrumValue> txPsd,
79
  Ptr<SpectrumValue> DoCalcRxPowerSpectralDensity (Ptr<const SpectrumValue> txPsd,
(-)a/src/lte/model/lte-spectrum-phy.h (-10 / +10 lines)
 Lines 81-87    Link Here 
81
  /**
81
  /**
82
   * Get the SpectrumType used by this PHY
82
   * Get the SpectrumType used by this PHY
83
   *
83
   *
84
   * @return
84
   * \return
85
   */
85
   */
86
  SpectrumType GetSpectrumType ();
86
  SpectrumType GetSpectrumType ();
87
87
 Lines 89-108    Link Here 
89
  /**
89
  /**
90
   * set the Power Spectral Density of outgoing signals in W/Hz.
90
   * set the Power Spectral Density of outgoing signals in W/Hz.
91
   *
91
   *
92
   * @param txPsd
92
   * \param txPsd
93
   */
93
   */
94
  void SetTxPowerSpectralDensity (Ptr<SpectrumValue> txPsd);
94
  void SetTxPowerSpectralDensity (Ptr<SpectrumValue> txPsd);
95
95
96
  /**
96
  /**
97
   * \brief set the noise power spectral density
97
   * \brief set the noise power spectral density
98
   * @param noisePsd the Noise Power Spectral Density in power units
98
   * \param noisePsd the Noise Power Spectral Density in power units
99
   * (Watt, Pascal...) per Hz.
99
   * (Watt, Pascal...) per Hz.
100
   */
100
   */
101
  void SetNoisePowerSpectralDensity (Ptr<const SpectrumValue> noisePsd);
101
  void SetNoisePowerSpectralDensity (Ptr<const SpectrumValue> noisePsd);
102
102
103
  /**
103
  /**
104
   * \brief get the noise power spectral density
104
   * \brief get the noise power spectral density
105
   * @return the Noise Power Spectral Density
105
   * \return the Noise Power Spectral Density
106
   */
106
   */
107
  Ptr<const SpectrumValue> GetNoisePowerSpectralDensity (void);
107
  Ptr<const SpectrumValue> GetNoisePowerSpectralDensity (void);
108
108
 Lines 110-118    Link Here 
110
   * Start a transmission
110
   * Start a transmission
111
   *
111
   *
112
   *
112
   *
113
   * @param pb the burst of packets to be transmitted
113
   * \param pb the burst of packets to be transmitted
114
   *
114
   *
115
   * @return true if an error occurred and the transmission was not
115
   * \return true if an error occurred and the transmission was not
116
   * started, false otherwise.
116
   * started, false otherwise.
117
   */
117
   */
118
  bool StartTx (Ptr<PacketBurst> pb);
118
  bool StartTx (Ptr<PacketBurst> pb);
 Lines 131-137    Link Here 
131
   * set the callback for the end of a TX, as part of the
131
   * set the callback for the end of a TX, as part of the
132
   * interconnections betweenthe PHY and the MAC
132
   * interconnections betweenthe PHY and the MAC
133
   *
133
   *
134
   * @param c the callback
134
   * \param c the callback
135
   */
135
   */
136
  void SetGenericPhyTxEndCallback (GenericPhyTxEndCallback c);
136
  void SetGenericPhyTxEndCallback (GenericPhyTxEndCallback c);
137
137
 Lines 139-145    Link Here 
139
   * set the callback for the start of RX, as part of the
139
   * set the callback for the start of RX, as part of the
140
   * interconnections betweenthe PHY and the MAC
140
   * interconnections betweenthe PHY and the MAC
141
   *
141
   *
142
   * @param c the callback
142
   * \param c the callback
143
   */
143
   */
144
  void SetGenericPhyRxStartCallback (GenericPhyRxStartCallback c);
144
  void SetGenericPhyRxStartCallback (GenericPhyRxStartCallback c);
145
145
 Lines 147-153    Link Here 
147
   * set the callback for the end of a RX in error, as part of the
147
   * set the callback for the end of a RX in error, as part of the
148
   * interconnections betweenthe PHY and the MAC
148
   * interconnections betweenthe PHY and the MAC
149
   *
149
   *
150
   * @param c the callback
150
   * \param c the callback
151
   */
151
   */
152
  void SetGenericPhyRxEndErrorCallback (GenericPhyRxEndErrorCallback c);
152
  void SetGenericPhyRxEndErrorCallback (GenericPhyRxEndErrorCallback c);
153
153
 Lines 155-161    Link Here 
155
   * set the callback for the successful end of a RX, as part of the
155
   * set the callback for the successful end of a RX, as part of the
156
   * interconnections betweenthe PHY and the MAC
156
   * interconnections betweenthe PHY and the MAC
157
   *
157
   *
158
   * @param c the callback
158
   * \param c the callback
159
   */
159
   */
160
  void SetGenericPhyRxEndOkCallback (GenericPhyRxEndOkCallback c);
160
  void SetGenericPhyRxEndOkCallback (GenericPhyRxEndOkCallback c);
161
161
(-)a/src/mesh/helper/mesh-stack-installer.h (-1 / +2 lines)
 Lines 28-34    Link Here 
28
 *
28
 *
29
 * \brief Prototype for class, which helps to install MAC-layer
29
 * \brief Prototype for class, which helps to install MAC-layer
30
 * routing stack to ns3::MeshPointDevice
30
 * routing stack to ns3::MeshPointDevice
31
 * \details You need to create a  MeshPointDevice and attach all
31
 *
32
 * You need to create a MeshPointDevice and attach all
32
 * interfaces to it, than call Install method
33
 * interfaces to it, than call Install method
33
 */
34
 */
34
class MeshStack : public Object
35
class MeshStack : public Object
(-)a/src/mesh/model/dot11s/airtime-metric.h (-7 / +6 lines)
 Lines 26-41    Link Here 
26
/**
26
/**
27
 * \ingroup dot11s
27
 * \ingroup dot11s
28
 *
28
 *
29
 * \brief airtime link metric calculator
29
 * \brief Airtime link metric calculator
30
 *
30
 *
31
 * \details Airtime link metric is defined in 11B.10 of 802.11s Draft D3.0 as:
31
 * Airtime link metric is defined in 11B.10 of 802.11s Draft D3.0 as:
32
 *
32
 *
33
 * airtime = (O + Bt/r)* (1 + average retry counter), where
33
 * airtime = (O + Bt/r)* (1 + average retry counter), where:
34
 *
34
 * - o  -- the PHY dependent channel access which includes frame headers, training sequences,
35
 * o  -- the PHY dependent channel access which includes frame headers, training sequences,
36
 *       access protocol frames, etc.
35
 *       access protocol frames, etc.
37
 * bt -- the test packet length in bits (8192 by default),
36
 * - bt -- the test packet length in bits (8192 by default),
38
 * r  -- the current bitrate of the packet,
37
 * - r  -- the current bitrate of the packet,
39
 *
38
 *
40
 * Final result is expressed in units of 0.01 Time Unit = 10.24 us (as required by 802.11s draft)
39
 * Final result is expressed in units of 0.01 Time Unit = 10.24 us (as required by 802.11s draft)
41
 */
40
 */
(-)a/src/mesh/model/dot11s/hwmp-tag.h (-1 / +1 lines)
 Lines 34-40    Link Here 
34
 * \brief Hwmp tag implements interaction between HWMP
34
 * \brief Hwmp tag implements interaction between HWMP
35
 * protocol and MeshWifiMac
35
 * protocol and MeshWifiMac
36
 *
36
 *
37
 * \details Hwmp tag keeps the following:
37
 * Hwmp tag keeps the following:
38
 * 1. When packet is passed from Hwmp to 11sMAC:
38
 * 1. When packet is passed from Hwmp to 11sMAC:
39
 *  - retransmitter address,
39
 *  - retransmitter address,
40
 *  - TTL value,
40
 *  - TTL value,
(-)a/src/mesh/model/dot11s/peer-link-frame.h (-3 / +3 lines)
34
/**
34
/**
35
 * \ingroup dot11s
35
 * \ingroup dot11s
36
 *
36
 *
37
 * \brief 802.11s Peer link management frame:
37
 * \brief 802.11s Peer link management frame
38
 * \details included the following (see chapters 7.4.12.1-7.4.12.3 of
38
 * 
39
 * 802.11s):
39
 * Peer link management frame included the following (see chapters 7.4.12.1-7.4.12.3 of 802.11s):
40
 * - Subtype field
40
 * - Subtype field
41
 * - Association ID field
41
 * - Association ID field
42
 * - Supported rates
42
 * - Supported rates
(-)a/src/mesh/model/dot11s/peer-link.h (-3 / +3 lines)
 Lines 202-215    Link Here 
202
  PeerLink& operator= (const PeerLink &);
202
  PeerLink& operator= (const PeerLink &);
203
  PeerLink (const PeerLink &);
203
  PeerLink (const PeerLink &);
204
204
205
  ///The number of interface I am associated with
205
  /// The number of interface I am associated with
206
  uint32_t m_interface;
206
  uint32_t m_interface;
207
  /// pointer to MAC plugin, which is responsible for peer management
207
  /// pointer to MAC plugin, which is responsible for peer management
208
  Ptr<PeerManagementProtocolMac> m_macPlugin;
208
  Ptr<PeerManagementProtocolMac> m_macPlugin;
209
  /// Peer address
209
  /// Peer address
210
  Mac48Address m_peerAddress;
210
  Mac48Address m_peerAddress;
211
  /// Mesh point address, equal to peer address in case of single
211
  /// Mesh point address, equal to peer address in case of single
212
  //interface mesh point
212
  /// interface mesh point
213
  Mac48Address m_peerMeshPointAddress;
213
  Mac48Address m_peerMeshPointAddress;
214
  /// My ID of this link
214
  /// My ID of this link
215
  uint16_t m_localLinkId;
215
  uint16_t m_localLinkId;
 Lines 253-259    Link Here 
253
  EventId  m_beaconLossTimer;
253
  EventId  m_beaconLossTimer;
254
  uint16_t m_maxBeaconLoss;
254
  uint16_t m_maxBeaconLoss;
255
  uint16_t m_maxPacketFail;
255
  uint16_t m_maxPacketFail;
256
  //\}
256
  // \}
257
  /// How to report my status change
257
  /// How to report my status change
258
  SignalStatusCallback m_linkStatusCallback;
258
  SignalStatusCallback m_linkStatusCallback;
259
};
259
};
(-)a/src/mesh/model/dot11s/peer-management-protocol-mac.h (-19 / +19 lines)
 Lines 45-70    Link Here 
45
  PeerManagementProtocolMac (uint32_t interface, Ptr<PeerManagementProtocol> protocol);
45
  PeerManagementProtocolMac (uint32_t interface, Ptr<PeerManagementProtocol> protocol);
46
  ~PeerManagementProtocolMac ();
46
  ~PeerManagementProtocolMac ();
47
  ///\name Inherited from plugin abstract class
47
  ///\name Inherited from plugin abstract class
48
  ///\{
48
  // \{
49
  void SetParent (Ptr<MeshWifiInterfaceMac> parent);
49
  void SetParent (Ptr<MeshWifiInterfaceMac> parent);
50
  bool Receive (Ptr<Packet> packet, const WifiMacHeader & header);
50
  bool Receive (Ptr<Packet> packet, const WifiMacHeader & header);
51
  bool UpdateOutcomingFrame (Ptr<Packet> packet, WifiMacHeader & header, Mac48Address from, Mac48Address to);
51
  bool UpdateOutcomingFrame (Ptr<Packet> packet, WifiMacHeader & header, Mac48Address from, Mac48Address to);
52
  void UpdateBeacon (MeshWifiBeacon & beacon) const;
52
  void UpdateBeacon (MeshWifiBeacon & beacon) const;
53
  ///\}
53
  // \}
54
  ///\name Statistics:
54
  ///\name Statistics
55
  ///\{
55
  // \{
56
  void Report (std::ostream &) const;
56
  void Report (std::ostream &) const;
57
  void ResetStats ();
57
  void ResetStats ();
58
  uint32_t GetLinkMetric (Mac48Address peerAddress);
58
  uint32_t GetLinkMetric (Mac48Address peerAddress);
59
  ///\}
59
  // \}
60
private:
60
private:
61
  PeerManagementProtocolMac& operator= (const PeerManagementProtocolMac &);
61
  PeerManagementProtocolMac& operator= (const PeerManagementProtocolMac &);
62
  PeerManagementProtocolMac (const PeerManagementProtocolMac &);
62
  PeerManagementProtocolMac (const PeerManagementProtocolMac &);
63
63
64
  friend class PeerManagementProtocol;
64
  friend class PeerManagementProtocol;
65
  friend class PeerLink;
65
  friend class PeerLink;
66
  ///\name Create peer link management frames:
66
  ///\name Create peer link management frames
67
  ///\{
67
  // \{
68
  /**
69
   * \brief This structure keeps all fields in peer link management frame,
70
   * which are not subclasses of WifiInformationElement
71
   */
68
  struct PlinkFrameStart
72
  struct PlinkFrameStart
69
  {
73
  {
70
    uint8_t subtype;
74
    uint8_t subtype;
 Lines 75-92    Link Here 
75
  Ptr<Packet> CreatePeerLinkOpenFrame ();
79
  Ptr<Packet> CreatePeerLinkOpenFrame ();
76
  Ptr<Packet> CreatePeerLinkConfirmFrame ();
80
  Ptr<Packet> CreatePeerLinkConfirmFrame ();
77
  Ptr<Packet> CreatePeerLinkCloseFrame ();
81
  Ptr<Packet> CreatePeerLinkCloseFrame ();
78
  /**
82
  /// Parses the start of the frame, where no WifiInformationElements exist
79
   * \brief This structure keeps all fields in peer link management frame,
80
   * which are not subclasses of WifiInformationElement
81
   */
82
  /// \name Parses the start of the frame, where there are no
83
  /// WifiInformationElements exist
84
  PlinkFrameStart ParsePlinkFrame (Ptr<const Packet> packet);
83
  PlinkFrameStart ParsePlinkFrame (Ptr<const Packet> packet);
85
  ///\}
84
  // \}
86
  ///// Closes link when a proper number of successive transmissions have failed
85
  ///  Closes link when a proper number of successive transmissions have failed
87
  void TxError (WifiMacHeader const &hdr);
86
  void TxError (WifiMacHeader const &hdr);
88
  void TxOk (WifiMacHeader const &hdr);
87
  void TxOk (WifiMacHeader const &hdr);
89
  ///BCA functionallity:
88
  /// BCA functionality
90
  void SetBeaconShift (Time shift);
89
  void SetBeaconShift (Time shift);
91
  void SetPeerManagerProtcol (Ptr<PeerManagementProtocol> protocol);
90
  void SetPeerManagerProtcol (Ptr<PeerManagementProtocol> protocol);
92
  void SendPeerLinkManagementFrame (
91
  void SendPeerLinkManagementFrame (
 Lines 96-104    Link Here 
96
    IePeerManagement peerElement,
95
    IePeerManagement peerElement,
97
    IeConfiguration meshConfig
96
    IeConfiguration meshConfig
98
    );
97
    );
99
  ///\brief DUBUG only - to print established links
98
  ///\brief debug only, used to print established links
100
  Mac48Address GetAddress () const;
99
  Mac48Address GetAddress () const;
101
  ///\name Statistics
100
  ///\name Statistics
101
  // \{
102
  struct Statistics
102
  struct Statistics
103
  {
103
  {
104
    uint16_t txOpen;
104
    uint16_t txOpen;
 Lines 122-132    Link Here 
122
  struct Statistics m_stats;
122
  struct Statistics m_stats;
123
  ///\}
123
  ///\}
124
  ///\name Information about MAC and protocol:
124
  ///\name Information about MAC and protocol:
125
  ///\{
125
  // \{
126
  Ptr<MeshWifiInterfaceMac> m_parent;
126
  Ptr<MeshWifiInterfaceMac> m_parent;
127
  uint32_t m_ifIndex;
127
  uint32_t m_ifIndex;
128
  Ptr<PeerManagementProtocol> m_protocol;
128
  Ptr<PeerManagementProtocol> m_protocol;
129
  ///\}
129
  // \}
130
};
130
};
131
131
132
} // namespace dot11s
132
} // namespace dot11s
(-)a/src/mesh/model/dot11s/peer-management-protocol.h (-10 / +11 lines)
 Lines 82-88    Link Here 
82
   * \param beaconTiming beacon timing element (needed by BCA)
82
   * \param beaconTiming beacon timing element (needed by BCA)
83
   */
83
   */
84
  void ReceiveBeacon (uint32_t interface, Mac48Address peerAddress, Time beaconInterval, Ptr<IeBeaconTiming> beaconTiming);
84
  void ReceiveBeacon (uint32_t interface, Mac48Address peerAddress, Time beaconInterval, Ptr<IeBeaconTiming> beaconTiming);
85
  //\}
85
  // \}
86
  /**
86
  /**
87
   * \brief Methods that handle Peer link management frames
87
   * \brief Methods that handle Peer link management frames
88
   * interaction:
88
   * interaction:
 Lines 125-133    Link Here 
125
   * \brief Checks if there is established link
125
   * \brief Checks if there is established link
126
   */
126
   */
127
  bool IsActiveLink (uint32_t interface, Mac48Address peerAddress);
127
  bool IsActiveLink (uint32_t interface, Mac48Address peerAddress);
128
  //\}
128
  // \}
129
  ///\name Interface to other protocols (MLME)
129
  ///\name Interface to other protocols (MLME)
130
  //\{
130
  // \{
131
  /// Set peer link status change callback
131
  /// Set peer link status change callback
132
  void SetPeerLinkStatusCallback (Callback<void, Mac48Address, Mac48Address, uint32_t, bool> cb);
132
  void SetPeerLinkStatusCallback (Callback<void, Mac48Address, Mac48Address, uint32_t, bool> cb);
133
  /// Find active peer link by my interface and peer interface MAC
133
  /// Find active peer link by my interface and peer interface MAC
 Lines 150-156    Link Here 
150
  void Report (std::ostream &) const;
150
  void Report (std::ostream &) const;
151
  void ResetStats ();
151
  void ResetStats ();
152
private:
152
private:
153
  /** \name Private structures
153
  /**
154
   * \name Private structures
154
   * \{
155
   * \{
155
   */
156
   */
156
  /// Keeps information about beacon of peer station: beacon interval, association ID, last time we have received a beacon
157
  /// Keeps information about beacon of peer station: beacon interval, association ID, last time we have received a beacon
 Lines 171-177    Link Here 
171
  typedef std::map<uint32_t, BeaconsOnInterface> BeaconInfoMap;
172
  typedef std::map<uint32_t, BeaconsOnInterface> BeaconInfoMap;
172
  ///\brief this vector keeps pointers to MAC-plugins
173
  ///\brief this vector keeps pointers to MAC-plugins
173
  typedef std::map<uint32_t, Ptr<PeerManagementProtocolMac> > PeerManagementProtocolMacMap;
174
  typedef std::map<uint32_t, Ptr<PeerManagementProtocolMac> > PeerManagementProtocolMacMap;
174
  ///\}
175
  // \}
175
private:
176
private:
176
  PeerManagementProtocol& operator= (const PeerManagementProtocol &);
177
  PeerManagementProtocol& operator= (const PeerManagementProtocol &);
177
  PeerManagementProtocol (const PeerManagementProtocol &);
178
  PeerManagementProtocol (const PeerManagementProtocol &);
 Lines 200-206    Link Here 
200
   */
201
   */
201
  Time TuToTime (uint32_t x);
202
  Time TuToTime (uint32_t x);
202
  uint32_t TimeToTu (Time x);
203
  uint32_t TimeToTu (Time x);
203
  ///\}
204
  // \}
204
205
205
  /// Aux. method to register open links
206
  /// Aux. method to register open links
206
  void NotifyLinkOpen (Mac48Address peerMp, Mac48Address peerIface, Mac48Address myIface, uint32_t interface);
207
  void NotifyLinkOpen (Mac48Address peerMp, Mac48Address peerIface, Mac48Address myIface, uint32_t interface);
 Lines 218-226    Link Here 
218
  bool m_enableBca;
219
  bool m_enableBca;
219
  /// Beacon can be shifted at [-m_maxBeaconShift; +m_maxBeaconShift] TUs
220
  /// Beacon can be shifted at [-m_maxBeaconShift; +m_maxBeaconShift] TUs
220
  uint16_t m_maxBeaconShift;
221
  uint16_t m_maxBeaconShift;
221
  ///Last beacon at each interface
222
  /// Last beacon at each interface
222
  std::map<uint32_t, Time> m_lastBeacon;
223
  std::map<uint32_t, Time> m_lastBeacon;
223
  ///Beacon interval at each interface
224
  /// Beacon interval at each interface
224
  std::map<uint32_t, Time> m_beaconInterval;
225
  std::map<uint32_t, Time> m_beaconInterval;
225
226
226
  /**
227
  /**
 Lines 248-254    Link Here 
248
  LinkEventCallback m_linkCloseTraceSrc;
249
  LinkEventCallback m_linkCloseTraceSrc;
249
250
250
  ///\name Statistics:
251
  ///\name Statistics:
251
  ///\{
252
  // \{
252
  struct Statistics {
253
  struct Statistics {
253
    uint16_t linksTotal;
254
    uint16_t linksTotal;
254
    uint16_t linksOpened;
255
    uint16_t linksOpened;
 Lines 258-264    Link Here 
258
    void Print (std::ostream & os) const;
259
    void Print (std::ostream & os) const;
259
  };
260
  };
260
  struct Statistics m_stats;
261
  struct Statistics m_stats;
261
  ///\}
262
  // \}
262
};
263
};
263
264
264
} // namespace dot11s
265
} // namespace dot11s
(-)a/src/mesh/model/mesh-wifi-beacon.h (-1 / +1 lines)
 Lines 58-64    Link Here 
58
   * \param mpAddress is mesh point address
58
   * \param mpAddress is mesh point address
59
   */
59
   */
60
  WifiMacHeader CreateHeader (Mac48Address address, Mac48Address mpAddress);
60
  WifiMacHeader CreateHeader (Mac48Address address, Mac48Address mpAddress);
61
  ///Returns a beacon interval of wifi beacon
61
  /// Returns a beacon interval of wifi beacon
62
  Time GetBeaconInterval () const;
62
  Time GetBeaconInterval () const;
63
  /// Create frame = { beacon header + all information elements sorted by ElementId () }
63
  /// Create frame = { beacon header + all information elements sorted by ElementId () }
64
  Ptr<Packet> CreatePacket ();
64
  Ptr<Packet> CreatePacket ();
(-)a/src/mesh/model/mesh-wifi-interface-mac.h (-17 / +17 lines)
 Lines 61-79    Link Here 
61
  virtual ~MeshWifiInterfaceMac ();
61
  virtual ~MeshWifiInterfaceMac ();
62
62
63
  ///\name Inherited from WifiMac
63
  ///\name Inherited from WifiMac
64
  //\{
64
  // \{
65
  virtual void  Enqueue (Ptr<const Packet> packet, Mac48Address to, Mac48Address from);
65
  virtual void  Enqueue (Ptr<const Packet> packet, Mac48Address to, Mac48Address from);
66
  virtual void  Enqueue (Ptr<const Packet> packet, Mac48Address to);
66
  virtual void  Enqueue (Ptr<const Packet> packet, Mac48Address to);
67
  virtual bool  SupportsSendFrom () const;
67
  virtual bool  SupportsSendFrom () const;
68
  virtual void  SetLinkUpCallback (Callback<void> linkUp);
68
  virtual void  SetLinkUpCallback (Callback<void> linkUp);
69
  //\}
69
  // \}
70
  ///\name Each mesh point interfaces must know the mesh point address
70
  ///\name Each mesh point interfaces must know the mesh point address
71
  //\{
71
  // \{
72
  void SetMeshPointAddress (Mac48Address);
72
  void SetMeshPointAddress (Mac48Address);
73
  Mac48Address GetMeshPointAddress () const;
73
  Mac48Address GetMeshPointAddress () const;
74
  //\}
74
  // \}
75
  ///\name Beacons
75
  ///\name Beacons
76
  //\{
76
  // \{
77
  /// Set maximum initial random delay before first beacon
77
  /// Set maximum initial random delay before first beacon
78
  void SetRandomStartDelay (Time interval);
78
  void SetRandomStartDelay (Time interval);
79
  /// Set interval between two successive beacons
79
  /// Set interval between two successive beacons
 Lines 94-106    Link Here 
94
   * \attention User of ShiftTbtt () must take care to not shift it to the past.
94
   * \attention User of ShiftTbtt () must take care to not shift it to the past.
95
   */
95
   */
96
  void ShiftTbtt (Time shift);
96
  void ShiftTbtt (Time shift);
97
  //\}
97
  // \}
98
98
99
  ///\name Plugins
99
  ///\name Plugins
100
  //\{
100
  // \{
101
  /// Install plugin. TODO return unique ID to allow unregister plugins
101
  /// Install plugin. TODO return unique ID to allow unregister plugins
102
  void InstallPlugin (Ptr<MeshWifiInterfaceMacPlugin> plugin);
102
  void InstallPlugin (Ptr<MeshWifiInterfaceMacPlugin> plugin);
103
  //\}
103
  // \}
104
104
105
  /** \name Channel switching
105
  /** \name Channel switching
106
   *
106
   *
 Lines 109-120    Link Here 
109
   *
109
   *
110
   * Number of channels to use must be limited elsewhere.
110
   * Number of channels to use must be limited elsewhere.
111
   */
111
   */
112
  //\{
112
  // \{
113
  /// Current channel Id
113
  /// Current channel Id
114
  uint16_t GetFrequencyChannel () const;
114
  uint16_t GetFrequencyChannel () const;
115
  /// Switch channel
115
  /// Switch channel
116
  void SwitchFrequencyChannel (uint16_t new_id);
116
  void SwitchFrequencyChannel (uint16_t new_id);
117
  //\}
117
  // \}
118
118
119
  /// To be used by plugins sending management frames.
119
  /// To be used by plugins sending management frames.
120
  void SendManagementFrame (Ptr<Packet> frame, const WifiMacHeader& hdr);
120
  void SendManagementFrame (Ptr<Packet> frame, const WifiMacHeader& hdr);
 Lines 122-132    Link Here 
122
  bool CheckSupportedRates (SupportedRates rates) const;
122
  bool CheckSupportedRates (SupportedRates rates) const;
123
  /// \return list of supported bitrates
123
  /// \return list of supported bitrates
124
  SupportedRates GetSupportedRates () const;
124
  SupportedRates GetSupportedRates () const;
125
  ///\ name Metric Calculation routines:
125
  ///\name Metric Calculation routines:
126
  ///\{
126
  // \{
127
  void SetLinkMetricCallback (Callback<uint32_t, Mac48Address, Ptr<MeshWifiInterfaceMac> > cb);
127
  void SetLinkMetricCallback (Callback<uint32_t, Mac48Address, Ptr<MeshWifiInterfaceMac> > cb);
128
  uint32_t GetLinkMetric (Mac48Address peerAddress);
128
  uint32_t GetLinkMetric (Mac48Address peerAddress);
129
  ///\}
129
  // \}
130
  ///\brief Statistics:
130
  ///\brief Statistics:
131
  void Report (std::ostream &) const;
131
  void Report (std::ostream &) const;
132
  void ResetStats ();
132
  void ResetStats ();
 Lines 152-165    Link Here 
152
  typedef std::vector<Ptr<MeshWifiInterfaceMacPlugin> > PluginList;
152
  typedef std::vector<Ptr<MeshWifiInterfaceMacPlugin> > PluginList;
153
153
154
  ///\name Mesh timing intervals
154
  ///\name Mesh timing intervals
155
  //\{
155
  // \{
156
  /// Beaconing interval.
156
  /// Beaconing interval.
157
  Time m_beaconInterval;
157
  Time m_beaconInterval;
158
  /// Maximum delay before first beacon
158
  /// Maximum delay before first beacon
159
  Time m_randomStart;
159
  Time m_randomStart;
160
  /// Time for the next frame
160
  /// Time for the next frame
161
  Time m_tbtt;
161
  Time m_tbtt;
162
  //\}
162
  // \}
163
163
164
  /// Mesh point address
164
  /// Mesh point address
165
  Mac48Address m_mpAddress;
165
  Mac48Address m_mpAddress;
 Lines 170-176    Link Here 
170
  PluginList m_plugins;
170
  PluginList m_plugins;
171
  Callback<uint32_t, Mac48Address, Ptr<MeshWifiInterfaceMac> > m_linkMetricCallback;
171
  Callback<uint32_t, Mac48Address, Ptr<MeshWifiInterfaceMac> > m_linkMetricCallback;
172
  ///\name Statistics:
172
  ///\name Statistics:
173
  ///\{
173
  // \{
174
  struct Statistics
174
  struct Statistics
175
  {
175
  {
176
    uint16_t recvBeacons;
176
    uint16_t recvBeacons;
 Lines 183-189    Link Here 
183
    Statistics ();
183
    Statistics ();
184
  };
184
  };
185
  Statistics m_stats;
185
  Statistics m_stats;
186
  ///\}
186
  // \}
187
  /// Current PHY standard: needed to configure metric
187
  /// Current PHY standard: needed to configure metric
188
  WifiPhyStandard m_standard;
188
  WifiPhyStandard m_standard;
189
};
189
};
(-)a/src/mobility/model/mobility.h (-1 / +1 lines)
 Lines 1-5    Link Here 
1
/**
1
/**
2
 * @defgroup mobility Mobility
2
 * \defgroup mobility Mobility
3
 */
3
 */
4
4
5
/**
5
/**
(-)a/src/network/helper/trace-helper.h (-99 / +99 lines)
 Lines 55-89    Link Here 
55
  };
55
  };
56
56
57
  /**
57
  /**
58
   * @brief Create a pcap helper.
58
   * \brief Create a pcap helper.
59
   */
59
   */
60
  PcapHelper ();
60
  PcapHelper ();
61
61
62
  /**
62
  /**
63
   * @brief Destroy a pcap helper.
63
   * \brief Destroy a pcap helper.
64
   */
64
   */
65
  ~PcapHelper ();
65
  ~PcapHelper ();
66
66
67
  /**
67
  /**
68
   * @brief Let the pcap helper figure out a reasonable filename to use for a
68
   * \brief Let the pcap helper figure out a reasonable filename to use for a
69
   * pcap file associated with a device.
69
   * pcap file associated with a device.
70
   */
70
   */
71
  std::string GetFilenameFromDevice (std::string prefix, Ptr<NetDevice> device, bool useObjectNames = true);
71
  std::string GetFilenameFromDevice (std::string prefix, Ptr<NetDevice> device, bool useObjectNames = true);
72
72
73
  /**
73
  /**
74
   * @brief Let the pcap helper figure out a reasonable filename to use for the
74
   * \brief Let the pcap helper figure out a reasonable filename to use for the
75
   * pcap file associated with a node.
75
   * pcap file associated with a node.
76
   */
76
   */
77
  std::string GetFilenameFromInterfacePair (std::string prefix, Ptr<Object> object, 
77
  std::string GetFilenameFromInterfacePair (std::string prefix, Ptr<Object> object, 
78
                                            uint32_t interface, bool useObjectNames = true);
78
                                            uint32_t interface, bool useObjectNames = true);
79
79
80
  /**
80
  /**
81
   * @brief Create and initialize a pcap file.
81
   * \brief Create and initialize a pcap file.
82
   */
82
   */
83
  Ptr<PcapFileWrapper> CreateFile (std::string filename, std::ios::openmode filemode,
83
  Ptr<PcapFileWrapper> CreateFile (std::string filename, std::ios::openmode filemode,
84
                                   uint32_t dataLinkType,  uint32_t snapLen = 65535, int32_t tzCorrection = 0);
84
                                   uint32_t dataLinkType,  uint32_t snapLen = 65535, int32_t tzCorrection = 0);
85
  /**
85
  /**
86
   * @brief Hook a trace source to the default trace sink
86
   * \brief Hook a trace source to the default trace sink
87
   */
87
   */
88
  template <typename T> void HookDefaultSink (Ptr<T> object, std::string traceName, Ptr<PcapFileWrapper> file);
88
  template <typename T> void HookDefaultSink (Ptr<T> object, std::string traceName, Ptr<PcapFileWrapper> file);
89
89
 Lines 110-139    Link Here 
110
{
110
{
111
public:
111
public:
112
  /**
112
  /**
113
   * @brief Create an ascii trace helper.
113
   * \brief Create an ascii trace helper.
114
   */
114
   */
115
  AsciiTraceHelper ();
115
  AsciiTraceHelper ();
116
116
117
  /**
117
  /**
118
   * @brief Destroy an ascii trace helper.
118
   * \brief Destroy an ascii trace helper.
119
   */
119
   */
120
  ~AsciiTraceHelper ();
120
  ~AsciiTraceHelper ();
121
121
122
  /**
122
  /**
123
   * @brief Let the ascii trace helper figure out a reasonable filename to use
123
   * \brief Let the ascii trace helper figure out a reasonable filename to use
124
   * for an ascii trace file associated with a device.
124
   * for an ascii trace file associated with a device.
125
   */
125
   */
126
  std::string GetFilenameFromDevice (std::string prefix, Ptr<NetDevice> device, bool useObjectNames = true);
126
  std::string GetFilenameFromDevice (std::string prefix, Ptr<NetDevice> device, bool useObjectNames = true);
127
127
128
  /**
128
  /**
129
   * @brief Let the ascii trace helper figure out a reasonable filename to use
129
   * \brief Let the ascii trace helper figure out a reasonable filename to use
130
   * for an ascii trace file associated with a node.
130
   * for an ascii trace file associated with a node.
131
   */
131
   */
132
  std::string GetFilenameFromInterfacePair (std::string prefix, Ptr<Object> object, 
132
  std::string GetFilenameFromInterfacePair (std::string prefix, Ptr<Object> object, 
133
                                            uint32_t interface, bool useObjectNames = true);
133
                                            uint32_t interface, bool useObjectNames = true);
134
134
135
  /**
135
  /**
136
   * @brief Create and initialize an output stream object we'll use to write the 
136
   * \brief Create and initialize an output stream object we'll use to write the 
137
   * traced bits.
137
   * traced bits.
138
   *
138
   *
139
   * One of the common issues users run into when trying to use tracing in ns-3
139
   * One of the common issues users run into when trying to use tracing in ns-3
 Lines 156-169    Link Here 
156
                                             std::ios::openmode filemode = std::ios::out);
156
                                             std::ios::openmode filemode = std::ios::out);
157
157
158
  /**
158
  /**
159
   * @brief Hook a trace source to the default enqueue operation trace sink that
159
   * \brief Hook a trace source to the default enqueue operation trace sink that
160
   * does not accept nor log a trace context.
160
   * does not accept nor log a trace context.
161
   */
161
   */
162
  template <typename T> 
162
  template <typename T> 
163
  void HookDefaultEnqueueSinkWithoutContext (Ptr<T> object, std::string traceName, Ptr<OutputStreamWrapper> stream);
163
  void HookDefaultEnqueueSinkWithoutContext (Ptr<T> object, std::string traceName, Ptr<OutputStreamWrapper> stream);
164
164
165
  /**
165
  /**
166
   * @brief Hook a trace source to the default enqueue operation trace sink that
166
   * \brief Hook a trace source to the default enqueue operation trace sink that
167
   * does accept and log a trace context.
167
   * does accept and log a trace context.
168
   */
168
   */
169
  template <typename T> 
169
  template <typename T> 
 Lines 171-184    Link Here 
171
                                          std::string context, std::string traceName, Ptr<OutputStreamWrapper> stream);
171
                                          std::string context, std::string traceName, Ptr<OutputStreamWrapper> stream);
172
172
173
  /**
173
  /**
174
   * @brief Hook a trace source to the default drop operation trace sink that 
174
   * \brief Hook a trace source to the default drop operation trace sink that 
175
   * does not accept nor log a trace context.
175
   * does not accept nor log a trace context.
176
   */
176
   */
177
  template <typename T> 
177
  template <typename T> 
178
  void HookDefaultDropSinkWithoutContext (Ptr<T> object, std::string traceName, Ptr<OutputStreamWrapper> stream);
178
  void HookDefaultDropSinkWithoutContext (Ptr<T> object, std::string traceName, Ptr<OutputStreamWrapper> stream);
179
179
180
  /**
180
  /**
181
   * @brief Hook a trace source to the default drop operation trace sink that 
181
   * \brief Hook a trace source to the default drop operation trace sink that 
182
   * does accept and log a trace context.
182
   * does accept and log a trace context.
183
   */
183
   */
184
  template <typename T> 
184
  template <typename T> 
 Lines 186-199    Link Here 
186
                                       std::string context, std::string traceName, Ptr<OutputStreamWrapper> stream);
186
                                       std::string context, std::string traceName, Ptr<OutputStreamWrapper> stream);
187
187
188
  /**
188
  /**
189
   * @brief Hook a trace source to the default dequeue operation trace sink
189
   * \brief Hook a trace source to the default dequeue operation trace sink
190
   * that does not accept nor log a trace context.
190
   * that does not accept nor log a trace context.
191
   */
191
   */
192
  template <typename T> 
192
  template <typename T> 
193
  void HookDefaultDequeueSinkWithoutContext (Ptr<T> object, std::string traceName, Ptr<OutputStreamWrapper> stream);
193
  void HookDefaultDequeueSinkWithoutContext (Ptr<T> object, std::string traceName, Ptr<OutputStreamWrapper> stream);
194
194
195
  /**
195
  /**
196
   * @brief Hook a trace source to the default dequeue operation trace sink
196
   * \brief Hook a trace source to the default dequeue operation trace sink
197
   * that does accept and log a trace context.
197
   * that does accept and log a trace context.
198
   */
198
   */
199
  template <typename T> 
199
  template <typename T> 
 Lines 201-214    Link Here 
201
                                          std::string context, std::string traceName, Ptr<OutputStreamWrapper> stream);
201
                                          std::string context, std::string traceName, Ptr<OutputStreamWrapper> stream);
202
202
203
  /**
203
  /**
204
   * @brief Hook a trace source to the default receive operation trace sink
204
   * \brief Hook a trace source to the default receive operation trace sink
205
   * that does not accept nor log a trace context.
205
   * that does not accept nor log a trace context.
206
   */
206
   */
207
  template <typename T> 
207
  template <typename T> 
208
  void HookDefaultReceiveSinkWithoutContext (Ptr<T> object, std::string traceName, Ptr<OutputStreamWrapper> stream);
208
  void HookDefaultReceiveSinkWithoutContext (Ptr<T> object, std::string traceName, Ptr<OutputStreamWrapper> stream);
209
209
210
  /**
210
  /**
211
   * @brief Hook a trace source to the default receive operation trace sink
211
   * \brief Hook a trace source to the default receive operation trace sink
212
   * that does accept and log a trace context.
212
   * that does accept and log a trace context.
213
   */
213
   */
214
  template <typename T> 
214
  template <typename T> 
 Lines 324-382    Link Here 
324
{
324
{
325
public:
325
public:
326
  /**
326
  /**
327
   * @brief Construct a PcapHelperForDevice
327
   * \brief Construct a PcapHelperForDevice
328
   */
328
   */
329
  PcapHelperForDevice () {}
329
  PcapHelperForDevice () {}
330
330
331
  /**
331
  /**
332
   * @brief Destroy a PcapHelperForDevice
332
   * \brief Destroy a PcapHelperForDevice
333
   */
333
   */
334
  virtual ~PcapHelperForDevice () {}
334
  virtual ~PcapHelperForDevice () {}
335
335
336
  /**
336
  /**
337
   * @brief Enable pcap output the indicated net device.
337
   * \brief Enable pcap output the indicated net device.
338
   * @internal
338
   * \internal
339
   *
339
   *
340
   * @param prefix Filename prefix to use for pcap files.
340
   * \param prefix Filename prefix to use for pcap files.
341
   * @param nd Net device for which you want to enable tracing.
341
   * \param nd Net device for which you want to enable tracing.
342
   * @param promiscuous If true capture all possible packets available at the device.
342
   * \param promiscuous If true capture all possible packets available at the device.
343
   * @param explicitFilename Treat the prefix as an explicit filename if true
343
   * \param explicitFilename Treat the prefix as an explicit filename if true
344
   */
344
   */
345
  virtual void EnablePcapInternal (std::string prefix, Ptr<NetDevice> nd, bool promiscuous, bool explicitFilename) = 0;
345
  virtual void EnablePcapInternal (std::string prefix, Ptr<NetDevice> nd, bool promiscuous, bool explicitFilename) = 0;
346
346
347
  /**
347
  /**
348
   * @brief Enable pcap output the indicated net device.
348
   * \brief Enable pcap output the indicated net device.
349
   *
349
   *
350
   * @param prefix Filename prefix to use for pcap files.
350
   * \param prefix Filename prefix to use for pcap files.
351
   * @param nd Net device for which you want to enable tracing.
351
   * \param nd Net device for which you want to enable tracing.
352
   * @param promiscuous If true capture all possible packets available at the device.
352
   * \param promiscuous If true capture all possible packets available at the device.
353
   * @param explicitFilename Treat the prefix as an explicit filename if true
353
   * \param explicitFilename Treat the prefix as an explicit filename if true
354
   */
354
   */
355
  void EnablePcap (std::string prefix, Ptr<NetDevice> nd, bool promiscuous = false, bool explicitFilename = false);
355
  void EnablePcap (std::string prefix, Ptr<NetDevice> nd, bool promiscuous = false, bool explicitFilename = false);
356
356
357
  /**
357
  /**
358
   * @brief Enable pcap output the indicated net device using a device previously
358
   * \brief Enable pcap output the indicated net device using a device previously
359
   * named using the ns-3 object name service.
359
   * named using the ns-3 object name service.
360
   *
360
   *
361
   * @param prefix filename prefix to use for pcap files.
361
   * \param prefix filename prefix to use for pcap files.
362
   * @param ndName The name of the net device in which you want to enable tracing.
362
   * \param ndName The name of the net device in which you want to enable tracing.
363
   * @param promiscuous If true capture all possible packets available at the device.
363
   * \param promiscuous If true capture all possible packets available at the device.
364
   * @param explicitFilename Treat the prefix as an explicit filename if true
364
   * \param explicitFilename Treat the prefix as an explicit filename if true
365
   */
365
   */
366
  void EnablePcap (std::string prefix, std::string ndName, bool promiscuous = false, bool explicitFilename = false);
366
  void EnablePcap (std::string prefix, std::string ndName, bool promiscuous = false, bool explicitFilename = false);
367
367
368
  /**
368
  /**
369
   * @brief Enable pcap output on each device in the container which is of the 
369
   * \brief Enable pcap output on each device in the container which is of the 
370
   * appropriate type.
370
   * appropriate type.
371
   *
371
   *
372
   * @param prefix Filename prefix to use for pcap files.
372
   * \param prefix Filename prefix to use for pcap files.
373
   * @param d container of devices of type ns3::CsmaNetDevice
373
   * \param d container of devices of type ns3::CsmaNetDevice
374
   * @param promiscuous If true capture all possible packets available at the device.
374
   * \param promiscuous If true capture all possible packets available at the device.
375
   */
375
   */
376
  void EnablePcap (std::string prefix, NetDeviceContainer d, bool promiscuous = false);
376
  void EnablePcap (std::string prefix, NetDeviceContainer d, bool promiscuous = false);
377
377
378
  /**
378
  /**
379
   * @brief Enable pcap output on each device (which is of the appropriate type)
379
   * \brief Enable pcap output on each device (which is of the appropriate type)
380
   * in the nodes provided in the container.
380
   * in the nodes provided in the container.
381
   *
381
   *
382
   * \param prefix Filename prefix to use for pcap files.
382
   * \param prefix Filename prefix to use for pcap files.
 Lines 386-407    Link Here 
386
  void EnablePcap (std::string prefix, NodeContainer n, bool promiscuous = false);
386
  void EnablePcap (std::string prefix, NodeContainer n, bool promiscuous = false);
387
387
388
  /**
388
  /**
389
   * @brief Enable pcap output on the device specified by a global node-id (of
389
   * \brief Enable pcap output on the device specified by a global node-id (of
390
   * a previously created node) and associated device-id.
390
   * a previously created node) and associated device-id.
391
   *
391
   *
392
   * @param prefix Filename prefix to use for pcap files.
392
   * \param prefix Filename prefix to use for pcap files.
393
   * @param nodeid the node id
393
   * \param nodeid the node id
394
   * @param deviceid the device id
394
   * \param deviceid the device id
395
   * @param promiscuous If true capture all possible packets available at the device.
395
   * \param promiscuous If true capture all possible packets available at the device.
396
   */
396
   */
397
  void EnablePcap (std::string prefix, uint32_t nodeid, uint32_t deviceid, bool promiscuous = false);
397
  void EnablePcap (std::string prefix, uint32_t nodeid, uint32_t deviceid, bool promiscuous = false);
398
398
399
  /**
399
  /**
400
   * @brief Enable pcap output on each device (which is of the appropriate type)
400
   * \brief Enable pcap output on each device (which is of the appropriate type)
401
   * in the set of all nodes created in the simulation.
401
   * in the set of all nodes created in the simulation.
402
   *
402
   *
403
   * @param prefix Filename prefix to use for pcap files.
403
   * \param prefix Filename prefix to use for pcap files.
404
   * @param promiscuous If true capture all possible packets available at the device.
404
   * \param promiscuous If true capture all possible packets available at the device.
405
   */
405
   */
406
  void EnablePcapAll (std::string prefix, bool promiscuous = false);
406
  void EnablePcapAll (std::string prefix, bool promiscuous = false);
407
};
407
};
 Lines 414-431    Link Here 
414
{
414
{
415
public:
415
public:
416
  /**
416
  /**
417
   * @brief Construct an AsciiTraceHelperForDevice.
417
   * \brief Construct an AsciiTraceHelperForDevice.
418
   */
418
   */
419
  AsciiTraceHelperForDevice () {}
419
  AsciiTraceHelperForDevice () {}
420
420
421
  /**
421
  /**
422
   * @brief Destroy an AsciiTraceHelperForDevice.
422
   * \brief Destroy an AsciiTraceHelperForDevice.
423
   */
423
   */
424
  virtual ~AsciiTraceHelperForDevice () {}
424
  virtual ~AsciiTraceHelperForDevice () {}
425
425
426
  /**
426
  /**
427
   * @brief Enable ascii trace output on the indicated net device.
427
   * \brief Enable ascii trace output on the indicated net device.
428
   * @internal
428
   * \internal
429
   *
429
   *
430
   * The implementation is expected to use a provided Ptr<OutputStreamWrapper>
430
   * The implementation is expected to use a provided Ptr<OutputStreamWrapper>
431
   * if it is non-null.  If the OutputStreamWrapper is null, the implementation
431
   * if it is non-null.  If the OutputStreamWrapper is null, the implementation
 Lines 441-451    Link Here 
441
   * trace context could be important, so the device implementation is 
441
   * trace context could be important, so the device implementation is 
442
   * expected to TraceConnect.
442
   * expected to TraceConnect.
443
   *
443
   *
444
   * @param stream An OutputStreamWrapper representing an existing file to use
444
   * \param stream An OutputStreamWrapper representing an existing file to use
445
   *               when writing trace data.
445
   *               when writing trace data.
446
   * @param prefix Filename prefix to use for ascii trace files.
446
   * \param prefix Filename prefix to use for ascii trace files.
447
   * @param nd Net device for which you want to enable tracing
447
   * \param nd Net device for which you want to enable tracing
448
   * @param explicitFilename Treat the prefix as an explicit filename if true
448
   * \param explicitFilename Treat the prefix as an explicit filename if true
449
   */
449
   */
450
  virtual void EnableAsciiInternal (Ptr<OutputStreamWrapper> stream, 
450
  virtual void EnableAsciiInternal (Ptr<OutputStreamWrapper> stream, 
451
                                    std::string prefix, 
451
                                    std::string prefix, 
 Lines 453-516    Link Here 
453
                                    bool explicitFilename) = 0;
453
                                    bool explicitFilename) = 0;
454
454
455
  /**
455
  /**
456
   * @brief Enable ascii trace output on the indicated net device.
456
   * \brief Enable ascii trace output on the indicated net device.
457
   *
457
   *
458
   * @param prefix Filename prefix to use for ascii files.
458
   * \param prefix Filename prefix to use for ascii files.
459
   * @param nd Net device for which you want to enable tracing.
459
   * \param nd Net device for which you want to enable tracing.
460
   * @param explicitFilename Treat the prefix as an explicit filename if true
460
   * \param explicitFilename Treat the prefix as an explicit filename if true
461
   */
461
   */
462
  void EnableAscii (std::string prefix, Ptr<NetDevice> nd, bool explicitFilename = false);
462
  void EnableAscii (std::string prefix, Ptr<NetDevice> nd, bool explicitFilename = false);
463
463
464
  /**
464
  /**
465
   * @brief Enable ascii trace output on the indicated net device.
465
   * \brief Enable ascii trace output on the indicated net device.
466
   *
466
   *
467
   * @param stream An OutputStreamWrapper representing an existing file to use
467
   * \param stream An OutputStreamWrapper representing an existing file to use
468
   *               when writing trace data.
468
   *               when writing trace data.
469
   * @param nd Net device for which you want to enable tracing.
469
   * \param nd Net device for which you want to enable tracing.
470
   */
470
   */
471
  void EnableAscii (Ptr<OutputStreamWrapper> stream, Ptr<NetDevice> nd);
471
  void EnableAscii (Ptr<OutputStreamWrapper> stream, Ptr<NetDevice> nd);
472
472
473
  /**
473
  /**
474
   * @brief Enable ascii trace output the indicated net device using a device 
474
   * \brief Enable ascii trace output the indicated net device using a device 
475
   * previously named using the ns-3 object name service.
475
   * previously named using the ns-3 object name service.
476
   *
476
   *
477
   * @param prefix filename prefix to use for ascii files.
477
   * \param prefix filename prefix to use for ascii files.
478
   * @param ndName The name of the net device in which you want to enable tracing.
478
   * \param ndName The name of the net device in which you want to enable tracing.
479
   * @param explicitFilename Treat the prefix as an explicit filename if true
479
   * \param explicitFilename Treat the prefix as an explicit filename if true
480
   */
480
   */
481
  void EnableAscii (std::string prefix, std::string ndName, bool explicitFilename = false);
481
  void EnableAscii (std::string prefix, std::string ndName, bool explicitFilename = false);
482
482
483
  /**
483
  /**
484
   * @brief Enable ascii trace output the indicated net device using a device 
484
   * \brief Enable ascii trace output the indicated net device using a device 
485
   * previously named using the ns-3 object name service.
485
   * previously named using the ns-3 object name service.
486
   *
486
   *
487
   * @param stream An OutputStreamWrapper representing an existing file to use
487
   * \param stream An OutputStreamWrapper representing an existing file to use
488
   *               when writing trace data.
488
   *               when writing trace data.
489
   * @param ndName The name of the net device in which you want to enable tracing.
489
   * \param ndName The name of the net device in which you want to enable tracing.
490
   */
490
   */
491
  void EnableAscii (Ptr<OutputStreamWrapper> stream, std::string ndName);
491
  void EnableAscii (Ptr<OutputStreamWrapper> stream, std::string ndName);
492
492
493
  /**
493
  /**
494
   * @brief Enable ascii trace output on each device in the container which is
494
   * \brief Enable ascii trace output on each device in the container which is
495
   * of the appropriate type.
495
   * of the appropriate type.
496
   *
496
   *
497
   * @param prefix Filename prefix to use for ascii files.
497
   * \param prefix Filename prefix to use for ascii files.
498
   * @param d container of devices of type ns3::CsmaNetDevice
498
   * \param d container of devices of type ns3::CsmaNetDevice
499
   */
499
   */
500
  void EnableAscii (std::string prefix, NetDeviceContainer d);
500
  void EnableAscii (std::string prefix, NetDeviceContainer d);
501
501
502
  /**
502
  /**
503
   * @brief Enable ascii trace output on each device in the container which is
503
   * \brief Enable ascii trace output on each device in the container which is
504
   * of the appropriate type.
504
   * of the appropriate type.
505
   *
505
   *
506
   * @param stream An OutputStreamWrapper representing an existing file to use
506
   * \param stream An OutputStreamWrapper representing an existing file to use
507
   *               when writing trace data.
507
   *               when writing trace data.
508
   * @param d container of devices of type ns3::CsmaNetDevice
508
   * \param d container of devices of type ns3::CsmaNetDevice
509
   */
509
   */
510
  void EnableAscii (Ptr<OutputStreamWrapper> stream, NetDeviceContainer d);
510
  void EnableAscii (Ptr<OutputStreamWrapper> stream, NetDeviceContainer d);
511
511
512
  /**
512
  /**
513
   * @brief Enable ascii trace output on each device (which is of the 
513
   * \brief Enable ascii trace output on each device (which is of the 
514
   * appropriate type) in the nodes provided in the container.
514
   * appropriate type) in the nodes provided in the container.
515
   *
515
   *
516
   * \param prefix Filename prefix to use for ascii files.
516
   * \param prefix Filename prefix to use for ascii files.
 Lines 519-579    Link Here 
519
  void EnableAscii (std::string prefix, NodeContainer n);
519
  void EnableAscii (std::string prefix, NodeContainer n);
520
520
521
  /**
521
  /**
522
   * @brief Enable ascii trace output on each device (which is of the 
522
   * \brief Enable ascii trace output on each device (which is of the 
523
   * appropriate type) in the nodes provided in the container.
523
   * appropriate type) in the nodes provided in the container.
524
   *
524
   *
525
   * @param stream An OutputStreamWrapper representing an existing file to use
525
   * \param stream An OutputStreamWrapper representing an existing file to use
526
   *               when writing trace data.
526
   *               when writing trace data.
527
   * \param n container of nodes.
527
   * \param n container of nodes.
528
   */
528
   */
529
  void EnableAscii (Ptr<OutputStreamWrapper> stream, NodeContainer n);
529
  void EnableAscii (Ptr<OutputStreamWrapper> stream, NodeContainer n);
530
530
531
  /**
531
  /**
532
   * @brief Enable ascii trace output on each device (which is of the
532
   * \brief Enable ascii trace output on each device (which is of the
533
   * appropriate type) in the set of all nodes created in the simulation.
533
   * appropriate type) in the set of all nodes created in the simulation.
534
   *
534
   *
535
   * @param prefix Filename prefix to use for ascii files.
535
   * \param prefix Filename prefix to use for ascii files.
536
   */
536
   */
537
  void EnableAsciiAll (std::string prefix);
537
  void EnableAsciiAll (std::string prefix);
538
538
539
  /**
539
  /**
540
   * @brief Enable ascii trace output on each device (which is of the
540
   * \brief Enable ascii trace output on each device (which is of the
541
   * appropriate type) in the set of all nodes created in the simulation.
541
   * appropriate type) in the set of all nodes created in the simulation.
542
   *
542
   *
543
   * @param stream An OutputStreamWrapper representing an existing file to use
543
   * \param stream An OutputStreamWrapper representing an existing file to use
544
   *               when writing trace data.
544
   *               when writing trace data.
545
   */
545
   */
546
  void EnableAsciiAll (Ptr<OutputStreamWrapper> stream);
546
  void EnableAsciiAll (Ptr<OutputStreamWrapper> stream);
547
547
548
  /**
548
  /**
549
   * @brief Enable ascii trace output on the device specified by a global 
549
   * \brief Enable ascii trace output on the device specified by a global 
550
   * node-id (of a previously created node) and associated device-id.
550
   * node-id (of a previously created node) and associated device-id.
551
   *
551
   *
552
   * @param prefix Filename prefix to use when creating ascii trace files
552
   * \param prefix Filename prefix to use when creating ascii trace files
553
   * @param nodeid The node identifier/number of the node on which to enable
553
   * \param nodeid The node identifier/number of the node on which to enable
554
   *               ascii tracing
554
   *               ascii tracing
555
   * @param deviceid The device identifier/index of the device on which to enable
555
   * \param deviceid The device identifier/index of the device on which to enable
556
   *               ascii tracing
556
   *               ascii tracing
557
   * @param explicitFilename Treat the prefix as an explicit filename if true
557
   * \param explicitFilename Treat the prefix as an explicit filename if true
558
   */
558
   */
559
  void EnableAscii (std::string prefix, uint32_t nodeid, uint32_t deviceid, bool explicitFilename);
559
  void EnableAscii (std::string prefix, uint32_t nodeid, uint32_t deviceid, bool explicitFilename);
560
560
561
  /**
561
  /**
562
   * @brief Enable ascii trace output on the device specified by a global 
562
   * \brief Enable ascii trace output on the device specified by a global 
563
   * node-id (of a previously created node) and associated device-id.
563
   * node-id (of a previously created node) and associated device-id.
564
   *
564
   *
565
   * @param stream An OutputStreamWrapper representing an existing file to use
565
   * \param stream An OutputStreamWrapper representing an existing file to use
566
   *               when writing trace data.
566
   *               when writing trace data.
567
   * @param nodeid The node identifier/number of the node on which to enable
567
   * \param nodeid The node identifier/number of the node on which to enable
568
   *               ascii tracing
568
   *               ascii tracing
569
   * @param deviceid The device identifier/index of the device on which to enable
569
   * \param deviceid The device identifier/index of the device on which to enable
570
   *               ascii tracing
570
   *               ascii tracing
571
   */
571
   */
572
  void EnableAscii (Ptr<OutputStreamWrapper> stream, uint32_t nodeid, uint32_t deviceid);
572
  void EnableAscii (Ptr<OutputStreamWrapper> stream, uint32_t nodeid, uint32_t deviceid);
573
573
574
private:
574
private:
575
  /**
575
  /**
576
   * @internal Avoid code duplication.
576
   * \internal Avoid code duplication.
577
   */
577
   */
578
  void EnableAsciiImpl (Ptr<OutputStreamWrapper> stream, 
578
  void EnableAsciiImpl (Ptr<OutputStreamWrapper> stream, 
579
                        std::string prefix, 
579
                        std::string prefix, 
 Lines 582-603    Link Here 
582
                        bool explicitFilename);
582
                        bool explicitFilename);
583
583
584
  /**
584
  /**
585
   * @internal Avoid code duplication.
585
   * \internal Avoid code duplication.
586
   */
586
   */
587
  void EnableAsciiImpl (Ptr<OutputStreamWrapper> stream, std::string prefix, NodeContainer n);
587
  void EnableAsciiImpl (Ptr<OutputStreamWrapper> stream, std::string prefix, NodeContainer n);
588
588
589
  /**
589
  /**
590
   * @internal Avoid code duplication.
590
   * \internal Avoid code duplication.
591
   */
591
   */
592
  void EnableAsciiImpl (Ptr<OutputStreamWrapper> stream, std::string prefix, NetDeviceContainer d);
592
  void EnableAsciiImpl (Ptr<OutputStreamWrapper> stream, std::string prefix, NetDeviceContainer d);
593
593
594
  /**
594
  /**
595
   * @internal Avoid code duplication.
595
   * \internal Avoid code duplication.
596
   */
596
   */
597
  void EnableAsciiImpl (Ptr<OutputStreamWrapper> stream, std::string prefix, std::string ndName, bool explicitFilename);
597
  void EnableAsciiImpl (Ptr<OutputStreamWrapper> stream, std::string prefix, std::string ndName, bool explicitFilename);
598
598
599
  /**
599
  /**
600
   * @internal Avoid code duplication.
600
   * \internal Avoid code duplication.
601
   */
601
   */
602
  void EnableAsciiImpl (Ptr<OutputStreamWrapper> stream, std::string prefix, Ptr<NetDevice> nd, bool explicitFilename);
602
  void EnableAsciiImpl (Ptr<OutputStreamWrapper> stream, std::string prefix, Ptr<NetDevice> nd, bool explicitFilename);
603
};
603
};
(-)a/src/network/model/buffer.h (-2 / +2 lines)
 Lines 514-521    Link Here 
514
  /** 
514
  /** 
515
   * Copy the specified amount of data from the buffer to the given output stream.
515
   * Copy the specified amount of data from the buffer to the given output stream.
516
   * 
516
   * 
517
   * @param os the output stream
517
   * \param os the output stream
518
   * @param size the maximum amount of bytes to copy. If zero, nothing is copied.
518
   * \param size the maximum amount of bytes to copy. If zero, nothing is copied.
519
   */
519
   */
520
  void CopyData (std::ostream *os, uint32_t size) const;
520
  void CopyData (std::ostream *os, uint32_t size) const;
521
521
(-)a/src/network/model/packet.h (-3 / +4 lines)
 Lines 168-176    Link Here 
168
 * were serialized in the byte buffer. The maintenance of metadata is
168
 * were serialized in the byte buffer. The maintenance of metadata is
169
 * optional and disabled by default. To enable it, you must call
169
 * optional and disabled by default. To enable it, you must call
170
 * Packet::EnablePrinting and this will allow you to get non-empty
170
 * Packet::EnablePrinting and this will allow you to get non-empty
171
 * output from Packet::Print and Packet::Print. If you wish to only enable
171
 * output from Packet::Print. If you wish to only enable
172
 * checking of metadata, and do not need any printing capability, you can
172
 * checking of metadata, and do not need any printing capability, you can
173
 * call Packet::EnableChecking: its runtime cost is lower than Packet::EnablePrinting.
173
 * call Packet::EnableChecking: its runtime cost is lower than
174
 * Packet::EnablePrinting.
174
 *
175
 *
175
 * - The set of tags contain simulation-specific information which cannot
176
 * - The set of tags contain simulation-specific information which cannot
176
 * be stored in the packet byte buffer because the protocol headers or trailers
177
 * be stored in the packet byte buffer because the protocol headers or trailers
 Lines 415-421    Link Here 
415
  /**
416
  /**
416
   * By default, packets do not keep around enough metadata to
417
   * By default, packets do not keep around enough metadata to
417
   * perform the operations requested by the Print methods. If you
418
   * perform the operations requested by the Print methods. If you
418
   * want to be able to invoke any of the two ::Print methods, 
419
   * want to be able the Packet::Print method, 
419
   * you need to invoke this method at least once during the 
420
   * you need to invoke this method at least once during the 
420
   * simulation setup and before any packet is created.
421
   * simulation setup and before any packet is created.
421
   */
422
   */
(-)a/src/network/utils/generic-phy.h (-4 / +4 lines)
 Lines 30-37    Link Here 
30
 * This method allows the MAC to instruct the PHY to start a
30
 * This method allows the MAC to instruct the PHY to start a
31
 * transmission of a given packet
31
 * transmission of a given packet
32
 *
32
 *
33
 * @param packet the Packet to be transmitted
33
 * \param packet the Packet to be transmitted
34
 * @return this method returns false if the PHY will start TX,
34
 * \return this method returns false if the PHY will start TX,
35
 * true if the PHY refuses to start the TX. If false, the MAC layer
35
 * true if the PHY refuses to start the TX. If false, the MAC layer
36
 * will expect that GenericPhyTxEndCallback is invoked at some point later.
36
 * will expect that GenericPhyTxEndCallback is invoked at some point later.
37
 */
37
 */
 Lines 41-47    Link Here 
41
 * this method is invoked by the PHY to notify the MAC that the
41
 * this method is invoked by the PHY to notify the MAC that the
42
 * transmission of a given packet has been completed.
42
 * transmission of a given packet has been completed.
43
 *
43
 *
44
 * @param packet the Packet whose TX has been completed.
44
 * \param packet the Packet whose TX has been completed.
45
 */
45
 */
46
typedef Callback< void, Ptr<const Packet> > GenericPhyTxEndCallback;
46
typedef Callback< void, Ptr<const Packet> > GenericPhyTxEndCallback;
47
47
 Lines 63-69    Link Here 
63
 * This method is used by the PHY to notify the MAC that a
63
 * This method is used by the PHY to notify the MAC that a
64
 * previously started RX attempt has been successfully completed.
64
 * previously started RX attempt has been successfully completed.
65
 *
65
 *
66
 * @param packet the received Packet
66
 * \param packet the received Packet
67
 */
67
 */
68
typedef Callback< void, Ptr<Packet> > GenericPhyRxEndOkCallback;
68
typedef Callback< void, Ptr<Packet> > GenericPhyRxEndOkCallback;
69
69
(-)a/src/network/utils/output-stream-wrapper.h (-1 / +1 lines)
 Lines 27-33    Link Here 
27
namespace ns3 {
27
namespace ns3 {
28
28
29
/*
29
/*
30
 * @brief A class encapsulating an STL output stream.
30
 * \brief A class encapsulating an STL output stream.
31
 *
31
 *
32
 * This class wraps a pointer to a C++ std::ostream and provides 
32
 * This class wraps a pointer to a C++ std::ostream and provides 
33
 * reference counting of the object.  This class is recommended for users 
33
 * reference counting of the object.  This class is recommended for users 
(-)a/src/network/utils/radiotap-header.h (-37 / +37 lines)
 Lines 27-40    Link Here 
27
namespace ns3 {
27
namespace ns3 {
28
28
29
/**
29
/**
30
 * @brief Radiotap header implementation
30
 * \brief Radiotap header implementation
31
 *
31
 *
32
 * Radiotap is a de facto standard for 802.11 frame injection and reception. 
32
 * Radiotap is a de facto standard for 802.11 frame injection and reception. 
33
 * The radiotap header format is a mechanism to supply additional information 
33
 * The radiotap header format is a mechanism to supply additional information 
34
 * about frames, from the driver to userspace applications such as libpcap, and 
34
 * about frames, from the driver to userspace applications such as libpcap, and 
35
 * from a userspace application to the driver for transmission. 
35
 * from a userspace application to the driver for transmission. 
36
 *
36
 *
37
 * @warning the radiotap header specification says that the fields included in
37
 * \warning the radiotap header specification says that the fields included in
38
 * the header should be aligned to their natural ize (e.g., 16-bit fields 
38
 * the header should be aligned to their natural ize (e.g., 16-bit fields 
39
 * aligned to 16-bit boundaries, 32-bit fields aligned to 32-bit boundaries, 
39
 * aligned to 16-bit boundaries, 32-bit fields aligned to 32-bit boundaries, 
40
 * and so on.  This implementation does not enforce this.  However, the radiotap
40
 * and so on.  This implementation does not enforce this.  However, the radiotap
 Lines 57-63    Link Here 
57
   * buffer of a packet.  This method returns the number of bytes which are 
57
   * buffer of a packet.  This method returns the number of bytes which are 
58
   * needed to store the header data during a Serialize.
58
   * needed to store the header data during a Serialize.
59
   *
59
   *
60
   * @returns The expected size of the header.
60
   * \returns The expected size of the header.
61
   */
61
   */
62
  virtual uint32_t GetSerializedSize (void) const;
62
  virtual uint32_t GetSerializedSize (void) const;
63
63
 Lines 66-72    Link Here 
66
   * buffer of a packet.  The data written is expected to match bit-for-bit the 
66
   * buffer of a packet.  The data written is expected to match bit-for-bit the 
67
   * representation of this header in a real network.
67
   * representation of this header in a real network.
68
   *
68
   *
69
   * @param start An iterator which points to where the header should
69
   * \param start An iterator which points to where the header should
70
   *              be written.
70
   *              be written.
71
   */
71
   */
72
  virtual void Serialize (Buffer::Iterator start) const;
72
  virtual void Serialize (Buffer::Iterator start) const;
 Lines 76-84    Link Here 
76
   * byte buffer of a packet.  The data read is expected to match bit-for-bit 
76
   * byte buffer of a packet.  The data read is expected to match bit-for-bit 
77
   * the representation of this header in real networks.
77
   * the representation of this header in real networks.
78
   *
78
   *
79
   * @param start An iterator which points to where the header should
79
   * \param start An iterator which points to where the header should
80
   *              written.
80
   *              written.
81
   * @returns The number of bytes read.
81
   * \returns The number of bytes read.
82
   */
82
   */
83
  virtual uint32_t Deserialize (Buffer::Iterator start);
83
  virtual uint32_t Deserialize (Buffer::Iterator start);
84
84
 Lines 93-117    Link Here 
93
   *
93
   *
94
   * eg: (field1 val1 field2 val2 field3 val3) field4 val4 field5 val5
94
   * eg: (field1 val1 field2 val2 field3 val3) field4 val4 field5 val5
95
   *
95
   *
96
   * @param os The output stream
96
   * \param os The output stream
97
   */
97
   */
98
  virtual void Print (std::ostream &os) const;
98
  virtual void Print (std::ostream &os) const;
99
99
100
  /**
100
  /**
101
   * @brief Set the Time Synchronization Function Timer (TSFT) value.  Valid for
101
   * \brief Set the Time Synchronization Function Timer (TSFT) value.  Valid for
102
   * received frames only. 
102
   * received frames only. 
103
   *
103
   *
104
   * @param tsft Value in microseconds of the MAC's 64-bit 802.11 Time 
104
   * \param tsft Value in microseconds of the MAC's 64-bit 802.11 Time 
105
   *             Synchronization Function timer when the first bit of the MPDU
105
   *             Synchronization Function timer when the first bit of the MPDU
106
   *             arrived at the MAC.
106
   *             arrived at the MAC.
107
   */
107
   */
108
  void SetTsft (uint64_t tsft);
108
  void SetTsft (uint64_t tsft);
109
109
110
  /**
110
  /**
111
   * @brief Get the Time Synchronization Function Timer (TSFT) value.  Valid for
111
   * \brief Get the Time Synchronization Function Timer (TSFT) value.  Valid for
112
   * received frames only. 
112
   * received frames only. 
113
   *
113
   *
114
   * @returns The value in microseconds of the MAC's 64-bit 802.11 Time 
114
   * \returns The value in microseconds of the MAC's 64-bit 802.11 Time 
115
   *          Synchronization Function timer when the first bit of the MPDU
115
   *          Synchronization Function timer when the first bit of the MPDU
116
   *          arrived at the MAC.
116
   *          arrived at the MAC.
117
   */
117
   */
 Lines 130-156    Link Here 
130
  };
130
  };
131
131
132
  /**
132
  /**
133
   * @brief Set the frame flags of the transmitted or received frame.
133
   * \brief Set the frame flags of the transmitted or received frame.
134
   * @param flags flags to set.
134
   * \param flags flags to set.
135
   */
135
   */
136
  void SetFrameFlags (uint8_t flags);
136
  void SetFrameFlags (uint8_t flags);
137
137
138
  /**
138
  /**
139
   * @brief Get the frame flags of the transmitted or received frame.
139
   * \brief Get the frame flags of the transmitted or received frame.
140
   * @returns The frame flags.
140
   * \returns The frame flags.
141
   * @see FrameFlags.
141
   * \see FrameFlags.
142
   */
142
   */
143
  uint8_t GetFrameFlags (void) const;
143
  uint8_t GetFrameFlags (void) const;
144
144
145
  /**
145
  /**
146
   * @brief Set the transmit/receive channel frequency in units of megahertz
146
   * \brief Set the transmit/receive channel frequency in units of megahertz
147
   * @param rate the transmit/receive channel frequency in units of megahertz.
147
   * \param rate the transmit/receive channel frequency in units of megahertz.
148
   */
148
   */
149
  void SetRate (uint8_t rate);
149
  void SetRate (uint8_t rate);
150
150
151
  /**
151
  /**
152
   * @brief Get the transmit/receive channel frequency in units of megahertz.
152
   * \brief Get the transmit/receive channel frequency in units of megahertz.
153
   * @returns The transmit/receive channel frequency in units of megahertz.
153
   * \returns The transmit/receive channel frequency in units of megahertz.
154
   */
154
   */
155
  uint8_t GetRate (void) const;
155
  uint8_t GetRate (void) const;
156
156
 Lines 167-224    Link Here 
167
  };
167
  };
168
168
169
  /**
169
  /**
170
   * @brief Set the transmit/receive channel frequency and flags
170
   * \brief Set the transmit/receive channel frequency and flags
171
   * @param frequency The transmit/receive data rate in units of 500 kbps.
171
   * \param frequency The transmit/receive data rate in units of 500 kbps.
172
   * @param flags The flags to set.
172
   * \param flags The flags to set.
173
   * @see ChannelFlags
173
   * \see ChannelFlags
174
   */
174
   */
175
  void SetChannelFrequencyAndFlags (uint16_t frequency, uint16_t flags);
175
  void SetChannelFrequencyAndFlags (uint16_t frequency, uint16_t flags);
176
176
177
  /**
177
  /**
178
   * @brief Get the transmit/receive data rate in units of 500 kbps.
178
   * \brief Get the transmit/receive data rate in units of 500 kbps.
179
   * @returns The transmit/receive data rate in units of 500 kbps.
179
   * \returns The transmit/receive data rate in units of 500 kbps.
180
   */
180
   */
181
  uint16_t GetChannelFrequency (void) const;
181
  uint16_t GetChannelFrequency (void) const;
182
182
183
  /**
183
  /**
184
   * @brief Get the channel flags of the transmitted or received frame.
184
   * \brief Get the channel flags of the transmitted or received frame.
185
   * @returns The frame flags.
185
   * \returns The frame flags.
186
   * @see ChannelFlags.
186
   * \see ChannelFlags.
187
   */
187
   */
188
  uint16_t GetChannelFlags (void) const;
188
  uint16_t GetChannelFlags (void) const;
189
189
190
  /**
190
  /**
191
   * @brief Set the RF signal power at the antenna as a decibel difference
191
   * \brief Set the RF signal power at the antenna as a decibel difference
192
   * from an arbitrary, fixed reference. 
192
   * from an arbitrary, fixed reference. 
193
   *
193
   *
194
   * @param signal The RF signal power at the antenna as a decibel difference
194
   * \param signal The RF signal power at the antenna as a decibel difference
195
   *               from an arbitrary, fixed reference;
195
   *               from an arbitrary, fixed reference;
196
   */
196
   */
197
  void SetAntennaSignalPower (double signal);
197
  void SetAntennaSignalPower (double signal);
198
198
199
  /**
199
  /**
200
   * @brief Get the RF signal power at the antenna as a decibel difference
200
   * \brief Get the RF signal power at the antenna as a decibel difference
201
   * from an arbitrary, fixed reference. 
201
   * from an arbitrary, fixed reference. 
202
   *
202
   *
203
   * @returns The RF signal power at the antenna as a decibel difference
203
   * \returns The RF signal power at the antenna as a decibel difference
204
   *          from an arbitrary, fixed reference. 
204
   *          from an arbitrary, fixed reference. 
205
   */
205
   */
206
  uint8_t GetAntennaSignalPower (void) const;
206
  uint8_t GetAntennaSignalPower (void) const;
207
207
208
  /**
208
  /**
209
   * @brief Set the RF noise power at the antenna as a decibel difference
209
   * \brief Set the RF noise power at the antenna as a decibel difference
210
   * from an arbitrary, fixed reference. 
210
   * from an arbitrary, fixed reference. 
211
   *
211
   *
212
   * @param noise The RF noise power at the antenna as a decibel difference
212
   * \param noise The RF noise power at the antenna as a decibel difference
213
   *              from an arbitrary, fixed reference. 
213
   *              from an arbitrary, fixed reference. 
214
   */
214
   */
215
  void SetAntennaNoisePower (double noise);
215
  void SetAntennaNoisePower (double noise);
216
216
217
  /**
217
  /**
218
   * @brief Get the RF noise power at the antenna as a decibel difference
218
   * \brief Get the RF noise power at the antenna as a decibel difference
219
   * from an arbitrary, fixed reference. 
219
   * from an arbitrary, fixed reference. 
220
   *
220
   *
221
   * @returns The RF noise power at the antenna as a decibel difference
221
   * \returns The RF noise power at the antenna as a decibel difference
222
   *          from an arbitrary, fixed reference. 
222
   *          from an arbitrary, fixed reference. 
223
   */
223
   */
224
  uint8_t GetAntennaNoisePower (void) const;
224
  uint8_t GetAntennaNoisePower (void) const;
(-)a/src/nix-vector-routing/model/ipv4-nix-vector-routing.h (-5 / +5 lines)
 Lines 52-72    Link Here 
52
  Ipv4NixVectorRouting ();
52
  Ipv4NixVectorRouting ();
53
  ~Ipv4NixVectorRouting ();
53
  ~Ipv4NixVectorRouting ();
54
  /**
54
  /**
55
   * @brief The Interface ID of the Global Router interface.
55
   * \brief The Interface ID of the Global Router interface.
56
   *
56
   *
57
   * @see Object::GetObject ()
57
   * \see Object::GetObject ()
58
   */
58
   */
59
  static TypeId GetTypeId (void);
59
  static TypeId GetTypeId (void);
60
  /**
60
  /**
61
   * @brief Set the Node pointer of the node for which this
61
   * \brief Set the Node pointer of the node for which this
62
   * routing protocol is to be placed
62
   * routing protocol is to be placed
63
   *
63
   *
64
   * @param node Node pointer
64
   * \param node Node pointer
65
   */
65
   */
66
  void SetNode (Ptr<Node> node);
66
  void SetNode (Ptr<Node> node);
67
67
68
  /**
68
  /**
69
   * @brief Called when run-time link topology change occurs
69
   * \brief Called when run-time link topology change occurs
70
   * which iterates through the node list and flushes any
70
   * which iterates through the node list and flushes any
71
   * nix vector caches
71
   * nix vector caches
72
   *
72
   *
(-)a/src/olsr/model/olsr-repositories.h (-2 / +1 lines)
 Lines 21-28    Link Here 
21
 */
21
 */
22
22
23
///
23
///
24
/// \file	olsr-repositories.h
24
/// \brief Here are defined all data structures needed by an OLSR node.
25
/// \brief	Here are defined all data structures needed by an OLSR node.
26
///
25
///
27
26
28
#ifndef OLSR_REPOSITORIES_H
27
#ifndef OLSR_REPOSITORIES_H
(-)a/src/olsr/model/olsr-routing-protocol.cc (-66 / +63 lines)
 Lines 22-29    Link Here 
22
22
23
23
24
///
24
///
25
/// \file	OLSR.cc
25
/// \brief Implementation of OLSR agent and related classes.
26
/// \brief	Implementation of OLSR agent and related classes.
27
///
26
///
28
/// This is the main file of this software because %OLSR's behaviour is
27
/// This is the main file of this software because %OLSR's behaviour is
29
/// implemented here.
28
/// implemented here.
 Lines 499-505    Link Here 
499
                              receiverIfaceAddr, inetSourceAddr.GetIpv4 ());
498
                              receiverIfaceAddr, inetSourceAddr.GetIpv4 ());
500
            }
499
            }
501
        }
500
        }
502
	
503
    }
501
    }
504
502
505
  // After processing all OLSR messages, we must recompute the routing table
503
  // After processing all OLSR messages, we must recompute the routing table
 Lines 573-579    Link Here 
573
  // MPR computation should be done for each interface. See section 8.3.1
571
  // MPR computation should be done for each interface. See section 8.3.1
574
  // (RFC 3626) for details.
572
  // (RFC 3626) for details.
575
  MprSet mprSet;
573
  MprSet mprSet;
576
	
577
574
578
  // N is the subset of neighbors of the node, which are
575
  // N is the subset of neighbors of the node, which are
579
  // neighbor "of the interface I"
576
  // neighbor "of the interface I"
 Lines 586-592    Link Here 
586
          N.push_back (*neighbor);
583
          N.push_back (*neighbor);
587
        }
584
        }
588
    }
585
    }
589
	
586
590
  // N2 is the set of 2-hop neighbors reachable from "the interface
587
  // N2 is the set of 2-hop neighbors reachable from "the interface
591
  // I", excluding:
588
  // I", excluding:
592
  // (i)   the nodes only reachable by members of N with willingness WILL_NEVER
589
  // (i)   the nodes only reachable by members of N with willingness WILL_NEVER
 Lines 681-687    Link Here 
681
678
682
  // 2. Calculate D(y), where y is a member of N, for all nodes in N.
679
  // 2. Calculate D(y), where y is a member of N, for all nodes in N.
683
  // (we do this later)
680
  // (we do this later)
684
	
681
685
  // 3. Add to the MPR set those nodes in N, which are the *only*
682
  // 3. Add to the MPR set those nodes in N, which are the *only*
686
  // nodes to provide reachability to a node in N2.
683
  // nodes to provide reachability to a node in N2.
687
  std::set<Ipv4Address> coveredTwoHopNeighbors;
684
  std::set<Ipv4Address> coveredTwoHopNeighbors;
 Lines 734-740    Link Here 
734
          twoHopNeigh++;
731
          twoHopNeigh++;
735
        }
732
        }
736
    }
733
    }
737
	
734
738
  // 4. While there exist nodes in N2 which are not covered by at
735
  // 4. While there exist nodes in N2 which are not covered by at
739
  // least one node in the MPR set:
736
  // least one node in the MPR set:
740
  while (N2.begin () != N2.end ())
737
  while (N2.begin () != N2.end ())
 Lines 882-888    Link Here 
882
879
883
  // 1. All the entries from the routing table are removed.
880
  // 1. All the entries from the routing table are removed.
884
  Clear ();
881
  Clear ();
885
	
882
886
  // 2. The new routing entries are added starting with the
883
  // 2. The new routing entries are added starting with the
887
  // symmetric neighbors (h=1) as the destination nodes.
884
  // symmetric neighbors (h=1) as the destination nodes.
888
  const NeighborSet &neighborSet = m_state.GetNeighbors ();
885
  const NeighborSet &neighborSet = m_state.GetNeighbors ();
 Lines 1080-1088    Link Here 
1080
1077
1081
  // 4. For each entry in the multiple interface association base
1078
  // 4. For each entry in the multiple interface association base
1082
  // where there exists a routing entry such that:
1079
  // where there exists a routing entry such that:
1083
  //	R_dest_addr  == I_main_addr  (of the multiple interface association entry)
1080
  // R_dest_addr == I_main_addr (of the multiple interface association entry)
1084
  // AND there is no routing entry such that:
1081
  // AND there is no routing entry such that:
1085
  //	R_dest_addr  == I_iface_addr
1082
  // R_dest_addr == I_iface_addr
1086
  const IfaceAssocSet &ifaceAssocSet = m_state.GetIfaceAssocSet ();
1083
  const IfaceAssocSet &ifaceAssocSet = m_state.GetIfaceAssocSet ();
1087
  for (IfaceAssocSet::const_iterator it = ifaceAssocSet.begin ();
1084
  for (IfaceAssocSet::const_iterator it = ifaceAssocSet.begin ();
1088
       it != ifaceAssocSet.end (); it++)
1085
       it != ifaceAssocSet.end (); it++)
 Lines 1268-1280    Link Here 
1268
{
1265
{
1269
  const olsr::MessageHeader::Tc &tc = msg.GetTc ();
1266
  const olsr::MessageHeader::Tc &tc = msg.GetTc ();
1270
  Time now = Simulator::Now ();
1267
  Time now = Simulator::Now ();
1271
	
1268
1272
  // 1. If the sender interface of this message is not in the symmetric
1269
  // 1. If the sender interface of this message is not in the symmetric
1273
  // 1-hop neighborhood of this node, the message MUST be discarded.
1270
  // 1-hop neighborhood of this node, the message MUST be discarded.
1274
  const LinkTuple *link_tuple = m_state.FindSymLinkTuple (senderIface, now);
1271
  const LinkTuple *link_tuple = m_state.FindSymLinkTuple (senderIface, now);
1275
  if (link_tuple == NULL)
1272
  if (link_tuple == NULL)
1276
    return;
1273
    return;
1277
	
1274
1278
  // 2. If there exist some tuple in the topology set where:
1275
  // 2. If there exist some tuple in the topology set where:
1279
  //    T_last_addr == originator address AND
1276
  //    T_last_addr == originator address AND
1280
  //    T_seq       >  ANSN,
1277
  //    T_seq       >  ANSN,
 Lines 1284-1293    Link Here 
1284
    m_state.FindNewerTopologyTuple (msg.GetOriginatorAddress (), tc.ansn);
1281
    m_state.FindNewerTopologyTuple (msg.GetOriginatorAddress (), tc.ansn);
1285
  if (topologyTuple != NULL)
1282
  if (topologyTuple != NULL)
1286
    return;
1283
    return;
1287
	
1284
1288
  // 3. All tuples in the topology set where:
1285
  // 3. All tuples in the topology set where:
1289
  //	T_last_addr == originator address AND
1286
  //    T_last_addr == originator address AND
1290
  //	T_seq       <  ANSN
1287
  //    T_seq       <  ANSN
1291
  // MUST be removed from the topology set.
1288
  // MUST be removed from the topology set.
1292
  m_state.EraseOlderTopologyTuples (msg.GetOriginatorAddress (), tc.ansn);
1289
  m_state.EraseOlderTopologyTuples (msg.GetOriginatorAddress (), tc.ansn);
1293
1290
 Lines 1298-1307    Link Here 
1298
    {
1295
    {
1299
      const Ipv4Address &addr = *i;
1296
      const Ipv4Address &addr = *i;
1300
      // 4.1. If there exist some tuple in the topology set where:
1297
      // 4.1. If there exist some tuple in the topology set where:
1301
      //        T_dest_addr == advertised neighbor main address, AND
1298
      //      T_dest_addr == advertised neighbor main address, AND
1302
      //        T_last_addr == originator address,
1299
      //      T_last_addr == originator address,
1303
      // then the holding time of that tuple MUST be set to:
1300
      // then the holding time of that tuple MUST be set to:
1304
      //        T_time      =  current time + validity time.
1301
      //      T_time      =  current time + validity time.
1305
      TopologyTuple *topologyTuple =
1302
      TopologyTuple *topologyTuple =
1306
        m_state.FindTopologyTuple (addr, msg.GetOriginatorAddress ());
1303
        m_state.FindTopologyTuple (addr, msg.GetOriginatorAddress ());
1307
1304
 Lines 1313-1322    Link Here 
1313
        {
1310
        {
1314
          // 4.2. Otherwise, a new tuple MUST be recorded in the topology
1311
          // 4.2. Otherwise, a new tuple MUST be recorded in the topology
1315
          // set where:
1312
          // set where:
1316
          //	T_dest_addr = advertised neighbor main address,
1313
          //      T_dest_addr = advertised neighbor main address,
1317
          //	T_last_addr = originator address,
1314
          //      T_last_addr = originator address,
1318
          //	T_seq       = ANSN,
1315
          //      T_seq       = ANSN,
1319
          //	T_time      = current time + validity time.
1316
          //      T_time      = current time + validity time.
1320
          TopologyTuple topologyTuple;;
1317
          TopologyTuple topologyTuple;;
1321
          topologyTuple.destAddr = addr;
1318
          topologyTuple.destAddr = addr;
1322
          topologyTuple.lastAddr = msg.GetOriginatorAddress ();
1319
          topologyTuple.lastAddr = msg.GetOriginatorAddress ();
 Lines 1376-1382    Link Here 
1376
                    " the message MUST be discarded.");
1373
                    " the message MUST be discarded.");
1377
      return;
1374
      return;
1378
    }
1375
    }
1379
	
1376
1380
  // 2. For each interface address listed in the MID message
1377
  // 2. For each interface address listed in the MID message
1381
  for (std::vector<Ipv4Address>::const_iterator i = mid.interfaceAddresses.begin ();
1378
  for (std::vector<Ipv4Address>::const_iterator i = mid.interfaceAddresses.begin ();
1382
       i != mid.interfaceAddresses.end (); i++)
1379
       i != mid.interfaceAddresses.end (); i++)
 Lines 1526-1532    Link Here 
1526
                    " from " << olsrMessage.GetOriginatorAddress () << " because it is duplicated");
1523
                    " from " << olsrMessage.GetOriginatorAddress () << " because it is duplicated");
1527
      return;
1524
      return;
1528
    }
1525
    }
1529
	
1526
1530
  // If the sender interface address is an interface address
1527
  // If the sender interface address is an interface address
1531
  // of a MPR selector of this node and ttl is greater than 1,
1528
  // of a MPR selector of this node and ttl is greater than 1,
1532
  // the message must be retransmitted
1529
  // the message must be retransmitted
 Lines 1545-1551    Link Here 
1545
          retransmitted = true;
1542
          retransmitted = true;
1546
        }
1543
        }
1547
    }
1544
    }
1548
	
1545
1549
  // Update duplicate tuple...
1546
  // Update duplicate tuple...
1550
  if (duplicated != NULL)
1547
  if (duplicated != NULL)
1551
    {
1548
    {
 Lines 1680-1686    Link Here 
1680
1677
1681
  std::vector<olsr::MessageHeader::Hello::LinkMessage>
1678
  std::vector<olsr::MessageHeader::Hello::LinkMessage>
1682
  &linkMessages = hello.linkMessages;
1679
  &linkMessages = hello.linkMessages;
1683
	
1680
1684
  const LinkSet &links = m_state.GetLinks ();
1681
  const LinkSet &links = m_state.GetLinks ();
1685
  for (LinkSet::const_iterator link_tuple = links.begin ();
1682
  for (LinkSet::const_iterator link_tuple = links.begin ();
1686
       link_tuple != links.end (); link_tuple++)
1683
       link_tuple != links.end (); link_tuple++)
 Lines 1921-1927    Link Here 
1921
///        in HNA messages sent by the node.
1918
///        in HNA messages sent by the node.
1922
///        If this method is called more than once, entries from the old
1919
///        If this method is called more than once, entries from the old
1923
///        association are deleted before entries from the new one are added.
1920
///        association are deleted before entries from the new one are added.
1924
/// \param the Ipv4StaticRouting routing table to be associated.
1921
/// \param routingTable the Ipv4StaticRouting routing table to be associated.
1925
///
1922
///
1926
void
1923
void
1927
RoutingProtocol::SetRoutingTableAssociation (Ptr<Ipv4StaticRouting> routingTable)
1924
RoutingProtocol::SetRoutingTableAssociation (Ptr<Ipv4StaticRouting> routingTable)
 Lines 1983-1990    Link Here 
1983
}
1980
}
1984
1981
1985
///
1982
///
1986
/// \brief	Updates Link Set according to a new received HELLO message (following RFC 3626
1983
/// \brief Updates Link Set according to a new received HELLO message
1987
///		specification). Neighbor Set is also updated if needed.
1984
/// (following RFC 3626 specification). Neighbor Set is also updated if needed.
1988
void
1985
void
1989
RoutingProtocol::LinkSensing (const olsr::MessageHeader &msg,
1986
RoutingProtocol::LinkSensing (const olsr::MessageHeader &msg,
1990
                              const olsr::MessageHeader::Hello &hello,
1987
                              const olsr::MessageHeader::Hello &hello,
 Lines 1997-2003    Link Here 
1997
  NS_LOG_DEBUG ("@" << now.GetSeconds () << ": Olsr node " << m_mainAddress
1994
  NS_LOG_DEBUG ("@" << now.GetSeconds () << ": Olsr node " << m_mainAddress
1998
                    << ": LinkSensing(receiverIface=" << receiverIface
1995
                    << ": LinkSensing(receiverIface=" << receiverIface
1999
                    << ", senderIface=" << senderIface << ") BEGIN");
1996
                    << ", senderIface=" << senderIface << ") BEGIN");
2000
	
1997
2001
  NS_ASSERT (msg.GetVTime () > Seconds (0));
1998
  NS_ASSERT (msg.GetVTime () > Seconds (0));
2002
  LinkTuple *link_tuple = m_state.FindLinkTuple (senderIface);
1999
  LinkTuple *link_tuple = m_state.FindLinkTuple (senderIface);
2003
  if (link_tuple == NULL)
2000
  if (link_tuple == NULL)
 Lines 2017-2023    Link Here 
2017
      NS_LOG_LOGIC ("Existing link tuple already exists => will update it");
2014
      NS_LOG_LOGIC ("Existing link tuple already exists => will update it");
2018
      updated = true;
2015
      updated = true;
2019
    }
2016
    }
2020
	
2017
2021
  link_tuple->asymTime = now + msg.GetVTime ();
2018
  link_tuple->asymTime = now + msg.GetVTime ();
2022
  for (std::vector<olsr::MessageHeader::Hello::LinkMessage>::const_iterator linkMessage =
2019
  for (std::vector<olsr::MessageHeader::Hello::LinkMessage>::const_iterator linkMessage =
2023
         hello.linkMessages.begin ();
2020
         hello.linkMessages.begin ();
 Lines 2118-2125    Link Here 
2118
}
2115
}
2119
2116
2120
///
2117
///
2121
/// \brief	Updates the Neighbor Set according to the information contained in a new received
2118
/// \brief Updates the Neighbor Set according to the information contained in
2122
///		HELLO message (following RFC 3626).
2119
/// a new received HELLO message (following RFC 3626).
2123
void
2120
void
2124
RoutingProtocol::PopulateNeighborSet (const olsr::MessageHeader &msg,
2121
RoutingProtocol::PopulateNeighborSet (const olsr::MessageHeader &msg,
2125
                                      const olsr::MessageHeader::Hello &hello)
2122
                                      const olsr::MessageHeader::Hello &hello)
 Lines 2133-2140    Link Here 
2133
2130
2134
2131
2135
///
2132
///
2136
/// \brief	Updates the 2-hop Neighbor Set according to the information contained in a new
2133
/// \brief Updates the 2-hop Neighbor Set according to the information contained
2137
///		received HELLO message (following RFC 3626).
2134
/// in a new received HELLO message (following RFC 3626).
2138
void
2135
void
2139
RoutingProtocol::PopulateTwoHopNeighborSet (const olsr::MessageHeader &msg,
2136
RoutingProtocol::PopulateTwoHopNeighborSet (const olsr::MessageHeader &msg,
2140
                                            const olsr::MessageHeader::Hello &hello)
2137
                                            const olsr::MessageHeader::Hello &hello)
 Lines 2142-2148    Link Here 
2142
  Time now = Simulator::Now ();
2139
  Time now = Simulator::Now ();
2143
2140
2144
  NS_LOG_DEBUG ("Olsr node " << m_mainAddress << ": PopulateTwoHopNeighborSet BEGIN");
2141
  NS_LOG_DEBUG ("Olsr node " << m_mainAddress << ": PopulateTwoHopNeighborSet BEGIN");
2145
	
2142
2146
  for (LinkSet::const_iterator link_tuple = m_state.GetLinks ().begin ();
2143
  for (LinkSet::const_iterator link_tuple = m_state.GetLinks ().begin ();
2147
       link_tuple != m_state.GetLinks ().end (); link_tuple++)
2144
       link_tuple != m_state.GetLinks ().end (); link_tuple++)
2148
    {
2145
    {
 Lines 2245-2252    Link Here 
2245
2242
2246
2243
2247
///
2244
///
2248
/// \brief	Updates the MPR Selector Set according to the information contained in a new
2245
/// \brief Updates the MPR Selector Set according to the information contained in
2249
///		received HELLO message (following RFC 3626).
2246
/// a new received HELLO message (following RFC 3626).
2250
void
2247
void
2251
RoutingProtocol::PopulateMprSelectorSet (const olsr::MessageHeader &msg,
2248
RoutingProtocol::PopulateMprSelectorSet (const olsr::MessageHeader &msg,
2252
                                         const olsr::MessageHeader::Hello &hello)
2249
                                         const olsr::MessageHeader::Hello &hello)
 Lines 2254-2260    Link Here 
2254
  NS_LOG_FUNCTION (this);
2251
  NS_LOG_FUNCTION (this);
2255
2252
2256
  Time now = Simulator::Now ();
2253
  Time now = Simulator::Now ();
2257
	
2254
2258
  typedef std::vector<olsr::MessageHeader::Hello::LinkMessage> LinkMessageVec;
2255
  typedef std::vector<olsr::MessageHeader::Hello::LinkMessage> LinkMessageVec;
2259
  for (LinkMessageVec::const_iterator linkMessage = hello.linkMessages.begin ();
2256
  for (LinkMessageVec::const_iterator linkMessage = hello.linkMessages.begin ();
2260
       linkMessage != hello.linkMessages.end ();
2257
       linkMessage != hello.linkMessages.end ();
 Lines 2305-2313    Link Here 
2305
2302
2306
#if 0
2303
#if 0
2307
///
2304
///
2308
/// \brief	Drops a given packet because it couldn't be delivered to the corresponding
2305
/// \brief Drops a given packet because it couldn't be delivered to the corresponding
2309
///		destination by the MAC layer. This may cause a neighbor loss, and appropiate
2306
/// destination by the MAC layer. This may cause a neighbor loss, and appropiate
2310
///		actions are then taken.
2307
/// actions are then taken.
2311
///
2308
///
2312
/// \param p the packet which couldn't be delivered by the MAC layer.
2309
/// \param p the packet which couldn't be delivered by the MAC layer.
2313
///
2310
///
 Lines 2316-2332    Link Here 
2316
  double now              = Simulator::Now ();
2313
  double now              = Simulator::Now ();
2317
  struct hdr_ip* ih       = HDR_IP (p);
2314
  struct hdr_ip* ih       = HDR_IP (p);
2318
  struct hdr_cmn* ch      = HDR_CMN (p);
2315
  struct hdr_cmn* ch      = HDR_CMN (p);
2319
	
2316
2320
  debug ("%f: Node %d MAC Layer detects a breakage on link to %d\n",
2317
  debug ("%f: Node %d MAC Layer detects a breakage on link to %d\n",
2321
         now,
2318
         now,
2322
         OLSR::node_id (ra_addr ()),
2319
         OLSR::node_id (ra_addr ()),
2323
         OLSR::node_id (ch->next_hop ()));
2320
         OLSR::node_id (ch->next_hop ()));
2324
	
2321
2325
  if ((u_int32_t)ih->daddr () == IP_BROADCAST) {
2322
  if ((u_int32_t)ih->daddr () == IP_BROADCAST) {
2326
      drop (p, DROP_RTR_MAC_CALLBACK);
2323
      drop (p, DROP_RTR_MAC_CALLBACK);
2327
      return;
2324
      return;
2328
    }
2325
    }
2329
	
2326
2330
  OLSR_link_tuple* link_tuple = state_.find_link_tuple (ch->next_hop ());
2327
  OLSR_link_tuple* link_tuple = state_.find_link_tuple (ch->next_hop ());
2331
  if (link_tuple != NULL) {
2328
  if (link_tuple != NULL) {
2332
      link_tuple->lost_time () = now + OLSR_NEIGHB_HOLD_TIME;
2329
      link_tuple->lost_time () = now + OLSR_NEIGHB_HOLD_TIME;
 Lines 2431-2438    Link Here 
2431
}
2428
}
2432
2429
2433
///
2430
///
2434
/// \brief	This function is invoked when a link tuple is updated. Its aim is to
2431
/// \brief This function is invoked when a link tuple is updated. Its aim is to
2435
///		also update the corresponding neighbor tuple if it is needed.
2432
/// also update the corresponding neighbor tuple if it is needed.
2436
///
2433
///
2437
/// \param tuple the link tuple which has been updated.
2434
/// \param tuple the link tuple which has been updated.
2438
///
2435
///
 Lines 2525-2531    Link Here 
2525
//         OLSR::node_id(ra_addr()),
2522
//         OLSR::node_id(ra_addr()),
2526
//         OLSR::node_id(tuple->neighborMainAddr),
2523
//         OLSR::node_id(tuple->neighborMainAddr),
2527
//         ((tuple->status() == OLSR_STATUS_SYM) ? "sym" : "not_sym"));
2524
//         ((tuple->status() == OLSR_STATUS_SYM) ? "sym" : "not_sym"));
2528
	
2525
2529
  m_state.EraseNeighborTuple (tuple);
2526
  m_state.EraseNeighborTuple (tuple);
2530
  IncrementAnsn ();
2527
  IncrementAnsn ();
2531
}
2528
}
 Lines 2987-2993    Link Here 
2987
2984
2988
///
2985
///
2989
/// \brief Deletes the entry whose destination address is given.
2986
/// \brief Deletes the entry whose destination address is given.
2990
/// \param dest	address of the destination node.
2987
/// \param dest address of the destination node.
2991
///
2988
///
2992
void
2989
void
2993
RoutingProtocol::RemoveEntry (Ipv4Address const &dest)
2990
RoutingProtocol::RemoveEntry (Ipv4Address const &dest)
 Lines 2997-3005    Link Here 
2997
2994
2998
///
2995
///
2999
/// \brief Looks up an entry for the specified destination address.
2996
/// \brief Looks up an entry for the specified destination address.
3000
/// \param dest	destination address.
2997
/// \param dest destination address.
3001
/// \param outEntry output parameter to hold the routing entry result, if fuond
2998
/// \param outEntry output parameter to hold the routing entry result, if fuond
3002
/// \return	true if found, false if not found
2999
/// \return true if found, false if not found
3003
///
3000
///
3004
bool
3001
bool
3005
RoutingProtocol::Lookup (Ipv4Address const &dest,
3002
RoutingProtocol::Lookup (Ipv4Address const &dest,
 Lines 3016-3023    Link Here 
3016
}
3013
}
3017
3014
3018
///
3015
///
3019
/// \brief	Finds the appropiate entry which must be used in order to forward
3016
/// \brief Finds the appropiate entry which must be used in order to forward
3020
///		a data packet to a next hop (given a destination).
3017
/// a data packet to a next hop (given a destination).
3021
///
3018
///
3022
/// Imagine a routing table like this: [A,B] [B,C] [C,C]; being each pair of the
3019
/// Imagine a routing table like this: [A,B] [B,C] [C,C]; being each pair of the
3023
/// form [dest addr,next-hop addr]. In this case, if this function is invoked with
3020
/// form [dest addr,next-hop addr]. In this case, if this function is invoked with
 Lines 3025-3035    Link Here 
3025
/// to forward a data packet destined to A. That is, C is a neighbor of this node,
3022
/// to forward a data packet destined to A. That is, C is a neighbor of this node,
3026
/// but B isn't. This function finds the appropiate neighbor for forwarding a packet.
3023
/// but B isn't. This function finds the appropiate neighbor for forwarding a packet.
3027
///
3024
///
3028
/// \param entry	the routing table entry which indicates the destination node
3025
/// \param entry the routing table entry which indicates the destination node
3029
///			we are interested in.
3026
/// we are interested in.
3030
/// \return		the appropiate routing table entry which indicates the next
3027
/// \return the appropiate routing table entry which indicates the next
3031
///			hop which must be used for forwarding a data packet, or NULL
3028
/// hop which must be used for forwarding a data packet, or NULL
3032
///			if there is no such entry.
3029
/// if there is no such entry.
3033
///
3030
///
3034
bool
3031
bool
3035
RoutingProtocol::FindSendEntry (RoutingTableEntry const &entry,
3032
RoutingProtocol::FindSendEntry (RoutingTableEntry const &entry,
 Lines 3239-3248    Link Here 
3239
///
3236
///
3240
/// If an entry for the given destination existed, it is deleted and freed.
3237
/// If an entry for the given destination existed, it is deleted and freed.
3241
///
3238
///
3242
/// \param dest		address of the destination node.
3239
/// \param dest address of the destination node.
3243
/// \param next		address of the next hop node.
3240
/// \param next address of the next hop node.
3244
/// \param iface	address of the local interface.
3241
/// \param iface address of the local interface.
3245
/// \param dist		distance to the destination node.
3242
/// \param dist distance to the destination node.
3246
///
3243
///
3247
void
3244
void
3248
RoutingProtocol::AddEntry (Ipv4Address const &dest,
3245
RoutingProtocol::AddEntry (Ipv4Address const &dest,
 Lines 3348-3354    Link Here 
3348
#endif  //NS3_LOG_ENABLE
3345
#endif  //NS3_LOG_ENABLE
3349
}
3346
}
3350
3347
3351
}
3348
} // namespace olsr
3352
}  // namespace olsr, ns3
3349
} // namespace ns3
3353
3350
3354
3351
(-)a/src/olsr/model/olsr-state.cc (-1 / +1 lines)
 Lines 21-27    Link Here 
21
 */
21
 */
22
22
23
///
23
///
24
/// \file	OlsrState.cc
24
/// \file	olsr-state.cc
25
/// \brief	Implementation of all functions needed for manipulating the internal
25
/// \brief	Implementation of all functions needed for manipulating the internal
26
///		state of an OLSR node.
26
///		state of an OLSR node.
27
///
27
///
(-)a/src/point-to-point/model/point-to-point-channel.h (-1 / +1 lines)
 Lines 135-141    Link Here 
135
   * net device, receiving net device, transmission time and 
135
   * net device, receiving net device, transmission time and 
136
   * packet receipt time.
136
   * packet receipt time.
137
   *
137
   *
138
   * @see class CallBackTraceSource
138
   * \see class CallBackTraceSource
139
   */
139
   */
140
  TracedCallback<Ptr<const Packet>, // Packet being transmitted
140
  TracedCallback<Ptr<const Packet>, // Packet being transmitted
141
                 Ptr<NetDevice>,    // Transmitting NetDevice
141
                 Ptr<NetDevice>,    // Transmitting NetDevice
(-)a/src/point-to-point/model/point-to-point-net-device.h (-22 / +22 lines)
 Lines 81-88    Link Here 
81
   * set in the Attach () method from the corresponding field in the channel
81
   * set in the Attach () method from the corresponding field in the channel
82
   * to which the device is attached.  It can be overridden using this method.
82
   * to which the device is attached.  It can be overridden using this method.
83
   *
83
   *
84
   * @see Attach ()
84
   * \see Attach ()
85
   * @param bps the data rate at which this object operates
85
   * \param bps the data rate at which this object operates
86
   */
86
   */
87
  void SetDataRate (DataRate bps);
87
  void SetDataRate (DataRate bps);
88
88
 Lines 90-103    Link Here 
90
   * Set the interframe gap used to separate packets.  The interframe gap
90
   * Set the interframe gap used to separate packets.  The interframe gap
91
   * defines the minimum space required between packets sent by this device.
91
   * defines the minimum space required between packets sent by this device.
92
   *
92
   *
93
   * @param t the interframe gap time
93
   * \param t the interframe gap time
94
   */
94
   */
95
  void SetInterframeGap (Time t);
95
  void SetInterframeGap (Time t);
96
96
97
  /**
97
  /**
98
   * Attach the device to a channel.
98
   * Attach the device to a channel.
99
   *
99
   *
100
   * @param ch Ptr to the channel to which this object is being attached.
100
   * \param ch Ptr to the channel to which this object is being attached.
101
   */
101
   */
102
  bool Attach (Ptr<PointToPointChannel> ch);
102
  bool Attach (Ptr<PointToPointChannel> ch);
103
103
 Lines 107-122    Link Here 
107
   * The PointToPointNetDevice "owns" a queue that implements a queueing 
107
   * The PointToPointNetDevice "owns" a queue that implements a queueing 
108
   * method such as DropTail or RED.
108
   * method such as DropTail or RED.
109
   *
109
   *
110
   * @see Queue
110
   * \see Queue
111
   * @see DropTailQueue
111
   * \see DropTailQueue
112
   * @param queue Ptr to the new queue.
112
   * \param queue Ptr to the new queue.
113
   */
113
   */
114
  void SetQueue (Ptr<Queue> queue);
114
  void SetQueue (Ptr<Queue> queue);
115
115
116
  /**
116
  /**
117
   * Get a copy of the attached Queue.
117
   * Get a copy of the attached Queue.
118
   *
118
   *
119
   * @returns Ptr to the queue.
119
   * \returns Ptr to the queue.
120
   */
120
   */
121
  Ptr<Queue> GetQueue (void) const;
121
  Ptr<Queue> GetQueue (void) const;
122
122
 Lines 126-133    Link Here 
126
   * The PointToPointNetDevice may optionally include an ErrorModel in
126
   * The PointToPointNetDevice may optionally include an ErrorModel in
127
   * the packet receive chain.
127
   * the packet receive chain.
128
   *
128
   *
129
   * @see ErrorModel
129
   * \see ErrorModel
130
   * @param em Ptr to the ErrorModel.
130
   * \param em Ptr to the ErrorModel.
131
   */
131
   */
132
  void SetReceiveErrorModel (Ptr<ErrorModel> em);
132
  void SetReceiveErrorModel (Ptr<ErrorModel> em);
133
133
 Lines 139-146    Link Here 
139
   * used by the channel to indicate that the last bit of a packet has 
139
   * used by the channel to indicate that the last bit of a packet has 
140
   * arrived at the device.
140
   * arrived at the device.
141
   *
141
   *
142
   * @see PointToPointChannel
142
   * \see PointToPointChannel
143
   * @param p Ptr to the received packet.
143
   * \param p Ptr to the received packet.
144
   */
144
   */
145
  void Receive (Ptr<Packet> p);
145
  void Receive (Ptr<Packet> p);
146
146
 Lines 231-240    Link Here 
231
   * started sending signals.  An event is scheduled for the time at which
231
   * started sending signals.  An event is scheduled for the time at which
232
   * the bits have been completely transmitted.
232
   * the bits have been completely transmitted.
233
   *
233
   *
234
   * @see PointToPointChannel::TransmitStart ()
234
   * \see PointToPointChannel::TransmitStart ()
235
   * @see TransmitCompleteEvent ()
235
   * \see TransmitCompleteEvent ()
236
   * @param p a reference to the packet to send
236
   * \param p a reference to the packet to send
237
   * @returns true if success, false on failure
237
   * \returns true if success, false on failure
238
   */
238
   */
239
  bool TransmitStart (Ptr<Packet> p);
239
  bool TransmitStart (Ptr<Packet> p);
240
240
 Lines 258-285    Link Here 
258
  };
258
  };
259
  /**
259
  /**
260
   * The state of the Net Device transmit state machine.
260
   * The state of the Net Device transmit state machine.
261
   * @see TxMachineState
261
   * \see TxMachineState
262
   */
262
   */
263
  TxMachineState m_txMachineState;
263
  TxMachineState m_txMachineState;
264
264
265
  /**
265
  /**
266
   * The data rate that the Net Device uses to simulate packet transmission
266
   * The data rate that the Net Device uses to simulate packet transmission
267
   * timing.
267
   * timing.
268
   * @see class DataRate
268
   * \see class DataRate
269
   */
269
   */
270
  DataRate       m_bps;
270
  DataRate       m_bps;
271
271
272
  /**
272
  /**
273
   * The interframe gap that the Net Device uses to throttle packet
273
   * The interframe gap that the Net Device uses to throttle packet
274
   * transmission
274
   * transmission
275
   * @see class Time
275
   * \see class Time
276
   */
276
   */
277
  Time           m_tInterframeGap;
277
  Time           m_tInterframeGap;
278
278
279
  /**
279
  /**
280
   * The PointToPointChannel to which this PointToPointNetDevice has been
280
   * The PointToPointChannel to which this PointToPointNetDevice has been
281
   * attached.
281
   * attached.
282
   * @see class PointToPointChannel
282
   * \see class PointToPointChannel
283
   */
283
   */
284
  Ptr<PointToPointChannel> m_channel;
284
  Ptr<PointToPointChannel> m_channel;
285
285
 Lines 287-294    Link Here 
287
   * The Queue which this PointToPointNetDevice uses as a packet source.
287
   * The Queue which this PointToPointNetDevice uses as a packet source.
288
   * Management of this Queue has been delegated to the PointToPointNetDevice
288
   * Management of this Queue has been delegated to the PointToPointNetDevice
289
   * and it has the responsibility for deletion.
289
   * and it has the responsibility for deletion.
290
   * @see class Queue
290
   * \see class Queue
291
   * @see class DropTailQueue
291
   * \see class DropTailQueue
292
   */
292
   */
293
  Ptr<Queue> m_queue;
293
  Ptr<Queue> m_queue;
294
294
(-)a/src/propagation/model/propagation-loss-model.h (-3 / +3 lines)
 Lines 56-62    Link Here 
56
56
57
  /**
57
  /**
58
   * \brief Enables a chain of loss models to act on the signal
58
   * \brief Enables a chain of loss models to act on the signal
59
   * \param The next PropagationLossModel to add to the chain
59
   * \param next The next PropagationLossModel to add to the chain
60
   *
60
   *
61
   * This method of chaining propagation loss models only works commutatively
61
   * This method of chaining propagation loss models only works commutatively
62
   * if the propagation loss of all models in the chain are independent
62
   * if the propagation loss of all models in the chain are independent
 Lines 516-523    Link Here 
516
   * \brief Set loss (in dB, positive) between pair of ns-3 objects
516
   * \brief Set loss (in dB, positive) between pair of ns-3 objects
517
   * (typically, nodes).
517
   * (typically, nodes).
518
   * 
518
   * 
519
   * \param ma          Source mobility model
519
   * \param a ma          Source mobility model
520
   * \param mb          Destination mobility model
520
   * \param b mb          Destination mobility model
521
   * \param loss        a -> b path loss, positive in dB
521
   * \param loss        a -> b path loss, positive in dB
522
   * \param symmetric   If true (default), both a->b and b->a paths will be affected
522
   * \param symmetric   If true (default), both a->b and b->a paths will be affected
523
   */ 
523
   */ 
(-)a/src/spectrum/helper/adhoc-aloha-noack-ideal-phy-helper.h (-15 / +14 lines)
 Lines 39-46    Link Here 
39
 * \ingroup spectrum
39
 * \ingroup spectrum
40
 *
40
 *
41
 *
41
 *
42
 * create the NetDevice depicted in the figure
42
 * helper for creating the NetDevice
43
 * @image html HdOfdmAlohaNoAck.png
44
 *
43
 *
45
 */
44
 */
46
class AdhocAlohaNoackIdealPhyHelper
45
class AdhocAlohaNoackIdealPhyHelper
 Lines 52-92    Link Here 
52
  /**
51
  /**
53
   * set the SpectrumChannel that will be used by SpectrumPhy instances created by this helper
52
   * set the SpectrumChannel that will be used by SpectrumPhy instances created by this helper
54
   *
53
   *
55
   * @param channel
54
   * \param channel
56
   */
55
   */
57
  void SetChannel (Ptr<SpectrumChannel> channel);
56
  void SetChannel (Ptr<SpectrumChannel> channel);
58
57
59
  /**
58
  /**
60
   * set the SpectrumChannel that will be used by SpectrumPhy instances created by this helper
59
   * set the SpectrumChannel that will be used by SpectrumPhy instances created by this helper
61
   *
60
   *
62
   * @param channelName
61
   * \param channelName
63
   */
62
   */
64
  void SetChannel (std::string channelName);
63
  void SetChannel (std::string channelName);
65
64
66
65
67
  /**
66
  /**
68
   *
67
   *
69
   * @param txPsd the Power Spectral Density to be used for transmission by all created PHY instances
68
   * \param txPsd the Power Spectral Density to be used for transmission by all created PHY instances
70
   */
69
   */
71
  void SetTxPowerSpectralDensity (Ptr<SpectrumValue> txPsd);
70
  void SetTxPowerSpectralDensity (Ptr<SpectrumValue> txPsd);
72
71
73
  /**
72
  /**
74
   *
73
   *
75
   * @param noisePsd the Power Spectral Density to be used for transmission by all created PHY instances
74
   * \param noisePsd the Power Spectral Density to be used for transmission by all created PHY instances
76
   */
75
   */
77
  void SetNoisePowerSpectralDensity (Ptr<SpectrumValue> noisePsd);
76
  void SetNoisePowerSpectralDensity (Ptr<SpectrumValue> noisePsd);
78
77
79
  /**
78
  /**
80
   * @param name the name of the attribute to set
79
   * \param name the name of the attribute to set
81
   * @param v the value of the attribute
80
   * \param v the value of the attribute
82
   *
81
   *
83
   * Set these attributes on each HdOfdmSpectrumPhy instance to be created
82
   * Set these attributes on each HdOfdmSpectrumPhy instance to be created
84
   */
83
   */
85
  void SetPhyAttribute (std::string name, const AttributeValue &v);
84
  void SetPhyAttribute (std::string name, const AttributeValue &v);
86
85
87
  /**
86
  /**
88
   * @param n1 the name of the attribute to set
87
   * \param n1 the name of the attribute to set
89
   * @param v1 the value of the attribute to set
88
   * \param v1 the value of the attribute to set
90
   *
89
   *
91
   * Set these attributes on each AlohaNoackNetDevice created
90
   * Set these attributes on each AlohaNoackNetDevice created
92
   */
91
   */
 Lines 94-111    Link Here 
94
93
95
94
96
  /**
95
  /**
97
    * @param c the set of nodes on which a device must be created
96
    * \param c the set of nodes on which a device must be created
98
    * @return a device container which contains all the devices created by this method.
97
    * \return a device container which contains all the devices created by this method.
99
    */
98
    */
100
  NetDeviceContainer Install (NodeContainer c) const;
99
  NetDeviceContainer Install (NodeContainer c) const;
101
  /**
100
  /**
102
   * @param node the node on which a device must be created
101
   * \param node the node on which a device must be created
103
   * \returns a device container which contains all the devices created by this method.
102
   * \returns a device container which contains all the devices created by this method.
104
   */
103
   */
105
  NetDeviceContainer Install (Ptr<Node> node) const;
104
  NetDeviceContainer Install (Ptr<Node> node) const;
106
  /**
105
  /**
107
   * @param nodeName the name of node on which a device must be created
106
   * \param nodeName the name of node on which a device must be created
108
   * @return a device container which contains all the devices created by this method.
107
   * \return a device container which contains all the devices created by this method.
109
   */
108
   */
110
  NetDeviceContainer Install (std::string nodeName) const;
109
  NetDeviceContainer Install (std::string nodeName) const;
111
110
(-)a/src/spectrum/helper/spectrum-analyzer-helper.h (-13 / +13 lines)
 Lines 50-77    Link Here 
50
  /**
50
  /**
51
   * set the SpectrumChannel that will be used by SpectrumPhy instances created by this helper
51
   * set the SpectrumChannel that will be used by SpectrumPhy instances created by this helper
52
   *
52
   *
53
   * @param channel
53
   * \param channel
54
   */
54
   */
55
  void SetChannel (Ptr<SpectrumChannel> channel);
55
  void SetChannel (Ptr<SpectrumChannel> channel);
56
56
57
  /**
57
  /**
58
   * set the SpectrumChannel that will be used by SpectrumPhy instances created by this helper
58
   * set the SpectrumChannel that will be used by SpectrumPhy instances created by this helper
59
   *
59
   *
60
   * @param channelName
60
   * \param channelName
61
   */
61
   */
62
  void SetChannel (std::string channelName);
62
  void SetChannel (std::string channelName);
63
63
64
  /**
64
  /**
65
   * @param name the name of the attribute to set
65
   * \param name the name of the attribute to set
66
   * @param v the value of the attribute
66
   * \param v the value of the attribute
67
   *
67
   *
68
   * Set these attributes on each HdOfdmSpectrumPhy instance to be created
68
   * Set these attributes on each HdOfdmSpectrumPhy instance to be created
69
   */
69
   */
70
  void SetPhyAttribute (std::string name, const AttributeValue &v);
70
  void SetPhyAttribute (std::string name, const AttributeValue &v);
71
71
72
  /**
72
  /**
73
   * @param n1 the name of the attribute to set
73
   * \param n1 the name of the attribute to set
74
   * @param v1 the value of the attribute to set
74
   * \param v1 the value of the attribute to set
75
   *
75
   *
76
   * Set these attributes on each AlohaNoackNetDevice created
76
   * Set these attributes on each AlohaNoackNetDevice created
77
   */
77
   */
 Lines 80-86    Link Here 
80
  /**
80
  /**
81
   * Set the spectrum model used by the created SpectrumAnalyzer instances to represent incoming signals
81
   * Set the spectrum model used by the created SpectrumAnalyzer instances to represent incoming signals
82
   *
82
   *
83
   * @param m 
83
   * \param m 
84
   */
84
   */
85
  void SetRxSpectrumModel (Ptr<SpectrumModel> m);
85
  void SetRxSpectrumModel (Ptr<SpectrumModel> m);
86
86
 Lines 88-110    Link Here 
88
  /** 
88
  /** 
89
   * Enable ASCII output. This will create one filename for every created SpectrumAnalyzer instance.
89
   * Enable ASCII output. This will create one filename for every created SpectrumAnalyzer instance.
90
   * 
90
   * 
91
   * @param prefix the prefix of the filename of the traces that will be created.
91
   * \param prefix the prefix of the filename of the traces that will be created.
92
   */
92
   */
93
  void EnableAsciiAll (std::string prefix);
93
  void EnableAsciiAll (std::string prefix);
94
94
95
  /**
95
  /**
96
    * @param c the set of nodes on which a device must be created
96
    * \param c the set of nodes on which a device must be created
97
    * @return a device container which contains all the devices created by this method.
97
    * \return a device container which contains all the devices created by this method.
98
    */
98
    */
99
  NetDeviceContainer Install (NodeContainer c) const;
99
  NetDeviceContainer Install (NodeContainer c) const;
100
  /**
100
  /**
101
   * @param node the node on which a device must be created
101
   * \param node the node on which a device must be created
102
   * \returns a device container which contains all the devices created by this method.
102
   * \returns a device container which contains all the devices created by this method.
103
   */
103
   */
104
  NetDeviceContainer Install (Ptr<Node> node) const;
104
  NetDeviceContainer Install (Ptr<Node> node) const;
105
  /**
105
  /**
106
   * @param nodeName the name of node on which a device must be created
106
   * \param nodeName the name of node on which a device must be created
107
   * @return a device container which contains all the devices created by this method.
107
   * \return a device container which contains all the devices created by this method.
108
   */
108
   */
109
  NetDeviceContainer Install (std::string nodeName) const;
109
  NetDeviceContainer Install (std::string nodeName) const;
110
110
(-)a/src/spectrum/helper/spectrum-helper.h (-5 / +5 lines)
 Lines 238-251    Link Here 
238
  /**
238
  /**
239
   * set the channel that will be used by SpectrumPhy instances created by this helper
239
   * set the channel that will be used by SpectrumPhy instances created by this helper
240
   *
240
   *
241
   * @param channel
241
   * \param channel
242
   */
242
   */
243
  void SetChannel (Ptr<SpectrumChannel> channel);
243
  void SetChannel (Ptr<SpectrumChannel> channel);
244
244
245
  /**
245
  /**
246
   * set the channel that will be used by SpectrumPhy instances created by this helper
246
   * set the channel that will be used by SpectrumPhy instances created by this helper
247
   *
247
   *
248
   * @param channelName
248
   * \param channelName
249
   */
249
   */
250
  void SetChannel (std::string channelName);
250
  void SetChannel (std::string channelName);
251
251
 Lines 259-268    Link Here 
259
259
260
  /**
260
  /**
261
   *
261
   *
262
   * @param node
262
   * \param node
263
   * @param device
263
   * \param device
264
   *
264
   *
265
   * @return a  newly created SpectrumPhy instance
265
   * \return a  newly created SpectrumPhy instance
266
   */
266
   */
267
  Ptr<SpectrumPhy> Create (Ptr<Node> node, Ptr<NetDevice> device) const;
267
  Ptr<SpectrumPhy> Create (Ptr<Node> node, Ptr<NetDevice> device) const;
268
268
(-)a/src/spectrum/helper/waveform-generator-helper.h (-12 / +12 lines)
 Lines 50-85    Link Here 
50
  /**
50
  /**
51
   * set the SpectrumChannel that will be used by SpectrumPhy instances created by this helper
51
   * set the SpectrumChannel that will be used by SpectrumPhy instances created by this helper
52
   *
52
   *
53
   * @param channel
53
   * \param channel
54
   */
54
   */
55
  void SetChannel (Ptr<SpectrumChannel> channel);
55
  void SetChannel (Ptr<SpectrumChannel> channel);
56
56
57
  /**
57
  /**
58
   * set the SpectrumChannel that will be used by SpectrumPhy instances created by this helper
58
   * set the SpectrumChannel that will be used by SpectrumPhy instances created by this helper
59
   *
59
   *
60
   * @param channelName
60
   * \param channelName
61
   */
61
   */
62
  void SetChannel (std::string channelName);
62
  void SetChannel (std::string channelName);
63
63
64
64
65
  /**
65
  /**
66
   *
66
   *
67
   * @param txPsd the Power Spectral Density to be used for transmission by all created PHY instances
67
   * \param txPsd the Power Spectral Density to be used for transmission by all created PHY instances
68
   */
68
   */
69
  void SetTxPowerSpectralDensity (Ptr<SpectrumValue> txPsd);
69
  void SetTxPowerSpectralDensity (Ptr<SpectrumValue> txPsd);
70
70
71
71
72
  /**
72
  /**
73
   * @param name the name of the attribute to set
73
   * \param name the name of the attribute to set
74
   * @param v the value of the attribute
74
   * \param v the value of the attribute
75
   *
75
   *
76
   * Set these attributes on each HdOfdmSpectrumPhy instance to be created
76
   * Set these attributes on each HdOfdmSpectrumPhy instance to be created
77
   */
77
   */
78
  void SetPhyAttribute (std::string name, const AttributeValue &v);
78
  void SetPhyAttribute (std::string name, const AttributeValue &v);
79
79
80
  /**
80
  /**
81
   * @param n1 the name of the attribute to set
81
   * \param n1 the name of the attribute to set
82
   * @param v1 the value of the attribute to set
82
   * \param v1 the value of the attribute to set
83
   *
83
   *
84
   * Set these attributes on each AlohaNoackNetDevice created
84
   * Set these attributes on each AlohaNoackNetDevice created
85
   */
85
   */
 Lines 87-104    Link Here 
87
87
88
88
89
  /**
89
  /**
90
    * @param c the set of nodes on which a device must be created
90
    * \param c the set of nodes on which a device must be created
91
    * @return a device container which contains all the devices created by this method.
91
    * \return a device container which contains all the devices created by this method.
92
    */
92
    */
93
  NetDeviceContainer Install (NodeContainer c) const;
93
  NetDeviceContainer Install (NodeContainer c) const;
94
  /**
94
  /**
95
   * @param node the node on which a device must be created
95
   * \param node the node on which a device must be created
96
   * \returns a device container which contains all the devices created by this method.
96
   * \returns a device container which contains all the devices created by this method.
97
   */
97
   */
98
  NetDeviceContainer Install (Ptr<Node> node) const;
98
  NetDeviceContainer Install (Ptr<Node> node) const;
99
  /**
99
  /**
100
   * @param nodeName the name of node on which a device must be created
100
   * \param nodeName the name of node on which a device must be created
101
   * @return a device container which contains all the devices created by this method.
101
   * \return a device container which contains all the devices created by this method.
102
   */
102
   */
103
  NetDeviceContainer Install (std::string nodeName) const;
103
  NetDeviceContainer Install (std::string nodeName) const;
104
104
(-)a/src/spectrum/model/aloha-noack-net-device.h (-6 / +6 lines)
 Lines 73-79    Link Here 
73
  /**
73
  /**
74
   * set the queue which is going to be used by this device
74
   * set the queue which is going to be used by this device
75
   *
75
   *
76
   * @param queue
76
   * \param queue
77
   */
77
   */
78
  virtual void SetQueue (Ptr<Queue> queue);
78
  virtual void SetQueue (Ptr<Queue> queue);
79
79
 Lines 100-106    Link Here 
100
  /**
100
  /**
101
   * Notify the MAC that the PHY finished a reception successfully
101
   * Notify the MAC that the PHY finished a reception successfully
102
   *
102
   *
103
   * @param p the received packet
103
   * \param p the received packet
104
   */
104
   */
105
  void NotifyReceptionEndOk (Ptr<Packet> p);
105
  void NotifyReceptionEndOk (Ptr<Packet> p);
106
106
 Lines 112-118    Link Here 
112
   * is therefore provide to allow AlohaNoackNetDevice::GetChannel() to have
112
   * is therefore provide to allow AlohaNoackNetDevice::GetChannel() to have
113
   * something meaningful to return.
113
   * something meaningful to return.
114
   *
114
   *
115
   * @param c the underlying channel
115
   * \param c the underlying channel
116
   */
116
   */
117
  void SetChannel (Ptr<Channel> c);
117
  void SetChannel (Ptr<Channel> c);
118
118
 Lines 120-126    Link Here 
120
  /**
120
  /**
121
   * set the callback used to instruct the lower layer to start a TX
121
   * set the callback used to instruct the lower layer to start a TX
122
   *
122
   *
123
   * @param c
123
   * \param c
124
   */
124
   */
125
  void SetGenericPhyTxStartCallback (GenericPhyTxStartCallback c);
125
  void SetGenericPhyTxStartCallback (GenericPhyTxStartCallback c);
126
126
 Lines 131-137    Link Here 
131
   * This object is needed so that we can set/get attributes and
131
   * This object is needed so that we can set/get attributes and
132
   * connect to trace sources of the PHY from the net device.
132
   * connect to trace sources of the PHY from the net device.
133
   *
133
   *
134
   * @param phy the Phy object attached to the device.  Note that the
134
   * \param phy the Phy object attached to the device.  Note that the
135
   * API between the PHY and the above (this NetDevice which also
135
   * API between the PHY and the above (this NetDevice which also
136
   * implements the MAC) is implemented entirely by
136
   * implements the MAC) is implemented entirely by
137
   * callbacks, so we do not require that the PHY inherits by any
137
   * callbacks, so we do not require that the PHY inherits by any
 Lines 140-146    Link Here 
140
  void SetPhy (Ptr<Object> phy);
140
  void SetPhy (Ptr<Object> phy);
141
141
142
  /**
142
  /**
143
   * @return a reference to the PHY object embedded in this NetDevice.
143
   * \return a reference to the PHY object embedded in this NetDevice.
144
   */
144
   */
145
  Ptr<Object> GetPhy () const;
145
  Ptr<Object> GetPhy () const;
146
146
(-)a/src/spectrum/model/friis-spectrum-propagation-loss.h (-3 / +3 lines)
 Lines 60-69    Link Here 
60
   * where C = 3e8 m/s is the light speed in the vacuum. The intended
60
   * where C = 3e8 m/s is the light speed in the vacuum. The intended
61
   * use is to calculate Prx = Ptx * G
61
   * use is to calculate Prx = Ptx * G
62
   *
62
   *
63
   * @param f frequency in Hz
63
   * \param f frequency in Hz
64
   * @param d distance in m
64
   * \param d distance in m
65
   *
65
   *
66
   * @return if Prx < Ptx then return Prx; else return Ptx
66
   * \return if Prx < Ptx then return Prx; else return Ptx
67
   */
67
   */
68
  double CalculateLoss (double f, double d) const;
68
  double CalculateLoss (double f, double d) const;
69
69
(-)a/src/spectrum/model/half-duplex-ideal-phy.h (-11 / +11 lines)
 Lines 106-112    Link Here 
106
  /**
106
  /**
107
   * Get the SpectrumType used by this PHY
107
   * Get the SpectrumType used by this PHY
108
   *
108
   *
109
   * @return
109
   * \return
110
   */
110
   */
111
  SpectrumType GetSpectrumType ();
111
  SpectrumType GetSpectrumType ();
112
112
 Lines 115-127    Link Here 
115
   * set the Power Spectral Density of outgoing signals in power units
115
   * set the Power Spectral Density of outgoing signals in power units
116
   * (Watt, Pascal...) per Hz.
116
   * (Watt, Pascal...) per Hz.
117
   *
117
   *
118
   * @param txPsd
118
   * \param txPsd
119
   */
119
   */
120
  void SetTxPowerSpectralDensity (Ptr<SpectrumValue> txPsd);
120
  void SetTxPowerSpectralDensity (Ptr<SpectrumValue> txPsd);
121
121
122
  /**
122
  /**
123
   *
123
   *
124
   * @param noisePsd the Noise Power Spectral Density in power units
124
   * \param noisePsd the Noise Power Spectral Density in power units
125
   * (Watt, Pascal...) per Hz.
125
   * (Watt, Pascal...) per Hz.
126
   */
126
   */
127
  void SetNoisePowerSpectralDensity (Ptr<const SpectrumValue> noisePsd);
127
  void SetNoisePowerSpectralDensity (Ptr<const SpectrumValue> noisePsd);
 Lines 131-139    Link Here 
131
   * Start a transmission
131
   * Start a transmission
132
   *
132
   *
133
   *
133
   *
134
   * @param p the packet to be transmitted
134
   * \param p the packet to be transmitted
135
   *
135
   *
136
   * @return true if an error occurred and the transmission was not
136
   * \return true if an error occurred and the transmission was not
137
   * started, false otherwise.
137
   * started, false otherwise.
138
   */
138
   */
139
  bool StartTx (Ptr<Packet> p);
139
  bool StartTx (Ptr<Packet> p);
 Lines 141-153    Link Here 
141
  /**
141
  /**
142
   * set the PHY rate to be used by this PHY.
142
   * set the PHY rate to be used by this PHY.
143
   *
143
   *
144
   * @param rate
144
   * \param rate
145
   */
145
   */
146
  void SetRate (DataRate rate);
146
  void SetRate (DataRate rate);
147
147
148
  /**
148
  /**
149
   *
149
   *
150
   * @return the PHY rate used by this PHY.
150
   * \return the PHY rate used by this PHY.
151
   */
151
   */
152
  DataRate GetRate () const;
152
  DataRate GetRate () const;
153
153
 Lines 155-161    Link Here 
155
   * set the callback for the end of a TX, as part of the
155
   * set the callback for the end of a TX, as part of the
156
   * interconnections betweenthe PHY and the MAC
156
   * interconnections betweenthe PHY and the MAC
157
   *
157
   *
158
   * @param c the callback
158
   * \param c the callback
159
   */
159
   */
160
  void SetGenericPhyTxEndCallback (GenericPhyTxEndCallback c);
160
  void SetGenericPhyTxEndCallback (GenericPhyTxEndCallback c);
161
161
 Lines 163-169    Link Here 
163
   * set the callback for the start of RX, as part of the
163
   * set the callback for the start of RX, as part of the
164
   * interconnections betweenthe PHY and the MAC
164
   * interconnections betweenthe PHY and the MAC
165
   *
165
   *
166
   * @param c the callback
166
   * \param c the callback
167
   */
167
   */
168
  void SetGenericPhyRxStartCallback (GenericPhyRxStartCallback c);
168
  void SetGenericPhyRxStartCallback (GenericPhyRxStartCallback c);
169
169
 Lines 171-177    Link Here 
171
   * set the callback for the end of a RX in error, as part of the
171
   * set the callback for the end of a RX in error, as part of the
172
   * interconnections betweenthe PHY and the MAC
172
   * interconnections betweenthe PHY and the MAC
173
   *
173
   *
174
   * @param c the callback
174
   * \param c the callback
175
   */
175
   */
176
  void SetGenericPhyRxEndErrorCallback (GenericPhyRxEndErrorCallback c);
176
  void SetGenericPhyRxEndErrorCallback (GenericPhyRxEndErrorCallback c);
177
177
 Lines 179-185    Link Here 
179
   * set the callback for the successful end of a RX, as part of the
179
   * set the callback for the successful end of a RX, as part of the
180
   * interconnections betweenthe PHY and the MAC
180
   * interconnections betweenthe PHY and the MAC
181
   *
181
   *
182
   * @param c the callback
182
   * \param c the callback
183
   */
183
   */
184
  void SetGenericPhyRxEndOkCallback (GenericPhyRxEndOkCallback c);
184
  void SetGenericPhyRxEndOkCallback (GenericPhyRxEndOkCallback c);
185
185
(-)a/src/spectrum/model/microwave-oven-spectrum-value-helper.h (-2 / +2 lines)
 Lines 43-56    Link Here 
43
public:
43
public:
44
  /**
44
  /**
45
   *
45
   *
46
   * @return the Power Spectral Density of Micro Wave Oven #1 in the
46
   * \return the Power Spectral Density of Micro Wave Oven #1 in the
47
   * cited paper
47
   * cited paper
48
   */
48
   */
49
  static Ptr<SpectrumValue> CreatePowerSpectralDensityMwo1 ();
49
  static Ptr<SpectrumValue> CreatePowerSpectralDensityMwo1 ();
50
50
51
  /**
51
  /**
52
   *
52
   *
53
   * @return the Power Spectral Density of Micro Wave Oven #2 in the
53
   * \return the Power Spectral Density of Micro Wave Oven #2 in the
54
   * cited paper
54
   * cited paper
55
   */
55
   */
56
  static Ptr<SpectrumValue> CreatePowerSpectralDensityMwo2 ();
56
  static Ptr<SpectrumValue> CreatePowerSpectralDensityMwo2 ();
(-)a/src/spectrum/model/multi-model-spectrum-channel.h (-8 / +8 lines)
 Lines 114-122    Link Here 
114
   * an interator pointing to it. If not, it creates a new entry in
114
   * an interator pointing to it. If not, it creates a new entry in
115
   * m_txSpectrumMpodelInfoMap, and returns an iterator to it.
115
   * m_txSpectrumMpodelInfoMap, and returns an iterator to it.
116
   *
116
   *
117
   * @param txSpectrumModel the TX SpectrumModel  being considered
117
   * \param txSpectrumModel the TX SpectrumModel  being considered
118
   *
118
   *
119
   * @return an iterator pointing to the corresponding entry in m_txSpectrumModelInfoMap
119
   * \return an iterator pointing to the corresponding entry in m_txSpectrumModelInfoMap
120
   */
120
   */
121
  TxSpectrumModelInfoMap_t::const_iterator FindAndEventuallyAddTxSpectrumModel (Ptr<const SpectrumModel> txSpectrumModel);
121
  TxSpectrumModelInfoMap_t::const_iterator FindAndEventuallyAddTxSpectrumModel (Ptr<const SpectrumModel> txSpectrumModel);
122
122
 Lines 125-132    Link Here 
125
   * make sure that there are SpectrumConverters from any
125
   * make sure that there are SpectrumConverters from any
126
   * SpectrumPhy being used for TX to the given SpectrumModel being used for RX
126
   * SpectrumPhy being used for TX to the given SpectrumModel being used for RX
127
   *
127
   *
128
   * @param rxPhy the RXing SpectrumPhy
128
   * \param rxPhy the RXing SpectrumPhy
129
   * @param rxSpectrumModel the SpectrumModel used for RX by rxPhy
129
   * \param rxSpectrumModel the SpectrumModel used for RX by rxPhy
130
   */
130
   */
131
  void CheckAddRxSpectrumModel (Ptr<SpectrumPhy> rxPhy, Ptr<const SpectrumModel> rxSpectrumModel);
131
  void CheckAddRxSpectrumModel (Ptr<SpectrumPhy> rxPhy, Ptr<const SpectrumModel> rxSpectrumModel);
132
132
 Lines 135-144    Link Here 
135
  /**
135
  /**
136
   * used internally to reschedule transmission after the propagation delay
136
   * used internally to reschedule transmission after the propagation delay
137
   *
137
   *
138
   * @param p
138
   * \param p
139
   * @param rxPowerSpectrum
139
   * \param rxPowerSpectrum
140
   * @param duration
140
   * \param duration
141
   * @param receiver
141
   * \param receiver
142
   */
142
   */
143
  virtual void StartRx (Ptr<PacketBurst> p, Ptr <SpectrumValue> rxPowerSpectrum, SpectrumType st, Time duration, Ptr<SpectrumPhy> receiver);
143
  virtual void StartRx (Ptr<PacketBurst> p, Ptr <SpectrumValue> rxPowerSpectrum, SpectrumType st, Time duration, Ptr<SpectrumPhy> receiver);
144
144
(-)a/src/spectrum/model/non-communicating-net-device.h (-3 / +3 lines)
 Lines 67-73    Link Here 
67
   * is therefore provide to allow NonCommunicatingNetDevice::GetChannel() to have
67
   * is therefore provide to allow NonCommunicatingNetDevice::GetChannel() to have
68
   * something meaningful to return.
68
   * something meaningful to return.
69
   *
69
   *
70
   * @param c the underlying channel
70
   * \param c the underlying channel
71
   */
71
   */
72
  void SetChannel (Ptr<Channel> c);
72
  void SetChannel (Ptr<Channel> c);
73
73
 Lines 77-88    Link Here 
77
   * This object is needed so that we can set/get attributes and
77
   * This object is needed so that we can set/get attributes and
78
   * connect to trace sources of the PHY from the net device.
78
   * connect to trace sources of the PHY from the net device.
79
   *
79
   *
80
   * @param phy the Phy object embedded within this device.
80
   * \param phy the Phy object embedded within this device.
81
   */
81
   */
82
  void SetPhy (Ptr<Object> phy);
82
  void SetPhy (Ptr<Object> phy);
83
83
84
  /**
84
  /**
85
   * @return a reference to the PHY object embedded in this NetDevice.
85
   * \return a reference to the PHY object embedded in this NetDevice.
86
   */
86
   */
87
  Ptr<Object> GetPhy () const;
87
  Ptr<Object> GetPhy () const;
88
88
(-)a/src/spectrum/model/single-model-spectrum-channel.h (-6 / +6 lines)
 Lines 33-39    Link Here 
33
/**
33
/**
34
 * \ingroup spectrum
34
 * \ingroup spectrum
35
 *
35
 *
36
 * @brief SpectrumChannel implementation which handles a single spectrum model
36
 * \brief SpectrumChannel implementation which handles a single spectrum model
37
 *
37
 *
38
 * All SpectrumPhy layers attached to this SpectrumChannel
38
 * All SpectrumPhy layers attached to this SpectrumChannel
39
 */
39
 */
 Lines 73-83    Link Here 
73
  /**
73
  /**
74
   * used internally to reschedule transmission after the propagation delay
74
   * used internally to reschedule transmission after the propagation delay
75
   *
75
   *
76
   * @param p
76
   * \param p
77
   * @param rxPowerSpectrum
77
   * \param rxPowerSpectrum
78
   * @param st
78
   * \param st
79
   * @param duration
79
   * \param duration
80
   * @param receiver
80
   * \param receiver
81
   */
81
   */
82
  virtual void StartRx (Ptr<PacketBurst> p, Ptr <SpectrumValue> rxPowerSpectrum, SpectrumType st, Time duration, Ptr<SpectrumPhy> receiver);
82
  virtual void StartRx (Ptr<PacketBurst> p, Ptr <SpectrumValue> rxPowerSpectrum, SpectrumType st, Time duration, Ptr<SpectrumPhy> receiver);
83
83
(-)a/src/spectrum/model/spectrum-analyzer.h (-1 / +1 lines)
 Lines 64-70    Link Here 
64
  /**
64
  /**
65
   * Set the spectrum model used by the SpectrumAnalyzer to represent incoming signals
65
   * Set the spectrum model used by the SpectrumAnalyzer to represent incoming signals
66
   *
66
   *
67
   * @param m
67
   * \param m
68
   */
68
   */
69
  void SetRxSpectrumModel (Ptr<SpectrumModel> m);
69
  void SetRxSpectrumModel (Ptr<SpectrumModel> m);
70
70
(-)a/src/spectrum/model/spectrum-channel.h (-7 / +7 lines)
 Lines 74-95    Link Here 
74
  /**
74
  /**
75
   * Used by attached PHY instances to transmit waveforms on the channel
75
   * Used by attached PHY instances to transmit waveforms on the channel
76
   *
76
   *
77
   * @param p the PacketBurst associated with the waveform being transmitted
77
   * \param p the PacketBurst associated with the waveform being transmitted
78
   * @param txPsd the Power Spectral Density of the
78
   * \param txPsd the Power Spectral Density of the
79
   * waveform, in linear units. The exact unit will depend on the
79
   * waveform, in linear units. The exact unit will depend on the
80
   * type of transmission medium involved: W for radio communications, Pa for
80
   * type of transmission medium involved: W for radio communications, Pa for
81
   * underwater acoustic communications. Other transmission media to be defined.
81
   * underwater acoustic communications. Other transmission media to be defined.
82
   * @param st spectrum type
82
   * \param st spectrum type
83
   * @param duration duration of the packet transmission. It is
83
   * \param duration duration of the packet transmission. It is
84
   * assumed that the Power Spectral Density remains constant for the
84
   * assumed that the Power Spectral Density remains constant for the
85
   * whole duration of the transmission. In other words, all waveform
85
   * whole duration of the transmission. In other words, all waveform
86
   * have a rect shape with respect to time.
86
   * have a rect shape with respect to time.
87
   * @param sender the SpectrumPhy instance making this function call
87
   * \param sender the SpectrumPhy instance making this function call
88
   */
88
   */
89
  virtual void StartTx (Ptr<PacketBurst> p, Ptr <SpectrumValue> txPsd, SpectrumType st, Time duration, Ptr<SpectrumPhy> sender) = 0;
89
  virtual void StartTx (Ptr<PacketBurst> p, Ptr <SpectrumValue> txPsd, SpectrumType st, Time duration, Ptr<SpectrumPhy> sender) = 0;
90
90
91
  /**
91
  /**
92
   * @brief add a SpectrumPhy to a channel, so it can receive packets
92
   * \brief add a SpectrumPhy to a channel, so it can receive packets
93
   *
93
   *
94
   * This method is used to attach a SpectrumPhy instance to a
94
   * This method is used to attach a SpectrumPhy instance to a
95
   * SpectrumChannel instance, so that the SpectrumPhy can receive
95
   * SpectrumChannel instance, so that the SpectrumPhy can receive
 Lines 100-106    Link Here 
100
   * This method is to be implemented by all classes inheriting from
100
   * This method is to be implemented by all classes inheriting from
101
   * SpectrumChannel.
101
   * SpectrumChannel.
102
   *
102
   *
103
   * @param phy the SpectrumPhy instance to be added to the channel as
103
   * \param phy the SpectrumPhy instance to be added to the channel as
104
   * a receiver.
104
   * a receiver.
105
   */
105
   */
106
  virtual void AddRx (Ptr<SpectrumPhy> phy) = 0;
106
  virtual void AddRx (Ptr<SpectrumPhy> phy) = 0;
(-)a/src/spectrum/model/spectrum-converter.h (-10 / +10 lines)
 Lines 47-54    Link Here 
47
   * instances defined over one SpectrumModel to corresponding ValueVsFreq
47
   * instances defined over one SpectrumModel to corresponding ValueVsFreq
48
   * instances defined over a diffent SpectrumModel
48
   * instances defined over a diffent SpectrumModel
49
   *
49
   *
50
   * @param fromSpectrumModel the SpectrumModel to convert from
50
   * \param fromSpectrumModel the SpectrumModel to convert from
51
   * @param toSpectrumModel the SpectrumModel to convert to
51
   * \param toSpectrumModel the SpectrumModel to convert to
52
   */
52
   */
53
  SpectrumConverter (Ptr<const SpectrumModel> fromSpectrumModel, Ptr<const SpectrumModel> toSpectrumModel);
53
  SpectrumConverter (Ptr<const SpectrumModel> fromSpectrumModel, Ptr<const SpectrumModel> toSpectrumModel);
54
54
 Lines 59-67    Link Here 
59
  /**
59
  /**
60
   * Convert a particular ValueVsFreq instance to
60
   * Convert a particular ValueVsFreq instance to
61
   *
61
   *
62
   * @param vvf the ValueVsFreq instance to be converted
62
   * \param vvf the ValueVsFreq instance to be converted
63
   *
63
   *
64
   * @return the converted version of the provided ValueVsFreq
64
   * \return the converted version of the provided ValueVsFreq
65
   */
65
   */
66
  Ptr<SpectrumValue> Convert (Ptr<const SpectrumValue> vvf) const;
66
  Ptr<SpectrumValue> Convert (Ptr<const SpectrumValue> vvf) const;
67
67
 Lines 70-86    Link Here 
70
  /**
70
  /**
71
   * Calculate the coefficient for value conversion between elements
71
   * Calculate the coefficient for value conversion between elements
72
   *
72
   *
73
   * @param from BandInfo to convert from
73
   * \param from BandInfo to convert from
74
   * @param to  BandInfo to convert to
74
   * \param to  BandInfo to convert to
75
   *
75
   *
76
   * @return the fraction of the value of the "from" BandInfos that is
76
   * \return the fraction of the value of the "from" BandInfos that is
77
   * mapped to the "to" BandInfo
77
   * mapped to the "to" BandInfo
78
   */
78
   */
79
  double GetCoefficient (const BandInfo& from, const BandInfo& to) const;
79
  double GetCoefficient (const BandInfo& from, const BandInfo& to) const;
80
80
81
  std::vector<std::vector<double> > m_conversionMatrix; // /< matrix of conversion coefficients
81
  std::vector<std::vector<double> > m_conversionMatrix; ///< matrix of conversion coefficients
82
  Ptr<const SpectrumModel> m_fromSpectrumModel;  // /<  the SpectrumModel this SpectrumConverter instance can convert from
82
  Ptr<const SpectrumModel> m_fromSpectrumModel;  ///< the SpectrumModel this SpectrumConverter instance can convert from
83
  Ptr<const SpectrumModel> m_toSpectrumModel;    // /<  the SpectrumModel this SpectrumConverter instance can convert to
83
  Ptr<const SpectrumModel> m_toSpectrumModel;    ///< the SpectrumModel this SpectrumConverter instance can convert to
84
84
85
};
85
};
86
86
(-)a/src/spectrum/model/spectrum-interference.h (-7 / +7 lines)
 Lines 52-66    Link Here 
52
  /**
52
  /**
53
   * set the SpectrumErrorModel to be used.
53
   * set the SpectrumErrorModel to be used.
54
   *
54
   *
55
   * @param e
55
   * \param e
56
   */
56
   */
57
  void SetErrorModel (Ptr<SpectrumErrorModel> e);
57
  void SetErrorModel (Ptr<SpectrumErrorModel> e);
58
58
59
  /**
59
  /**
60
   * notify that the PHY is starting a RX attempt
60
   * notify that the PHY is starting a RX attempt
61
   *
61
   *
62
   * @param p the packet corresponding to the signal being RX
62
   * \param p the packet corresponding to the signal being RX
63
   * @param rxPsd the power spectral density of the signal being RX
63
   * \param rxPsd the power spectral density of the signal being RX
64
   */
64
   */
65
  void StartRx (Ptr<const Packet> p, Ptr<const SpectrumValue> rxPsd);
65
  void StartRx (Ptr<const Packet> p, Ptr<const SpectrumValue> rxPsd);
66
66
 Lines 74-80    Link Here 
74
   * method must also be called when RX is aborted.
74
   * method must also be called when RX is aborted.
75
   *
75
   *
76
   *
76
   *
77
   * @return true if RX was successful, false otherwise
77
   * \return true if RX was successful, false otherwise
78
   */
78
   */
79
  bool EndRx ();
79
  bool EndRx ();
80
80
 Lines 84-98    Link Here 
84
   * method is to be called for all incoming signal, regardless of
84
   * method is to be called for all incoming signal, regardless of
85
   * wether they're useful signals or interferers.
85
   * wether they're useful signals or interferers.
86
   *
86
   *
87
   * @param spd the power spectral density of the new signal
87
   * \param spd the power spectral density of the new signal
88
   * @param duration the duration of the new signal
88
   * \param duration the duration of the new signal
89
   */
89
   */
90
  void AddSignal (Ptr<const SpectrumValue> spd, const Time duration);
90
  void AddSignal (Ptr<const SpectrumValue> spd, const Time duration);
91
91
92
92
93
  /**
93
  /**
94
   *
94
   *
95
   * @param noisePsd the Noise Power Spectral Density in power units
95
   * \param noisePsd the Noise Power Spectral Density in power units
96
   * (Watt, Pascal...) per Hz.
96
   * (Watt, Pascal...) per Hz.
97
   */
97
   */
98
  void SetNoisePowerSpectralDensity (Ptr<const SpectrumValue> noisePsd);
98
  void SetNoisePowerSpectralDensity (Ptr<const SpectrumValue> noisePsd);
(-)a/src/spectrum/model/spectrum-model.h (-6 / +6 lines)
 Lines 72-80    Link Here 
72
   * between the center frequency of the considered band and the
72
   * between the center frequency of the considered band and the
73
   * center frequency of the adjacent lower (resp. upper) band.
73
   * center frequency of the adjacent lower (resp. upper) band.
74
   *
74
   *
75
   * @param centerFreqs the vector of center frequencies.
75
   * \param centerFreqs the vector of center frequencies.
76
   *
76
   *
77
   * @return
77
   * \return
78
   */
78
   */
79
  SpectrumModel (std::vector<double> centerFreqs);
79
  SpectrumModel (std::vector<double> centerFreqs);
80
80
 Lines 83-104    Link Here 
83
   * This construct a SpectrumModel based on the explicit values of
83
   * This construct a SpectrumModel based on the explicit values of
84
   * center frequencies and boundaries of each subband.
84
   * center frequencies and boundaries of each subband.
85
   *
85
   *
86
   * @param bands
86
   * \param bands
87
   *
87
   *
88
   * @return
88
   * \return
89
   */
89
   */
90
  SpectrumModel (Bands bands);
90
  SpectrumModel (Bands bands);
91
91
92
  /**
92
  /**
93
   *
93
   *
94
   * @return the number of frequencies in this SpectrumModel
94
   * \return the number of frequencies in this SpectrumModel
95
   */
95
   */
96
  size_t GetNumBands () const;
96
  size_t GetNumBands () const;
97
97
98
98
99
  /**
99
  /**
100
   *
100
   *
101
   * @return the unique id of this SpectrumModel
101
   * \return the unique id of this SpectrumModel
102
   */
102
   */
103
  SpectrumModelUid_t GetUid () const;
103
  SpectrumModelUid_t GetUid () const;
104
104
(-)a/src/spectrum/model/spectrum-phy.h (-10 / +10 lines)
 Lines 52-79    Link Here 
52
  /**
52
  /**
53
   * set the associated NetDevice instance
53
   * set the associated NetDevice instance
54
   *
54
   *
55
   * @param d the NetDevice instance
55
   * \param d the NetDevice instance
56
   */
56
   */
57
  virtual void SetDevice (Ptr<NetDevice> d) = 0;
57
  virtual void SetDevice (Ptr<NetDevice> d) = 0;
58
58
59
  /**
59
  /**
60
   * get the associated NetDevice instance
60
   * get the associated NetDevice instance
61
   *
61
   *
62
   * @return a Ptr to the associated NetDevice instance
62
   * \return a Ptr to the associated NetDevice instance
63
   */
63
   */
64
  virtual Ptr<NetDevice> GetDevice () = 0;
64
  virtual Ptr<NetDevice> GetDevice () = 0;
65
65
66
  /**
66
  /**
67
   * Set the mobility model associated with this device.
67
   * Set the mobility model associated with this device.
68
   *
68
   *
69
   * @param m the mobility model
69
   * \param m the mobility model
70
   */
70
   */
71
  virtual void SetMobility (Ptr<MobilityModel> m) = 0;
71
  virtual void SetMobility (Ptr<MobilityModel> m) = 0;
72
72
73
  /**
73
  /**
74
   * get the associated MobilityModel instance
74
   * get the associated MobilityModel instance
75
   *
75
   *
76
   * @return a Ptr to the associated NetDevice instance
76
   * \return a Ptr to the associated NetDevice instance
77
   */
77
   */
78
  virtual Ptr<MobilityModel> GetMobility () = 0;
78
  virtual Ptr<MobilityModel> GetMobility () = 0;
79
79
 Lines 81-93    Link Here 
81
  /**
81
  /**
82
   * Set the channel attached to this device.
82
   * Set the channel attached to this device.
83
   *
83
   *
84
   * @param c the channel
84
   * \param c the channel
85
   */
85
   */
86
  virtual void SetChannel (Ptr<SpectrumChannel> c) = 0;
86
  virtual void SetChannel (Ptr<SpectrumChannel> c) = 0;
87
87
88
  /**
88
  /**
89
   *
89
   *
90
   * @return returns the SpectrumModel that this SpectrumPhy expects to be used
90
   * \return returns the SpectrumModel that this SpectrumPhy expects to be used
91
   * for all SpectrumValues that are passed to StartRx. If 0 is
91
   * for all SpectrumValues that are passed to StartRx. If 0 is
92
   * returned, it means that any model will be accepted.
92
   * returned, it means that any model will be accepted.
93
   */
93
   */
 Lines 96-106    Link Here 
96
  /**
96
  /**
97
   * Notify the SpectrumPhy instance of an incoming waveform
97
   * Notify the SpectrumPhy instance of an incoming waveform
98
   *
98
   *
99
   * @param p the PacketBurst associated with the incoming waveform
99
   * \param p the PacketBurst associated with the incoming waveform
100
   * @param rxPsd the Power Spectral Density of the incoming
100
   * \param rxPsd the Power Spectral Density of the incoming
101
   * waveform. The units of the PSD are the same specified for SpectrumChannel::StartTx().
101
   * waveform. The units of the PSD are the same specified for SpectrumChannel::StartTx().
102
   * @param st spectrum type
102
   * \param st spectrum type
103
   * @param duration the duration of the incoming waveform
103
   * \param duration the duration of the incoming waveform
104
   */
104
   */
105
  virtual void StartRx (Ptr<PacketBurst> p, Ptr <const SpectrumValue> rxPsd, SpectrumType st, Time duration) = 0;
105
  virtual void StartRx (Ptr<PacketBurst> p, Ptr <const SpectrumValue> rxPsd, SpectrumType st, Time duration) = 0;
106
106
(-)a/src/spectrum/model/spectrum-propagation-loss-model.h (-9 / +9 lines)
 Lines 53-74    Link Here 
53
  /**
53
  /**
54
   * used to chain various instances of SpectrumPropagationLossModel
54
   * used to chain various instances of SpectrumPropagationLossModel
55
   *
55
   *
56
   * @param next
56
   * \param next
57
   */
57
   */
58
  void SetNext (Ptr<SpectrumPropagationLossModel> next);
58
  void SetNext (Ptr<SpectrumPropagationLossModel> next);
59
59
60
  /**
60
  /**
61
   * This method is to be called to calculate
61
   * This method is to be called to calculate
62
   *
62
   *
63
   * @param txPsd the SpectrumValue representing the power spectral
63
   * \param txPsd the SpectrumValue representing the power spectral
64
   * density of the transmission. Watt units are to be used for radio
64
   * density of the transmission. Watt units are to be used for radio
65
   * communications, and Pascal units for acoustic communications
65
   * communications, and Pascal units for acoustic communications
66
   * (e.g. underwater).
66
   * (e.g. underwater).
67
   *
67
   *
68
   * @param a sender mobility
68
   * \param a sender mobility
69
   * @param b receiver mobility
69
   * \param b receiver mobility
70
   *
70
   *
71
   * @return set of values vs frequency representing the received
71
   * \return set of values vs frequency representing the received
72
   * power in the same units used for the txPower parameter.
72
   * power in the same units used for the txPower parameter.
73
   */
73
   */
74
  Ptr<SpectrumValue> CalcRxPowerSpectralDensity (Ptr<const SpectrumValue> txPsd,
74
  Ptr<SpectrumValue> CalcRxPowerSpectralDensity (Ptr<const SpectrumValue> txPsd,
 Lines 83-94    Link Here 
83
  /**
83
  /**
84
   *
84
   *
85
   *
85
   *
86
   * @param txPsd set of values vs frequency representing the
86
   * \param txPsd set of values vs frequency representing the
87
   * transmission power. See SpectrumChannel for details.
87
   * transmission power. See SpectrumChannel for details.
88
   * @param a sender mobility
88
   * \param a sender mobility
89
   * @param b receiver mobility
89
   * \param b receiver mobility
90
   *
90
   *
91
   * @return set of values vs frequency representing the received
91
   * \return set of values vs frequency representing the received
92
   * power in the same units used for the txPower parameter.
92
   * power in the same units used for the txPower parameter.
93
   */
93
   */
94
  virtual Ptr<SpectrumValue> DoCalcRxPowerSpectralDensity (Ptr<const SpectrumValue> txPsd,
94
  virtual Ptr<SpectrumValue> DoCalcRxPowerSpectralDensity (Ptr<const SpectrumValue> txPsd,
(-)a/src/spectrum/model/spectrum-value.h (-128 / +100 lines)
 Lines 58-69    Link Here 
58
{
58
{
59
public:
59
public:
60
  /**
60
  /**
61
   * @brief SpectrumValue constructor
61
   * \brief SpectrumValue constructor
62
   *
62
   *
63
   * @param sm pointer to the SpectrumModel which implements the set of frequencies to which the values
63
   * \param sm pointer to the SpectrumModel which implements the set of frequencies to which the values
64
   * will be referring.
64
   * will be referring.
65
   *
65
   *
66
   * @warning the intended use if that sm points to a static object
66
   * \warning the intended use if that sm points to a static object
67
   * which will be there for the whole simulation. This is reasonable
67
   * which will be there for the whole simulation. This is reasonable
68
   * since the set of frequencies which are to be used in the
68
   * since the set of frequencies which are to be used in the
69
   * simulation is normally known before the simulation starts. Make
69
   * simulation is normally known before the simulation starts. Make
 Lines 83-150    Link Here 
83
  /**
83
  /**
84
   * Access value at given frequency index
84
   * Access value at given frequency index
85
   *
85
   *
86
   * @param index the given frequency index
86
   * \param index the given frequency index
87
   *
87
   *
88
   * @return reference to the value
88
   * \return reference to the value
89
   */
89
   */
90
  double& operator[] (size_t index);
90
  double& operator[] (size_t index);
91
91
92
92
93
93
94
  /**
94
  /**
95
   *
95
   * \return the uid of the embedded SpectrumModel
96
   * @return the uid of the embedded SpectrumModel
97
   */
96
   */
98
  SpectrumModelUid_t GetSpectrumModelUid () const;
97
  SpectrumModelUid_t GetSpectrumModelUid () const;
99
98
100
99
101
  /**
100
  /**
102
   *
101
   * \return the embedded SpectrumModel
103
   * @return the  embedded SpectrumModel
104
   */
102
   */
105
  Ptr<const SpectrumModel> GetSpectrumModel () const;
103
  Ptr<const SpectrumModel> GetSpectrumModel () const;
106
104
107
105
108
  /**
106
  /**
109
   *
107
   * \return a const iterator pointing to the beginning of the embedded SpectrumModel
110
   *
111
   * @return a const iterator pointing to the beginning of the embedded SpectrumModel
112
   */
108
   */
113
  Bands::const_iterator ConstBandsBegin () const;
109
  Bands::const_iterator ConstBandsBegin () const;
114
110
115
  /**
111
  /**
116
   *
112
   * \return a const iterator pointing to the end of the embedded SpectrumModel
117
   *
118
   * @return a const iterator pointing to the end of the embedded SpectrumModel
119
   */
113
   */
120
  Bands::const_iterator ConstBandsEnd () const;
114
  Bands::const_iterator ConstBandsEnd () const;
121
115
122
116
123
  /**
117
  /**
124
   *
118
   * \return a const iterator pointing to the beginning of the embedded SpectrumModel
125
   *
126
   * @return a const iterator pointing to the beginning of the embedded SpectrumModel
127
   */
119
   */
128
  Values::const_iterator ConstValuesBegin () const;
120
  Values::const_iterator ConstValuesBegin () const;
129
121
130
  /**
122
  /**
131
   *
123
   * \return a const iterator pointing to the end of the embedded SpectrumModel
132
   *
133
   * @return a const iterator pointing to the end of the embedded SpectrumModel
134
   */
124
   */
135
  Values::const_iterator ConstValuesEnd () const;
125
  Values::const_iterator ConstValuesEnd () const;
136
126
137
  /**
127
  /**
138
   *
128
   * \return an iterator pointing to the beginning of the embedded SpectrumModel
139
   *
140
   * @return an iterator pointing to the beginning of the embedded SpectrumModel
141
   */
129
   */
142
  Values::iterator ValuesBegin ();
130
  Values::iterator ValuesBegin ();
143
131
144
  /**
132
  /**
145
   *
133
   * \return an iterator pointing to the end of the embedded SpectrumModel
146
   *
147
   * @return an iterator pointing to the end of the embedded SpectrumModel
148
   */
134
   */
149
  Values::iterator ValuesEnd ();
135
  Values::iterator ValuesEnd ();
150
136
 Lines 153-162    Link Here 
153
  /**
139
  /**
154
   *  addition operator
140
   *  addition operator
155
   *
141
   *
156
   * @param lhs Left Hand Side of the operator
142
   * \param lhs Left Hand Side of the operator
157
   * @param rhs Right Hand Side of the operator
143
   * \param rhs Right Hand Side of the operator
158
   *
144
   *
159
   * @return the value of lhs + rhs
145
   * \return the value of lhs + rhs
160
   */
146
   */
161
  friend SpectrumValue operator+ (const SpectrumValue& lhs, const SpectrumValue& rhs);
147
  friend SpectrumValue operator+ (const SpectrumValue& lhs, const SpectrumValue& rhs);
162
148
 Lines 164-183    Link Here 
164
  /**
150
  /**
165
   *  addition operator
151
   *  addition operator
166
   *
152
   *
167
   * @param lhs Left Hand Side of the operator
153
   * \param lhs Left Hand Side of the operator
168
   * @param rhs Right Hand Side of the operator
154
   * \param rhs Right Hand Side of the operator
169
   *
155
   *
170
   * @return the value of lhs + rhs
156
   * \return the value of lhs + rhs
171
   */
157
   */
172
  friend SpectrumValue operator+ (const SpectrumValue& lhs, double rhs);
158
  friend SpectrumValue operator+ (const SpectrumValue& lhs, double rhs);
173
159
174
  /**
160
  /**
175
   *  addition operator
161
   *  addition operator
176
   *
162
   *
177
   * @param lhs Left Hand Side of the operator
163
   * \param lhs Left Hand Side of the operator
178
   * @param rhs Right Hand Side of the operator
164
   * \param rhs Right Hand Side of the operator
179
   *
165
   *
180
   * @return the value of lhs + rhs
166
   * \return the value of lhs + rhs
181
   */
167
   */
182
  friend SpectrumValue operator+ (double lhs, const SpectrumValue& rhs);
168
  friend SpectrumValue operator+ (double lhs, const SpectrumValue& rhs);
183
169
 Lines 185-274    Link Here 
185
  /**
171
  /**
186
   *  subtraction operator
172
   *  subtraction operator
187
   *
173
   *
188
   * @param lhs Left Hand Side of the operator
174
   * \param lhs Left Hand Side of the operator
189
   * @param rhs Right Hand Side of the operator
175
   * \param rhs Right Hand Side of the operator
190
   *
176
   *
191
   * @return the value of lhs - rhs
177
   * \return the value of lhs - rhs
192
   */
178
   */
193
  friend SpectrumValue operator- (const SpectrumValue& lhs, const SpectrumValue& rhs);
179
  friend SpectrumValue operator- (const SpectrumValue& lhs, const SpectrumValue& rhs);
194
180
195
  /**
181
  /**
196
   *  subtraction operator
182
   *  subtraction operator
197
   *
183
   *
198
   * @param lhs Left Hand Side of the operator
184
   * \param lhs Left Hand Side of the operator
199
   * @param rhs Right Hand Side of the operator
185
   * \param rhs Right Hand Side of the operator
200
   *
186
   *
201
   * @return the value of lhs - rhs
187
   * \return the value of lhs - rhs
202
   */
188
   */
203
  friend SpectrumValue operator- (const SpectrumValue& lhs, double rhs);
189
  friend SpectrumValue operator- (const SpectrumValue& lhs, double rhs);
204
190
205
  /**
191
  /**
206
   *  subtraction operator
192
   *  subtraction operator
207
   *
193
   *
208
   * @param lhs Left Hand Side of the operator
194
   * \param lhs Left Hand Side of the operator
209
   * @param rhs Right Hand Side of the operator
195
   * \param rhs Right Hand Side of the operator
210
   *
196
   *
211
   * @return the value of lhs - rhs
197
   * \return the value of lhs - rhs
212
   */
198
   */
213
  friend SpectrumValue operator- (double lhs, const SpectrumValue& rhs);
199
  friend SpectrumValue operator- (double lhs, const SpectrumValue& rhs);
214
200
215
  /**
201
  /**
216
   *  multiplication component-by-component (Schur product)
202
   *  multiplication component-by-component (Schur product)
217
   *
203
   *
218
   * @param lhs Left Hand Side of the operator
204
   * \param lhs Left Hand Side of the operator
219
   * @param rhs Right Hand Side of the operator
205
   * \param rhs Right Hand Side of the operator
220
   *
206
   *
221
   * @return the value of lhs * rhs
207
   * \return the value of lhs * rhs
222
   */
208
   */
223
  friend SpectrumValue operator* (const SpectrumValue& lhs, const SpectrumValue& rhs);
209
  friend SpectrumValue operator* (const SpectrumValue& lhs, const SpectrumValue& rhs);
224
210
225
  /**
211
  /**
226
   *  multiplication by a scalar
212
   *  multiplication by a scalar
227
   *
213
   *
228
   * @param lhs Left Hand Side of the operator
214
   * \param lhs Left Hand Side of the operator
229
   * @param rhs Right Hand Side of the operator
215
   * \param rhs Right Hand Side of the operator
230
   *
216
   *
231
   * @return the value of lhs * rhs
217
   * \return the value of lhs * rhs
232
   */
218
   */
233
  friend SpectrumValue operator* (const SpectrumValue& lhs, double rhs);
219
  friend SpectrumValue operator* (const SpectrumValue& lhs, double rhs);
234
220
235
  /**
221
  /**
236
   *  multiplication of a scalar
222
   *  multiplication of a scalar
237
   *
223
   *
238
   * @param lhs Left Hand Side of the operator
224
   * \param lhs Left Hand Side of the operator
239
   * @param rhs Right Hand Side of the operator
225
   * \param rhs Right Hand Side of the operator
240
   *
226
   *
241
   * @return the value of lhs * rhs
227
   * \return the value of lhs * rhs
242
   */
228
   */
243
  friend SpectrumValue operator* (double lhs, const SpectrumValue& rhs);
229
  friend SpectrumValue operator* (double lhs, const SpectrumValue& rhs);
244
230
245
  /**
231
  /**
246
   *  division component-by-component
232
   *  division component-by-component
247
   *
233
   *
248
   * @param lhs Left Hand Side of the operator
234
   * \param lhs Left Hand Side of the operator
249
   * @param rhs Right Hand Side of the operator
235
   * \param rhs Right Hand Side of the operator
250
   *
236
   *
251
   * @return the value of lhs / rhs
237
   * \return the value of lhs / rhs
252
   */
238
   */
253
  friend SpectrumValue operator/ (const SpectrumValue& lhs, const SpectrumValue& rhs);
239
  friend SpectrumValue operator/ (const SpectrumValue& lhs, const SpectrumValue& rhs);
254
240
255
  /**
241
  /**
256
   * division by a scalar
242
   * division by a scalar
257
   *
243
   *
258
   * @param lhs Left Hand Side of the operator
244
   * \param lhs Left Hand Side of the operator
259
   * @param rhs Right Hand Side of the operator
245
   * \param rhs Right Hand Side of the operator
260
   *
246
   *
261
   * @return the value of *this / rhs
247
   * \return the value of *this / rhs
262
   */
248
   */
263
  friend SpectrumValue operator/ (const SpectrumValue& lhs, double rhs);
249
  friend SpectrumValue operator/ (const SpectrumValue& lhs, double rhs);
264
250
265
  /**
251
  /**
266
   * division of a scalar
252
   * division of a scalar
267
   *
253
   *
268
   * @param lhs Left Hand Side of the operator
254
   * \param lhs Left Hand Side of the operator
269
   * @param rhs Right Hand Side of the operator
255
   * \param rhs Right Hand Side of the operator
270
   *
256
   *
271
   * @return the value of *this / rhs
257
   * \return the value of *this / rhs
272
   */
258
   */
273
  friend SpectrumValue operator/ (double lhs, const SpectrumValue& rhs);
259
  friend SpectrumValue operator/ (double lhs, const SpectrumValue& rhs);
274
260
 Lines 276-282    Link Here 
276
   * unary plus operator
262
   * unary plus operator
277
   *
263
   *
278
   *
264
   *
279
   * @return the value of *this
265
   * \return the value of *this
280
   */
266
   */
281
  friend SpectrumValue operator+ (const SpectrumValue& rhs);
267
  friend SpectrumValue operator+ (const SpectrumValue& rhs);
282
268
 Lines 284-290    Link Here 
284
   * unary minus operator
270
   * unary minus operator
285
   *
271
   *
286
   *
272
   *
287
   * @return the value of - *this
273
   * \return the value of - *this
288
   */
274
   */
289
  friend SpectrumValue operator- (const SpectrumValue& rhs);
275
  friend SpectrumValue operator- (const SpectrumValue& rhs);
290
276
 Lines 292-300    Link Here 
292
  /**
278
  /**
293
   * left shift operator
279
   * left shift operator
294
   *
280
   *
295
   * @param n position to shift
281
   * \param n position to shift
296
   *
282
   *
297
   * @return the value of *this left shifted by n positions. In other
283
   * \return the value of *this left shifted by n positions. In other
298
   * words, the function of the set of frequencies represented by
284
   * words, the function of the set of frequencies represented by
299
   * *this is left-shifted in frequency by n positions.
285
   * *this is left-shifted in frequency by n positions.
300
   */
286
   */
 Lines 303-311    Link Here 
303
  /**
289
  /**
304
    * right shift operator
290
    * right shift operator
305
    *
291
    *
306
    * @param n position to shift
292
    * \param n position to shift
307
    *
293
    *
308
    * @return the value of *this right shifted by n positions. In other
294
    * \return the value of *this right shifted by n positions. In other
309
    * words, the function of the set of frequencies represented by
295
    * words, the function of the set of frequencies represented by
310
    * *this is left-shifted in frequency by n positions.
296
    * *this is left-shifted in frequency by n positions.
311
    */
297
    */
 Lines 316-351    Link Here 
316
  /**
302
  /**
317
   * Add the Right Hand Side of the operator to *this, component by component
303
   * Add the Right Hand Side of the operator to *this, component by component
318
   *
304
   *
319
   * @param rhs the Right Hand Side
305
   * \param rhs the Right Hand Side
320
   *
306
   *
321
   * @return a reference to *this
307
   * \return a reference to *this
322
   */
308
   */
323
  SpectrumValue& operator+= (const SpectrumValue& rhs);
309
  SpectrumValue& operator+= (const SpectrumValue& rhs);
324
310
325
  /**
311
  /**
326
   * Subtract the Right Hand Side of the operator from *this, component by component
312
   * Subtract the Right Hand Side of the operator from *this, component by component
327
   *
313
   *
328
   * @param rhs the Right Hand Side
314
   * \param rhs the Right Hand Side
329
   *
315
   *
330
   * @return a reference to *this
316
   * \return a reference to *this
331
   */
317
   */
332
  SpectrumValue& operator-= (const SpectrumValue& rhs);
318
  SpectrumValue& operator-= (const SpectrumValue& rhs);
333
319
334
  /**
320
  /**
335
   * Multiply *this by the Right Hand Side of the operator, component by component
321
   * Multiply *this by the Right Hand Side of the operator, component by component
336
   *
322
   *
337
   * @param rhs the Right Hand Side
323
   * \param rhs the Right Hand Side
338
   *
324
   *
339
   * @return  a reference to *this
325
   * \return  a reference to *this
340
   */
326
   */
341
  SpectrumValue& operator*= (const SpectrumValue& rhs);
327
  SpectrumValue& operator*= (const SpectrumValue& rhs);
342
328
343
  /**
329
  /**
344
   * Divide *this by the Right Hand Side of the operator, component by component
330
   * Divide *this by the Right Hand Side of the operator, component by component
345
   *
331
   *
346
   * @param rhs the Right Hand Side
332
   * \param rhs the Right Hand Side
347
   *
333
   *
348
   * @return  a reference to *this
334
   * \return  a reference to *this
349
   */
335
   */
350
  SpectrumValue& operator/= (const SpectrumValue& rhs);
336
  SpectrumValue& operator/= (const SpectrumValue& rhs);
351
337
 Lines 353-361    Link Here 
353
   * Add the value of the Right Hand Side of the operator to all
339
   * Add the value of the Right Hand Side of the operator to all
354
   * components of *this
340
   * components of *this
355
   *
341
   *
356
   * @param rhs the Right Hand Side
342
   * \param rhs the Right Hand Side
357
   *
343
   *
358
   * @return a reference to *this
344
   * \return a reference to *this
359
   */
345
   */
360
  SpectrumValue& operator+= (double rhs);
346
  SpectrumValue& operator+= (double rhs);
361
347
 Lines 363-371    Link Here 
363
   * Subtract the value of the Right Hand Side of the operator from all
349
   * Subtract the value of the Right Hand Side of the operator from all
364
   * components of *this
350
   * components of *this
365
   *
351
   *
366
   * @param rhs the Right Hand Side
352
   * \param rhs the Right Hand Side
367
   *
353
   *
368
   * @return a reference to *this
354
   * \return a reference to *this
369
   */
355
   */
370
  SpectrumValue& operator-= (double rhs);
356
  SpectrumValue& operator-= (double rhs);
371
357
 Lines 373-381    Link Here 
373
   * Multiply every component of *this by the value of the Right Hand
359
   * Multiply every component of *this by the value of the Right Hand
374
   * Side of the operator
360
   * Side of the operator
375
   *
361
   *
376
   * @param rhs the Right Hand Side
362
   * \param rhs the Right Hand Side
377
   *
363
   *
378
   * @return  a reference to *this
364
   * \return  a reference to *this
379
   */
365
   */
380
  SpectrumValue& operator*= (double rhs);
366
  SpectrumValue& operator*= (double rhs);
381
367
 Lines 383-391    Link Here 
383
   * Divide every component of *this by the value of the Right Hand
369
   * Divide every component of *this by the value of the Right Hand
384
   * Side of the operator
370
   * Side of the operator
385
   *
371
   *
386
   * @param rhs the Right Hand Side
372
   * \param rhs the Right Hand Side
387
   *
373
   *
388
   * @return  a reference to *this
374
   * \return  a reference to *this
389
   */
375
   */
390
  SpectrumValue& operator/= (double rhs);
376
  SpectrumValue& operator/= (double rhs);
391
377
 Lines 394-493    Link Here 
394
   * Assign each component of *this to the value of the Right Hand
380
   * Assign each component of *this to the value of the Right Hand
395
   * Side of the operator
381
   * Side of the operator
396
   *
382
   *
397
   * @param rhs
383
   * \param rhs
398
   *
384
   *
399
   * @return
385
   * \return
400
   */
386
   */
401
  SpectrumValue& operator= (double rhs);
387
  SpectrumValue& operator= (double rhs);
402
388
403
389
404
390
405
  /**
391
  /**
392
   * \param x the operand
406
   *
393
   *
407
   * @param x the operand
394
   * \return the euclidean norm, i.e., the sum of the squares of all
408
   *
409
   * @return the euclidean norm, i.e., the sum of the squares of all
410
   * the values in x
395
   * the values in x
411
   */
396
   */
412
  friend double Norm (const SpectrumValue& x);
397
  friend double Norm (const SpectrumValue& x);
413
398
414
399
415
  /**
400
  /**
401
   * \param x the operand
416
   *
402
   *
417
   * @param x the operand
403
   * \return the sum of all
418
   *
419
   * @return the sum of all
420
   * the values in x
404
   * the values in x
421
   */
405
   */
422
  friend double Sum (const SpectrumValue& x);
406
  friend double Sum (const SpectrumValue& x);
423
407
424
408
425
  /**
409
  /**
426
   * @param x the operand
410
   * \param x the operand
427
   *
411
   *
428
   * @return the product of all
412
   * \return the product of all
429
   * the values in x
413
   * the values in x
430
   */
414
   */
431
  friend double Prod (const SpectrumValue& x);
415
  friend double Prod (const SpectrumValue& x);
432
416
433
417
434
  /**
418
  /**
419
   * \param lhs the base
420
   * \param rhs  the exponent
435
   *
421
   *
436
   *
422
   * \return each value in base raised to the exponent
437
   * @param base the base
438
   * @param exp  the exponent
439
   *
440
   * @return each value in base raised to the exponent
441
   */
423
   */
442
  friend SpectrumValue Pow (const SpectrumValue& base, double exp);
424
  friend SpectrumValue Pow (const SpectrumValue& lhs, double rhs);
443
425
444
426
445
  /**
427
  /**
428
   * \param lhs the base
429
   * \param rhs  the exponent
446
   *
430
   *
447
   *
431
   * \return the value in base raised to each value in the exponent
448
   * @param base the base
449
   * @param exp  the exponent
450
   *
451
   * @return the value in base raised to each value in the exponent
452
   */
432
   */
453
  friend SpectrumValue Pow (double base, const SpectrumValue& exp);
433
  friend SpectrumValue Pow (double lhs, const SpectrumValue& rhs);
454
434
455
  /**
435
  /**
436
   * \param arg the argument
456
   *
437
   *
457
   *
438
   * \return the logarithm in base 10 of all values in the argument
458
   * @param arg the argument
459
   *
460
   * @return the logarithm in base 10 of all values in the argument
461
   */
439
   */
462
  friend SpectrumValue Log10 (const SpectrumValue&  arg);
440
  friend SpectrumValue Log10 (const SpectrumValue& arg);
463
441
464
442
465
  /**
443
  /**
444
   * \param arg the argument
466
   *
445
   *
467
   *
446
   * \return the logarithm in base 2 of all values in the argument
468
   * @param arg the argument
469
   *
470
   * @return the logarithm in base 2 of all values in the argument
471
   */
447
   */
472
  friend SpectrumValue Log2 (const SpectrumValue&  arg);
448
  friend SpectrumValue Log2 (const SpectrumValue&  arg);
473
449
474
  /**
450
  /**
451
   * \param arg the argument
475
   *
452
   *
476
   *
453
   * \return the logarithm in base e of all values in the argument
477
   * @param arg the argument
478
   *
479
   * @return the logarithm in base e of all values in the argument
480
   */
454
   */
481
  friend SpectrumValue Log (const SpectrumValue&  arg);
455
  friend SpectrumValue Log (const SpectrumValue&  arg);
482
456
483
  /**
457
  /**
484
   *
458
   * \return a Ptr to a copy of this instance
485
   * @return a Ptr to a copy of this instance
486
   */
459
   */
487
  Ptr<SpectrumValue> Copy () const;
460
  Ptr<SpectrumValue> Copy () const;
488
461
489
462
490
491
private:
463
private:
492
  void Add (const SpectrumValue& x);
464
  void Add (const SpectrumValue& x);
493
  void Add (double s);
465
  void Add (double s);
 Lines 526-536    Link Here 
526
double Norm (const SpectrumValue& x);
498
double Norm (const SpectrumValue& x);
527
double Sum (const SpectrumValue& x);
499
double Sum (const SpectrumValue& x);
528
double Prod (const SpectrumValue& x);
500
double Prod (const SpectrumValue& x);
529
SpectrumValue Pow (const SpectrumValue& base, double exp);
501
SpectrumValue Pow (const SpectrumValue& lhs, double rhs);
530
SpectrumValue Pow (double base, const SpectrumValue& exp);
502
SpectrumValue Pow (double lhs, const SpectrumValue& rhs);
531
SpectrumValue Log10 (const SpectrumValue&  arg);
503
SpectrumValue Log10 (const SpectrumValue& arg);
532
SpectrumValue Log2 (const SpectrumValue&  arg);
504
SpectrumValue Log2 (const SpectrumValue& arg);
533
SpectrumValue Log (const SpectrumValue&  arg);
505
SpectrumValue Log (const SpectrumValue& arg);
534
506
535
507
536
} // namespace ns3
508
} // namespace ns3
(-)a/src/spectrum/model/waveform-generator.h (-6 / +6 lines)
 Lines 67-73    Link Here 
67
  /**
67
  /**
68
   * Set the Power Spectral Density used for outgoing waveforms
68
   * Set the Power Spectral Density used for outgoing waveforms
69
   *
69
   *
70
   * @param txs the Power Spectral Density
70
   * \param txs the Power Spectral Density
71
   */
71
   */
72
  void SetTxPowerSpectralDensity (Ptr<SpectrumValue> txs);
72
  void SetTxPowerSpectralDensity (Ptr<SpectrumValue> txs);
73
73
 Lines 75-81    Link Here 
75
  /**
75
  /**
76
   * Get the SpectrumType used by this PHY
76
   * Get the SpectrumType used by this PHY
77
   *
77
   *
78
   * @return
78
   * \return
79
   */
79
   */
80
  SpectrumType GetSpectrumType ();
80
  SpectrumType GetSpectrumType ();
81
81
 Lines 85-98    Link Here 
85
   * Set the period according to which the WaveformGenerator switches
85
   * Set the period according to which the WaveformGenerator switches
86
   * on and off
86
   * on and off
87
   *
87
   *
88
   * @param period
88
   * \param period
89
   */
89
   */
90
  void SetPeriod (Time period);
90
  void SetPeriod (Time period);
91
91
92
92
93
  /**
93
  /**
94
   *
94
   *
95
   * @return the value of the period according to which the WaveformGenerator switches
95
   * \return the value of the period according to which the WaveformGenerator switches
96
   * on and off
96
   * on and off
97
   */
97
   */
98
  Time GetPeriod () const;
98
  Time GetPeriod () const;
 Lines 100-112    Link Here 
100
100
101
  /**
101
  /**
102
   *
102
   *
103
   * @param value the value of the duty cycle
103
   * \param value the value of the duty cycle
104
   */
104
   */
105
  void SetDutyCycle (double value);
105
  void SetDutyCycle (double value);
106
106
107
  /**
107
  /**
108
   *
108
   *
109
   * @return the value of the duty cycle
109
   * \return the value of the duty cycle
110
   */
110
   */
111
  double GetDutyCycle () const;
111
  double GetDutyCycle () const;
112
112
(-)a/src/spectrum/model/wifi-spectrum-value-helper.h (-7 / +7 lines)
 Lines 40-58    Link Here 
40
  virtual ~WifiSpectrumValueHelper ();
40
  virtual ~WifiSpectrumValueHelper ();
41
  /*
41
  /*
42
   *
42
   *
43
   * @param value the constant value
43
   * \param value the constant value
44
   *
44
   *
45
   * @return a Ptr to a newly created SpectrumValue instance which
45
   * \return a Ptr to a newly created SpectrumValue instance which
46
   * has a constant value for all frequencies
46
   * has a constant value for all frequencies
47
   */
47
   */
48
  virtual Ptr<SpectrumValue> CreateConstant (double psd) = 0;
48
  virtual Ptr<SpectrumValue> CreateConstant (double psd) = 0;
49
49
50
  /*
50
  /*
51
   *
51
   *
52
   * @param txPower the total TX power in W
52
   * \param txPower the total TX power in W
53
   * @param channel the number of the channel
53
   * \param channel the number of the channel
54
   *
54
   *
55
   * @return a Ptr to a newly created SpectrumValue instance which
55
   * \return a Ptr to a newly created SpectrumValue instance which
56
   * represents the TX Power Spectral Density  of a wifi device
56
   * represents the TX Power Spectral Density  of a wifi device
57
   * corresponding to the provided parameters
57
   * corresponding to the provided parameters
58
   */
58
   */
 Lines 60-68    Link Here 
60
60
61
  /*
61
  /*
62
   *
62
   *
63
   * @param channel the number of the channel
63
   * \param channel the number of the channel
64
   *
64
   *
65
   * @return a Ptr to a newly created SpectrumValue instance which
65
   * \return a Ptr to a newly created SpectrumValue instance which
66
   * represents the frequency response of the RF filter which is used
66
   * represents the frequency response of the RF filter which is used
67
   * by a wifi device to receive signals when tuned to a particular channel
67
   * by a wifi device to receive signals when tuned to a particular channel
68
   */
68
   */
(-)a/src/stats/model/data-calculator.h (-2 / +2 lines)
 Lines 46-58    Link Here 
46
46
47
  /**
47
  /**
48
   * Returns the sum of the values.
48
   * Returns the sum of the values.
49
   * @see getWeightedSum()
49
   * \see getWeightedSum()
50
   */
50
   */
51
  virtual double getSum () const = 0;
51
  virtual double getSum () const = 0;
52
52
53
  /**
53
  /**
54
   * Returns the sum of the squared values.
54
   * Returns the sum of the squared values.
55
   * @see getWeightedSqrSum()
55
   * \see getWeightedSqrSum()
56
   */
56
   */
57
  virtual double getSqrSum () const = 0;
57
  virtual double getSqrSum () const = 0;
58
58
(-)a/src/tap-bridge/model/tap-bridge.h (-1 / +1 lines)
 Lines 160-166    Link Here 
160
  /**
160
  /**
161
   * Set a stop time for the device.
161
   * Set a stop time for the device.
162
   *
162
   *
163
   * @param tStop the stop time
163
   * \param tStop the stop time
164
   *
164
   *
165
   * \see TapBridge::Start
165
   * \see TapBridge::Start
166
   */
166
   */
(-)a/src/topology-read/model/rocketfuel-topology-reader.cc (-3 / +3 lines)
 Lines 51-57    Link Here 
51
  NS_LOG_FUNCTION (this);
51
  NS_LOG_FUNCTION (this);
52
}
52
}
53
53
54
/* uid @loc [+] [bb] (num_neigh) [&ext] -> <nuid-1> <nuid-2> ... {-euid} ... =name[!] rn */
54
/* uid \loc [+] [bb] (num_neigh) [&ext] -> <nuid-1> <nuid-2> ... {-euid} ... =name[!] rn */
55
55
56
#define REGMATCH_MAX 16
56
#define REGMATCH_MAX 16
57
57
 Lines 150-156    Link Here 
150
      return nodes;
150
      return nodes;
151
    }
151
    }
152
152
153
  /* uid @loc [+] [bb] (num_neigh) [&ext] -> <nuid-1> <nuid-2> ... {-euid} ... =name[!] rn */
153
  /* uid \loc [+] [bb] (num_neigh) [&ext] -> <nuid-1> <nuid-2> ... {-euid} ... =name[!] rn */
154
  NS_LOG_INFO ("Load Node[" << uid << "]: location: " << loc << " dns: " << dns
154
  NS_LOG_INFO ("Load Node[" << uid << "]: location: " << loc << " dns: " << dns
155
                            << " bb: " << bb << " neighbors: " << neigh_list.size ()
155
                            << " bb: " << bb << " neighbors: " << neigh_list.size ()
156
                            << "(" << "%d" << ") externals: \"%s\"(%d) "
156
                            << "(" << "%d" << ") externals: \"%s\"(%d) "
 Lines 200-206    Link Here 
200
NodeContainer
200
NodeContainer
201
RocketfuelTopologyReader::GenerateFromWeightsFile (int argc, char *argv[])
201
RocketfuelTopologyReader::GenerateFromWeightsFile (int argc, char *argv[])
202
{
202
{
203
  /* uid @loc [+] [bb] (num_neigh) [&ext] -> <nuid-1> <nuid-2> ... {-euid} ... =name[!] rn */
203
  /* uid \loc [+] [bb] (num_neigh) [&ext] -> <nuid-1> <nuid-2> ... {-euid} ... =name[!] rn */
204
  std::string sname;
204
  std::string sname;
205
  std::string tname;
205
  std::string tname;
206
  char *endptr;
206
  char *endptr;
(-)a/src/uan/helper/uan-helper.h (-1 / +2 lines)
 Lines 188-195    Link Here 
188
188
189
  NetDeviceContainer Install (NodeContainer c) const;
189
  NetDeviceContainer Install (NodeContainer c) const;
190
  /**
190
  /**
191
   * \param c a set of nodes
191
   * \param channel a channel to use
192
   * \param channel a channel to use
192
   * \param c a set of nodes
193
   *
193
   *
194
   * For each of the input nodes, a new ns3::UanNetDevice is attached
194
   * For each of the input nodes, a new ns3::UanNetDevice is attached
195
   * to the shared input channel. Each ns3::UanNetDevice is also
195
   * to the shared input channel. Each ns3::UanNetDevice is also
 Lines 202-207    Link Here 
202
202
203
  /**
203
  /**
204
   * \param node a node where to install the uan components
204
   * \param node a node where to install the uan components
205
   * \param channel a channel to use
205
   *
206
   *
206
   * Create a default uan stack with:
207
   * Create a default uan stack with:
207
   * - default channel, ideal propagation and default noise model
208
   * - default channel, ideal propagation and default noise model
(-)a/src/uan/model/uan-phy.h (-1 / +1 lines)
 Lines 169-175    Link Here 
169
public:
169
public:
170
  static TypeId GetTypeId (void);
170
  static TypeId GetTypeId (void);
171
171
172
  // / Enum defining possible Phy states
172
  /// Enum defining possible Phy states
173
  enum State
173
  enum State
174
  {
174
  {
175
    IDLE, CCABUSY, RX, TX, SLEEP
175
    IDLE, CCABUSY, RX, TX, SLEEP
(-)a/src/uan/model/uan-tx-mode.h (-1 / +1 lines)
 Lines 200-206    Link Here 
200
 */
200
 */
201
std::istream &operator >> (std::istream &is, UanModesList &ml);
201
std::istream &operator >> (std::istream &is, UanModesList &ml);
202
202
203
///UanModesList is attribute value
203
/// UanModesList is attribute value
204
ATTRIBUTE_HELPER_HEADER (UanModesList);
204
ATTRIBUTE_HELPER_HEADER (UanModesList);
205
205
206
} // namespace ns3
206
} // namespace ns3
(-)a/src/visualizer/visualizer/core.py (-6 / +6 lines)
 Lines 104-121    Link Here 
104
        """
104
        """
105
        Set a background SVG icon for the node.
105
        Set a background SVG icon for the node.
106
106
107
        @param file_base_name: base file name, including .svg
107
        \param file_base_name: base file name, including .svg
108
        extension, of the svg file.  Place the file in the folder
108
        extension, of the svg file.  Place the file in the folder
109
        src/contrib/visualizer/resource.
109
        src/contrib/visualizer/resource.
110
        
110
        
111
        @param width: scale to the specified width, in meters
111
        \param width: scale to the specified width, in meters
112
        @param width: scale to the specified height, in meters
112
        \param width: scale to the specified height, in meters
113
113
114
        @param align_x: horizontal alignment of the icon relative to
114
        \param align_x: horizontal alignment of the icon relative to
115
        the node position, from 0 (icon fully to the left of the node)
115
        the node position, from 0 (icon fully to the left of the node)
116
        to 1.0 (icon fully to the right of the node)
116
        to 1.0 (icon fully to the right of the node)
117
117
118
        @param align_y: vertical alignment of the icon relative to the
118
        \param align_y: vertical alignment of the icon relative to the
119
        node position, from 0 (icon fully to the top of the node) to
119
        node position, from 0 (icon fully to the top of the node) to
120
        1.0 (icon fully to the bottom of the node)
120
        1.0 (icon fully to the bottom of the node)
121
121
 Lines 298-304    Link Here 
298
        assert isinstance(link, Link)
298
        assert isinstance(link, Link)
299
        self.links.remove(link)
299
        self.links.remove(link)
300
300
301
    @property
301
    \property
302
    def has_mobility(self):
302
    def has_mobility(self):
303
        if self._has_mobility is None:
303
        if self._has_mobility is None:
304
            node = ns.network.NodeList.GetNode(self.node_index)
304
            node = ns.network.NodeList.GetNode(self.node_index)
(-)a/src/wifi/helper/athstats-helper.h (-34 / +34 lines)
 Lines 38-44    Link Here 
38
class NetDevice;
38
class NetDevice;
39
39
40
/**
40
/**
41
 * @brief create AthstatsWifiTraceSink instances and connect them to wifi devices
41
 * \brief create AthstatsWifiTraceSink instances and connect them to wifi devices
42
 *
42
 *
43
 *
43
 *
44
 */
44
 */
 Lines 59-65    Link Here 
59
59
60
60
61
/**
61
/**
62
 * @brief trace sink for wifi device that mimics madwifi's athstats tool.
62
 * \brief trace sink for wifi device that mimics madwifi's athstats tool.
63
 *
63
 *
64
 * The AthstatsWifiTraceSink class is a trace sink to be connected to several of the traces
64
 * The AthstatsWifiTraceSink class is a trace sink to be connected to several of the traces
65
 * available within a wifi device. The purpose of AthstatsWifiTraceSink is to
65
 * available within a wifi device. The purpose of AthstatsWifiTraceSink is to
 Lines 90-105    Link Here 
90
  /**
90
  /**
91
   * function to be called when the net device transmits a packet
91
   * function to be called when the net device transmits a packet
92
   *
92
   *
93
   * @param context
93
   * \param context
94
   * @param p the packet being transmitted
94
   * \param p the packet being transmitted
95
   */
95
   */
96
  void DevTxTrace (std::string context, Ptr<const Packet> p);
96
  void DevTxTrace (std::string context, Ptr<const Packet> p);
97
97
98
  /**
98
  /**
99
   * function to be called when the net device receives a packet
99
   * function to be called when the net device receives a packet
100
   *
100
   *
101
   * @param context
101
   * \param context
102
   * @param p the packet being received
102
   * \param p the packet being received
103
   */
103
   */
104
  void DevRxTrace (std::string context, Ptr<const Packet> p);
104
  void DevRxTrace (std::string context, Ptr<const Packet> p);
105
105
 Lines 107-114    Link Here 
107
   * Function to be called when a RTS frame transmission by the considered
107
   * Function to be called when a RTS frame transmission by the considered
108
   * device has failed
108
   * device has failed
109
   *
109
   *
110
   * @param context
110
   * \param context
111
   * @param address the MAC address of the remote station
111
   * \param address the MAC address of the remote station
112
   */
112
   */
113
  void TxRtsFailedTrace (std::string context, Mac48Address address);
113
  void TxRtsFailedTrace (std::string context, Mac48Address address);
114
114
 Lines 116-123    Link Here 
116
   * Function to be called when a data frame transmission by the considered
116
   * Function to be called when a data frame transmission by the considered
117
   * device has failed
117
   * device has failed
118
   *
118
   *
119
   * @param context
119
   * \param context
120
   * @param address the MAC address of the remote station
120
   * \param address the MAC address of the remote station
121
   */
121
   */
122
  void TxDataFailedTrace (std::string context, Mac48Address address);
122
  void TxDataFailedTrace (std::string context, Mac48Address address);
123
123
 Lines 125-132    Link Here 
125
   * Function to be called when the transmission of a RTS frame has
125
   * Function to be called when the transmission of a RTS frame has
126
   * exceeded the retry limit
126
   * exceeded the retry limit
127
   *
127
   *
128
   * @param context
128
   * \param context
129
   * @param address the MAC address of the remote station
129
   * \param address the MAC address of the remote station
130
   */
130
   */
131
  void TxFinalRtsFailedTrace (std::string context, Mac48Address address);
131
  void TxFinalRtsFailedTrace (std::string context, Mac48Address address);
132
132
 Lines 134-141    Link Here 
134
   * Function to be called when the transmission of a data frame has
134
   * Function to be called when the transmission of a data frame has
135
   * exceeded the retry limit
135
   * exceeded the retry limit
136
   *
136
   *
137
   * @param context
137
   * \param context
138
   * @param address the MAC address of the remote station
138
   * \param address the MAC address of the remote station
139
   */
139
   */
140
  void TxFinalDataFailedTrace (std::string context, Mac48Address address);
140
  void TxFinalDataFailedTrace (std::string context, Mac48Address address);
141
141
 Lines 143-153    Link Here 
143
   * Function to be called when the PHY layer  of the considered
143
   * Function to be called when the PHY layer  of the considered
144
   * device receives a frame
144
   * device receives a frame
145
   *
145
   *
146
   * @param context
146
   * \param context
147
   * @param packet
147
   * \param packet
148
   * @param snr
148
   * \param snr
149
   * @param mode
149
   * \param mode
150
   * @param preamble
150
   * \param preamble
151
   */
151
   */
152
  void PhyRxOkTrace (std::string context, Ptr<const Packet> packet, double snr, WifiMode mode, enum WifiPreamble preamble);
152
  void PhyRxOkTrace (std::string context, Ptr<const Packet> packet, double snr, WifiMode mode, enum WifiPreamble preamble);
153
153
 Lines 156-164    Link Here 
156
   * layer  of the considered device resulted in an error due to a failure in the CRC check of
156
   * layer  of the considered device resulted in an error due to a failure in the CRC check of
157
   * the frame
157
   * the frame
158
   *
158
   *
159
   * @param context
159
   * \param context
160
   * @param packet
160
   * \param packet
161
   * @param snr
161
   * \param snr
162
   */
162
   */
163
  void PhyRxErrorTrace (std::string context, Ptr<const Packet> packet, double snr);
163
  void PhyRxErrorTrace (std::string context, Ptr<const Packet> packet, double snr);
164
164
 Lines 166-176    Link Here 
166
   * Function to be called when a frame is being transmitted by the
166
   * Function to be called when a frame is being transmitted by the
167
   * PHY layer of the considered device
167
   * PHY layer of the considered device
168
   *
168
   *
169
   * @param context
169
   * \param context
170
   * @param packet
170
   * \param packet
171
   * @param mode
171
   * \param mode
172
   * @param preamble
172
   * \param preamble
173
   * @param txPower
173
   * \param txPower
174
   */
174
   */
175
  void PhyTxTrace (std::string context, Ptr<const Packet> packet, WifiMode mode, WifiPreamble preamble, uint8_t txPower);
175
  void PhyTxTrace (std::string context, Ptr<const Packet> packet, WifiMode mode, WifiPreamble preamble, uint8_t txPower);
176
176
 Lines 178-205    Link Here 
178
   * Function to be called when the PHY layer of the considered device
178
   * Function to be called when the PHY layer of the considered device
179
   * changes state
179
   * changes state
180
   *
180
   *
181
   * @param context
181
   * \param context
182
   * @param start
182
   * \param start
183
   * @param duration
183
   * \param duration
184
   * @param state
184
   * \param state
185
   */
185
   */
186
  void PhyStateTrace (std::string context, Time start, Time duration, enum WifiPhy::State state);
186
  void PhyStateTrace (std::string context, Time start, Time duration, enum WifiPhy::State state);
187
187
188
  /**
188
  /**
189
   * Open a file for output
189
   * Open a file for output
190
   *
190
   *
191
   * @param name the name of the file to be opened.
191
   * \param name the name of the file to be opened.
192
   */
192
   */
193
  void Open (std::string const& name);
193
  void Open (std::string const& name);
194
194
195
private:
195
private:
196
  /**
196
  /**
197
   * @internal
197
   * \internal
198
   */
198
   */
199
  void WriteStats ();
199
  void WriteStats ();
200
200
201
  /**
201
  /**
202
   * @internal
202
   * \internal
203
   */
203
   */
204
  void ResetCounters ();
204
  void ResetCounters ();
205
205
(-)a/src/wifi/helper/yans-wifi-helper.h (-7 / +7 lines)
 Lines 224-232    Link Here 
224
   * called before EnablePcap(), so that the header of the pcap file can be
224
   * called before EnablePcap(), so that the header of the pcap file can be
225
   * written correctly.
225
   * written correctly.
226
   *
226
   *
227
   * @see SupportedPcapDataLinkTypes
227
   * \see SupportedPcapDataLinkTypes
228
   *
228
   *
229
   * @param dlt The data link type of the pcap file (and packets) to be used
229
   * \param dlt The data link type of the pcap file (and packets) to be used
230
   */
230
   */
231
  void SetPcapDataLinkType (enum SupportedPcapDataLinkTypes dlt);
231
  void SetPcapDataLinkType (enum SupportedPcapDataLinkTypes dlt);
232
232
 Lines 241-255    Link Here 
241
  virtual Ptr<WifiPhy> Create (Ptr<Node> node, Ptr<WifiNetDevice> device) const;
241
  virtual Ptr<WifiPhy> Create (Ptr<Node> node, Ptr<WifiNetDevice> device) const;
242
242
243
  /**
243
  /**
244
   * @brief Enable pcap output the indicated net device.
244
   * \brief Enable pcap output the indicated net device.
245
   *
245
   *
246
   * NetDevice-specific implementation mechanism for hooking the trace and
246
   * NetDevice-specific implementation mechanism for hooking the trace and
247
   * writing to the trace file.
247
   * writing to the trace file.
248
   *
248
   *
249
   * @param prefix Filename prefix to use for pcap files.
249
   * \param prefix Filename prefix to use for pcap files.
250
   * @param nd Net device for which you want to enable tracing.
250
   * \param nd Net device for which you want to enable tracing.
251
   * @param promiscuous If true capture all possible packets available at the device.
251
   * \param promiscuous If true capture all possible packets available at the device.
252
   * @param explicitFilename Treat the prefix as an explicit filename if true
252
   * \param explicitFilename Treat the prefix as an explicit filename if true
253
   */
253
   */
254
  virtual void EnablePcapInternal (std::string prefix,
254
  virtual void EnablePcapInternal (std::string prefix,
255
                                   Ptr<NetDevice> nd,
255
                                   Ptr<NetDevice> nd,
(-)a/src/wifi/model/interference-helper.h (-1 / +1 lines)
 Lines 121-127    Link Here 
121
121
122
  double m_noiseFigure; /**< noise figure (linear) */
122
  double m_noiseFigure; /**< noise figure (linear) */
123
  Ptr<ErrorRateModel> m_errorRateModel;
123
  Ptr<ErrorRateModel> m_errorRateModel;
124
  ///Experimental: needed for energy duration calculation
124
  /// Experimental: needed for energy duration calculation
125
  NiChanges m_niChanges;
125
  NiChanges m_niChanges;
126
  double m_firstPower;
126
  double m_firstPower;
127
  bool m_rxing;
127
  bool m_rxing;
(-)a/src/wifi/model/qos-tag.h (-2 / +2 lines)
 Lines 79-85    Link Here 
79
   * application is aware of the QoS support provided by the MAC
79
   * application is aware of the QoS support provided by the MAC
80
   * layer, and is therefore able to set the correct TID.
80
   * layer, and is therefore able to set the correct TID.
81
   *
81
   *
82
   * @param tid the value of the TID to set
82
   * \param tid the value of the TID to set
83
   */
83
   */
84
  void SetTid (uint8_t tid);
84
  void SetTid (uint8_t tid);
85
85
 Lines 90-96    Link Here 
90
   * EDCA is used. When using HDCA, QosTag(uint8_t tid) should be used
90
   * EDCA is used. When using HDCA, QosTag(uint8_t tid) should be used
91
   * instead.
91
   * instead.
92
   *
92
   *
93
   * @param up the requested UserPriority
93
   * \param up the requested UserPriority
94
   *
94
   *
95
   */
95
   */
96
  void SetUserPriority (UserPriority up);
96
  void SetUserPriority (UserPriority up);
(-)a/src/wifi/model/wifi-information-element-vector.h (-5 / +5 lines)
 Lines 46-52    Link Here 
46
  WifiInformationElementVector ();
46
  WifiInformationElementVector ();
47
  ~WifiInformationElementVector ();
47
  ~WifiInformationElementVector ();
48
  ///\name Inherited from Header
48
  ///\name Inherited from Header
49
  //\{
49
  // \{
50
  static TypeId GetTypeId ();
50
  static TypeId GetTypeId ();
51
  TypeId GetInstanceTypeId () const;
51
  TypeId GetInstanceTypeId () const;
52
  virtual uint32_t GetSerializedSize () const;
52
  virtual uint32_t GetSerializedSize () const;
 Lines 54-72    Link Here 
54
  /**
54
  /**
55
   * \attention When you use RemoveHeader, WifiInformationElementVector supposes, that
55
   * \attention When you use RemoveHeader, WifiInformationElementVector supposes, that
56
   * all buffer consists of information elements
56
   * all buffer consists of information elements
57
   * @param start
57
   * \param start
58
   * @return
58
   * \return
59
   */
59
   */
60
  virtual uint32_t Deserialize (Buffer::Iterator start);
60
  virtual uint32_t Deserialize (Buffer::Iterator start);
61
  virtual void Print (std::ostream &os) const;
61
  virtual void Print (std::ostream &os) const;
62
  //\}
62
  // \}
63
  /**
63
  /**
64
   * \brief Needed when you try to deserialize a lonely IE inside other header
64
   * \brief Needed when you try to deserialize a lonely IE inside other header
65
   * \param start is the start of the buffer
65
   * \param start is the start of the buffer
66
   * \return deserialized bytes
66
   * \return deserialized bytes
67
   */
67
   */
68
  virtual uint32_t DeserializeSingleIe (Buffer::Iterator start);
68
  virtual uint32_t DeserializeSingleIe (Buffer::Iterator start);
69
  ///Set maximum size to control overflow of the max packet length
69
  /// Set maximum size to control overflow of the max packet length
70
  void SetMaxSize (uint16_t size);
70
  void SetMaxSize (uint16_t size);
71
  /// As soon as this is a vector, we define an Iterator
71
  /// As soon as this is a vector, we define an Iterator
72
  typedef std::vector<Ptr<WifiInformationElement> >::iterator Iterator;
72
  typedef std::vector<Ptr<WifiInformationElement> >::iterator Iterator;
(-)a/src/wifi/model/wifi-phy.h (-17 / +15 lines)
 Lines 252-262    Link Here 
252
   */
252
   */
253
  static WifiMode GetPlcpHeaderMode (WifiMode payloadMode, WifiPreamble preamble);
253
  static WifiMode GetPlcpHeaderMode (WifiMode payloadMode, WifiPreamble preamble);
254
254
255
  /** 
255
  /**
256
   * 
257
   * 
258
   * \param payloadMode the WifiMode use for the transmission of the payload
256
   * \param payloadMode the WifiMode use for the transmission of the payload
259
   * \param preamble the type of preamble 
257
   * \param preamble the type of preamble
260
   * 
258
   * 
261
   * \return the duration of the PLCP header in microseconds
259
   * \return the duration of the PLCP header in microseconds
262
   */
260
   */
 Lines 271-278    Link Here 
271
  static uint32_t GetPlcpPreambleDurationMicroSeconds (WifiMode payloadMode, WifiPreamble preamble);
269
  static uint32_t GetPlcpPreambleDurationMicroSeconds (WifiMode payloadMode, WifiPreamble preamble);
272
270
273
  /** 
271
  /** 
272
   * \param size the number of bytes in the packet to send
274
   * \param payloadMode the WifiMode use for the transmission of the payload
273
   * \param payloadMode the WifiMode use for the transmission of the payload
275
   * \param preamble the type of preamble 
276
   * 
274
   * 
277
   * \return the duration of the payload in microseconds
275
   * \return the duration of the payload in microseconds
278
   */
276
   */
 Lines 418-437    Link Here 
418
   * Public method used to fire a MonitorSniffer trace for a wifi packet being received.  Implemented for encapsulation
416
   * Public method used to fire a MonitorSniffer trace for a wifi packet being received.  Implemented for encapsulation
419
   * purposes.
417
   * purposes.
420
   *
418
   *
421
   * @param packet the packet being received
419
   * \param packet the packet being received
422
   * @param channelFreqMhz the frequency in MHz at which the packet is
420
   * \param channelFreqMhz the frequency in MHz at which the packet is
423
   * received. Note that in real devices this is normally the
421
   * received. Note that in real devices this is normally the
424
   * frequency to which  the receiver is tuned, and this can be
422
   * frequency to which  the receiver is tuned, and this can be
425
   * different than the frequency at which the packet was originally
423
   * different than the frequency at which the packet was originally
426
   * transmitted. This is because it is possible to have the receiver
424
   * transmitted. This is because it is possible to have the receiver
427
   * tuned on a given channel and still to be able to receive packets
425
   * tuned on a given channel and still to be able to receive packets
428
   * on a nearby channel.
426
   * on a nearby channel.
429
   * @param channelNumber the channel on which the packet is received
427
   * \param channelNumber the channel on which the packet is received
430
   * @param rate the PHY data rate in units of 500kbps (i.e., the same
428
   * \param rate the PHY data rate in units of 500kbps (i.e., the same
431
   * units used both for the radiotap and for the prism header)
429
   * units used both for the radiotap and for the prism header)
432
   * @param isShortPreamble true if short preamble is used, false otherwise
430
   * \param isShortPreamble true if short preamble is used, false otherwise
433
   * @param signalDbm signal power in dBm
431
   * \param signalDbm signal power in dBm
434
   * @param noiseDbm  noise power in dBm
432
   * \param noiseDbm  noise power in dBm
435
   */
433
   */
436
  void NotifyMonitorSniffRx (Ptr<const Packet> packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, bool isShortPreamble,
434
  void NotifyMonitorSniffRx (Ptr<const Packet> packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, bool isShortPreamble,
437
                             double signalDbm, double noiseDbm);
435
                             double signalDbm, double noiseDbm);
 Lines 441-453    Link Here 
441
   * Public method used to fire a MonitorSniffer trace for a wifi packet being transmitted.  Implemented for encapsulation
439
   * Public method used to fire a MonitorSniffer trace for a wifi packet being transmitted.  Implemented for encapsulation
442
   * purposes.
440
   * purposes.
443
   *
441
   *
444
   * @param packet the packet being transmitted
442
   * \param packet the packet being transmitted
445
   * @param channelFreqMhz the frequency in MHz at which the packet is
443
   * \param channelFreqMhz the frequency in MHz at which the packet is
446
   * transmitted.
444
   * transmitted.
447
   * @param channelNumber the channel on which the packet is transmitted
445
   * \param channelNumber the channel on which the packet is transmitted
448
   * @param rate the PHY data rate in units of 500kbps (i.e., the same
446
   * \param rate the PHY data rate in units of 500kbps (i.e., the same
449
   * units used both for the radiotap and for the prism header)
447
   * units used both for the radiotap and for the prism header)
450
   * @param isShortPreamble true if short preamble is used, false otherwise
448
   * \param isShortPreamble true if short preamble is used, false otherwise
451
   */
449
   */
452
  void NotifyMonitorSniffTx (Ptr<const Packet> packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, bool isShortPreamble);
450
  void NotifyMonitorSniffTx (Ptr<const Packet> packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, bool isShortPreamble);
453
451
(-)a/src/wifi/model/wifi-remote-station-manager.h (-3 / +3 lines)
 Lines 64-80    Link Here 
64
   * because it resets time of last update.
64
   * because it resets time of last update.
65
   */
65
   */
66
  double CalculateAveragingCoefficient ();
66
  double CalculateAveragingCoefficient ();
67
  ///averaging coefficient depends on the memory time
67
  /// averaging coefficient depends on the memory time
68
  Time m_memoryTime;
68
  Time m_memoryTime;
69
  ///when last update has occured
69
  /// when last update has occured
70
  Time m_lastUpdate;
70
  Time m_lastUpdate;
71
  /// moving percentage of failed frames
71
  /// moving percentage of failed frames
72
  double m_failAvg;
72
  double m_failAvg;
73
};
73
};
74
74
75
/**
75
/**
76
 * \ingroup wifi
76
 * \brief hold a list of per-remote-station state.
77
 * \brief hold a list of per-remote-station state.
77
 * \ingroup wifi
78
 *
78
 *
79
 * \sa ns3::WifiRemoteStation.
79
 * \sa ns3::WifiRemoteStation.
80
 */
80
 */
(-)a/src/wifi/test/tx-duration-test.cc (-9 / +9 lines)
 Lines 41-51    Link Here 
41
   * Check if the payload tx duration returned by InterferenceHelper
41
   * Check if the payload tx duration returned by InterferenceHelper
42
   * corresponds to a known value of the pay
42
   * corresponds to a known value of the pay
43
   *
43
   *
44
   * @param size size of payload in octets (includes everything after the PLCP header)
44
   * \param size size of payload in octets (includes everything after the PLCP header)
45
   * @param payloadMode the WifiMode used
45
   * \param payloadMode the WifiMode used
46
   * @param knownPlcpLengthFieldValue the known value of the Length field in the PLCP header
46
   * \param knownPlcpLengthFieldValue the known value of the Length field in the PLCP header
47
   *
47
   *
48
   * @return true if values correspond, false otherwise
48
   * \return true if values correspond, false otherwise
49
   */
49
   */
50
  bool CheckPayloadDuration (uint32_t size, WifiMode payloadMode,  uint32_t knownDurationMicroSeconds);
50
  bool CheckPayloadDuration (uint32_t size, WifiMode payloadMode,  uint32_t knownDurationMicroSeconds);
51
51
 Lines 53-64    Link Here 
53
   * Check if the overall tx duration returned by InterferenceHelper
53
   * Check if the overall tx duration returned by InterferenceHelper
54
   * corresponds to a known value of the pay
54
   * corresponds to a known value of the pay
55
   *
55
   *
56
   * @param size size of payload in octets (includes everything after the PLCP header)
56
   * \param size size of payload in octets (includes everything after the PLCP header)
57
   * @param payloadMode the WifiMode used
57
   * \param payloadMode the WifiMode used
58
   * @param preamble the WifiPreamble used
58
   * \param preamble the WifiPreamble used
59
   * @param knownPlcpLengthFieldValue the known value of the Length field in the PLCP header
59
   * \param knownPlcpLengthFieldValue the known value of the Length field in the PLCP header
60
   *
60
   *
61
   * @return true if values correspond, false otherwise
61
   * \return true if values correspond, false otherwise
62
   */
62
   */
63
  bool CheckTxDuration (uint32_t size, WifiMode payloadMode,  WifiPreamble preamble, uint32_t knownDurationMicroSeconds);
63
  bool CheckTxDuration (uint32_t size, WifiMode payloadMode,  WifiPreamble preamble, uint32_t knownDurationMicroSeconds);
64
64
(-)a/src/wimax/model/bs-scheduler-rtps.cc (-14 / +14 lines)
 Lines 110-132    Link Here 
110
  m_downlinkBursts->push_back (std::make_pair (dlMapIe, burst));
110
  m_downlinkBursts->push_back (std::make_pair (dlMapIe, burst));
111
}
111
}
112
112
113
/**
114
 * \brief A DownLink Scheduler for rtPS Flows
115
 *
116
 * The DL Scheduler assigns the available bandwidth in the following order:
117
 * - IR Connections
118
 * - Broadcast Connections
119
 * - Basic and Primary Connections
120
 * - UGS Connections
121
 * - rtPS Connections
122
 * - nrtPS Connections
123
 * - BE Connections
124
 * All rtPS flows that have packets in the queue can transmit at least one
125
 * packet, according to the available bandwidth.
126
 */
113
void
127
void
114
BSSchedulerRtps::Schedule (void)
128
BSSchedulerRtps::Schedule (void)
115
{
129
{
116
  /**
117
   * \brief  A DownLink Scheduler for rtPS Flows
118
   *
119
   * The DL Scheduler assigns the available bandwidth in the following order:
120
   *         - IR Connections
121
   *         - Broadcast Connections
122
   *         - Basic and Primary Connections
123
   *         - UGS Connections
124
   * - rtPS Connections
125
   *         - nrtPS Connections
126
   *         - BE Connections
127
   * All rtPS flows that have packets in the queue can transmit at least one
128
   * packet, according to the available bandwidth.
129
   */
130
130
131
  uint32_t availableSymbols = GetBs ()->GetNrDlSymbols ();
131
  uint32_t availableSymbols = GetBs ()->GetNrDlSymbols ();
132
132

Return to bug 938