From a28769181f72fcda9b91cc826d1ccfe0c5350695 Mon Sep 17 00:00:00 2001 From: Levente Meszaros Date: Fri, 20 Dec 2024 11:24:34 +0100 Subject: [PATCH] Ppp: Added emitting the packet with transmissionEnd and receptionEnd signals for PCAP recording. --- src/inet/linklayer/ppp/Ppp.cc | 2 ++ src/inet/linklayer/ppp/Ppp.ned | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/inet/linklayer/ppp/Ppp.cc b/src/inet/linklayer/ppp/Ppp.cc index 59dbe767859..9e9aaaebd45 100644 --- a/src/inet/linklayer/ppp/Ppp.cc +++ b/src/inet/linklayer/ppp/Ppp.cc @@ -215,6 +215,7 @@ void Ppp::handleMessageWhenUp(cMessage *message) void Ppp::handleSelfMessage(cMessage *message) { if (message == endTransmissionEvent) { + emit(transmissionEndedSignal, curTxPacket); deleteCurrentTxFrame(); delete curTxPacket; curTxPacket = nullptr; @@ -268,6 +269,7 @@ void Ppp::handleLowerPacket(Packet *packet) const auto& pppTrailer = packet->peekAtBack(PPP_TRAILER_LENGTH); if (pppHeader == nullptr || pppTrailer == nullptr) throw cRuntimeError("Invalid PPP packet: PPP header or Trailer is missing"); + emit(receptionEndedSignal, packet); emit(rxPkOkSignal, packet); decapsulate(packet); numRcvdOK++; diff --git a/src/inet/linklayer/ppp/Ppp.ned b/src/inet/linklayer/ppp/Ppp.ned index ab01cb7e31b..ac679d57147 100644 --- a/src/inet/linklayer/ppp/Ppp.ned +++ b/src/inet/linklayer/ppp/Ppp.ned @@ -51,6 +51,8 @@ simple Ppp @signal[packetReceivedFromLower](type=cPacket); @signal[packetSentToUpper](type=cPacket); @signal[packetReceivedFromUpper](type=cPacket); + @signal[transmissionEnded](type=inet::Packet); + @signal[receptionEnded](type=inet::Packet); @statistic[transmissionState](title="tx state"; source=transmissionStateChanged; record=timeavg,vector; interpolationmode=sample-hold); @statistic[txPk](title="packets transmitted"; source=packetSentToLower; record=count,"sum(packetBytes)","vector(packetBytes)"; interpolationmode=none); @statistic[rxPkOk](title="packets received OK"; source=rxPkOk; record=count,"sum(packetBytes)","vector(packetBytes)"; interpolationmode=none);