20#ifndef ORES_COMMS_RECORDING_SESSION_FILE_HPP
21#define ORES_COMMS_RECORDING_SESSION_FILE_HPP
28#include <boost/uuid/uuid.hpp>
29#include "ores.comms/messaging/message_types.hpp"
39 0x4F, 0x52, 0x45, 0x53, 0x2D, 0x52, 0x45, 0x43
75 std::array<std::uint8_t, 8> magic;
76 std::uint16_t version;
77 std::uint16_t reserved1;
78 std::uint16_t protocol_version_major;
79 std::uint16_t protocol_version_minor;
80 boost::uuids::uuid session_id;
81 std::int64_t start_timestamp_us;
82 std::uint16_t server_address_length;
84 std::array<std::uint8_t, 21> reserved2;
86 static constexpr size_t size = 64;
90 "session_file_header must be exactly 64 bytes");
105 std::int64_t timestamp_offset_us;
106 std::uint32_t frame_size;
108 std::array<std::uint8_t, 3> reserved;
110 static constexpr size_t size = 16;
114 "frame_record_header must be exactly 16 bytes");
141 const boost::uuids::uuid& session_id,
142 std::chrono::system_clock::time_point start_time);
compression_type
Compression algorithm used for payload compression.
Definition message_types.hpp:259
Session recording infrastructure for debugging and analysis.
Definition ores.comms.recording.hpp:28
session_file_error
Error codes for session file operations.
Definition session_file.hpp:119
@ unexpected_eof
Truncated file in middle of read.
@ end_of_file
Clean end of file at frame boundary.
constexpr std::uint16_t SESSION_FILE_VERSION
Current version of the session file format.
Definition session_file.hpp:45
std::string generate_session_filename(const boost::uuids::uuid &session_id, std::chrono::system_clock::time_point start_time)
Generate a session filename with timestamp and UUID.
Definition session_file.cpp:28
constexpr std::array< std::uint8_t, 8 > SESSION_FILE_MAGIC
Magic bytes identifying an ORES session recording file.
Definition session_file.hpp:38
frame_direction
Direction of a recorded frame.
Definition session_file.hpp:50
@ sent
Frame was sent by the client.
@ received
Frame was received by the client.
File header for session recording files.
Definition session_file.hpp:74
Header for each recorded frame in the session file.
Definition session_file.hpp:104