Skip to content

Commit 1a143c8

Browse files
committed
apps: added numbering to VoIP and VoD packet names, to facilitate tracing with Qtenv
1 parent 8d95e97 commit 1a143c8

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

src/simu5g/apps/vod/VodUdpClient.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ void VodUdpClient::handleMessage(cMessage *msg)
139139
socket.setTos(tos);
140140
delete msg;
141141
}
142-
else if (!strcmp(msg->getName(), "VoDPacket")) {
142+
else if (opp_stringbeginswith(msg->getName(), "VoDPacket")) {
143143
receiveStream(check_and_cast<inet::Packet *>(msg)->peekAtFront<VoDPacket>().get());
144144
delete msg;
145145
}

src/simu5g/apps/vod/VodUdpServer.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ void VodUdpServer::handleSVCMessage(cMessage *msg)
136136
int seq_num = numPkSentApp;
137137
int currentFrame = svcTrace_[numPkSentApp].frameNumber;
138138

139-
Packet *packet = new Packet("VoDPacket");
139+
Packet *packet = new Packet(opp_stringf("VoDPacket-%d-%d", getId(), seq_num).c_str());
140140
auto frame = makeShared<VoDPacket>();
141141
frame->setFrameSeqNum(seq_num);
142142
frame->setPayloadTimestamp(simTime());

src/simu5g/apps/voip/VoipSender.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ void VoipSender::sendVoIPPacket()
156156
if (destAddress_.isUnspecified())
157157
destAddress_ = L3AddressResolver().resolve(par("destAddress"));
158158

159-
Packet *packet = new inet::Packet("VoIP");
159+
Packet *packet = new inet::Packet(opp_stringf("VoIP-%d-%d", getId(), iDframe_).c_str());
160160
auto voip = makeShared<VoipPacket>();
161161
voip->setIDtalk(iDtalk_ - 1);
162162
voip->setNframes(nframes_);

src/simu5g/stack/pdcp/LtePdcp.cc

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,25 +36,28 @@ LtePdcpBase::~LtePdcpBase()
3636
{
3737
}
3838

39+
3940
ApplicationType LtePdcpBase::getApplication(cPacket *pkt)
4041
{
41-
if ((strcmp(pkt->getName(), "VoIP")) == 0)
42+
const char *name = pkt->getName();
43+
if (opp_stringbeginswith(name, "VoIP"))
4244
return VOIP;
43-
else if ((strcmp(pkt->getName(), "gaming")) == 0)
45+
else if (opp_stringbeginswith(name, "gaming"))
4446
return GAMING;
45-
else if ((strcmp(pkt->getName(), "VoDPacket") == 0) || (strcmp(pkt->getName(), "VoDFinishPacket") == 0))
47+
else if (opp_stringbeginswith(name, "VoDPacket") || opp_stringbeginswith(name, "VoDFinishPacket"))
4648
return VOD;
4749
else
4850
return CBR;
4951
}
5052

5153
LteTrafficClass LtePdcpBase::getTrafficCategory(cPacket *pkt)
5254
{
53-
if ((strcmp(pkt->getName(), "VoIP")) == 0)
55+
const char *name = pkt->getName();
56+
if (opp_stringbeginswith(name, "VoIP"))
5457
return CONVERSATIONAL;
55-
else if ((strcmp(pkt->getName(), "gaming")) == 0)
58+
else if (opp_stringbeginswith(name, "gaming"))
5659
return INTERACTIVE;
57-
else if ((strcmp(pkt->getName(), "VoDPacket") == 0) || (strcmp(pkt->getName(), "VoDFinishPacket") == 0))
60+
else if (opp_stringbeginswith(name, "VoDPacket") || opp_stringbeginswith(name, "VoDFinishPacket"))
5861
return STREAMING;
5962
else
6063
return BACKGROUND;

0 commit comments

Comments
 (0)