Skip to content

Commit

Permalink
rust: fix compile issues after change to bindgen
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonish committed Oct 23, 2024
1 parent 3e4f196 commit 7739953
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion rust/derive/src/applayerevent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ pub fn derive_app_layer_event(input: TokenStream) -> TokenStream {
event_id: std::os::raw::c_int,
event_name: *mut *const std::os::raw::c_char,
event_type: *mut #crate_id::core::AppLayerEventType,
) -> i8 {
) -> std::os::raw::c_int {
#crate_id::applayer::get_event_info_by_id::<#name>(event_id, event_name, event_type)
}

Expand Down
6 changes: 3 additions & 3 deletions rust/src/applayer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
//! Parser registration functions and common interface module.
use std;
use crate::core::{self,DetectEngineState,Flow,AppLayerEventType,AppProto,Direction};
use crate::core::{self,DetectEngineState,Flow,AppProto,Direction};
use crate::filecontainer::FileContainer;
use std::os::raw::{c_void,c_char,c_int};
use crate::core::SC;
Expand Down Expand Up @@ -587,7 +587,7 @@ pub trait AppLayerEvent {
event_id: std::os::raw::c_int,
event_name: *mut *const std::os::raw::c_char,
event_type: *mut core::AppLayerEventType,
) -> i8;
) -> std::os::raw::c_int;
}

/// Generic `get_info_info` implementation for enums implementing
Expand Down Expand Up @@ -631,7 +631,7 @@ pub unsafe fn get_event_info_by_id<T: AppLayerEvent>(
event_id: std::os::raw::c_int,
event_name: *mut *const std::os::raw::c_char,
event_type: *mut core::AppLayerEventType,
) -> i8 {
) -> std::os::raw::c_int {
if let Some(e) = T::from_id(event_id) {
*event_name = e.to_cstring().as_ptr() as *const std::os::raw::c_char;
*event_type = core::AppLayerEventType::APP_LAYER_EVENT_TYPE_TRANSACTION;
Expand Down
2 changes: 1 addition & 1 deletion rust/src/smb/smb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2206,7 +2206,7 @@ pub unsafe extern "C" fn rs_smb_state_get_event_info_by_id(
event_id: std::os::raw::c_int,
event_name: *mut *const std::os::raw::c_char,
event_type: *mut AppLayerEventType,
) -> i8 {
) -> std::os::raw::c_int {
SMBEvent::get_event_info_by_id(event_id, event_name, event_type)
}

Expand Down

0 comments on commit 7739953

Please sign in to comment.