tracefilter.cpp File Reference
Last updated: 25-Feb-2025
#include "tracefilter.h"
#include "hexutil.h"
#include "bertlv/bertlv.h"
#include "sdi_tags.h"
#include "data.h"
#include "csd.h"
#include "epp/counterTop.h"
#include "filterconfig.h"
#include "filesystem.h"
Include dependency graph for tracefilter.cpp:

Macros |
|
#define | TRACE_FILTER |
#define | MAX_TRACE_MSG_SIZE 4096 |
#define | BIN2HEXSTRING(str, buf, size) bintohexstring(str,buf,(size<=MAX_TRACE_MSG_SIZE?size:MAX_TRACE_MSG_SIZE)) |
Functions |
|
void | filterCommand (const unsigned char *cmd, unsigned cmdSize, std::string &out) |
void | filterResponse (const unsigned char *cmd, unsigned cmdSize, const unsigned char *rsp, unsigned rspSize, std::string &out) |
Macro Definition Documentation
◆ BIN2HEXSTRING
#define BIN2HEXSTRING | ( | str, | |
buf, | |||
size | |||
) | bintohexstring(str,buf,(size<=MAX_TRACE_MSG_SIZE?size:MAX_TRACE_MSG_SIZE)) |
◆ MAX_TRACE_MSG_SIZE
#define MAX_TRACE_MSG_SIZE 4096 |
◆ TRACE_FILTER
#define TRACE_FILTER |
Function Documentation
◆ filterCommand()
void filterCommand | ( | const unsigned char * | cmd, |
unsigned | cmdSize, | ||
std::string & | out | ||
) |
Prepare and SDI command for trace and return a hexdump as STL string for it. For release build variants of SDI a trace filter is applied to command data to wipe out values of TLV tags containing sensitive data. For debug build variant the trace filter is disabled by default (use -DTRACE_FILTER to activate).
- Parameters
-
[in] cmd pointer to SDI command buffer (starting wich class/instruction) [in] cmdSize size of command data in buffer cmd [out] out hexdump of SDI command as STL string
- The size of the hexdump is basically limited by MAX_TRACE_MSG_SIZE in tracefilter.cpp.
◆ filterResponse()
void filterResponse | ( | const unsigned char * | cmd, |
unsigned | cmdSize, | ||
const unsigned char * | rsp, | ||
unsigned | rspSize, | ||
std::string & | out | ||
) |
Prepare and SDI response for trace and return a hexdump as STL string for it. For release build variants of SDI a trace filter is applied to response data to wipe out values of TLV tags containing sensitive data. For debug build variant the trace filter is disabled by default (use -DTRACE_FILTER to activate).
- Parameters
-
[in] cmd pointer to SDI command buffer (starting wich class/instruction) [in] cmdSize size of command data in buffer cmd [in] rsp pointer to SDI response buffer (starting wich class/instruction) [in] rspSize size of response data in buffer rsp [out] out hexdump of SDI response as STL string
- The size of the hexdump is basically limited by MAX_TRACE_MSG_SIZE in tracefilter.cpp.
Rate this article: