rust/ffi: move IPPROTO_TCP to ffi

and reexport in suricata

Allows to reduce dependencies to full suricata crate

Ticket: 7666
pull/14888/head
Philippe Antoine 2 months ago committed by Victor Julien
parent 2a90cef318
commit 71b59f6dbe

@ -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,

@ -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;

@ -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 {

@ -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;

@ -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();
}
}
Loading…
Cancel
Save