Removed csv_fp as external symbol. Instead passing csv_fp through as argument.
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
This commit is contained in:
@@ -1414,7 +1414,7 @@ static void node_proto_guess_walker(const void *node, ndpi_VISIT which, int dept
|
|||||||
flow->ndpi_flow, enable_protocol_guess, &proto_guessed);
|
flow->ndpi_flow, enable_protocol_guess, &proto_guessed);
|
||||||
}
|
}
|
||||||
|
|
||||||
process_ndpi_collected_info(ndpi_thread_info[thread_id].workflow, flow);
|
process_ndpi_collected_info(ndpi_thread_info[thread_id].workflow, flow, csv_fp);
|
||||||
|
|
||||||
proto = flow->detected_protocol.app_protocol ? flow->detected_protocol.app_protocol : flow->detected_protocol.master_protocol;
|
proto = flow->detected_protocol.app_protocol ? flow->detected_protocol.app_protocol : flow->detected_protocol.master_protocol;
|
||||||
|
|
||||||
@@ -2913,7 +2913,7 @@ static void ndpi_process_packet(u_char *args,
|
|||||||
uint8_t *packet_checked = malloc(header->caplen);
|
uint8_t *packet_checked = malloc(header->caplen);
|
||||||
|
|
||||||
memcpy(packet_checked, packet, header->caplen);
|
memcpy(packet_checked, packet, header->caplen);
|
||||||
p = ndpi_workflow_process_packet(ndpi_thread_info[thread_id].workflow, header, packet_checked);
|
p = ndpi_workflow_process_packet(ndpi_thread_info[thread_id].workflow, header, packet_checked, csv_fp);
|
||||||
|
|
||||||
if(!pcap_start.tv_sec) pcap_start.tv_sec = header->ts.tv_sec, pcap_start.tv_usec = header->ts.tv_usec;
|
if(!pcap_start.tv_sec) pcap_start.tv_sec = header->ts.tv_sec, pcap_start.tv_usec = header->ts.tv_usec;
|
||||||
pcap_end.tv_sec = header->ts.tv_sec, pcap_end.tv_usec = header->ts.tv_usec;
|
pcap_end.tv_sec = header->ts.tv_sec, pcap_end.tv_usec = header->ts.tv_usec;
|
||||||
|
|||||||
@@ -89,7 +89,6 @@
|
|||||||
extern u_int8_t enable_protocol_guess, enable_joy_stats, enable_payload_analyzer;
|
extern u_int8_t enable_protocol_guess, enable_joy_stats, enable_payload_analyzer;
|
||||||
extern u_int8_t verbose, human_readeable_string_len;
|
extern u_int8_t verbose, human_readeable_string_len;
|
||||||
extern u_int8_t max_num_udp_dissected_pkts /* 8 */, max_num_tcp_dissected_pkts /* 10 */;
|
extern u_int8_t max_num_udp_dissected_pkts /* 8 */, max_num_tcp_dissected_pkts /* 10 */;
|
||||||
extern FILE *csv_fp;
|
|
||||||
static u_int32_t flow_id = 0;
|
static u_int32_t flow_id = 0;
|
||||||
|
|
||||||
/* ****************************************************** */
|
/* ****************************************************** */
|
||||||
@@ -1022,7 +1021,7 @@ void correct_csv_data_field(char* data) {
|
|||||||
|
|
||||||
/* ****************************************************** */
|
/* ****************************************************** */
|
||||||
|
|
||||||
void process_ndpi_collected_info(struct ndpi_workflow * workflow, struct ndpi_flow_info *flow) {
|
void process_ndpi_collected_info(struct ndpi_workflow * workflow, struct ndpi_flow_info *flow, FILE * csv_fp) {
|
||||||
u_int i;
|
u_int i;
|
||||||
|
|
||||||
if(!flow->ndpi_flow) return;
|
if(!flow->ndpi_flow) return;
|
||||||
@@ -1290,7 +1289,8 @@ static struct ndpi_proto packet_processing(struct ndpi_workflow * workflow,
|
|||||||
u_int16_t ipsize, u_int16_t rawsize,
|
u_int16_t ipsize, u_int16_t rawsize,
|
||||||
const struct pcap_pkthdr *header,
|
const struct pcap_pkthdr *header,
|
||||||
const u_char *packet,
|
const u_char *packet,
|
||||||
struct timeval when) {
|
struct timeval when,
|
||||||
|
FILE * csv_fp) {
|
||||||
struct ndpi_id_struct *src, *dst;
|
struct ndpi_id_struct *src, *dst;
|
||||||
struct ndpi_flow_info *flow = NULL;
|
struct ndpi_flow_info *flow = NULL;
|
||||||
struct ndpi_flow_struct *ndpi_flow = NULL;
|
struct ndpi_flow_struct *ndpi_flow = NULL;
|
||||||
@@ -1513,7 +1513,7 @@ static struct ndpi_proto packet_processing(struct ndpi_workflow * workflow,
|
|||||||
enable_protocol_guess, &proto_guessed);
|
enable_protocol_guess, &proto_guessed);
|
||||||
}
|
}
|
||||||
|
|
||||||
process_ndpi_collected_info(workflow, flow);
|
process_ndpi_collected_info(workflow, flow, csv_fp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1525,7 +1525,8 @@ static struct ndpi_proto packet_processing(struct ndpi_workflow * workflow,
|
|||||||
|
|
||||||
struct ndpi_proto ndpi_workflow_process_packet(struct ndpi_workflow * workflow,
|
struct ndpi_proto ndpi_workflow_process_packet(struct ndpi_workflow * workflow,
|
||||||
const struct pcap_pkthdr *header,
|
const struct pcap_pkthdr *header,
|
||||||
const u_char *packet) {
|
const u_char *packet,
|
||||||
|
FILE * csv_fp) {
|
||||||
/*
|
/*
|
||||||
* Declare pointers to packet headers
|
* Declare pointers to packet headers
|
||||||
*/
|
*/
|
||||||
@@ -1945,7 +1946,8 @@ struct ndpi_proto ndpi_workflow_process_packet(struct ndpi_workflow * workflow,
|
|||||||
/* process the packet */
|
/* process the packet */
|
||||||
return(packet_processing(workflow, time_ms, vlan_id, tunnel_type, iph, iph6,
|
return(packet_processing(workflow, time_ms, vlan_id, tunnel_type, iph, iph6,
|
||||||
ip_offset, header->caplen - ip_offset,
|
ip_offset, header->caplen - ip_offset,
|
||||||
header->caplen, header, packet, header->ts));
|
header->caplen, header, packet, header->ts,
|
||||||
|
csv_fp));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ********************************************************** */
|
/* ********************************************************** */
|
||||||
|
|||||||
@@ -308,7 +308,8 @@ void ndpi_free_flow_info_half(struct ndpi_flow_info *flow);
|
|||||||
/* Process a packet and update the workflow */
|
/* Process a packet and update the workflow */
|
||||||
struct ndpi_proto ndpi_workflow_process_packet(struct ndpi_workflow * workflow,
|
struct ndpi_proto ndpi_workflow_process_packet(struct ndpi_workflow * workflow,
|
||||||
const struct pcap_pkthdr *header,
|
const struct pcap_pkthdr *header,
|
||||||
const u_char *packet);
|
const u_char *packet,
|
||||||
|
FILE * csv_fp);
|
||||||
|
|
||||||
|
|
||||||
/* flow callbacks for complete detected flow
|
/* flow callbacks for complete detected flow
|
||||||
@@ -327,7 +328,7 @@ static inline void ndpi_workflow_set_flow_giveup_callback(struct ndpi_workflow *
|
|||||||
|
|
||||||
/* compare two nodes in workflow */
|
/* compare two nodes in workflow */
|
||||||
int ndpi_workflow_node_cmp(const void *a, const void *b);
|
int ndpi_workflow_node_cmp(const void *a, const void *b);
|
||||||
void process_ndpi_collected_info(struct ndpi_workflow * workflow, struct ndpi_flow_info *flow);
|
void process_ndpi_collected_info(struct ndpi_workflow * workflow, struct ndpi_flow_info *flow, FILE * csv_fp);
|
||||||
u_int32_t ethernet_crc32(const void* data, size_t n_bytes);
|
u_int32_t ethernet_crc32(const void* data, size_t n_bytes);
|
||||||
void ndpi_flow_info_free_data(struct ndpi_flow_info *flow);
|
void ndpi_flow_info_free_data(struct ndpi_flow_info *flow);
|
||||||
void ndpi_flow_info_freer(void *node);
|
void ndpi_flow_info_freer(void *node);
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
|
|||||||
/* allocate an exact size buffer to check overflows */
|
/* allocate an exact size buffer to check overflows */
|
||||||
uint8_t *packet_checked = malloc(header->caplen);
|
uint8_t *packet_checked = malloc(header->caplen);
|
||||||
memcpy(packet_checked, pkt, header->caplen);
|
memcpy(packet_checked, pkt, header->caplen);
|
||||||
ndpi_workflow_process_packet(workflow, header, packet_checked);
|
ndpi_workflow_process_packet(workflow, header, packet_checked, NULL);
|
||||||
free(packet_checked);
|
free(packet_checked);
|
||||||
r = pcap_next_ex(pkts, &header, &pkt);
|
r = pcap_next_ex(pkts, &header, &pkt);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user