Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[draft] bindgen poc - v1 #12018

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions rust/Cargo.toml.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ license = "GPL-2.0-only"
description = "Suricata Rust components"
edition = "2021"
rust-version = "1.67.1"
build = "src/build.rs"

[workspace]
members = [".", "./derive"]
Expand Down Expand Up @@ -72,3 +73,11 @@ suricata-lua-sys = { version = "0.1.0-alpha.1" }
[dev-dependencies]
test-case = "~3.3.1"
hex = "~0.4.3"

[build-dependencies]
# Pin as bindgen 0.70.1 requires Rust 1.70.0+
bindgen = "=0.69.4"

# Most recent version to support Rust 1.67. 0.5.9 requires 1.70.0.
# - Not used directly but Suricata, but by bindgen.
home = "=0.5.5"
13 changes: 5 additions & 8 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 @@ -369,12 +369,12 @@ pub struct RustParser {
pub tx_comp_st_ts: c_int,
pub tx_comp_st_tc: c_int,
/// Function returning the current transaction progress
pub tx_get_progress: StateGetProgressFn,
pub tx_get_progress: crate::sys::SCAppLayerStateGetProgressFn,

/// Function to get an event id from a description
pub get_eventinfo: Option<GetEventInfoFn>,
pub get_eventinfo: crate::sys::SCAppLayerStateGetEventInfoFn,
/// Function to get an event description from an event id
pub get_eventinfo_byid: Option<GetEventInfoByIdFn>,
pub get_eventinfo_byid: crate::sys::SCAppLayerStateGetEventInfoByIdFn,

/// Function to allocate local storage
pub localstorage_new: Option<LocalStorageNewFn>,
Expand Down Expand Up @@ -443,9 +443,6 @@ pub type StateFreeFn = unsafe extern "C" fn (*mut c_void);
pub type StateTxFreeFn = unsafe extern "C" fn (*mut c_void, u64);
pub type StateGetTxFn = unsafe extern "C" fn (*mut c_void, u64) -> *mut c_void;
pub type StateGetTxCntFn = unsafe extern "C" fn (*mut c_void) -> u64;
pub type StateGetProgressFn = unsafe extern "C" fn (*mut c_void, u8) -> c_int;
pub type GetEventInfoFn = unsafe extern "C" fn (*const c_char, *mut c_int, *mut AppLayerEventType) -> c_int;
pub type GetEventInfoByIdFn = unsafe extern "C" fn (c_int, *mut *const c_char, *mut AppLayerEventType) -> c_int;
pub type LocalStorageNewFn = extern "C" fn () -> *mut c_void;
pub type LocalStorageFreeFn = extern "C" fn (*mut c_void);
pub type GetTxFilesFn = unsafe extern "C" fn (*mut c_void, u8) -> AppLayerGetFileState;
Expand Down Expand Up @@ -622,7 +619,7 @@ pub unsafe fn get_event_info<T: AppLayerEvent>(
Ok(Some(event)) => event.as_i32(),
_ => -1,
};
*event_type = core::AppLayerEventType::APP_LAYER_EVENT_TYPE_TRANSACTION;
*event_type = crate::sys::AppLayerEventType::APP_LAYER_EVENT_TYPE_TRANSACTION;
*event_id = event as std::os::raw::c_int;
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion rust/src/applayertemplate/template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ pub unsafe extern "C" fn rs_template_register_parser() {
get_tx: rs_template_state_get_tx,
tx_comp_st_ts: 1,
tx_comp_st_tc: 1,
tx_get_progress: rs_template_tx_get_alstate_progress,
tx_get_progress: Some(rs_template_tx_get_alstate_progress),
get_eventinfo: Some(TemplateEvent::get_event_info),
get_eventinfo_byid: Some(TemplateEvent::get_event_info_by_id),
localstorage_new: None,
Expand Down
2 changes: 1 addition & 1 deletion rust/src/bittorrent_dht/bittorrent_dht.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ pub unsafe extern "C" fn rs_bittorrent_dht_udp_register_parser() {
get_tx: rs_bittorrent_dht_state_get_tx,
tx_comp_st_ts: 1,
tx_comp_st_tc: 1,
tx_get_progress: rs_bittorrent_dht_tx_get_alstate_progress,
tx_get_progress: Some(rs_bittorrent_dht_tx_get_alstate_progress),
get_eventinfo: Some(BitTorrentDHTEvent::get_event_info),
get_eventinfo_byid: Some(BitTorrentDHTEvent::get_event_info_by_id),
localstorage_new: None,
Expand Down
28 changes: 28 additions & 0 deletions rust/src/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// builds.rs for Suricata
//
// Currently this build.rs only uses bindgen to build some Rust
// bindings to the Suricata C code.
//
// For more info on Rust and the build.rs file, see:
// https://doc.rust-lang.org/cargo/reference/build-scripts.html
fn main() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add some explanation here and also to the commit about why we need build.rs and what it does?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Broke the commit that introduced bindgen, and made use of the bindings into 2. Added some more comments to the code and the commit that introduces bindgen.

// Pull in a simple header that presents no issues with bindgen at
// this time. Multiple headers can be specified.
let bindings = bindgen::Builder::default()
.header("../src/app-layer-ext.h")
.parse_callbacks(Box::new(bindgen::CargoCallbacks::new()))
.allowlist_item("SC.*")
.allowlist_item("AppLayer.*")
.rustified_enum("AppLayerEventType")
.generate()
.unwrap();

// Write out the bindings. *Rules* say we should only write into
// the target directory (idiomatically the OUT_DIR env var), so
// we'll pull them into our namespace using an include!() macro
// (current in sys.rs).
let out_path = std::path::PathBuf::from(std::env::var("OUT_DIR").unwrap());
bindings
.write_to_file(out_path.join("bindings.rs"))
.unwrap();
}
9 changes: 2 additions & 7 deletions rust/src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,8 @@ use crate::debug_validate_fail;
pub enum DetectEngineState {}
pub enum AppLayerDecoderEvents {}

#[repr(C)]
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
#[allow(non_camel_case_types)]
pub enum AppLayerEventType {
APP_LAYER_EVENT_TYPE_TRANSACTION = 1,
APP_LAYER_EVENT_TYPE_PACKET = 2,
}
/// Re-export for now.
pub use crate::sys::AppLayerEventType;

pub const STREAM_START: u8 = 0x01;
pub const STREAM_EOF: u8 = 0x02;
Expand Down
2 changes: 1 addition & 1 deletion rust/src/dcerpc/dcerpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1332,7 +1332,7 @@ pub unsafe extern "C" fn rs_dcerpc_register_parser() {
get_tx: rs_dcerpc_get_tx,
tx_comp_st_ts: 1,
tx_comp_st_tc: 1,
tx_get_progress: rs_dcerpc_get_alstate_progress,
tx_get_progress: Some(rs_dcerpc_get_alstate_progress),
get_eventinfo: None,
get_eventinfo_byid : None,
localstorage_new: None,
Expand Down
2 changes: 1 addition & 1 deletion rust/src/dcerpc/dcerpc_udp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ pub unsafe extern "C" fn rs_dcerpc_udp_register_parser() {
get_tx: rs_dcerpc_udp_get_tx,
tx_comp_st_ts: 1,
tx_comp_st_tc: 1,
tx_get_progress: rs_dcerpc_get_alstate_progress,
tx_get_progress: Some(rs_dcerpc_get_alstate_progress),
get_eventinfo: None,
get_eventinfo_byid: None,
localstorage_new: None,
Expand Down
2 changes: 1 addition & 1 deletion rust/src/dhcp/dhcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ pub unsafe extern "C" fn rs_dhcp_register_parser() {
get_tx : rs_dhcp_state_get_tx,
tx_comp_st_ts : 1,
tx_comp_st_tc : 1,
tx_get_progress : rs_dhcp_tx_get_alstate_progress,
tx_get_progress : Some(rs_dhcp_tx_get_alstate_progress),
get_eventinfo : Some(DHCPEvent::get_event_info),
get_eventinfo_byid : Some(DHCPEvent::get_event_info_by_id),
localstorage_new : None,
Expand Down
4 changes: 2 additions & 2 deletions rust/src/dns/dns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1031,7 +1031,7 @@ pub unsafe extern "C" fn SCRegisterDnsUdpParser() {
get_tx: state_get_tx,
tx_comp_st_ts: 1,
tx_comp_st_tc: 1,
tx_get_progress: tx_get_alstate_progress,
tx_get_progress: Some(tx_get_alstate_progress),
get_eventinfo: Some(DNSEvent::get_event_info),
get_eventinfo_byid: Some(DNSEvent::get_event_info_by_id),
localstorage_new: None,
Expand Down Expand Up @@ -1076,7 +1076,7 @@ pub unsafe extern "C" fn SCRegisterDnsTcpParser() {
get_tx: state_get_tx,
tx_comp_st_ts: 1,
tx_comp_st_tc: 1,
tx_get_progress: tx_get_alstate_progress,
tx_get_progress: Some(tx_get_alstate_progress),
get_eventinfo: Some(DNSEvent::get_event_info),
get_eventinfo_byid: Some(DNSEvent::get_event_info_by_id),
localstorage_new: None,
Expand Down
2 changes: 1 addition & 1 deletion rust/src/enip/enip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ pub unsafe extern "C" fn SCEnipRegisterParsers() {
get_tx: rs_enip_state_get_tx,
tx_comp_st_ts: 1,
tx_comp_st_tc: 1,
tx_get_progress: rs_enip_tx_get_alstate_progress,
tx_get_progress: Some(rs_enip_tx_get_alstate_progress),
get_eventinfo: Some(EnipEvent::get_event_info),
get_eventinfo_byid: Some(EnipEvent::get_event_info_by_id),
localstorage_new: None,
Expand Down
2 changes: 1 addition & 1 deletion rust/src/http2/http2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1539,7 +1539,7 @@ pub unsafe extern "C" fn rs_http2_register_parser() {
get_tx: rs_http2_state_get_tx,
tx_comp_st_ts: HTTP2TransactionState::HTTP2StateClosed as i32,
tx_comp_st_tc: HTTP2TransactionState::HTTP2StateClosed as i32,
tx_get_progress: rs_http2_tx_get_alstate_progress,
tx_get_progress: Some(rs_http2_tx_get_alstate_progress),
get_eventinfo: Some(HTTP2Event::get_event_info),
get_eventinfo_byid: Some(HTTP2Event::get_event_info_by_id),
localstorage_new: None,
Expand Down
2 changes: 1 addition & 1 deletion rust/src/ike/ike.rs
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ pub unsafe extern "C" fn rs_ike_register_parser() {
get_tx: rs_ike_state_get_tx,
tx_comp_st_ts: 1,
tx_comp_st_tc: 1,
tx_get_progress: rs_ike_tx_get_alstate_progress,
tx_get_progress: Some(rs_ike_tx_get_alstate_progress),
get_eventinfo: Some(IkeEvent::get_event_info),
get_eventinfo_byid: Some(IkeEvent::get_event_info_by_id),
localstorage_new: None,
Expand Down
2 changes: 1 addition & 1 deletion rust/src/krb/krb5.rs
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ pub unsafe extern "C" fn rs_register_krb5_parser() {
get_tx : rs_krb5_state_get_tx,
tx_comp_st_ts : 1,
tx_comp_st_tc : 1,
tx_get_progress : rs_krb5_tx_get_alstate_progress,
tx_get_progress : Some(rs_krb5_tx_get_alstate_progress),
get_eventinfo : Some(KRB5Event::get_event_info),
get_eventinfo_byid : Some(KRB5Event::get_event_info_by_id),
localstorage_new : None,
Expand Down
4 changes: 2 additions & 2 deletions rust/src/ldap/ldap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ pub unsafe extern "C" fn SCRegisterLdapTcpParser() {
get_tx: SCLdapStateGetTx,
tx_comp_st_ts: 1,
tx_comp_st_tc: 1,
tx_get_progress: SCLdapTxGetAlstateProgress,
tx_get_progress: Some(SCLdapTxGetAlstateProgress),
get_eventinfo: Some(LdapEvent::get_event_info),
get_eventinfo_byid: Some(LdapEvent::get_event_info_by_id),
localstorage_new: None,
Expand Down Expand Up @@ -692,7 +692,7 @@ pub unsafe extern "C" fn SCRegisterLdapUdpParser() {
get_tx: SCLdapStateGetTx,
tx_comp_st_ts: 1,
tx_comp_st_tc: 1,
tx_get_progress: SCLdapTxGetAlstateProgress,
tx_get_progress: Some(SCLdapTxGetAlstateProgress),
get_eventinfo: Some(LdapEvent::get_event_info),
get_eventinfo_byid: Some(LdapEvent::get_event_info_by_id),
localstorage_new: None,
Expand Down
3 changes: 3 additions & 0 deletions rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,6 @@ pub mod ldap;

#[allow(unused_imports)]
pub use suricata_lua_sys;

// Generated Rust bindings from C.
pub mod sys;
2 changes: 1 addition & 1 deletion rust/src/modbus/modbus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ pub unsafe extern "C" fn rs_modbus_register_parser() {
get_tx: rs_modbus_state_get_tx,
tx_comp_st_ts: 1,
tx_comp_st_tc: 1,
tx_get_progress: rs_modbus_tx_get_alstate_progress,
tx_get_progress: Some(rs_modbus_tx_get_alstate_progress),
get_eventinfo: Some(ModbusEvent::get_event_info),
get_eventinfo_byid: Some(ModbusEvent::get_event_info_by_id),
localstorage_new: None,
Expand Down
2 changes: 1 addition & 1 deletion rust/src/mqtt/mqtt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ pub unsafe extern "C" fn SCMqttRegisterParser() {
get_tx: rs_mqtt_state_get_tx,
tx_comp_st_ts: 1,
tx_comp_st_tc: 1,
tx_get_progress: rs_mqtt_tx_get_alstate_progress,
tx_get_progress: Some(rs_mqtt_tx_get_alstate_progress),
get_eventinfo: Some(MQTTEvent::get_event_info),
get_eventinfo_byid: Some(MQTTEvent::get_event_info_by_id),
localstorage_new: None,
Expand Down
4 changes: 2 additions & 2 deletions rust/src/nfs/nfs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1978,7 +1978,7 @@ pub unsafe extern "C" fn rs_nfs_register_parser() {
get_tx: rs_nfs_state_get_tx,
tx_comp_st_ts: 1,
tx_comp_st_tc: 1,
tx_get_progress: rs_nfs_tx_get_alstate_progress,
tx_get_progress: Some(rs_nfs_tx_get_alstate_progress),
get_eventinfo: Some(NFSEvent::get_event_info),
get_eventinfo_byid : Some(NFSEvent::get_event_info_by_id),
localstorage_new: None,
Expand Down Expand Up @@ -2055,7 +2055,7 @@ pub unsafe extern "C" fn rs_nfs_udp_register_parser() {
get_tx: rs_nfs_state_get_tx,
tx_comp_st_ts: 1,
tx_comp_st_tc: 1,
tx_get_progress: rs_nfs_tx_get_alstate_progress,
tx_get_progress: Some(rs_nfs_tx_get_alstate_progress),
get_eventinfo: Some(NFSEvent::get_event_info),
get_eventinfo_byid : Some(NFSEvent::get_event_info_by_id),
localstorage_new: None,
Expand Down
2 changes: 1 addition & 1 deletion rust/src/ntp/ntp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ pub unsafe extern "C" fn rs_register_ntp_parser() {
get_tx : rs_ntp_state_get_tx,
tx_comp_st_ts : 1,
tx_comp_st_tc : 1,
tx_get_progress : rs_ntp_tx_get_alstate_progress,
tx_get_progress : Some(rs_ntp_tx_get_alstate_progress),
get_eventinfo : Some(NTPEvent::get_event_info),
get_eventinfo_byid : Some(NTPEvent::get_event_info_by_id),
localstorage_new : None,
Expand Down
2 changes: 1 addition & 1 deletion rust/src/pgsql/pgsql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ pub unsafe extern "C" fn SCRegisterPgsqlParser() {
get_tx: SCPgsqlStateGetTx,
tx_comp_st_ts: PgsqlTxProgress::TxDone as i32,
tx_comp_st_tc: PgsqlTxProgress::TxDone as i32,
tx_get_progress: SCPgsqlTxGetALStateProgress,
tx_get_progress: Some(SCPgsqlTxGetALStateProgress),
get_eventinfo: None,
get_eventinfo_byid: None,
localstorage_new: None,
Expand Down
2 changes: 1 addition & 1 deletion rust/src/quic/quic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ pub unsafe extern "C" fn rs_quic_register_parser() {
get_tx: rs_quic_state_get_tx,
tx_comp_st_ts: 1,
tx_comp_st_tc: 1,
tx_get_progress: rs_quic_tx_get_alstate_progress,
tx_get_progress: Some(rs_quic_tx_get_alstate_progress),
get_eventinfo: Some(QuicEvent::get_event_info),
get_eventinfo_byid: Some(QuicEvent::get_event_info_by_id),
localstorage_new: None,
Expand Down
2 changes: 1 addition & 1 deletion rust/src/rdp/rdp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ pub unsafe extern "C" fn rs_rdp_register_parser() {
get_tx: rs_rdp_state_get_tx,
tx_comp_st_ts: 1,
tx_comp_st_tc: 1,
tx_get_progress: rs_rdp_tx_get_progress,
tx_get_progress: Some(rs_rdp_tx_get_progress),
get_eventinfo: None,
get_eventinfo_byid: None,
localstorage_new: None,
Expand Down
2 changes: 1 addition & 1 deletion rust/src/rfb/rfb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,7 @@ pub unsafe extern "C" fn SCRfbRegisterParser() {
get_tx: rs_rfb_state_get_tx,
tx_comp_st_ts: 1,
tx_comp_st_tc: 1,
tx_get_progress: rs_rfb_tx_get_alstate_progress,
tx_get_progress: Some(rs_rfb_tx_get_alstate_progress),
get_eventinfo: Some(RFBEvent::get_event_info),
get_eventinfo_byid: Some(RFBEvent::get_event_info_by_id),
localstorage_new: None,
Expand Down
2 changes: 1 addition & 1 deletion rust/src/sip/sip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ pub unsafe extern "C" fn rs_sip_register_parser() {
get_tx: rs_sip_state_get_tx,
tx_comp_st_ts: 1,
tx_comp_st_tc: 1,
tx_get_progress: rs_sip_tx_get_alstate_progress,
tx_get_progress: Some(rs_sip_tx_get_alstate_progress),
get_eventinfo: Some(SIPEvent::get_event_info),
get_eventinfo_byid: Some(SIPEvent::get_event_info_by_id),
localstorage_new: None,
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 @@ -2299,7 +2299,7 @@ pub unsafe extern "C" fn rs_smb_register_parser() {
get_tx: rs_smb_state_get_tx,
tx_comp_st_ts: 1,
tx_comp_st_tc: 1,
tx_get_progress: rs_smb_tx_get_alstate_progress,
tx_get_progress: Some(rs_smb_tx_get_alstate_progress),
get_eventinfo: Some(rs_smb_state_get_event_info),
get_eventinfo_byid : Some(rs_smb_state_get_event_info_by_id),
localstorage_new: None,
Expand Down
2 changes: 1 addition & 1 deletion rust/src/snmp/snmp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ pub unsafe extern "C" fn rs_register_snmp_parser() {
get_tx : rs_snmp_state_get_tx,
tx_comp_st_ts : 1,
tx_comp_st_tc : 1,
tx_get_progress : rs_snmp_tx_get_alstate_progress,
tx_get_progress : Some(rs_snmp_tx_get_alstate_progress),
get_eventinfo : Some(SNMPEvent::get_event_info),
get_eventinfo_byid : Some(SNMPEvent::get_event_info_by_id),
localstorage_new : None,
Expand Down
2 changes: 1 addition & 1 deletion rust/src/ssh/ssh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ pub unsafe extern "C" fn rs_ssh_register_parser() {
get_tx: rs_ssh_state_get_tx,
tx_comp_st_ts: SSHConnectionState::SshStateFinished as i32,
tx_comp_st_tc: SSHConnectionState::SshStateFinished as i32,
tx_get_progress: rs_ssh_tx_get_alstate_progress,
tx_get_progress: Some(rs_ssh_tx_get_alstate_progress),
get_eventinfo: Some(SSHEvent::get_event_info),
get_eventinfo_byid: Some(SSHEvent::get_event_info_by_id),
localstorage_new: None,
Expand Down
20 changes: 20 additions & 0 deletions rust/src/sys.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/* Copyright (C) 2024 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.
*/

#![allow(non_camel_case_types)]

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sys is used, as naming crates sometime-sys is idiomatic for crates that pull in a C library into Rust.

include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
2 changes: 1 addition & 1 deletion rust/src/telnet/telnet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ pub unsafe extern "C" fn rs_telnet_register_parser() {
get_tx: rs_telnet_state_get_tx,
tx_comp_st_ts: 1,
tx_comp_st_tc: 1,
tx_get_progress: rs_telnet_tx_get_alstate_progress,
tx_get_progress: Some(rs_telnet_tx_get_alstate_progress),
get_eventinfo: Some(TelnetEvent::get_event_info),
get_eventinfo_byid : Some(TelnetEvent::get_event_info_by_id),
localstorage_new: None,
Expand Down
2 changes: 1 addition & 1 deletion rust/src/websocket/websocket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ pub unsafe extern "C" fn rs_websocket_register_parser() {
get_tx: rs_websocket_state_get_tx,
tx_comp_st_ts: 1,
tx_comp_st_tc: 1,
tx_get_progress: rs_websocket_tx_get_alstate_progress,
tx_get_progress: Some(rs_websocket_tx_get_alstate_progress),
get_eventinfo: Some(WebSocketEvent::get_event_info),
get_eventinfo_byid: Some(WebSocketEvent::get_event_info_by_id),
localstorage_new: None,
Expand Down
1 change: 1 addition & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ noinst_HEADERS = \
app-layer-dnp3-objects.h \
app-layer-events.h \
app-layer-expectation.h \
app-layer-ext.h \
app-layer-frames.h \
app-layer-ftp.h \
app-layer.h \
Expand Down
Loading
Loading