Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 16 additions & 25 deletions bin/inet_diffingerprints
Original file line number Diff line number Diff line change
Expand Up @@ -3,57 +3,49 @@ import sys
import re

def computeUniqueFingerprints(fingerprints):
i = 0
uniqueFingerprints = list()
while i < len(fingerprints):
fingerprint = fingerprints[i]
j = i
while (j < len(fingerprints)) and (fingerprint == fingerprints[j]):
j = j + 1
uniqueFingerprints.append([j-1, fingerprint])
i = j
for i in range(1, len(fingerprints)):
fingerprint = fingerprints[i-1]
if (fingerprints[i][1] != fingerprint[1]):
uniqueFingerprints.append(fingerprint)
if fingerprints:
uniqueFingerprints.append(fingerprints[-1])
return uniqueFingerprints

def readFingerprints1(eventlogFile):
"RegExp version"
regExp = re.compile(r"^E # ([0-9]+) t ((?:[0-9]*\.)?[0-9]+) m [0-9]+ ce [0-9]+ msg [0-9]+ f (?:\"([^\"]*)\"|(\S+))$")
regExp = re.compile(r"^E # ([0-9]+) t ((?:[0-9]*\.)?[0-9]+) m [0-9]+ ce -?[0-9]+ msg -?[0-9]+ f (?:\"([^\"]*)\"|(\S+))$")
fingerprints = list()
for line in eventlogFile:
match = regExp.match(line)
if match:
fingerprint = match.group(3) if match.group(3) else match.group(4)
fingerprints.append(fingerprint)
fingerprints.append([match.group(1), fingerprint])
return fingerprints

def isNewEvent(line):
return len(line) >= 4 and line[0:4] == "E # "

def getFingerprint(line):
n = len(line) - 1
return line[(n-14):(n-5)]

def readFingerprints2(eventlogFile):
fingerprints = list()
eventlogFile.readline() # skip the first line
for line in eventlogFile:
if isNewEvent(line):
fingerprint = getFingerprint(line)
fingerprints.append(fingerprint)
return fingerprints

def diffingerprint(elog1Fingerprints, elog2Fingerprints):
minSize = min(len(elog1Fingerprints), len(elog2Fingerprints)) - 1
minSize = min(len(elog1Fingerprints), len(elog2Fingerprints))
for i in range(0,minSize):
elog1Fingerprint = elog1Fingerprints[i]
elog2Fingerprint = elog2Fingerprints[i]
if elog1Fingerprint[1] != elog2Fingerprint[1]:
return "Diff elog1: " + str(elog1Fingerprint[0]) + " fingerprint = " + elog1Fingerprint[1] + ", elog2: " + str(elog2Fingerprint[0]) + " fingerprint = " + elog2Fingerprint[1]
if len(elog1Fingerprints) > minSize:
elog1Fingerprint = elog1Fingerprints[i]
return "The elog1 fingerprint list longer than elog2, last equals: elog1: " + str(elog1Fingerprint[0]) + " fingerprint = " + elog1Fingerprint[1] + ", elog2: " + str(elog2Fingerprint[0]) + " fingerprint = " + elog2Fingerprint[1]
elif len(elog2Fingerprints) > minSize:
elog2Fingerprint = elog2Fingerprints[i]
return "The elog2 fingerprint list longer than elog1, last equals: elog1: " + str(elog1Fingerprint[0]) + " fingerprint = " + elog1Fingerprint[1] + ", elog2: " + str(elog2Fingerprint[0]) + " fingerprint = " + elog2Fingerprint[1]
return "No differences"


elog1FilePath = sys.argv[1]
elog2FilePath = sys.argv[2]

print(elog1FilePath)
elog1File = open(elog1FilePath)
elog2File = open(elog2FilePath)
uniqueElog1Fingerprints = computeUniqueFingerprints(readFingerprints1(elog1File))
Expand All @@ -62,4 +54,3 @@ print(diffingerprint(uniqueElog1Fingerprints, uniqueElog2Fingerprints))

elog1File.close()
elog2File.close()

3 changes: 2 additions & 1 deletion bin/inet_fingerprinttest
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ writeOutfile = True
useColors = sys.stdout.isatty()

defaultFingerprintCalculator = 'inet::FingerprintCalculator'
defaultExecutable = "inet"

txtPASS = "PASS"
txtPASS_unexpected = "PASS (unexpected)"
Expand Down Expand Up @@ -798,7 +799,7 @@ if __name__ == "__main__":
parser.add_argument('-x', '--exclude', action='append', metavar='regex', help='Negative line filter: a line (more precisely, workingdir+SPACE+args) must NOT match any of the regular expressions in order for that test case to be run')
parser.add_argument('-t', '--threads', type=int, default=defaultNumThreads, help='number of parallel threads (default: number of CPUs, currently '+str(defaultNumThreads)+')')
parser.add_argument('-r', '--repeat', type=int, default=1, help='number of repeating each test (default: 1)')
parser.add_argument('-e', '--executable', default='inet', help='Determines which binary to execute (e.g. opp_run_dbg, opp_run_release) if the command column in the CSV file does not specify one.')
parser.add_argument('-e', '--executable', default=defaultExecutable, help='Determines which binary to execute (e.g. opp_run_dbg, opp_run_release) if the command column in the CSV file does not specify one.')
parser.add_argument('-C', '--directory', help='Change to DIRECTORY before executing the tests. Working dirs in the CSV files are relative to this.')
parser.add_argument('-d', '--debug', action='store_true', help='Run debug executables: use the debug version of the executable (appends _dbg to the executable name)')
parser.add_argument('-s', '--release', action='store_true', help='Run release executables: use the release version of the executable (appends _release to the executable name)')
Expand Down
4 changes: 4 additions & 0 deletions python/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ distributed >=2024.10.0
optimparallel >=0.1.3
sewar >=0.4.6
py4j >=0.10.9


matplotlib
pandas
34 changes: 0 additions & 34 deletions src/inet/clock/common/ClockEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,4 @@
// SPDX-License-Identifier: LGPL-3.0-or-later
//


#ifndef __INET_COMMON_CLOCKEVENT_H
#define __INET_COMMON_CLOCKEVENT_H

#include "inet/clock/common/ClockEvent_m.h"

namespace inet {

class ClockBase;

class INET_API ClockEvent : public ClockEvent_Base
{
friend ClockBase;

protected:
virtual void execute() override;

void callBaseExecute() { ClockEvent_Base::execute(); }

public:
ClockEvent(const char *name = nullptr, short kind = 0) : ClockEvent_Base(name, kind) {}
ClockEvent(const ClockEvent& other) : ClockEvent_Base(other) {}

ClockEvent& operator=(const ClockEvent& other) {
if (this == &other) return *this;
ClockEvent_Base::operator=(other);
return *this;
}
virtual ClockEvent *dup() const override { return new ClockEvent(*this); }
};

} // namespace inet

#endif

13 changes: 12 additions & 1 deletion src/inet/clock/common/ClockEvent.msg
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ import inet.clock.contract.IClock;

namespace inet;

cplusplus {{
class ClockBase;
}}

