25 PTHREAD_MUTEX_INITIALIZER
49 PTHREAD_MUTEX_INITIALIZER
59 if (strcmp(getenv(
"USER"),
"root") == 0)
void log_message(log_level level, const char *filename, const char *source_file, const char *format,...)
Log a message used to log a message to the console or a file.
bool set_peer_discovery_daemon(bool value)
Set the peer discovery daemon state.
bool get_peer_discovery()
Get the peer discovery operation.
bool set_peer_discovery_hardcoded_seeds(bool value)
Set the peer discovery hardcoded seeds state.
bool get_peer_discovery_in_progress()
Get the peer discovery in progress state.
bool set_peer_discovery_dns_lookup(bool value)
Set the peer discovery DNS lookup state.
bool set_peer_discovery_dns_domain(const char *domain)
Set the peer discovery DNS domain.
void destroy_program_state()
Destroy the program state.
int get_elapsed_time()
Get the elapsed time since the program started.
bool get_peer_discovery_hardcoded_seeds()
Get the peer discovery hardcoded seeds state.
void print_program_state()
Print the program state.
void destroy_program_operation()
Clear all program operations.
program_state state
The program state structure used to store the state of the program.
void set_exit_flag(volatile sig_atomic_t flag)
Set the exit flag.
bool get_peer_discovery_succeeded()
Get the peer discovery succeeded state.
void start_peer_discovery_progress()
Start the peer discovery progress.
int get_pid()
Get the program PID.
void mark_started_with_parameters()
Mark the program as started with parameters.
int init_program_operation()
Initialize the program operation.
program_operation operation
The program operation structure used to store the operation of the program.
bool set_peer_discovery(bool value)
Set the peer discovery operation.
bool get_peer_discovery_daemon()
Get the peer discovery daemon state.
const char * get_peer_discovery_dns_domain()
Get the peer discovery DNS domain.
sig_atomic_t get_exit_flag()
Get the exit flag.
void init_program_state()
Initialize the program state.
void finish_peer_discovery_progress(bool succeeded)
Finish the peer discovery progress.
bool force_stop_peer_discovery()
Force stop the peer discovery operation.
time_t get_start_time()
Get the program start time.
bool get_peer_discovery_dns_lookup()
Get the peer discovery DNS lookup state.
#define PEER_DISCOVERY_DEFAULT_DAEMON
#define PEER_DISCOVERY_DEFAULT_HARDCODED_SEEDS
The program operation structure used to store the operation of the program.
bool peer_discovery_succeeded
bool peer_discovery_in_progress
char * peer_discovery_dns_domain
bool peer_discovery_daemon
bool peer_discovery_dns_lookup
bool peer_discovery_hardcoded_seeds
pthread_mutex_t operation_mutex
The program state structure used to store the state of the program.
volatile sig_atomic_t exit_flag
pthread_mutex_t exit_flag_mutex
bool started_with_parameters
void guarded_print_line(const char *format,...)
Guarded print line function.