pub type GetFrameIdByName = unsafe extern "C" fn(*const c_char) -> c_int;
pub type GetFrameNameById = unsafe extern "C" fn(u8) -> *const c_char;
-// Defined in detect-engine-register.h
-/// cbindgen:ignore
-extern "C" {
- pub fn SigTablePreRegister(cb: unsafe extern "C" fn ());
-}
-
// Defined in app-layer-register.h
/// cbindgen:ignore
extern "C" {
use nom7::error::{ErrorKind, make_error};
use suricata_sys::sys::{
AppProto, AppProtoNewProtoFromString, EveJsonTxLoggerRegistrationData,
- SCOutputJsonLogDirection, SCOutputEvePreRegisterLogger,
+ SCOutputJsonLogDirection, SCOutputEvePreRegisterLogger, SCSigTablePreRegister,
};
#[derive(AppLayerEvent)]
LogTx: Some(snmp_log_json_response),
};
SCOutputEvePreRegisterLogger(reg_data);
- SigTablePreRegister(detect_snmp_register);
+ SCSigTablePreRegister(Some(detect_snmp_register));
if AppLayerProtoDetectConfProtoDetectionEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
// port 161
_ = AppLayerRegisterProtocolDetection(&parser, 1);
reg_data: EveJsonTxLoggerRegistrationData,
) -> ::std::os::raw::c_int;
}
+extern "C" {
+ pub fn SCSigTablePreRegister(
+ KeywordsRegister: ::std::option::Option<unsafe extern "C" fn()>,
+ ) -> ::std::os::raw::c_int;
+}
#[doc = " Structure of a configuration parameter."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
#include "app-layer-protos.h"
#include "suricata-plugin.h"
#include "output-eve-bindgen.h"
+#include "detect-engine-register.h"
#include "conf.h"
// When an app-layer plugin is loaded, it wants to register its keywords
// But the plugin is loaded before keywords can register
// The preregistration callbacks will later be called by SigTableSetup
-int SigTablePreRegister(void (*KeywordsRegister)(void))
+int SCSigTablePreRegister(void (*KeywordsRegister)(void))
{
if (preregistered_callbacks_nb == preregistered_callbacks_cap) {
void *tmp = SCRealloc(PreregisteredCallbacks,
#ifndef SURICATA_DETECT_ENGINE_REGISTER_H
#define SURICATA_DETECT_ENGINE_REGISTER_H
-#include "suricata-common.h"
-
enum DetectKeywordId {
DETECT_SID,
DETECT_PRIORITY,
void SigTableCleanup(void);
void SigTableInit(void);
void SigTableSetup(void);
-int SigTablePreRegister(void (*KeywordsRegister)(void));
+int SCSigTablePreRegister(void (*KeywordsRegister)(void));
void SigTableRegisterTests(void);
bool SigTableHasKeyword(const char *keyword);
*
*/
-#include "detect-engine-register.h"
#include "suricata-common.h"
+#include "detect-engine-register.h"
#include "detect.h"
#include "detect-parse.h"
}
}
if (plugin->KeywordsRegister) {
- if (SigTablePreRegister(plugin->KeywordsRegister) != 0) {
+ if (SCSigTablePreRegister(plugin->KeywordsRegister) != 0) {
return 1;
}
}