diff options
Diffstat (limited to 'example')
-rw-r--r-- | example/intrusion_detection.c | 6 | ||||
-rw-r--r-- | example/ndpiReader.c | 4 | ||||
-rw-r--r-- | example/reader_util.c | 4 |
3 files changed, 6 insertions, 8 deletions
diff --git a/example/intrusion_detection.c b/example/intrusion_detection.c index 5c83b5b8e..cce25a8b8 100644 --- a/example/intrusion_detection.c +++ b/example/intrusion_detection.c @@ -53,7 +53,6 @@ double get_flow_score(ndpi_norm_value* scores, int n_metrics){ /* ********************************** */ double Ddos_score(struct ndpi_flow_info* flow){ - double f = (double)flow->first_seen/1000.0, l = (double)flow->last_seen/1000.0; int n_metrics = 6; ndpi_norm_value* scores = malloc(n_metrics * sizeof(ndpi_norm_value)); /* pktlen_c_to_s_avg */ @@ -105,7 +104,6 @@ double Ddos_score(struct ndpi_flow_info* flow){ } double Dos_goldeneye_score(struct ndpi_flow_info* flow){ - double f = (double)flow->first_seen/1000.0, l = (double)flow->last_seen/1000.0; int n_metrics = 6; ndpi_norm_value* scores = malloc(n_metrics * sizeof(ndpi_norm_value)); /* pktlen_s_to_c_max */ @@ -208,7 +206,6 @@ double Dos_hulk_score(struct ndpi_flow_info* flow){ } double Dos_slow_score(struct ndpi_flow_info* flow){ - double f = (double)flow->first_seen/1000.0, l = (double)flow->last_seen/1000.0; int n_metrics = 6; ndpi_norm_value* scores = malloc(n_metrics * sizeof(ndpi_norm_value)); /* pktlen_s_to_c_max */ @@ -260,7 +257,6 @@ double Dos_slow_score(struct ndpi_flow_info* flow){ } double Ftp_patator_score(struct ndpi_flow_info* flow){ - double f = (double)flow->first_seen/1000.0, l = (double)flow->last_seen/1000.0; int n_metrics = 6; ndpi_norm_value* scores = malloc(n_metrics * sizeof(ndpi_norm_value)); /* iat_flow_min */ @@ -364,7 +360,6 @@ double Hearthbleed_score(struct ndpi_flow_info* flow){ } double Infiltration_score(struct ndpi_flow_info* flow){ - double f = (double)flow->first_seen/1000.0, l = (double)flow->last_seen/1000.0; int n_metrics = 6; ndpi_norm_value* scores = malloc(n_metrics * sizeof(ndpi_norm_value)); /* pktlen_c_to_s_max */ @@ -416,7 +411,6 @@ double Infiltration_score(struct ndpi_flow_info* flow){ } double Ssh_patator_score(struct ndpi_flow_info* flow){ - double f = (double)flow->first_seen/1000.0, l = (double)flow->last_seen/1000.0; int n_metrics = 6; ndpi_norm_value* scores = malloc(n_metrics * sizeof(ndpi_norm_value)); /* fin */ diff --git a/example/ndpiReader.c b/example/ndpiReader.c index d64918b85..f15ee0e66 100644 --- a/example/ndpiReader.c +++ b/example/ndpiReader.c @@ -218,6 +218,7 @@ FILE *trace = NULL; */ static void setupDetection(u_int16_t thread_id, pcap_t * pcap_handle); +#if 0 static void reduceBDbits(uint32_t *bd, unsigned int len) { int mask = 0; int shift = 0; @@ -238,6 +239,7 @@ static void reduceBDbits(uint32_t *bd, unsigned int len) { for(i = 0; i < len; i++) bd[i] = bd[i] >> shift; } +#endif /** * @brief Get flow byte distribution mean and variance @@ -1530,12 +1532,14 @@ static int acceptable(u_int32_t num_pkts){ /* *********************************************** */ +#if 0 static int receivers_sort(void *_a, void *_b) { struct receiver *a = (struct receiver *)_a; struct receiver *b = (struct receiver *)_b; return(b->num_pkts - a->num_pkts); } +#endif /* *********************************************** */ diff --git a/example/reader_util.c b/example/reader_util.c index 73d580cc1..db18496c7 100644 --- a/example/reader_util.c +++ b/example/reader_util.c @@ -1210,7 +1210,7 @@ static struct ndpi_proto packet_processing(struct ndpi_workflow * workflow, u_int8_t *payload; u_int8_t src_to_dst_direction = 1; u_int8_t begin_or_end_tcp = 0; - struct ndpi_proto nproto = { NDPI_PROTOCOL_UNKNOWN, NDPI_PROTOCOL_UNKNOWN }; + struct ndpi_proto nproto = NDPI_PROTOCOL_NULL; if(iph) flow = get_ndpi_flow_info(workflow, IPVERSION, vlan_id, @@ -1441,7 +1441,7 @@ struct ndpi_proto ndpi_workflow_process_packet(struct ndpi_workflow * workflow, /** --- IPv6 header --- **/ struct ndpi_ipv6hdr *iph6; - struct ndpi_proto nproto = { NDPI_PROTOCOL_UNKNOWN, NDPI_PROTOCOL_UNKNOWN }; + struct ndpi_proto nproto = NDPI_PROTOCOL_NULL; ndpi_packet_tunnel tunnel_type = ndpi_no_tunnel; /* lengths and offsets */ |