rust/ffi: move direction to ffi

Ticket: 7666
This commit is contained in:
Philippe Antoine 2026-05-11 22:22:23 +02:00 committed by Victor Julien
parent 5440e41314
commit 2525ea2e37
3 changed files with 6 additions and 8 deletions

View file

@ -15,13 +15,16 @@
* 02110-1301, USA.
*/
use crate::debug_validate_fail;
pub const DIR_BOTH: u8 = 0b0000_1100;
const DIR_TOSERVER: u8 = 0b0000_0100;
const DIR_TOCLIENT: u8 = 0b0000_1000;
#[repr(C)]
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
#[derive(Debug, Default, PartialEq, Eq, Clone, Copy)]
pub enum Direction {
#[default]
ToServer = 0x04,
ToClient = 0x08,
}
@ -45,12 +48,6 @@ impl Direction {
}
}
impl Default for Direction {
fn default() -> Self {
Direction::ToServer
}
}
impl std::fmt::Display for Direction {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {

View file

@ -19,6 +19,7 @@ pub mod applayer;
pub mod conf;
pub mod debug;
pub mod detect;
pub mod direction;
pub mod eve;
pub mod flow;
pub mod jsonbuilder;

View file

@ -139,7 +139,7 @@ pub mod feature;
pub mod sdp;
pub mod ldap;
pub mod flow;
pub mod direction;
pub use suricata_ffi::direction;
#[allow(unused_imports)]
pub use suricata_lua_sys;