From bc89c946d86062c566154b8015511f7d9d5ecb20 Mon Sep 17 00:00:00 2001 From: Rudolf Hornig Date: Fri, 12 Apr 2019 16:41:38 +0200 Subject: [PATCH] generic: fix to build with both OMNeT++ 5.3 (or later, including 6.0pre) --- WHATSNEW | 8 +- src/inet/applications/dhcp/DHCPServer.cc | 2 +- src/inet/applications/ethernet/EtherAppCli.cc | 4 +- .../applications/ethernet/EtherTrafGen.cc | 4 +- .../ethernet/EthernetApplication.cc | 4 +- src/inet/applications/generic/IPvXTrafGen.cc | 2 +- .../applications/netperfmeter/NetPerfMeter.h | 4 +- src/inet/applications/sctpapp/SCTPClient.cc | 2 +- src/inet/applications/sctpapp/SCTPNatPeer.cc | 2 +- src/inet/applications/sctpapp/SCTPNatPeer.h | 2 +- src/inet/applications/sctpapp/SCTPPeer.cc | 12 +- src/inet/applications/sctpapp/SCTPPeer.h | 2 +- src/inet/applications/sctpapp/SCTPServer.cc | 10 +- .../applications/tcpapp/TCPBasicClientApp.cc | 2 +- src/inet/applications/udpapp/UDPBasicApp.cc | 2 +- src/inet/applications/udpapp/UDPBasicBurst.cc | 2 +- .../applications/udpapp/UDPVideoStreamSvr.cc | 2 +- src/inet/common/INETDefs.h | 6 + src/inet/common/Topology.cc | 2 +- src/inet/common/Topology.h | 2 +- src/inet/common/geometry/common/Coord.h | 4 +- src/inet/common/queue/PacketQueue.cc | 2 +- src/inet/linklayer/bmac/BMacLayer.cc | 2 +- .../configurator/Ieee8021dInterfaceData.cc | 2 +- .../configurator/Ieee8021dInterfaceData.h | 4 +- src/inet/linklayer/csma/CSMA.cc | 2 +- src/inet/linklayer/ethernet/EtherMACBase.cc | 4 +- src/inet/linklayer/ideal/IdealMac.cc | 4 +- .../linklayer/ieee80211/mac/Ieee80211Mac.cc | 2 +- .../ieee80211/mac/queue/Ieee80211Queue.cc | 2 +- src/inet/linklayer/lmac/LMacLayer.cc | 2 +- src/inet/linklayer/loopback/Loopback.cc | 2 +- src/inet/linklayer/ppp/PPP.cc | 2 +- src/inet/linklayer/tun/TunInterface.cc | 2 +- src/inet/linklayer/xmac/XMacLayer.cc | 748 +++++++++--------- src/inet/mobility/group/MoBANCoordinator.cc | 2 +- src/inet/mobility/group/PostureTransition.cc | 2 +- .../networklayer/common/InterfaceEntry.cc | 62 +- src/inet/networklayer/common/InterfaceEntry.h | 6 +- .../networklayer/common/InterfaceTable.cc | 2 +- .../generic/GenericNetworkConfigurator.cc | 2 +- .../ipv4/IPv4NetworkConfigurator.cc | 4 +- .../networklayer/diffserv/DiffservUtil.cc | 2 +- .../GenericNetworkProtocolInterfaceData.cc | 2 +- .../GenericNetworkProtocolInterfaceData.h | 4 +- src/inet/networklayer/generic/GenericRoute.cc | 4 +- src/inet/networklayer/generic/GenericRoute.h | 8 +- .../generic/GenericRoutingTable.cc | 4 +- .../networklayer/ipv4/IPv4InterfaceData.cc | 16 +- .../networklayer/ipv4/IPv4InterfaceData.h | 10 +- src/inet/networklayer/ipv4/IPv4Route.cc | 8 +- src/inet/networklayer/ipv4/IPv4Route.h | 8 +- .../networklayer/ipv4/IPv4RoutingTable.cc | 10 +- .../networklayer/ipv6/IPv6InterfaceData.cc | 14 +- .../networklayer/ipv6/IPv6InterfaceData.h | 8 +- src/inet/networklayer/ipv6/IPv6Route.cc | 2 +- src/inet/networklayer/ipv6/IPv6Route.h | 4 +- .../networklayer/ipv6/IPv6RoutingTable.cc | 4 +- src/inet/networklayer/mpls/MPLSPacket.cc | 2 +- src/inet/networklayer/mpls/MPLSPacket.h | 2 +- src/inet/routing/ospfv2/OSPFConfigReader.cc | 2 +- src/inet/routing/ospfv2/router/OSPFArea.cc | 2 +- src/inet/routing/ospfv2/router/OSPFArea.h | 4 +- .../routing/pim/tables/PIMInterfaceTable.cc | 2 +- .../routing/pim/tables/PIMInterfaceTable.h | 2 +- .../routing/pim/tables/PIMNeighborTable.cc | 4 +- .../routing/pim/tables/PIMNeighborTable.h | 2 +- src/inet/routing/rip/RIPRouting.cc | 4 +- src/inet/routing/rip/RIPRouting.h | 2 +- src/inet/transportlayer/rtp/RTPInnerPacket.cc | 2 +- src/inet/transportlayer/rtp/RTPInnerPacket.h | 2 +- src/inet/transportlayer/rtp/RTPPacket.cc | 2 +- src/inet/transportlayer/rtp/RTPPacket.h | 2 +- src/inet/transportlayer/rtp/reports.cc | 4 +- src/inet/transportlayer/rtp/reports.h | 4 +- src/inet/transportlayer/rtp/sdes.cc | 4 +- src/inet/transportlayer/rtp/sdes.h | 4 +- src/inet/transportlayer/tcp/TCP.cc | 2 +- src/inet/transportlayer/tcp/TCPConnection.h | 4 +- .../transportlayer/tcp/TCPConnectionBase.cc | 2 +- .../tcp/TCPConnectionRcvSegment.cc | 2 +- .../transportlayer/tcp/TCPConnectionUtil.cc | 4 +- .../transportlayer/tcp/flavours/TCPBaseAlg.cc | 6 +- .../transportlayer/tcp/flavours/TCPBaseAlg.h | 4 +- .../tcp/flavours/TCPTahoeRenoFamily.cc | 4 +- .../tcp/flavours/TCPTahoeRenoFamily.h | 4 +- .../transportlayer/tcp/flavours/TCPVegas.cc | 4 +- .../transportlayer/tcp/flavours/TCPVegas.h | 4 +- .../tcp/flavours/TCPWestwood.cc | 4 +- .../transportlayer/tcp/flavours/TCPWestwood.h | 4 +- .../tcp/queues/TCPByteStreamRcvQueue.cc | 2 +- .../tcp/queues/TCPByteStreamRcvQueue.h | 2 +- .../tcp/queues/TCPByteStreamSendQueue.cc | 2 +- .../tcp/queues/TCPByteStreamSendQueue.h | 2 +- .../tcp/queues/TCPMsgBasedRcvQueue.cc | 2 +- .../tcp/queues/TCPMsgBasedRcvQueue.h | 2 +- .../tcp/queues/TCPMsgBasedSendQueue.cc | 8 +- .../tcp/queues/TCPMsgBasedSendQueue.h | 2 +- .../tcp/queues/TCPVirtualDataRcvQueue.cc | 6 +- .../tcp/queues/TCPVirtualDataRcvQueue.h | 2 +- .../tcp/queues/TCPVirtualDataSendQueue.cc | 2 +- .../tcp/queues/TCPVirtualDataSendQueue.h | 2 +- .../transportlayer/tcp_common/TCPSpoof.cc | 2 +- src/inet/transportlayer/tcp_nsc/TCP_NSC.cc | 2 +- .../base/InterfaceTableVisualizerBase.cc | 2 +- .../base/RoutingTableVisualizerBase.cc | 2 +- src/makefrag | 5 + 107 files changed, 576 insertions(+), 619 deletions(-) diff --git a/WHATSNEW b/WHATSNEW index bc7e1e173b6..83bb5dee7a9 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -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: @@ -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 diff --git a/src/inet/applications/dhcp/DHCPServer.cc b/src/inet/applications/dhcp/DHCPServer.cc index 2dd6ed5e0cc..135fe051340 100644 --- a/src/inet/applications/dhcp/DHCPServer.cc +++ b/src/inet/applications/dhcp/DHCPServer.cc @@ -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)) diff --git a/src/inet/applications/ethernet/EtherAppCli.cc b/src/inet/applications/ethernet/EtherAppCli.cc index 009ceadec6c..fee0e82a795 100644 --- a/src/inet/applications/ethernet/EtherAppCli.cc +++ b/src/inet/applications/ethernet/EtherAppCli.cc @@ -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(); diff --git a/src/inet/applications/ethernet/EtherTrafGen.cc b/src/inet/applications/ethernet/EtherTrafGen.cc index 23e99ce4dff..afe8df12ffa 100644 --- a/src/inet/applications/ethernet/EtherTrafGen.cc +++ b/src/inet/applications/ethernet/EtherTrafGen.cc @@ -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++; @@ -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(); diff --git a/src/inet/applications/ethernet/EthernetApplication.cc b/src/inet/applications/ethernet/EthernetApplication.cc index 872108cb08f..69bc250c943 100644 --- a/src/inet/applications/ethernet/EthernetApplication.cc +++ b/src/inet/applications/ethernet/EthernetApplication.cc @@ -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(); diff --git a/src/inet/applications/generic/IPvXTrafGen.cc b/src/inet/applications/generic/IPvXTrafGen.cc index 77cd18ea084..24f39bdee27 100644 --- a/src/inet/applications/generic/IPvXTrafGen.cc +++ b/src/inet/applications/generic/IPvXTrafGen.cc @@ -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(); diff --git a/src/inet/applications/netperfmeter/NetPerfMeter.h b/src/inet/applications/netperfmeter/NetPerfMeter.h index 2b537dc0ec5..708b2868669 100644 --- a/src/inet/applications/netperfmeter/NetPerfMeter.h +++ b/src/inet/applications/netperfmeter/NetPerfMeter.h @@ -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 SenderStatisticsMap; diff --git a/src/inet/applications/sctpapp/SCTPClient.cc b/src/inet/applications/sctpapp/SCTPClient.cc index 53e1d5c96be..e88613661e3 100644 --- a/src/inet/applications/sctpapp/SCTPClient.cc +++ b/src/inet/applications/sctpapp/SCTPClient.cc @@ -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(); diff --git a/src/inet/applications/sctpapp/SCTPNatPeer.cc b/src/inet/applications/sctpapp/SCTPNatPeer.cc index 5641182252f..7edc07f8185 100644 --- a/src/inet/applications/sctpapp/SCTPNatPeer.cc +++ b/src/inet/applications/sctpapp/SCTPNatPeer.cc @@ -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; diff --git a/src/inet/applications/sctpapp/SCTPNatPeer.h b/src/inet/applications/sctpapp/SCTPNatPeer.h index 59b15e77098..69e06a776cb 100644 --- a/src/inet/applications/sctpapp/SCTPNatPeer.h +++ b/src/inet/applications/sctpapp/SCTPNatPeer.h @@ -70,7 +70,7 @@ class INET_API SCTPNatPeer : public cSimpleModule, public SCTPSocket::CallbackIn RcvdBytesPerAssoc rcvdBytesPerAssoc; typedef std::map BytesPerAssoc; BytesPerAssoc bytesPerAssoc; - typedef std::map HistEndToEndDelay; + typedef std::map HistEndToEndDelay; HistEndToEndDelay histEndToEndDelay; typedef std::map EndToEndDelay; EndToEndDelay endToEndDelay; diff --git a/src/inet/applications/sctpapp/SCTPPeer.cc b/src/inet/applications/sctpapp/SCTPPeer.cc index 1d947bf73a7..05ef2ddf277 100644 --- a/src/inet/applications/sctpapp/SCTPPeer.cc +++ b/src/inet/applications/sctpapp/SCTPPeer.cc @@ -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")); @@ -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) { @@ -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(msg); @@ -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); @@ -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"); diff --git a/src/inet/applications/sctpapp/SCTPPeer.h b/src/inet/applications/sctpapp/SCTPPeer.h index 5b222254e1c..dfbde91372e 100644 --- a/src/inet/applications/sctpapp/SCTPPeer.h +++ b/src/inet/applications/sctpapp/SCTPPeer.h @@ -44,7 +44,7 @@ class INET_API SCTPPeer : public cSimpleModule, public SCTPSocket::CallbackInter typedef std::map SentPacketsPerAssoc; typedef std::map RcvdBytesPerAssoc; typedef std::map BytesPerAssoc; - typedef std::map HistEndToEndDelay; + typedef std::map HistEndToEndDelay; typedef std::map EndToEndDelay; typedef std::map SCTPPathStatus; diff --git a/src/inet/applications/sctpapp/SCTPServer.cc b/src/inet/applications/sctpapp/SCTPServer.cc index 4e413270f1a..d11fb782114 100644 --- a/src/inet/applications/sctpapp/SCTPServer.cc +++ b/src/inet/applications/sctpapp/SCTPServer.cc @@ -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++) { @@ -195,7 +195,7 @@ void SCTPServer::handleMessage(cMessage *msg) SCTPCommand *command = check_and_cast(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; @@ -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) { @@ -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(msg); auto m = endToEndDelay.find(id); @@ -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); diff --git a/src/inet/applications/tcpapp/TCPBasicClientApp.cc b/src/inet/applications/tcpapp/TCPBasicClientApp.cc index 1a4038ce001..a81667b377c 100644 --- a/src/inet/applications/tcpapp/TCPBasicClientApp.cc +++ b/src/inet/applications/tcpapp/TCPBasicClientApp.cc @@ -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; diff --git a/src/inet/applications/udpapp/UDPBasicApp.cc b/src/inet/applications/udpapp/UDPBasicApp.cc index 9ce1f1c6fc6..dfe4a53e8a8 100644 --- a/src/inet/applications/udpapp/UDPBasicApp.cc +++ b/src/inet/applications/udpapp/UDPBasicApp.cc @@ -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(); diff --git a/src/inet/applications/udpapp/UDPBasicBurst.cc b/src/inet/applications/udpapp/UDPBasicBurst.cc index 7cd6c68436a..b5e7f7e5a14 100644 --- a/src/inet/applications/udpapp/UDPBasicBurst.cc +++ b/src/inet/applications/udpapp/UDPBasicBurst.cc @@ -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); diff --git a/src/inet/applications/udpapp/UDPVideoStreamSvr.cc b/src/inet/applications/udpapp/UDPVideoStreamSvr.cc index 92e515538c7..c8fcbb3744c 100644 --- a/src/inet/applications/udpapp/UDPVideoStreamSvr.cc +++ b/src/inet/applications/udpapp/UDPVideoStreamSvr.cc @@ -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; diff --git a/src/inet/common/INETDefs.h b/src/inet/common/INETDefs.h index c5cc2fcdc7b..eabf3d0318a 100644 --- a/src/inet/common/INETDefs.h +++ b/src/inet/common/INETDefs.h @@ -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) diff --git a/src/inet/common/Topology.cc b/src/inet/common/Topology.cc index 63aa70dfb85..7089c1d0433 100644 --- a/src/inet/common/Topology.cc +++ b/src/inet/common/Topology.cc @@ -61,7 +61,7 @@ Topology::~Topology() clear(); } -std::string Topology::info() const +std::string Topology::str() const { std::stringstream out; out << "n=" << nodes.size(); diff --git a/src/inet/common/Topology.h b/src/inet/common/Topology.h index fc06726a1b5..8502504434a 100644 --- a/src/inet/common/Topology.h +++ b/src/inet/common/Topology.h @@ -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. diff --git a/src/inet/common/geometry/common/Coord.h b/src/inet/common/geometry/common/Coord.h index 0652c99cc0e..5c67ed516f6 100644 --- a/src/inet/common/geometry/common/Coord.h +++ b/src/inet/common/geometry/common/Coord.h @@ -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) @@ -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; diff --git a/src/inet/common/queue/PacketQueue.cc b/src/inet/common/queue/PacketQueue.cc index 464f789665c..3b4e1f424a7 100644 --- a/src/inet/common/queue/PacketQueue.cc +++ b/src/inet/common/queue/PacketQueue.cc @@ -20,7 +20,7 @@ namespace inet { PacketQueue::PacketQueue(const char *name) : - cPacketQueue(name, nullptr) + cPacketQueue(name) { } diff --git a/src/inet/linklayer/bmac/BMacLayer.cc b/src/inet/linklayer/bmac/BMacLayer.cc index 26f571a3f8e..4ecfb0b52f0 100644 --- a/src/inet/linklayer/bmac/BMacLayer.cc +++ b/src/inet/linklayer/bmac/BMacLayer.cc @@ -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); diff --git a/src/inet/linklayer/configurator/Ieee8021dInterfaceData.cc b/src/inet/linklayer/configurator/Ieee8021dInterfaceData.cc index 200f27f0e3e..793a9df0353 100644 --- a/src/inet/linklayer/configurator/Ieee8021dInterfaceData.cc +++ b/src/inet/linklayer/configurator/Ieee8021dInterfaceData.cc @@ -45,7 +45,7 @@ Ieee8021dInterfaceData::Ieee8021dInterfaceData() { } -std::string Ieee8021dInterfaceData::info() const +std::string Ieee8021dInterfaceData::str() const { std::stringstream out; out << "role:" << getRoleName() << " state:" << getStateName(); diff --git a/src/inet/linklayer/configurator/Ieee8021dInterfaceData.h b/src/inet/linklayer/configurator/Ieee8021dInterfaceData.h index 9e33072bd3d..7c0621b49eb 100644 --- a/src/inet/linklayer/configurator/Ieee8021dInterfaceData.h +++ b/src/inet/linklayer/configurator/Ieee8021dInterfaceData.h @@ -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; } diff --git a/src/inet/linklayer/csma/CSMA.cc b/src/inet/linklayer/csma/CSMA.cc index 0af9650acdc..4daeeb0ec8d 100644 --- a/src/inet/linklayer/csma/CSMA.cc +++ b/src/inet/linklayer/csma/CSMA.cc @@ -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); diff --git a/src/inet/linklayer/ethernet/EtherMACBase.cc b/src/inet/linklayer/ethernet/EtherMACBase.cc index a435c0b1144..d8a9672d0c1 100644 --- a/src/inet/linklayer/ethernet/EtherMACBase.cc +++ b/src/inet/linklayer/ethernet/EtherMACBase.cc @@ -210,7 +210,7 @@ void EtherMACBase::initializeQueueModule() txQueue.extQueue->requestPacket(); } else { - txQueue.setInternalQueue("txQueue", par("txQueueLimit").longValue()); + txQueue.setInternalQueue("txQueue", par("txQueueLimit").intValue()); } } @@ -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); diff --git a/src/inet/linklayer/ideal/IdealMac.cc b/src/inet/linklayer/ideal/IdealMac.cc index 08966bb1b83..498e2af86e5 100644 --- a/src/inet/linklayer/ideal/IdealMac.cc +++ b/src/inet/linklayer/ideal/IdealMac.cc @@ -68,7 +68,7 @@ void IdealMac::initialize(int stage) outStandingRequests = 0; bitrate = par("bitrate").doubleValue(); - headerLength = par("headerLength").longValue(); + headerLength = par("headerLength").intValue(); promiscuous = par("promiscuous"); fullDuplex = par("fullDuplex"); useAck = par("useAck"); @@ -125,7 +125,7 @@ InterfaceEntry *IdealMac::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) - e->setMtu(par("mtu").longValue()); + e->setMtu(par("mtu").intValue()); // capabilities e->setMulticast(true); diff --git a/src/inet/linklayer/ieee80211/mac/Ieee80211Mac.cc b/src/inet/linklayer/ieee80211/mac/Ieee80211Mac.cc index 6223051be48..1a42be8cbe7 100644 --- a/src/inet/linklayer/ieee80211/mac/Ieee80211Mac.cc +++ b/src/inet/linklayer/ieee80211/mac/Ieee80211Mac.cc @@ -105,7 +105,7 @@ InterfaceEntry *Ieee80211Mac::createInterfaceEntry() // address e->setMACAddress(address); e->setInterfaceToken(address.formInterfaceIdentifier()); - e->setMtu(par("mtu").longValue()); + e->setMtu(par("mtu").intValue()); // capabilities e->setBroadcast(true); e->setMulticast(true); diff --git a/src/inet/linklayer/ieee80211/mac/queue/Ieee80211Queue.cc b/src/inet/linklayer/ieee80211/mac/queue/Ieee80211Queue.cc index 31486a1f815..06e47aac1ce 100644 --- a/src/inet/linklayer/ieee80211/mac/queue/Ieee80211Queue.cc +++ b/src/inet/linklayer/ieee80211/mac/queue/Ieee80211Queue.cc @@ -21,7 +21,7 @@ namespace inet { namespace ieee80211 { Ieee80211Queue::Ieee80211Queue(int maxQueueSize, const char *name) : - cQueue(name, nullptr) + cQueue(name) { this->maxQueueSize = maxQueueSize; } diff --git a/src/inet/linklayer/lmac/LMacLayer.cc b/src/inet/linklayer/lmac/LMacLayer.cc index 0ae6f19850d..c1e21413662 100644 --- a/src/inet/linklayer/lmac/LMacLayer.cc +++ b/src/inet/linklayer/lmac/LMacLayer.cc @@ -141,7 +141,7 @@ InterfaceEntry *LMacLayer::createInterfaceEntry() e->setInterfaceToken(address.formInterfaceIdentifier()); // capabilities - e->setMtu(par("mtu").longValue()); + e->setMtu(par("mtu").intValue()); e->setMulticast(false); e->setBroadcast(true); diff --git a/src/inet/linklayer/loopback/Loopback.cc b/src/inet/linklayer/loopback/Loopback.cc index 4ea1be421ee..23b4699a08f 100644 --- a/src/inet/linklayer/loopback/Loopback.cc +++ b/src/inet/linklayer/loopback/Loopback.cc @@ -63,7 +63,7 @@ InterfaceEntry *Loopback::createInterfaceEntry() // ie->setInterfaceToken(token); // capabilities - ie->setMtu(par("mtu").longValue()); + ie->setMtu(par("mtu").intValue()); ie->setLoopback(true); return ie; diff --git a/src/inet/linklayer/ppp/PPP.cc b/src/inet/linklayer/ppp/PPP.cc index 9bec11749f8..77fdde51cff 100644 --- a/src/inet/linklayer/ppp/PPP.cc +++ b/src/inet/linklayer/ppp/PPP.cc @@ -118,7 +118,7 @@ InterfaceEntry *PPP::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) - e->setMtu(par("mtu").longValue()); + e->setMtu(par("mtu").intValue()); // capabilities e->setMulticast(true); diff --git a/src/inet/linklayer/tun/TunInterface.cc b/src/inet/linklayer/tun/TunInterface.cc index f212e5b4def..96bbfc0e640 100644 --- a/src/inet/linklayer/tun/TunInterface.cc +++ b/src/inet/linklayer/tun/TunInterface.cc @@ -38,7 +38,7 @@ void TunInterface::initialize(int stage) InterfaceEntry *TunInterface::createInterfaceEntry() { InterfaceEntry *e = new InterfaceEntry(this); - e->setMtu(par("mtu").longValue()); + e->setMtu(par("mtu").intValue()); return e; } diff --git a/src/inet/linklayer/xmac/XMacLayer.cc b/src/inet/linklayer/xmac/XMacLayer.cc index 0f842d73788..a4f86b36870 100644 --- a/src/inet/linklayer/xmac/XMacLayer.cc +++ b/src/inet/linklayer/xmac/XMacLayer.cc @@ -41,113 +41,113 @@ simsignal_t XMacLayer::packetFromUpperDroppedSignal = registerSignal("packetFrom */ void XMacLayer::initialize(int stage) { - MACProtocolBase::initialize(stage); - - if (stage == INITSTAGE_LOCAL) { - - queueLength = hasPar("queueLength") ? par("queueLength") : 10; - animation = hasPar("animation") ? par("animation") : true; - slotDuration = hasPar("slotDuration") ? par("slotDuration") : 1.; - bitrate = hasPar("bitrate") ? par("bitrate") : 15360.; - headerLength = par("headerLength").longValue(); - checkInterval = hasPar("checkInterval") ? par("checkInterval") : 0.1; - txPower = hasPar("txPower") ? par("txPower") : 50.; - useMacAcks = hasPar("useMACAcks") ? par("useMACAcks") : false; - maxTxAttempts = hasPar("maxTxAttempts") ? par("maxTxAttempts") : 2; - EV_DEBUG << "headerLength: " << headerLength << ", bitrate: " << bitrate << endl; - - stats = par("stats"); - nbTxDataPackets = 0; - nbTxPreambles = 0; - nbRxDataPackets = 0; - nbRxPreambles = 0; - nbMissedAcks = 0; - nbRecvdAcks=0; - nbDroppedDataPackets=0; - nbRxBrokenDataPackets = 0; - nbTxAcks=0; - - txAttempts = 0; - lastDataPktDestAddr = MACAddress::BROADCAST_ADDRESS; - lastDataPktSrcAddr = MACAddress::BROADCAST_ADDRESS; - - cModule *radioModule = getModuleFromPar(par("radioModule"), this); + MACProtocolBase::initialize(stage); + + if (stage == INITSTAGE_LOCAL) { + + queueLength = hasPar("queueLength") ? par("queueLength") : 10; + animation = hasPar("animation") ? par("animation") : true; + slotDuration = hasPar("slotDuration") ? par("slotDuration") : 1.; + bitrate = hasPar("bitrate") ? par("bitrate") : 15360.; + headerLength = par("headerLength").intValue(); + checkInterval = hasPar("checkInterval") ? par("checkInterval") : 0.1; + txPower = hasPar("txPower") ? par("txPower") : 50.; + useMacAcks = hasPar("useMACAcks") ? par("useMACAcks") : false; + maxTxAttempts = hasPar("maxTxAttempts") ? par("maxTxAttempts") : 2; + EV_DEBUG << "headerLength: " << headerLength << ", bitrate: " << bitrate << endl; + + stats = par("stats"); + nbTxDataPackets = 0; + nbTxPreambles = 0; + nbRxDataPackets = 0; + nbRxPreambles = 0; + nbMissedAcks = 0; + nbRecvdAcks=0; + nbDroppedDataPackets=0; + nbRxBrokenDataPackets = 0; + nbTxAcks=0; + + txAttempts = 0; + lastDataPktDestAddr = MACAddress::BROADCAST_ADDRESS; + lastDataPktSrcAddr = MACAddress::BROADCAST_ADDRESS; + + cModule *radioModule = getModuleFromPar(par("radioModule"), this); radioModule->subscribe(IRadio::radioModeChangedSignal, this); radioModule->subscribe(IRadio::transmissionStateChangedSignal, this); radio = check_and_cast(radioModule); - macState = INIT; - WATCH(macState); - } - else if(stage == INITSTAGE_LINK_LAYER) { - initializeMACAddress(); - registerInterface(); + macState = INIT; + WATCH(macState); + } + else if(stage == INITSTAGE_LINK_LAYER) { + initializeMACAddress(); + registerInterface(); - wakeup = new cMessage("wakeup"); - wakeup->setKind(XMAC_WAKE_UP); + wakeup = new cMessage("wakeup"); + wakeup->setKind(XMAC_WAKE_UP); - data_timeout = new cMessage("data_timeout"); - data_timeout->setKind(XMAC_DATA_TIMEOUT); - data_timeout->setSchedulingPriority(100); + data_timeout = new cMessage("data_timeout"); + data_timeout->setKind(XMAC_DATA_TIMEOUT); + data_timeout->setSchedulingPriority(100); - data_tx_over = new cMessage("data_tx_over"); - data_tx_over->setKind(XMAC_DATA_TX_OVER); + data_tx_over = new cMessage("data_tx_over"); + data_tx_over->setKind(XMAC_DATA_TX_OVER); - stop_preambles = new cMessage("stop_preambles"); - stop_preambles->setKind(XMAC_STOP_PREAMBLES); + stop_preambles = new cMessage("stop_preambles"); + stop_preambles->setKind(XMAC_STOP_PREAMBLES); - send_preamble = new cMessage("send_preamble"); - send_preamble->setKind(XMAC_SEND_PREAMBLE); + send_preamble = new cMessage("send_preamble"); + send_preamble->setKind(XMAC_SEND_PREAMBLE); - ack_tx_over = new cMessage("ack_tx_over"); - ack_tx_over->setKind(XMAC_ACK_TX_OVER); + ack_tx_over = new cMessage("ack_tx_over"); + ack_tx_over->setKind(XMAC_ACK_TX_OVER); - cca_timeout = new cMessage("cca_timeout"); - cca_timeout->setKind(XMAC_CCA_TIMEOUT); - cca_timeout->setSchedulingPriority(100); + cca_timeout = new cMessage("cca_timeout"); + cca_timeout->setKind(XMAC_CCA_TIMEOUT); + cca_timeout->setSchedulingPriority(100); - send_ack = new cMessage("send_ack"); - send_ack->setKind(XMAC_SEND_ACK); + send_ack = new cMessage("send_ack"); + send_ack->setKind(XMAC_SEND_ACK); - start_xmac = new cMessage("start_xmac"); - start_xmac->setKind(XMAC_START_XMAC); + start_xmac = new cMessage("start_xmac"); + start_xmac->setKind(XMAC_START_XMAC); - ack_timeout = new cMessage("ack_timeout"); - ack_timeout->setKind(XMAC_ACK_TIMEOUT); + ack_timeout = new cMessage("ack_timeout"); + ack_timeout->setKind(XMAC_ACK_TIMEOUT); - resend_data = new cMessage("resend_data"); - resend_data->setKind(XMAC_RESEND_DATA); - resend_data->setSchedulingPriority(100); + resend_data = new cMessage("resend_data"); + resend_data->setKind(XMAC_RESEND_DATA); + resend_data->setSchedulingPriority(100); - switch_preamble_phase = new cMessage("switch_preamble_phase"); - switch_preamble_phase->setKind(SWITCH_PREAMBLE_PHASE); + switch_preamble_phase = new cMessage("switch_preamble_phase"); + switch_preamble_phase->setKind(SWITCH_PREAMBLE_PHASE); - delay_for_ack_within_remote_rx = new cMessage("delay_for_ack_within_remote_rx"); - delay_for_ack_within_remote_rx->setKind(DELAY_FOR_ACK_WITHIN_REMOTE_RX); + delay_for_ack_within_remote_rx = new cMessage("delay_for_ack_within_remote_rx"); + delay_for_ack_within_remote_rx->setKind(DELAY_FOR_ACK_WITHIN_REMOTE_RX); - switching_done = new cMessage("switching_done"); - switching_done->setKind(XMAC_SWITCHING_FINISHED); + switching_done = new cMessage("switching_done"); + switching_done->setKind(XMAC_SWITCHING_FINISHED); - scheduleAt(0.0, start_xmac); - } + scheduleAt(0.0, start_xmac); + } } XMacLayer::~XMacLayer() { - cancelAndDelete(wakeup); - cancelAndDelete(data_timeout); - cancelAndDelete(data_tx_over); - cancelAndDelete(stop_preambles); - cancelAndDelete(send_preamble); - cancelAndDelete(ack_tx_over); - cancelAndDelete(cca_timeout); - cancelAndDelete(send_ack); - cancelAndDelete(start_xmac); - cancelAndDelete(ack_timeout); - cancelAndDelete(resend_data); - cancelAndDelete(switch_preamble_phase); - cancelAndDelete(delay_for_ack_within_remote_rx); - cancelAndDelete(switching_done); + cancelAndDelete(wakeup); + cancelAndDelete(data_timeout); + cancelAndDelete(data_tx_over); + cancelAndDelete(stop_preambles); + cancelAndDelete(send_preamble); + cancelAndDelete(ack_tx_over); + cancelAndDelete(cca_timeout); + cancelAndDelete(send_ack); + cancelAndDelete(start_xmac); + cancelAndDelete(ack_timeout); + cancelAndDelete(resend_data); + cancelAndDelete(switch_preamble_phase); + cancelAndDelete(delay_for_ack_within_remote_rx); + cancelAndDelete(switching_done); } void XMacLayer::flushQueue() @@ -170,18 +170,18 @@ void XMacLayer::finish() // record stats if (stats) { - recordScalar("nbTxDataPackets", nbTxDataPackets); - recordScalar("nbTxPreambles", nbTxPreambles); - recordScalar("nbRxDataPackets", nbRxDataPackets); - recordScalar("nbRxPreambles", nbRxPreambles); - recordScalar("nbMissedAcks", nbMissedAcks); - recordScalar("nbRecvdAcks", nbRecvdAcks); - recordScalar("nbTxAcks", nbTxAcks); - recordScalar("nbDroppedDataPackets", nbDroppedDataPackets); - recordScalar("nbRxBrokenDataPackets", nbRxBrokenDataPackets); - //recordScalar("timeSleep", timeSleep); - //recordScalar("timeRX", timeRX); - //recordScalar("timeTX", timeTX); + recordScalar("nbTxDataPackets", nbTxDataPackets); + recordScalar("nbTxPreambles", nbTxPreambles); + recordScalar("nbRxDataPackets", nbRxDataPackets); + recordScalar("nbRxPreambles", nbRxPreambles); + recordScalar("nbMissedAcks", nbMissedAcks); + recordScalar("nbRecvdAcks", nbRecvdAcks); + recordScalar("nbTxAcks", nbTxAcks); + recordScalar("nbDroppedDataPackets", nbDroppedDataPackets); + recordScalar("nbRxBrokenDataPackets", nbRxBrokenDataPackets); + //recordScalar("timeSleep", timeSleep); + //recordScalar("timeRX", timeRX); + //recordScalar("timeTX", timeTX); } } @@ -213,7 +213,7 @@ InterfaceEntry *XMacLayer::createInterfaceEntry() e->setInterfaceToken(address.formInterfaceIdentifier()); // capabilities - e->setMtu(par("mtu").longValue()); + e->setMtu(par("mtu").intValue()); e->setMulticast(false); e->setBroadcast(true); @@ -227,16 +227,16 @@ InterfaceEntry *XMacLayer::createInterfaceEntry() */ void XMacLayer::handleUpperPacket(cPacket *msg) { - bool pktAdded = addToQueue(msg); - if (!pktAdded) - return; - // force wakeup now - if (wakeup->isScheduled() && (macState == SLEEP)) - { - cancelEvent(wakeup); - scheduleAt(simTime() + dblrand()*0.01f, wakeup); - }else if(macState == SLEEP){ - } + bool pktAdded = addToQueue(msg); + if (!pktAdded) + return; + // force wakeup now + if (wakeup->isScheduled() && (macState == SLEEP)) + { + cancelEvent(wakeup); + scheduleAt(simTime() + dblrand()*0.01f, wakeup); + }else if(macState == SLEEP){ + } } /** @@ -246,13 +246,13 @@ void XMacLayer::sendPreamble(MACAddress preamble_address) { //~ diff with BMAC, @ in preamble! XMacFrame* preamble = new XMacFrame("Preamble"); - preamble->setSrc(address); - preamble->setDest(preamble_address); - preamble->setKind(XMAC_PREAMBLE); - preamble->setBitLength(headerLength); - attachSignal(preamble, simTime()); - sendDown(preamble); - nbTxPreambles++; + preamble->setSrc(address); + preamble->setDest(preamble_address); + preamble->setKind(XMAC_PREAMBLE); + preamble->setBitLength(headerLength); + attachSignal(preamble, simTime()); + sendDown(preamble); + nbTxPreambles++; } /** @@ -261,14 +261,14 @@ void XMacLayer::sendPreamble(MACAddress preamble_address) void XMacLayer::sendMacAck() { XMacFrame* ack = new XMacFrame("Acknowledgment"); - ack->setSrc(address); - //~ diff with BMAC, ack_preamble_based - ack->setDest(lastPreamblePktSrcAddr); - ack->setKind(XMAC_ACK); - ack->setBitLength(headerLength); + ack->setSrc(address); + //~ diff with BMAC, ack_preamble_based + ack->setDest(lastPreamblePktSrcAddr); + ack->setKind(XMAC_ACK); + ack->setBitLength(headerLength); attachSignal(ack, simTime()); - sendDown(ack); - nbTxAcks++; + sendDown(ack); + nbTxAcks++; } /** @@ -276,75 +276,75 @@ void XMacLayer::sendMacAck() */ void XMacLayer::handleSelfMessage(cMessage *msg) { - switch (macState) - { - case INIT: - if (msg->getKind() == XMAC_START_XMAC) - { - EV_DEBUG << "State INIT, message XMAC_START, new state SLEEP" << endl; - changeDisplayColor(BLACK); - radio->setRadioMode(IRadio::RADIO_MODE_SLEEP); - macState = SLEEP; - scheduleAt(simTime()+dblrand()*slotDuration, wakeup); - return; - } - break; - case SLEEP: - if (msg->getKind() == XMAC_WAKE_UP) - { - EV_DEBUG << "node " << address << " : State SLEEP, message XMAC_WAKEUP, new state CCA, simTime " << - simTime() << " to " << simTime() + 1.7f * checkInterval << endl; - // this CCA is useful when in RX to detect preamble and has to make room for - // 0.2f = Tx switch, 0.5f = Tx send_preamble, 1f = time_for_ack_back - scheduleAt(simTime() + 1.7f * checkInterval, cca_timeout); - radio->setRadioMode(IRadio::RADIO_MODE_RECEIVER); - changeDisplayColor(GREEN); - macState = CCA; - return; - } - // we receive an ACK back but it is too late - else if (msg->getKind() == XMAC_ACK) { - nbMissedAcks++; - delete msg; - return; - } - // received messages prior real-switching to SLEEP? I'm sorry, out - else { return; } - break; - case CCA: - if (msg->getKind() == XMAC_CCA_TIMEOUT) - { - // channel is clear and we wanna SEND - if (macQueue.size() > 0) - { - radio->setRadioMode(IRadio::RADIO_MODE_TRANSMITTER); - changeDisplayColor(YELLOW); - macState = SEND_PREAMBLE; - // We send the preamble for a whole SLOT duration :) - scheduleAt(simTime() + slotDuration, stop_preambles); - // if 0.2f * CI = 2ms to switch to TX -> has to be accounted for RX_preamble_detection - scheduleAt(simTime() + 0.2f * checkInterval, switch_preamble_phase); - return; - } - // if anything to send, go back to sleep and wake up after a full period - else - { - scheduleAt(simTime() + slotDuration, wakeup); - macState = SLEEP; - radio->setRadioMode(IRadio::RADIO_MODE_SLEEP); - changeDisplayColor(BLACK); - return; - } - } - // during CCA, we received a preamble. Go to state WAIT_DATA and - // schedule the timeout. - if (msg->getKind() == XMAC_PREAMBLE) - { - XMacFrame* incoming_preamble = static_cast(msg); - - // preamble is for me - if (incoming_preamble->getDest() == address || incoming_preamble->getDest().isBroadcast() || incoming_preamble->getDest().isMulticast()) { - cancelEvent(cca_timeout); + switch (macState) + { + case INIT: + if (msg->getKind() == XMAC_START_XMAC) + { + EV_DEBUG << "State INIT, message XMAC_START, new state SLEEP" << endl; + changeDisplayColor(BLACK); + radio->setRadioMode(IRadio::RADIO_MODE_SLEEP); + macState = SLEEP; + scheduleAt(simTime()+dblrand()*slotDuration, wakeup); + return; + } + break; + case SLEEP: + if (msg->getKind() == XMAC_WAKE_UP) + { + EV_DEBUG << "node " << address << " : State SLEEP, message XMAC_WAKEUP, new state CCA, simTime " << + simTime() << " to " << simTime() + 1.7f * checkInterval << endl; + // this CCA is useful when in RX to detect preamble and has to make room for + // 0.2f = Tx switch, 0.5f = Tx send_preamble, 1f = time_for_ack_back + scheduleAt(simTime() + 1.7f * checkInterval, cca_timeout); + radio->setRadioMode(IRadio::RADIO_MODE_RECEIVER); + changeDisplayColor(GREEN); + macState = CCA; + return; + } + // we receive an ACK back but it is too late + else if (msg->getKind() == XMAC_ACK) { + nbMissedAcks++; + delete msg; + return; + } + // received messages prior real-switching to SLEEP? I'm sorry, out + else { return; } + break; + case CCA: + if (msg->getKind() == XMAC_CCA_TIMEOUT) + { + // channel is clear and we wanna SEND + if (macQueue.size() > 0) + { + radio->setRadioMode(IRadio::RADIO_MODE_TRANSMITTER); + changeDisplayColor(YELLOW); + macState = SEND_PREAMBLE; + // We send the preamble for a whole SLOT duration :) + scheduleAt(simTime() + slotDuration, stop_preambles); + // if 0.2f * CI = 2ms to switch to TX -> has to be accounted for RX_preamble_detection + scheduleAt(simTime() + 0.2f * checkInterval, switch_preamble_phase); + return; + } + // if anything to send, go back to sleep and wake up after a full period + else + { + scheduleAt(simTime() + slotDuration, wakeup); + macState = SLEEP; + radio->setRadioMode(IRadio::RADIO_MODE_SLEEP); + changeDisplayColor(BLACK); + return; + } + } + // during CCA, we received a preamble. Go to state WAIT_DATA and + // schedule the timeout. + if (msg->getKind() == XMAC_PREAMBLE) + { + XMacFrame* incoming_preamble = static_cast(msg); + + // preamble is for me + if (incoming_preamble->getDest() == address || incoming_preamble->getDest().isBroadcast() || incoming_preamble->getDest().isMulticast()) { + cancelEvent(cca_timeout); nbRxPreambles++; EV << "node " << address << " : State CCA, message XMAC_PREAMBLE received, new state SEND_ACK" << endl; macState = SEND_ACK; @@ -363,20 +363,20 @@ void XMacLayer::handleSelfMessage(cMessage *msg) changeDisplayColor(BLACK); } - delete msg; - return; - } - //in case we get an ACK, we simply dicard it, because it means the end - //of another communication - if (msg->getKind() == XMAC_ACK) - { - EV_DEBUG << "State CCA, message XMAC_ACK, new state CCA" << endl; - delete msg; - return; - } + delete msg; + return; + } + //in case we get an ACK, we simply dicard it, because it means the end + //of another communication + if (msg->getKind() == XMAC_ACK) + { + EV_DEBUG << "State CCA, message XMAC_ACK, new state CCA" << endl; + delete msg; + return; + } // this case is very, very, very improbable, but let's do it. // if in CCA the node receives directly the data packet, accept it - // even if we increased nbMissedAcks in state SLEEP + // even if we increased nbMissedAcks in state SLEEP if (msg->getKind() == XMAC_DATA) { XMacFrame* incoming_data = static_cast(msg); @@ -392,13 +392,13 @@ void XMacLayer::handleSelfMessage(cMessage *msg) } return; } - break; + break; - case SEND_PREAMBLE: - if (msg->getKind() == SWITCH_PREAMBLE_PHASE) - { - //~ make room for preamble + time_for_ack_back, check_interval is 10ms by default (from NetworkXMAC.ini) - // 0.5f* = 5ms + case SEND_PREAMBLE: + if (msg->getKind() == SWITCH_PREAMBLE_PHASE) + { + //~ make room for preamble + time_for_ack_back, check_interval is 10ms by default (from NetworkXMAC.ini) + // 0.5f* = 5ms if (radio->getRadioMode() == IRadio::RADIO_MODE_RECEIVER) { radio->setRadioMode(IRadio::RADIO_MODE_TRANSMITTER); changeDisplayColor(YELLOW); @@ -412,17 +412,17 @@ void XMacLayer::handleSelfMessage(cMessage *msg) EV_DEBUG << "node " << address << " : preamble_phase rx, simTime = " << simTime() << endl; scheduleAt(simTime() + 1.0f *checkInterval, switch_preamble_phase); } - return; - } - // radio switch from above - if(msg->getKind() == XMAC_SWITCHING_FINISHED) { - if (radio->getRadioMode() == IRadio::RADIO_MODE_TRANSMITTER) { + return; + } + // radio switch from above + if(msg->getKind() == XMAC_SWITCHING_FINISHED) { + if (radio->getRadioMode() == IRadio::RADIO_MODE_TRANSMITTER) { XMacFrame *pkt_preamble = macQueue.front(); sendPreamble(pkt_preamble->getDest()); } - return; - } - // ack_rx within sending_preamble or preamble_timeout without an ACK + return; + } + // ack_rx within sending_preamble or preamble_timeout without an ACK if ((msg->getKind() == XMAC_ACK) || (msg->getKind() == XMAC_STOP_PREAMBLES)) { //~ ADDED THE SECOND CONDITION! :) if not, below @@ -441,45 +441,45 @@ void XMacLayer::handleSelfMessage(cMessage *msg) return; } - // next is the case of a node receiving 1 preamble or data while in his preamble gaps, ignore, we are sending! - if ((msg->getKind() == XMAC_PREAMBLE) || (msg->getKind() == XMAC_DATA)) { - if(msg->getKind() == XMAC_DATA){ - nbDroppedDataPackets++; - } - delete msg; - return; - } - else { + // next is the case of a node receiving 1 preamble or data while in his preamble gaps, ignore, we are sending! + if ((msg->getKind() == XMAC_PREAMBLE) || (msg->getKind() == XMAC_DATA)) { + if(msg->getKind() == XMAC_DATA){ + nbDroppedDataPackets++; + } + delete msg; + return; + } + else { EV << "**node " << address << " : State SEND_PREAMBLE, received message " << msg->getKind() << endl; - return; - } - break; - - case SEND_DATA: - if (msg->getKind() == XMAC_STOP_PREAMBLES) - { - EV << "node " << address << " : State SEND_DATA, message XMAC_STOP_PREAMBLES" << endl; + return; + } + break; + + case SEND_DATA: + if (msg->getKind() == XMAC_STOP_PREAMBLES) + { + EV << "node " << address << " : State SEND_DATA, message XMAC_STOP_PREAMBLES" << endl; // send the data packet sendDataPacket(); macState = WAIT_TX_DATA_OVER; - return; - }else if (msg->getKind() == XMAC_SWITCHING_FINISHED) { - EV << "node " << address << " : State SEND_DATA, message RADIO_SWITCHING OVER, sending packet..." << endl; + return; + }else if (msg->getKind() == XMAC_SWITCHING_FINISHED) { + EV << "node " << address << " : State SEND_DATA, message RADIO_SWITCHING OVER, sending packet..." << endl; // send the data packet sendDataPacket(); macState = WAIT_TX_DATA_OVER; return; - } - else { - return; - } - break; - - case WAIT_TX_DATA_OVER: - if (msg->getKind() == XMAC_DATA_TX_OVER) - { - EV_DEBUG << "node " << address << " : State WAIT_TX_DATA_OVER, message XMAC_DATA_TX_OVER, new state SLEEP" << endl; - // remove the packet just served from the queue + } + else { + return; + } + break; + + case WAIT_TX_DATA_OVER: + if (msg->getKind() == XMAC_DATA_TX_OVER) + { + EV_DEBUG << "node " << address << " : State WAIT_TX_DATA_OVER, message XMAC_DATA_TX_OVER, new state SLEEP" << endl; + // remove the packet just served from the queue delete macQueue.front(); macQueue.pop_front(); // if something in the queue, wakeup soon. @@ -490,95 +490,95 @@ void XMacLayer::handleSelfMessage(cMessage *msg) macState = SLEEP; radio->setRadioMode(IRadio::RADIO_MODE_SLEEP); changeDisplayColor(BLACK); - return; - } - break; - case WAIT_ACK: - //not used - break; - case WAIT_DATA: - if (msg->getKind() == XMAC_PREAMBLE) - { - //nothing happens - nbRxPreambles++; - delete msg; - return; - } - if (msg->getKind() == XMAC_ACK) - { - //nothing happens - delete msg; - return; - } - if (msg->getKind() == XMAC_DATA) - { - XMacFrame* mac = static_cast(msg); - const MACAddress& dest = mac->getDest(); - - if ((dest == address) || dest.isBroadcast() || dest.isMulticast()) { - sendUp(decapsMsg(mac)); - delete mac; - nbRxDataPackets++; - cancelEvent(data_timeout); - - // if something in the queue, wakeup soon. - if (macQueue.size() > 0) - scheduleAt(simTime() + dblrand()*checkInterval, wakeup); - else - scheduleAt(simTime() + slotDuration, wakeup); - macState = SLEEP; - radio->setRadioMode(IRadio::RADIO_MODE_SLEEP); - changeDisplayColor(BLACK); - - } else { - delete msg; - msg = NULL; - mac = NULL; - } + return; + } + break; + case WAIT_ACK: + //not used + break; + case WAIT_DATA: + if (msg->getKind() == XMAC_PREAMBLE) + { + //nothing happens + nbRxPreambles++; + delete msg; + return; + } + if (msg->getKind() == XMAC_ACK) + { + //nothing happens + delete msg; + return; + } + if (msg->getKind() == XMAC_DATA) + { + XMacFrame* mac = static_cast(msg); + const MACAddress& dest = mac->getDest(); + + if ((dest == address) || dest.isBroadcast() || dest.isMulticast()) { + sendUp(decapsMsg(mac)); + delete mac; + nbRxDataPackets++; + cancelEvent(data_timeout); + + // if something in the queue, wakeup soon. + if (macQueue.size() > 0) + scheduleAt(simTime() + dblrand()*checkInterval, wakeup); + else + scheduleAt(simTime() + slotDuration, wakeup); + macState = SLEEP; + radio->setRadioMode(IRadio::RADIO_MODE_SLEEP); + changeDisplayColor(BLACK); + + } else { + delete msg; + msg = NULL; + mac = NULL; + } EV << "node " << address << " : State WAIT_DATA, message XMAC_DATA, new state SLEEP" << endl; - return; - } - // data does not arrives in time - if (msg->getKind() == XMAC_DATA_TIMEOUT) - { - EV << "node " << address << " : State WAIT_DATA, message XMAC_DATA_TIMEOUT, new state SLEEP" << endl; - // if something in the queue, wakeup soon. - if (macQueue.size() > 0) - scheduleAt(simTime() + dblrand()*checkInterval, wakeup); - else - scheduleAt(simTime() + slotDuration, wakeup); - macState = SLEEP; - radio->setRadioMode(IRadio::RADIO_MODE_SLEEP); - changeDisplayColor(BLACK); - return; - } - break; - case SEND_ACK: + return; + } + // data does not arrives in time + if (msg->getKind() == XMAC_DATA_TIMEOUT) + { + EV << "node " << address << " : State WAIT_DATA, message XMAC_DATA_TIMEOUT, new state SLEEP" << endl; + // if something in the queue, wakeup soon. + if (macQueue.size() > 0) + scheduleAt(simTime() + dblrand()*checkInterval, wakeup); + else + scheduleAt(simTime() + slotDuration, wakeup); + macState = SLEEP; + radio->setRadioMode(IRadio::RADIO_MODE_SLEEP); + changeDisplayColor(BLACK); + return; + } + break; + case SEND_ACK: // send now the ack packet - if (msg->getKind() == DELAY_FOR_ACK_WITHIN_REMOTE_RX) { - EV_DEBUG << "node " << address << " : State SEND_ACK, message XMAC_SEND_ACK, new state WAIT_ACK_TX" << endl; - sendMacAck(); - macState = WAIT_ACK_TX; - return; - } - break; - case WAIT_ACK_TX: + if (msg->getKind() == DELAY_FOR_ACK_WITHIN_REMOTE_RX) { + EV_DEBUG << "node " << address << " : State SEND_ACK, message XMAC_SEND_ACK, new state WAIT_ACK_TX" << endl; + sendMacAck(); + macState = WAIT_ACK_TX; + return; + } + break; + case WAIT_ACK_TX: // wait for the ACK to be sent back to the Transmitter - if (msg->getKind() == XMAC_ACK_TX_OVER) - { - EV_DEBUG << "node " << address << " : State WAIT_ACK_TX, message XMAC_ACK_TX_OVER, new state WAIT_DATA" << endl; + if (msg->getKind() == XMAC_ACK_TX_OVER) + { + EV_DEBUG << "node " << address << " : State WAIT_ACK_TX, message XMAC_ACK_TX_OVER, new state WAIT_DATA" << endl; changeDisplayColor(GREEN); macState = WAIT_DATA; cancelEvent(cca_timeout); scheduleAt(simTime() + (slotDuration / 2), data_timeout); - radio->setRadioMode(IRadio::RADIO_MODE_RECEIVER); - return; - } - break; - } - throw cRuntimeError("Undefined event of type %d in state %d (Radio state %d)!", - msg->getKind(), macState, radio->getRadioMode()); + radio->setRadioMode(IRadio::RADIO_MODE_RECEIVER); + return; + } + break; + } + throw cRuntimeError("Undefined event of type %d in state %d (Radio state %d)!", + msg->getKind(), macState, radio->getRadioMode()); } @@ -593,18 +593,18 @@ void XMacLayer::handleLowerPacket(cPacket *msg) delete msg; return; } - // simply pass the massage as self message, to be processed by the FSM. - handleSelfMessage(msg); + // simply pass the massage as self message, to be processed by the FSM. + handleSelfMessage(msg); } void XMacLayer::sendDataPacket() { - nbTxDataPackets++; - XMacFrame* pkt = check_and_cast(macQueue.front()->dup()); - attachSignal(pkt, simTime()); - lastDataPktDestAddr = pkt->getDest(); - pkt->setKind(XMAC_DATA); - sendDown(pkt); + nbTxDataPackets++; + XMacFrame* pkt = check_and_cast(macQueue.front()->dup()); + attachSignal(pkt, simTime()); + lastDataPktDestAddr = pkt->getDest(); + pkt->setKind(XMAC_DATA); + sendDown(pkt); } /** @@ -648,18 +648,18 @@ void XMacLayer::receiveSignal(cComponent *source, simsignal_t signalID, long val */ bool XMacLayer::addToQueue(cMessage *msg) { - if (macQueue.size() >= queueLength) { - // queue is full, message has to be deleted - EV_DEBUG << "New packet arrived, but queue is FULL, so new packet is" - " deleted\n"; - emit(packetFromUpperDroppedSignal, msg); - delete msg; - nbDroppedDataPackets++; - - return false; - } - - XMacFrame *macPkt = new XMacFrame(msg->getName()); + if (macQueue.size() >= queueLength) { + // queue is full, message has to be deleted + EV_DEBUG << "New packet arrived, but queue is FULL, so new packet is" + " deleted\n"; + emit(packetFromUpperDroppedSignal, msg); + delete msg; + nbDroppedDataPackets++; + + return false; + } + + XMacFrame *macPkt = new XMacFrame(msg->getName()); macPkt->setBitLength(headerLength); IMACProtocolControlInfo *const cInfo = check_and_cast(msg->removeControlInfo()); EV_DETAIL << "CSMA received a message from upper layer, name is " << msg->getName() << ", CInfo removed, mac addr=" << cInfo->getDestinationAddress() << endl; @@ -668,14 +668,14 @@ bool XMacLayer::addToQueue(cMessage *msg) delete cInfo; macPkt->setSrc(address); - assert(static_cast(msg)); - macPkt->encapsulate(static_cast(msg)); + assert(static_cast(msg)); + macPkt->encapsulate(static_cast(msg)); EV_DETAIL << "pkt encapsulated, length: " << macPkt->getBitLength() << "\n"; - macQueue.push_back(macPkt); - EV_DEBUG << "Max queue length: " << queueLength << ", packet put in queue" - "\n queue size: " << macQueue.size() << " macState: " - << macState << endl; - return true; + macQueue.push_back(macPkt); + EV_DEBUG << "Max queue length: " << queueLength << ", packet put in queue" + "\n queue size: " << macQueue.size() << " macState: " + << macState << endl; + return true; } void XMacLayer::attachSignal(XMacFrame *mac, simtime_t_cref startTime) @@ -689,25 +689,25 @@ void XMacLayer::attachSignal(XMacFrame *mac, simtime_t_cref startTime) */ void XMacLayer::changeDisplayColor(XMAC_COLORS color) { - if (!animation) - return; - cDisplayString& dispStr = getContainingNode(this)->getDisplayString(); - //b=40,40,rect,black,black,2" - if (color == GREEN) - dispStr.setTagArg("b", 3, "green"); - //dispStr.parse("b=40,40,rect,green,green,2"); - if (color == BLUE) - dispStr.setTagArg("b", 3, "blue"); - //dispStr.parse("b=40,40,rect,blue,blue,2"); - if (color == RED) - dispStr.setTagArg("b", 3, "red"); - //dispStr.parse("b=40,40,rect,red,red,2"); - if (color == BLACK) - dispStr.setTagArg("b", 3, "black"); - //dispStr.parse("b=40,40,rect,black,black,2"); - if (color == YELLOW) - dispStr.setTagArg("b", 3, "yellow"); - //dispStr.parse("b=40,40,rect,yellow,yellow,2"); + if (!animation) + return; + cDisplayString& dispStr = getContainingNode(this)->getDisplayString(); + //b=40,40,rect,black,black,2" + if (color == GREEN) + dispStr.setTagArg("b", 3, "green"); + //dispStr.parse("b=40,40,rect,green,green,2"); + if (color == BLUE) + dispStr.setTagArg("b", 3, "blue"); + //dispStr.parse("b=40,40,rect,blue,blue,2"); + if (color == RED) + dispStr.setTagArg("b", 3, "red"); + //dispStr.parse("b=40,40,rect,red,red,2"); + if (color == BLACK) + dispStr.setTagArg("b", 3, "black"); + //dispStr.parse("b=40,40,rect,black,black,2"); + if (color == YELLOW) + dispStr.setTagArg("b", 3, "yellow"); + //dispStr.parse("b=40,40,rect,yellow,yellow,2"); } /** diff --git a/src/inet/mobility/group/MoBANCoordinator.cc b/src/inet/mobility/group/MoBANCoordinator.cc index 7e35e348f98..3fc96a39974 100644 --- a/src/inet/mobility/group/MoBANCoordinator.cc +++ b/src/inet/mobility/group/MoBANCoordinator.cc @@ -719,7 +719,7 @@ void MoBANCoordinator::collectLocalModules(cModule *module) cModule *submodule = *it; collectLocalModules(submodule); MoBANLocal *localModule = dynamic_cast(submodule); - if (localModule && localModule->par("coordinatorIndex").longValue() == getIndex()) { + if (localModule && localModule->par("coordinatorIndex").intValue() == getIndex()) { localModule->setCoordinator(this); localModules.push_back(localModule); } diff --git a/src/inet/mobility/group/PostureTransition.cc b/src/inet/mobility/group/PostureTransition.cc index e6d5069c012..cc04761754a 100644 --- a/src/inet/mobility/group/PostureTransition.cc +++ b/src/inet/mobility/group/PostureTransition.cc @@ -319,7 +319,7 @@ double **PostureTransition::getMatrix(simtime_t iTime, Coord iLocation) } } - EV_DEBUG << "The corresponding Markov matrix for time" << iTime.dbl() << " and location " << iLocation.info() << " is: " << matrixList.at(matrixID)->name << endl; + EV_DEBUG << "The corresponding Markov matrix for time" << iTime.dbl() << " and location " << iLocation.str() << " is: " << matrixList.at(matrixID)->name << endl; return matrixList.at(matrixID)->matrix; } diff --git a/src/inet/networklayer/common/InterfaceEntry.cc b/src/inet/networklayer/common/InterfaceEntry.cc index e4fe95ca173..8ab69fad9a0 100644 --- a/src/inet/networklayer/common/InterfaceEntry.cc +++ b/src/inet/networklayer/common/InterfaceEntry.cc @@ -55,15 +55,10 @@ void InterfaceProtocolData::changed(simsignal_t signalID, int fieldId) ownerp->changed(signalID, fieldId); } -std::string InterfaceEntryChangeDetails::info() const -{ - return ie->info(); -} - -std::string InterfaceEntryChangeDetails::detailedInfo() const +std::string InterfaceEntryChangeDetails::str() const { std::stringstream out; - out << ie->detailedInfo() << " changed field: " << field << "\n"; + out << ie->str() << " changed field: " << field << "\n"; return out.str(); } @@ -83,7 +78,7 @@ InterfaceEntry::~InterfaceEntry() resetInterface(); } -std::string InterfaceEntry::info() const +std::string InterfaceEntry::str() const { std::stringstream out; out << (getName()[0] ? getName() : "*"); @@ -111,11 +106,11 @@ std::string InterfaceEntry::info() const #ifdef WITH_IPv4 if (ipv4data) - out << " " << ipv4data->info(); + out << " " << ipv4data->str(); #endif // ifdef WITH_IPv4 #ifdef WITH_IPv6 if (ipv6data) - out << " " << ipv6data->info(); + out << " " << ipv6data->str(); #endif // ifdef WITH_IPv6 if (isisdata) out << " " << ((InterfaceProtocolData *)isisdata)->str(); // Khmm... @@ -126,53 +121,6 @@ std::string InterfaceEntry::info() const return out.str(); } -std::string InterfaceEntry::detailedInfo() const -{ - std::stringstream out; - out << "name:" << (getName()[0] ? getName() : "*"); - if (getNetworkLayerGateIndex() == -1) - out << " on:-"; - else - out << " on:nwLayer.ifOut[" << getNetworkLayerGateIndex() << "]"; - out << "MTU: " << getMTU() << " \t"; - if (!isUp()) - out << "DOWN "; - if (isBroadcast()) - out << "BROADCAST "; - if (isMulticast()) - out << "MULTICAST "; - if (isPointToPoint()) - out << "POINTTOPOINT "; - if (isLoopback()) - out << "LOOPBACK "; - out << "\n"; - out << " macAddr:"; - if (getMacAddress().isUnspecified()) - out << "n/a"; - else - out << getMacAddress(); - out << "\n"; -#ifdef WITH_IPv4 - if (ipv4data) - out << " " << ipv4data->detailedInfo() << "\n"; -#endif // ifdef WITH_IPv4 -#ifdef WITH_IPv6 - if (ipv6data) - out << " " << ipv6data->detailedInfo() << "\n"; -#endif // ifdef WITH_IPv6 -#ifdef WITH_GENERIC - if (genericNetworkProtocolData) - out << " " << genericNetworkProtocolData->detailedInfo() << "\n"; -#endif // ifdef WITH_GENERIC - if (isisdata) - out << " " << ((InterfaceProtocolData *)isisdata)->str() << "\n"; // Khmm... - if (trilldata) - out << " " << ((InterfaceProtocolData *)trilldata)->str() << "\n"; // Khmm... - if (ieee8021ddata) - out << " " << ((InterfaceProtocolData *)ieee8021ddata)->str() << "\n"; // Khmm... - return out.str(); -} - std::string InterfaceEntry::getFullPath() const { return ownerp == nullptr ? getFullName() : ownerp->getHostModule()->getFullPath() + "." + getFullName(); diff --git a/src/inet/networklayer/common/InterfaceEntry.h b/src/inet/networklayer/common/InterfaceEntry.h index 2ecc5d7c08c..5e4a442499e 100644 --- a/src/inet/networklayer/common/InterfaceEntry.h +++ b/src/inet/networklayer/common/InterfaceEntry.h @@ -86,8 +86,7 @@ class INET_API InterfaceEntryChangeDetails : public cObject InterfaceEntryChangeDetails(InterfaceEntry *ie, int field) : ie(ie), field(field) { ASSERT(ie); } InterfaceEntry *getInterfaceEntry() const { return ie; } int getFieldId() const { return field; } - virtual std::string info() const override; - virtual std::string detailedInfo() const override; + virtual std::string str() const override; }; /** @@ -158,8 +157,7 @@ class INET_API InterfaceEntry : public cNamedObject public: InterfaceEntry(cModule *module); virtual ~InterfaceEntry(); - virtual std::string info() const override; - virtual std::string detailedInfo() const override; + virtual std::string str() const override; virtual std::string getFullPath() const override; /** diff --git a/src/inet/networklayer/common/InterfaceTable.cc b/src/inet/networklayer/common/InterfaceTable.cc index 8f21344c415..56305620b4f 100644 --- a/src/inet/networklayer/common/InterfaceTable.cc +++ b/src/inet/networklayer/common/InterfaceTable.cc @@ -48,7 +48,7 @@ Define_Module(InterfaceTable); std::ostream& operator<<(std::ostream& os, const InterfaceEntry& e) { - os << e.info(); + os << e.str(); return os; }; diff --git a/src/inet/networklayer/configurator/generic/GenericNetworkConfigurator.cc b/src/inet/networklayer/configurator/generic/GenericNetworkConfigurator.cc index 74bc3a95e10..c066669d003 100644 --- a/src/inet/networklayer/configurator/generic/GenericNetworkConfigurator.cc +++ b/src/inet/networklayer/configurator/generic/GenericNetworkConfigurator.cc @@ -112,7 +112,7 @@ void GenericNetworkConfigurator::addStaticRoutes(Topology& topology) L3Address nextHopAddress = nextHopInterfaceEntry->getGenericNetworkProtocolData()->getAddress(); if (nextHopAddress != destinationAddress) route->setNextHop(nextHopAddress); - EV_DEBUG << "Adding route " << sourceInterfaceEntry->getFullPath() << " -> " << destinationInterfaceEntry->getFullPath() << " as " << route->info() << endl; + EV_DEBUG << "Adding route " << sourceInterfaceEntry->getFullPath() << " -> " << destinationInterfaceEntry->getFullPath() << " as " << route->str() << endl; sourceRoutingTable->addRoute(route); } } diff --git a/src/inet/networklayer/configurator/ipv4/IPv4NetworkConfigurator.cc b/src/inet/networklayer/configurator/ipv4/IPv4NetworkConfigurator.cc index c95cad11bce..eefbd53821e 100644 --- a/src/inet/networklayer/configurator/ipv4/IPv4NetworkConfigurator.cc +++ b/src/inet/networklayer/configurator/ipv4/IPv4NetworkConfigurator.cc @@ -706,7 +706,7 @@ void IPv4NetworkConfigurator::dumpAddresses(Topology& topology) for (auto & interfaceInfo : linkInfo->interfaceInfos) { InterfaceEntry *interfaceEntry = interfaceInfo->interfaceEntry; cModule *host = interfaceInfo->node->module; - EV_INFO << " " << host->getFullName() << " / " << interfaceEntry->info() << endl; + EV_INFO << " " << host->getFullName() << " / " << interfaceEntry->str() << endl; } } } @@ -1378,7 +1378,7 @@ void IPv4NetworkConfigurator::addStaticRoutes(Topology& topology, cXMLElement *a delete route; else { sourceNode->staticRoutes.push_back(route); - EV_DEBUG << "Adding route " << sourceInterfaceEntry->getFullPath() << " -> " << destinationInterfaceEntry->getFullPath() << " as " << route->info() << endl; + EV_DEBUG << "Adding route " << sourceInterfaceEntry->getFullPath() << " -> " << destinationInterfaceEntry->getFullPath() << " as " << route->str() << endl; } } } diff --git a/src/inet/networklayer/diffserv/DiffservUtil.cc b/src/inet/networklayer/diffserv/DiffservUtil.cc index 41957c741b3..178c2988554 100644 --- a/src/inet/networklayer/diffserv/DiffservUtil.cc +++ b/src/inet/networklayer/diffserv/DiffservUtil.cc @@ -220,7 +220,7 @@ class ColorAttribute : public cObject public: ColorAttribute(int color) : color(color) {} virtual const char *getName() const override { return "dscolor"; } - virtual std::string info() const override { return colorToString(color); } + virtual std::string str() const override { return colorToString(color); } virtual cObject *dup() const override { return new ColorAttribute(color); } }; diff --git a/src/inet/networklayer/generic/GenericNetworkProtocolInterfaceData.cc b/src/inet/networklayer/generic/GenericNetworkProtocolInterfaceData.cc index 12e336b6e96..f175b635771 100644 --- a/src/inet/networklayer/generic/GenericNetworkProtocolInterfaceData.cc +++ b/src/inet/networklayer/generic/GenericNetworkProtocolInterfaceData.cc @@ -22,7 +22,7 @@ namespace inet { -std::string GenericNetworkProtocolInterfaceData::info() const +std::string GenericNetworkProtocolInterfaceData::str() const { std::stringstream out; out << "generic addr:" << getAddress(); diff --git a/src/inet/networklayer/generic/GenericNetworkProtocolInterfaceData.h b/src/inet/networklayer/generic/GenericNetworkProtocolInterfaceData.h index 078e6f0c415..cf4140661b5 100644 --- a/src/inet/networklayer/generic/GenericNetworkProtocolInterfaceData.h +++ b/src/inet/networklayer/generic/GenericNetworkProtocolInterfaceData.h @@ -52,8 +52,8 @@ class INET_API GenericNetworkProtocolInterfaceData : public InterfaceProtocolDat public: GenericNetworkProtocolInterfaceData() { metric = 0; } - 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); /** @name Getters */ //@{ diff --git a/src/inet/networklayer/generic/GenericRoute.cc b/src/inet/networklayer/generic/GenericRoute.cc index b1fb9ccd1e1..3daf9d0c53d 100644 --- a/src/inet/networklayer/generic/GenericRoute.cc +++ b/src/inet/networklayer/generic/GenericRoute.cc @@ -23,7 +23,7 @@ namespace inet { Register_Class(GenericRoute); -std::string GenericRoute::info() const +std::string GenericRoute::str() const { std::stringstream out; @@ -77,7 +77,7 @@ IRoutingTable *GenericRoute::getRoutingTableAsGeneric() const #if 0 /*FIXME TODO!!!! */ -std::string GenericMulticastRoute::info() const +std::string GenericMulticastRoute::str() const { return ""; //TODO } diff --git a/src/inet/networklayer/generic/GenericRoute.h b/src/inet/networklayer/generic/GenericRoute.h index e325e947237..883b56dfdcb 100644 --- a/src/inet/networklayer/generic/GenericRoute.h +++ b/src/inet/networklayer/generic/GenericRoute.h @@ -52,8 +52,8 @@ class INET_API GenericRoute : public cObject, public IRoute source(nullptr), protocolData(nullptr), metric(0) {} virtual ~GenericRoute() { delete protocolData; } - 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 equals(const IRoute& route) const; @@ -123,8 +123,8 @@ class INET_API GenericMulticastRoute : public cObject, public IGenericMulticastR GenericMulticastRoute() {} //TODO virtual ~GenericMulticastRoute() {} - virtual std::string info() const; - virtual std::string detailedInfo() const; + virtual std::string str() const override; + virtual std::string detailedInfo() const OMNETPP5_CODE(override); virtual void setEnabled(bool enabled) { this->enabled = enabled; } virtual void setOrigin(const L3Address& origin) { this->origin = origin; } diff --git a/src/inet/networklayer/generic/GenericRoutingTable.cc b/src/inet/networklayer/generic/GenericRoutingTable.cc index 5ddbe1809f4..5c27c619f31 100644 --- a/src/inet/networklayer/generic/GenericRoutingTable.cc +++ b/src/inet/networklayer/generic/GenericRoutingTable.cc @@ -32,7 +32,7 @@ Define_Module(GenericRoutingTable); std::ostream& operator<<(std::ostream& os, const GenericRoute& e) { - os << e.info(); + os << e.str(); return os; }; @@ -416,7 +416,7 @@ IRoute *GenericRoutingTable::createRoute() void GenericRoutingTable::printRoutingTable() const { for (const auto & elem : routes) - EV_INFO << (elem)->getInterface()->getFullPath() << " -> " << (elem)->getDestinationAsGeneric().str() << " as " << (elem)->info() << endl; + EV_INFO << (elem)->getInterface()->getFullPath() << " -> " << (elem)->getDestinationAsGeneric().str() << " as " << (elem)->str() << endl; } } // namespace inet diff --git a/src/inet/networklayer/ipv4/IPv4InterfaceData.cc b/src/inet/networklayer/ipv4/IPv4InterfaceData.cc index 6f7656f9462..bc57308a5d9 100644 --- a/src/inet/networklayer/ipv4/IPv4InterfaceData.cc +++ b/src/inet/networklayer/ipv4/IPv4InterfaceData.cc @@ -65,7 +65,7 @@ bool IPv4MulticastSourceList::remove(IPv4Address source) return sources.size() != oldSize; } -std::string IPv4MulticastSourceList::info() const +std::string IPv4MulticastSourceList::str() const { std::stringstream out; out << (filterMode == MCAST_INCLUDE_SOURCES ? "I" : "E"); @@ -91,7 +91,7 @@ IPv4InterfaceData::HostMulticastData::~HostMulticastData() joinedMulticastGroups.clear(); } -std::string IPv4InterfaceData::HostMulticastData::info() +std::string IPv4InterfaceData::HostMulticastData::str() { std::stringstream out; if (!joinedMulticastGroups.empty()) { @@ -99,7 +99,7 @@ std::string IPv4InterfaceData::HostMulticastData::info() for (int i = 0; i < (int)joinedMulticastGroups.size(); ++i) { out << (i > 0 ? "," : "") << joinedMulticastGroups[i]->multicastGroup; if (!joinedMulticastGroups[i]->sourceList.containsAll()) - out << " " << joinedMulticastGroups[i]->sourceList.info(); + out << " " << joinedMulticastGroups[i]->sourceList.str(); } } return out.str(); @@ -124,7 +124,7 @@ IPv4InterfaceData::RouterMulticastData::~RouterMulticastData() reportedMulticastGroups.clear(); } -std::string IPv4InterfaceData::RouterMulticastData::info() +std::string IPv4InterfaceData::RouterMulticastData::str() { std::stringstream out; if (reportedMulticastGroups.size() > 0) { @@ -132,7 +132,7 @@ std::string IPv4InterfaceData::RouterMulticastData::info() for (int i = 0; i < (int)reportedMulticastGroups.size(); ++i) { out << (i > 0 ? "," : "") << reportedMulticastGroups[i]->multicastGroup; if (!reportedMulticastGroups[i]->sourceList.containsAll()) - out << " " << reportedMulticastGroups[i]->sourceList.info(); + out << " " << reportedMulticastGroups[i]->sourceList.str(); } } if (multicastTtlThreshold > 0) @@ -167,14 +167,14 @@ IPv4InterfaceData::~IPv4InterfaceData() delete routerData; } -std::string IPv4InterfaceData::info() const +std::string IPv4InterfaceData::str() const { std::stringstream out; out << "IPv4:{inet_addr:" << getIPAddress() << "/" << getNetmask().getNetmaskLength(); if (hostData) - out << hostData->info(); + out << hostData->str(); if (routerData) - out << routerData->info(); + out << routerData->str(); out << "}"; return out.str(); } diff --git a/src/inet/networklayer/ipv4/IPv4InterfaceData.h b/src/inet/networklayer/ipv4/IPv4InterfaceData.h index def303aa465..40fbccc4434 100644 --- a/src/inet/networklayer/ipv4/IPv4InterfaceData.h +++ b/src/inet/networklayer/ipv4/IPv4InterfaceData.h @@ -51,7 +51,7 @@ struct INET_API IPv4MulticastSourceList bool contains(IPv4Address source); bool add(IPv4Address source); bool remove(IPv4Address source); - std::string info() const; + std::string str() const; std::string detailedInfo() const; }; @@ -118,7 +118,7 @@ class INET_API IPv4InterfaceData : public InterfaceProtocolData HostMulticastGroupVector joinedMulticastGroups; // multicast groups this interface joined virtual ~HostMulticastData(); - std::string info(); + std::string str(); std::string detailedInfo(); }; @@ -140,7 +140,7 @@ class INET_API IPv4InterfaceData : public InterfaceProtocolData RouterMulticastData() : multicastTtlThreshold(0) {} virtual ~RouterMulticastData(); - std::string info(); + std::string str(); std::string detailedInfo(); }; @@ -169,8 +169,8 @@ class INET_API IPv4InterfaceData : public InterfaceProtocolData public: IPv4InterfaceData(); virtual ~IPv4InterfaceData(); - 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); /** @name Getters */ //@{ diff --git a/src/inet/networklayer/ipv4/IPv4Route.cc b/src/inet/networklayer/ipv4/IPv4Route.cc index 2091f1bfe81..8bcbd24194e 100644 --- a/src/inet/networklayer/ipv4/IPv4Route.cc +++ b/src/inet/networklayer/ipv4/IPv4Route.cc @@ -39,7 +39,7 @@ IPv4Route::~IPv4Route() delete protocolData; } -std::string IPv4Route::info() const +std::string IPv4Route::str() const { std::stringstream out; @@ -81,7 +81,7 @@ std::string IPv4Route::info() const std::string IPv4Route::detailedInfo() const { - return std::string(); + return str(); } bool IPv4Route::equals(const IPv4Route& route) const @@ -114,7 +114,7 @@ IPv4MulticastRoute::~IPv4MulticastRoute() outInterfaces.clear(); } -std::string IPv4MulticastRoute::info() const +std::string IPv4MulticastRoute::str() const { std::stringstream out; @@ -157,7 +157,7 @@ std::string IPv4MulticastRoute::info() const std::string IPv4MulticastRoute::detailedInfo() const { - return info(); + return str(); } void IPv4MulticastRoute::setInInterface(InInterface *_inInterface) diff --git a/src/inet/networklayer/ipv4/IPv4Route.h b/src/inet/networklayer/ipv4/IPv4Route.h index bf90089a872..a1a18f3e211 100644 --- a/src/inet/networklayer/ipv4/IPv4Route.h +++ b/src/inet/networklayer/ipv4/IPv4Route.h @@ -79,8 +79,8 @@ class INET_API IPv4Route : public cObject, public IRoute IPv4Route() : rt(nullptr), interfacePtr(nullptr), sourceType(MANUAL), adminDist(dUnknown), metric(0), source(nullptr), protocolData(nullptr) {} virtual ~IPv4Route(); - 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 operator==(const IPv4Route& route) const { return equals(route); } bool operator!=(const IPv4Route& route) const { return !equals(route); } @@ -191,8 +191,8 @@ class INET_API IPv4MulticastRoute : public cObject, public IMulticastRoute public: IPv4MulticastRoute() : rt(nullptr), inInterface(nullptr), sourceType(MANUAL), source(nullptr), metric(0) {} virtual ~IPv4MulticastRoute(); - 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); /** To be called by the routing table when this route is added or removed from it */ virtual void setRoutingTable(IIPv4RoutingTable *rt) { this->rt = rt; } diff --git a/src/inet/networklayer/ipv4/IPv4RoutingTable.cc b/src/inet/networklayer/ipv4/IPv4RoutingTable.cc index 3fb14db2ce0..908a78c9852 100644 --- a/src/inet/networklayer/ipv4/IPv4RoutingTable.cc +++ b/src/inet/networklayer/ipv4/IPv4RoutingTable.cc @@ -41,13 +41,13 @@ Define_Module(IPv4RoutingTable); std::ostream& operator<<(std::ostream& os, const IPv4Route& e) { - os << e.info(); + os << e.str(); return os; }; std::ostream& operator<<(std::ostream& os, const IPv4MulticastRoute& e) { - os << e.info(); + os << e.str(); return os; }; @@ -590,7 +590,7 @@ void IPv4RoutingTable::internalAddRoute(IPv4Route *entry) void IPv4RoutingTable::addRoute(IPv4Route *entry) { Enter_Method("addRoute(...)"); - EV_INFO << "add route " << entry->info() << "\n"; + EV_INFO << "add route " << entry->str() << "\n"; internalAddRoute(entry); @@ -616,7 +616,7 @@ IPv4Route *IPv4RoutingTable::removeRoute(IPv4Route *entry) entry = internalRemoveRoute(entry); if (entry != nullptr) { - EV_INFO << "remove route " << entry->info() << "\n"; + EV_INFO << "remove route " << entry->str() << "\n"; invalidateCache(); ASSERT(entry->getRoutingTable() == this); // still filled in, for the listeners' benefit emit(NF_ROUTE_DELETED, entry); @@ -632,7 +632,7 @@ bool IPv4RoutingTable::deleteRoute(IPv4Route *entry) //TODO this is almost du entry = internalRemoveRoute(entry); if (entry != nullptr) { - EV_INFO << "delete route " << entry->info() << "\n"; + EV_INFO << "delete route " << entry->str() << "\n"; invalidateCache(); ASSERT(entry->getRoutingTable() == this); // still filled in, for the listeners' benefit emit(NF_ROUTE_DELETED, entry); diff --git a/src/inet/networklayer/ipv6/IPv6InterfaceData.cc b/src/inet/networklayer/ipv6/IPv6InterfaceData.cc index 9824114fb9a..26655942852 100644 --- a/src/inet/networklayer/ipv6/IPv6InterfaceData.cc +++ b/src/inet/networklayer/ipv6/IPv6InterfaceData.cc @@ -29,7 +29,7 @@ Register_Abstract_Class(IPv6MulticastGroupInfo); //FIXME invoked changed() from state-changing methods, to trigger notification... -std::string IPv6InterfaceData::HostMulticastData::info() +std::string IPv6InterfaceData::HostMulticastData::str() { std::stringstream out; if (!joinedMulticastGroups.empty() && @@ -57,7 +57,7 @@ std::string IPv6InterfaceData::HostMulticastData::detailedInfo() return out.str(); } -std::string IPv6InterfaceData::RouterMulticastData::info() +std::string IPv6InterfaceData::RouterMulticastData::str() { std::stringstream out; if (reportedMulticastGroups.size() > 0) { @@ -151,9 +151,9 @@ IPv6InterfaceData::~IPv6InterfaceData() delete routerMcastData; } -std::string IPv6InterfaceData::info() const +std::string IPv6InterfaceData::str() const { - // FIXME FIXME FIXME FIXME info() should never print a newline + // FIXME FIXME FIXME FIXME str() should never print a newline std::ostringstream os; os << "IPv6:{" << endl; for (int i = 0; i < getNumAddresses(); i++) { @@ -173,7 +173,7 @@ std::string IPv6InterfaceData::info() const } if (hostMcastData) - os << hostMcastData->info(); + os << hostMcastData->str(); for (int i = 0; i < getNumAdvPrefixes(); i++) { const AdvPrefix& a = getAdvPrefix(i); @@ -196,7 +196,7 @@ std::string IPv6InterfaceData::info() const os << " "; if (routerMcastData) - os << routerMcastData->info(); + os << routerMcastData->str(); // uncomment the following as needed! os << "\tNode:"; @@ -234,7 +234,7 @@ std::string IPv6InterfaceData::info() const std::string IPv6InterfaceData::detailedInfo() const { - return info(); // TBD this could be improved: multi-line text, etc + return str(); // TBD this could be improved: multi-line text, etc } #ifndef WITH_xMIPv6 diff --git a/src/inet/networklayer/ipv6/IPv6InterfaceData.h b/src/inet/networklayer/ipv6/IPv6InterfaceData.h index 8476fc70c89..3e3416848cb 100644 --- a/src/inet/networklayer/ipv6/IPv6InterfaceData.h +++ b/src/inet/networklayer/ipv6/IPv6InterfaceData.h @@ -117,7 +117,7 @@ class INET_API IPv6InterfaceData : public InterfaceProtocolData IPv6AddressVector joinedMulticastGroups; std::vector refCounts; - std::string info(); + std::string str(); std::string detailedInfo(); }; @@ -125,7 +125,7 @@ class INET_API IPv6InterfaceData : public InterfaceProtocolData { IPv6AddressVector reportedMulticastGroups; ///< multicast groups that have listeners on the link connected to this interface - std::string info(); + std::string str(); std::string detailedInfo(); }; @@ -454,8 +454,8 @@ class INET_API IPv6InterfaceData : public InterfaceProtocolData public: IPv6InterfaceData(); virtual ~IPv6InterfaceData(); - std::string info() const override; - std::string detailedInfo() const override; + std::string str() const override; + std::string detailedInfo() const OMNETPP5_CODE(override); /** @name Addresses */ //@{ diff --git a/src/inet/networklayer/ipv6/IPv6Route.cc b/src/inet/networklayer/ipv6/IPv6Route.cc index 8ab0cb32d75..b04b7e16290 100644 --- a/src/inet/networklayer/ipv6/IPv6Route.cc +++ b/src/inet/networklayer/ipv6/IPv6Route.cc @@ -25,7 +25,7 @@ namespace inet { Register_Abstract_Class(IPv6Route); -std::string IPv6Route::info() const +std::string IPv6Route::str() const { std::stringstream out; out << getDestPrefix() << "/" << getPrefixLength() << " --> "; diff --git a/src/inet/networklayer/ipv6/IPv6Route.h b/src/inet/networklayer/ipv6/IPv6Route.h index de75b21fe21..2f5e438afec 100644 --- a/src/inet/networklayer/ipv6/IPv6Route.h +++ b/src/inet/networklayer/ipv6/IPv6Route.h @@ -93,8 +93,8 @@ class INET_API IPv6Route : public cObject, public IRoute virtual ~IPv6Route() { delete _protocolData; } - 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); /** To be called by the routing table when this route is added or removed from it */ virtual void setRoutingTable(IPv6RoutingTable *rt) { _rt = rt; } diff --git a/src/inet/networklayer/ipv6/IPv6RoutingTable.cc b/src/inet/networklayer/ipv6/IPv6RoutingTable.cc index 606a063fbd7..a51ec065b73 100644 --- a/src/inet/networklayer/ipv6/IPv6RoutingTable.cc +++ b/src/inet/networklayer/ipv6/IPv6RoutingTable.cc @@ -34,7 +34,7 @@ Define_Module(IPv6RoutingTable); std::ostream& operator<<(std::ostream& os, const IPv6Route& e) { - os << e.info(); + os << e.str(); return os; }; @@ -897,7 +897,7 @@ bool IPv6RoutingTable::handleOperationStage(LifecycleOperation *operation, int s void IPv6RoutingTable::printRoutingTable() const { for (const auto & elem : routeList) - EV_INFO << (elem)->getInterface()->getFullPath() << " -> " << (elem)->getDestinationAsGeneric().str() << " as " << (elem)->info() << endl; + EV_INFO << (elem)->getInterface()->getFullPath() << " -> " << (elem)->getDestinationAsGeneric().str() << " as " << (elem)->str() << endl; } } // namespace inet diff --git a/src/inet/networklayer/mpls/MPLSPacket.cc b/src/inet/networklayer/mpls/MPLSPacket.cc index b5687aca7a8..9083a7dca58 100644 --- a/src/inet/networklayer/mpls/MPLSPacket.cc +++ b/src/inet/networklayer/mpls/MPLSPacket.cc @@ -40,7 +40,7 @@ MPLSPacket& MPLSPacket::operator=(const MPLSPacket& p) return *this; } -std::string MPLSPacket::info() const +std::string MPLSPacket::str() const { std::stringstream out; for (int i = (int)labels.size() - 1; i >= 0; i--) diff --git a/src/inet/networklayer/mpls/MPLSPacket.h b/src/inet/networklayer/mpls/MPLSPacket.h index 9a399fb28d4..b7f14327e43 100644 --- a/src/inet/networklayer/mpls/MPLSPacket.h +++ b/src/inet/networklayer/mpls/MPLSPacket.h @@ -50,7 +50,7 @@ class INET_API MPLSPacket : public cPacket /** * Returns a string with the labels, starting with the top of stack. */ - virtual std::string info() const override; + virtual std::string str() const override; /** * Swap Label operation diff --git a/src/inet/routing/ospfv2/OSPFConfigReader.cc b/src/inet/routing/ospfv2/OSPFConfigReader.cc index 2c2b45b52af..8dc55e45947 100644 --- a/src/inet/routing/ospfv2/OSPFConfigReader.cc +++ b/src/inet/routing/ospfv2/OSPFConfigReader.cc @@ -147,7 +147,7 @@ int OSPFConfigReader::getIntAttrOrPar(const cXMLElement& ifConfig, const char *n const char *attrStr = ifConfig.getAttribute(name); if (attrStr && *attrStr) return atoi(attrStr); - return par(name).longValue(); + return par(name).intValue(); } bool OSPFConfigReader::getBoolAttrOrPar(const cXMLElement& ifConfig, const char *name) const diff --git a/src/inet/routing/ospfv2/router/OSPFArea.cc b/src/inet/routing/ospfv2/router/OSPFArea.cc index aebaac20b10..354ae687fe8 100644 --- a/src/inet/routing/ospfv2/router/OSPFArea.cc +++ b/src/inet/routing/ospfv2/router/OSPFArea.cc @@ -106,7 +106,7 @@ void Area::addAddressRange(IPv4AddressRange addressRange, bool advertise) } } -std::string Area::info() const +std::string Area::str() const { std::stringstream out; out << "areaID: " << areaID.str(false); diff --git a/src/inet/routing/ospfv2/router/OSPFArea.h b/src/inet/routing/ospfv2/router/OSPFArea.h index 4bf202c98a9..a498efb1dda 100644 --- a/src/inet/routing/ospfv2/router/OSPFArea.h +++ b/src/inet/routing/ospfv2/router/OSPFArea.h @@ -123,8 +123,8 @@ class INET_API Area : public cObject void calculateInterAreaRoutes(std::vector& newRoutingTable); void recheckSummaryLSAs(std::vector& newRoutingTable); - std::string info() const override; - std::string detailedInfo() const override; + std::string str() const override; + std::string detailedInfo() const OMNETPP5_CODE(override); private: SummaryLSA *originateSummaryLSA(const SummaryLSA *summaryLSA); diff --git a/src/inet/routing/pim/tables/PIMInterfaceTable.cc b/src/inet/routing/pim/tables/PIMInterfaceTable.cc index a9db0505fc7..6d3f92fc778 100644 --- a/src/inet/routing/pim/tables/PIMInterfaceTable.cc +++ b/src/inet/routing/pim/tables/PIMInterfaceTable.cc @@ -38,7 +38,7 @@ std::ostream& operator<<(std::ostream& os, const PIMInterface *e) return os; }; -std::string PIMInterface::info() const +std::string PIMInterface::str() const { std::stringstream out; out << this; diff --git a/src/inet/routing/pim/tables/PIMInterfaceTable.h b/src/inet/routing/pim/tables/PIMInterfaceTable.h index 3e6e0cb1c9f..a8567669554 100644 --- a/src/inet/routing/pim/tables/PIMInterfaceTable.h +++ b/src/inet/routing/pim/tables/PIMInterfaceTable.h @@ -50,7 +50,7 @@ class INET_API PIMInterface : public cObject public: PIMInterface(InterfaceEntry *ie, PIMMode mode, bool stateRefreshFlag) : ie(ie), mode(mode), stateRefreshFlag(stateRefreshFlag) { ASSERT(ie); } - virtual std::string info() const override; + virtual std::string str() const override; int getInterfaceId() const { return ie->getInterfaceId(); } InterfaceEntry *getInterfacePtr() const { return ie; } diff --git a/src/inet/routing/pim/tables/PIMNeighborTable.cc b/src/inet/routing/pim/tables/PIMNeighborTable.cc index 5dbb923b6f3..61b7266bdd7 100644 --- a/src/inet/routing/pim/tables/PIMNeighborTable.cc +++ b/src/inet/routing/pim/tables/PIMNeighborTable.cc @@ -54,7 +54,7 @@ std::ostream& operator<<(std::ostream& os, const PIMNeighborTable::PIMNeighborVe return os; }; -std::string PIMNeighbor::info() const +std::string PIMNeighbor::str() const { std::stringstream out; out << "PIMNeighbor addr=" << address << ", iface=" << ie->getName() << ", v=" << version << ", priority=" << this->drPriority << "}"; @@ -120,7 +120,7 @@ bool PIMNeighborTable::addNeighbor(PIMNeighbor *entry, double holdTime) return false; - EV_DETAIL << "Added new neighbor to table: " << entry->info() << "\n"; + EV_DETAIL << "Added new neighbor to table: " << entry->str() << "\n"; entry->nt = this; neighborsOnInterface.push_back(entry); take(entry->getLivenessTimer()); diff --git a/src/inet/routing/pim/tables/PIMNeighborTable.h b/src/inet/routing/pim/tables/PIMNeighborTable.h index b7d2b8a83a8..0ffa750a09b 100644 --- a/src/inet/routing/pim/tables/PIMNeighborTable.h +++ b/src/inet/routing/pim/tables/PIMNeighborTable.h @@ -51,7 +51,7 @@ class INET_API PIMNeighbor : public cObject public: PIMNeighbor(InterfaceEntry *ie, IPv4Address address, int version); virtual ~PIMNeighbor(); - virtual std::string info() const override; + virtual std::string str() const override; int getInterfaceId() const { return ie->getInterfaceId(); } InterfaceEntry *getInterfacePtr() const { return ie; } diff --git a/src/inet/routing/rip/RIPRouting.cc b/src/inet/routing/rip/RIPRouting.cc index dda8a9fdf4e..dbcdccce167 100644 --- a/src/inet/routing/rip/RIPRouting.cc +++ b/src/inet/routing/rip/RIPRouting.cc @@ -37,7 +37,7 @@ Define_Module(RIPRouting); std::ostream& operator<<(std::ostream& os, const RIPRoute& e) { - os << e.info(); + os << e.str(); return os; } @@ -51,7 +51,7 @@ RIPRoute::RIPRoute(IRoute *route, RouteType type, int metric, uint16 routeTag) tag = routeTag; } -std::string RIPRoute::info() const +std::string RIPRoute::str() const { std::stringstream out; diff --git a/src/inet/routing/rip/RIPRouting.h b/src/inet/routing/rip/RIPRouting.h index eea7c402caa..d484da4fa2d 100644 --- a/src/inet/routing/rip/RIPRouting.h +++ b/src/inet/routing/rip/RIPRouting.h @@ -55,7 +55,7 @@ struct RIPRoute : public cObject public: RIPRoute(IRoute *route, RouteType type, int metric, uint16 tag); - virtual std::string info() const override; + virtual std::string str() const override; RouteType getType() const { return type; } IRoute *getRoute() const { return route; } diff --git a/src/inet/transportlayer/rtp/RTPInnerPacket.cc b/src/inet/transportlayer/rtp/RTPInnerPacket.cc index b6b32620478..83e6910eddc 100644 --- a/src/inet/transportlayer/rtp/RTPInnerPacket.cc +++ b/src/inet/transportlayer/rtp/RTPInnerPacket.cc @@ -25,7 +25,7 @@ namespace rtp { Register_Class(RTPInnerPacket); -std::string RTPInnerPacket::info() const +std::string RTPInnerPacket::str() const { std::stringstream out; out << "RTPInnerPacket: type=" << type; diff --git a/src/inet/transportlayer/rtp/RTPInnerPacket.h b/src/inet/transportlayer/rtp/RTPInnerPacket.h index 0364f792e06..65b3e7cf7dd 100644 --- a/src/inet/transportlayer/rtp/RTPInnerPacket.h +++ b/src/inet/transportlayer/rtp/RTPInnerPacket.h @@ -39,7 +39,7 @@ class INET_API RTPInnerPacket : public RTPInnerPacket_Base /** * Writes a short info about this RTPInnerPacket into the given string. */ - virtual std::string info() const override; + virtual std::string str() const override; /** * Writes a longer info about this RTPInnerPacket into the given output stream. diff --git a/src/inet/transportlayer/rtp/RTPPacket.cc b/src/inet/transportlayer/rtp/RTPPacket.cc index 40e76782293..c0107c5c290 100644 --- a/src/inet/transportlayer/rtp/RTPPacket.cc +++ b/src/inet/transportlayer/rtp/RTPPacket.cc @@ -23,7 +23,7 @@ namespace rtp { Register_Class(RTPPacket); -std::string RTPPacket::info() const +std::string RTPPacket::str() const { std::stringstream out; out << "RTPPacket: payloadType=" << payloadType diff --git a/src/inet/transportlayer/rtp/RTPPacket.h b/src/inet/transportlayer/rtp/RTPPacket.h index 56f6d2d1132..b647592ad32 100644 --- a/src/inet/transportlayer/rtp/RTPPacket.h +++ b/src/inet/transportlayer/rtp/RTPPacket.h @@ -43,7 +43,7 @@ class INET_API RTPPacket : public RTPPacket_Base /** * Writes a one line info about this RTPPacket into the given string. */ - virtual std::string info() const override; + virtual std::string str() const override; /** * Writes a longer description about this RTPPacket into the given stream. diff --git a/src/inet/transportlayer/rtp/reports.cc b/src/inet/transportlayer/rtp/reports.cc index 1b48477e528..d3656b5c616 100644 --- a/src/inet/transportlayer/rtp/reports.cc +++ b/src/inet/transportlayer/rtp/reports.cc @@ -27,7 +27,7 @@ namespace rtp { Register_Class(SenderReport); -std::string SenderReport::info() const +std::string SenderReport::str() const { std::stringstream out; out << "SenderReport.timeStamp=" << getRTPTimeStamp(); @@ -49,7 +49,7 @@ void SenderReport::dump(std::ostream& os) const Register_Class(ReceptionReport); -std::string ReceptionReport::info() const +std::string ReceptionReport::str() const { std::stringstream out; out << "ReceptionReport.ssrc=" << getSsrc(); diff --git a/src/inet/transportlayer/rtp/reports.h b/src/inet/transportlayer/rtp/reports.h index 58a99140bdd..b1fcd1a8898 100644 --- a/src/inet/transportlayer/rtp/reports.h +++ b/src/inet/transportlayer/rtp/reports.h @@ -47,7 +47,7 @@ class INET_API SenderReport : public SenderReport_Base /** * Writes a short info about this SenderReport into the given string. */ - virtual std::string info() const override; + virtual std::string str() const override; /** * Writes a longer info about this SenderReport into the given stream. @@ -72,7 +72,7 @@ class INET_API ReceptionReport : public ReceptionReport_Base /** * Writes a short info about this ReceptionReport into the given string. */ - virtual std::string info() const override; + virtual std::string str() const override; /** * Writes a longer info about this ReceptionReport into the given stream. diff --git a/src/inet/transportlayer/rtp/sdes.cc b/src/inet/transportlayer/rtp/sdes.cc index 7b21dc15540..7be2eac334f 100644 --- a/src/inet/transportlayer/rtp/sdes.cc +++ b/src/inet/transportlayer/rtp/sdes.cc @@ -76,7 +76,7 @@ SDESItem *SDESItem::dup() const return new SDESItem(*this); } -std::string SDESItem::info() const +std::string SDESItem::str() const { std::stringstream out; out << "SDESItem=" << _content; @@ -149,7 +149,7 @@ SDESChunk *SDESChunk::dup() const return new SDESChunk(*this); } -std::string SDESChunk::info() const +std::string SDESChunk::str() const { std::stringstream out; out << "SDESChunk.ssrc=" << _ssrc << " items=" << size(); diff --git a/src/inet/transportlayer/rtp/sdes.h b/src/inet/transportlayer/rtp/sdes.h index c952d472b10..741d22fbc8e 100644 --- a/src/inet/transportlayer/rtp/sdes.h +++ b/src/inet/transportlayer/rtp/sdes.h @@ -81,7 +81,7 @@ class INET_API SDESItem : public cObject /** * Writes a short info about this SDESItem into the given string. */ - virtual std::string info() const override; + virtual std::string str() const override; /** * Writes an info about this SDESItem into the give output stream. @@ -160,7 +160,7 @@ class INET_API SDESChunk : public cArray /** * Writes a short info about this SDESChunk into the given string. */ - virtual std::string info() const override; + virtual std::string str() const override; /** * Writes a longer info about this SDESChunk into the given stream. diff --git a/src/inet/transportlayer/tcp/TCP.cc b/src/inet/transportlayer/tcp/TCP.cc index 9a6b3c512c8..b0184b0d863 100644 --- a/src/inet/transportlayer/tcp/TCP.cc +++ b/src/inet/transportlayer/tcp/TCP.cc @@ -71,7 +71,7 @@ static std::ostream& operator<<(std::ostream& os, const TCP::AppConnKey& app) static std::ostream& operator<<(std::ostream& os, const TCPConnection& conn) { os << "connId=" << conn.connId << " " << TCPConnection::stateName(conn.getFsmState()) - << " state={" << const_cast(conn).getState()->info() << "}"; + << " state={" << const_cast(conn).getState()->str() << "}"; return os; } diff --git a/src/inet/transportlayer/tcp/TCPConnection.h b/src/inet/transportlayer/tcp/TCPConnection.h index 2da2f6b608c..9ce1e4cde32 100644 --- a/src/inet/transportlayer/tcp/TCPConnection.h +++ b/src/inet/transportlayer/tcp/TCPConnection.h @@ -149,8 +149,8 @@ class INET_API TCPStateVariables : public cObject { public: TCPStateVariables(); - 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); public: bool active; // set if the connection was initiated by an active open diff --git a/src/inet/transportlayer/tcp/TCPConnectionBase.cc b/src/inet/transportlayer/tcp/TCPConnectionBase.cc index 390f4463b7f..ef9fb985cd5 100644 --- a/src/inet/transportlayer/tcp/TCPConnectionBase.cc +++ b/src/inet/transportlayer/tcp/TCPConnectionBase.cc @@ -119,7 +119,7 @@ TCPStateVariables::TCPStateVariables() queueUpdate = true; } -std::string TCPStateVariables::info() const +std::string TCPStateVariables::str() const { std::stringstream out; out << "snd_una=" << snd_una; diff --git a/src/inet/transportlayer/tcp/TCPConnectionRcvSegment.cc b/src/inet/transportlayer/tcp/TCPConnectionRcvSegment.cc index 0ae9d82504f..b10531354df 100644 --- a/src/inet/transportlayer/tcp/TCPConnectionRcvSegment.cc +++ b/src/inet/transportlayer/tcp/TCPConnectionRcvSegment.cc @@ -90,7 +90,7 @@ TCPEventCode TCPConnection::process_RCV_SEGMENT(TCPSegment *tcpseg, L3Address sr { EV_INFO << "Seg arrived: "; printSegmentBrief(tcpseg); - EV_DETAIL << "TCB: " << state->info() << "\n"; + EV_DETAIL << "TCB: " << state->str() << "\n"; if (rcvSeqVector) rcvSeqVector->record(tcpseg->getSequenceNo()); diff --git a/src/inet/transportlayer/tcp/TCPConnectionUtil.cc b/src/inet/transportlayer/tcp/TCPConnectionUtil.cc index 87b5c27dc78..2e8e2d268f0 100644 --- a/src/inet/transportlayer/tcp/TCPConnectionUtil.cc +++ b/src/inet/transportlayer/tcp/TCPConnectionUtil.cc @@ -356,7 +356,7 @@ void TCPConnection::initConnection(TCPOpenCommand *openCmd) void TCPConnection::configureStateVariables() { - long advertisedWindowPar = tcpMain->par("advertisedWindow").longValue(); + long advertisedWindowPar = tcpMain->par("advertisedWindow").intValue(); state->ws_support = tcpMain->par("windowScalingSupport"); // if set, this means that current host supports WS (RFC 1323) state->ws_manual_scale = tcpMain->par("windowScalingFactor"); // scaling factor (set manually) to help for TCP validation if (!state->ws_support && (advertisedWindowPar > TCP_MAX_WIN || advertisedWindowPar <= 0)) @@ -375,7 +375,7 @@ void TCPConnection::configureStateVariables() state->nagle_enabled = tcpMain->par("nagleEnabled"); // Nagle's algorithm (RFC 896) enabled/disabled state->limited_transmit_enabled = tcpMain->par("limitedTransmitEnabled"); // Limited Transmit algorithm (RFC 3042) enabled/disabled state->increased_IW_enabled = tcpMain->par("increasedIWEnabled"); // Increased Initial Window (RFC 3390) enabled/disabled - state->snd_mss = tcpMain->par("mss").longValue(); // Maximum Segment Size (RFC 793) + state->snd_mss = tcpMain->par("mss").intValue(); // Maximum Segment Size (RFC 793) state->ts_support = tcpMain->par("timestampSupport"); // if set, this means that current host supports TS (RFC 1323) state->sack_support = tcpMain->par("sackSupport"); // if set, this means that current host supports SACK (RFC 2018, 2883, 3517) diff --git a/src/inet/transportlayer/tcp/flavours/TCPBaseAlg.cc b/src/inet/transportlayer/tcp/flavours/TCPBaseAlg.cc index 506170b3ef3..18158a74b14 100644 --- a/src/inet/transportlayer/tcp/flavours/TCPBaseAlg.cc +++ b/src/inet/transportlayer/tcp/flavours/TCPBaseAlg.cc @@ -75,10 +75,10 @@ TCPBaseAlgStateVariables::TCPBaseAlgStateVariables() firstPartialACK = false; } -std::string TCPBaseAlgStateVariables::info() const +std::string TCPBaseAlgStateVariables::str() const { std::stringstream out; - out << TCPStateVariables::info(); + out << TCPStateVariables::str(); out << " snd_cwnd=" << snd_cwnd; out << " rto=" << rexmit_timeout; return out.str(); @@ -230,7 +230,7 @@ void TCPBaseAlg::processTimer(cMessage *timer, TCPEventCode& event) void TCPBaseAlg::processRexmitTimer(TCPEventCode& event) { - EV_DETAIL << "TCB: " << state->info() << "\n"; + EV_DETAIL << "TCB: " << state->str() << "\n"; //" // For any state if the retransmission timeout expires on a segment in diff --git a/src/inet/transportlayer/tcp/flavours/TCPBaseAlg.h b/src/inet/transportlayer/tcp/flavours/TCPBaseAlg.h index fef75e8de5d..314a5855d16 100644 --- a/src/inet/transportlayer/tcp/flavours/TCPBaseAlg.h +++ b/src/inet/transportlayer/tcp/flavours/TCPBaseAlg.h @@ -34,8 +34,8 @@ class INET_API TCPBaseAlgStateVariables : public TCPStateVariables { public: TCPBaseAlgStateVariables(); - 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); /// retransmit count //@{ diff --git a/src/inet/transportlayer/tcp/flavours/TCPTahoeRenoFamily.cc b/src/inet/transportlayer/tcp/flavours/TCPTahoeRenoFamily.cc index 4025db162e5..c39afd36c2e 100644 --- a/src/inet/transportlayer/tcp/flavours/TCPTahoeRenoFamily.cc +++ b/src/inet/transportlayer/tcp/flavours/TCPTahoeRenoFamily.cc @@ -37,10 +37,10 @@ void TCPTahoeRenoFamilyStateVariables::setSendQueueLimit(uint32 newLimit){ ssthresh = sendQueueLimit; } -std::string TCPTahoeRenoFamilyStateVariables::info() const +std::string TCPTahoeRenoFamilyStateVariables::str() const { std::stringstream out; - out << TCPBaseAlgStateVariables::info(); + out << TCPBaseAlgStateVariables::str(); out << " ssthresh=" << ssthresh; return out.str(); } diff --git a/src/inet/transportlayer/tcp/flavours/TCPTahoeRenoFamily.h b/src/inet/transportlayer/tcp/flavours/TCPTahoeRenoFamily.h index c12712953e7..8f991b98289 100644 --- a/src/inet/transportlayer/tcp/flavours/TCPTahoeRenoFamily.h +++ b/src/inet/transportlayer/tcp/flavours/TCPTahoeRenoFamily.h @@ -33,8 +33,8 @@ class INET_API TCPTahoeRenoFamilyStateVariables : public TCPBaseAlgStateVariable { public: TCPTahoeRenoFamilyStateVariables(); - 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); virtual void setSendQueueLimit(uint32 newLimit); uint32 ssthresh; ///< slow start threshold diff --git a/src/inet/transportlayer/tcp/flavours/TCPVegas.cc b/src/inet/transportlayer/tcp/flavours/TCPVegas.cc index 633570168ed..0496cba84fc 100644 --- a/src/inet/transportlayer/tcp/flavours/TCPVegas.cc +++ b/src/inet/transportlayer/tcp/flavours/TCPVegas.cc @@ -52,10 +52,10 @@ TCPVegasStateVariables::~TCPVegasStateVariables() { } -std::string TCPVegasStateVariables::info() const +std::string TCPVegasStateVariables::str() const { std::stringstream out; - out << TCPBaseAlgStateVariables::info(); + out << TCPBaseAlgStateVariables::str(); out << " ssthresh=" << ssthresh; return out.str(); } diff --git a/src/inet/transportlayer/tcp/flavours/TCPVegas.h b/src/inet/transportlayer/tcp/flavours/TCPVegas.h index 00153b4fffb..c0e5e0f7b03 100644 --- a/src/inet/transportlayer/tcp/flavours/TCPVegas.h +++ b/src/inet/transportlayer/tcp/flavours/TCPVegas.h @@ -36,8 +36,8 @@ class INET_API TCPVegasStateVariables : public TCPBaseAlgStateVariables public: TCPVegasStateVariables(); ~TCPVegasStateVariables(); - 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); uint32 v_recoverypoint; simtime_t v_cwnd_changed; // last time cwnd changes because of a rtx. diff --git a/src/inet/transportlayer/tcp/flavours/TCPWestwood.cc b/src/inet/transportlayer/tcp/flavours/TCPWestwood.cc index 2cf90774654..40d25cef45e 100644 --- a/src/inet/transportlayer/tcp/flavours/TCPWestwood.cc +++ b/src/inet/transportlayer/tcp/flavours/TCPWestwood.cc @@ -41,10 +41,10 @@ TCPWestwoodStateVariables::~TCPWestwoodStateVariables() { } -std::string TCPWestwoodStateVariables::info() const +std::string TCPWestwoodStateVariables::str() const { std::stringstream out; - out << TCPBaseAlgStateVariables::info(); + out << TCPBaseAlgStateVariables::str(); out << " ssthresh=" << ssthresh; return out.str(); } diff --git a/src/inet/transportlayer/tcp/flavours/TCPWestwood.h b/src/inet/transportlayer/tcp/flavours/TCPWestwood.h index 12a459125ea..44bca6033c6 100644 --- a/src/inet/transportlayer/tcp/flavours/TCPWestwood.h +++ b/src/inet/transportlayer/tcp/flavours/TCPWestwood.h @@ -36,8 +36,8 @@ class INET_API TCPWestwoodStateVariables : public TCPBaseAlgStateVariables public: TCPWestwoodStateVariables(); ~TCPWestwoodStateVariables(); - 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); uint32 ssthresh; ///< slow start threshold diff --git a/src/inet/transportlayer/tcp/queues/TCPByteStreamRcvQueue.cc b/src/inet/transportlayer/tcp/queues/TCPByteStreamRcvQueue.cc index 8313fc5f686..7143ea2f469 100644 --- a/src/inet/transportlayer/tcp/queues/TCPByteStreamRcvQueue.cc +++ b/src/inet/transportlayer/tcp/queues/TCPByteStreamRcvQueue.cc @@ -88,7 +88,7 @@ TCPByteStreamRcvQueue::~TCPByteStreamRcvQueue() { } -std::string TCPByteStreamRcvQueue::info() const +std::string TCPByteStreamRcvQueue::str() const { std::stringstream os; diff --git a/src/inet/transportlayer/tcp/queues/TCPByteStreamRcvQueue.h b/src/inet/transportlayer/tcp/queues/TCPByteStreamRcvQueue.h index 625b87c1261..13bbbee9d95 100644 --- a/src/inet/transportlayer/tcp/queues/TCPByteStreamRcvQueue.h +++ b/src/inet/transportlayer/tcp/queues/TCPByteStreamRcvQueue.h @@ -78,7 +78,7 @@ class INET_API TCPByteStreamRcvQueue : public TCPVirtualDataRcvQueue /** * Returns a string with region stored. */ - virtual std::string info() const override; + virtual std::string str() const override; cPacket *extractBytesUpTo(uint32 seq) override; diff --git a/src/inet/transportlayer/tcp/queues/TCPByteStreamSendQueue.cc b/src/inet/transportlayer/tcp/queues/TCPByteStreamSendQueue.cc index e7c78faad3d..c34bcb420a2 100644 --- a/src/inet/transportlayer/tcp/queues/TCPByteStreamSendQueue.cc +++ b/src/inet/transportlayer/tcp/queues/TCPByteStreamSendQueue.cc @@ -42,7 +42,7 @@ void TCPByteStreamSendQueue::init(uint32 startSeq) dataBuffer.clear(); } -std::string TCPByteStreamSendQueue::info() const +std::string TCPByteStreamSendQueue::str() const { std::stringstream out; out << "[" << begin << ".." << end << "), " << dataBuffer.getLength() << " bytes"; diff --git a/src/inet/transportlayer/tcp/queues/TCPByteStreamSendQueue.h b/src/inet/transportlayer/tcp/queues/TCPByteStreamSendQueue.h index 60f5a8b3853..04a4311ab51 100644 --- a/src/inet/transportlayer/tcp/queues/TCPByteStreamSendQueue.h +++ b/src/inet/transportlayer/tcp/queues/TCPByteStreamSendQueue.h @@ -53,7 +53,7 @@ class INET_API TCPByteStreamSendQueue : public TCPSendQueue virtual void init(uint32 startSeq) override; - virtual std::string info() const override; + virtual std::string str() const override; virtual void enqueueAppData(cPacket *msg) override; diff --git a/src/inet/transportlayer/tcp/queues/TCPMsgBasedRcvQueue.cc b/src/inet/transportlayer/tcp/queues/TCPMsgBasedRcvQueue.cc index 1efdb9572d9..d4fad986863 100644 --- a/src/inet/transportlayer/tcp/queues/TCPMsgBasedRcvQueue.cc +++ b/src/inet/transportlayer/tcp/queues/TCPMsgBasedRcvQueue.cc @@ -47,7 +47,7 @@ void TCPMsgBasedRcvQueue::init(uint32 startSeq) TCPVirtualDataRcvQueue::init(startSeq); } -std::string TCPMsgBasedRcvQueue::info() const +std::string TCPMsgBasedRcvQueue::str() const { std::stringstream os; diff --git a/src/inet/transportlayer/tcp/queues/TCPMsgBasedRcvQueue.h b/src/inet/transportlayer/tcp/queues/TCPMsgBasedRcvQueue.h index 2efba096ea8..fcbb4f5be7d 100644 --- a/src/inet/transportlayer/tcp/queues/TCPMsgBasedRcvQueue.h +++ b/src/inet/transportlayer/tcp/queues/TCPMsgBasedRcvQueue.h @@ -64,7 +64,7 @@ class INET_API TCPMsgBasedRcvQueue : public TCPVirtualDataRcvQueue /** * Returns a string with region stored. */ - virtual std::string info() const override; + virtual std::string str() const override; /** * Called when a TCP segment arrives. Returns sequence number for ACK. diff --git a/src/inet/transportlayer/tcp/queues/TCPMsgBasedSendQueue.cc b/src/inet/transportlayer/tcp/queues/TCPMsgBasedSendQueue.cc index a9219650957..a828483bf22 100644 --- a/src/inet/transportlayer/tcp/queues/TCPMsgBasedSendQueue.cc +++ b/src/inet/transportlayer/tcp/queues/TCPMsgBasedSendQueue.cc @@ -42,7 +42,7 @@ void TCPMsgBasedSendQueue::init(uint32 startSeq) end = startSeq; } -std::string TCPMsgBasedSendQueue::info() const +std::string TCPMsgBasedSendQueue::str() const { std::stringstream out; out << "[" << begin << ".." << end << "), " << payloadQueue.size() << " packets"; @@ -51,7 +51,7 @@ std::string TCPMsgBasedSendQueue::info() const void TCPMsgBasedSendQueue::enqueueAppData(cPacket *msg) { - //tcpEV << "sendQ: " << info() << " enqueueAppData(bytes=" << msg->getByteLength() << ")\n"; + //tcpEV << "sendQ: " << str() << " enqueueAppData(bytes=" << msg->getByteLength() << ")\n"; end += msg->getByteLength(); if (seqLess(end, begin)) throw cRuntimeError("Send queue is full"); @@ -74,7 +74,7 @@ uint32 TCPMsgBasedSendQueue::getBufferEndSeq() TCPSegment *TCPMsgBasedSendQueue::createSegmentWithBytes(uint32 fromSeq, ulong numBytes) { - //tcpEV << "sendQ: " << info() << " createSeg(seq=" << fromSeq << " len=" << numBytes << ")\n"; + //tcpEV << "sendQ: " << str() << " createSeg(seq=" << fromSeq << " len=" << numBytes << ")\n"; ASSERT(seqLE(begin, fromSeq) && seqLE(fromSeq + numBytes, end)); TCPSegment *tcpseg = new TCPSegment(nullptr); @@ -112,7 +112,7 @@ TCPSegment *TCPMsgBasedSendQueue::createSegmentWithBytes(uint32 fromSeq, ulong n void TCPMsgBasedSendQueue::discardUpTo(uint32 seqNum) { - //tcpEV << "sendQ: " << info() << " discardUpTo(seq=" << seqNum << ")\n"; + //tcpEV << "sendQ: " << str() << " discardUpTo(seq=" << seqNum << ")\n"; ASSERT(seqLE(begin, seqNum) && seqLE(seqNum, end)); diff --git a/src/inet/transportlayer/tcp/queues/TCPMsgBasedSendQueue.h b/src/inet/transportlayer/tcp/queues/TCPMsgBasedSendQueue.h index 20a40389e04..c1f2fc7c6db 100644 --- a/src/inet/transportlayer/tcp/queues/TCPMsgBasedSendQueue.h +++ b/src/inet/transportlayer/tcp/queues/TCPMsgBasedSendQueue.h @@ -63,7 +63,7 @@ class INET_API TCPMsgBasedSendQueue : public TCPSendQueue /** * Returns a string with the region stored. */ - virtual std::string info() const override; + virtual std::string str() const override; /** * diff --git a/src/inet/transportlayer/tcp/queues/TCPVirtualDataRcvQueue.cc b/src/inet/transportlayer/tcp/queues/TCPVirtualDataRcvQueue.cc index ac1ccbca354..34f4568a0b6 100644 --- a/src/inet/transportlayer/tcp/queues/TCPVirtualDataRcvQueue.cc +++ b/src/inet/transportlayer/tcp/queues/TCPVirtualDataRcvQueue.cc @@ -100,7 +100,7 @@ void TCPVirtualDataRcvQueue::init(uint32 startSeq) } } -std::string TCPVirtualDataRcvQueue::info() const +std::string TCPVirtualDataRcvQueue::str() const { std::string res; char buf[32]; @@ -134,7 +134,7 @@ uint32 TCPVirtualDataRcvQueue::insertBytesFromSegment(TCPSegment *tcpseg) uint32 maxe = seqMax(oe, ne); if (seqGE(minb, oe) || seqGE(minb, ne) || seqGE(ob, maxe) || seqGE(nb, maxe)) throw cRuntimeError("The new segment is [%u, %u) out of the acceptable range at the queue %s", - region->getBegin(), region->getEnd(), info().c_str()); + region->getBegin(), region->getEnd(), str().c_str()); } #endif // ifndef NDEBUG @@ -231,7 +231,7 @@ uint32 TCPVirtualDataRcvQueue::getQueueLength() void TCPVirtualDataRcvQueue::getQueueStatus() { - EV_DEBUG << "receiveQLength=" << regionList.size() << " " << info() << "\n"; + EV_DEBUG << "receiveQLength=" << regionList.size() << " " << str() << "\n"; } uint32 TCPVirtualDataRcvQueue::getLE(uint32 fromSeqNum) diff --git a/src/inet/transportlayer/tcp/queues/TCPVirtualDataRcvQueue.h b/src/inet/transportlayer/tcp/queues/TCPVirtualDataRcvQueue.h index b99ca40c015..17fed154741 100644 --- a/src/inet/transportlayer/tcp/queues/TCPVirtualDataRcvQueue.h +++ b/src/inet/transportlayer/tcp/queues/TCPVirtualDataRcvQueue.h @@ -103,7 +103,7 @@ class INET_API TCPVirtualDataRcvQueue : public TCPReceiveQueue virtual void init(uint32 startSeq) override; /** Method inherited from TCPReceiveQueue */ - virtual std::string info() const override; + virtual std::string str() const override; /** Method inherited from TCPReceiveQueue */ virtual uint32 insertBytesFromSegment(TCPSegment *tcpseg) override; diff --git a/src/inet/transportlayer/tcp/queues/TCPVirtualDataSendQueue.cc b/src/inet/transportlayer/tcp/queues/TCPVirtualDataSendQueue.cc index a47547014e9..34a54778164 100644 --- a/src/inet/transportlayer/tcp/queues/TCPVirtualDataSendQueue.cc +++ b/src/inet/transportlayer/tcp/queues/TCPVirtualDataSendQueue.cc @@ -38,7 +38,7 @@ void TCPVirtualDataSendQueue::init(uint32 startSeq) end = startSeq; } -std::string TCPVirtualDataSendQueue::info() const +std::string TCPVirtualDataSendQueue::str() const { std::stringstream out; out << "[" << begin << ".." << end << ")"; diff --git a/src/inet/transportlayer/tcp/queues/TCPVirtualDataSendQueue.h b/src/inet/transportlayer/tcp/queues/TCPVirtualDataSendQueue.h index 8350459f8f1..9772af9997d 100644 --- a/src/inet/transportlayer/tcp/queues/TCPVirtualDataSendQueue.h +++ b/src/inet/transportlayer/tcp/queues/TCPVirtualDataSendQueue.h @@ -56,7 +56,7 @@ class INET_API TCPVirtualDataSendQueue : public TCPSendQueue /** * Returns a string with the region stored. */ - virtual std::string info() const override; + virtual std::string str() const override; /** * diff --git a/src/inet/transportlayer/tcp_common/TCPSpoof.cc b/src/inet/transportlayer/tcp_common/TCPSpoof.cc index 758b2e8e71e..8c2137c8b4d 100644 --- a/src/inet/transportlayer/tcp_common/TCPSpoof.cc +++ b/src/inet/transportlayer/tcp_common/TCPSpoof.cc @@ -49,7 +49,7 @@ void TCPSpoof::sendSpoofPacket() int srcPort = par("srcPort"); int destPort = par("destPort"); bool isSYN = par("isSYN"); - unsigned long seq = par("seqNo").longValue() == -1 ? chooseInitialSeqNum() : par("seqNo").longValue(); + unsigned long seq = par("seqNo").intValue() == -1 ? chooseInitialSeqNum() : par("seqNo").intValue(); // one can customize the following according to concrete needs tcpseg->setSrcPort(srcPort); diff --git a/src/inet/transportlayer/tcp_nsc/TCP_NSC.cc b/src/inet/transportlayer/tcp_nsc/TCP_NSC.cc index 328236561c4..d002be16880 100644 --- a/src/inet/transportlayer/tcp_nsc/TCP_NSC.cc +++ b/src/inet/transportlayer/tcp_nsc/TCP_NSC.cc @@ -228,7 +228,7 @@ void TCP_NSC::initialize(int stage) // load the stack const char *stackName = this->par(stackNameParamNameS).stringValue(); - int bufferSize = (int)(this->par(bufferSizeParamNameS).longValue()); + int bufferSize = (int)(this->par(bufferSizeParamNameS).intValue()); loadStack(stackName, bufferSize); pStackM->if_attach(localInnerIpS.str().c_str(), localInnerMaskS.str().c_str(), 1500); pStackM->add_default_gateway(localInnerGwS.str().c_str()); diff --git a/src/inet/visualizer/base/InterfaceTableVisualizerBase.cc b/src/inet/visualizer/base/InterfaceTableVisualizerBase.cc index 81d0d2b2f5e..1a302f8d024 100644 --- a/src/inet/visualizer/base/InterfaceTableVisualizerBase.cc +++ b/src/inet/visualizer/base/InterfaceTableVisualizerBase.cc @@ -91,7 +91,7 @@ const char *InterfaceTableVisualizerBase::DirectiveResolver::resolveDirective(ch result = interfaceEntry->getNetworkAddress().str(); break; case 'i': - result = interfaceEntry->info(); + result = interfaceEntry->str(); break; case 's': result = interfaceEntry->str(); diff --git a/src/inet/visualizer/base/RoutingTableVisualizerBase.cc b/src/inet/visualizer/base/RoutingTableVisualizerBase.cc index 1a4233496c9..2af13ff34c4 100644 --- a/src/inet/visualizer/base/RoutingTableVisualizerBase.cc +++ b/src/inet/visualizer/base/RoutingTableVisualizerBase.cc @@ -48,7 +48,7 @@ const char *RoutingTableVisualizerBase::DirectiveResolver::resolveDirective(char result = route->getInterface()->getName(); break; case 'i': - result = route->info(); + result = route->str(); break; case 's': result = route->str(); diff --git a/src/makefrag b/src/makefrag index 3636b28bcf2..7925b45cd03 100644 --- a/src/makefrag +++ b/src/makefrag @@ -1,3 +1,8 @@ +# +# Use the older message compiler. New compiler was introduced in OMNeT++ 5.3 +# +MSGC:=$(MSGC) --msg4 + # # on windows we have to link with the ws2_32 (winsock2) library as it is no longer added # to the omnetpp system libraries by default (as of OMNeT++ 5.1)