see: pfpsim/pfpdb#2
The return type of TrType::debuggable should be changed from bool to a pointer to a new DebugInfo type. DebugInfo would be a pure virtual base class, something like the following. Returning nullptr would indicate that the object is not debuggable.
class DebugInfo {
public:
// Get the raw unparsed packet data
virtual std::vector<uint8_t> raw_data() = 0;
// Get a list of all header fields available
virtual std::vector<std::string> fields() = 0;
// Get the value of a header field, based on a field name
virtual std::vector<uint8_t> field_value(std::string field_name) = 0;
};
The return type of field_value will probably need to be more complicated, probably including length in bits, and possibly some hints for the display format to use (hexadecimal, decimal, IPv4, MAC, etc.).
see: pfpsim/pfpdb#2
The return type of
TrType::debuggableshould be changed fromboolto a pointer to a newDebugInfotype.DebugInfowould be a pure virtual base class, something like the following. Returningnullptrwould indicate that the object is not debuggable.The return type of
field_valuewill probably need to be more complicated, probably including length in bits, and possibly some hints for the display format to use (hexadecimal, decimal, IPv4, MAC, etc.).