"sni": "www.googleapis.com",
"certificate": "MIIE3TCCA8WgAwIBAgIIQPsvobRZN0gwDQYJKoZIhvcNAQELBQAwSTELMA [...]"
}
+
+Event type: TFTP
+----------------
+
+Fields
+~~~~~~
+
+* "packet": The operation code, can be "read" or "write" or "error"
+* "file": The filename transported with the tftp protocol
+* "mode": The mode field, can be "octet" or "mail" or "netascii" (or any combination of upper and lower case)
+
+Example of TFTP logging:
+
+::
+
+ "tftp": {
+ "packet": "write",
+ "file": "rfc1350.txt",
+ "mode": "octet"
+ }
#[no_mangle]
pub extern "C" fn rs_tftp_get_tx_logged(_state: &mut TFTPState,
- tx: &mut TFTPTransaction,
- logger: libc::uint32_t) -> i8 {
- if tx.logged.is_logged(logger) {
- 1
- } else {
- 0
- }
+ tx: &mut TFTPTransaction)
+ -> u32 {
+ return tx.logged.get();
}
#[no_mangle]
pub extern "C" fn rs_tftp_set_tx_logged(_state: &mut TFTPState,
tx: &mut TFTPTransaction,
- logger: libc::uint32_t) {
- tx.logged.set_logged(logger);
+ logged: libc::uint32_t) {
+ tx.logged.set(logged);
}
#[no_mangle]
break;
case ALPROTO_FTPDATA:
proto_name = "ftp-data";
+ break;
case ALPROTO_TFTP:
proto_name = "tftp";
break;
static AppProto TFTPProbingParser(Flow *f, uint8_t *input, uint32_t input_len,
uint32_t *offset)
{
- /* Very simple test - if there is input, this is echo.
+ /* Very simple test - if there is input, this is tftp.
* Also check if it's starting by a zero */
if (input_len >= TFTP_MIN_FRAME_LEN && *input == 0) {
SCLogDebug("Detected as ALPROTO_TFTP.");
rs_tftp_set_tx_logged(state, vtx, logger);
}
-static int TFTPGetTxLogged(void *state, void *vtx, uint32_t logger)
+static LoggerId TFTPGetTxLogged(void *state, void *vtx)
{
- return rs_tftp_get_tx_logged(state, vtx, logger);
+ return rs_tftp_get_tx_logged(state, vtx);
}
/**
* Implement JSON/eve logging app-layer TFTP.
*/
-//#ifdef HAVE_RUST
#include "suricata-common.h"
#include "debug.h"
SCFree(output_ctx);
}
-static OutputCtx *OutputTFTPLogInitSub(ConfNode *conf,
+static OutputInitResult OutputTFTPLogInitSub(ConfNode *conf,
OutputCtx *parent_ctx)
{
+ OutputInitResult result = { NULL, false };
OutputJsonCtx *ajt = parent_ctx->data;
LogTFTPFileCtx *tftplog_ctx = SCCalloc(1, sizeof(*tftplog_ctx));
if (unlikely(tftplog_ctx == NULL)) {
- return NULL;
+ return result;
}
tftplog_ctx->file_ctx = ajt->file_ctx;
OutputCtx *output_ctx = SCCalloc(1, sizeof(*output_ctx));
if (unlikely(output_ctx == NULL)) {
SCFree(tftplog_ctx);
- return NULL;
+ return result;
}
output_ctx->data = tftplog_ctx;
output_ctx->DeInit = OutputTFTPLogDeInitCtxSub;
AppLayerParserRegisterLogger(IPPROTO_UDP, ALPROTO_TFTP);
- return output_ctx;
+ result.ctx = output_ctx;
+ result.ok = true;
+ return result;
}
#define OUTPUT_BUFFER_SIZE 65535
#- dnp3
@rust_config_comment@- nfs
+ @rust_config_comment@- tftp
- ssh
- stats:
totals: yes # stats for all threads merged together
# to configure.
nfs:
enabled: @rust_config_enabled@
+ tftp:
+ enabled: @rust_config_enabled@
dns:
# memcaps. Globally and per flow/state.
#global-memcap: 16mb