use std::ptr;
#[no_mangle]
-pub unsafe extern "C" fn rs_quic_tx_get_ua(
+pub unsafe extern "C" fn SCQuicTxGetUa(
tx: &QuicTransaction, buffer: *mut *const u8, buffer_len: *mut u32,
) -> u8 {
if let Some(ua) = &tx.ua {
}
#[no_mangle]
-pub unsafe extern "C" fn rs_quic_tx_get_sni(
+pub unsafe extern "C" fn SCQuicTxGetSni(
tx: &QuicTransaction, buffer: *mut *const u8, buffer_len: *mut u32,
) -> u8 {
if let Some(sni) = &tx.sni {
}
#[no_mangle]
-pub unsafe extern "C" fn rs_quic_tx_get_ja3(
+pub unsafe extern "C" fn SCQuicTxGetJa3(
tx: &QuicTransaction, buffer: *mut *const u8, buffer_len: *mut u32,
) -> u8 {
if let Some(ja3) = &tx.ja3 {
}
#[no_mangle]
-pub unsafe extern "C" fn rs_quic_tx_get_ja4(
+pub unsafe extern "C" fn SCQuicTxGetJa4(
tx: &QuicTransaction, buffer: *mut *const u8, buffer_len: *mut u32,
) -> u8 {
if let Some(ja4) = &tx.ja4 {
}
#[no_mangle]
-pub unsafe extern "C" fn rs_quic_tx_get_version(
+pub unsafe extern "C" fn SCQuicTxGetVersion(
tx: &QuicTransaction, buffer: *mut *const u8, buffer_len: *mut u32,
) -> u8 {
if tx.header.flags.is_long {
}
#[no_mangle]
-pub unsafe extern "C" fn rs_quic_tx_get_cyu_hash(
+pub unsafe extern "C" fn SCQuicTxGetCyuHash(
_de: *mut DetectEngineThreadCtx, tx: *const c_void, _flags: u8, i: u32, buffer: *mut *const u8,
buffer_len: *mut u32,
) -> bool {
}
#[no_mangle]
-pub unsafe extern "C" fn rs_quic_tx_get_cyu_string(
+pub unsafe extern "C" fn SCQuicTxGetCyuString(
_de: *mut DetectEngineThreadCtx, tx: *const c_void, _flags: u8, i: u32, buffer: *mut *const u8,
buffer_len: *mut u32,
) -> bool {
}
}
-#[no_mangle]
-pub extern "C" fn rs_quic_state_new(
+extern "C" fn quic_state_new(
_orig_state: *mut std::os::raw::c_void, _orig_proto: AppProto,
) -> *mut std::os::raw::c_void {
let state = QuicState::new();
return Box::into_raw(boxed) as *mut _;
}
-#[no_mangle]
-pub extern "C" fn rs_quic_state_free(state: *mut std::os::raw::c_void) {
+extern "C" fn quic_state_free(state: *mut std::os::raw::c_void) {
// Just unbox...
std::mem::drop(unsafe { Box::from_raw(state as *mut QuicState) });
}
-#[no_mangle]
-pub unsafe extern "C" fn rs_quic_state_tx_free(state: *mut std::os::raw::c_void, tx_id: u64) {
+unsafe extern "C" fn quic_state_tx_free(state: *mut std::os::raw::c_void, tx_id: u64) {
let state = cast_pointer!(state, QuicState);
state.free_tx(tx_id);
}
-#[no_mangle]
-pub unsafe extern "C" fn rs_quic_probing_parser(
+unsafe extern "C" fn quic_probing_parser(
_flow: *const Flow, _direction: u8, input: *const u8, input_len: u32, _rdir: *mut u8,
) -> AppProto {
if input.is_null() {
}
}
-#[no_mangle]
-pub unsafe extern "C" fn rs_quic_parse_tc(
+unsafe extern "C" fn quic_parse_tc(
_flow: *const Flow, state: *mut std::os::raw::c_void, _pstate: *mut std::os::raw::c_void,
stream_slice: StreamSlice, _data: *const std::os::raw::c_void,
) -> AppLayerResult {
}
}
-#[no_mangle]
-pub unsafe extern "C" fn rs_quic_parse_ts(
+unsafe extern "C" fn quic_parse_ts(
_flow: *const Flow, state: *mut std::os::raw::c_void, _pstate: *mut std::os::raw::c_void,
stream_slice: StreamSlice, _data: *const std::os::raw::c_void,
) -> AppLayerResult {
}
}
-#[no_mangle]
-pub unsafe extern "C" fn rs_quic_state_get_tx(
+unsafe extern "C" fn quic_state_get_tx(
state: *mut std::os::raw::c_void, tx_id: u64,
) -> *mut std::os::raw::c_void {
let state = cast_pointer!(state, QuicState);
}
}
-#[no_mangle]
-pub unsafe extern "C" fn rs_quic_state_get_tx_count(state: *mut std::os::raw::c_void) -> u64 {
+unsafe extern "C" fn quic_state_get_tx_count(state: *mut std::os::raw::c_void) -> u64 {
let state = cast_pointer!(state, QuicState);
return state.max_tx_id;
}
-#[no_mangle]
-pub extern "C" fn rs_quic_state_progress_completion_status(_direction: u8) -> std::os::raw::c_int {
- // This parser uses 1 to signal transaction completion status.
- return 1;
-}
-
-#[no_mangle]
-pub unsafe extern "C" fn rs_quic_tx_get_alstate_progress(
+unsafe extern "C" fn quic_tx_get_alstate_progress(
tx: *mut std::os::raw::c_void, _direction: u8,
) -> std::os::raw::c_int {
let _tx = cast_pointer!(tx, QuicTransaction);
return 1;
}
-#[no_mangle]
-pub unsafe extern "C" fn rs_quic_state_get_tx_iterator(
+unsafe extern "C" fn quic_state_get_tx_iterator(
_ipproto: u8, _alproto: AppProto, state: *mut std::os::raw::c_void, min_tx_id: u64,
_max_tx_id: u64, istate: &mut u64,
) -> applayer::AppLayerGetTxIterTuple {
const PARSER_NAME: &[u8] = b"quic\0";
#[no_mangle]
-pub unsafe extern "C" fn rs_quic_register_parser() {
+pub unsafe extern "C" fn SCRegisterQuicParser() {
let default_port = CString::new("[443,80]").unwrap();
let parser = RustParser {
name: PARSER_NAME.as_ptr() as *const std::os::raw::c_char,
default_port: default_port.as_ptr(),
ipproto: IPPROTO_UDP,
- probe_ts: Some(rs_quic_probing_parser),
- probe_tc: Some(rs_quic_probing_parser),
+ probe_ts: Some(quic_probing_parser),
+ probe_tc: Some(quic_probing_parser),
min_depth: 0,
max_depth: 16,
- state_new: rs_quic_state_new,
- state_free: rs_quic_state_free,
- tx_free: rs_quic_state_tx_free,
- parse_ts: rs_quic_parse_ts,
- parse_tc: rs_quic_parse_tc,
- get_tx_count: rs_quic_state_get_tx_count,
- get_tx: rs_quic_state_get_tx,
+ state_new: quic_state_new,
+ state_free: quic_state_free,
+ tx_free: quic_state_tx_free,
+ parse_ts: quic_parse_ts,
+ parse_tc: quic_parse_tc,
+ get_tx_count: quic_state_get_tx_count,
+ get_tx: 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: 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,
localstorage_free: None,
get_tx_files: None,
- get_tx_iterator: Some(rs_quic_state_get_tx_iterator),
+ get_tx_iterator: Some(quic_state_get_tx_iterator),
get_tx_data: quic_get_tx_data,
get_state_data: quic_get_state_data,
apply_tx_config: None,