Fix casing of classes, structs and enums to start with an uppercase letter

This commit is contained in:
Eduardo Almeida
2022-12-07 18:22:56 +00:00
parent 5934ee398f
commit e3b8bc49b5
23 changed files with 142 additions and 147 deletions

View File

@@ -98,7 +98,7 @@ class Fnv1a : public Implementation
/**
* Seed value
*/
enum seed
enum Seed
{
SEED = 0x8BADF00D /**< Ate bad food */
};

View File

@@ -101,7 +101,7 @@ class Murmur3 : public Implementation
* This has to be a constant for all MPI ranks to generate
* the same hash from the same string.
*/
enum seed
enum Seed
{
SEED = 0x8BADF00D // Ate bad food
};

View File

@@ -40,7 +40,7 @@ namespace ns3
* \ingroup ptr
* \brief Empty class, used as a default parent class for SimpleRefCount
*/
class empty
class Empty
{
};
@@ -66,7 +66,7 @@ class empty
* common C++ template pattern whose name is CRTP (Curiously
* Recursive Template Pattern)
* \tparam PARENT \explicit The typename of the parent of this template.
* By default, this typename is "'ns3::empty'" which is an empty
* By default, this typename is "'ns3::Empty'" which is an empty
* class: compilers which implement the EBCO optimization (empty
* base class optimization) will make this a no-op
* \tparam DELETER \explicit The typename of a class which implements
@@ -76,7 +76,7 @@ class empty
*
* Interesting users of this class include ns3::Object as well as ns3::Packet.
*/
template <typename T, typename PARENT = empty, typename DELETER = DefaultDeleter<T>>
template <typename T, typename PARENT = Empty, typename DELETER = DefaultDeleter<T>>
class SimpleRefCount : public PARENT
{
public:

View File

@@ -61,14 +61,14 @@ TcpOption::GetInstanceTypeId() const
Ptr<TcpOption>
TcpOption::CreateOption(uint8_t kind)
{
struct kindToTid
struct KindToTid
{
TcpOption::Kind kind;
TypeId tid;
};
static ObjectFactory objectFactory;
static kindToTid toTid[] = {
static KindToTid toTid[] = {
{TcpOption::END, TcpOptionEnd::GetTypeId()},
{TcpOption::MSS, TcpOptionMSS::GetTypeId()},
{TcpOption::NOP, TcpOptionNOP::GetTypeId()},
@@ -79,7 +79,7 @@ TcpOption::CreateOption(uint8_t kind)
{TcpOption::UNKNOWN, TcpOptionUnknown::GetTypeId()},
};
for (unsigned int i = 0; i < sizeof(toTid) / sizeof(kindToTid); ++i)
for (unsigned int i = 0; i < sizeof(toTid) / sizeof(KindToTid); ++i)
{
if (toTid[i].kind == kind)
{

View File

@@ -224,7 +224,7 @@ class GtsFields
/**
* GTS Descriptor
*/
struct gtsDescriptor
struct GtsDescriptor
{
Mac16Address m_gtsDescDevShortAddr; //!< GTS Descriptor Device Short Address (Bit 0-15)
uint8_t m_gtsDescStartSlot; //!< GTS Descriptor GTS Starting Slot(Bit 16-19)
@@ -239,7 +239,7 @@ class GtsFields
uint8_t m_gtsDirMask; //!< GTS Direction field Directions Mask (Bit 0-6)
// GTS Direction field Reserved (Not Necessary) (Bit 7)
// GTS List
gtsDescriptor m_gtsList[7]; //!< GTS List field (maximum descriptors stored == 7)
GtsDescriptor m_gtsList[7]; //!< GTS List field (maximum descriptors stored == 7)
};
/**

View File

@@ -93,7 +93,7 @@ class LteRrcSap
struct RlcConfig
{
/// the direction choice
enum direction
enum Direction
{
AM,
UM_BI_DIRECTIONAL,
@@ -101,7 +101,7 @@ class LteRrcSap
UM_UNI_DIRECTIONAL_DL
};
direction choice; ///< direction choice
Direction choice; ///< direction choice
};
/// LogicalChannelConfig structure
@@ -117,13 +117,13 @@ class LteRrcSap
struct SoundingRsUlConfigCommon
{
/// the config action
enum action
enum Action
{
SETUP,
RESET
};
action type; ///< action type
Action type; ///< action type
uint16_t srsBandwidthConfig; ///< SRS bandwidth config
uint8_t srsSubframeConfig; ///< SRS subframe config
@@ -133,13 +133,13 @@ class LteRrcSap
struct SoundingRsUlConfigDedicated
{
/// the config action
enum action
enum Action
{
SETUP,
RESET
};
action type; ///< action type
Action type; ///< action type
uint16_t srsBandwidth; ///< SRS bandwidth
uint16_t srsConfigIndex; ///< SRS config index
@@ -165,7 +165,7 @@ class LteRrcSap
* P_A values, TS 36.331 6.3.2 PDSCH-Config
* ENUMERATED { dB-6, dB-4dot77, dB-3, dB-1dot77, dB0, dB1, dB2, dB3 }
*/
enum db
enum Db
{
dB_6,
dB_4dot77,
@@ -411,13 +411,13 @@ class LteRrcSap
uint16_t timeToTrigger;
/// the report purpose
enum report
enum Report
{
REPORT_STRONGEST_CELLS,
REPORT_CGI
};
report purpose; ///< purpose
Report purpose; ///< purpose
/// Trigger type enumeration
enum
@@ -495,22 +495,22 @@ class LteRrcSap
struct MeasGapConfig
{
/// the action type
enum action
enum Action
{
SETUP,
RESET
};
action type; ///< action type
Action type; ///< action type
/// the gap offset
enum gap
enum Gap
{
GP0,
GP1
};
gap gapOffsetChoice; ///< gap offset
Gap gapOffsetChoice; ///< gap offset
uint8_t gapOffsetValue; ///< gap offset value
};
@@ -536,13 +536,13 @@ class LteRrcSap
struct SpeedStatePars
{
/// the action type
enum action
enum Action
{
SETUP,
RESET
};
action type; ///< action type
Action type; ///< action type
MobilityStateParameters mobilityStateParameters; ///< mobility state parameters
SpeedStateScaleFactors timeToTriggerSf; ///< time to trigger scale factors

View File

@@ -161,13 +161,13 @@ IeConfiguration::DeserializeInformationField(Buffer::Iterator i, uint16_t length
{
Buffer::Iterator start = i;
// Active Path Selection Protocol ID:
m_APSPId = (dot11sPathSelectionProtocol)i.ReadU8();
m_APSPId = (Dot11sPathSelectionProtocol)i.ReadU8();
// Active Path Metric ID:
m_APSMId = (dot11sPathSelectionMetric)i.ReadU8();
m_APSMId = (Dot11sPathSelectionMetric)i.ReadU8();
// Congestion Control Mode ID:
m_CCMId = (dot11sCongestionControlMode)i.ReadU8();
m_SPId = (dot11sSynchronizationProtocolIdentifier)i.ReadU8();
m_APId = (dot11sAuthenticationProtocol)i.ReadU8();
m_CCMId = (Dot11sCongestionControlMode)i.ReadU8();
m_SPId = (Dot11sSynchronizationProtocolIdentifier)i.ReadU8();
m_APId = (Dot11sAuthenticationProtocol)i.ReadU8();
m_neighbors = (i.ReadU8() >> 1) & 0xF;
i = m_meshCap.Deserialize(i);
return i.GetDistanceFrom(start);
@@ -187,13 +187,13 @@ IeConfiguration::Print(std::ostream& os) const
}
void
IeConfiguration::SetRouting(dot11sPathSelectionProtocol routingId)
IeConfiguration::SetRouting(Dot11sPathSelectionProtocol routingId)
{
m_APSPId = routingId;
}
void
IeConfiguration::SetMetric(dot11sPathSelectionMetric metricId)
IeConfiguration::SetMetric(Dot11sPathSelectionMetric metricId)
{
m_APSMId = metricId;
}

View File

@@ -31,33 +31,33 @@ namespace dot11s
// according to IEEE 802.11 - 2012
// in 7.3.2.98.2 Active Path Selection Protocol Identifier - 802.11s-2011
enum dot11sPathSelectionProtocol
enum Dot11sPathSelectionProtocol
{
PROTOCOL_HWMP = 0x01,
};
// in 7.3.2.98.3 Active Path Selection Metric Identifier - 802.11s-2011
enum dot11sPathSelectionMetric
enum Dot11sPathSelectionMetric
{
METRIC_AIRTIME = 0x01,
};
// in 7.3.2.98.4 Congestion Control Mode Identifier - 802.11s-2011
enum dot11sCongestionControlMode
enum Dot11sCongestionControlMode
{
CONGESTION_SIGNALING = 0x01,
CONGESTION_NULL = 0x00,
};
// in 7.3.2.98.5 Synchronization Method Identifier - 802.11s-2011
enum dot11sSynchronizationProtocolIdentifier
enum Dot11sSynchronizationProtocolIdentifier
{
SYNC_NEIGHBOUR_OFFSET = 0x01, // Neighbor offset synchronization method
SYNC_NULL = 0x00, // Reserved
};
// in 7.3.2.98.6 Authentication Protocol Identifier - 802.11s-2011
enum dot11sAuthenticationProtocol
enum Dot11sAuthenticationProtocol
{
AUTH_NULL =
0x00, // No authentication method is required to establish mesh peerings within the MBSS
@@ -134,12 +134,12 @@ class IeConfiguration : public WifiInformationElement
* Set routing value
* \param routingId the routing ID
*/
void SetRouting(dot11sPathSelectionProtocol routingId);
void SetRouting(Dot11sPathSelectionProtocol routingId);
/**
* Set metric value
* \param metricId the path selection metric
*/
void SetMetric(dot11sPathSelectionMetric metricId);
void SetMetric(Dot11sPathSelectionMetric metricId);
/**
* Is HWMP function
* \returns true if Active Path Selection Protocol Identifier field set
@@ -177,15 +177,15 @@ class IeConfiguration : public WifiInformationElement
private:
/** Active Path Selection Protocol ID */
dot11sPathSelectionProtocol m_APSPId;
Dot11sPathSelectionProtocol m_APSPId;
/** Active Path Metric ID */
dot11sPathSelectionMetric m_APSMId;
Dot11sPathSelectionMetric m_APSMId;
/** Congestion Control Mode ID */
dot11sCongestionControlMode m_CCMId;
Dot11sCongestionControlMode m_CCMId;
/** Sync protocol ID */
dot11sSynchronizationProtocolIdentifier m_SPId;
Dot11sSynchronizationProtocolIdentifier m_SPId;
/** Auth protocol ID */
dot11sAuthenticationProtocol m_APId;
Dot11sAuthenticationProtocol m_APId;
/** Mesh capability */
Dot11sMeshCapability m_meshCap;
uint8_t m_neighbors; ///< neighbors

View File

@@ -30,14 +30,14 @@ using namespace ns3;
AnimationInterface* pAnim = nullptr;
/// RGB structure
struct rgb
struct Rgb
{
uint8_t r; ///< red
uint8_t g; ///< green
uint8_t b; ///< blue
};
rgb colors[] = {
Rgb colors[] = {
{255, 0, 0}, // Red
{0, 255, 0}, // Blue
{0, 0, 255}, // Green
@@ -72,7 +72,7 @@ modify()
{
index = 0;
}
rgb color = colors[index];
Rgb color = colors[index];
for (uint32_t nodeId = 4; nodeId < 12; ++nodeId)
{
pAnim->UpdateNodeColor(nodeId, color.r, color.g, color.b);

View File

@@ -30,14 +30,14 @@ using namespace ns3;
AnimationInterface* pAnim = nullptr;
/// RGB struture
struct rgb
struct Rgb
{
uint8_t r; ///< red
uint8_t g; ///< green
uint8_t b; ///< blue
};
rgb colors[] = {
Rgb colors[] = {
{255, 0, 0}, // Red
{0, 255, 0}, // Blue
{0, 0, 255}, // Green
@@ -96,7 +96,7 @@ modify()
{
index = 0;
}
rgb color = colors[index];
Rgb color = colors[index];
for (uint32_t nodeId = 4; nodeId < 12; ++nodeId)
{
pAnim->UpdateNodeColor(nodeId, color.r, color.g, color.b);

View File

@@ -34,7 +34,7 @@ using namespace ns3;
*
* \brief Queue Disc Test Item
*/
class qdTestItem : public QueueDiscItem
class QdTestItem : public QueueDiscItem
{
public:
/**
@@ -43,28 +43,28 @@ class qdTestItem : public QueueDiscItem
* \param p the packet
* \param addr the address
*/
qdTestItem(Ptr<Packet> p, const Address& addr);
~qdTestItem() override;
QdTestItem(Ptr<Packet> p, const Address& addr);
~QdTestItem() override;
void AddHeader() override;
bool Mark() override;
};
qdTestItem::qdTestItem(Ptr<Packet> p, const Address& addr)
QdTestItem::QdTestItem(Ptr<Packet> p, const Address& addr)
: QueueDiscItem(p, addr, 0)
{
}
qdTestItem::~qdTestItem()
QdTestItem::~QdTestItem()
{
}
void
qdTestItem::AddHeader()
QdTestItem::AddHeader()
{
}
bool
qdTestItem::Mark()
QdTestItem::Mark()
{
return false;
}
@@ -450,7 +450,7 @@ QueueDiscTracesTestCase::DoRun()
// Enqueue 4 packets. They must all be enqueued
for (uint16_t i = 1; i <= 4; i++)
{
root->Enqueue(Create<qdTestItem>(Create<Packet>(pktSizeUnit * i), dest));
root->Enqueue(Create<QdTestItem>(Create<Packet>(pktSizeUnit * i), dest));
CheckQueued(root, i, pktSizeUnit * i * (i + 1) / 2);
CheckDroppedBeforeEnqueue(root, 0, 0);
@@ -463,7 +463,7 @@ QueueDiscTracesTestCase::DoRun()
// The fifth packet is dropped before enqueue by the child queue disc.
// The packet drop is notified to the root queue disc.
root->Enqueue(Create<qdTestItem>(Create<Packet>(pktSizeUnit * 5), dest));
root->Enqueue(Create<QdTestItem>(Create<Packet>(pktSizeUnit * 5), dest));
CheckQueued(root, 4, pktSizeUnit * 10);
CheckDroppedBeforeEnqueue(root, 1, pktSizeUnit * 5);
@@ -559,7 +559,7 @@ QueueDiscTracesTestCase::DoRun()
CheckDroppedAfterDequeue(child, 2, pktSizeUnit * 3);
// Enqueue one packet.
root->Enqueue(Create<qdTestItem>(Create<Packet>(pktSizeUnit), dest));
root->Enqueue(Create<QdTestItem>(Create<Packet>(pktSizeUnit), dest));
CheckQueued(root, 1, pktSizeUnit);
CheckDroppedBeforeEnqueue(root, 1, pktSizeUnit * 5);

View File

@@ -26,7 +26,7 @@
namespace ns3
{
/// boolean vector typedef
typedef std::vector<bool> bvec;
typedef std::vector<bool> Bvec;
} // namespace ns3
#endif /* BVEC_H */

View File

@@ -85,7 +85,7 @@ IpcsClassifierRecord::IpcsClassifierRecord(Tlv tlv)
}
case ClassificationRuleVectorTlvValue::IP_src: {
Ipv4AddressTlvValue* list = (Ipv4AddressTlvValue*)(*iter)->PeekValue();
for (std::vector<Ipv4AddressTlvValue::ipv4Addr>::const_iterator iter2 = list->Begin();
for (std::vector<Ipv4AddressTlvValue::Ipv4Addr>::const_iterator iter2 = list->Begin();
iter2 != list->End();
++iter2)
{
@@ -95,7 +95,7 @@ IpcsClassifierRecord::IpcsClassifierRecord(Tlv tlv)
}
case ClassificationRuleVectorTlvValue::IP_dst: {
Ipv4AddressTlvValue* list = (Ipv4AddressTlvValue*)(*iter)->PeekValue();
for (std::vector<Ipv4AddressTlvValue::ipv4Addr>::const_iterator iter2 = list->Begin();
for (std::vector<Ipv4AddressTlvValue::Ipv4Addr>::const_iterator iter2 = list->Begin();
iter2 != list->End();
++iter2)
{
@@ -158,7 +158,7 @@ IpcsClassifierRecord::IpcsClassifierRecord(Ipv4Address SrcAddress,
void
IpcsClassifierRecord::AddSrcAddr(Ipv4Address srcAddress, Ipv4Mask srcMask)
{
ipv4Addr tmp;
Ipv4Addr tmp;
tmp.Address = srcAddress;
tmp.Mask = srcMask;
m_srcAddr.push_back(tmp);
@@ -167,7 +167,7 @@ IpcsClassifierRecord::AddSrcAddr(Ipv4Address srcAddress, Ipv4Mask srcMask)
void
IpcsClassifierRecord::AddDstAddr(Ipv4Address dstAddress, Ipv4Mask dstMask)
{
ipv4Addr tmp;
Ipv4Addr tmp;
tmp.Address = dstAddress;
tmp.Mask = dstMask;
m_dstAddr.push_back(tmp);
@@ -236,7 +236,7 @@ IpcsClassifierRecord::GetPriority() const
bool
IpcsClassifierRecord::CheckMatchSrcAddr(Ipv4Address srcAddress) const
{
for (std::vector<ipv4Addr>::const_iterator iter = m_srcAddr.begin(); iter != m_srcAddr.end();
for (std::vector<Ipv4Addr>::const_iterator iter = m_srcAddr.begin(); iter != m_srcAddr.end();
++iter)
{
NS_LOG_INFO("src addr check match: pkt=" << srcAddress << " cls=" << (*iter).Address << "/"
@@ -253,7 +253,7 @@ IpcsClassifierRecord::CheckMatchSrcAddr(Ipv4Address srcAddress) const
bool
IpcsClassifierRecord::CheckMatchDstAddr(Ipv4Address dstAddress) const
{
for (std::vector<ipv4Addr>::const_iterator iter = m_dstAddr.begin(); iter != m_dstAddr.end();
for (std::vector<Ipv4Addr>::const_iterator iter = m_dstAddr.begin(); iter != m_dstAddr.end();
++iter)
{
NS_LOG_INFO("dst addr check match: pkt=" << dstAddress << " cls=" << (*iter).Address << "/"
@@ -334,14 +334,14 @@ Tlv
IpcsClassifierRecord::ToTlv() const
{
Ipv4AddressTlvValue ipv4AddrValSrc;
for (std::vector<ipv4Addr>::const_iterator iter = m_srcAddr.begin(); iter != m_srcAddr.end();
for (std::vector<Ipv4Addr>::const_iterator iter = m_srcAddr.begin(); iter != m_srcAddr.end();
++iter)
{
ipv4AddrValSrc.Add((*iter).Address, (*iter).Mask);
}
Ipv4AddressTlvValue ipv4AddrValDst;
for (std::vector<ipv4Addr>::const_iterator iter = m_dstAddr.begin(); iter != m_dstAddr.end();
for (std::vector<Ipv4Addr>::const_iterator iter = m_dstAddr.begin(); iter != m_dstAddr.end();
++iter)
{
ipv4AddrValDst.Add((*iter).Address, (*iter).Mask);

View File

@@ -183,8 +183,8 @@ class IpcsClassifierRecord
uint16_t PortHigh; ///< port high
};
/// ipv4Addr structure
struct ipv4Addr
/// Ipv4Addr structure
struct Ipv4Addr
{
Ipv4Address Address; ///< IP address
Ipv4Mask Mask; ///< net mask
@@ -196,8 +196,8 @@ class IpcsClassifierRecord
uint8_t m_tosHigh; ///< TOS high
uint8_t m_tosMask; ///< TOS mask
std::vector<uint8_t> m_protocol; ///< protocol
std::vector<ipv4Addr> m_srcAddr; ///< source address
std::vector<ipv4Addr> m_dstAddr; ///< destination address
std::vector<Ipv4Addr> m_srcAddr; ///< source address
std::vector<Ipv4Addr> m_dstAddr; ///< destination address
std::vector<PortRange> m_srcPortRange; ///< source port range
std::vector<PortRange> m_dstPortRange; ///< destination port range

View File

@@ -376,8 +376,6 @@ class RngRsp : public Header
namespace ns3
{
class serviceFlow;
/**
* \ingroup wimax
* This class implements the DSA-REQ message described by "IEEE Standard for

View File

@@ -25,7 +25,7 @@
namespace ns3
{
simpleOfdmSendParam::simpleOfdmSendParam()
SimpleOfdmSendParam::SimpleOfdmSendParam()
{
// m_fecBlock = 0;
m_burstSize = 0;
@@ -36,7 +36,7 @@ simpleOfdmSendParam::simpleOfdmSendParam()
m_rxPowerDbm = 0;
}
simpleOfdmSendParam::simpleOfdmSendParam(const bvec& fecBlock,
SimpleOfdmSendParam::SimpleOfdmSendParam(const Bvec& fecBlock,
uint32_t burstSize,
bool isFirstBlock,
uint64_t Frequency,
@@ -53,7 +53,7 @@ simpleOfdmSendParam::simpleOfdmSendParam(const bvec& fecBlock,
m_rxPowerDbm = rxPowerDbm;
}
simpleOfdmSendParam::simpleOfdmSendParam(uint32_t burstSize,
SimpleOfdmSendParam::SimpleOfdmSendParam(uint32_t burstSize,
bool isFirstBlock,
uint64_t Frequency,
WimaxPhy::ModulationType modulationType,
@@ -70,96 +70,96 @@ simpleOfdmSendParam::simpleOfdmSendParam(uint32_t burstSize,
m_burst = burst;
}
simpleOfdmSendParam::~simpleOfdmSendParam()
SimpleOfdmSendParam::~SimpleOfdmSendParam()
{
}
void
simpleOfdmSendParam::SetFecBlock(const bvec& fecBlock)
SimpleOfdmSendParam::SetFecBlock(const Bvec& fecBlock)
{
m_fecBlock = fecBlock;
}
void
simpleOfdmSendParam::SetBurstSize(uint32_t burstSize)
SimpleOfdmSendParam::SetBurstSize(uint32_t burstSize)
{
m_burstSize = burstSize;
}
void
simpleOfdmSendParam::SetIsFirstBlock(bool isFirstBlock)
SimpleOfdmSendParam::SetIsFirstBlock(bool isFirstBlock)
{
m_isFirstBlock = isFirstBlock;
}
void
simpleOfdmSendParam::SetFrequency(uint64_t Frequency)
SimpleOfdmSendParam::SetFrequency(uint64_t Frequency)
{
m_frequency = Frequency;
}
void
simpleOfdmSendParam::SetModulationType(WimaxPhy::ModulationType modulationType)
SimpleOfdmSendParam::SetModulationType(WimaxPhy::ModulationType modulationType)
{
m_modulationType = modulationType;
}
void
simpleOfdmSendParam::SetDirection(uint8_t direction)
SimpleOfdmSendParam::SetDirection(uint8_t direction)
{
m_direction = direction;
}
void
simpleOfdmSendParam::SetRxPowerDbm(double rxPowerDbm)
SimpleOfdmSendParam::SetRxPowerDbm(double rxPowerDbm)
{
m_rxPowerDbm = rxPowerDbm;
}
bvec
simpleOfdmSendParam::GetFecBlock()
Bvec
SimpleOfdmSendParam::GetFecBlock()
{
return m_fecBlock;
}
uint32_t
simpleOfdmSendParam::GetBurstSize()
SimpleOfdmSendParam::GetBurstSize()
{
return m_burstSize;
}
bool
simpleOfdmSendParam::GetIsFirstBlock()
SimpleOfdmSendParam::GetIsFirstBlock()
{
return m_isFirstBlock;
}
uint64_t
simpleOfdmSendParam::GetFrequency()
SimpleOfdmSendParam::GetFrequency()
{
return m_frequency;
}
WimaxPhy::ModulationType
simpleOfdmSendParam::GetModulationType()
SimpleOfdmSendParam::GetModulationType()
{
return m_modulationType;
}
uint8_t
simpleOfdmSendParam::GetDirection()
SimpleOfdmSendParam::GetDirection()
{
return m_direction;
}
double
simpleOfdmSendParam::GetRxPowerDbm()
SimpleOfdmSendParam::GetRxPowerDbm()
{
return m_rxPowerDbm;
}
Ptr<PacketBurst>
simpleOfdmSendParam::GetBurst()
SimpleOfdmSendParam::GetBurst()
{
return m_burst;
}

View File

@@ -34,12 +34,12 @@ namespace ns3
/**
* \ingroup wimax
* simpleOfdmSendParam class
* SimpleOfdmSendParam class
*/
class simpleOfdmSendParam
class SimpleOfdmSendParam
{
public:
simpleOfdmSendParam();
SimpleOfdmSendParam();
/**
* Constructor
*
@@ -51,7 +51,7 @@ class simpleOfdmSendParam
* \param direction the direction
* \param rxPowerDbm receive power
*/
simpleOfdmSendParam(const bvec& fecBlock,
SimpleOfdmSendParam(const Bvec& fecBlock,
uint32_t burstSize,
bool isFirstBlock,
uint64_t Frequency,
@@ -69,19 +69,19 @@ class simpleOfdmSendParam
* \param rxPowerDbm receive power
* \param burst packet burst object
*/
simpleOfdmSendParam(uint32_t burstSize,
SimpleOfdmSendParam(uint32_t burstSize,
bool isFirstBlock,
uint64_t Frequency,
WimaxPhy::ModulationType modulationType,
uint8_t direction,
double rxPowerDbm,
Ptr<PacketBurst> burst);
~simpleOfdmSendParam();
~SimpleOfdmSendParam();
/**
* \brief sent the fec block to send
* \param fecBlock the fec block to send
*/
void SetFecBlock(const bvec& fecBlock);
void SetFecBlock(const Bvec& fecBlock);
/**
* \brief set the burst size
* \param burstSize the burst size in bytes
@@ -111,7 +111,7 @@ class simpleOfdmSendParam
/**
* \return the fec block
*/
bvec GetFecBlock();
Bvec GetFecBlock();
/**
* \return the burst size
*/
@@ -142,7 +142,7 @@ class simpleOfdmSendParam
Ptr<PacketBurst> GetBurst();
private:
bvec m_fecBlock; ///< FEC block
Bvec m_fecBlock; ///< FEC block
uint32_t m_burstSize; ///< burst size
bool m_isFirstBlock; ///< is first block
uint64_t m_frequency; ///< frequency

View File

@@ -159,7 +159,7 @@ SimpleOfdmWimaxChannel::Send(Time BlockTime,
Ptr<MobilityModel> senderMobility = nullptr;
Ptr<MobilityModel> receiverMobility = nullptr;
senderMobility = phy->GetDevice()->GetNode()->GetObject<MobilityModel>();
simpleOfdmSendParam* param;
SimpleOfdmSendParam* param;
for (std::list<Ptr<SimpleOfdmWimaxPhy>>::iterator iter = m_phyList.begin();
iter != m_phyList.end();
++iter)
@@ -176,7 +176,7 @@ SimpleOfdmWimaxChannel::Send(Time BlockTime,
rxPowerDbm = m_loss->CalcRxPower(txPowerDbm, senderMobility, receiverMobility);
}
param = new simpleOfdmSendParam(burstSize,
param = new SimpleOfdmSendParam(burstSize,
isFirstBlock,
frequency,
modulationType,
@@ -204,7 +204,7 @@ SimpleOfdmWimaxChannel::Send(Time BlockTime,
}
void
SimpleOfdmWimaxChannel::EndSendDummyBlock(Ptr<SimpleOfdmWimaxPhy> rxphy, simpleOfdmSendParam* param)
SimpleOfdmWimaxChannel::EndSendDummyBlock(Ptr<SimpleOfdmWimaxPhy> rxphy, SimpleOfdmSendParam* param)
{
rxphy->StartReceive(param->GetBurstSize(),
param->GetIsFirstBlock(),

View File

@@ -122,9 +122,9 @@ class SimpleOfdmWimaxChannel : public WimaxChannel
/**
* End send dummy block function
* \param rxphy the Ptr<SimpleOfdmWimaxPhy>
* \param param the simpleOfdmSendParam *
* \param param the SimpleOfdmSendParam *
*/
void EndSendDummyBlock(Ptr<SimpleOfdmWimaxPhy> rxphy, simpleOfdmSendParam* param);
void EndSendDummyBlock(Ptr<SimpleOfdmWimaxPhy> rxphy, SimpleOfdmSendParam* param);
/**
* Get device function
* \param i the device index

View File

@@ -173,8 +173,8 @@ SimpleOfdmWimaxPhy::InitSimpleOfdmWimaxPhy()
m_nfft = 256;
m_g = 1.0 / 4;
SetNrCarriers(192);
m_fecBlocks = new std::list<bvec>;
m_receivedFecBlocks = new std::list<bvec>;
m_fecBlocks = new std::list<Bvec>;
m_receivedFecBlocks = new std::list<Bvec>;
m_currentBurstSize = 0;
m_noiseFigure = 5; // dB
m_txPower = 30; // dBm
@@ -500,10 +500,10 @@ SimpleOfdmWimaxPhy::EndReceive(Ptr<const PacketBurst> burst)
m_traceRx(burst);
}
bvec
Bvec
SimpleOfdmWimaxPhy::ConvertBurstToBits(Ptr<const PacketBurst> burst)
{
bvec buffer(burst->GetSize() * 8, 0);
Bvec buffer(burst->GetSize() * 8, 0);
std::list<Ptr<Packet>> packets = burst->GetPackets();
@@ -514,7 +514,7 @@ SimpleOfdmWimaxPhy::ConvertBurstToBits(Ptr<const PacketBurst> burst)
uint8_t* pstart = (uint8_t*)std::malloc(packet->GetSize());
std::memset(pstart, 0, packet->GetSize());
packet->CopyData(pstart, packet->GetSize());
bvec temp(8);
Bvec temp(8);
temp.resize(0, 0);
temp.resize(8, 0);
for (uint32_t i = 0; i < packet->GetSize(); i++)
@@ -533,21 +533,21 @@ SimpleOfdmWimaxPhy::ConvertBurstToBits(Ptr<const PacketBurst> burst)
}
/*
Converts back the bit buffer (bvec) to the actual burst.
Actually creates byte buffer from the bvec and resets the buffer
of each packet in the copy of the orifinal burst stored before transmitting.
Converts back the bit buffer (Bvec) to the actual burst.
Actually creates byte buffer from the Bvec and resets the buffer
of each packet in the copy of the original burst stored before transmitting.
By doing this it preserves the metadata and tags in the packet.
Function could also be named DeserializeBurst because actually it
copying to the burst's byte buffer.
*/
Ptr<PacketBurst>
SimpleOfdmWimaxPhy::ConvertBitsToBurst(bvec buffer)
SimpleOfdmWimaxPhy::ConvertBitsToBurst(Bvec buffer)
{
uint8_t init[buffer.size() / 8];
uint8_t* pstart = init;
uint8_t temp;
int32_t j = 0;
// recreating byte buffer from bit buffer (bvec)
// recreating byte buffer from bit buffer (Bvec)
for (uint32_t i = 0; i < buffer.size(); i += 8)
{
temp = 0;
@@ -592,34 +592,34 @@ SimpleOfdmWimaxPhy::ConvertBitsToBurst(bvec buffer)
}
void
SimpleOfdmWimaxPhy::CreateFecBlocks(const bvec& buffer, WimaxPhy::ModulationType modulationType)
SimpleOfdmWimaxPhy::CreateFecBlocks(const Bvec& buffer, WimaxPhy::ModulationType modulationType)
{
bvec fecBlock(m_blockSize);
Bvec fecBlock(m_blockSize);
for (uint32_t i = 0, j = m_nrBlocks; j > 0; i += m_blockSize, j--)
{
if (j == 1 && m_paddingBits > 0) // last block can be smaller than block size
{
fecBlock = bvec(buffer.begin() + i, buffer.end());
fecBlock = Bvec(buffer.begin() + i, buffer.end());
fecBlock.resize(m_blockSize, 0);
}
else
{
fecBlock = bvec(buffer.begin() + i, buffer.begin() + i + m_blockSize);
fecBlock = Bvec(buffer.begin() + i, buffer.begin() + i + m_blockSize);
}
m_fecBlocks->push_back(fecBlock);
}
}
bvec
Bvec
SimpleOfdmWimaxPhy::RecreateBuffer()
{
bvec buffer(m_blockSize * (unsigned long)m_nrBlocks);
bvec block(m_blockSize);
Bvec buffer(m_blockSize * (unsigned long)m_nrBlocks);
Bvec block(m_blockSize);
uint32_t i = 0;
for (uint32_t j = 0; j < m_nrBlocks; j++)
{
bvec tmpRecFecBloc = m_receivedFecBlocks->front();
Bvec tmpRecFecBloc = m_receivedFecBlocks->front();
buffer.insert(buffer.begin() + i, tmpRecFecBloc.begin(), tmpRecFecBloc.end());
m_receivedFecBlocks->pop_front();
i += m_blockSize;

View File

@@ -241,24 +241,24 @@ class SimpleOfdmWimaxPhy : public WimaxPhy
* \param burst the packet burst
* \returns the BVEC
*/
bvec ConvertBurstToBits(Ptr<const PacketBurst> burst);
Bvec ConvertBurstToBits(Ptr<const PacketBurst> burst);
/**
* Convert bits to burst
* \param buffer the BVEC
* \returns the packet burst
*/
Ptr<PacketBurst> ConvertBitsToBurst(bvec buffer);
Ptr<PacketBurst> ConvertBitsToBurst(Bvec buffer);
/**
* Create FEC blocks
* \param buffer the BVEC
* \param modulationType the modulation type
*/
void CreateFecBlocks(const bvec& buffer, WimaxPhy::ModulationType modulationType);
void CreateFecBlocks(const Bvec& buffer, WimaxPhy::ModulationType modulationType);
/**
* Recreate buffer
* \returns BVEC
*/
bvec RecreateBuffer();
Bvec RecreateBuffer();
/**
* Get FEC block size
* \param type the modulation type
@@ -442,10 +442,10 @@ class SimpleOfdmWimaxPhy : public WimaxPhy
uint16_t m_fecBlockSize; ///< in bits, size of FEC block transmitted after PHY operations
uint32_t m_currentBurstSize; ///< current burst size
std::list<bvec>* m_receivedFecBlocks; ///< a list of received FEC blocks until they are combined
std::list<Bvec>* m_receivedFecBlocks; ///< a list of received FEC blocks until they are combined
///< to recreate the full burst buffer
uint32_t m_nrFecBlocksSent; ///< counting the number of FEC blocks sent (within a burst)
std::list<bvec>* m_fecBlocks; ///< the FEC blocks
std::list<Bvec>* m_fecBlocks; ///< the FEC blocks
Time m_blockTime; ///< block time
TracedCallback<Ptr<const PacketBurst>> m_traceRx; ///< trace receive callback

View File

@@ -1024,7 +1024,7 @@ ProtocolTlvValue::Copy() const
Ipv4AddressTlvValue::Ipv4AddressTlvValue()
{
m_ipv4Addr = new std::vector<ipv4Addr>;
m_ipv4Addr = new std::vector<Ipv4Addr>;
}
Ipv4AddressTlvValue::~Ipv4AddressTlvValue()
@@ -1046,7 +1046,7 @@ Ipv4AddressTlvValue::GetSerializedSize() const
void
Ipv4AddressTlvValue::Serialize(Buffer::Iterator i) const
{
for (std::vector<ipv4Addr>::const_iterator iter = m_ipv4Addr->begin();
for (std::vector<Ipv4Addr>::const_iterator iter = m_ipv4Addr->begin();
iter != m_ipv4Addr->end();
++iter)
{
@@ -1070,12 +1070,9 @@ Ipv4AddressTlvValue::Deserialize(Buffer::Iterator i, uint64_t valueLength)
}
void
Ipv4AddressTlvValue::Add(Ipv4Address address, Ipv4Mask Mask)
Ipv4AddressTlvValue::Add(Ipv4Address address, Ipv4Mask mask)
{
ipv4Addr tmp;
tmp.Address = address;
tmp.Mask = Mask;
m_ipv4Addr->push_back(tmp);
m_ipv4Addr->push_back({address, mask});
}
Ipv4AddressTlvValue::Iterator
@@ -1094,7 +1091,7 @@ Ipv4AddressTlvValue*
Ipv4AddressTlvValue::Copy() const
{
Ipv4AddressTlvValue* tmp = new Ipv4AddressTlvValue();
for (std::vector<ipv4Addr>::const_iterator iter = m_ipv4Addr->begin();
for (std::vector<Ipv4Addr>::const_iterator iter = m_ipv4Addr->begin();
iter != m_ipv4Addr->end();
++iter)
{

View File

@@ -571,15 +571,15 @@ class ProtocolTlvValue : public TlvValue
class Ipv4AddressTlvValue : public TlvValue
{
public:
/// ipv4Addr structure
struct ipv4Addr
/// Ipv4Addr structure
struct Ipv4Addr
{
Ipv4Address Address; ///< address
Ipv4Mask Mask; ///< mask
};
/// IPv4 address vector iterator typedef
typedef std::vector<ipv4Addr>::const_iterator Iterator;
typedef std::vector<Ipv4Addr>::const_iterator Iterator;
Ipv4AddressTlvValue();
~Ipv4AddressTlvValue() override;
uint32_t GetSerializedSize() const override;
@@ -588,9 +588,9 @@ class Ipv4AddressTlvValue : public TlvValue
/**
* Add IPv4 address and mask
* \param address the IPv4 address
* \param Mask the IPv4 mask
* \param mask the IPv4 mask
*/
void Add(Ipv4Address address, Ipv4Mask Mask);
void Add(Ipv4Address address, Ipv4Mask mask);
/**
* Begin iterator
* \returns the beginning element
@@ -604,7 +604,7 @@ class Ipv4AddressTlvValue : public TlvValue
Ipv4AddressTlvValue* Copy() const override;
private:
std::vector<ipv4Addr>* m_ipv4Addr; ///< ipv4 addr
std::vector<Ipv4Addr>* m_ipv4Addr; ///< ipv4 addr
};
} // namespace ns3