@ -334,14 +334,7 @@ void RunModeInitializeOutputs(void)
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					        if  ( strcmp ( output - > val ,  " stats " )  = =  0 ) 
 
					 
					 
					 
					        if  ( strcmp ( output - > val ,  " stats " )  = =  0 ) 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					            continue ; 
 
					 
					 
					 
					            continue ; 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					
 
					 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					        OutputModule  * module  =  OutputGetModuleByConfName ( output - > val ) ; 
 
					 
					 
					 
					        output_config  =  ConfNodeLookupChild ( output ,  output - > val ) ; 
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					        if  ( module  = =  NULL )  { 
 
					 
					 
					 
					 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					            SCLogWarning ( SC_ERR_INVALID_ARGUMENT , 
 
					 
					 
					 
					 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                " No output module named %s, ignoring " ,  output - > val ) ; 
 
					 
					 
					 
					 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					            continue ; 
 
					 
					 
					 
					 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					        } 
 
					 
					 
					 
					 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					
 
					 
					 
					 
					 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					        output_config  =  ConfNodeLookupChild ( output ,  module - > conf_name ) ; 
 
					 
					 
					 
					 
				
			 
			
		
	
		
		
	
		
		
			
				
					
					 
					 
					 
					        if  ( output_config  = =  NULL )  { 
 
					 
					 
					 
					        if  ( output_config  = =  NULL )  { 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					            /* Shouldn't happen. */ 
 
					 
					 
					 
					            /* Shouldn't happen. */ 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					            SCLogError ( SC_ERR_INVALID_ARGUMENT , 
 
					 
					 
					 
					            SCLogError ( SC_ERR_INVALID_ARGUMENT , 
 
				
			 
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
							 
						
					 
					 
					@ -350,29 +343,47 @@ void RunModeInitializeOutputs(void)
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					        } 
 
					 
					 
					 
					        } 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					
 
					 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					        enabled  =  ConfNodeLookupChildValue ( output_config ,  " enabled " ) ; 
 
					 
					 
					 
					        enabled  =  ConfNodeLookupChildValue ( output_config ,  " enabled " ) ; 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					        if  ( enabled  ! =  NULL  & &  ConfValIsTrue ( enabled ) )  { 
 
					 
					 
					 
					        if  ( enabled  = =  NULL  | |  ! ConfValIsTrue ( enabled ) )  { 
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					            OutputCtx  * output_ctx  =  NULL ; 
 
					 
					 
					 
					            continue ; 
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					            if  ( module - > InitFunc  ! =  NULL )  { 
 
					 
					 
					 
					        } 
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					                output_ctx  =  module - > InitFunc ( output_config ) ; 
 
					 
					 
					 
					
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					                if  ( output_ctx  = =  NULL )  { 
 
					 
					 
					 
					        if  ( strncmp ( output - > val ,  " unified- " ,  sizeof ( " unified- " )  -  1 )  = =  0 )  { 
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					                    /* In most cases the init function will have logged the
 
 
					 
					 
					 
					            SCLogWarning ( SC_ERR_INVALID_ARGUMENT , 
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					                     *  error .  Maybe  we  should  exit  on  init  errors ?  */ 
 
					 
					 
					 
					                    " Unified1 is no longer supported, " 
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					                    continue ; 
 
					 
					 
					 
					                    "  use Unified2 instead  " 
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					                } 
 
					 
					 
					 
					                    " (see https://redmine.openinfosecfoundation.org/issues/353 " 
 
				
			 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
					                    "  for an explanation) " ) ; 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
					            continue ; 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
					        } 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
					        OutputModule  * module  =  OutputGetModuleByConfName ( output - > val ) ; 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
					        if  ( module  = =  NULL )  { 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
					            SCLogWarning ( SC_ERR_INVALID_ARGUMENT , 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
					                " No output module named %s, ignoring " ,  output - > val ) ; 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
					            continue ; 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
					        } 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
					        OutputCtx  * output_ctx  =  NULL ; 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
					        if  ( module - > InitFunc  ! =  NULL )  { 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
					            output_ctx  =  module - > InitFunc ( output_config ) ; 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
					            if  ( output_ctx  = =  NULL )  { 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
					                /* In most cases the init function will have logged the
 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
					                 *  error .  Maybe  we  should  exit  on  init  errors ?  */ 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
					                continue ; 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					            } 
 
					 
					 
					 
					            } 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					            tm_module  =  TmModuleGetByName ( module - > name ) ; 
 
					 
					 
					 
					        } 
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					            if  ( tm_module  = =  NULL )  { 
 
					 
					 
					 
					        tm_module  =  TmModuleGetByName ( module - > name ) ; 
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					                SCLogError ( SC_ERR_INVALID_ARGUMENT , 
 
					 
					 
					 
					        if  ( tm_module  = =  NULL )  { 
 
				
			 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
					            SCLogError ( SC_ERR_INVALID_ARGUMENT , 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                    " TmModuleGetByName for %s failed " ,  module - > name ) ; 
 
					 
					 
					 
					                    " TmModuleGetByName for %s failed " ,  module - > name ) ; 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                exit ( EXIT_FAILURE ) ; 
 
					 
					 
					 
					            exit ( EXIT_FAILURE ) ; 
 
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					            } 
 
					 
					 
					 
					 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					            RunModeOutput  * runmode_output  =  SCCalloc ( 1 ,  sizeof ( RunModeOutput ) ) ; 
 
					 
					 
					 
					 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					            if  ( runmode_output  = =  NULL ) 
 
					 
					 
					 
					 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                return ; 
 
					 
					 
					 
					 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					            runmode_output - > tm_module  =  tm_module ; 
 
					 
					 
					 
					 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					            runmode_output - > output_ctx  =  output_ctx ; 
 
					 
					 
					 
					 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					            TAILQ_INSERT_TAIL ( & RunModeOutputs ,  runmode_output ,  entries ) ; 
 
					 
					 
					 
					 
				
			 
			
		
	
		
		
	
		
		
			
				
					
					 
					 
					 
					        } 
 
					 
					 
					 
					        } 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
					        RunModeOutput  * runmode_output  =  SCCalloc ( 1 ,  sizeof ( RunModeOutput ) ) ; 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
					        if  ( runmode_output  = =  NULL ) 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
					            return ; 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
					        runmode_output - > tm_module  =  tm_module ; 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
					        runmode_output - > output_ctx  =  output_ctx ; 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
					        TAILQ_INSERT_TAIL ( & RunModeOutputs ,  runmode_output ,  entries ) ; 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					    } 
 
					 
					 
					 
					    } 
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					} 
 
					 
					 
					 
					}