#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include <cstdio>
#include <event.h>
#include <time.h>
#include <list>
Go to the source code of this file.
Classes | |
struct | config_entry |
struct | buf_el |
Buffer used to store information to send. More... | |
struct | t_uid |
Main structure used to identify user or destination. More... | |
struct | t_traffic |
information about user / destination traffic More... | |
struct | client_s |
Structure to store network information. More... | |
class | proxy_server |
Information about local proxy server. More... | |
struct | thread_s |
Thread structure. More... | |
Defines | |
#define | MAX_CLIENT_RECV 4024 |
#define | MAX_SERVER_RECV 4024 |
#define | RECV_THREAD_AMOUNT 1024 |
#define | debug(...) ; |
#define | log_error(...) fprintf(stderr, __VA_ARGS__ ) |
#define | t_int int |
#define | t_traffic_int long long |
#define | QUARTER 900 |
#define | HOUR 3600 |
#define | DAY 86400 |
#define | MONTH 2592000 |
Typedefs | |
typedef client_s | client_t |
Enumerations | |
enum | AUTH_STATE { AUTH_STATE_UNKNOWN = 0, AUTH_STATE_BANNED = 1, AUTH_STATE_IGNORE_BANNED = 2 } |
enum | CONFIG_ENTRY_CHECK_MODE { CHECK_TRAFFIC = 1, CHECK_HOSTING = 2, CHECK_BOTH = 3 } |
enum | conn_state { opened, closed } |
Variables | |
int | curr_month |
struct event_base * | thread_loops [RECV_THREAD_AMOUNT] |
pthread_t | thread_ids [RECV_THREAD_AMOUNT] |
int | thread_usage [RECV_THREAD_AMOUNT] |
pthread_mutex_t | thread_usage_guard |
pthread_mutex_t | mutex_queue [RECV_THREAD_AMOUNT] |
int | pipe_queue [RECV_THREAD_AMOUNT][2] |
int | last_thread |
pthread_mutex_t | master_server_connecting |
bool | master_server_connected |
client_t * | master_server_cli |
const char * | NOTIFY |
std::list< client_t * > | queue [RECV_THREAD_AMOUNT] |
pthread_mutex_t | master_guard |
#define DAY 86400 |
number of seconds in day
#define debug | ( | ... | ) | ; |
Special macro to print information to stderr when in debugging mode
#define HOUR 3600 |
number of seconds in hour
#define log_error | ( | ... | ) | fprintf(stderr, __VA_ARGS__ ) |
#define MAX_CLIENT_RECV 4024 |
Size of local server buffer
#define MAX_SERVER_RECV 4024 |
Size of main server buffer
#define MONTH 2592000 |
number of seconds in month
#define QUARTER 900 |
number of seconds in 15min
#define RECV_THREAD_AMOUNT 1024 |
Number of worker threads
#define t_int int |
#define t_traffic_int long long |
type of traffic information
enum AUTH_STATE |
enum conn_state |
int curr_month |
Variable identifying current month (1-12)
int last_thread |
next thread to use (round-robin)
pthread_mutex_t master_guard |
pthread_mutex_t master_server_connecting |
pthread_mutex_t mutex_queue[RECV_THREAD_AMOUNT] |
const char* NOTIFY |
int pipe_queue[RECV_THREAD_AMOUNT][2] |
pthread_t thread_ids[RECV_THREAD_AMOUNT] |
worker threads
struct event_base* thread_loops[RECV_THREAD_AMOUNT] |
int thread_usage[RECV_THREAD_AMOUNT] |
pthread_mutex_t thread_usage_guard |