diff --git a/examples/plugins/altemplate/src/template.rs b/examples/plugins/altemplate/src/template.rs index 5d5180411c..eb697a54a8 100644 --- a/examples/plugins/altemplate/src/template.rs +++ b/examples/plugins/altemplate/src/template.rs @@ -32,9 +32,8 @@ use suricata::applayer::{ }; use suricata::applayer::{AppLayerResultRust, StreamSliceRust}; use suricata::conf::conf_get; -use suricata::core::IPPROTO_TCP; use suricata::{build_slice, cast_pointer, export_state_data_get, export_tx_data_get}; -use suricata_ffi::{SCLogError, SCLogNotice}; +use suricata_ffi::{SCLogError, SCLogNotice, IPPROTO_TCP}; use suricata_sys::sys::AppProtoEnum::ALPROTO_UNKNOWN; use suricata_sys::sys::{ AppLayerParser, AppLayerParserState, AppLayerProtocolDetect, AppLayerResult, AppLayerStateData, diff --git a/rust/ffi/src/lib.rs b/rust/ffi/src/lib.rs index 5d3c85662b..4987a87c98 100644 --- a/rust/ffi/src/lib.rs +++ b/rust/ffi/src/lib.rs @@ -19,3 +19,6 @@ pub mod debug; pub mod eve; pub mod jsonbuilder; pub mod plugin; + +pub const IPPROTO_TCP: u8 = 6; +pub const IPPROTO_UDP: u8 = 17; diff --git a/rust/src/core.rs b/rust/src/core.rs index f3a226ac9f..ef2db3dc0a 100644 --- a/rust/src/core.rs +++ b/rust/src/core.rs @@ -36,8 +36,8 @@ pub const STREAM_MIDSTREAM:u8 = 0x40; pub const ALPROTO_UNKNOWN : AppProto = AppProtoEnum::ALPROTO_UNKNOWN as AppProto; pub const ALPROTO_FAILED : AppProto = AppProtoEnum::ALPROTO_FAILED as AppProto; -pub const IPPROTO_TCP : u8 = 6; -pub const IPPROTO_UDP : u8 = 17; +pub use suricata_ffi::IPPROTO_TCP; +pub use suricata_ffi::IPPROTO_UDP; macro_rules!BIT_U8 { diff --git a/rust/src/lib.rs b/rust/src/lib.rs index 431e423279..51f9824af9 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -130,7 +130,6 @@ pub mod ssh; pub mod http2; pub mod quic; pub mod bittorrent_dht; -pub mod plugin; pub mod lzma; pub mod util; pub mod ffi; diff --git a/rust/src/plugin.rs b/rust/src/plugin.rs deleted file mode 100644 index b84ac93380..0000000000 --- a/rust/src/plugin.rs +++ /dev/null @@ -1,27 +0,0 @@ -/* Copyright (C) 2020 Open Information Security Foundation - * - * You can copy, redistribute or modify this Program under the terms of - * the GNU General Public License version 2 as published by the Free - * Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * version 2 along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - * 02110-1301, USA. - */ - -//! Plugin utility module. - -use suricata_sys::sys::SCLogGetLogLevel; - -pub fn init() { - unsafe { - // maybe we can get rid of this... - crate::debug::LEVEL = SCLogGetLogLevel(); - } -}