/// C entry point for a probing parser.
#[no_mangle]
-pub unsafe extern "C" fn rs_pgsql_probing_parser_ts(
+pub unsafe extern "C" fn SCPgsqlProbingParserTS(
_flow: *const Flow, _direction: u8, input: *const u8, input_len: u32, _rdir: *mut u8,
) -> AppProto {
if input_len >= 1 && !input.is_null() {
/// C entry point for a probing parser.
#[no_mangle]
-pub unsafe extern "C" fn rs_pgsql_probing_parser_tc(
+pub unsafe extern "C" fn SCPgsqlProbingParserTC(
_flow: *const Flow, _direction: u8, input: *const u8, input_len: u32, _rdir: *mut u8,
) -> AppProto {
if input_len >= 1 && !input.is_null() {
}
#[no_mangle]
-pub extern "C" fn rs_pgsql_state_new(
+pub extern "C" fn SCPgsqlStateNew(
_orig_state: *mut std::os::raw::c_void, _orig_proto: AppProto,
) -> *mut std::os::raw::c_void {
let state = PgsqlState::new();
}
#[no_mangle]
-pub extern "C" fn rs_pgsql_state_free(state: *mut std::os::raw::c_void) {
+pub extern "C" fn SCPgsqlStateFree(state: *mut std::os::raw::c_void) {
// Just unbox...
std::mem::drop(unsafe { Box::from_raw(state as *mut PgsqlState) });
}
#[no_mangle]
-pub extern "C" fn rs_pgsql_state_tx_free(state: *mut std::os::raw::c_void, tx_id: u64) {
+pub extern "C" fn SCPgsqlStateTxFree(state: *mut std::os::raw::c_void, tx_id: u64) {
let state_safe: &mut PgsqlState;
unsafe {
state_safe = cast_pointer!(state, PgsqlState);
}
#[no_mangle]
-pub unsafe extern "C" fn rs_pgsql_parse_request(
+pub unsafe extern "C" fn SCPgsqlParseRequest(
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_pgsql_parse_response(
+pub unsafe extern "C" fn SCPgsqlParseResponse(
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_pgsql_state_get_tx(
+pub unsafe extern "C" fn SCPgsqlStateGetTx(
state: *mut std::os::raw::c_void, tx_id: u64,
) -> *mut std::os::raw::c_void {
let state_safe: &mut PgsqlState = cast_pointer!(state, PgsqlState);
}
#[no_mangle]
-pub extern "C" fn rs_pgsql_state_get_tx_count(state: *mut std::os::raw::c_void) -> u64 {
+pub extern "C" fn SCPgsqlStateGetTxCount(state: *mut std::os::raw::c_void) -> u64 {
let state_safe: &mut PgsqlState;
unsafe {
state_safe = cast_pointer!(state, PgsqlState);
return state_safe.tx_id;
}
-unsafe extern "C" fn rs_pgsql_tx_get_alstate_progress(
+#[no_mangle]
+pub unsafe extern "C" fn SCPgsqlTxGetALStateProgress(
tx: *mut std::os::raw::c_void, _direction: u8,
) -> std::os::raw::c_int {
let tx = cast_pointer!(tx, PgsqlTransaction);
const PARSER_NAME: &[u8] = b"pgsql\0";
#[no_mangle]
-pub unsafe extern "C" fn rs_pgsql_register_parser() {
+pub unsafe extern "C" fn SCRegisterPgsqlParser() {
let default_port = CString::new("[5432]").unwrap();
let mut stream_depth = PGSQL_CONFIG_DEFAULT_STREAM_DEPTH;
let parser = RustParser {
name: PARSER_NAME.as_ptr() as *const std::os::raw::c_char,
default_port: default_port.as_ptr(),
ipproto: IPPROTO_TCP,
- probe_ts: Some(rs_pgsql_probing_parser_ts),
- probe_tc: Some(rs_pgsql_probing_parser_tc),
+ probe_ts: Some(SCPgsqlProbingParserTS),
+ probe_tc: Some(SCPgsqlProbingParserTC),
min_depth: 0,
max_depth: 16,
- state_new: rs_pgsql_state_new,
- state_free: rs_pgsql_state_free,
- tx_free: rs_pgsql_state_tx_free,
- parse_ts: rs_pgsql_parse_request,
- parse_tc: rs_pgsql_parse_response,
- get_tx_count: rs_pgsql_state_get_tx_count,
- get_tx: rs_pgsql_state_get_tx,
+ state_new: SCPgsqlStateNew,
+ state_free: SCPgsqlStateFree,
+ tx_free: SCPgsqlStateTxFree,
+ parse_ts: SCPgsqlParseRequest,
+ parse_tc: SCPgsqlParseResponse,
+ get_tx_count: SCPgsqlStateGetTxCount,
+ get_tx: SCPgsqlStateGetTx,
tx_comp_st_ts: PgsqlTransactionState::RequestReceived as i32,
tx_comp_st_tc: PgsqlTransactionState::ResponseDone as i32,
- tx_get_progress: rs_pgsql_tx_get_alstate_progress,
+ tx_get_progress: SCPgsqlTxGetALStateProgress,
get_eventinfo: None,
get_eventinfo_byid: None,
localstorage_new: None,