mirror of
https://github.com/OISF/suricata.git
synced 2026-10-12 02:07:10 +00:00
rust/ffi: move build_slice macro to ffi crate
Ticket: 7666
This commit is contained in:
committed by
Victor Julien
parent
4a0143c8d4
commit
d77c43c79b
@@ -32,8 +32,8 @@ use suricata::applayer::{
|
||||
};
|
||||
use suricata::applayer::{AppLayerResultRust, StreamSliceRust};
|
||||
use suricata::conf::conf_get;
|
||||
use suricata::{build_slice, export_state_data_get, export_tx_data_get};
|
||||
use suricata_ffi::{cast_pointer, SCLogError, SCLogNotice, IPPROTO_TCP};
|
||||
use suricata::{export_state_data_get, export_tx_data_get};
|
||||
use suricata_ffi::{build_slice, cast_pointer, SCLogError, SCLogNotice, IPPROTO_TCP};
|
||||
use suricata_sys::sys::AppProtoEnum::ALPROTO_UNKNOWN;
|
||||
use suricata_sys::sys::{
|
||||
AppLayerParser, AppLayerParserState, AppLayerProtocolDetect, AppLayerResult, AppLayerStateData,
|
||||
|
||||
@@ -32,3 +32,13 @@ macro_rules! cast_pointer {
|
||||
&mut *($ptr as *mut $ty)
|
||||
};
|
||||
}
|
||||
|
||||
/// Create a slice, given a buffer and a length
|
||||
///
|
||||
/// UNSAFE !
|
||||
#[macro_export]
|
||||
macro_rules! build_slice {
|
||||
($buf:ident, $len:expr) => {
|
||||
std::slice::from_raw_parts($buf, $len)
|
||||
};
|
||||
}
|
||||
|
||||
@@ -332,14 +332,6 @@ pub struct RustParser {
|
||||
pub get_state_name_by_id: Option<GetStateNameById>,
|
||||
}
|
||||
|
||||
/// Create a slice, given a buffer and a length
|
||||
///
|
||||
/// UNSAFE !
|
||||
#[macro_export]
|
||||
macro_rules! build_slice {
|
||||
($buf:ident, $len:expr) => ( std::slice::from_raw_parts($buf, $len) );
|
||||
}
|
||||
|
||||
pub trait AppLayerGetFileStateRust {
|
||||
fn err() -> Self;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
//! Utility library module for commonly used strings, hexadecimals and other elements.
|
||||
|
||||
use super::build_slice;
|
||||
use crate::jsonbuilder::HEX;
|
||||
use std::ffi::CString;
|
||||
use std::os::raw::c_char;
|
||||
|
||||
Reference in New Issue
Block a user