enum OverdueClockEventHandlingMode {
UNSPECIFIED = -1;
EXECUTE = 0;
Expand All @@ -19,9 +23,16 @@ enum OverdueClockEventHandlingMode {

message ClockEvent
{
@customize;
IClock *clock;
bool relative = false;
clocktime_t arrivalClockTime = -1;
OverdueClockEventHandlingMode overdueClockEventHandlingMode = UNSPECIFIED;
}

cplusplus(ClockEvent) {{
friend ClockBase;

protected:
virtual void execute() override;
void callBaseExecute() { cMessage::execute(); }
}}
2 changes: 1 addition & 1 deletion src/inet/common/INETDefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ using namespace omnetpp;
# error At least OMNeT++/OMNEST version 6.0 required
#endif

#define INET_VERSION 0x0405
#define INET_VERSION 0x0406
#define INET_PATCH_LEVEL 0x00

#if defined(INET_EXPORT)
Expand Down
9 changes: 9 additions & 0 deletions src/inet/linklayer/ethernet/base/EthernetModes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,15 @@ const EthernetModes::EthernetMode EthernetModes::ethernetModes[NUM_OF_ETHERNETMO
B(0),
0,
0
},
{
EIGHTHUNDRED_GIGABIT_ETHERNET_TXRATE,
0,
B(0),
B(-1), // half-duplex is not supported
B(0),
0,
0
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/inet/linklayer/ethernet/base/EthernetModes.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class INET_API EthernetModes

protected:
enum {
NUM_OF_ETHERNETMODES = 11
NUM_OF_ETHERNETMODES = 12
};

// MAC constants for bitrates and modes
Expand Down
43 changes: 40 additions & 3 deletions src/inet/linklayer/ethernet/basic/EthernetMacPhy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ EthernetMacPhy::EthernetMacPhy()
{
}

EthernetMacPhy::~EthernetMacPhy()
{
cancelAndDelete(endRxTimer);
delete currentRxSignal;
}

void EthernetMacPhy::initialize(int stage)
{
EthernetMacBase::initialize(stage);
Expand All @@ -55,8 +61,14 @@ void EthernetMacPhy::initializeFlags()
{
EthernetMacBase::initializeFlags();

// read parameters
emitReceptionStarted = par("emitReceptionStarted");
if (emitReceptionStarted) {
endRxTimer = new cMessage("EndReception", ENDRECEPTION);
setTxUpdateSupport(true);
}
duplexMode = true;
physInGate->setDeliverImmediately(false);
physInGate->setDeliverImmediately(emitReceptionStarted);
}

void EthernetMacPhy::handleMessageWhenUp(cMessage *msg)
Expand All @@ -68,8 +80,27 @@ void EthernetMacPhy::handleMessageWhenUp(cMessage *msg)
handleSelfMessage(msg);
else if (msg->getArrivalGateId() == upperLayerInGateId)
handleUpperPacket(check_and_cast<Packet *>(msg));
else if (msg->getArrivalGate() == physInGate)
processMsgFromNetwork(check_and_cast<Signal *>(msg));
else if (msg->getArrivalGate() == physInGate) {
Signal *signal = check_and_cast<Signal *>(msg);
if (emitReceptionStarted) {
if (signal->isUpdate()) {
EV_DETAIL << "Rx update: " << signal << endl;
ASSERT(endRxTimer->isScheduled() && currentRxSignal != nullptr);
rescheduleAfter(signal->getRemainingDuration(), endRxTimer);
}
else {
EV_DETAIL << "Rx start: " << signal << endl;
ASSERT(!endRxTimer->isScheduled());
simtime_t remainingDuration = signal->getRemainingDuration();
scheduleAfter(remainingDuration, endRxTimer);
emit(receptionStartedSignal, signal);
}
currentRxSignal = signal;
}
else {
processMsgFromNetwork(signal);
}
}
else
throw cRuntimeError("Message received from unknown gate!");
processAtHandleMessageFinished();
Expand All @@ -85,6 +116,12 @@ void EthernetMacPhy::handleSelfMessage(cMessage *msg)
handleEndIFGPeriod();
else if (msg == endPauseTimer)
handleEndPausePeriod();
else if (msg == endRxTimer) {
EV_DETAIL << "Rx end: " << currentRxSignal << endl;
processMsgFromNetwork(currentRxSignal);
currentRxSignal = nullptr;
processAtHandleMessageFinished();
}
else
throw cRuntimeError("Unknown self message received!");
}
Expand Down
10 changes: 10 additions & 0 deletions src/inet/linklayer/ethernet/basic/EthernetMacPhy.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class INET_API EthernetMacPhy : public EthernetMacBase
{
public:
EthernetMacPhy();
virtual ~EthernetMacPhy();

// IActivePacketSink:
virtual void handleCanPullPacketChanged(const cGate *gate) override;
Expand Down Expand Up @@ -52,6 +53,15 @@ class INET_API EthernetMacPhy : public EthernetMacBase
virtual void scheduleEndPausePeriod(int pauseUnits);
virtual void beginSendFrames();

// parameter values
bool emitReceptionStarted = false;

// self messages
cMessage *endRxTimer = nullptr;

// other variables
Signal *currentRxSignal = nullptr;

// statistics
simtime_t totalSuccessfulRxTime; // total duration of successful transmissions on channel
};
Expand Down
2 changes: 2 additions & 0 deletions src/inet/linklayer/ethernet/basic/EthernetMacPhy.ned
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ module EthernetMacPhy extends Module like IEtherMac
bool duplexMode; // Must be set to "true", as EthernetMacPhy does not support half-duplex operation
// (parameter is present to reduce the risk of accidental misconfiguration)
bool allowNonstandardBitrate = default(false); // Allows any bitrate and uses the first larger bitrate specified parameters
bool emitReceptionStarted = default(false);
int mtu @unit(B) = default(1500B);
string fcsMode @enum("declared", "computed");
@lifecycleSupport;
Expand All @@ -137,6 +138,7 @@ module EthernetMacPhy extends Module like IEtherMac
@signal[receptionStateChanged](type=long); // Enum=MacReceiveState
@signal[transmissionStarted](type=inet::physicallayer::EthernetSignalBase);
@signal[transmissionEnded](type=inet::physicallayer::EthernetSignalBase);
@signal[receptionStarted](type=inet::physicallayer::Signal);
@signal[receptionEnded](type=inet::physicallayer::Signal);

@statistic[transmitting](title="transmitting state"; type=int; source=count(transmissionStarted) - count(transmissionEnded); record=vector; interpolationmode=sample-hold);
Expand Down
1 change: 1 addition & 0 deletions src/inet/linklayer/ethernet/common/Ethernet.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const b INTERFRAME_GAP_BITS = b(96);
#define HUNDRED_GIGABIT_ETHERNET_TXRATE 100000000000.0 /* 100 Gbit/sec (in bit/s) */
#define TWOHUNDRED_GIGABIT_ETHERNET_TXRATE 200000000000.0 /* 200 Gbit/sec (in bit/s) */
#define FOURHUNDRED_GIGABIT_ETHERNET_TXRATE 400000000000.0 /* 400 Gbit/sec (in bit/s) */
#define EIGHTHUNDRED_GIGABIT_ETHERNET_TXRATE 800000000000.0 /* 800 Gbit/sec (in bit/s) */

#define MAX_ATTEMPTS 16
#define BACKOFF_RANGE_LIMIT 10
Expand Down
7 changes: 6 additions & 1 deletion src/inet/routing/eigrp/messages/EigrpMessage.msg
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@ struct EigrpMsgRoute
// Message request
message EigrpMsgReq
{
@customize(true);
int8_t opcode; // Type of message
bool goodbyeMsg = false; // Message is Hello goodbye

Expand All @@ -279,3 +278,9 @@ message EigrpMsgReq
int numOfAck; // Number of acknowledges
EigrpMsgRoute routes[];
};

cplusplus(EigrpMsgReq) {{
public:
bool isMsgReliable() { return getOpcode() != EIGRP_HELLO_MSG; }
int findMsgRoute(int routeId) const;
}}
19 changes: 0 additions & 19 deletions src/inet/routing/eigrp/messages/EigrpMsgReq.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,5 @@
* @author Vladimir Vesely (ivesely@fit.vutbr.cz)
* @copyright Brno University of Technology (www.fit.vutbr.cz) under GPLv3
*/
#ifndef __INET_EIGRPMSGREQ_H
#define __INET_EIGRPMSGREQ_H

#include "inet/routing/eigrp/messages/EigrpMessage_m.h"
namespace inet {
class INET_API EigrpMsgReq : public EigrpMsgReq_Base
{
public:
EigrpMsgReq(const char *name = nullptr) : EigrpMsgReq_Base(name) {}
EigrpMsgReq(const EigrpMsgReq& other) : EigrpMsgReq_Base(other) {}
EigrpMsgReq& operator=(const EigrpMsgReq& other)
{ EigrpMsgReq_Base::operator=(other); return *this; }
virtual EigrpMsgReq *dup() const { return new EigrpMsgReq(*this); }
bool isMsgReliable() { return getOpcode() != EIGRP_HELLO_MSG; }
int findMsgRoute(int routeId) const;
};

//Register_Class(EigrpMsgReq);
} // namespace inet
#endif

Loading