bool RequiresFeature(const char *feature_name)
{
- FeatureEntryType t = { 0, feature_name };
+ FeatureEntryType f = { feature_name };
SCMutexLock(&feature_table_mutex);
- FeatureEntryType *feature = HashTableLookup(feature_hash_table, &t, sizeof(t));
+ FeatureEntryType *feature = HashListTableLookup(feature_hash_table, &f, sizeof(f));
SCMutexUnlock(&feature_table_mutex);
-
return feature != NULL;
}
void FeatureTrackingRelease(void)
{
if (feature_hash_table != NULL) {
- HashTableFree(feature_hash_table);
+ HashListTableFree(feature_hash_table);
feature_hash_table = NULL;
- feature_table_id = 0;
}
}
+void FeatureDump(void)
+{
+ HashListTableBucket *hb = HashListTableGetListHead(feature_hash_table);
+ for (; hb != NULL; hb = HashListTableGetListNext(hb)) {
+ FeatureEntryType *f = HashListTableGetListData(hb);
+ printf("provided feature name: %s\n", f->feature);
+ }
+}
void FeatureTrackingRegister(void)
{
FeatureInit();
printf("\t--init-errors-fatal : enable fatal failure on signature init error\n");
printf("\t--disable-detection : disable detection engine\n");
printf("\t--dump-config : show the running configuration\n");
+ printf("\t--dump-features : display provided features\n");
printf("\t--build-info : display build information\n");
printf("\t--pcap[=<dev>] : run in pcap mode, no value select interfaces from suricata.yaml\n");
printf("\t--pcap-file-continuous : when running in pcap mode with a directory, continue checking directory for pcaps until interrupted\n");
int opt;
int dump_config = 0;
+ int dump_features = 0;
int list_app_layer_protocols = 0;
int list_unittests = 0;
int list_runmodes = 0;
struct option long_opts[] = {
{"dump-config", 0, &dump_config, 1},
+ {"dump-features", 0, &dump_features, 1},
{"pfring", optional_argument, 0, 0},
{"pfring-int", required_argument, 0, 0},
{"pfring-cluster-id", required_argument, 0, 0},
suri->run_mode = RUNMODE_LIST_UNITTEST;
if (dump_config)
suri->run_mode = RUNMODE_DUMP_CONFIG;
+ if (dump_features)
+ suri->run_mode = RUNMODE_DUMP_FEATURES;
if (conf_test)
suri->run_mode = RUNMODE_CONF_TEST;
if (engine_analysis)
} else if (suricata.run_mode == RUNMODE_CONF_TEST){
SCLogNotice("Configuration provided was successfully loaded. Exiting.");
goto out;
+ } else if (suricata.run_mode == RUNMODE_DUMP_FEATURES) {
+ FeatureDump();
+ goto out;
}
SCSetStartTime(&suricata);