* new Packet type: PAYLOAD_TYPE_TRACE

This commit is contained in:
Scott Powell 2025-02-17 19:22:31 +11:00
parent ef95462345
commit 0db15db625
9 changed files with 135 additions and 8 deletions

View file

@ -25,6 +25,7 @@ namespace mesh {
#define PAYLOAD_TYPE_GRP_DATA 0x06 // an (unverified) group datagram (prefixed with channel hash, MAC) (enc data: timestamp, blob)
#define PAYLOAD_TYPE_ANON_REQ 0x07 // generic request (prefixed with dest_hash, ephemeral pub_key, MAC) (enc data: ...)
#define PAYLOAD_TYPE_PATH 0x08 // returned path (prefixed with dest/src hashes, MAC) (enc data: path, extra)
#define PAYLOAD_TYPE_TRACE 0x09 // trace a path, collecting SNI for each hop
//...
#define PAYLOAD_TYPE_RESERVEDM 0x0F // FUTURE
@ -44,6 +45,7 @@ public:
uint16_t payload_len, path_len;
uint8_t path[MAX_PATH_SIZE];
uint8_t payload[MAX_PACKET_PAYLOAD];
float _snr;
/**
* \brief calculate the hash of payload + type
@ -72,6 +74,8 @@ public:
void markDoNotRetransmit() { header = 0xFF; }
bool isMarkedDoNotRetransmit() const { return header == 0xFF; }
float getSNR() const { return _snr; }
/**
* \brief save entire packet as a blob
* \param dest (OUT) destination buffer (assumed to be MAX_MTU_SIZE)