normStreamer example tweak

pull/18/head
Brian Adamson 2020-06-13 13:15:03 -04:00
parent 63d266f0b5
commit ad31a1a32a
2 changed files with 10 additions and 1 deletions

View File

@ -576,6 +576,8 @@ bool NormStreamer::OpenNormSession(NormInstanceHandle instance, const char* addr
NormSetGrttProbingTOS(norm_session, probe_tos); NormSetGrttProbingTOS(norm_session, probe_tos);
NormSetFragmentation(norm_session, true); // so that IP ID gets set for SMF DPD
return true; return true;
} // end NormStreamer::OpenNormSession() } // end NormStreamer::OpenNormSession()
@ -1459,7 +1461,11 @@ int main(int argc, char* argv[])
int tos = -1; int tos = -1;
int result = sscanf(argv[i], "%i", &tos); int result = sscanf(argv[i], "%i", &tos);
if (1 != result) if (1 != result)
result = sscanf(argv[i], "%x", &tos); {
unsigned int utos;
result = sscanf(argv[i], "%x", &utos);
tos = utos;
}
if ((1 != result) || (tos < 0) || (tos > 255)) if ((1 != result) || (tos < 0) || (tos > 255))
{ {
fprintf(stderr, "normStreamer error: invalid 'ptos' value!\n"); fprintf(stderr, "normStreamer error: invalid 'ptos' value!\n");

View File

@ -5110,12 +5110,15 @@ bool NormSession::RawSendTo(const char* buffer, unsigned int& numBytes, const Pr
etherDst = PROTO_ADDR_BROADCAST; etherDst = PROTO_ADDR_BROADCAST;
ethPkt.SetDstAddr(etherDst); ethPkt.SetDstAddr(etherDst);
if (ecn_enabled) if (ecn_enabled)
{ {
trafficClass |= ((UINT8)ProtoSocket::ECN_ECT0); // set ECT0 bit trafficClass |= ((UINT8)ProtoSocket::ECN_ECT0); // set ECT0 bit
trafficClass &= ~((UINT8)ProtoSocket::ECN_ECT1); // clear ECT1 bit trafficClass &= ~((UINT8)ProtoSocket::ECN_ECT1); // clear ECT1 bit
} }
//TRACE("sending RAW with tos 0x%02x (probe_tos 0x%02x\n", trafficClass, probe_tos);
switch (dstAddr.GetType()) switch (dstAddr.GetType())
{ {
case ProtoAddress::IPv4: case ProtoAddress::IPv4: