Skip to content

Add support for viewing packet contents in debugger #1

@grodtron

Description

@grodtron

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.).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions