enum HelpType {
HT_CFG, HT_CMD, HT_GID, HT_IPS, HT_MOD,
HT_BUF, HT_LST, HT_PLG, HT_DDR, HT_DBR,
- HT_SHO
+ HT_HMO, HT_HPL
};
static void show_help(SnortConfig* sc, const char* val, HelpType ht)
case HT_DBR:
ModuleManager::dump_rules(val);
break;
- case HT_SHO:
+ case HT_HMO:
ModuleManager::show_modules();
break;
+ case HT_HPL:
+ PluginManager::show_plugins();
+ break;
}
ModuleManager::term();
PluginManager::release_plugins();
void help_modules(SnortConfig* sc, const char* val)
{
- show_help(sc, val, HT_SHO);
+ show_help(sc, val, HT_HMO);
+}
+
+void help_plugins(SnortConfig* sc, const char* val)
+{
+ show_help(sc, val, HT_HPL);
}
void list_modules(SnortConfig* sc, const char* val)
void help_builtin(SnortConfig* sc, const char*);
void help_module(SnortConfig* sc, const char*);
void help_modules(SnortConfig* sc, const char*);
+void help_plugins(SnortConfig* sc, const char*);
void help_version(SnortConfig*, const char*);
void list_modules(SnortConfig* sc, const char*);
"<module> output description of given module" },
{ "--help-modules", Parameter::PT_IMPLIED, nullptr, nullptr,
- "list all modules with brief help" },
+ "list all available modules with brief help" },
+
+ { "--help-plugins", Parameter::PT_IMPLIED, nullptr, nullptr,
+ "list all available plugins with brief help" },
{ "--help-options", Parameter::PT_STRING, "(optional)", nullptr,
"<option prefix> output matching command line option quick help" },
else if ( v.is("--help-modules") )
help_modules(sc, v.get_string());
+ else if ( v.is("--help-plugins") )
+ help_plugins(sc, v.get_string());
+
else if ( v.is("--help-options") )
help_options(sc, v.get_string());
}
}
+void PluginManager::show_plugins()
+{
+ PlugMap::iterator it;
+
+ for ( it = plug_map.begin(); it != plug_map.end(); ++it )
+ {
+ Plugin& p = it->second;
+ cout << p.key << ": " << p.api->help << endl;
+ }
+}
+
void PluginManager::dump_plugins()
{
DataManager::dump_plugins();
// plugin methods
static void load_plugins(const char* lib_paths);
static void list_plugins();
+ static void show_plugins();
static void dump_plugins();
static void release_plugins();
static const BaseApi* get_api(PlugType, const char* name);