doxygen: fix warnings in various modules

This commit is contained in:
Tommaso Pecorella
2022-01-05 00:22:31 -06:00
parent ee43ff631c
commit a8fc1b6235
40 changed files with 820 additions and 257 deletions

View File

@@ -64,11 +64,11 @@ GridBuildingAllocator::GetTypeId (void)
DoubleValue (0.0), DoubleValue (0.0),
MakeDoubleAccessor (&GridBuildingAllocator::m_yMin), MakeDoubleAccessor (&GridBuildingAllocator::m_yMin),
MakeDoubleChecker<double> ()) MakeDoubleChecker<double> ())
.AddAttribute ("LengthX", " the length of the wall of each building along the X axis.", .AddAttribute ("LengthX", "The length of the wall of each building along the X axis.",
DoubleValue (1.0), DoubleValue (1.0),
MakeDoubleAccessor (&GridBuildingAllocator::m_lengthX), MakeDoubleAccessor (&GridBuildingAllocator::m_lengthX),
MakeDoubleChecker<double> ()) MakeDoubleChecker<double> ())
.AddAttribute ("LengthY", " the length of the wall of each building along the X axis.", .AddAttribute ("LengthY", "The length of the wall of each building along the X axis.",
DoubleValue (1.0), DoubleValue (1.0),
MakeDoubleAccessor (&GridBuildingAllocator::m_lengthY), MakeDoubleAccessor (&GridBuildingAllocator::m_lengthY),
MakeDoubleChecker<double> ()) MakeDoubleChecker<double> ())

View File

@@ -47,7 +47,10 @@ public:
GridBuildingAllocator (); GridBuildingAllocator ();
virtual ~GridBuildingAllocator (); virtual ~GridBuildingAllocator ();
// inherited from Object /**
* \brief Get the type ID.
* \return The object TypeId.
*/
static TypeId GetTypeId (void); static TypeId GetTypeId (void);
/** /**
@@ -68,22 +71,25 @@ public:
BuildingContainer Create (uint32_t n) const; BuildingContainer Create (uint32_t n) const;
private: private:
/**
* Pushes the attributes into the relevant position allocators
*/
void PushAttributes () const; void PushAttributes () const;
mutable uint32_t m_current;
enum GridPositionAllocator::LayoutType m_layoutType;
double m_xMin;
double m_yMin;
uint32_t m_n;
double m_lengthX;
double m_lengthY;
double m_deltaX;
double m_deltaY;
double m_height;
mutable ObjectFactory m_buildingFactory; mutable uint32_t m_current; //!< current building number
Ptr<GridPositionAllocator> m_lowerLeftPositionAllocator; enum GridPositionAllocator::LayoutType m_layoutType; //!< Layout type
Ptr<GridPositionAllocator> m_upperRightPositionAllocator; double m_xMin; //!< The x coordinate where the grid starts
double m_yMin; //!< The y coordinate where the grid starts
uint32_t m_n; //!< The number of objects laid out on a line
double m_lengthX; //!< The length of the wall of each building along the X axis.
double m_lengthY; //!< The length of the wall of each building along the Y axis.
double m_deltaX; //!< The x space between buildings
double m_deltaY; //!< The y space between buildings
double m_height; //!< The height of the building (roof level)
mutable ObjectFactory m_buildingFactory; //!< The building factory
Ptr<GridPositionAllocator> m_lowerLeftPositionAllocator; //!< The upper left position allocator
Ptr<GridPositionAllocator> m_upperRightPositionAllocator; //!< The upper right position allocator
}; };

View File

