Debug output fixes.

This commit is contained in:
Adam Ierymenko 2016-08-29 16:19:26 -07:00
parent f0636ffd4a
commit cb82193333

View file

@ -79,7 +79,7 @@ static const void _dumpFilterTrace(const char *ruleName,uint8_t thisSetMatches,b
{ {
static volatile unsigned long cnt = 0; static volatile unsigned long cnt = 0;
printf("%.6lu %c %s inbound=%d noRedirect=%d frameLen=%u etherType=%u" ZT_EOL_S, printf("%.6lu %c %s inbound=%d noRedirect=%d frameLen=%u etherType=%u" ZT_EOL_S,
cnt, cnt++,
((thisSetMatches) ? 'Y' : '.'), ((thisSetMatches) ? 'Y' : '.'),
ruleName, ruleName,
(int)inbound, (int)inbound,
@ -88,8 +88,8 @@ static const void _dumpFilterTrace(const char *ruleName,uint8_t thisSetMatches,b
etherType etherType
); );
for(std::vector<std::string>::const_iterator m(dlog.begin());m!=dlog.end();++m) for(std::vector<std::string>::const_iterator m(dlog.begin());m!=dlog.end();++m)
printf(" | %s" ZT_EOL_S,m->c_str()); printf(" | %s" ZT_EOL_S,m->c_str());
printf(" + %c %s->%s %.2x:%.2x:%.2x:%.2x:%.2x:%.2x->%.2x:%.2x:%.2x:%.2x:%.2x:%.2x" ZT_EOL_S, printf(" + %c %s->%s %.2x:%.2x:%.2x:%.2x:%.2x:%.2x->%.2x:%.2x:%.2x:%.2x:%.2x:%.2x" ZT_EOL_S,
((thisSetMatches) ? 'Y' : '.'), ((thisSetMatches) ? 'Y' : '.'),
ztSource.toString().c_str(), ztSource.toString().c_str(),
ztDest.toString().c_str(), ztDest.toString().c_str(),
@ -213,7 +213,7 @@ static int _doZtFilter(
// to self. We should also accept here instead of interpreting // to self. We should also accept here instead of interpreting
// REDIRECT as DROP since we are the destination. // REDIRECT as DROP since we are the destination.
#ifdef ZT_RULES_ENGINE_DEBUGGING #ifdef ZT_RULES_ENGINE_DEBUGGING
_dumpFilterTrace(_rtn(rt),thisSetMatches,noRedirect,inbound,ztSource,ztDest,macSource,macDest,dlog,frameLen,etherType,"ignored since we are the destination"); _dumpFilterTrace(_rtn(rt),thisSetMatches,noRedirect,inbound,ztSource,ztDest,macSource,macDest,dlog,frameLen,etherType,"TEE/REDIRECT resulted in 'super-accept' since we are destination");
#endif // ZT_RULES_ENGINE_DEBUGGING #endif // ZT_RULES_ENGINE_DEBUGGING
return 2; // we should "super-accept" this packet since we are the TEE or REDIRECT destination return 2; // we should "super-accept" this packet since we are the TEE or REDIRECT destination
} else { } else {