Yarilo v0.9.9
WPA2 Decrypter & Packet Analyzer
Loading...
Searching...
No Matches
recording.h
Go to the documentation of this file.
1#ifndef SNIFF_RECORDING
2#define SNIFF_RECORDING
3
4#include "channel.h"
5#include "uuid.h"
6#include <filesystem>
7#include <memory>
8#include <optional>
9#include <spdlog/logger.h>
10#include <tins/snap.h>
11
12#include "database.h"
13
14namespace yarilo {
15
19class Recording {
20public:
24 enum class DataLinkType {
25 UNKNOWN,
28 ETH2,
29 };
30
34 struct info {
36 std::string filename;
37 std::string display_name;
39 uint32_t count;
40
41 uuid::UUIDv4 get_uuid() const { return uuid; }
42 };
43
51 Recording(const std::filesystem::path &save_dir, bool dump_raw, Database &db,
52 const std::string &display_name);
53
60 std::optional<info> dump(std::shared_ptr<PacketChannel> channel) const;
61
68 std::optional<info> dump(std::vector<Tins::Packet *> *packets) const;
69
75 static std::unique_ptr<Tins::Packet> make_eth_packet(Tins::Packet *pkt);
76
77private:
78 /*
79 * Generates a path for the recording file.
80 * @return The generated recording path as a path object.
81 */
82 std::filesystem::path generate_filepath() const;
83
84 std::shared_ptr<spdlog::logger> logger;
85 const std::filesystem::path save_dir;
86 const bool dump_raw;
87 const std::string basename;
88 const uuid::UUIDv4 uuid;
89 Database &db;
90};
91
92} // namespace yarilo
93
94#endif // SNIFF_RECORDING
Definition database.h:14
Recordings utility class.
Definition recording.h:19
static std::unique_ptr< Tins::Packet > make_eth_packet(Tins::Packet *pkt)
Definition recording.cpp:148
std::optional< info > dump(std::shared_ptr< PacketChannel > channel) const
Definition recording.cpp:21
DataLinkType
data link of a saved recording
Definition recording.h:24
Recording(const std::filesystem::path &save_dir, bool dump_raw, Database &db, const std::string &display_name)
Definition recording.cpp:13
std::string UUIDv4
Definition uuid.h:11
Definition access_point.cpp:22
Information about a saved recording.
Definition recording.h:34
std::string filename
Definition recording.h:36
uuid::UUIDv4 uuid
Definition recording.h:35
DataLinkType datalink
Definition recording.h:38
std::string display_name
Definition recording.h:37
uint32_t count
Definition recording.h:39
uuid::UUIDv4 get_uuid() const
Definition recording.h:41