@@ -40,6 +40,7 @@ namespace ns3 {
class BuildingContainer class BuildingContainer
{ {
public: public:
/// Const iterator
typedef std::vector<Ptr<Building> >::const_iterator Iterator; typedef std::vector<Ptr<Building> >::const_iterator Iterator;
/** /**
@@ -200,7 +201,7 @@ public:
static BuildingContainer GetGlobal (void); static BuildingContainer GetGlobal (void);
private: private:
std::vector<Ptr<Building> > m_buildings; std::vector<Ptr<Building> > m_buildings; //!< Building container
}; };
} // namespace ns3 } // namespace ns3

View File

@@ -35,14 +35,16 @@ class UniformRandomVariable;
/** /**
* Allocate each position by randomly choosing a building from the list * Allocate each position by randomly choosing a building from the list
* of all buildings, and then randomly choosing a position inside the building. * of all buildings, and then randomly choosing a position inside the building.
*
*/ */
class RandomBuildingPositionAllocator : public PositionAllocator class RandomBuildingPositionAllocator : public PositionAllocator
{ {
public: public:
RandomBuildingPositionAllocator (); RandomBuildingPositionAllocator ();
// inherited from Object /**
* \brief Get the type ID.
* \return The object TypeId.
*/
static TypeId GetTypeId (void); static TypeId GetTypeId (void);
// inherited from PositionAllocator // inherited from PositionAllocator
@@ -60,8 +62,8 @@ public:
private: private:
bool m_withReplacement; bool m_withReplacement; //!< If true, the building will be randomly selected with replacement
mutable std::vector< Ptr<Building> > m_buildingListWithoutReplacement; mutable std::vector< Ptr<Building> > m_buildingListWithoutReplacement; //!< List of building without replacement
/// Provides uniform random variables. /// Provides uniform random variables.
Ptr<UniformRandomVariable> m_rand; Ptr<UniformRandomVariable> m_rand;
@@ -86,7 +88,10 @@ class OutdoorPositionAllocator : public PositionAllocator
public: public:
OutdoorPositionAllocator (); OutdoorPositionAllocator ();
// inherited from Object /**
* \brief Get the type ID.
* \return The object TypeId.
*/
static TypeId GetTypeId (void); static TypeId GetTypeId (void);
// inherited from PositionAllocator // inherited from PositionAllocator
@@ -137,7 +142,10 @@ class RandomRoomPositionAllocator : public PositionAllocator
public: public:
RandomRoomPositionAllocator (); RandomRoomPositionAllocator ();
// inherited from Object /**
* \brief Get the type ID.
* \return The object TypeId.
*/
static TypeId GetTypeId (void); static TypeId GetTypeId (void);
// inherited from PositionAllocator // inherited from PositionAllocator
@@ -155,14 +163,17 @@ public:
private: private:
/**
* Room informations
*/
struct RoomInfo struct RoomInfo
{ {
Ptr<Building> b; Ptr<Building> b; //!< Building
uint32_t roomx; uint32_t roomx; //!< Room (x coord)
uint32_t roomy; uint32_t roomy; //!< Room (y coord)
uint32_t floor; uint32_t floor; //!< Room (floor number)
}; };
mutable std::vector<RoomInfo> m_roomListWithoutReplacement; mutable std::vector<RoomInfo> m_roomListWithoutReplacement; //!< Container of rooms
/// Provides uniform random variables. /// Provides uniform random variables.
Ptr<UniformRandomVariable> m_rand; Ptr<UniformRandomVariable> m_rand;
@@ -179,9 +190,17 @@ class SameRoomPositionAllocator : public PositionAllocator
{ {
public: public:
SameRoomPositionAllocator (); SameRoomPositionAllocator ();
/**
* Constructor
* \param c Node container
*/
SameRoomPositionAllocator (NodeContainer c); SameRoomPositionAllocator (NodeContainer c);
// inherited from Object /**
* \brief Get the type ID.
* \return The object TypeId.
*/
static TypeId GetTypeId (void); static TypeId GetTypeId (void);
// inherited from PositionAllocator // inherited from PositionAllocator
@@ -199,8 +218,8 @@ public:
private: private:
NodeContainer m_nodes; NodeContainer m_nodes; //!< Nodes container
mutable NodeContainer::Iterator m_nodeIt; mutable NodeContainer::Iterator m_nodeIt; //!< Nodes iterator
/// Provides uniform random variables. /// Provides uniform random variables.
Ptr<UniformRandomVariable> m_rand; Ptr<UniformRandomVariable> m_rand;
@@ -227,7 +246,10 @@ public:
uint32_t y, uint32_t y,
uint32_t z, uint32_t z,
Ptr<Building> b); Ptr<Building> b);
// inherited from Object /**
* \brief Get the type ID.
* \return The object TypeId.
*/
static TypeId GetTypeId (void); static TypeId GetTypeId (void);
// inherited from PositionAllocator // inherited from PositionAllocator
virtual Vector GetNext (void) const; virtual Vector GetNext (void) const;
@@ -244,11 +266,11 @@ public:
private: private:
uint32_t roomx; uint32_t roomx; //!< Index of the room on the x-axis
uint32_t roomy; uint32_t roomy; //!< Index of the room on the y-axis
uint32_t floor; uint32_t floor; //!< Index of the room on the z-axis (i.e., floor number)
Ptr<Building> bptr; Ptr<Building> bptr; //!< Pointer to the chosen building
/// Provides uniform random variables. /// Provides uniform random variables.
Ptr<UniformRandomVariable> m_rand; Ptr<UniformRandomVariable> m_rand;

View File

@@ -48,11 +48,8 @@ BuildingsHelper::Install (Ptr<Node> node)
{ {
Ptr<Object> object = node; Ptr<Object> object = node;
Ptr<MobilityModel> model = object->GetObject<MobilityModel> (); Ptr<MobilityModel> model = object->GetObject<MobilityModel> ();
if (model == 0)
{
NS_ABORT_MSG_UNLESS (0 != model, "node " << node->GetId () << " does not have a MobilityModel");
} NS_ABORT_MSG_UNLESS (0 != model, "node " << node->GetId () << " does not have a MobilityModel");
Ptr<MobilityBuildingInfo> buildingInfo = CreateObject<MobilityBuildingInfo> (); Ptr<MobilityBuildingInfo> buildingInfo = CreateObject<MobilityBuildingInfo> ();
model->AggregateObject (buildingInfo); model->AggregateObject (buildingInfo);

View File

@@ -33,6 +33,9 @@ namespace ns3 {
class MobilityModel; class MobilityModel;
class Building; class Building;
/**
* Helper used to install a MobilityBuildingInfo into a set of nodes.
*/
class BuildingsHelper class BuildingsHelper
{ {
public: public:

View File

@@ -38,23 +38,66 @@ NS_LOG_COMPONENT_DEFINE ("BuildingList");
class BuildingListPriv : public Object class BuildingListPriv : public Object
{ {
public: public:
/**
* \brief Get the type ID.
* \return The object TypeId.
*/
static TypeId GetTypeId (void); static TypeId GetTypeId (void);
BuildingListPriv (); BuildingListPriv ();
~BuildingListPriv (); ~BuildingListPriv ();
/**
* Add a Building to the list.
*
* \param building building to add
* \returns index of building in list.
*/
uint32_t Add (Ptr<Building> building); uint32_t Add (Ptr<Building> building);
/**
* Returns an interator to the start of the list.
*
* \returns iterator to the begin of the container.
*/
BuildingList::Iterator Begin (void) const; BuildingList::Iterator Begin (void) const;
/**
* Returns an interator to the end of the list.
*
* \returns iterator to the end of the container.
*/
BuildingList::Iterator End (void) const; BuildingList::Iterator End (void) const;
/**
* Gets the n-th Building in the container
* \param n Building position
* \returns a pointer to the Building
*/
Ptr<Building> GetBuilding (uint32_t n); Ptr<Building> GetBuilding (uint32_t n);
/**
* Gets the number of Building in the container
* \returns the container size
*/
uint32_t GetNBuildings (void); uint32_t GetNBuildings (void);
/**
* Get the Singleton instance of BuildingListPriv (or create one)
* \return the BuildingListPriv instance
*/
static Ptr<BuildingListPriv> Get (void); static Ptr<BuildingListPriv> Get (void);
private: private:
virtual void DoDispose (void); virtual void DoDispose (void);
/**
* Get the Singleton instance of BuildingListPriv (or create one)
* \return the BuildingListPriv instance
*/
static Ptr<BuildingListPriv> *DoGet (void); static Ptr<BuildingListPriv> *DoGet (void);
/**
* Dispose the Singleton instance of BuildingListPriv.
*
* \note: this function is automatically called at the simulation end.
*
*/
static void Delete (void); static void Delete (void);
std::vector<Ptr<Building> > m_buildings; std::vector<Ptr<Building> > m_buildings; //!< Container of Building
}; };
NS_OBJECT_ENSURE_REGISTERED (BuildingListPriv); NS_OBJECT_ENSURE_REGISTERED (BuildingListPriv);

View File

@@ -30,9 +30,13 @@ namespace ns3 {
class Building; class Building;
/**
* Container for Building class
*/
class BuildingList class BuildingList
{ {
public: public:
/// Const Iterator
typedef std::vector< Ptr<Building> >::const_iterator Iterator; typedef std::vector< Ptr<Building> >::const_iterator Iterator;
/** /**

View File

@@ -38,15 +38,23 @@ class Building : public Object
{ {
public: public:
// inherited from Object /**
* \brief Get the type ID.
* \return The object TypeId.
*/
static TypeId GetTypeId (void); static TypeId GetTypeId (void);
virtual void DoDispose (); virtual void DoDispose ();
/**
* Building type enum
*/
enum BuildingType_t enum BuildingType_t
{ {
Residential, Office, Commercial Residential, Office, Commercial
}; };
/**
* External building wall type enum
*/
enum ExtWallsType_t enum ExtWallsType_t
{ {
Wood, ConcreteWithWindows, ConcreteWithoutWindows, StoneBlocks Wood, ConcreteWithWindows, ConcreteWithoutWindows, StoneBlocks
@@ -215,19 +223,19 @@ public:
private: private:
Box m_buildingBounds; Box m_buildingBounds; //!< Building boundaries
/** /**
* number of floors, must be greater than 0, and 1 means only one floor * number of floors, must be greater than 0, and 1 means only one floor
* (i.e., groundfloor) * (i.e., groundfloor)
*/ */
uint16_t m_floors; uint16_t m_floors;
uint16_t m_roomsX; uint16_t m_roomsX; //!< X Room coordinate
uint16_t m_roomsY; uint16_t m_roomsY; //!< Y Room coordinate
uint32_t m_buildingId; uint32_t m_buildingId; //!< Building ID number
BuildingType_t m_buildingType; BuildingType_t m_buildingType; //!< Building type
ExtWallsType_t m_externalWalls; ExtWallsType_t m_externalWalls; //!< External building wall type
}; };

View File

@@ -58,6 +58,10 @@ class BuildingsPropagationLossModel : public PropagationLossModel
{ {
public: public:
/**
* \brief Get the type ID.
* \return The object TypeId.
*/
static TypeId GetTypeId (void); static TypeId GetTypeId (void);
BuildingsPropagationLossModel (); BuildingsPropagationLossModel ();
@@ -72,35 +76,81 @@ public:
virtual double DoCalcRxPower (double txPowerDbm, Ptr<MobilityModel> a, Ptr<MobilityModel> b) const; virtual double DoCalcRxPower (double txPowerDbm, Ptr<MobilityModel> a, Ptr<MobilityModel> b) const;
protected: protected:
/**
* Calculate the external wall loss
* \param a Building data
* \returns the propagation loss (in dBm)
*/
double ExternalWallLoss (Ptr<MobilityBuildingInfo> a) const; double ExternalWallLoss (Ptr<MobilityBuildingInfo> a) const;
/**
* Calculate the height loss
* \param n Building data
* \returns the propagation loss (in dBm)
*/
double HeightLoss (Ptr<MobilityBuildingInfo> n) const; double HeightLoss (Ptr<MobilityBuildingInfo> n) const;
/**
* Calculate the internal wall loss
* \param a Room A data
* \param b Room B data
* \returns the propagation loss (in dBm)
*/
double InternalWallsLoss (Ptr<MobilityBuildingInfo> a, Ptr<MobilityBuildingInfo> b) const; double InternalWallsLoss (Ptr<MobilityBuildingInfo> a, Ptr<MobilityBuildingInfo> b) const;
/**
* Calculate the shadowing loss
* \param a Room A data
* \param b Room B data
* \returns the propagation loss (in dBm)
*/
double GetShadowing (Ptr<MobilityModel> a, Ptr<MobilityModel> b) const; double GetShadowing (Ptr<MobilityModel> a, Ptr<MobilityModel> b) const;
double m_lossInternalWall; // in meters double m_lossInternalWall; //!< loss from internal walls (in dBm)
/**
* \ingroup propagation
*
* This model allows the computation of shadowing loss
*/
class ShadowingLoss class ShadowingLoss
{ {
public: public:
ShadowingLoss (); ShadowingLoss ();
/**
* Constructor
* \param shadowingValue Value for shadowing
* \param receiver Receiver position
*/
ShadowingLoss (double shadowingValue, Ptr<MobilityModel> receiver); ShadowingLoss (double shadowingValue, Ptr<MobilityModel> receiver);
/**
* \returns the loss (in dBm)
*/
double GetLoss () const; double GetLoss () const;
/**
* \returns the receiver mobility model
*/
Ptr<MobilityModel> GetReceiver (void) const; Ptr<MobilityModel> GetReceiver (void) const;
protected: protected:
double m_shadowingValue; double m_shadowingValue; //!< Shadowing value
Ptr<MobilityModel> m_receiver; Ptr<MobilityModel> m_receiver; //!< The receiver mobility model
}; };
/// Map of the shadowng loss
mutable std::map<Ptr<MobilityModel>, std::map<Ptr<MobilityModel>, ShadowingLoss> > m_shadowingLossMap; mutable std::map<Ptr<MobilityModel>, std::map<Ptr<MobilityModel>, ShadowingLoss> > m_shadowingLossMap;
/**
* Caluculate the Standard deviation of the normal distribution used for calculate the shadowing
* \param a Room A data
* \param b Room B data
* \return the Standard deviation of the normal distribution
*/
double EvaluateSigma (Ptr<MobilityBuildingInfo> a, Ptr<MobilityBuildingInfo> b) const; double EvaluateSigma (Ptr<MobilityBuildingInfo> a, Ptr<MobilityBuildingInfo> b) const;
/// Standard deviation of the normal distribution used for calculate the shadowing due to ext walls
double m_shadowingSigmaExtWalls; double m_shadowingSigmaExtWalls;
/// Standard deviation of the normal distribution used for calculate the shadowing for outdoor nodes
double m_shadowingSigmaOutdoor; double m_shadowingSigmaOutdoor;
/// Standard deviation of the normal distribution used for calculate the shadowing for indoor nodes
double m_shadowingSigmaIndoor; double m_shadowingSigmaIndoor;
Ptr<NormalRandomVariable> m_randVariable; Ptr<NormalRandomVariable> m_randVariable; //!< Random variable
virtual int64_t DoAssignStreams (int64_t stream); virtual int64_t DoAssignStreams (int64_t stream);
}; };

View File

@@ -57,6 +57,10 @@ class HybridBuildingsPropagationLossModel : public BuildingsPropagationLossModel
{ {
public: public:
/**
* \brief Get the type ID.
* \return The object TypeId.
*/
static TypeId GetTypeId (void); static TypeId GetTypeId (void);
HybridBuildingsPropagationLossModel (); HybridBuildingsPropagationLossModel ();
~HybridBuildingsPropagationLossModel (); ~HybridBuildingsPropagationLossModel ();
@@ -91,6 +95,9 @@ public:
void SetRooftopHeight (double rooftopHeight); void SetRooftopHeight (double rooftopHeight);
/** /**
* \brief Compute the path loss according to the nodes position
* using the appropriate model.
*
* \param a the mobility model of the source * \param a the mobility model of the source
* \param b the mobility model of the destination * \param b the mobility model of the destination
* \returns the propagation loss (in dBm) * \returns the propagation loss (in dBm)
@@ -99,20 +106,47 @@ public:
private: private:
/**
* Compute the path loss using either OkumuraHataPropagationLossModel
* or Kun2600MhzPropagationLossModel
*
* \param a the mobility model of the source
* \param b the mobility model of the destination
* \returns the propagation loss (in dBm)
*/
double OkumuraHata (Ptr<MobilityModel> a, Ptr<MobilityModel> b) const; double OkumuraHata (Ptr<MobilityModel> a, Ptr<MobilityModel> b) const;
/**
* Compute the path loss using either ItuR1411LosPropagationLossModelor
* ItuR1411NlosOverRooftopPropagationLossModel
*
* \param a the mobility model of the source
* \param b the mobility model of the destination
* \returns the propagation loss (in dBm)
*/
double ItuR1411 (Ptr<MobilityModel> a, Ptr<MobilityModel> b) const; double ItuR1411 (Ptr<MobilityModel> a, Ptr<MobilityModel> b) const;
/**
* Compute the path loss using ItuR1238PropagationLossModel
*
* \param a the mobility model of the source
* \param b the mobility model of the destination
* \returns the propagation loss (in dBm)
*/
double ItuR1238 (Ptr<MobilityModel> a, Ptr<MobilityModel> b) const; double ItuR1238 (Ptr<MobilityModel> a, Ptr<MobilityModel> b) const;
/// OkumuraHataPropagationLossModel
Ptr<OkumuraHataPropagationLossModel> m_okumuraHata; Ptr<OkumuraHataPropagationLossModel> m_okumuraHata;
/// ItuR1411LosPropagationLossModel
Ptr<ItuR1411LosPropagationLossModel> m_ituR1411Los; Ptr<ItuR1411LosPropagationLossModel> m_ituR1411Los;
/// ItuR1411NlosOverRooftopPropagationLossModel
Ptr<ItuR1411NlosOverRooftopPropagationLossModel> m_ituR1411NlosOverRooftop; Ptr<ItuR1411NlosOverRooftopPropagationLossModel> m_ituR1411NlosOverRooftop;
/// ItuR1238PropagationLossModel
Ptr<ItuR1238PropagationLossModel> m_ituR1238; Ptr<ItuR1238PropagationLossModel> m_ituR1238;
/// Kun2600MhzPropagationLossModel
Ptr<Kun2600MhzPropagationLossModel> m_kun2600Mhz; Ptr<Kun2600MhzPropagationLossModel> m_kun2600Mhz;
double m_itu1411NlosThreshold; ///< in meters (switch Los -> NLoS) double m_itu1411NlosThreshold; ///< in meters (switch Los -> NLoS)
double m_rooftopHeight; double m_rooftopHeight; ///< Roof Height (in meters)
double m_frequency; double m_frequency; ///< Operation frequency
}; };

View File

@@ -37,7 +37,10 @@ class ItuR1238PropagationLossModel : public PropagationLossModel
public: public:
// inherited from Object /**
* \brief Get the type ID.
* \return The object TypeId.
*/
static TypeId GetTypeId (void); static TypeId GetTypeId (void);
/** /**

View File

@@ -40,6 +40,10 @@ class OhBuildingsPropagationLossModel : public BuildingsPropagationLossModel
{ {
public: public:
/**
* \brief Get the type ID.
* \return The object TypeId.
*/
static TypeId GetTypeId (void); static TypeId GetTypeId (void);
OhBuildingsPropagationLossModel (); OhBuildingsPropagationLossModel ();
~OhBuildingsPropagationLossModel (); ~OhBuildingsPropagationLossModel ();
@@ -53,7 +57,7 @@ public:
private: private:
Ptr<OkumuraHataPropagationLossModel> m_okumuraHata; Ptr<OkumuraHataPropagationLossModel> m_okumuraHata; //!< OkumuraHata Propagation Loss Model
}; };

View File

@@ -77,15 +77,16 @@ private:
void Rebound (Time timeLeft); void Rebound (Time timeLeft);
/** /**
* \brief Avoid a building * \brief Avoid a building
* \param timeLeft The remaining time of the walk * \param delayLeft The remaining time of the walk
* \param intersectPosition The position at which the building is intersected * \param intersectPosition The position at which the building is intersected
*/ */
void AvoidBuilding (Time delayLeft, Vector intersectPosition); void AvoidBuilding (Time delayLeft, Vector intersectPosition);
/** /**
* Walk according to position and velocity, until distance is reached, * Walk according to position and velocity, until distance is reached,
* time is reached, or intersection with the bounding box, or building * time is reached, or intersection with the bounding box, or building
* \param delayLeft The remaining time of the walk
*/ */
void DoWalk (Time timeLeft); void DoWalk (Time delayLeft);
/** /**
* Perform initialization of the object before MobilityModel::DoInitialize () * Perform initialization of the object before MobilityModel::DoInitialize ()
*/ */

View File

@@ -159,7 +159,7 @@ private:
* \link BuildingsChannelConditionModel \endlink, which requires * \link BuildingsChannelConditionModel \endlink, which requires
* \link MobilityBuildingInfo \endlink aggregated to the nodes to compute * \link MobilityBuildingInfo \endlink aggregated to the nodes to compute
* LOS and NLOS. Otherwise, the callback is hooked to a local method * LOS and NLOS. Otherwise, the callback is hooked to a local method
* \link GetChaCondWithNoBuildings \endlink * \link GetChCondWithNoBuildings \endlink
* , which construct the ChannelCondtion object and set the condition to * , which construct the ChannelCondtion object and set the condition to
* outdoor to outdoor with LOS. * outdoor to outdoor with LOS.
*/ */
@@ -167,8 +167,8 @@ private:
/** /**
* \brief Get the channel condition and redirect the callback * \brief Get the channel condition and redirect the callback
* \link ComputeChCond \endlink to \link GetChaCondWithBuildings \endlink * \link ComputeChCond \endlink to \link GetChCondWithBuildings \endlink
* or to \link GetChaCondWithNoBuildings \endlink depending on if there are * or to \link GetChCondWithNoBuildings \endlink depending on if there are
* buildings in the scenario or not. * buildings in the scenario or not.
* *
* \param a tx mobility model * \param a tx mobility model

View File

@@ -36,12 +36,29 @@ using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("BuildingPositionAllocatorTest"); NS_LOG_COMPONENT_DEFINE ("BuildingPositionAllocatorTest");
/**
* \ingroup propagation
* \defgroup building-test Buildings module tests
*/
/**
* \ingroup building-test
* \ingroup tests
*
* Room coordinates
*/
struct Room struct Room
{ {
/**
* Constructor
* \param xx X coord
* \param yy Y coord
* \param zz Z coord
*/
Room (uint32_t xx, uint32_t yy, uint32_t zz); Room (uint32_t xx, uint32_t yy, uint32_t zz);
uint32_t x; uint32_t x; //!< X coord
uint32_t y; uint32_t y; //!< Y coord
uint32_t z; uint32_t z; //!< Z coord (floor)
}; };
Room::Room (uint32_t xx, uint32_t yy, uint32_t zz) Room::Room (uint32_t xx, uint32_t yy, uint32_t zz)
@@ -60,7 +77,12 @@ operator < (const Room& a, const Room& b)
} }
/**
* \ingroup building-test
* \ingroup tests
*
* RandomRoomPositionAllocator test
*/
class RandomRoomPositionAllocatorTestCase : public TestCase class RandomRoomPositionAllocatorTestCase : public TestCase
{ {
public: public:
@@ -139,8 +161,12 @@ RandomRoomPositionAllocatorTestCase::DoRun ()
/**
* \ingroup building-test
* \ingroup tests
*
* SameRoomPositionAllocator test
*/
class SameRoomPositionAllocatorTestCase : public TestCase class SameRoomPositionAllocatorTestCase : public TestCase
{ {
public: public:
@@ -214,17 +240,18 @@ SameRoomPositionAllocatorTestCase::DoRun ()
} }
/**
* \ingroup building-test
* \ingroup tests
*
* \brief RandomRoomPositionAllocator TestSuite
*/
class BuildingPositionAllocatorTestSuite : public TestSuite class BuildingPositionAllocatorTestSuite : public TestSuite
{ {
public: public:
BuildingPositionAllocatorTestSuite (); BuildingPositionAllocatorTestSuite ();
}; };
BuildingPositionAllocatorTestSuite::BuildingPositionAllocatorTestSuite () BuildingPositionAllocatorTestSuite::BuildingPositionAllocatorTestSuite ()
: TestSuite ("building-position-allocator", UNIT) : TestSuite ("building-position-allocator", UNIT)
{ {
@@ -235,4 +262,5 @@ BuildingPositionAllocatorTestSuite::BuildingPositionAllocatorTestSuite ()
} }
static BuildingPositionAllocatorTestSuite buildingsPositionAllocatorTestSuiteInstance; /// Static variable for test initialization
static BuildingPositionAllocatorTestSuite buildingsPositionAllocatorTestSuiteInstance;

View File

@@ -31,6 +31,9 @@ using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("BuildingsChannelConditionModelsTest"); NS_LOG_COMPONENT_DEFINE ("BuildingsChannelConditionModelsTest");
/** /**
* \ingroup building-test
* \ingroup tests
*
* Test case for the class BuildingsChannelConditionModel. It checks if the * Test case for the class BuildingsChannelConditionModel. It checks if the
* channel condition is correctly determined when a building is deployed in the * channel condition is correctly determined when a building is deployed in the
* scenario * scenario
@@ -140,6 +143,8 @@ BuildingsChannelConditionModelTestCase::DoRun (void)
} }
/** /**
* \ingroup building-test
* \ingroup tests
* Test suite for the buildings channel condition model * Test suite for the buildings channel condition model
*/ */
class BuildingsChannelConditionModelsTestSuite : public TestSuite class BuildingsChannelConditionModelsTestSuite : public TestSuite
@@ -154,4 +159,5 @@ BuildingsChannelConditionModelsTestSuite::BuildingsChannelConditionModelsTestSui
AddTestCase (new BuildingsChannelConditionModelTestCase, TestCase::QUICK); AddTestCase (new BuildingsChannelConditionModelTestCase, TestCase::QUICK);
} }
/// Static variable for test initialization
static BuildingsChannelConditionModelsTestSuite BuildingsChannelConditionModelsTestSuite; static BuildingsChannelConditionModelsTestSuite BuildingsChannelConditionModelsTestSuite;

View File

@@ -33,15 +33,21 @@ using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("BuildingsHelperTest"); NS_LOG_COMPONENT_DEFINE ("BuildingsHelperTest");
/**
* \ingroup building-test
* \ingroup tests
*
* \brief Struct representing a position in a building
*/
struct PositionInBuilding struct PositionInBuilding
{ {
PositionInBuilding (); PositionInBuilding ();
Vector pos; // coordinates of the mobility model instance Vector pos; //!< coordinates of the mobility model instance
bool indoor; // true if indoor, false otherwise bool indoor; //!< true if indoor, false otherwise
uint32_t bid; // building id uint32_t bid; //!< building id
uint16_t rx; // room x uint16_t rx; //!< room x
uint16_t ry; // room y uint16_t ry; //!< room y
uint16_t fn; // floor number uint16_t fn; //!< floor number
}; };
PositionInBuilding::PositionInBuilding () PositionInBuilding::PositionInBuilding ()
@@ -55,7 +61,10 @@ PositionInBuilding::PositionInBuilding ()
} }
/** /**
* data to construct a Building object. We don't want to pass Building * \ingroup building-test
* \ingroup tests
* Data to construct a Building object. We don't want to pass Building
* objects to the TestCase constructor because otherwise BuildingList * objects to the TestCase constructor because otherwise BuildingList
* would contain all of them (even if only one is meant to be in the * would contain all of them (even if only one is meant to be in the
* test case). * test case).
@@ -64,15 +73,15 @@ PositionInBuilding::PositionInBuilding ()
struct BuildingData struct BuildingData
{ {
BuildingData (); BuildingData ();
double xmin; double xmin; //!< X min coordinate
double xmax; double xmax; //!< X max coordinate
double ymin; double ymin; //!< Y min coordinate
double ymax; double ymax; //!< Y max coordinate
double zmin; double zmin; //!< Z min coordinate
double zmax; double zmax; //!< Z max coordinate
uint16_t nrx; uint16_t nrx; //!< Number of rooms (X coord)
uint16_t nry; uint16_t nry; //!< Number of rooms (Y coord)
uint16_t nf; uint16_t nf; //!< Number of floors
}; };
BuildingData::BuildingData () BuildingData::BuildingData ()
@@ -88,17 +97,35 @@ BuildingData::BuildingData ()
{ {
} }
/**
* \ingroup building-test
* \ingroup tests
*
* \brief BuildingsHelper test
*/
class BuildingsHelperOneTestCase : public TestCase class BuildingsHelperOneTestCase : public TestCase
{ {
public: public:
/**
* Build the testcase name
* \param pib Position in building
* \param bd Building data
* \return the TestCase name
*/
static std::string BuildNameString (PositionInBuilding pib, BuildingData bd); static std::string BuildNameString (PositionInBuilding pib, BuildingData bd);
/**
* Constructor
* \param pib Position in building
* \param bd Building data
*/
BuildingsHelperOneTestCase (PositionInBuilding pib, BuildingData bd); BuildingsHelperOneTestCase (PositionInBuilding pib, BuildingData bd);
private: private:
virtual void DoRun (void); virtual void DoRun (void);
PositionInBuilding m_pib; PositionInBuilding m_pib; //!< Position in the building
BuildingData m_bd; BuildingData m_bd; //!< Building data
}; };
@@ -167,11 +194,12 @@ BuildingsHelperOneTestCase::DoRun ()
} }
/**
* \ingroup building-test
* \ingroup tests
*
* \brief BuildingsHelper TestSuite
*/
class BuildingsHelperTestSuite : public TestSuite class BuildingsHelperTestSuite : public TestSuite
{ {
public: public:
@@ -322,4 +350,5 @@ BuildingsHelperTestSuite::BuildingsHelperTestSuite ()
AddTestCase (new BuildingsHelperOneTestCase (q7, b2), TestCase::QUICK); AddTestCase (new BuildingsHelperOneTestCase (q7, b2), TestCase::QUICK);
} }
/// Static variable for test initialization
static BuildingsHelperTestSuite buildingsHelperAntennaTestSuiteInstance; static BuildingsHelperTestSuite buildingsHelperAntennaTestSuiteInstance;

View File

@@ -38,16 +38,12 @@ using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("BuildingsPathlossTest"); NS_LOG_COMPONENT_DEFINE ("BuildingsPathlossTest");
/** /*
* Test 1.1 BuildingsPathlossModel Pathloss compound test * Test 1.1 BuildingsPathlossModel Pathloss compound test
*/ *
/**
* This TestSuite tests the BuildingPathlossModel by reproducing * This TestSuite tests the BuildingPathlossModel by reproducing
* several communication scenarios * several communication scenarios
*/ */
BuildingsPathlossTestSuite::BuildingsPathlossTestSuite () BuildingsPathlossTestSuite::BuildingsPathlossTestSuite ()
: TestSuite ("buildings-pathloss-test", SYSTEM) : TestSuite ("buildings-pathloss-test", SYSTEM)
{ {
@@ -127,11 +123,11 @@ BuildingsPathlossTestSuite::BuildingsPathlossTestSuite ()
} }
/// Static variable for test initialization
static BuildingsPathlossTestSuite buildingsPathlossTestSuite; static BuildingsPathlossTestSuite buildingsPathlossTestSuite;
/** /*
* TestCase * TestCase
*/ */

View File

@@ -28,8 +28,14 @@
using namespace ns3; using namespace ns3;
/** /**
* Test 1.1 pathloss calculation * \ingroup building-test
*/ * \ingroup tests
*
* Test 1.1 BuildingsPathlossModel Pathloss compound test
*
* This TestSuite tests the BuildingPathlossModel by reproducing
* several communication scenarios
*/
class BuildingsPathlossTestSuite : public TestSuite class BuildingsPathlossTestSuite : public TestSuite
{ {
public: public:
@@ -37,22 +43,44 @@ public:
}; };
/**
* \ingroup building-test
* \ingroup tests
*
* Test 1.1 BuildingsPathlossModel Pathloss test
*
*/
class BuildingsPathlossTestCase : public TestCase class BuildingsPathlossTestCase : public TestCase
{ {
public: public:
/**
* Constructor
* \param freq Communication frequency
* \param m1 First MobilityModel Index
* \param m2 Second MobilityModel Index
* \param env Enviroment type
* \param city City size
* \param refValue Theoretical loss
* \param name Test name
*/
BuildingsPathlossTestCase (double freq, uint16_t m1, uint16_t m2, EnvironmentType env, CitySize city, double refValue, std::string name); BuildingsPathlossTestCase (double freq, uint16_t m1, uint16_t m2, EnvironmentType env, CitySize city, double refValue, std::string name);
virtual ~BuildingsPathlossTestCase (); virtual ~BuildingsPathlossTestCase ();
private: private:
virtual void DoRun (void); virtual void DoRun (void);
/**
* Create a mobility model based on its index
* \param index MobilityModel index
* \return The MobilityModel
*/
Ptr<MobilityModel> CreateMobilityModel (uint16_t index); Ptr<MobilityModel> CreateMobilityModel (uint16_t index);
double m_freq; double m_freq; //!< Communication frequency
uint16_t m_mobilityModelIndex1; uint16_t m_mobilityModelIndex1; //!< First MobilityModel Index
uint16_t m_mobilityModelIndex2; uint16_t m_mobilityModelIndex2; //!< Second MobilityModel Index
EnvironmentType m_env; EnvironmentType m_env; //!< Enviroment type
CitySize m_city; CitySize m_city; //!< City size
double m_lossRef; double m_lossRef; //!< Theoretical loss
}; };

View File

@@ -38,11 +38,9 @@ using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("BuildingsShadowingTest"); NS_LOG_COMPONENT_DEFINE ("BuildingsShadowingTest");
/** /*
* Test 1.1 Shadowing compound test * Test 1.1 Shadowing compound test
*/ *
/**
* This TestSuite tests the shadowing model of BuildingPathlossModel * This TestSuite tests the shadowing model of BuildingPathlossModel
* by reproducing several communication scenarios * by reproducing several communication scenarios
*/ */
@@ -65,10 +63,11 @@ BuildingsShadowingTestSuite::BuildingsShadowingTestSuite ()
} }
/// Static variable for test initialization
static BuildingsShadowingTestSuite buildingsShadowingTestSuite; static BuildingsShadowingTestSuite buildingsShadowingTestSuite;
/** /*
* TestCase * TestCase
*/ */

View File

@@ -28,7 +28,13 @@
using namespace ns3; using namespace ns3;
/** /**
* Test shadowing calculation * \ingroup building-test
* \ingroup tests
*
* Shadowing compound test
*
* This TestSuite tests the shadowing model of BuildingPathlossModel
* by reproducing several communication scenarios
*/ */
class BuildingsShadowingTestSuite : public TestSuite class BuildingsShadowingTestSuite : public TestSuite
{ {
@@ -37,20 +43,39 @@ public:
}; };
/**
* \ingroup building-test
* \ingroup tests
*
* Shadowing test
*/
class BuildingsShadowingTestCase : public TestCase class BuildingsShadowingTestCase : public TestCase
{ {
public: public:
/**
* Constructor
* \param m1 First MobilityModel Index
* \param m2 Second MobilityModel Index
* \param refValue Theoretical loss
* \param sigmaRef Theoretical loss standard deviation
* \param name Test name
*/
BuildingsShadowingTestCase (uint16_t m1, uint16_t m2, double refValue, double sigmaRef, std::string name); BuildingsShadowingTestCase (uint16_t m1, uint16_t m2, double refValue, double sigmaRef, std::string name);
virtual ~BuildingsShadowingTestCase (); virtual ~BuildingsShadowingTestCase ();
private: private:
virtual void DoRun (void); virtual void DoRun (void);
/**
* Create a mobility model based on its index
* \param index MobilityModel index
* \return The MobilityModel
*/
Ptr<MobilityModel> CreateMobilityModel (uint16_t index); Ptr<MobilityModel> CreateMobilityModel (uint16_t index);
uint16_t m_mobilityModelIndex1; uint16_t m_mobilityModelIndex1; //!< First MobilityModel Index
uint16_t m_mobilityModelIndex2; uint16_t m_mobilityModelIndex2; //!< Second MobilityModel Index
double m_lossRef; // pathloss value (without shadowing) double m_lossRef; //!< pathloss value (without shadowing)
double m_sigmaRef; double m_sigmaRef; //!< pathloss standard deviation value reference value
}; };

View File

@@ -34,31 +34,28 @@ using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("OutdoorRandomWalkTest"); NS_LOG_COMPONENT_DEFINE ("OutdoorRandomWalkTest");
/** /**
* \ingroup building-test
* \ingroup tests
*
* Test case for the class OutdoorRandomWalkTestCase. It checks if the * Test case for the class OutdoorRandomWalkTestCase. It checks if the
* positions visited by the user are outside buildings * positions visited by the user are outside buildings
*/ */
class OutdoorRandomWalkTestCase : public TestCase class OutdoorRandomWalkTestCase : public TestCase
{ {
public: public:
/**
* Constructor
*/
OutdoorRandomWalkTestCase (); OutdoorRandomWalkTestCase ();
/**
* Destructor
*/
virtual ~OutdoorRandomWalkTestCase (); virtual ~OutdoorRandomWalkTestCase ();
private: private:
/**
* Builds the simulation scenario and perform the tests
*/
virtual void DoRun (void); virtual void DoRun (void);
/**
* Check that the position is the expected one
* \param model Mobility model
*/
void CheckPositionOutdoor (Ptr<RandomWalk2dOutdoorMobilityModel> model); void CheckPositionOutdoor (Ptr<RandomWalk2dOutdoorMobilityModel> model);
std::vector<Ptr<Building> > m_buildings; std::vector<Ptr<Building> > m_buildings; //!< Buildings
}; };
OutdoorRandomWalkTestCase::OutdoorRandomWalkTestCase () OutdoorRandomWalkTestCase::OutdoorRandomWalkTestCase ()
@@ -150,6 +147,9 @@ OutdoorRandomWalkTestCase::DoRun (void)
} }
/** /**
* \ingroup building-test
* \ingroup tests
*
* Test suite for the buildings channel condition model * Test suite for the buildings channel condition model
*/ */
class OutdoorRandomWalkTestSuite : public TestSuite class OutdoorRandomWalkTestSuite : public TestSuite
@@ -164,4 +164,5 @@ OutdoorRandomWalkTestSuite::OutdoorRandomWalkTestSuite ()
AddTestCase (new OutdoorRandomWalkTestCase, TestCase::QUICK); AddTestCase (new OutdoorRandomWalkTestCase, TestCase::QUICK);
} }
/// Static variable for test initialization
static OutdoorRandomWalkTestSuite OutdoorRandomWalkTestSuite; static OutdoorRandomWalkTestSuite OutdoorRandomWalkTestSuite;

View File

@@ -38,6 +38,9 @@ using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("ThreeGppV2vChannelConditionModelsTest"); NS_LOG_COMPONENT_DEFINE ("ThreeGppV2vChannelConditionModelsTest");
/** /**
* \ingroup building-test
* \ingroup tests
*
* Test case for the classes ThreeGppV2vUrbanChannelConditionModel, * Test case for the classes ThreeGppV2vUrbanChannelConditionModel,
* and ThreeGppV2vHighwayChannelConditionModel to test their code to * and ThreeGppV2vHighwayChannelConditionModel to test their code to
* deterministically determine NLOS state. The test checks if the * deterministically determine NLOS state. The test checks if the
@@ -473,6 +476,9 @@ ThreeGppV2vHighwayLosNlosvChCondModelTestCase::DoRun (void)
/** /**
* \ingroup building-test
* \ingroup tests
*
* Test suite for the 3GPP V2V channel condition model * Test suite for the 3GPP V2V channel condition model
* *
* Note that, in 3GPP V2V scenarios, the channel condition model is * Note that, in 3GPP V2V scenarios, the channel condition model is
@@ -483,8 +489,8 @@ ThreeGppV2vHighwayLosNlosvChCondModelTestCase::DoRun (void)
* *
* The test ThreeGppV2vBuildingsChCondModelTestCase checks the * The test ThreeGppV2vBuildingsChCondModelTestCase checks the
* 1st step of the procedure, the deterministic one, using buildings for * 1st step of the procedure, the deterministic one, using buildings for
* both \link ThreeGppV2vUrbanChannelConditionModel \endlink and * both \link ns3::ThreeGppV2vUrbanChannelConditionModel \endlink and
* \link ThreeGppV2vHighwayChannelConditionModel \endlink . * \link ns3::ThreeGppV2vHighwayChannelConditionModel \endlink .
* *
* The tests ThreeGppV2vUrbanLosNlosvChCondModelTestCase and * The tests ThreeGppV2vUrbanLosNlosvChCondModelTestCase and
* ThreeGppV2vHighwayLosNlosvChCondModelTestCase check the * ThreeGppV2vHighwayLosNlosvChCondModelTestCase check the
@@ -506,4 +512,5 @@ ThreeGppV2vChCondModelsTestSuite::ThreeGppV2vChCondModelsTestSuite ()
AddTestCase (new ThreeGppV2vHighwayLosNlosvChCondModelTestCase, TestCase::QUICK); // test for the probabilistic procedure (LOS vs NLOSv), in V2V highway scenario AddTestCase (new ThreeGppV2vHighwayLosNlosvChCondModelTestCase, TestCase::QUICK); // test for the probabilistic procedure (LOS vs NLOSv), in V2V highway scenario
} }
/// Static variable for test initialization
static ThreeGppV2vChCondModelsTestSuite ThreeGppV2vChCondModelsTestSuite; static ThreeGppV2vChCondModelsTestSuite ThreeGppV2vChCondModelsTestSuite;

View File

@@ -286,15 +286,12 @@ public:
private: private:
/** /**
* \name Arithmetic Operators * \defgroup AritmeticOps Arithmetic Operators
* Arithmetic operators for int64x64_t. * \brief Arithmetic operators for int64x64_t.
*/ * \param [in] lhs Left hand argument
/** * \param [in] rhs Right hand argument
* \return The result of the operator.
* @{ * @{
* Arithmetic operator.
* \param [in] lhs Left hand argument
* \param [in] rhs Right hand argument
* \return The result of the operator.
*/ */
friend bool operator == (const int64x64_t & lhs, const int64x64_t & rhs); friend bool operator == (const int64x64_t & lhs, const int64x64_t & rhs);
@@ -305,21 +302,18 @@ private:
friend int64x64_t & operator -= ( int64x64_t & lhs, const int64x64_t & rhs); friend int64x64_t & operator -= ( int64x64_t & lhs, const int64x64_t & rhs);
friend int64x64_t & operator *= ( int64x64_t & lhs, const int64x64_t & rhs); friend int64x64_t & operator *= ( int64x64_t & lhs, const int64x64_t & rhs);
friend int64x64_t & operator /= ( int64x64_t & lhs, const int64x64_t & rhs); friend int64x64_t & operator /= ( int64x64_t & lhs, const int64x64_t & rhs);
/**@}*/ /** @} */
/** /**
* \name Unary Operators * \defgroup UnaryOps Unary Operators
* Unary operators for int64x64_t. * \brief Unary operators for int64x64_t.
*/ * \param [in] lhs Left hand argument
/** * \return The result of the operator.
* @{ * @{
* Unary operator.
* \param [in] lhs Left hand argument
* \return The result of the operator.
*/ */
friend int64x64_t operator - (const int64x64_t & lhs); friend int64x64_t operator - (const int64x64_t & lhs);
friend int64x64_t operator ! (const int64x64_t & lhs); friend int64x64_t operator ! (const int64x64_t & lhs);
/**@}*/ /** @} */
/** /**
* Implement `*=`. * Implement `*=`.

View File

@@ -163,6 +163,7 @@ private:
* *
* @param [in] arg This SystemThread instance to communicate to the newly * @param [in] arg This SystemThread instance to communicate to the newly
* launched thread. * launched thread.
* @return a null pointer (for compatibility)
*/ */
static void * DoRun (void *arg); static void * DoRun (void *arg);
@@ -174,5 +175,3 @@ private:
} // namespace ns3 } // namespace ns3
#endif /* SYSTEM_THREAD_H */ #endif /* SYSTEM_THREAD_H */

