mirror of
				https://github.com/optim-enterprises-bv/nDPId.git
				synced 2025-10-29 17:32:23 +00:00 
			
		
		
		
	Added libnDPI global context init/deinit used for cache mgmt.
* support for adding *.ndpiconf for nDPI config tests * all other configs should have the suffix *.conf * fixed nDPI malloc/free wrapper set (was already too late set) Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
This commit is contained in:
		
							
								
								
									
										19
									
								
								nDPId-test.c
									
									
									
									
									
								
							
							
						
						
									
										19
									
								
								nDPId-test.c
									
									
									
									
									
								
							| @@ -1649,6 +1649,13 @@ int main(int argc, char ** argv) | ||||
|         return 1; | ||||
|     } | ||||
|  | ||||
| #ifdef ENABLE_MEMORY_STATUS | ||||
|     set_ndpi_malloc(ndpi_malloc_wrapper); | ||||
|     set_ndpi_free(ndpi_free_wrapper); | ||||
|     set_ndpi_flow_malloc(NULL); | ||||
|     set_ndpi_flow_free(NULL); | ||||
| #endif | ||||
|  | ||||
|     init_logging("nDPId-test"); | ||||
|     log_app_info(); | ||||
|  | ||||
| @@ -1743,6 +1750,12 @@ int main(int argc, char ** argv) | ||||
|     distributor_un_sockfd = -1; | ||||
|     distributor_in_sockfd = -1; | ||||
|  | ||||
|     global_context = ndpi_global_init(); | ||||
|     if (global_context == NULL) | ||||
|     { | ||||
|         logger_early(1, "Could not initialize libnDPI global context."); | ||||
|     } | ||||
|  | ||||
|     if (setup_remote_descriptors(MAX_REMOTE_DESCRIPTORS) != 0) | ||||
|     { | ||||
|         return 1; | ||||
| @@ -1797,6 +1810,12 @@ int main(int argc, char ** argv) | ||||
|     logger(0, "%s", "All worker threads terminated.."); | ||||
|     free_reader_threads(); | ||||
|  | ||||
|     if (global_context != NULL) | ||||
|     { | ||||
|         ndpi_global_deinit(global_context); | ||||
|     } | ||||
|     global_context = NULL; | ||||
|  | ||||
|     if (THREADS_RETURNED_ERROR() != 0) | ||||
|     { | ||||
|         char const * which_thread = "Unknown"; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Toni Uhlig
					Toni Uhlig