mirror of
https://github.com/bol-van/zapret.git
synced 2024-12-02 14:40:52 +03:00
Compare commits
No commits in common. "0098926ca429d6d95f740958e1b80ed04d7cfe01" and "42422f479c704fa21127b0696d20267996ab5341" have entirely different histories.
0098926ca4
...
42422f479c
Binary file not shown.
Binary file not shown.
33
nfq/nfqws.c
33
nfq/nfqws.c
@ -759,13 +759,6 @@ static bool wf_make_filter(
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static unsigned int hash_jen(const void *data,unsigned int len)
|
|
||||||
{
|
|
||||||
unsigned int hash;
|
|
||||||
HASH_JEN(data,len,hash);
|
|
||||||
return hash;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@ -908,7 +901,6 @@ int main(int argc, char **argv)
|
|||||||
char windivert_filter[8192], wf_pf_tcp_src[256], wf_pf_tcp_dst[256], wf_pf_udp_src[256], wf_pf_udp_dst[256], wf_save_file[256];
|
char windivert_filter[8192], wf_pf_tcp_src[256], wf_pf_tcp_dst[256], wf_pf_udp_src[256], wf_pf_udp_dst[256], wf_save_file[256];
|
||||||
bool wf_ipv4=true, wf_ipv6=true;
|
bool wf_ipv4=true, wf_ipv6=true;
|
||||||
unsigned int IfIdx=0, SubIfIdx=0;
|
unsigned int IfIdx=0, SubIfIdx=0;
|
||||||
unsigned int hash_wf_tcp=0,hash_wf_udp=0,hash_wf_raw=0,hash_ssid_filter=0;
|
|
||||||
*windivert_filter = *wf_pf_tcp_src = *wf_pf_tcp_dst = *wf_pf_udp_src = *wf_pf_udp_dst = *wf_save_file = 0;
|
*windivert_filter = *wf_pf_tcp_src = *wf_pf_tcp_dst = *wf_pf_udp_src = *wf_pf_udp_dst = *wf_save_file = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1510,7 +1502,6 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 52: /* wf-tcp */
|
case 52: /* wf-tcp */
|
||||||
hash_wf_tcp=hash_jen(optarg,strlen(optarg));
|
|
||||||
if (!wf_make_pf(optarg,"tcp","SrcPort",wf_pf_tcp_src,sizeof(wf_pf_tcp_src)) ||
|
if (!wf_make_pf(optarg,"tcp","SrcPort",wf_pf_tcp_src,sizeof(wf_pf_tcp_src)) ||
|
||||||
!wf_make_pf(optarg,"tcp","DstPort",wf_pf_tcp_dst,sizeof(wf_pf_tcp_dst)))
|
!wf_make_pf(optarg,"tcp","DstPort",wf_pf_tcp_dst,sizeof(wf_pf_tcp_dst)))
|
||||||
{
|
{
|
||||||
@ -1519,7 +1510,6 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 53: /* wf-udp */
|
case 53: /* wf-udp */
|
||||||
hash_wf_udp=hash_jen(optarg,strlen(optarg));
|
|
||||||
if (!wf_make_pf(optarg,"udp","SrcPort",wf_pf_udp_src,sizeof(wf_pf_udp_src)) ||
|
if (!wf_make_pf(optarg,"udp","SrcPort",wf_pf_udp_src,sizeof(wf_pf_udp_src)) ||
|
||||||
!wf_make_pf(optarg,"udp","DstPort",wf_pf_udp_dst,sizeof(wf_pf_udp_dst)))
|
!wf_make_pf(optarg,"udp","DstPort",wf_pf_udp_dst,sizeof(wf_pf_udp_dst)))
|
||||||
{
|
{
|
||||||
@ -1528,7 +1518,6 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 54: /* wf-raw */
|
case 54: /* wf-raw */
|
||||||
hash_wf_raw=hash_jen(optarg,strlen(optarg));
|
|
||||||
if (optarg[0]=='@')
|
if (optarg[0]=='@')
|
||||||
{
|
{
|
||||||
size_t sz = sizeof(windivert_filter)-1;
|
size_t sz = sizeof(windivert_filter)-1;
|
||||||
@ -1546,7 +1535,6 @@ int main(int argc, char **argv)
|
|||||||
wf_save_file[sizeof(wf_save_file) - 1] = '\0';
|
wf_save_file[sizeof(wf_save_file) - 1] = '\0';
|
||||||
break;
|
break;
|
||||||
case 56: /* ssid-filter */
|
case 56: /* ssid-filter */
|
||||||
hash_ssid_filter=hash_jen(optarg,strlen(optarg));
|
|
||||||
{
|
{
|
||||||
char *e,*p = optarg;
|
char *e,*p = optarg;
|
||||||
while (p)
|
while (p)
|
||||||
@ -1608,20 +1596,6 @@ int main(int argc, char **argv)
|
|||||||
exit_clean(1);
|
exit_clean(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
HANDLE hMutexArg;
|
|
||||||
{
|
|
||||||
char mutex_name[128];
|
|
||||||
snprintf(mutex_name,sizeof(mutex_name),"Global\\winws_arg_%u_%u_%u_%u_%u_%u_%u_%u",hash_wf_tcp,hash_wf_udp,hash_wf_raw,hash_ssid_filter,IfIdx,SubIfIdx,wf_ipv4,wf_ipv6);
|
|
||||||
|
|
||||||
hMutexArg = CreateMutexA(NULL,TRUE,mutex_name);
|
|
||||||
if (hMutexArg && GetLastError()==ERROR_ALREADY_EXISTS)
|
|
||||||
{
|
|
||||||
CloseHandle(hMutexArg); hMutexArg = NULL;
|
|
||||||
printf("A copy of winws is already running with the same filter\n");
|
|
||||||
goto exiterr;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// not specified - use desync_ttl value instead
|
// not specified - use desync_ttl value instead
|
||||||
@ -1670,13 +1644,6 @@ int main(int argc, char **argv)
|
|||||||
ex:
|
ex:
|
||||||
rawsend_cleanup();
|
rawsend_cleanup();
|
||||||
cleanup_params();
|
cleanup_params();
|
||||||
#ifdef __CYGWIN__
|
|
||||||
if (hMutexArg)
|
|
||||||
{
|
|
||||||
ReleaseMutex(hMutexArg);
|
|
||||||
CloseHandle(hMutexArg);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
return result;
|
return result;
|
||||||
exiterr:
|
exiterr:
|
||||||
result = 1;
|
result = 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user