forked from pi-hole/FTL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
routines.h
114 lines (95 loc) · 3.48 KB
/
routines.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
/* Pi-hole: A black hole for Internet advertisements
* (c) 2017 Pi-hole, LLC (https://pi-hole.net)
* Network-wide ad blocking via your own hardware.
*
* FTL Engine
* Global prototypes
*
* This file is copyright under the latest version of the EUPL.
* Please see LICENSE file for your rights under this license. */
void go_daemon(void);
void timer_start(int i);
double timer_elapsed_msec(int i);
void sleepms(int milliseconds);
void savepid(void);
char * getUserName(void);
void removepid(void);
void open_FTL_log(bool test);
void logg(const char* format, ...);
void logg_struct_resize(const char* str, int to, int step);
void log_counter_info(void);
void format_memory_size(char *prefix, unsigned long int bytes, double *formated);
void log_FTL_version(void);
// datastructure.c
void gettimestamp(int *querytimestamp, int *overTimetimestamp);
void strtolower(char *str);
int findOverTimeID(int overTimetimestamp);
int findForwardID(const char * forward, bool count);
int findDomainID(const char *domain);
int findClientID(const char *client);
bool isValidIPv4(const char *addr);
bool isValidIPv6(const char *addr);
char *getDomainString(int queryID);
char *getClientIPString(int queryID);
void close_telnet_socket(void);
void close_unix_socket(void);
void seom(int sock);
void ssend(int sock, const char *format, ...);
void swrite(int sock, void *value, size_t size);
void *telnet_listening_thread_IPv4(void *args);
void *telnet_listening_thread_IPv6(void *args);
void *socket_listening_thread(void *args);
bool ipv6_available(void);
void bind_sockets(void);
void process_request(char *client_message, int *sock);
bool command(char *client_message, const char* cmd);
bool matchesEndpoint(char *client_message, const char *cmd);
// grep.c
int countlines(const char* fname);
int countlineswith(const char* str, const char* fname);
void check_blocking_status(void);
void check_setupVarsconf(void);
char * read_setupVarsconf(const char * key);
void getSetupVarsArray(char * input);
void clearSetupVarsArray(void);
bool insetupVarsArray(char * str);
bool getSetupVarsBool(char * input);
void parse_args(int argc, char* argv[]);
char* find_equals(const char* s);
// threads.c
void enable_thread_lock(void);
void disable_thread_lock(void);
void init_thread_lock(void);
// config.c
void getLogFilePath(void);
void read_FTLconf(void);
void get_privacy_level(FILE *fp);
void get_blocking_mode(FILE *fp);
// gc.c
void *GC_thread(void *val);
// database.c
void db_init(void);
void *DB_thread(void *val);
int get_number_of_queries_in_DB(void);
void save_to_DB(void);
void read_data_from_DB(void);
// memory.c
void memory_check(int which);
char *FTLstrdup(const char *src, const char *file, const char *function, int line);
void *FTLcalloc(size_t nmemb, size_t size, const char *file, const char *function, int line);
void *FTLrealloc(void *ptr_in, size_t size, const char *file, const char *function, int line);
void FTLfree(void *ptr, const char* file, const char *function, int line);
void validate_access(const char * name, int pos, bool testmagic, int line, const char * function, const char * file);
void validate_access_oTcl(int timeidx, int clientID, int line, const char * function, const char * file);
int main_dnsmasq(int argc, char **argv);
// signals.c
void handle_signals(void);
// resolve.c
void *DNSclient_thread(void *val);
void resolveClients(bool onlynew);
void resolveForwardDestinations(bool onlynew);
// regex.c
bool match_regex(char *input);
void free_regex(void);
void read_regex_from_file(void);
bool in_whitelist(char *domain);