pub type SCFileContainerRecycle = extern "C" fn (
file_container: &FileContainer);
+pub type SCFileSetTx = extern "C" fn (
+ file: &FileContainer,
+ tx_id: u64);
// A Suricata context that is passed in from C. This is alternative to
// using functions from Suricata directly, so they can be wrapped so
pub FileAppendData: SCFileAppendDataById,
pub FileContainerRecycle: SCFileContainerRecycle,
pub FilePrune: SCFilePrune,
+ pub FileSetTx: SCFileSetTx,
}
#[allow(non_snake_case)]
const uint8_t *data, uint32_t data_len);
void (*FileContainerRecycle)(FileContainer *ffc);
void (*FilePrune)(FileContainer *ffc);
+ void (*FileSetTx)(FileContainer *, uint64_t);
} SuricataContext;
context.FileAppendDataById = FileAppendDataById;
context.FileContainerRecycle = FileContainerRecycle;
context.FilePrune = FilePrune;
+ context.FileSetTx = FileContainerSetTx;
rs_init(&context);
#endif
SCReturnInt(0);
}
+void FileContainerSetTx(FileContainer *ffc, uint64_t tx_id)
+{
+ if (ffc && ffc->tail) {
+ (void)FileSetTx(ffc->tail, tx_id);
+ }
+}
+
/**
* \brief check if we have stored enough
*
* \param txid the tx id
*/
int FileSetTx(File *, uint64_t txid);
+void FileContainerSetTx(FileContainer *ffc, uint64_t tx_id);
/**
* \brief disable file storage for a flow