View File

@@ -217,9 +217,15 @@ private:
*/ */
void void
RecvDsdv (Ptr<Socket> socket); RecvDsdv (Ptr<Socket> socket);
/// Send packet /**
* Send a packet
* \param route the route
* \param packet the packet
* \param header the IPv4 header
*/
void void
Send (Ptr<Ipv4Route>, Ptr<const Packet>, const Ipv4Header &); Send (Ptr<Ipv4Route> route, Ptr<const Packet> packet, const Ipv4Header & header);
/** /**
* Create loopback route for given header * Create loopback route for given header
* *
@@ -245,9 +251,14 @@ private:
/// Merge periodic updates /// Merge periodic updates
void void
MergeTriggerPeriodicUpdates (); MergeTriggerPeriodicUpdates ();
/// Notify that packet is dropped for some reason /**
* Notify that packet is dropped for some reason
* \param packet the dropped packet
* \param header the IPv4 header
* \param err the error number
*/
void void
Drop (Ptr<const Packet>, const Ipv4Header &, Socket::SocketErrno); Drop (Ptr<const Packet> packet, const Ipv4Header & header, Socket::SocketErrno err);
/// Timer to trigger periodic updates from a node /// Timer to trigger periodic updates from a node
Timer m_periodicUpdateTimer; Timer m_periodicUpdateTimer;
/// Timer used by the trigger updates in case of Weighted Settling Time is used /// Timer used by the trigger updates in case of Weighted Settling Time is used

