mirror of
https://github.com/emanuele-f/PCAPdroid.git
synced 2026-06-14 21:00:37 +08:00
parent
86b4c505e3
commit
85c2fda5db
@ -161,11 +161,10 @@ static int connectPcapd(pcapdroid_t *pd) {
|
||||
log_d("BPF filter is in use");
|
||||
}
|
||||
|
||||
#ifdef ANDROID
|
||||
if(pd->pcap_file_capture) {
|
||||
// must be a file path
|
||||
if(access(pd->pcap.capture_interface, F_OK)) {
|
||||
log_f("The specified PCAP file does not exist");
|
||||
log_f("The specified PCAP file does not exist: %s", pd->pcap.capture_interface);
|
||||
goto cleanup;
|
||||
}
|
||||
} else {
|
||||
@ -175,7 +174,6 @@ static int connectPcapd(pcapdroid_t *pd) {
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// Start the daemon
|
||||
char args[256];
|
||||
|
||||
@ -23,6 +23,8 @@
|
||||
#include <stdint.h>
|
||||
#include <net/if.h>
|
||||
#include <pcap.h>
|
||||
#include <linux/limits.h>
|
||||
|
||||
#include "nl_utils.h"
|
||||
#include "common/uid_lru.h"
|
||||
#include "common/uid_resolver.h"
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
project(tests)
|
||||
cmake_minimum_required(VERSION 3.18.1)
|
||||
project(tests)
|
||||
|
||||
option(FUZZING "Build for Fuzz Testing" OFF)
|
||||
|
||||
|
||||
@ -26,9 +26,9 @@ add_test(NAME blacklist_match COMMAND ./blacklist match)
|
||||
add_test(NAME blacklist_detection COMMAND ./blacklist detection)
|
||||
|
||||
test_source(dump_api)
|
||||
#~ add_test(NAME dump_api_snaplen COMMAND ./dump_api snaplen)
|
||||
add_test(NAME dump_api_snaplen COMMAND ./dump_api snaplen)
|
||||
add_test(NAME dump_api_max_pkts_flow COMMAND ./dump_api max_pkts_per_flow)
|
||||
#~ add_test(NAME dump_api_max_size COMMAND ./dump_api max_dump_size)
|
||||
add_test(NAME dump_api_max_size COMMAND ./dump_api max_dump_size)
|
||||
|
||||
#~ test_source(root_capture)
|
||||
#~ add_test(NAME root_capture COMMAND ./root_capture invalid_pkts)
|
||||
test_source(root_capture)
|
||||
add_test(NAME root_capture COMMAND ./root_capture invalid_pkts)
|
||||
|
||||
@ -91,7 +91,7 @@ static void max_pkts_per_flow() {
|
||||
src_ip = pkt.tuple.src_ip;
|
||||
dst_ip = pkt.tuple.dst_ip;
|
||||
|
||||
remote_ip = (zdtun_cmp_ip(4, &pkt.tuple.src_ip, &local_ip) == 0) ?
|
||||
remote_ip = (zdtun_cmp_ip(4, &src_ip, &local_ip) == 0) ?
|
||||
&dst_ip : &src_ip;
|
||||
|
||||
#if 0
|
||||
|
||||
@ -86,6 +86,7 @@ pcapdroid_t* pd_init_test(const char *ifname) {
|
||||
assert(pd != NULL);
|
||||
|
||||
pd->vpn_capture = false;
|
||||
pd->pcap_file_capture = true;
|
||||
pd->pcap.capture_interface = (char*) ifname;
|
||||
pd->pcap.as_root = false; // don't run as root
|
||||
pd->app_filter = -1; // don't filter
|
||||
|
||||
Loading…
Reference in New Issue
Block a user