@ -1202,6 +1202,9 @@ static TmEcode ParseCommandLine(int argc, char** argv, SCInstance *suri)
{ " no-random " , 0 , & g_disable_randomness , 1 } ,
{ " no-random " , 0 , & g_disable_randomness , 1 } ,
{ " strict-rule-keywords " , optional_argument , 0 , 0 } ,
{ " strict-rule-keywords " , optional_argument , 0 , 0 } ,
{ " capture-plugin " , required_argument , 0 , 0 } ,
{ " cpature-plugin-args " , required_argument , 0 , 0 } ,
# ifdef BUILD_UNIX_SOCKET
# ifdef BUILD_UNIX_SOCKET
{ " unix-socket " , optional_argument , 0 , 0 } ,
{ " unix-socket " , optional_argument , 0 , 0 } ,
# endif
# endif
@ -1293,6 +1296,13 @@ static TmEcode ParseCommandLine(int argc, char** argv, SCInstance *suri)
return TM_ECODE_FAILED ;
return TM_ECODE_FAILED ;
# endif /* HAVE_PFRING */
# endif /* HAVE_PFRING */
}
}
else if ( strcmp ( ( long_opts [ option_index ] ) . name , " capture-plugin " ) = = 0 ) {
suri - > run_mode = RUNMODE_PLUGIN ;
suri - > capture_plugin_name = optarg ;
}
else if ( strcmp ( ( long_opts [ option_index ] ) . name , " capture-plugin-args " ) = = 0 ) {
suri - > capture_plugin_args = optarg ;
}
else if ( strcmp ( ( long_opts [ option_index ] ) . name , " af-packet " ) = = 0 )
else if ( strcmp ( ( long_opts [ option_index ] ) . name , " af-packet " ) = = 0 )
{
{
if ( ParseCommandLineAfpacket ( suri , optarg ) ! = TM_ECODE_OK ) {
if ( ParseCommandLineAfpacket ( suri , optarg ) ! = TM_ECODE_OK ) {
@ -2550,7 +2560,7 @@ int PostConfLoadedSetup(SCInstance *suri)
FeatureTrackingRegister ( ) ; /* must occur prior to output mod registration */
FeatureTrackingRegister ( ) ; /* must occur prior to output mod registration */
RegisterAllModules ( ) ;
RegisterAllModules ( ) ;
SCPluginsLoad ( ) ;
SCPluginsLoad ( suri - > capture_plugin_name , suri - > capture_plugin_args ) ;
AppLayerHtpNeedFileInspection ( ) ;
AppLayerHtpNeedFileInspection ( ) ;
@ -2792,7 +2802,8 @@ int SuricataMain(int argc, char **argv)
}
}
SCSetStartTime ( & suricata ) ;
SCSetStartTime ( & suricata ) ;
RunModeDispatch ( suricata . run_mode , suricata . runmode_custom_mode ) ;
RunModeDispatch ( suricata . run_mode , suricata . runmode_custom_mode ,
suricata . capture_plugin_name , suricata . capture_plugin_args ) ;
if ( suricata . run_mode ! = RUNMODE_UNIX_SOCKET ) {
if ( suricata . run_mode ! = RUNMODE_UNIX_SOCKET ) {
UnixManagerThreadSpawnNonRunmode ( ) ;
UnixManagerThreadSpawnNonRunmode ( ) ;
}
}