bump version
[prads.git] / src / sys_func.h
blobdabd6afff7dff1f9979842c738166f832d5ea62b
1 #ifndef SYSFUNC_H
2 #define SYSFUNC_H
4 #define elog(fmt, ...) fprintf(stderr, ("[%s:%d(%s)] " fmt), __FILE__, __LINE__, __PRETTY_FUNCTION__, ##__VA_ARGS__);
5 #define olog(fmt, ...) do{ fprintf(stdout, (fmt), ##__VA_ARGS__); }while(0)
6 #ifdef DEBUG
7 #define dlog(fmt, ...) do { fprintf(stderr, ("[%s:%d(%s)] " fmt), __FILE__, __LINE__, __PRETTY_FUNCTION__, ##__VA_ARGS__);} while(0)
8 #define vlog(v, fmt, ...) do{ if(DEBUG == v) fprintf(stderr, ("[%s:%d(%s)] " fmt), __FILE__, __LINE__, __PRETTY_FUNCTION__, ##__VA_ARGS__); }while(0)
9 #else
10 #define dlog(fmt, ...) do { ; } while(0)
11 #define vlog(fmt, ...) do { ; } while(0)
12 #endif
14 #define SETFLAG(key,flags) do{ key |= (flags); }while(0)
15 #define RESETFLAG(key,flags) do { key &= ~(flags); }while(0)
16 size_t strlcpy(char *dst, const char *src, size_t size);
17 size_t strlcat(char *dst, const char *src, size_t len);
18 const char *u_ntop(const struct in6_addr ip_addr, int af, char *dest);
19 void bucket_keys_NULL();
20 int set_chroot(void);
21 int drop_privs(void);
22 int is_valid_path(const char *path);
23 int create_pid_file(const char *path, const char *filename);
24 void game_over();
25 void end_all_sessions();
26 void del_assets(int ctime);
27 int daemonize();
28 void set_end_sessions();
29 void end_sessions();
30 void check_interrupt();
31 void print_pcap_stats();
32 void print_prads_stats();
33 void unload_tcp_sigs();
34 uint8_t normalize_ttl (uint8_t ttl);
36 #endif