@@ -300,8 +300,6 @@ void ndpi_report_payload_stats() {
300300
301301void ndpi_free_flow_info_half (struct ndpi_flow_info * flow ) {
302302 if (flow -> ndpi_flow ) { ndpi_flow_free (flow -> ndpi_flow ); flow -> ndpi_flow = NULL ; }
303- if (flow -> src_id ) { ndpi_free (flow -> src_id ); flow -> src_id = NULL ; }
304- if (flow -> dst_id ) { ndpi_free (flow -> dst_id ); flow -> dst_id = NULL ; }
305303}
306304
307305/* ***************************************************** */
@@ -699,8 +697,6 @@ static struct ndpi_flow_info *get_ndpi_flow_info(struct ndpi_workflow * workflow
699697 struct ndpi_tcphdr * * tcph ,
700698 struct ndpi_udphdr * * udph ,
701699 u_int16_t * sport , u_int16_t * dport ,
702- struct ndpi_id_struct * * src ,
703- struct ndpi_id_struct * * dst ,
704700 u_int8_t * proto ,
705701 u_int8_t * * payload ,
706702 u_int16_t * payload_len ,
@@ -878,30 +874,6 @@ static struct ndpi_flow_info *get_ndpi_flow_info(struct ndpi_workflow * workflow
878874 } else
879875 memset (newflow -> ndpi_flow , 0 , SIZEOF_FLOW_STRUCT );
880876
881- if ((newflow -> src_id = ndpi_malloc (SIZEOF_ID_STRUCT )) == NULL ) {
882- LOG (NDPI_LOG_ERROR , "[NDPI] %s(3): not enough memory\n" , __FUNCTION__ );
883- #ifdef DIRECTION_BINS
884- ndpi_free_bin (& newflow -> payload_len_bin_src2dst ), ndpi_free_bin (& newflow -> payload_len_bin_dst2src );
885- #else
886- ndpi_free_bin (& newflow -> payload_len_bin );
887- #endif
888- ndpi_free (newflow );
889- return (NULL );
890- } else
891- memset (newflow -> src_id , 0 , SIZEOF_ID_STRUCT );
892-
893- if ((newflow -> dst_id = ndpi_malloc (SIZEOF_ID_STRUCT )) == NULL ) {
894- LOG (NDPI_LOG_ERROR , "[NDPI] %s(4): not enough memory\n" , __FUNCTION__ );
895- #ifdef DIRECTION_BINS
896- ndpi_free_bin (& newflow -> payload_len_bin_src2dst ), ndpi_free_bin (& newflow -> payload_len_bin_dst2src );
897- #else
898- ndpi_free_bin (& newflow -> payload_len_bin );
899- #endif
900- ndpi_free (newflow );
901- return (NULL );
902- } else
903- memset (newflow -> dst_id , 0 , SIZEOF_ID_STRUCT );
904-
905877 ndpi_tsearch (newflow , & workflow -> ndpi_flows_root [idx ], ndpi_workflow_node_cmp ); /* Add */
906878 workflow -> stats .ndpi_flow_count ++ ;
907879 if (* proto == IPPROTO_TCP )
@@ -911,8 +883,6 @@ static struct ndpi_flow_info *get_ndpi_flow_info(struct ndpi_workflow * workflow
911883 else
912884 workflow -> stats .flow_count [2 ]++ ;
913885
914- * src = newflow -> src_id , * dst = newflow -> dst_id ;
915-
916886 if (enable_flow_stats ) {
917887 newflow -> entropy = ndpi_calloc (1 , sizeof (struct ndpi_entropy ));
918888 newflow -> last_entropy = ndpi_calloc (1 , sizeof (struct ndpi_entropy ));
@@ -939,19 +909,19 @@ static struct ndpi_flow_info *get_ndpi_flow_info(struct ndpi_workflow * workflow
939909 && rflow -> src_port == htons (* sport )
940910 && rflow -> dst_port == htons (* dport )
941911 )
942- * src = rflow -> dst_id , * dst = rflow -> src_id , * src_to_dst_direction = 0 , rflow -> bidirectional = 1 ;
912+ * src_to_dst_direction = 0 , rflow -> bidirectional = 1 ;
943913 else
944- * src = rflow -> src_id , * dst = rflow -> dst_id , * src_to_dst_direction = 1 ;
914+ * src_to_dst_direction = 1 ;
945915 }
946916 else {
947917 if (rflow -> src_ip == iph -> saddr
948918 && rflow -> dst_ip == iph -> daddr
949919 && rflow -> src_port == htons (* sport )
950920 && rflow -> dst_port == htons (* dport )
951921 )
952- * src = rflow -> src_id , * dst = rflow -> dst_id , * src_to_dst_direction = 1 ;
922+ * src_to_dst_direction = 1 ;
953923 else
954- * src = rflow -> dst_id , * dst = rflow -> src_id , * src_to_dst_direction = 0 , rflow -> bidirectional = 1 ;
924+ * src_to_dst_direction = 0 , rflow -> bidirectional = 1 ;
955925 }
956926 if (enable_flow_stats ) {
957927 if (src_to_dst_direction ) {
@@ -997,8 +967,6 @@ static struct ndpi_flow_info *get_ndpi_flow_info6(struct ndpi_workflow * workflo
997967 struct ndpi_tcphdr * * tcph ,
998968 struct ndpi_udphdr * * udph ,
999969 u_int16_t * sport , u_int16_t * dport ,
1000- struct ndpi_id_struct * * src ,
1001- struct ndpi_id_struct * * dst ,
1002970 u_int8_t * proto ,
1003971 u_int8_t * * payload ,
1004972 u_int16_t * payload_len ,
@@ -1024,7 +992,7 @@ static struct ndpi_flow_info *get_ndpi_flow_info6(struct ndpi_workflow * workflo
1024992 & iph , iph6 , ip_offset , ipsize ,
1025993 ip_len , l4ptr - (const u_int8_t * )iph6 ,
1026994 tcph , udph , sport , dport ,
1027- src , dst , proto , payload ,
995+ proto , payload ,
1028996 payload_len , src_to_dst_direction , when ));
1029997}
1030998
@@ -1347,7 +1315,6 @@ static struct ndpi_proto packet_processing(struct ndpi_workflow * workflow,
13471315 pkt_timeval when ,
13481316 ndpi_risk * flow_risk ,
13491317 FILE * csv_fp ) {
1350- struct ndpi_id_struct * src , * dst ;
13511318 struct ndpi_flow_info * flow = NULL ;
13521319 struct ndpi_flow_struct * ndpi_flow = NULL ;
13531320 u_int8_t proto ;
@@ -1369,13 +1336,13 @@ static struct ndpi_proto packet_processing(struct ndpi_workflow * workflow,
13691336 ntohs (iph -> tot_len ) - (iph -> ihl * 4 ),
13701337 iph -> ihl * 4 ,
13711338 & tcph , & udph , & sport , & dport ,
1372- & src , & dst , & proto ,
1339+ & proto ,
13731340 & payload , & payload_len , & src_to_dst_direction , when );
13741341 else
13751342 flow = get_ndpi_flow_info6 (workflow , vlan_id ,
13761343 tunnel_type , iph6 , ip_offset , ipsize ,
13771344 & tcph , & udph , & sport , & dport ,
1378- & src , & dst , & proto ,
1345+ & proto ,
13791346 & payload , & payload_len , & src_to_dst_direction , when );
13801347
13811348 if (flow != NULL ) {
@@ -1563,7 +1530,7 @@ static struct ndpi_proto packet_processing(struct ndpi_workflow * workflow,
15631530
15641531 flow -> detected_protocol = ndpi_detection_process_packet (workflow -> ndpi_struct , ndpi_flow ,
15651532 iph ? (uint8_t * )iph : (uint8_t * )iph6 ,
1566- ipsize , time_ms , src , dst );
1533+ ipsize , time_ms );
15671534
15681535 if (enough_packets || (flow -> detected_protocol .app_protocol != NDPI_PROTOCOL_UNKNOWN )) {
15691536 if ((!enough_packets )
0 commit comments