Add an incrementing tag id to T-Tag packets

This commit is contained in:
Srivats P 2023-03-18 16:34:47 +05:30
parent 90a3731a90
commit 072dfcdc3b
2 changed files with 3 additions and 0 deletions

View File

@ -432,6 +432,7 @@ int PcapTxThread::sendQueueTransmit(pcap_t *p, PacketSequence *seq,
&& ((stats_->pkts % seq->ttagPktInterval_) == 0)) {
ttagPkt = true;
*(pkt+pktLen-5) = SignProtocol::kTypeLenTtag;
*(pkt+pktLen-6) = ttagId_++;
if (seq->ttagL4CksumOffset_) {
quint16 *cksum = reinterpret_cast<quint16*>(
pkt + seq->ttagL4CksumOffset_);
@ -467,6 +468,7 @@ int PcapTxThread::sendQueueTransmit(pcap_t *p, PacketSequence *seq,
// Revert T-Tag packet changes
if (ttagPkt) {
*(pkt+pktLen-5) = SignProtocol::kTypeLenTtagPlaceholder;
*(pkt+pktLen-6) = 0;
if (seq->ttagL4CksumOffset_) {
quint16 *cksum = reinterpret_cast<quint16*>(
pkt + seq->ttagL4CksumOffset_);

View File

@ -93,6 +93,7 @@ private:
StatsTuple *stats_;
StatsTuple lastStats_;
StreamStats streamStats_;
quint8 ttagId_{0};
double lastTxDuration_{0.0}; // in secs