inLimbo
TUI Music Player that keeps you in Limbo.
 
Loading...
Searching...
No Matches
protocols.h File Reference
#include <arpa/inet.h>
#include <chrono>
#include <cstdlib>
#include <cstring>
#include <filesystem>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <openssl/err.h>
#include <openssl/sha.h>
#include <openssl/ssl.h>
#include <random>
#include <sstream>
#include <string>
#include <thread>
#include <unistd.h>
#include <unordered_map>

Go to the source code of this file.

Macros

#define AUTH_REQUEST   "AUTH"
 
#define STATUS_AUTH_FAILED   430
 
#define STATUS_AUTH_SUCCESS   230
 
#define LIST_REQUEST   "LIST"
 
#define GET_REQUEST   "GET"
 
#define STATUS_MISSING_FILE_NAME   400
 
#define STATUS_LISTING_FILES   150
 
#define STATUS_FILE_TRANSFER   160
 
#define STATUS_TRANSFER_COMPLETE   226
 
#define STATUS_CHECKSUM_VERIFY   151
 
#define STATUS_FILE_NOT_FOUND   550
 
#define STATUS_UNKNOWN_COMMAND   500
 
#define QUIT_REQUEST   "QUIT"
 
#define STATUS_GOODBYE   221
 
#define PORT   12345
 
#define BUFFER_SIZE   1024
 
#define MAX_ATTEMPTS   3
 
#define ATTEMPT_DELAY   2000
 
#define SERVER_CERT   "server_cert.pem"
 
#define SERVER_KEY   "server_key.pem"
 
#define SERVER_IP   "127.0.0.1"
 
#define CA_CERT   "server_cert.pem"
 

Functions

const char * get_error_message (int status_code)
 
void send_protocol_message (SSL *ssl, int status_code)
 

Macro Definition Documentation

◆ ATTEMPT_DELAY

#define ATTEMPT_DELAY   2000

◆ AUTH_REQUEST

#define AUTH_REQUEST   "AUTH"

◆ BUFFER_SIZE

#define BUFFER_SIZE   1024

◆ CA_CERT

#define CA_CERT   "server_cert.pem"

◆ GET_REQUEST

#define GET_REQUEST   "GET"

◆ LIST_REQUEST

#define LIST_REQUEST   "LIST"

◆ MAX_ATTEMPTS

#define MAX_ATTEMPTS   3

◆ PORT

#define PORT   12345

◆ QUIT_REQUEST

#define QUIT_REQUEST   "QUIT"

◆ SERVER_CERT

#define SERVER_CERT   "server_cert.pem"

◆ SERVER_IP

#define SERVER_IP   "127.0.0.1"

◆ SERVER_KEY

#define SERVER_KEY   "server_key.pem"

◆ STATUS_AUTH_FAILED

#define STATUS_AUTH_FAILED   430

◆ STATUS_AUTH_SUCCESS

#define STATUS_AUTH_SUCCESS   230

◆ STATUS_CHECKSUM_VERIFY

#define STATUS_CHECKSUM_VERIFY   151

◆ STATUS_FILE_NOT_FOUND

#define STATUS_FILE_NOT_FOUND   550

◆ STATUS_FILE_TRANSFER

#define STATUS_FILE_TRANSFER   160

◆ STATUS_GOODBYE

#define STATUS_GOODBYE   221

◆ STATUS_LISTING_FILES

#define STATUS_LISTING_FILES   150

◆ STATUS_MISSING_FILE_NAME

#define STATUS_MISSING_FILE_NAME   400

◆ STATUS_TRANSFER_COMPLETE

#define STATUS_TRANSFER_COMPLETE   226

◆ STATUS_UNKNOWN_COMMAND

#define STATUS_UNKNOWN_COMMAND   500

Function Documentation

◆ get_error_message()

const char * get_error_message ( int status_code)

◆ send_protocol_message()

void send_protocol_message ( SSL * ssl,
int status_code )