+17
-1
@@ -172,6 +172,7 @@ struct ndpi_packet_trailer {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static pcap_dumper_t *extcap_dumper = NULL;
|
static pcap_dumper_t *extcap_dumper = NULL;
|
||||||
|
static pcap_t *extcap_fifo_h = NULL;
|
||||||
static char extcap_buf[16384];
|
static char extcap_buf[16384];
|
||||||
static char *extcap_capture_fifo = NULL;
|
static char *extcap_capture_fifo = NULL;
|
||||||
static u_int16_t extcap_packet_filter = (u_int16_t)-1;
|
static u_int16_t extcap_packet_filter = (u_int16_t)-1;
|
||||||
@@ -559,7 +560,16 @@ void extcap_capture() {
|
|||||||
if(trace) fprintf(trace, " #### %s #### \n", __FUNCTION__);
|
if(trace) fprintf(trace, " #### %s #### \n", __FUNCTION__);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if((extcap_dumper = pcap_dump_open(pcap_open_dead(DLT_EN10MB, 16384 /* MTU */),
|
if((extcap_fifo_h = pcap_open_dead(DLT_EN10MB, 16384 /* MTU */)) == NULL) {
|
||||||
|
fprintf(stderr, "Error pcap_open_dead");
|
||||||
|
|
||||||
|
#ifdef DEBUG_TRACE
|
||||||
|
if(trace) fprintf(trace, "Error pcap_open_dead\n");
|
||||||
|
#endif
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if((extcap_dumper = pcap_dump_open(extcap_fifo_h,
|
||||||
extcap_capture_fifo)) == NULL) {
|
extcap_capture_fifo)) == NULL) {
|
||||||
fprintf(stderr, "Unable to open the pcap dumper on %s", extcap_capture_fifo);
|
fprintf(stderr, "Unable to open the pcap dumper on %s", extcap_capture_fifo);
|
||||||
|
|
||||||
@@ -840,6 +850,11 @@ static void parseOptions(int argc, char **argv) {
|
|||||||
printCSVHeader();
|
printCSVHeader();
|
||||||
|
|
||||||
#ifndef USE_DPDK
|
#ifndef USE_DPDK
|
||||||
|
if(do_capture) {
|
||||||
|
quiet_mode = 1;
|
||||||
|
extcap_capture();
|
||||||
|
}
|
||||||
|
|
||||||
if(strchr(_pcap_file[0], ',')) { /* multiple ingress interfaces */
|
if(strchr(_pcap_file[0], ',')) { /* multiple ingress interfaces */
|
||||||
num_threads = 0; /* setting number of threads = number of interfaces */
|
num_threads = 0; /* setting number of threads = number of interfaces */
|
||||||
__pcap_file = strtok(_pcap_file[0], ",");
|
__pcap_file = strtok(_pcap_file[0], ",");
|
||||||
@@ -3507,6 +3522,7 @@ int orginal_main(int argc, char **argv) {
|
|||||||
if(results_path) free(results_path);
|
if(results_path) free(results_path);
|
||||||
if(results_file) fclose(results_file);
|
if(results_file) fclose(results_file);
|
||||||
if(extcap_dumper) pcap_dump_close(extcap_dumper);
|
if(extcap_dumper) pcap_dump_close(extcap_dumper);
|
||||||
|
if(extcap_fifo_h) pcap_close(extcap_fifo_h);
|
||||||
if(ndpi_info_mod) ndpi_exit_detection_module(ndpi_info_mod);
|
if(ndpi_info_mod) ndpi_exit_detection_module(ndpi_info_mod);
|
||||||
if(csv_fp) fclose(csv_fp);
|
if(csv_fp) fclose(csv_fp);
|
||||||
|
|
||||||
|
|||||||
+5
-3
@@ -895,10 +895,12 @@ function ndpi_proto.dissector(tvb, pinfo, tree)
|
|||||||
-- The trick below avoids to process the packet twice
|
-- The trick below avoids to process the packet twice
|
||||||
|
|
||||||
if(pinfo.visited == true) then
|
if(pinfo.visited == true) then
|
||||||
local eth_trailer = f_eth_trailer()
|
local eth_trailer = {f_eth_trailer()}
|
||||||
|
|
||||||
if(eth_trailer ~= nil) then
|
-- Depending on Wireshark configuration, there may be multiple ethernet trailer fields.
|
||||||
local eth_trailer = getval(eth_trailer)
|
-- Ours should be the last one, anyway
|
||||||
|
if(eth_trailer[#eth_trailer] ~= nil) then
|
||||||
|
local eth_trailer = getval(eth_trailer[#eth_trailer])
|
||||||
local magic = string.sub(eth_trailer, 1, 11)
|
local magic = string.sub(eth_trailer, 1, 11)
|
||||||
|
|
||||||
if(magic == "19:68:09:24") then
|
if(magic == "19:68:09:24") then
|
||||||
|
|||||||
Reference in New Issue
Block a user