|
|
|
@ -36,14 +36,6 @@
|
|
|
|
|
|
|
|
|
|
#include "app-layer-tftp.h"
|
|
|
|
|
|
|
|
|
|
#ifndef HAVE_RUST
|
|
|
|
|
|
|
|
|
|
void RegisterTFTPParsers(void)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
|
|
#include "rust-tftp-tftp-gen.h"
|
|
|
|
|
|
|
|
|
|
/* The default port to probe if not provided in the configuration file. */
|
|
|
|
@ -53,27 +45,6 @@ void RegisterTFTPParsers(void)
|
|
|
|
|
* be the size of a header. */
|
|
|
|
|
#define TFTP_MIN_FRAME_LEN 4
|
|
|
|
|
|
|
|
|
|
/* Enum of app-layer events for an echo protocol. Normally you might
|
|
|
|
|
* have events for errors in parsing data, like unexpected data being
|
|
|
|
|
* received. For echo we'll make something up, and log an app-layer
|
|
|
|
|
* level alert if an empty message is received.
|
|
|
|
|
*
|
|
|
|
|
* Example rule:
|
|
|
|
|
*
|
|
|
|
|
* alert tftp any any -> any any (msg:"SURICATA TFTP empty message"; \
|
|
|
|
|
* app-layer-event:tftp.empty_message; sid:X; rev:Y;)
|
|
|
|
|
*/
|
|
|
|
|
enum {
|
|
|
|
|
TFTP_DECODER_EVENT_EMPTY_MESSAGE,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
SCEnumCharMap tftp_decoder_event_table[] = {
|
|
|
|
|
{"EMPTY_MESSAGE", TFTP_DECODER_EVENT_EMPTY_MESSAGE},
|
|
|
|
|
|
|
|
|
|
// event table must be NULL-terminated
|
|
|
|
|
{ NULL, -1 },
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static void *TFTPStateAlloc(void)
|
|
|
|
|
{
|
|
|
|
|
return rs_tftp_state_alloc();
|
|
|
|
@ -304,20 +275,4 @@ void RegisterTFTPParsers(void)
|
|
|
|
|
else {
|
|
|
|
|
SCLogDebug("TFTP protocol parsing disabled.");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#ifdef UNITTESTS
|
|
|
|
|
AppLayerParserRegisterProtocolUnittests(IPPROTO_UDP, ALPROTO_TFTP,
|
|
|
|
|
TFTPParserRegisterTests);
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#ifdef UNITTESTS
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
void TFTPParserRegisterTests(void)
|
|
|
|
|
{
|
|
|
|
|
#ifdef UNITTESTS
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif /* HAVE_RUST */
|
|
|
|
|