|
|
|
@ -36,12 +36,13 @@ use crate::detect::uint::{
|
|
|
|
|
SCDetectU8Match, SCDetectU8Parse,
|
|
|
|
|
};
|
|
|
|
|
use crate::detect::{
|
|
|
|
|
helper_keyword_register_sticky_buffer, DetectHelperBufferMpmRegister,
|
|
|
|
|
DetectHelperBufferRegister, DetectHelperGetData, DetectHelperKeywordRegister,
|
|
|
|
|
DetectSignatureSetAppProto, SCSigTableAppLiteElmt, SigMatchAppendSMToList,
|
|
|
|
|
SigTableElmtStickyBuffer,
|
|
|
|
|
helper_keyword_register_sticky_buffer, DetectHelperBufferMpmRegister, DetectHelperGetData,
|
|
|
|
|
DetectHelperKeywordRegister, DetectSignatureSetAppProto, SCSigTableAppLiteElmt,
|
|
|
|
|
SigMatchAppendSMToList, SigTableElmtStickyBuffer,
|
|
|
|
|
};
|
|
|
|
|
use suricata_sys::sys::{
|
|
|
|
|
DetectEngineCtx, SCDetectBufferSetActiveList, SCDetectHelperBufferRegister, Signature,
|
|
|
|
|
};
|
|
|
|
|
use suricata_sys::sys::{DetectEngineCtx, SCDetectBufferSetActiveList, Signature};
|
|
|
|
|
|
|
|
|
|
use crate::direction::Direction;
|
|
|
|
|
|
|
|
|
@ -1345,7 +1346,7 @@ pub unsafe extern "C" fn SCDetectEnipRegister() {
|
|
|
|
|
flags: 0,
|
|
|
|
|
};
|
|
|
|
|
G_ENIP_CIPSERVICE_KW_ID = DetectHelperKeywordRegister(&kw);
|
|
|
|
|
G_ENIP_CIPSERVICE_BUFFER_ID = DetectHelperBufferRegister(
|
|
|
|
|
G_ENIP_CIPSERVICE_BUFFER_ID = SCDetectHelperBufferRegister(
|
|
|
|
|
b"cip\0".as_ptr() as *const libc::c_char,
|
|
|
|
|
ALPROTO_ENIP,
|
|
|
|
|
STREAM_TOSERVER | STREAM_TOCLIENT,
|
|
|
|
@ -1360,7 +1361,7 @@ pub unsafe extern "C" fn SCDetectEnipRegister() {
|
|
|
|
|
flags: 0,
|
|
|
|
|
};
|
|
|
|
|
G_ENIP_CAPABILITIES_KW_ID = DetectHelperKeywordRegister(&kw);
|
|
|
|
|
G_ENIP_CAPABILITIES_BUFFER_ID = DetectHelperBufferRegister(
|
|
|
|
|
G_ENIP_CAPABILITIES_BUFFER_ID = SCDetectHelperBufferRegister(
|
|
|
|
|
b"enip.capabilities\0".as_ptr() as *const libc::c_char,
|
|
|
|
|
ALPROTO_ENIP,
|
|
|
|
|
STREAM_TOSERVER | STREAM_TOCLIENT,
|
|
|
|
@ -1375,7 +1376,7 @@ pub unsafe extern "C" fn SCDetectEnipRegister() {
|
|
|
|
|
flags: 0,
|
|
|
|
|
};
|
|
|
|
|
G_ENIP_CIP_ATTRIBUTE_KW_ID = DetectHelperKeywordRegister(&kw);
|
|
|
|
|
G_ENIP_CIP_ATTRIBUTE_BUFFER_ID = DetectHelperBufferRegister(
|
|
|
|
|
G_ENIP_CIP_ATTRIBUTE_BUFFER_ID = SCDetectHelperBufferRegister(
|
|
|
|
|
b"enip.cip_attribute\0".as_ptr() as *const libc::c_char,
|
|
|
|
|
ALPROTO_ENIP,
|
|
|
|
|
STREAM_TOSERVER | STREAM_TOCLIENT,
|
|
|
|
@ -1390,7 +1391,7 @@ pub unsafe extern "C" fn SCDetectEnipRegister() {
|
|
|
|
|
flags: 0,
|
|
|
|
|
};
|
|
|
|
|
G_ENIP_CIP_CLASS_KW_ID = DetectHelperKeywordRegister(&kw);
|
|
|
|
|
G_ENIP_CIP_CLASS_BUFFER_ID = DetectHelperBufferRegister(
|
|
|
|
|
G_ENIP_CIP_CLASS_BUFFER_ID = SCDetectHelperBufferRegister(
|
|
|
|
|
b"enip.cip_class\0".as_ptr() as *const libc::c_char,
|
|
|
|
|
ALPROTO_ENIP,
|
|
|
|
|
STREAM_TOSERVER | STREAM_TOCLIENT,
|
|
|
|
@ -1405,7 +1406,7 @@ pub unsafe extern "C" fn SCDetectEnipRegister() {
|
|
|
|
|
flags: 0,
|
|
|
|
|
};
|
|
|
|
|
G_ENIP_VENDOR_ID_KW_ID = DetectHelperKeywordRegister(&kw);
|
|
|
|
|
G_ENIP_VENDOR_ID_BUFFER_ID = DetectHelperBufferRegister(
|
|
|
|
|
G_ENIP_VENDOR_ID_BUFFER_ID = SCDetectHelperBufferRegister(
|
|
|
|
|
b"enip.vendor_id\0".as_ptr() as *const libc::c_char,
|
|
|
|
|
ALPROTO_ENIP,
|
|
|
|
|
STREAM_TOSERVER | STREAM_TOCLIENT,
|
|
|
|
@ -1420,7 +1421,7 @@ pub unsafe extern "C" fn SCDetectEnipRegister() {
|
|
|
|
|
flags: 0,
|
|
|
|
|
};
|
|
|
|
|
G_ENIP_STATUS_KW_ID = DetectHelperKeywordRegister(&kw);
|
|
|
|
|
G_ENIP_STATUS_BUFFER_ID = DetectHelperBufferRegister(
|
|
|
|
|
G_ENIP_STATUS_BUFFER_ID = SCDetectHelperBufferRegister(
|
|
|
|
|
b"enip.status\0".as_ptr() as *const libc::c_char,
|
|
|
|
|
ALPROTO_ENIP,
|
|
|
|
|
STREAM_TOSERVER | STREAM_TOCLIENT,
|
|
|
|
@ -1435,7 +1436,7 @@ pub unsafe extern "C" fn SCDetectEnipRegister() {
|
|
|
|
|
flags: 0,
|
|
|
|
|
};
|
|
|
|
|
G_ENIP_STATE_KW_ID = DetectHelperKeywordRegister(&kw);
|
|
|
|
|
G_ENIP_STATE_BUFFER_ID = DetectHelperBufferRegister(
|
|
|
|
|
G_ENIP_STATE_BUFFER_ID = SCDetectHelperBufferRegister(
|
|
|
|
|
b"enip.state\0".as_ptr() as *const libc::c_char,
|
|
|
|
|
ALPROTO_ENIP,
|
|
|
|
|
STREAM_TOSERVER | STREAM_TOCLIENT,
|
|
|
|
@ -1450,7 +1451,7 @@ pub unsafe extern "C" fn SCDetectEnipRegister() {
|
|
|
|
|
flags: 0,
|
|
|
|
|
};
|
|
|
|
|
G_ENIP_SERIAL_KW_ID = DetectHelperKeywordRegister(&kw);
|
|
|
|
|
G_ENIP_SERIAL_BUFFER_ID = DetectHelperBufferRegister(
|
|
|
|
|
G_ENIP_SERIAL_BUFFER_ID = SCDetectHelperBufferRegister(
|
|
|
|
|
b"enip.serial\0".as_ptr() as *const libc::c_char,
|
|
|
|
|
ALPROTO_ENIP,
|
|
|
|
|
STREAM_TOSERVER | STREAM_TOCLIENT,
|
|
|
|
@ -1465,7 +1466,7 @@ pub unsafe extern "C" fn SCDetectEnipRegister() {
|
|
|
|
|
flags: 0,
|
|
|
|
|
};
|
|
|
|
|
G_ENIP_REVISION_KW_ID = DetectHelperKeywordRegister(&kw);
|
|
|
|
|
G_ENIP_REVISION_BUFFER_ID = DetectHelperBufferRegister(
|
|
|
|
|
G_ENIP_REVISION_BUFFER_ID = SCDetectHelperBufferRegister(
|
|
|
|
|
b"enip.revision\0".as_ptr() as *const libc::c_char,
|
|
|
|
|
ALPROTO_ENIP,
|
|
|
|
|
STREAM_TOSERVER | STREAM_TOCLIENT,
|
|
|
|
@ -1480,7 +1481,7 @@ pub unsafe extern "C" fn SCDetectEnipRegister() {
|
|
|
|
|
flags: 0,
|
|
|
|
|
};
|
|
|
|
|
G_ENIP_PROTOCOL_VERSION_KW_ID = DetectHelperKeywordRegister(&kw);
|
|
|
|
|
G_ENIP_PROTOCOL_VERSION_BUFFER_ID = DetectHelperBufferRegister(
|
|
|
|
|
G_ENIP_PROTOCOL_VERSION_BUFFER_ID = SCDetectHelperBufferRegister(
|
|
|
|
|
b"enip.protocol_version\0".as_ptr() as *const libc::c_char,
|
|
|
|
|
ALPROTO_ENIP,
|
|
|
|
|
STREAM_TOSERVER | STREAM_TOCLIENT,
|
|
|
|
@ -1495,7 +1496,7 @@ pub unsafe extern "C" fn SCDetectEnipRegister() {
|
|
|
|
|
flags: 0,
|
|
|
|
|
};
|
|
|
|
|
G_ENIP_PRODUCT_CODE_KW_ID = DetectHelperKeywordRegister(&kw);
|
|
|
|
|
G_ENIP_PRODUCT_CODE_BUFFER_ID = DetectHelperBufferRegister(
|
|
|
|
|
G_ENIP_PRODUCT_CODE_BUFFER_ID = SCDetectHelperBufferRegister(
|
|
|
|
|
b"enip.product_code\0".as_ptr() as *const libc::c_char,
|
|
|
|
|
ALPROTO_ENIP,
|
|
|
|
|
STREAM_TOSERVER | STREAM_TOCLIENT,
|
|
|
|
@ -1510,7 +1511,7 @@ pub unsafe extern "C" fn SCDetectEnipRegister() {
|
|
|
|
|
flags: 0,
|
|
|
|
|
};
|
|
|
|
|
G_ENIP_COMMAND_KW_ID = DetectHelperKeywordRegister(&kw);
|
|
|
|
|
G_ENIP_COMMAND_BUFFER_ID = DetectHelperBufferRegister(
|
|
|
|
|
G_ENIP_COMMAND_BUFFER_ID = SCDetectHelperBufferRegister(
|
|
|
|
|
b"enip.command\0".as_ptr() as *const libc::c_char,
|
|
|
|
|
ALPROTO_ENIP,
|
|
|
|
|
STREAM_TOSERVER | STREAM_TOCLIENT,
|
|
|
|
@ -1525,7 +1526,7 @@ pub unsafe extern "C" fn SCDetectEnipRegister() {
|
|
|
|
|
flags: 0,
|
|
|
|
|
};
|
|
|
|
|
G_ENIP_IDENTITY_STATUS_KW_ID = DetectHelperKeywordRegister(&kw);
|
|
|
|
|
G_ENIP_IDENTITY_STATUS_BUFFER_ID = DetectHelperBufferRegister(
|
|
|
|
|
G_ENIP_IDENTITY_STATUS_BUFFER_ID = SCDetectHelperBufferRegister(
|
|
|
|
|
b"enip.identity_status\0".as_ptr() as *const libc::c_char,
|
|
|
|
|
ALPROTO_ENIP,
|
|
|
|
|
STREAM_TOSERVER | STREAM_TOCLIENT,
|
|
|
|
@ -1540,7 +1541,7 @@ pub unsafe extern "C" fn SCDetectEnipRegister() {
|
|
|
|
|
flags: 0,
|
|
|
|
|
};
|
|
|
|
|
G_ENIP_DEVICE_TYPE_KW_ID = DetectHelperKeywordRegister(&kw);
|
|
|
|
|
G_ENIP_DEVICE_TYPE_BUFFER_ID = DetectHelperBufferRegister(
|
|
|
|
|
G_ENIP_DEVICE_TYPE_BUFFER_ID = SCDetectHelperBufferRegister(
|
|
|
|
|
b"enip.device_type\0".as_ptr() as *const libc::c_char,
|
|
|
|
|
ALPROTO_ENIP,
|
|
|
|
|
STREAM_TOSERVER | STREAM_TOCLIENT,
|
|
|
|
@ -1555,7 +1556,7 @@ pub unsafe extern "C" fn SCDetectEnipRegister() {
|
|
|
|
|
flags: 0,
|
|
|
|
|
};
|
|
|
|
|
G_ENIP_CIP_STATUS_KW_ID = DetectHelperKeywordRegister(&kw);
|
|
|
|
|
G_ENIP_CIP_STATUS_BUFFER_ID = DetectHelperBufferRegister(
|
|
|
|
|
G_ENIP_CIP_STATUS_BUFFER_ID = SCDetectHelperBufferRegister(
|
|
|
|
|
b"enip.cip_status\0".as_ptr() as *const libc::c_char,
|
|
|
|
|
ALPROTO_ENIP,
|
|
|
|
|
STREAM_TOSERVER | STREAM_TOCLIENT,
|
|
|
|
@ -1570,7 +1571,7 @@ pub unsafe extern "C" fn SCDetectEnipRegister() {
|
|
|
|
|
flags: 0,
|
|
|
|
|
};
|
|
|
|
|
G_ENIP_CIP_INSTANCE_KW_ID = DetectHelperKeywordRegister(&kw);
|
|
|
|
|
G_ENIP_CIP_INSTANCE_BUFFER_ID = DetectHelperBufferRegister(
|
|
|
|
|
G_ENIP_CIP_INSTANCE_BUFFER_ID = SCDetectHelperBufferRegister(
|
|
|
|
|
b"enip.cip_instance\0".as_ptr() as *const libc::c_char,
|
|
|
|
|
ALPROTO_ENIP,
|
|
|
|
|
STREAM_TOSERVER | STREAM_TOCLIENT,
|
|
|
|
@ -1586,7 +1587,7 @@ pub unsafe extern "C" fn SCDetectEnipRegister() {
|
|
|
|
|
flags: 0,
|
|
|
|
|
};
|
|
|
|
|
G_ENIP_CIP_EXTENDEDSTATUS_KW_ID = DetectHelperKeywordRegister(&kw);
|
|
|
|
|
G_ENIP_CIP_EXTENDEDSTATUS_BUFFER_ID = DetectHelperBufferRegister(
|
|
|
|
|
G_ENIP_CIP_EXTENDEDSTATUS_BUFFER_ID = SCDetectHelperBufferRegister(
|
|
|
|
|
b"enip.cip_extendedstatus\0".as_ptr() as *const libc::c_char,
|
|
|
|
|
ALPROTO_ENIP,
|
|
|
|
|
STREAM_TOSERVER | STREAM_TOCLIENT,
|
|
|
|
|