Skip to content

Commit

Permalink
generic: fix to build with both OMNeT++ 5.3 (or later, including 6.0pre)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhornig committed Apr 18, 2019
1 parent 2393e23 commit bc89c94
Show file tree
Hide file tree
Showing 107 changed files with 576 additions and 619 deletions.
8 changes: 4 additions & 4 deletions WHATSNEW
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
Recent changes in the INET Framework
====================================

INET 3.6.5 (April 2019) - satble
INET 3.6.5 (April 2019) - stable
--------------------------------

This release contains minor bug fixes and compatibility fixes for the
OMNeT++ 5.4.1 release and for recent Linux distros. It requires
OMNeT++ 5.1 or later.
OMNeT++ 5.3 or later.

General:

- Added missing measurement units for 0 values in NED and INI files
- NED files are now using full qualified type names
- NED files are now using fully qualified type names
- Added missing doParsimPacking/doParsimUnpacking in L3Address

Ethernet:
Expand Down Expand Up @@ -39,7 +39,7 @@ IPv6:

Visualizers:

- Removed dependence on ObjectLocatorNode as it was removed in later
- Removed dependence on ObjectLocatorNode as it was removed in recent
versions of osgEarth


Expand Down
2 changes: 1 addition & 1 deletion src/inet/applications/dhcp/DHCPServer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ void DHCPServer::startApp()
const char *gatewayStr = par("gateway").stringValue();
gateway = *gatewayStr ? L3AddressResolver().resolve(gatewayStr, L3AddressResolver::ADDR_IPv4).toIPv4() : ipv4data->getIPAddress();
subnetMask = ipv4data->getNetmask();
long numReservedAddresses = par("numReservedAddresses").longValue();
long numReservedAddresses = par("numReservedAddresses").intValue();
uint32_t networkStartAddress = ipv4data->getIPAddress().getInt() & ipv4data->getNetmask().getInt();
ipAddressStart = IPv4Address(networkStartAddress + numReservedAddresses);
if (!IPv4Address::maskedAddrAreEqual(ipv4data->getIPAddress(), ipAddressStart, subnetMask))
Expand Down
4 changes: 2 additions & 2 deletions src/inet/applications/ethernet/EtherAppCli.cc
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,10 @@ void EtherAppCli::sendPacket()

datapacket->setRequestId(seqNum);

long len = reqLength->longValue();
long len = reqLength->intValue();
datapacket->setByteLength(len);

long respLen = respLength->longValue();
long respLen = respLength->intValue();
datapacket->setResponseBytes(respLen);

Ieee802Ctrl *etherctrl = new Ieee802Ctrl();
Expand Down
4 changes: 2 additions & 2 deletions src/inet/applications/ethernet/EtherTrafGen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ MACAddress EtherTrafGen::resolveDestMACAddress()

void EtherTrafGen::sendBurstPackets()
{
int n = numPacketsPerBurst->longValue();
int n = numPacketsPerBurst->intValue();
for (int i = 0; i < n; i++) {
seqNum++;

Expand All @@ -179,7 +179,7 @@ void EtherTrafGen::sendBurstPackets()

cPacket *datapacket = new cPacket(msgname, IEEE802CTRL_DATA);

long len = packetLength->longValue();
long len = packetLength->intValue();
datapacket->setByteLength(len);

Ieee802Ctrl *etherctrl = new Ieee802Ctrl();
Expand Down
4 changes: 2 additions & 2 deletions src/inet/applications/ethernet/EthernetApplication.cc
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ void EthernetApplication::sendPacket()

datapacket->setRequestId(seqNum);

long len = reqLength->longValue();
long len = reqLength->intValue();
datapacket->setByteLength(len);

long respLen = respLength->longValue();
long respLen = respLength->intValue();
datapacket->setResponseBytes(respLen);

Ieee802Ctrl *etherctrl = new Ieee802Ctrl();
Expand Down
2 changes: 1 addition & 1 deletion src/inet/applications/generic/IPvXTrafGen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ void IPvXTrafGen::sendPacket()
sprintf(msgName, "appData-%d", numSent);

cPacket *payload = new cPacket(msgName);
payload->setByteLength(packetLengthPar->longValue());
payload->setByteLength(packetLengthPar->intValue());

L3Address destAddr = chooseDestAddr();

Expand Down
4 changes: 2 additions & 2 deletions src/inet/applications/netperfmeter/NetPerfMeter.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,12 @@ class INET_API NetPerfMeter : public cSimpleModule
inline void reset() {
ReceivedBytes = 0;
ReceivedMessages = 0;
ReceivedDelayHistogram.clearResult();
ReceivedDelayHistogram.clear();
}

unsigned long long ReceivedBytes = 0;
unsigned long long ReceivedMessages = 0;
cDoubleHistogram ReceivedDelayHistogram;
cHistogram ReceivedDelayHistogram;
};

std::map<unsigned int, SenderStatistics*> SenderStatisticsMap;
Expand Down
2 changes: 1 addition & 1 deletion src/inet/applications/sctpapp/SCTPClient.cc
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ void SCTPClient::socketDataArrived(int, void *, cPacket *msg, bool)
socket.sendMsg(cmsg);
}

