}
#[no_mangle]
-pub extern "C" fn rs_tftp_log_json_request(tx: &TFTPTransaction, jb: &mut JsonBuilder) -> bool {
+pub extern "C" fn SCTftpLogJsonRequest(tx: &TFTPTransaction, jb: &mut JsonBuilder) -> bool {
tftp_log_request(tx, jb).is_ok()
}
}
#[no_mangle]
-pub extern "C" fn rs_tftp_state_alloc() -> *mut std::os::raw::c_void {
+pub extern "C" fn SCTftpStateAlloc() -> *mut std::os::raw::c_void {
let state = TFTPState { state_data: AppLayerStateData::new(), transactions : Vec::new(), tx_id: 0, };
let boxed = Box::new(state);
return Box::into_raw(boxed) as *mut _;
}
#[no_mangle]
-pub extern "C" fn rs_tftp_state_free(state: *mut std::os::raw::c_void) {
+pub extern "C" fn SCTftpStateFree(state: *mut std::os::raw::c_void) {
std::mem::drop(unsafe { Box::from_raw(state as *mut TFTPState) });
}
#[no_mangle]
-pub extern "C" fn rs_tftp_state_tx_free(state: &mut TFTPState,
+pub extern "C" fn SCTftpStateTxFree(state: &mut TFTPState,
tx_id: u64) {
state.free_tx(tx_id);
}
#[no_mangle]
-pub extern "C" fn rs_tftp_get_tx(state: &mut TFTPState,
+pub extern "C" fn SCTftpGetTx(state: &mut TFTPState,
tx_id: u64) -> *mut std::os::raw::c_void {
match state.get_tx_by_id(tx_id) {
Some(tx) => tx as *const _ as *mut _,
}
#[no_mangle]
-pub extern "C" fn rs_tftp_get_tx_cnt(state: &mut TFTPState) -> u64 {
+pub extern "C" fn SCTftpGetTxCnt(state: &mut TFTPState) -> u64 {
return state.tx_id;
}
}
#[no_mangle]
-pub unsafe extern "C" fn rs_tftp_request(state: &mut TFTPState,
+pub unsafe extern "C" fn SCTftpParseRequest(state: &mut TFTPState,
input: *const u8,
len: u32) -> i64 {
let buf = std::slice::from_raw_parts(input, len as usize);
}
#[no_mangle]
-pub unsafe extern "C" fn rs_tftp_get_tx_data(
+pub unsafe extern "C" fn SCTftpGetTxData(
tx: *mut std::os::raw::c_void)
-> *mut AppLayerTxData
{
}
#[no_mangle]
-pub unsafe extern "C" fn rs_tftp_get_state_data(
+pub unsafe extern "C" fn SCTftpGetStateData(
state: *mut std::os::raw::c_void)
-> *mut AppLayerStateData
{
static void *TFTPStateAlloc(void *orig_state, AppProto proto_orig)
{
- return rs_tftp_state_alloc();
+ return SCTftpStateAlloc();
}
static void TFTPStateFree(void *state)
{
- rs_tftp_state_free(state);
+ SCTftpStateFree(state);
}
/**
*/
static void TFTPStateTxFree(void *state, uint64_t tx_id)
{
- rs_tftp_state_tx_free(state, tx_id);
+ SCTftpStateTxFree(state, tx_id);
}
static int TFTPStateGetEventInfo(
SCReturnStruct(APP_LAYER_OK);
}
- int64_t res = rs_tftp_request(state, input, input_len);
+ int64_t res = SCTftpParseRequest(state, input, input_len);
if (res < 0) {
SCReturnStruct(APP_LAYER_ERROR);
}
static uint64_t TFTPGetTxCnt(void *state)
{
- return rs_tftp_get_tx_cnt(state);
+ return SCTftpGetTxCnt(state);
}
static void *TFTPGetTx(void *state, uint64_t tx_id)
{
- return rs_tftp_get_tx(state, tx_id);
+ return SCTftpGetTx(state, tx_id);
}
/**
AppLayerParserRegisterGetEventInfo(IPPROTO_UDP, ALPROTO_TFTP,
TFTPStateGetEventInfo);
- AppLayerParserRegisterTxDataFunc(IPPROTO_UDP, ALPROTO_TFTP,
- rs_tftp_get_tx_data);
- AppLayerParserRegisterStateDataFunc(IPPROTO_UDP, ALPROTO_TFTP, rs_tftp_get_state_data);
+ AppLayerParserRegisterTxDataFunc(IPPROTO_UDP, ALPROTO_TFTP, SCTftpGetTxData);
+ AppLayerParserRegisterStateDataFunc(IPPROTO_UDP, ALPROTO_TFTP, SCTftpGetStateData);
}
else {
SCLogDebug("TFTP protocol parsing disabled.");
RegisterSimpleJsonApplayerLogger(
ALPROTO_FTPDATA, (EveJsonSimpleTxLogFunc)EveFTPDataAddMetadata, "ftp_data");
RegisterSimpleJsonApplayerLogger(
- ALPROTO_TFTP, (EveJsonSimpleTxLogFunc)rs_tftp_log_json_request, NULL);
+ ALPROTO_TFTP, (EveJsonSimpleTxLogFunc)SCTftpLogJsonRequest, NULL);
// ALPROTO_IKE special: uses state
RegisterSimpleJsonApplayerLogger(
ALPROTO_KRB5, (EveJsonSimpleTxLogFunc)SCKrb5LogJsonResponse, NULL);