inLimbo
TUI Music Player that keeps you in Limbo.
 
Loading...
Searching...
No Matches
server.cpp File Reference
#include "../parser/toml_parser.hpp"
#include "protocols.h"

Functions

std::string sha256 (const std::string &str)
 
SSL_CTX * initialize_ssl ()
 
bool authenticate_client (SSL *ssl, const std::string &client_ip)
 
std::string list_files ()
 
void send_file (SSL *ssl, const std::string &file_name)
 
std::string sanitize_path (const std::string &file_name)
 
void handle_client (SSL *ssl, const std::string &client_ip)
 
int main ()
 

Variables

std::string DIRECTORY = std::string(parseTOMLField(PARENT_LIB, PARENT_LIB_FIELD_DIR))
 
const std::string USERNAME = std::string(parseTOMLField(PARENT_FTP, PARENT_FTP_FIELD_USER))
 
const std::string SALT = std::string(parseTOMLField(PARENT_FTP, PARENT_FTP_FIELD_SALT))
 
const std::string PASSWORD_HASH
 
std::unordered_map< std::string, int > auth_attempts
 

Function Documentation

◆ authenticate_client()

bool authenticate_client ( SSL * ssl,
const std::string & client_ip )

◆ handle_client()

void handle_client ( SSL * ssl,
const std::string & client_ip )

◆ initialize_ssl()

SSL_CTX * initialize_ssl ( )

◆ list_files()

std::string list_files ( )

◆ main()

int main ( )

◆ sanitize_path()

std::string sanitize_path ( const std::string & file_name)

◆ send_file()

void send_file ( SSL * ssl,
const std::string & file_name )

◆ sha256()

std::string sha256 ( const std::string & str)

Variable Documentation

◆ auth_attempts

std::unordered_map<std::string, int> auth_attempts

◆ DIRECTORY

std::string DIRECTORY = std::string(parseTOMLField(PARENT_LIB, PARENT_LIB_FIELD_DIR))

◆ PASSWORD_HASH

const std::string PASSWORD_HASH
Initial value:
=
string_view parseTOMLField(string parent, string field)
Parses a string field from the TOML configuration.
Definition toml_parser.hpp:121
#define PARENT_FTP
Definition toml_parser.hpp:21
#define PARENT_FTP_FIELD_PWD_HASH
Definition toml_parser.hpp:24

◆ SALT

const std::string SALT = std::string(parseTOMLField(PARENT_FTP, PARENT_FTP_FIELD_SALT))

◆ USERNAME

const std::string USERNAME = std::string(parseTOMLField(PARENT_FTP, PARENT_FTP_FIELD_USER))