View File

@@ -65,7 +65,7 @@ public:
* \param iface the interface * \param iface the interface
* \param hops the number of hops * \param hops the number of hops
* \param nextHop the IP address of the next hop * \param nextHop the IP address of the next hop
* \param lifetime the lifetime * \param lifetime the lifetime
* \param SettlingTime the settling time * \param SettlingTime the settling time
* \param changedEntries flag for changed entries * \param changedEntries flag for changed entries
*/ */
@@ -276,6 +276,7 @@ public:
/** /**
* Print routing table entry * Print routing table entry
* \param stream the output stream * \param stream the output stream
* \param unit the Time unit
*/ */
void void
Print (Ptr<OutputStreamWrapper> stream, Time::Unit unit = Time::S) const; Print (Ptr<OutputStreamWrapper> stream, Time::Unit unit = Time::S) const;
@@ -393,6 +394,7 @@ public:
/** /**
* Print routing table * Print routing table
* \param stream the output stream * \param stream the output stream
* \param unit the Time unit
*/ */
void void
Print (Ptr<OutputStreamWrapper> stream, Time::Unit unit = Time::S) const; Print (Ptr<OutputStreamWrapper> stream, Time::Unit unit = Time::S) const;

View File

@@ -51,6 +51,13 @@ public:
virtual uint32_t Deserialize (Buffer::Iterator start); virtual uint32_t Deserialize (Buffer::Iterator start);
virtual void Print (std::ostream &os) const; virtual void Print (std::ostream &os) const;
/**
* Get the message size.
*
* Subclasses are supposed to have a message size greater than zero.
*
* \returns the message size
*/
virtual uint32_t GetMessageSize (void) const; virtual uint32_t GetMessageSize (void) const;
/** /**
@@ -100,6 +107,9 @@ public:
*/ */
void SetIesLength (uint16_t iesLength); void SetIesLength (uint16_t iesLength);
/**
* Compute the message length according to the message type
*/
void ComputeMessageLength (void); void ComputeMessageLength (void);
/// Interface Type enumeration /// Interface Type enumeration
@@ -116,9 +126,9 @@ public:
/// FTEID structure /// FTEID structure
struct Fteid_t struct Fteid_t
{ {
InterfaceType_t interfaceType; InterfaceType_t interfaceType; //!< Interface type
Ipv4Address addr; Ipv4Address addr; //!< IPv4 address
uint32_t teid; uint32_t teid; //!< TEID
}; };
/// Message Type enumeration /// Message Type enumeration
@@ -173,61 +183,178 @@ protected:
/** /**
* Deserialize the GTP-C header in the GTP-C messages * Deserialize the GTP-C header in the GTP-C messages
* \param i the buffer iterator * \param i the buffer iterator
* \return number of bytes deserialized
*/ */
uint32_t PreDeserialize (Buffer::Iterator &i); uint32_t PreDeserialize (Buffer::Iterator &i);
}; };
/**
* \ingroup lte
* GTP-C Information Elemements
*/
class GtpcIes class GtpcIes
{ {
public: public:
/**
* Cause
*/
enum Cause_t enum Cause_t
{ {
RESERVED = 0, RESERVED = 0,
REQUEST_ACCEPTED = 16, REQUEST_ACCEPTED = 16,
}; };
const uint32_t serializedSizeImsi = 12; const uint32_t serializedSizeImsi = 12; //!< IMSI serialized size
const uint32_t serializedSizeCause = 6; const uint32_t serializedSizeCause = 6; //!< Cause serialized size
const uint32_t serializedSizeEbi = 5; const uint32_t serializedSizeEbi = 5; //!< EBI serialized size
const uint32_t serializedSizeBearerQos = 26; const uint32_t serializedSizeBearerQos = 26; //!< Bearer QoS serialized size
const uint32_t serializedSizePacketFilter = 3 + 9 + 9 + 5 + 5 + 3; const uint32_t serializedSizePacketFilter = 3 + 9 + 9 + 5 + 5 + 3; //!< Packet filter serialized size
/**
* \return the BearerTft serialized size
* \param packetFilters The packet filter
*/
uint32_t GetSerializedSizeBearerTft (std::list<EpcTft::PacketFilter> packetFilters) const; uint32_t GetSerializedSizeBearerTft (std::list<EpcTft::PacketFilter> packetFilters) const;
const uint32_t serializedSizeUliEcgi = 12; const uint32_t serializedSizeUliEcgi = 12; //!< UliEcgi serialized size
const uint32_t serializedSizeFteid = 13; const uint32_t serializedSizeFteid = 13; //!< Fteid serialized size
const uint32_t serializedSizeBearerContextHeader = 4; const uint32_t serializedSizeBearerContextHeader = 4; //!< Fteid serialized size
/**
* Serialize the IMSI
* \param i Buffer iterator
* \param imsi The IMSI
*/
void SerializeImsi (Buffer::Iterator &i, uint64_t imsi) const; void SerializeImsi (Buffer::Iterator &i, uint64_t imsi) const;
/**
* Deserialize the IMSI
* \param i Buffer iterator
* \param [out] imsi The IMSI
* \return the number of deserialized bytes
*/
uint32_t DeserializeImsi (Buffer::Iterator &i, uint64_t &imsi); uint32_t DeserializeImsi (Buffer::Iterator &i, uint64_t &imsi);
/**
* Serialize the Cause
* \param i Buffer iterator
* \param cause The Cause
*/
void SerializeCause (Buffer::Iterator &i, Cause_t cause) const; void SerializeCause (Buffer::Iterator &i, Cause_t cause) const;
uint32_t DeserializeCause (Buffer::Iterator &i, Cause_t &cause); /**
* Deserialize the Cause
* \param i Buffer iterator
* \param [out] cause The cause
* \return the number of deserialized bytes
*/
uint32_t DeserializeCause (Buffer::Iterator &i, Cause_t &cause);
/**
* Serialize the eps Bearer Id
* \param i Buffer iterator
* \param epsBearerId The eps Bearer Id
*/
void SerializeEbi (Buffer::Iterator &i, uint8_t epsBearerId) const; void SerializeEbi (Buffer::Iterator &i, uint8_t epsBearerId) const;
/**
* Deserialize the eps Bearer Id
* \param i Buffer iterator
* \param [out] epsBearerId The eps Bearer Id
* \return the number of deserialized bytes
*/
uint32_t DeserializeEbi (Buffer::Iterator &i, uint8_t &epsBearerId); uint32_t DeserializeEbi (Buffer::Iterator &i, uint8_t &epsBearerId);
/**
* \param i Buffer iterator
* \param data data to write in buffer
*
* Write the data in buffer and advance the iterator position
* by five bytes. The data is written in network order and the
* input data is expected to be in host order.
*/
void WriteHtonU40 (Buffer::Iterator &i, uint64_t data) const; void WriteHtonU40 (Buffer::Iterator &i, uint64_t data) const;
/**
* \param i Buffer iterator
* \return the five bytes read in the buffer.
*
* Read data and advance the Iterator by the number of bytes
* read.
* The data is read in network format and returned in host format.
*/
uint64_t ReadNtohU40 (Buffer::Iterator &i); uint64_t ReadNtohU40 (Buffer::Iterator &i);
/**
* Serialize the eps Bearer QoS
* \param i Buffer iterator
* \param bearerQos The Bearer QoS
*/
void SerializeBearerQos (Buffer::Iterator &i, EpsBearer bearerQos) const; void SerializeBearerQos (Buffer::Iterator &i, EpsBearer bearerQos) const;
/**
* Deserialize the eps Bearer QoS
* \param i Buffer iterator
* \param [out] bearerQos The Bearer QoS
* \return the number of deserialized bytes
*/
uint32_t DeserializeBearerQos (Buffer::Iterator &i, EpsBearer &bearerQos); uint32_t DeserializeBearerQos (Buffer::Iterator &i, EpsBearer &bearerQos);
/**
* Serialize the Bearer TFT
* \param i Buffer iterator
* \param packetFilters The Packet filters
*/
void SerializeBearerTft (Buffer::Iterator &i, std::list<EpcTft::PacketFilter> packetFilters) const; void SerializeBearerTft (Buffer::Iterator &i, std::list<EpcTft::PacketFilter> packetFilters) const;
/**
* Deserialize the Bearer TFT
* \param i Buffer iterator
* \param [out] epcTft The Bearer TFT
* \return the number of deserialized bytes
*/
uint32_t DeserializeBearerTft (Buffer::Iterator &i, Ptr<EpcTft> epcTft); uint32_t DeserializeBearerTft (Buffer::Iterator &i, Ptr<EpcTft> epcTft);
/**
* Serialize the UliEcgi
* \param i Buffer iterator
* \param uliEcgi The UliEcgi
*/
void SerializeUliEcgi (Buffer::Iterator &i, uint32_t uliEcgi) const; void SerializeUliEcgi (Buffer::Iterator &i, uint32_t uliEcgi) const;
/**
* Deserialize the UliEcgi
* \param i Buffer iterator
* \param [out] uliEcgi UliEcgi
* \return the number of deserialized bytes
*/
uint32_t DeserializeUliEcgi (Buffer::Iterator &i, uint32_t &uliEcgi); uint32_t DeserializeUliEcgi (Buffer::Iterator &i, uint32_t &uliEcgi);
/**
* Serialize the Fteid_t
* \param i Buffer iterator
* \param fteid The Fteid_t
*/
void SerializeFteid (Buffer::Iterator &i, GtpcHeader::Fteid_t fteid) const; void SerializeFteid (Buffer::Iterator &i, GtpcHeader::Fteid_t fteid) const;
/**
* Deserialize the Fteid
* \param i Buffer iterator
* \param [out] fteid Fteid
* \return the number of deserialized bytes
*/
uint32_t DeserializeFteid (Buffer::Iterator &i, GtpcHeader::Fteid_t &fteid); uint32_t DeserializeFteid (Buffer::Iterator &i, GtpcHeader::Fteid_t &fteid);
/**
* Serialize the Bearer Context Header
* \param i Buffer iterator
* \param length The length
*/
void SerializeBearerContextHeader (Buffer::Iterator &i, uint16_t length) const; void SerializeBearerContextHeader (Buffer::Iterator &i, uint16_t length) const;
/**
* Deserialize the Bearer Context Header
* \param i Buffer iterator
* \param [out] length length
* \return the number of deserialized bytes
*/
uint32_t DeserializeBearerContextHeader (Buffer::Iterator &i, uint16_t &length); uint32_t DeserializeBearerContextHeader (Buffer::Iterator &i, uint16_t &length);
}; };
/**
* \ingroup lte
* GTP-C Create Session Request Message
*/
class GtpcCreateSessionRequestMessage : public GtpcHeader, public GtpcIes class GtpcCreateSessionRequestMessage : public GtpcHeader, public GtpcIes
{ {
public: public:
@@ -245,15 +372,42 @@ public:
virtual void Print (std::ostream &os) const; virtual void Print (std::ostream &os) const;
virtual uint32_t GetMessageSize (void) const; virtual uint32_t GetMessageSize (void) const;
/**
* Get the IMSI
* \return IMSI
*/
uint64_t GetImsi () const; uint64_t GetImsi () const;
/**
* Set the IMSI
* \param imsi IMSI
*/
void SetImsi (uint64_t imsi); void SetImsi (uint64_t imsi);
/**
* Get the UliEcgi
* \return UliEcgi
*/
uint32_t GetUliEcgi () const; uint32_t GetUliEcgi () const;
/**
* Set the UliEcgi
* \param uliEcgi UliEcgi
*/
void SetUliEcgi (uint32_t uliEcgi); void SetUliEcgi (uint32_t uliEcgi);
/**
* Get the Sender CpFteid
* \return Sender CpFteid
*/
GtpcHeader::Fteid_t GetSenderCpFteid () const; GtpcHeader::Fteid_t GetSenderCpFteid () const;
/**
* Set the Sender CpFteid
* \param fteid Sender CpFteid
*/
void SetSenderCpFteid (GtpcHeader::Fteid_t fteid); void SetSenderCpFteid (GtpcHeader::Fteid_t fteid);
/**
* Bearer Context structure
*/
struct BearerContextToBeCreated struct BearerContextToBeCreated
{ {
GtpcHeader::Fteid_t sgwS5uFteid; ///< FTEID GtpcHeader::Fteid_t sgwS5uFteid; ///< FTEID
@@ -262,18 +416,30 @@ public:
EpsBearer bearerLevelQos; ///< bearer QOS level EpsBearer bearerLevelQos; ///< bearer QOS level
}; };
/**
* Get the Bearer Contexts
* \return the Bearer Context list
*/
std::list<BearerContextToBeCreated> GetBearerContextsToBeCreated () const; std::list<BearerContextToBeCreated> GetBearerContextsToBeCreated () const;
/**
* Set the Bearer Contexts
* \param bearerContexts the Bearer Context list
*/
void SetBearerContextsToBeCreated (std::list<BearerContextToBeCreated> bearerContexts); void SetBearerContextsToBeCreated (std::list<BearerContextToBeCreated> bearerContexts);
private: private:
uint64_t m_imsi; uint64_t m_imsi; //!< IMSI
uint32_t m_uliEcgi; uint32_t m_uliEcgi; //!< UliEcgi
GtpcHeader::Fteid_t m_senderCpFteid; GtpcHeader::Fteid_t m_senderCpFteid; //!< Sender CpFteid
/// Bearer Context list
std::list<BearerContextToBeCreated> m_bearerContextsToBeCreated; std::list<BearerContextToBeCreated> m_bearerContextsToBeCreated;
}; };
/**
* \ingroup lte
* GTP-C Create Session Response Message
*/
class GtpcCreateSessionResponseMessage : public GtpcHeader, public GtpcIes class GtpcCreateSessionResponseMessage : public GtpcHeader, public GtpcIes
{ {
public: public:
@@ -291,12 +457,31 @@ public:
virtual void Print (std::ostream &os) const; virtual void Print (std::ostream &os) const;
virtual uint32_t GetMessageSize (void) const; virtual uint32_t GetMessageSize (void) const;
/**
* Get the Cause
* \return the Cause
*/
Cause_t GetCause () const; Cause_t GetCause () const;
/**
* Set the Cause
* \param cause The cause
*/
void SetCause (Cause_t cause); void SetCause (Cause_t cause);
/**
* Get the Sender CpFteid
* \return the Sender CpFteid
*/
GtpcHeader::Fteid_t GetSenderCpFteid () const; GtpcHeader::Fteid_t GetSenderCpFteid () const;
/**
* Set the Sender CpFteid
* \param fteid the Sender CpFteid
*/
void SetSenderCpFteid (GtpcHeader::Fteid_t fteid); void SetSenderCpFteid (GtpcHeader::Fteid_t fteid);
/**
* Bearer Context structure
*/
struct BearerContextCreated struct BearerContextCreated
{ {
uint8_t epsBearerId; ///< EPS bearer ID uint8_t epsBearerId; ///< EPS bearer ID
@@ -306,17 +491,29 @@ public:
EpsBearer bearerLevelQos; ///< Bearer QOS level EpsBearer bearerLevelQos; ///< Bearer QOS level
}; };
/**
* Get the Container of Bearer Contexts
* \return a list of Bearer Contexts
*/
std::list<BearerContextCreated> GetBearerContextsCreated () const; std::list<BearerContextCreated> GetBearerContextsCreated () const;
/**
* Set the Bearer Contexts
* \param bearerContexts a list of Bearer Contexts
*/
void SetBearerContextsCreated (std::list<BearerContextCreated> bearerContexts); void SetBearerContextsCreated (std::list<BearerContextCreated> bearerContexts);
private: private:
Cause_t m_cause; Cause_t m_cause; //!< Cause
GtpcHeader::Fteid_t m_senderCpFteid; GtpcHeader::Fteid_t m_senderCpFteid; //!< Sender CpFteid
/// Container of Bearer Contexts
std::list<BearerContextCreated> m_bearerContextsCreated; std::list<BearerContextCreated> m_bearerContextsCreated;
}; };
/**
* \ingroup lte
* GTP-C Modify Bearer Request Message
*/
class GtpcModifyBearerRequestMessage : public GtpcHeader, public GtpcIes class GtpcModifyBearerRequestMessage : public GtpcHeader, public GtpcIes
{ {
public: public:
@@ -334,29 +531,60 @@ public:
virtual void Print (std::ostream &os) const; virtual void Print (std::ostream &os) const;
virtual uint32_t GetMessageSize (void) const; virtual uint32_t GetMessageSize (void) const;
/**
* Get the IMSI
* \return IMSI
*/
uint64_t GetImsi () const; uint64_t GetImsi () const;
/**
* Set the IMSI
* \param imsi IMSI
*/
void SetImsi (uint64_t imsi); void SetImsi (uint64_t imsi);
/**
* Get the UliEcgi
* \return UliEcgi
*/
uint32_t GetUliEcgi () const; uint32_t GetUliEcgi () const;
/**
* Set the UliEcgi
* \param uliEcgi UliEcgi
*/
void SetUliEcgi (uint32_t uliEcgi); void SetUliEcgi (uint32_t uliEcgi);
/**
* Bearer Context structure
*/
struct BearerContextToBeModified struct BearerContextToBeModified
{ {
uint8_t epsBearerId; ///< EPS bearer ID uint8_t epsBearerId; ///< EPS bearer ID
GtpcHeader::Fteid_t fteid; ///< FTEID GtpcHeader::Fteid_t fteid; ///< FTEID
}; };
/**
* Get the Bearer Contexts
* \return the Bearer Context list
*/
std::list<BearerContextToBeModified> GetBearerContextsToBeModified () const; std::list<BearerContextToBeModified> GetBearerContextsToBeModified () const;
/**
* Set the Bearer Contexts
* \param bearerContexts the Bearer Context list
*/
void SetBearerContextsToBeModified (std::list<BearerContextToBeModified> bearerContexts); void SetBearerContextsToBeModified (std::list<BearerContextToBeModified> bearerContexts);
private: private:
uint64_t m_imsi; uint64_t m_imsi; //!< IMSI
uint32_t m_uliEcgi; uint32_t m_uliEcgi; //!< UliEcgi
/// Bearer Context list
std::list<BearerContextToBeModified> m_bearerContextsToBeModified; std::list<BearerContextToBeModified> m_bearerContextsToBeModified;
}; };
/**
* \ingroup lte
* GTP-C Modify Bearer Response Message
*/
class GtpcModifyBearerResponseMessage : public GtpcHeader, public GtpcIes class GtpcModifyBearerResponseMessage : public GtpcHeader, public GtpcIes
{ {
public: public:
@@ -374,14 +602,25 @@ public:
virtual void Print (std::ostream &os) const; virtual void Print (std::ostream &os) const;
virtual uint32_t GetMessageSize (void) const; virtual uint32_t GetMessageSize (void) const;
/**
* Get the Cause
* \return the Cause
*/
Cause_t GetCause () const; Cause_t GetCause () const;
/**
* Set the Cause
* \param cause The cause
*/
void SetCause (Cause_t cause); void SetCause (Cause_t cause);
private: private:
Cause_t m_cause; Cause_t m_cause; //!< Cause
}; };
/**
* \ingroup lte
* GTP-C Delete Bearer Command Message
*/
class GtpcDeleteBearerCommandMessage : public GtpcHeader, public GtpcIes class GtpcDeleteBearerCommandMessage : public GtpcHeader, public GtpcIes
{ {
public: public:
@@ -399,19 +638,31 @@ public:
virtual void Print (std::ostream &os) const; virtual void Print (std::ostream &os) const;
virtual uint32_t GetMessageSize (void) const; virtual uint32_t GetMessageSize (void) const;
/// Bearer context
struct BearerContext struct BearerContext
{ {
uint8_t m_epsBearerId; ///< EPS bearer ID uint8_t m_epsBearerId; ///< EPS bearer ID
}; };
/**
* Get the Bearer contexts
* \return container of beraer contexts
*/
std::list<BearerContext> GetBearerContexts () const; std::list<BearerContext> GetBearerContexts () const;
/**
* Set the Bearer contexts
* \param bearerContexts container of beraer contexts
*/
void SetBearerContexts (std::list<BearerContext> bearerContexts); void SetBearerContexts (std::list<BearerContext> bearerContexts);
private: private:
std::list<BearerContext> m_bearerContexts; std::list<BearerContext> m_bearerContexts; //!< Container of Bearer Contexts
}; };
/**
* \ingroup lte
* GTP-C Delete Bearer Request Message
*/
class GtpcDeleteBearerRequestMessage : public GtpcHeader, public GtpcIes class GtpcDeleteBearerRequestMessage : public GtpcHeader, public GtpcIes
{ {
public: public:
@@ -429,14 +680,25 @@ public:
virtual void Print (std::ostream &os) const; virtual void Print (std::ostream &os) const;
virtual uint32_t GetMessageSize (void) const; virtual uint32_t GetMessageSize (void) const;
/**
* Get the Bearers IDs
* \return a container of Bearers IDs
*/
std::list<uint8_t> GetEpsBearerIds () const; std::list<uint8_t> GetEpsBearerIds () const;
/**
* Set the Bearers IDs
* \param epsBearerIds The container of Bearers IDs
*/
void SetEpsBearerIds (std::list<uint8_t> epsBearerIds); void SetEpsBearerIds (std::list<uint8_t> epsBearerIds);
private: private:
std::list<uint8_t> m_epsBearerIds; std::list<uint8_t> m_epsBearerIds; //!< Container of Bearers IDs
}; };
/**
* \ingroup lte
* GTP-C Delete Bearer Response Message
*/
class GtpcDeleteBearerResponseMessage : public GtpcHeader, public GtpcIes class GtpcDeleteBearerResponseMessage : public GtpcHeader, public GtpcIes
{ {
public: public:
@@ -454,15 +716,31 @@ public:
virtual void Print (std::ostream &os) const; virtual void Print (std::ostream &os) const;
virtual uint32_t GetMessageSize (void) const; virtual uint32_t GetMessageSize (void) const;
/**
* Get the Cause
* \return the Cause
*/
Cause_t GetCause () const; Cause_t GetCause () const;
/**
* Set the Cause
* \param cause The cause
*/
void SetCause (Cause_t cause); void SetCause (Cause_t cause);
/**
* Get the Bearers IDs
* \return a container of Bearers IDs
*/
std::list<uint8_t> GetEpsBearerIds () const; std::list<uint8_t> GetEpsBearerIds () const;
/**
* Set the Bearers IDs
* \param epsBearerIds The container of Bearers IDs
*/
void SetEpsBearerIds (std::list<uint8_t> epsBearerIds); void SetEpsBearerIds (std::list<uint8_t> epsBearerIds);
private: private:
Cause_t m_cause; Cause_t m_cause; //!< Cause
std::list<uint8_t> m_epsBearerIds; std::list<uint8_t> m_epsBearerIds; //!< Container of Bearers IDs
}; };
} // namespace ns3 } // namespace ns3

