Yarilo v0.9.9
WPA2 Decrypter & Packet Analyzer
Loading...
Searching...
No Matches
main.cpp File Reference
#include "log_sink.h"
#include "service.h"
#include <absl/flags/flag.h>
#include <absl/flags/internal/flag.h>
#include <absl/flags/parse.h>
#include <absl/flags/usage.h>
#include <absl/strings/str_format.h>
#include <csignal>
#include <grpcpp/ext/proto_server_reflection_plugin.h>
#include <grpcpp/server_builder.h>
#include <memory>
#include <optional>
#include <spdlog/common.h>
#include <spdlog/sinks/stdout_color_sinks.h>
#include <spdlog/spdlog.h>
#include <tins/utils/routing_utils.h>

Functions

 ABSL_FLAG (std::optional< std::string >, sniff_file, std::nullopt, "Create a FileSniffer from this file on startup")
 
 ABSL_FLAG (std::optional< std::string >, iface, std::nullopt, "Create an InterfaceSniffer from this file on startup")
 
 ABSL_FLAG (std::string, host, "0.0.0.0", "Host for the gRPC server")
 
 ABSL_FLAG (uint32_t, port, 9090, "Port for the gRPC server")
 
 ABSL_FLAG (std::string, save_path, "/opt/yarilo/saves", "Directory to discover and save packet captures")
 
 ABSL_FLAG (std::string, db_file, "/opt/yarilo/db.sqlite3", "Path to the database file")
 
 ABSL_FLAG (std::string, oid_file, "/opt/yarilo/src/backend/data/oid.txt", "Path to the OIDs list for MAC vendor lookup")
 
 ABSL_FLAG (bool, save_on_shutdown, false, "Dump all packets on program termination")
 
 ABSL_FLAG (std::string, log_level, "info", "Log level (debug, info, trace)")
 
 ABSL_FLAG (std::vector< std::string >, ignore_bssids, {}, "Access point hardware addresses to ignore on startup")
 
 ABSL_FLAG (std::string, battery_file, "/tmp/battery_level", "Path to the battery percentage file (only with battery support enabled)")
 
bool set_log_level ()
 
std::optional< std::filesystem::path > init_saves (std::shared_ptr< spdlog::logger > log)
 
std::optional< std::filesystem::path > init_oid_file (std::shared_ptr< spdlog::logger > log)
 
std::optional< std::filesystem::path > init_battery_file (std::shared_ptr< spdlog::logger > log)
 
bool init_first_sniffer (std::shared_ptr< spdlog::logger > log)
 
void handle_signal (int sig)
 
void shutdown_check ()
 
int main (int argc, char *argv[])
 

Function Documentation

◆ ABSL_FLAG() [1/11]

ABSL_FLAG ( bool ,
save_on_shutdown ,
false ,
"Dump all packets on program termination"  )

◆ ABSL_FLAG() [2/11]

ABSL_FLAG ( std::optional< std::string > ,
iface ,
std::nullopt ,
"Create an InterfaceSniffer from this file on startup"  )

◆ ABSL_FLAG() [3/11]

ABSL_FLAG ( std::optional< std::string > ,
sniff_file ,
std::nullopt ,
"Create a FileSniffer from this file on startup"  )

◆ ABSL_FLAG() [4/11]

ABSL_FLAG ( std::string ,
battery_file ,
"/tmp/battery_level" ,
"Path to the battery percentage file (only with battery support enabled)"  )

◆ ABSL_FLAG() [5/11]

ABSL_FLAG ( std::string ,
db_file ,
"/opt/yarilo/db.sqlite3" ,
"Path to the database file"  )

◆ ABSL_FLAG() [6/11]

ABSL_FLAG ( std::string ,
host ,
"0.0.0.0" ,
"Host for the gRPC server"  )

◆ ABSL_FLAG() [7/11]

ABSL_FLAG ( std::string ,
log_level ,
"info" ,
"Log level (debug, info, trace)"  )

◆ ABSL_FLAG() [8/11]

ABSL_FLAG ( std::string ,
oid_file ,
"/opt/yarilo/src/backend/data/oid.txt" ,
"Path to the OIDs list for MAC vendor lookup"  )

◆ ABSL_FLAG() [9/11]

ABSL_FLAG ( std::string ,
save_path ,
"/opt/yarilo/saves" ,
"Directory to discover and save packet captures"  )

◆ ABSL_FLAG() [10/11]

ABSL_FLAG ( std::vector< std::string > ,
ignore_bssids ,
{} ,
"Access point hardware addresses to ignore on startup"  )

◆ ABSL_FLAG() [11/11]

ABSL_FLAG ( uint32_t ,
port ,
9090 ,
"Port for the gRPC server"  )

◆ handle_signal()

void handle_signal ( int sig)

◆ init_battery_file()

std::optional< std::filesystem::path > init_battery_file ( std::shared_ptr< spdlog::logger > log)

◆ init_first_sniffer()

bool init_first_sniffer ( std::shared_ptr< spdlog::logger > log)

◆ init_oid_file()

std::optional< std::filesystem::path > init_oid_file ( std::shared_ptr< spdlog::logger > log)

◆ init_saves()

std::optional< std::filesystem::path > init_saves ( std::shared_ptr< spdlog::logger > log)

◆ main()

int main ( int argc,
char * argv[] )

◆ set_log_level()

bool set_log_level ( )

◆ shutdown_check()

void shutdown_check ( )