From 260109ea70a403b97f13eb0b75485c4a3186f78c Mon Sep 17 00:00:00 2001 From: bebopagogo Date: Mon, 20 Jan 2020 00:21:49 -0500 Subject: [PATCH] update to track Protolib ProtoPkt changes --- examples/normCast.cpp | 7 ++++--- src/common/pcap2norm.cpp | 10 ++++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/examples/normCast.cpp b/examples/normCast.cpp index be6516a..317c686 100644 --- a/examples/normCast.cpp +++ b/examples/normCast.cpp @@ -11,7 +11,7 @@ #endif // if/else WIN32/UNIX // When the "ack" option _and_ flushing is used, there are a couple of strategies -// that can be used. Here, the two options implemented are titled +// that can be used. Here, the two options implemented are titled // "SHOOT_FIRST" and "ACK_LATER". If "SHOOT_FIRST" is #defined, then // NormSetWatermark() is called immediately after each enqueued transmit // object. This call to "NormSetWatermark()" cancels any previous @@ -23,8 +23,9 @@ // request is pending acknowledgment. This potentially allows the flow control // to be advanced sooner instead of the sender "chasing its own tail" with the // SHOOT_FIRST strategy. Both strategies are implemented here, because under -// certain cases, the SHOOT_FIRST _may_ have benefit. Try them both, and you -// decide ... +// certain cases, the SHOOT_FIRST _may_ have benefit. For example, low duty cycle +// transmission may benefit if acknowledgment is requested after each object. +// Try them both, and you decide ... // By the way, this SHOOT_FIRST/ACK_LATER only applies to the case when both // the "ack" and "flush" options are used. The "flush" option controls the diff --git a/src/common/pcap2norm.cpp b/src/common/pcap2norm.cpp index 43709c0..e2505e1 100644 --- a/src/common/pcap2norm.cpp +++ b/src/common/pcap2norm.cpp @@ -113,7 +113,9 @@ int main(int argc, char* argv[]) } ethType = ethPkt.GetType(); payloadLength = ethPkt.GetPayloadLength(); - payloadPtr = (UINT32*)ethPkt.AccessPayload(); + // This is done know we offset the ethBuffer above + payloadPtr = alignedBuffer + (2 + ethPkt.GetLength() - ethPkt.GetPayloadLength())/4; + //payloadPtr = (UINT32*)ethPkt.AccessPayload(); } ProtoPktIP ipPkt; @@ -264,7 +266,7 @@ void NormTrace2(const struct timeval& currentTime, seq, //data.IsData() ? "DATA" : "PRTY", (UINT16)data.GetObjectId(), - (UINT32)data.GetFecBlockId(fecM), + (UINT32)data.GetFecBlockId(fecM).GetValue(), (UINT16)data.GetFecSymbolId(fecM)); if (data.IsStream()) @@ -308,7 +310,7 @@ void NormTrace2(const struct timeval& currentTime, static_cast(msg); PLOG(PL_ALWAYS, " obj>%hu blk>%lu seg>%hu ", (UINT16)squelch.GetObjectId(), - (UINT32)squelch.GetFecBlockId(fecM), + (UINT32)squelch.GetFecBlockId(fecM).GetValue(), (UINT16)squelch.GetFecSymbolId(fecM)); break; } @@ -318,7 +320,7 @@ void NormTrace2(const struct timeval& currentTime, static_cast(msg); PLOG(PL_ALWAYS, " obj>%hu blk>%lu seg>%hu ", (UINT16)flush.GetObjectId(), - (UINT32)flush.GetFecBlockId(fecM), + (UINT32)flush.GetFecBlockId(fecM).GetValue(), (UINT16)flush.GetFecSymbolId(fecM)); // Print acking node list (if any)