View File

@@ -21,7 +21,7 @@
/** /**
* \file * \file
* \ingroup mpi * \ingroup mpi
* Declaration of class ns3::NullMessageSimulatorImpl. * Declaration of class ns3::NullMessageSimulatorImpl.
*/ */
@@ -98,7 +98,7 @@ private:
friend class RemoteChannelBundleManager; friend class RemoteChannelBundleManager;
/** /**
* Non blocking receive of pending messages. * Non blocking receive of pending messages.
*/ */
void HandleArrivingMessagesNonBlocking (void); void HandleArrivingMessagesNonBlocking (void);
@@ -134,6 +134,7 @@ private:
* Get the current SafeTime; the maximum time that events can * Get the current SafeTime; the maximum time that events can
* be processed based on information received from neighboring * be processed based on information received from neighboring
* MPI tasks. * MPI tasks.
* \return the current SafeTime
*/ */
Time GetSafeTime (void); Time GetSafeTime (void);

View File

@@ -71,6 +71,7 @@ public:
* The maximum number of bits to be deserialized in one single call is 64. * The maximum number of bits to be deserialized in one single call is 64.
* *
* \param size The number of bits to pop. * \param size The number of bits to pop.
* \return The popped bits value
*/ */
uint64_t GetBits (uint8_t size); uint64_t GetBits (uint8_t size);

View File

@@ -32,7 +32,7 @@ namespace ns3 {
NS_LOG_COMPONENT_DEFINE ("ThreeGppPropagationLossModel"); NS_LOG_COMPONENT_DEFINE ("ThreeGppPropagationLossModel");
static const double M_C = 3.0e8; // propagation velocity in free space static const double M_C = 3.0e8; //!< propagation velocity in free space
// ------------------------------------------------------------------------- // // ------------------------------------------------------------------------- //

View File

@@ -49,15 +49,15 @@ class Node;
/** /**
* \ingroup tap-bridge * \ingroup tap-bridge
* *
* \brief A bridge to make it appear that a real host process is connected to * \brief A bridge to make it appear that a real host process is connected to
* an ns-3 net device. * an ns-3 net device.
* *
* The Tap Bridge lives in a kind of a gray world somewhere between a * The Tap Bridge lives in a kind of a gray world somewhere between a
* Linux host and an ns-3 bridge device. From the Linux perspective, * Linux host and an ns-3 bridge device. From the Linux perspective,
* this code appears as the user mode handler for a Tap net device. That * this code appears as the user mode handler for a Tap net device. That
* is, when the Linux host writes to a /dev/tap device (that is either * is, when the Linux host writes to a /dev/tap device (that is either
* manually or automatically created depending on basic operating mode * manually or automatically created depending on basic operating mode
* -- more on this later), the write is redirected into the TapBridge that * -- more on this later), the write is redirected into the TapBridge that
* lives in the ns-3 world; and from this perspective, becomes a read. * lives in the ns-3 world; and from this perspective, becomes a read.
* In other words, a Linux process writes a packet to a tap device and * In other words, a Linux process writes a packet to a tap device and
@@ -70,7 +70,7 @@ class Node;
* the host using the Linux TAP mechanism. This write to the device will * the host using the Linux TAP mechanism. This write to the device will
* then appear to the Linux host as if a packet has arrived on its * then appear to the Linux host as if a packet has arrived on its
* device. * device.
* *
* The upshot is that the Tap Bridge appears to bridge a tap device on a * The upshot is that the Tap Bridge appears to bridge a tap device on a
* Linux host in the "real world" to an ns-3 net device in the simulation * Linux host in the "real world" to an ns-3 net device in the simulation
* and make is appear that a ns-3 net device is actually installed in the * and make is appear that a ns-3 net device is actually installed in the
@@ -81,12 +81,12 @@ class Node;
* Linux. This is not just arbitrary policy, it is because: * Linux. This is not just arbitrary policy, it is because:
* *
* - Bits sent to the Tap Bridge from higher layers in the ghost node (using * - Bits sent to the Tap Bridge from higher layers in the ghost node (using
* the TapBridge Send() method) are completely ignored. The Tap Bridge is * the TapBridge Send() method) are completely ignored. The Tap Bridge is
* not, itself, connected to any network, neither in Linux nor in ns-3; * not, itself, connected to any network, neither in Linux nor in ns-3;
* - The bridged ns-3 net device is has had its receive callback disconnected * - The bridged ns-3 net device is has had its receive callback disconnected
* from the ns-3 node and reconnected to the Tap Bridge. All data received * from the ns-3 node and reconnected to the Tap Bridge. All data received
* by a bridged device will be sent to the Linux host and will not be * by a bridged device will be sent to the Linux host and will not be
* received by the node. From the perspective of the ghost node, you can * received by the node. From the perspective of the ghost node, you can
* send over this device but you cannot ever receive. * send over this device but you cannot ever receive.
* *
* Of course, if you understand all of the issues you can take control of * Of course, if you understand all of the issues you can take control of
@@ -145,7 +145,7 @@ public:
* \param bridgedDevice device to set * \param bridgedDevice device to set
* *
* \attention The ns-3 net device that is being set as the device must have an * \attention The ns-3 net device that is being set as the device must have an
* an IP address assigned to it before the simulation is run. This address * an IP address assigned to it before the simulation is run. This address
* will be used to set the hardware address of the host Linux device. * will be used to set the hardware address of the host Linux device.
*/ */
void SetBridgedNetDevice (Ptr<NetDevice> bridgedDevice); void SetBridgedNetDevice (Ptr<NetDevice> bridgedDevice);
@@ -156,7 +156,7 @@ public:
* The tap bridge consumes a non-trivial amount of time to start. It starts * The tap bridge consumes a non-trivial amount of time to start. It starts
* up in the context of a scheduled event to ensure that all configuration * up in the context of a scheduled event to ensure that all configuration
* has been completed before extracting the configuration (IP addresses, etc.) * has been completed before extracting the configuration (IP addresses, etc.)
* In order to allow a more reasonable start-up sequence than a thundering * In order to allow a more reasonable start-up sequence than a thundering
* herd of devices, the time at which each device starts is also configurable * herd of devices, the time at which each device starts is also configurable
* bot via the Attribute system and via this call. * bot via the Attribute system and via this call.
* *
@@ -219,8 +219,8 @@ public:
protected: protected:
/** /**
* Call out to a separate process running as suid root in order to get our * Call out to a separate process running as suid root in order to get our
* tap device created. We do this to avoid having the entire simulation * tap device created. We do this to avoid having the entire simulation
* running as root. If this method returns, we'll have a socket waiting * running as root. If this method returns, we'll have a socket waiting
* for us in m_sock that we can use to talk to the tap device. * for us in m_sock that we can use to talk to the tap device.
*/ */
virtual void DoDispose (void); virtual void DoDispose (void);
@@ -253,8 +253,8 @@ private:
/** /**
* Call out to a separate process running as suid root in order to get our * Call out to a separate process running as suid root in order to get our
* tap device created. We do this to avoid having the entire simulation * tap device created. We do this to avoid having the entire simulation
* running as root. If this method returns, we'll have a socket waiting * running as root. If this method returns, we'll have a socket waiting
* for us in m_sock that we can use to talk to the tap device. * for us in m_sock that we can use to talk to the tap device.
*/ */
void CreateTap (void); void CreateTap (void);
@@ -271,11 +271,13 @@ private:
/** /**
* Callback to process packets that are read * Callback to process packets that are read
* \param buf input buffer
* \param len input buffer length
*/ */
void ReadCallback (uint8_t *buf, ssize_t len); void ReadCallback (uint8_t *buf, ssize_t len);
/** /**
* Forward a packet received from the tap device to the bridged ns-3 * Forward a packet received from the tap device to the bridged ns-3
* device * device
* *
* \param buf A character buffer containing the actual packet bits that were * \param buf A character buffer containing the actual packet bits that were
@@ -289,17 +291,17 @@ private:
* checking on a received packet to make sure it isn't too evil for our * checking on a received packet to make sure it isn't too evil for our
* poor naive virginal simulator to handle. * poor naive virginal simulator to handle.
* *
* \param packet The packet we received from the host, and which we need * \param packet The packet we received from the host, and which we need
* to check. * to check.
* \param src A pointer to the data structure that will get the source * \param src A pointer to the data structure that will get the source
* MAC address of the packet (extracted from the packet Ethernet * MAC address of the packet (extracted from the packet Ethernet
* header). * header).
* \param dst A pointer to the data structure that will get the destination * \param dst A pointer to the data structure that will get the destination
* MAC address of the packet (extracted from the packet Ethernet * MAC address of the packet (extracted from the packet Ethernet
* header). * header).
* \param type A pointer to the variable that will get the packet type from * \param type A pointer to the variable that will get the packet type from
* either the Ethernet header in the case of type interpretation * either the Ethernet header in the case of type interpretation
* (DIX framing) or from the 802.2 LLC header in the case of * (DIX framing) or from the 802.2 LLC header in the case of
* length interpretation (802.3 framing). * length interpretation (802.3 framing).
* \returns the packet, or null if the packet has been filtered. * \returns the packet, or null if the packet has been filtered.
*/ */
@@ -410,8 +412,8 @@ private:
/** /**
* The MAC address to use as the hardware address on the host; only used * The MAC address to use as the hardware address on the host; only used
* in UseLocal mode. This value comes from the MAC * in UseLocal mode. This value comes from the MAC
* address assigned to the bridged ns-3 net device and matches the MAC * address assigned to the bridged ns-3 net device and matches the MAC
* address of the underlying network TAP which we configured to have the * address of the underlying network TAP which we configured to have the
* same value. * same value.
*/ */
Mac48Address m_tapMac; Mac48Address m_tapMac;
@@ -438,7 +440,7 @@ private:
/** /**
* a copy of the node id so the read thread doesn't have to GetNode() in * a copy of the node id so the read thread doesn't have to GetNode() in
* in order to find the node ID. Thread unsafe reference counting in * in order to find the node ID. Thread unsafe reference counting in
* multithreaded apps is not a good thing. * multithreaded apps is not a good thing.
*/ */
uint32_t m_nodeId; uint32_t m_nodeId;

View File

@@ -129,16 +129,6 @@ static inline uint32_t ReciprocalDivide (uint32_t A, uint32_t R)
return (uint32_t)(((uint64_t)A * R) >> 32); return (uint32_t)(((uint64_t)A * R) >> 32);
} }
double min (double x, double y)
{
return (x < y) ? x : y;
}
double max (double x, double y)
{
return (x > y) ? x : y;
}
/** /**
* Returns the current time translated in CoDel time representation * Returns the current time translated in CoDel time representation
* \return the current time * \return the current time
@@ -408,7 +398,7 @@ void CobaltQueueDisc::CobaltQueueFull (int64_t now)
if (CoDelTimeAfter ((now - m_lastUpdateTimeBlue), Time2CoDel (m_target))) if (CoDelTimeAfter ((now - m_lastUpdateTimeBlue), Time2CoDel (m_target)))
{ {
NS_LOG_LOGIC ("inside IF block"); NS_LOG_LOGIC ("inside IF block");
m_pDrop = min (m_pDrop + m_increment, (double)1.0); m_pDrop = std::min (m_pDrop + m_increment, (double)1.0);
m_lastUpdateTimeBlue = now; m_lastUpdateTimeBlue = now;
} }
m_dropping = true; m_dropping = true;
@@ -425,7 +415,7 @@ void CobaltQueueDisc::CobaltQueueEmpty (int64_t now)
NS_LOG_FUNCTION (this); NS_LOG_FUNCTION (this);
if (m_pDrop && CoDelTimeAfter ((now - m_lastUpdateTimeBlue), Time2CoDel (m_target))) if (m_pDrop && CoDelTimeAfter ((now - m_lastUpdateTimeBlue), Time2CoDel (m_target)))
{ {
m_pDrop = max (m_pDrop - m_decrement, (double)0.0); m_pDrop = std::max (m_pDrop - m_decrement, (double)0.0);
m_lastUpdateTimeBlue = now; m_lastUpdateTimeBlue = now;
} }
m_dropping = false; m_dropping = false;
@@ -501,7 +491,7 @@ bool CobaltQueueDisc::CobaltShouldDrop (Ptr<QueueDiscItem> item, int64_t now)
isMarked = (m_useEcn && Mark (item, FORCED_MARK)); isMarked = (m_useEcn && Mark (item, FORCED_MARK));
drop = !isMarked; drop = !isMarked;
m_count = max (m_count, m_count + 1); m_count = std::max (m_count, m_count + 1);
InvSqrt (); InvSqrt ();
m_dropNext = ControlLaw (m_dropNext); m_dropNext = ControlLaw (m_dropNext);
@@ -530,7 +520,7 @@ bool CobaltQueueDisc::CobaltShouldDrop (Ptr<QueueDiscItem> item, int64_t now)
// Enable Blue Enhancement if sojourn time is greater than blueThreshold and its been m_target time until the last time blue was updated // Enable Blue Enhancement if sojourn time is greater than blueThreshold and its been m_target time until the last time blue was updated
if (CoDelTimeAfter (sojournTime, Time2CoDel (m_blueThreshold)) && CoDelTimeAfter ((now - m_lastUpdateTimeBlue), Time2CoDel (m_target))) if (CoDelTimeAfter (sojournTime, Time2CoDel (m_blueThreshold)) && CoDelTimeAfter ((now - m_lastUpdateTimeBlue), Time2CoDel (m_target)))
{ {
m_pDrop = min (m_pDrop + m_increment, (double)1.0); m_pDrop = std::min (m_pDrop + m_increment, (double)1.0);
m_lastUpdateTimeBlue = now; m_lastUpdateTimeBlue = now;
} }

View File

@@ -165,6 +165,9 @@ private:
*/ */
int64_t ControlLaw (int64_t t); int64_t ControlLaw (int64_t t);
/**
* \brief Updates the inverse square root
*/
void InvSqrt (void); void InvSqrt (void);
/** /**
@@ -210,7 +213,8 @@ private:
/** /**
* Called to decide whether the current packet should be dropped based on decisions taken by Blue and Codel working parallely * Called to decide whether the current packet should be dropped based on decisions taken by Blue and Codel working parallely
* Returns true if the packet should be dropped, false otherwise *
* \return true if the packet should be dropped, false otherwise
* \param item current packet * \param item current packet
* \param now time in CoDel time units (microseconds) * \param now time in CoDel time units (microseconds)
*/ */

