void pop_include_path();
void snort_whitelist_append(const char*);
void snort_whitelist_add_prefix(const char*);
+int get_module_version(const char* name, const char* type);
]]
function whitelist_append(list, is_prefix)
end
end
+function get_module_version(name, type)
+ return ffi.C.get_module_version(name, type)
+end
+
---------------------------------------------------------------------------
-- path magic for includes
---------------------------------------------------------------------------
SNORT_MINOR_VERSION = SNORT_MINOR_VERSION,
SNORT_PATCH_VERSION = SNORT_PATCH_VERSION,
SNORT_SUBLEVEL_VERSION = SNORT_SUBLEVEL_VERSION,
+ get_module_version = get_module_version,
tweaks = tweaks,
}
void snort_whitelist_append(const char*);
void snort_whitelist_add_prefix(const char*);
+
+ int get_module_version(const char* name, const char* type);
}
//-------------------------------------------------------------------------
return true;
}
+// cppcheck-suppress unusedFunction
+SO_PUBLIC int get_module_version(const char* name, const char* type)
+{
+ // not all modules are plugins
+ // not all plugins have modules
+ ModHook* h = get_hook(name);
+
+ if ( !h )
+ {
+ if ( !type )
+ return -1;
+
+ PlugType pt = PluginManager::get_type(type);
+ return PluginManager::get_api(pt, name) ? 0 : -1;
+ }
+
+ return h->api ? (int)h->api->version : 0;
+}
+
//-------------------------------------------------------------------------
// ffi methods - also called internally so no cppcheck suppressions
//-------------------------------------------------------------------------