if (par("numPacketsToReceive").longValue() > 0) {
if (par("numPacketsToReceive").intValue() > 0) {
numPacketsToReceive--;
if (numPacketsToReceive == 0)
close();
Expand Down
2 changes: 1 addition & 1 deletion src/inet/applications/sctpapp/SCTPNatPeer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ void SCTPNatPeer::handleMessage(cMessage *msg)
sprintf(text, "App: EndToEndDelay of assoc %d", serverAssocId);
endToEndDelay[serverAssocId] = new cOutVector(text);
sprintf(text, "Hist: EndToEndDelay of assoc %d", serverAssocId);
histEndToEndDelay[serverAssocId] = new cDoubleHistogram(text);
histEndToEndDelay[serverAssocId] = new cHistogram(text);
delete connectInfo;
delete msg;

Expand Down
2 changes: 1 addition & 1 deletion src/inet/applications/sctpapp/SCTPNatPeer.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class INET_API SCTPNatPeer : public cSimpleModule, public SCTPSocket::CallbackIn
RcvdBytesPerAssoc rcvdBytesPerAssoc;
typedef std::map<int32, cOutVector *> BytesPerAssoc;
BytesPerAssoc bytesPerAssoc;
typedef std::map<int32, cDoubleHistogram *> HistEndToEndDelay;
typedef std::map<int32, cHistogram *> HistEndToEndDelay;
HistEndToEndDelay histEndToEndDelay;
typedef std::map<int32, cOutVector *> EndToEndDelay;
EndToEndDelay endToEndDelay;
Expand Down
12 changes: 6 additions & 6 deletions src/inet/applications/sctpapp/SCTPPeer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ void SCTPPeer::initialize(int stage)
listeningSocket.bindx(addresses, port);
clientSocket.bindx(addresses, port);
}
listeningSocket.listen(true, par("streamReset").boolValue(), par("numPacketsToSendPerClient").longValue());
listeningSocket.listen(true, par("streamReset").boolValue(), par("numPacketsToSendPerClient").intValue());
EV_DEBUG << "SCTPPeer::initialized listen port=" << port << "\n";
clientSocket.setCallbackObject(this);
clientSocket.setOutputGate(gate("sctpOut"));
Expand Down Expand Up @@ -270,12 +270,12 @@ void SCTPPeer::handleMessage(cMessage *msg)
sprintf(text, "App: EndToEndDelay of assoc %d", serverAssocId);
endToEndDelay[serverAssocId] = new cOutVector(text);
sprintf(text, "Hist: EndToEndDelay of assoc %d", serverAssocId);
histEndToEndDelay[serverAssocId] = new cDoubleHistogram(text);
histEndToEndDelay[serverAssocId] = new cHistogram(text);

//delete connectInfo;
delete msg;

if (par("numPacketsToSendPerClient").longValue() > 0) {
if (par("numPacketsToSendPerClient").intValue() > 0) {
auto i = sentPacketsPerAssoc.find(serverAssocId);
numRequestsToSend = i->second;
if (par("thinkTime").doubleValue() > 0) {
Expand Down Expand Up @@ -369,7 +369,7 @@ void SCTPPeer::handleMessage(cMessage *msg)
packetsRcvd++;

if (!echo) {
if (par("numPacketsToReceivePerClient").longValue() > 0) {
if (par("numPacketsToReceivePerClient").intValue() > 0) {
auto i = rcvdPacketsPerAssoc.find(id);
i->second--;
SCTPSimpleMessage *smsg = check_and_cast<SCTPSimpleMessage *>(msg);
Expand Down Expand Up @@ -595,7 +595,7 @@ void SCTPPeer::sendRequest(bool last)
SCTPSendInfo* sendCommand = new SCTPSendInfo;
sendCommand->setLast(last);
cmsg->setControlInfo(sendCommand);

// send SCTPMessage with SCTPSimpleMessage enclosed
emit(sentPkSignal, msg);
clientSocket.sendMsg(cmsg);
Expand Down Expand Up @@ -706,7 +706,7 @@ void SCTPPeer::socketDataArrived(int, void *, cPacket *msg, bool)
clientSocket.sendMsg(cmsg);
}

if (par("numPacketsToReceive").longValue() > 0) {
if (par("numPacketsToReceive").intValue() > 0) {
numPacketsToReceive--;
if (numPacketsToReceive == 0) {
setStatusString("closing");
Expand Down
2 changes: 1 addition & 1 deletion src/inet/applications/sctpapp/SCTPPeer.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class INET_API SCTPPeer : public cSimpleModule, public SCTPSocket::CallbackInter
typedef std::map<int, long> SentPacketsPerAssoc;
typedef std::map<int, long> RcvdBytesPerAssoc;
typedef std::map<int, cOutVector *> BytesPerAssoc;
typedef std::map<int, cDoubleHistogram *> HistEndToEndDelay;
typedef std::map<int, cHistogram *> HistEndToEndDelay;
typedef std::map<int, cOutVector *> EndToEndDelay;
typedef std::map<L3Address, PathStatus> SCTPPathStatus;

Expand Down
10 changes: 5 additions & 5 deletions src/inet/applications/sctpapp/SCTPServer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ void SCTPServer::initialize(int stage)
else
socket->bindx(addresses, port);

socket->listen(true, par("streamReset").boolValue(), par("numPacketsToSendPerClient").longValue(), messagesToPush);
socket->listen(true, par("streamReset").boolValue(), par("numPacketsToSendPerClient").intValue(), messagesToPush);
EV_INFO << "SCTPServer::initialized listen port=" << port << "\n";
cStringTokenizer tokenizer(par("streamPriorities").stringValue());
for (unsigned int streamNum = 0; tokenizer.hasMoreTokens(); streamNum++) {
Expand Down Expand Up @@ -195,7 +195,7 @@ void SCTPServer::handleMessage(cMessage *msg)
SCTPCommand *command = check_and_cast<SCTPCommand *>(msg->removeControlInfo());
assocId = command->getAssocId();
serverAssocStatMap[assocId].peerClosed = true;
if (par("numPacketsToReceivePerClient").longValue() == 0) {
if (par("numPacketsToReceivePerClient").intValue() == 0) {
if (serverAssocStatMap[assocId].abortSent == false) {
sendOrSchedule(makeAbortNotification(command->dup()));
serverAssocStatMap[assocId].abortSent = true;
Expand Down Expand Up @@ -241,7 +241,7 @@ void SCTPServer::handleMessage(cMessage *msg)

delete connectInfo;
delete msg;
if (par("numPacketsToSendPerClient").longValue() > 0) {
if (par("numPacketsToSendPerClient").intValue() > 0) {
auto i = serverAssocStatMap.find(assocId);
numRequestsToSend = i->second.sentPackets;
if (par("thinkTime").doubleValue() > 0) {
Expand Down Expand Up @@ -340,7 +340,7 @@ void SCTPServer::handleMessage(cMessage *msg)
k->second->record(j->second.rcvdBytes);

if (!echo) {
if (par("numPacketsToReceivePerClient").longValue() > 0) {
if (par("numPacketsToReceivePerClient").intValue() > 0) {
j->second.rcvdPackets--;
SCTPSimpleMessage *smsg = check_and_cast<SCTPSimpleMessage *>(msg);
auto m = endToEndDelay.find(id);
Expand Down Expand Up @@ -398,7 +398,7 @@ void SCTPServer::handleMessage(cMessage *msg)
id = command->getAssocId();
EV_INFO << "server: SCTP_I_SHUTDOWN_RECEIVED for assoc " << id << "\n";
auto i = serverAssocStatMap.find(id);
if (i->second.sentPackets == 0 || par("numPacketsToSendPerClient").longValue() == 0) {
if (i->second.sentPackets == 0 || par("numPacketsToSendPerClient").intValue() == 0) {
cMessage *cmsg = new cMessage("SCTP_C_NO_OUTSTANDING");
SCTPInfo *qinfo = new SCTPInfo("Info3");
cmsg->setKind(SCTP_C_NO_OUTSTANDING);
Expand Down
2 changes: 1 addition & 1 deletion src/inet/applications/tcpapp/TCPBasicClientApp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ void TCPBasicClientApp::socketEstablished(int connId, void *ptr)
TCPAppBase::socketEstablished(connId, ptr);

// determine number of requests in this session
numRequestsToSend = par("numRequestsPerSession").longValue();
numRequestsToSend = par("numRequestsPerSession").intValue();
if (numRequestsToSend < 1)
numRequestsToSend = 1;

Expand Down
2 changes: 1 addition & 1 deletion src/inet/applications/udpapp/UDPBasicApp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ void UDPBasicApp::sendPacket()
std::ostringstream str;
str << packetName << "-" << numSent;
ApplicationPacket *payload = new ApplicationPacket(str.str().c_str());
payload->setByteLength(par("messageLength").longValue());
payload->setByteLength(par("messageLength").intValue());
payload->setSequenceNumber(numSent);

L3Address destAddr = chooseDestAddr();
Expand Down
2 changes: 1 addition & 1 deletion src/inet/applications/udpapp/UDPBasicBurst.cc
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ cPacket *UDPBasicBurst::createPacket()
{
char msgName[32];
sprintf(msgName, "UDPBasicAppData-%d", counter++);
long msgByteLength = messageLengthPar->longValue();
long msgByteLength = messageLengthPar->intValue();
ApplicationPacket *payload = new ApplicationPacket(msgName);
payload->setByteLength(msgByteLength);
payload->setSequenceNumber(numSent);
Expand Down
2 changes: 1 addition & 1 deletion src/inet/applications/udpapp/UDPVideoStreamSvr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ void UDPVideoStreamSvr::sendStreamData(cMessage *timer)

// generate and send a packet
cPacket *pkt = new cPacket("VideoStrmPk");
long pktLen = packetLen->longValue();
long pktLen = packetLen->intValue();

if (pktLen > d->bytesLeft)
pktLen = d->bytesLeft;
Expand Down
6 changes: 6 additions & 0 deletions src/inet/common/INETDefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ using namespace omnetpp;
#define INET_VERSION 0x0306
#define INET_PATCH_LEVEL 0x05

#if OMNETPP_VERSION < 0x0600
#define OMNETPP5_CODE(x) x
#else
#define OMNETPP5_CODE(x)
#endif // if OMNETPP_VERSION < 0x0600

#if defined(INET_EXPORT)
# define INET_API OPP_DLLEXPORT
#elif defined(INET_IMPORT)
Expand Down
2 changes: 1 addition & 1 deletion src/inet/common/Topology.cc
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Topology::~Topology()
clear();
}

std::string Topology::info() const
std::string Topology::str() const
{
std::stringstream out;
out << "n=" << nodes.size();
Expand Down
2 changes: 1 addition & 1 deletion src/inet/common/Topology.h
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ class INET_API Topology : public cOwnedObject
* Produces a one-line description of the object's contents.
* See cObject for more details.
*/
virtual std::string info() const override;
virtual std::string str() const override;

/**
* Serializes the object into an MPI send buffer.
Expand Down
4 changes: 2 additions & 2 deletions src/inet/common/geometry/common/Coord.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class INET_API Coord : public cObject
: cObject(other) { copy(other); }

/** @brief Returns a string with the value of the coordinate. */
std::string info() const override;
std::string str() const override;

/** @brief Adds two coordinate vectors. */
friend Coord operator+(const Coord& a, const Coord& b)
Expand Down Expand Up @@ -293,7 +293,7 @@ inline std::ostream& operator<<(std::ostream& os, const Coord& coord)
return os << "(" << coord.x << ", " << coord.y << ", " << coord.z << ")";
}

inline std::string Coord::info() const
inline std::string Coord::str() const
{
std::stringstream os;
os << *this;
Expand Down
2 changes: 1 addition & 1 deletion src/inet/common/queue/PacketQueue.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
namespace inet {

PacketQueue::PacketQueue(const char *name) :
cPacketQueue(name, nullptr)
cPacketQueue(name)
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/inet/linklayer/bmac/BMacLayer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ InterfaceEntry *BMacLayer::createInterfaceEntry()
e->setInterfaceToken(address.formInterfaceIdentifier());

// capabilities
e->setMtu(par("mtu").longValue());
e->setMtu(par("mtu").intValue());
e->setMulticast(false);
e->setBroadcast(true);

Expand Down
2 changes: 1 addition & 1 deletion src/inet/linklayer/configurator/Ieee8021dInterfaceData.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Ieee8021dInterfaceData::Ieee8021dInterfaceData()
{
}

std::string Ieee8021dInterfaceData::info() const
std::string Ieee8021dInterfaceData::str() const
{
std::stringstream out;
out << "role:" << getRoleName() << " state:" << getStateName();
Expand Down
4 changes: 2 additions & 2 deletions src/inet/linklayer/configurator/Ieee8021dInterfaceData.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ class INET_API Ieee8021dInterfaceData : public InterfaceProtocolData
public:
Ieee8021dInterfaceData();

virtual std::string info() const override;
virtual std::string detailedInfo() const override;
virtual std::string str() const override;
virtual std::string detailedInfo() const OMNETPP5_CODE(override);

bool isLearning() const { return portData.state == LEARNING || portData.state == FORWARDING; }

Expand Down
2 changes: 1 addition & 1 deletion src/inet/linklayer/csma/CSMA.cc
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ InterfaceEntry *CSMA::createInterfaceEntry()
e->setInterfaceToken(address.formInterfaceIdentifier());

// capabilities
e->setMtu(par("mtu").longValue());
e->setMtu(par("mtu").intValue());
e->setMulticast(false);
e->setBroadcast(true);

Expand Down
4 changes: 2 additions & 2 deletions src/inet/linklayer/ethernet/EtherMACBase.cc
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ void EtherMACBase::initializeQueueModule()
txQueue.extQueue->requestPacket();
}
else {
txQueue.setInternalQueue("txQueue", par("txQueueLimit").longValue());
txQueue.setInternalQueue("txQueue", par("txQueueLimit").intValue());
}
}

Expand Down Expand Up @@ -290,7 +290,7 @@ InterfaceEntry *EtherMACBase::createInterfaceEntry()

// MTU: typical values are 576 (Internet de facto), 1500 (Ethernet-friendly),
// 4000 (on some point-to-point links), 4470 (Cisco routers default, FDDI compatible)
interfaceEntry->setMtu(par("mtu").longValue());
interfaceEntry->setMtu(par("mtu").intValue());

// capabilities
interfaceEntry->setMulticast(true);
Expand Down
Loading

0 comments on commit bc89c94

Please sign in to comment.