View File

@@ -26,6 +26,7 @@
namespace ns3 { namespace ns3 {
/// Priority map
typedef std::array<uint16_t, 16> Priomap; typedef std::array<uint16_t, 16> Priomap;
/** /**
@@ -106,6 +107,7 @@ std::ostream &operator << (std::ostream &os, const Priomap &priomap);
*/ */
std::istream &operator >> (std::istream &is, Priomap &priomap); std::istream &operator >> (std::istream &is, Priomap &priomap);
ATTRIBUTE_HELPER_HEADER (Priomap); ATTRIBUTE_HELPER_HEADER (Priomap);
} // namespace ns3 } // namespace ns3

View File

@@ -107,7 +107,6 @@ public:
* Get the channel width over which the PPDU will effectively be * Get the channel width over which the PPDU will effectively be
* transmitted. * transmitted.
* *
* \param ppdu the PPDU to send
* \return the effective channel width (in MHz) used for the tranmsission * \return the effective channel width (in MHz) used for the tranmsission
*/ */
virtual uint16_t GetTransmissionChannelWidth (void) const; virtual uint16_t GetTransmissionChannelWidth (void) const;
@@ -117,7 +116,6 @@ public:
* channel. Normally, a PPDU can be received if it is transmitted over a * channel. Normally, a PPDU can be received if it is transmitted over a
* channel that overlaps the primary20 channel of a PHY entity. * channel that overlaps the primary20 channel of a PHY entity.
* *
* \param ppdu the given PPDU
* \param txCenterFreq the center frequency (MHz) of the channel over which the * \param txCenterFreq the center frequency (MHz) of the channel over which the
* PPDU is transmitted * PPDU is transmitted
* \param p20MinFreq the minimum frequency (MHz) of the primary channel * \param p20MinFreq the minimum frequency (MHz) of the primary channel

View File

@@ -21,7 +21,6 @@ class DataRange:
@param start start @param start start
@param end end @param end end
@param value value @param value value
@return none
""" """
self.start = start self.start = start
self.end = end self.end = end
@@ -37,7 +36,6 @@ class EventString:
@param self this object @param self this object
@param at you @param at you
@param value value @param value value
@return none
""" """
self.at = at self.at = at
self.value = value self.value = value
@@ -52,7 +50,6 @@ class EventFloat:
@param self this object @param self this object
@param at you @param at you
@param value value @param value value
@return none
""" """
self.at = at self.at = at
self.value = value self.value = value
@@ -67,7 +64,6 @@ class EventInt:
@param self this object @param self this object
@param at you @param at you
@param value value @param value value
@return none
""" """
self.at = at self.at = at
self.value = value self.value = value
@@ -97,7 +93,6 @@ class TimelineDataRange:
"""! Initializer """! Initializer
@param self this object @param self this object
@param name name @param name name
@return none
""" """
self.name = name self.name = name
self.ranges = [] self.ranges = []
@@ -194,7 +189,6 @@ class TimelineEvent:
"""! Get ranges bounds """! Get ranges bounds
@param self this object @param self this object
@param name name @param name name
@return none
""" """
self.name = name self.name = name
self.events = [] self.events = []
@@ -275,7 +269,6 @@ class Timeline:
"""! Initializer """! Initializer
@param self this object @param self this object
@param name name @param name name
@return none
""" """
self.ranges = [] self.ranges = []
self.event_str = [] self.event_str = []
@@ -447,7 +440,6 @@ class Color:
@param r: red @param r: red
@param g: green @param g: green
@param b: blue @param b: blue
@return none
""" """
self.r = r self.r = r
self.g = g self.g = g
@@ -475,7 +467,6 @@ class Colors:
def __init__(self): def __init__(self):
"""! Initializer """! Initializer
@param self this object @param self this object
@return none
""" """
self.__colors = {} self.__colors = {}
def add(self, name, color): def add(self, name, color):
@@ -511,7 +502,6 @@ class TopLegendRenderer:
def __init__(self): def __init__(self):
"""! Initializer """! Initializer
@param self this object @param self this object
@return none
""" """
self.__padding = 10 self.__padding = 10
def set_padding(self, padding): def set_padding(self, padding):
@@ -627,7 +617,6 @@ class TimelinesRenderer:
def __init__(self): def __init__(self):
"""! Initializer """! Initializer
@param self this object @param self this object
@return none
""" """
self.padding = 10 self.padding = 10
return return
@@ -863,7 +852,6 @@ class ScaleRenderer:
def __init__(self): def __init__(self):
"""! Initializer """! Initializer
@param self this object @param self this object
@return none
""" """
self.__top = 0 self.__top = 0
return return
@@ -1007,7 +995,6 @@ class GraphicRenderer:
@param self this object @param self this object
@param start start @param start start
@param end end @param end end
@return none
""" """
self.__start = float(start) self.__start = float(start)
self.__end = float(end) self.__end = float(end)
@@ -1301,7 +1288,6 @@ class GtkGraphicRenderer(gtk.DrawingArea):
"""! Initializer """! Initializer
@param self this object @param self this object
@param data data @param data data
@return none
""" """
super(GtkGraphicRenderer, self).__init__() super(GtkGraphicRenderer, self).__init__()
self.__data = data self.__data = data
@@ -1542,7 +1528,6 @@ class MainWindow:
def __init__(self): def __init__(self):
"""! Initializer """! Initializer
@param self this object @param self this object
@return none
""" """
return return
def run(self, graphic): def run(self, graphic):

View File

@@ -1053,7 +1053,7 @@ PrintAllAttributes (std::ostream & os)
os << commentStart << page << "AttributeList All Attributes\n" os << commentStart << page << "AttributeList All Attributes\n"
<< std::endl; << std::endl;
os << "This is a list of all" << reference << "ns3::Attribute classes. " os << "This is a list of all" << reference << "ns3::Attribute classes. "
<< "For more information see the" << reference << "ns3:Attributes " << "For more information see the" << reference << "ns3::Attributes "
<< "section of this API documentation and the Attributes sections " << "section of this API documentation and the Attributes sections "
<< "in the Tutorial and Manual.\n" << "in the Tutorial and Manual.\n"
<< std::endl; << std::endl;
@@ -1524,6 +1524,8 @@ PrintAttributeImplementations (std::ostream & os)
{ "OrganizationIdentifier", { "OrganizationIdentifier",
"OrganizationIdentifier", "OrganizationIdentifier",
true, "vendor-specific-action.h" }, true, "vendor-specific-action.h" },
{ "Priomap", "Priomap", true, "prio-queue-disc.h" },
{ "QueueSize", "QueueSize", true, "queue-size.h" },
{ "Rectangle", "Rectangle", true, "rectangle.h" }, { "Rectangle", "Rectangle", true, "rectangle.h" },
{ "Ssid", "Ssid", true, "ssid.h" }, { "Ssid", "Ssid", true, "ssid.h" },
{ "TypeId", "TypeId", true, "type-id.h" }, { "TypeId", "TypeId", true, "type-id.h" },

View File

@@ -70,7 +70,6 @@ class TestBaseClass:
@param argv argument list @param argv argument list
@param desc description @param desc description
@param mode test mode @param mode test mode
@return none
""" """
self.my_env = os.environ self.my_env = os.environ
set_workdir() set_workdir()