Commit d7f927a1 authored by Tomek Mrugalski's avatar Tomek Mrugalski 🛰
Browse files

[4271] Logging checks added for TokenVendor and TokenVendorClass

parent 77848fb7
......@@ -112,49 +112,55 @@ This debug message indicates that the expression has been evaluated
to said value. This message is mostly useful during debugging of the
client classification expressions.
% EVAL_DEBUG_VENDOR_NO_OPTION Option with code %1 missing, pushing result %2
% EVAL_DEBUG_VENDOR_NO_OPTION Option with code %1 missing, pushing result '%2'
This debug message indicates that the expression has been evaluated
and vendor option was not found. This message is mostly useful during
debugging of the client classification expressions.
% EVAL_DEBUG_VENDOR_ENTERPRISE_ID_MISMATCH Was looking for %1, option had %2, pushing result %3
% EVAL_DEBUG_VENDOR_ENTERPRISE_ID_MISMATCH Was looking for %1, option had %2, pushing result '%3'
This debug message indicates that the expression has been evaluated
and vendor option was found, but has different enterprise-id than specified
in the expression. This message is mostly useful during debugging of the
client classification expressions.
% EVAL_DEBUG_VENDOR_ENTERPRISE_ID Pushing enterprise-id %1 as result %2
% EVAL_DEBUG_VENDOR_ENTERPRISE_ID Pushing enterprise-id %1 as result '%2'
This debug message indicates that the expression has been evaluated and vendor
option was found and its enterprise-id is being reported. This message is mostly
useful during debugging of the client classification expressions.
% EVAL_DEBUG_VENDOR_EXISTS Option with enterprise-id %1 found, pushing result %2
% EVAL_DEBUG_VENDOR_EXISTS Option with enterprise-id %1 found, pushing result '%2'
This debug message indicates that the expression has been evaluated and vendor
option was found. This message is mostly useful during debugging of the client
classification expressions.
% EVAL_DEBUG_VENDOR_CLASS_NO_OPTION Option with code %1 missing, pushing result %2
% EVAL_DEBUG_VENDOR_CLASS_NO_OPTION Option with code %1 missing, pushing result '%2'
This debug message indicates that the expression has been evaluated
and vendor class option was not found. This message is mostly useful during
debugging of the client classification expressions.
% EVAL_DEBUG_VENDOR_CLASS_ENTERPRISE_ID_MISMATCH Was looking for %1, option had %2, pushing result %3
% EVAL_DEBUG_VENDOR_CLASS_ENTERPRISE_ID_MISMATCH Was looking for %1, option had %2, pushing result '%3'
This debug message indicates that the expression has been evaluated
and vendor class option was found, but has different enterprise-id than specified
in the expression. This message is mostly useful during debugging of the
client classification expressions.
% EVAL_DEBUG_VENDOR_CLASS_ENTERPRISE_ID Pushing enterprise-id %1 as result %2
% EVAL_DEBUG_VENDOR_CLASS_ENTERPRISE_ID Pushing enterprise-id %1 as result '%2'
This debug message indicates that the expression has been evaluated and vendor
class option was found and its enterprise-id is being reported. This message is mostly
useful during debugging of the client classification expressions.
% EVAL_DEBUG_VENDOR_CLASS_EXISTS Option with enterprise-id %1 found, pushing result %2
% EVAL_DEBUG_VENDOR_CLASS_EXISTS Option with enterprise-id %1 found, pushing result '%2'
This debug message indicates that the expression has been evaluated and vendor
class option was found. This message is mostly useful during debugging of the
client classification expressions.
% EVAL_DEBUG_VENDOR_CLASS_DATA Data %1 (out of %2 received) in vendor class found pushing as %3
% EVAL_DEBUG_VENDOR_CLASS_DATA Data %1 (out of %2 received) in vendor class found, pushing result '%3'
This debug message indicates that vendor class option was found and passed
enterprise-id checks and has sufficient number of data chunks. Total numer
of chunks and value pushed are reported as debugging aid.
% EVAL_DEBUG_VENDOR_CLASS_DATA_NOT_FOUND Requested data index %1, but option with enterprise-id %2 has only %3 data tuple(s), pushing result '%4'
This debug message indicates that vendor class option was found and passed
enterprise-id checks, but does not have sufficient number of data chunks.
Note that the index starts at 0, so there has to be at least (index + 1)
data chunks.
\ No newline at end of file
This diff is collapsed.
......@@ -682,7 +682,7 @@ void TokenVendor::evaluate(Pkt& pkt, ValueStack& values) {
memcpy(&txt[0], &value, sizeof(uint32_t));
values.push(txt);
LOG_DEBUG(eval_logger, EVAL_DBG_STACK, EVAL_DEBUG_VENDOR_ENTERPRISE_ID)
.arg(vendor_id_)
.arg(vendor->getVendorId())
.arg(util::encode::encodeHex(std::vector<uint8_t>(txt.begin(),
txt.end())));
return;
......@@ -789,7 +789,7 @@ void TokenVendorClass::evaluate(Pkt& pkt, ValueStack& values) {
memcpy(&txt[0], &value, sizeof(uint32_t));
values.push(txt);
LOG_DEBUG(eval_logger, EVAL_DBG_STACK, EVAL_DEBUG_VENDOR_CLASS_ENTERPRISE_ID)
.arg(vendor_id_)
.arg(vendor->getVendorId())
.arg(util::encode::encodeHex(std::vector<uint8_t>(txt.begin(),
txt.end())));
return;
......@@ -812,6 +812,11 @@ void TokenVendorClass::evaluate(Pkt& pkt, ValueStack& values) {
if (index_ + 1 > max) {
// The index specified if out of bound, e.g. there are only
// 2 tuples and index specified is 5.
LOG_DEBUG(eval_logger, EVAL_DBG_STACK, EVAL_DEBUG_VENDOR_CLASS_DATA_NOT_FOUND)
.arg(index_)
.arg(vendor->getVendorId())
.arg(max)
.arg("");
values.push("");
return;
}
......@@ -823,7 +828,7 @@ void TokenVendorClass::evaluate(Pkt& pkt, ValueStack& values) {
LOG_DEBUG(eval_logger, EVAL_DBG_STACK, EVAL_DEBUG_VENDOR_CLASS_DATA)
.arg(index_)
.arg(max)
.arg(util::encode::encodeHex(buf));
.arg(txt);
values.push(txt);
return;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment