Skip to content

Commit

Permalink
Ppp: Added emitting the packet with transmissionEnd and receptionEnd …
Browse files Browse the repository at this point in the history
…signals for PCAP recording.
  • Loading branch information
levy committed Dec 20, 2024
1 parent 9b760de commit a287691
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/inet/linklayer/ppp/Ppp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -268,6 +269,7 @@ void Ppp::handleLowerPacket(Packet *packet)
const auto& pppTrailer = packet->peekAtBack<PppTrailer>(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++;
Expand Down
2 changes: 2 additions & 0 deletions src/inet/linklayer/ppp/Ppp.ned
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit a287691

Please sign in to comment.