mirror of
https://github.com/bol-van/zapret.git
synced 2025-05-24 22:32:58 +03:00
function without args () -> (void)
This commit is contained in:
@@ -884,7 +884,7 @@ static void rawsend_clean_sock(int *sock)
|
||||
*sock=-1;
|
||||
}
|
||||
}
|
||||
void rawsend_cleanup()
|
||||
void rawsend_cleanup(void)
|
||||
{
|
||||
rawsend_clean_sock(&rawsend_sock4);
|
||||
rawsend_clean_sock(&rawsend_sock6);
|
||||
|
@@ -125,7 +125,7 @@ bool rawsend(const struct sockaddr* dst,uint32_t fwmark,const char *ifout,const
|
||||
// should pre-do it if dropping privileges. otherwise its not necessary
|
||||
bool rawsend_preinit(bool bind_fix4, bool bind_fix6);
|
||||
// cleans up socket autocreated by rawsend
|
||||
void rawsend_cleanup();
|
||||
void rawsend_cleanup(void);
|
||||
|
||||
const char *proto_name(uint8_t proto);
|
||||
uint16_t family_from_proto(uint8_t l3proto);
|
||||
|
@@ -55,7 +55,7 @@ const uint8_t fake_tls_clienthello_default[517] = {
|
||||
|
||||
static uint8_t zeropkt[DPI_DESYNC_MAX_FAKE_LEN];
|
||||
|
||||
void desync_init()
|
||||
void desync_init(void)
|
||||
{
|
||||
memset(zeropkt, 0, sizeof(zeropkt));
|
||||
}
|
||||
|
@@ -49,6 +49,6 @@ bool desync_valid_second_stage(enum dpi_desync_mode mode);
|
||||
bool desync_valid_second_stage_tcp(enum dpi_desync_mode mode);
|
||||
bool desync_valid_second_stage_udp(enum dpi_desync_mode mode);
|
||||
|
||||
void desync_init();
|
||||
void desync_init(void);
|
||||
packet_process_result dpi_desync_tcp_packet(uint32_t fwmark, const char *ifout, uint8_t *data_pkt, size_t len_pkt, struct ip *ip, struct ip6_hdr *ip6hdr, struct tcphdr *tcphdr, size_t len_tcp, uint8_t *data_payload, size_t len_payload);
|
||||
packet_process_result dpi_desync_udp_packet(uint32_t fwmark, const char *ifout, uint8_t *data_pkt, size_t len_pkt, struct ip *ip, struct ip6_hdr *ip6hdr, struct udphdr *udphdr, uint8_t *data_payload, size_t len_payload);
|
||||
|
12
nfq/nfqws.c
12
nfq/nfqws.c
@@ -53,7 +53,7 @@ static void onhup(int sig)
|
||||
bHup = true;
|
||||
}
|
||||
// should be called in normal execution
|
||||
static void dohup()
|
||||
static void dohup(void)
|
||||
{
|
||||
if (bHup)
|
||||
{
|
||||
@@ -223,7 +223,7 @@ static int nfq_cb(struct nfq_q_handle *qh, struct nfgenmsg *nfmsg, struct nfq_da
|
||||
DLOG("packet: id=%d pass unmodified\n", id);
|
||||
return nfq_set_verdict2(qh, id, NF_ACCEPT, mark, 0, NULL);
|
||||
}
|
||||
static int nfq_main()
|
||||
static int nfq_main(void)
|
||||
{
|
||||
struct nfq_handle *h = NULL;
|
||||
struct nfq_q_handle *qh = NULL;
|
||||
@@ -328,7 +328,7 @@ exiterr:
|
||||
|
||||
#elif defined(BSD)
|
||||
|
||||
static int dvt_main()
|
||||
static int dvt_main(void)
|
||||
{
|
||||
uint8_t buf[16384] __attribute__((aligned));
|
||||
struct sockaddr_storage sa_from;
|
||||
@@ -497,7 +497,7 @@ static bool parse_ws_scale_factor(char *s, uint16_t *wsize, uint8_t *wscale)
|
||||
}
|
||||
|
||||
|
||||
static void exithelp()
|
||||
static void exithelp(void)
|
||||
{
|
||||
printf(
|
||||
" --debug=0|1\n"
|
||||
@@ -567,7 +567,7 @@ static void exithelp()
|
||||
exit(1);
|
||||
}
|
||||
|
||||
static void cleanup_params()
|
||||
static void cleanup_params(void)
|
||||
{
|
||||
ConntrackPoolDestroy(¶ms.conntrack);
|
||||
|
||||
@@ -584,7 +584,7 @@ static void cleanup_params()
|
||||
params.hostlist = NULL;
|
||||
}
|
||||
}
|
||||
static void exithelp_clean()
|
||||
static void exithelp_clean(void)
|
||||
{
|
||||
cleanup_params();
|
||||
exithelp();
|
||||
|
16
nfq/sec.c
16
nfq/sec.c
@@ -152,7 +152,7 @@ static void set_filter(struct sock_filter *filter, __u16 code, __u8 jt, __u8 jf,
|
||||
filter->k = k;
|
||||
}
|
||||
// deny all blocked syscalls
|
||||
static bool set_seccomp()
|
||||
static bool set_seccomp(void)
|
||||
{
|
||||
#ifdef __X32_SYSCALL_BIT
|
||||
#define SECCOMP_PROG_SIZE (6 + BLOCKED_SYSCALL_COUNT)
|
||||
@@ -190,7 +190,7 @@ static bool set_seccomp()
|
||||
return prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, &prog) >= 0;
|
||||
}
|
||||
|
||||
bool sec_harden()
|
||||
bool sec_harden(void)
|
||||
{
|
||||
if (prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0))
|
||||
{
|
||||
@@ -234,7 +234,7 @@ bool setpcap(uint64_t caps)
|
||||
|
||||
return !capset(&ch,cd);
|
||||
}
|
||||
int getmaxcap()
|
||||
int getmaxcap(void)
|
||||
{
|
||||
int maxcap = CAP_LAST_CAP;
|
||||
FILE *F = fopen("/proc/sys/kernel/cap_last_cap", "r");
|
||||
@@ -246,7 +246,7 @@ int getmaxcap()
|
||||
return maxcap;
|
||||
|
||||
}
|
||||
bool dropcaps()
|
||||
bool dropcaps(void)
|
||||
{
|
||||
uint64_t caps = (1<<CAP_NET_ADMIN)|(1<<CAP_NET_RAW);
|
||||
int maxcap = getmaxcap();
|
||||
@@ -272,7 +272,7 @@ bool dropcaps()
|
||||
}
|
||||
#else // __linux__
|
||||
|
||||
bool sec_harden()
|
||||
bool sec_harden(void)
|
||||
{
|
||||
// noop
|
||||
return true;
|
||||
@@ -282,7 +282,7 @@ bool sec_harden()
|
||||
|
||||
|
||||
|
||||
bool can_drop_root()
|
||||
bool can_drop_root(void)
|
||||
{
|
||||
#ifdef __linux__
|
||||
// has some caps
|
||||
@@ -325,7 +325,7 @@ bool droproot(uid_t uid, gid_t gid)
|
||||
#endif
|
||||
}
|
||||
|
||||
void print_id()
|
||||
void print_id(void)
|
||||
{
|
||||
int i,N;
|
||||
gid_t g[128];
|
||||
@@ -341,7 +341,7 @@ void print_id()
|
||||
printf("%u\n",getgid());
|
||||
}
|
||||
|
||||
void daemonize()
|
||||
void daemonize(void)
|
||||
{
|
||||
int pid;
|
||||
|
||||
|
12
nfq/sec.h
12
nfq/sec.h
@@ -11,8 +11,8 @@
|
||||
|
||||
bool checkpcap(uint64_t caps);
|
||||
bool setpcap(uint64_t caps);
|
||||
int getmaxcap();
|
||||
bool dropcaps();
|
||||
int getmaxcap(void);
|
||||
bool dropcaps(void);
|
||||
|
||||
#define syscall_nr (offsetof(struct seccomp_data, nr))
|
||||
#define arch_nr (offsetof(struct seccomp_data, arch))
|
||||
@@ -52,9 +52,9 @@ bool dropcaps();
|
||||
|
||||
#endif
|
||||
|
||||
bool sec_harden();
|
||||
bool can_drop_root();
|
||||
bool sec_harden(void);
|
||||
bool can_drop_root(void);
|
||||
bool droproot(uid_t uid, gid_t gid);
|
||||
void print_id();
|
||||
void daemonize();
|
||||
void print_id(void);
|
||||
void daemonize(void);
|
||||
bool writepid(const char *filename);
|
||||
|
Reference in New Issue
Block a user