-/* Copyright (C) 2007-2010 Open Information Security Foundation
+/* Copyright (C) 2007-2018 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free
#include "detect.h"
#include "detect-parse.h"
#include "detect-rawbytes.h"
+#include "detect-engine.h"
#include "detect-content.h"
#include "detect-pcre.h"
void DetectRawbytesRegister (void)
{
sigmatch_table[DETECT_RAWBYTES].name = "rawbytes";
- sigmatch_table[DETECT_RAWBYTES].Match = NULL;
sigmatch_table[DETECT_RAWBYTES].Setup = DetectRawbytesSetup;
- sigmatch_table[DETECT_RAWBYTES].Free = NULL;
- sigmatch_table[DETECT_RAWBYTES].RegisterTests = NULL;
-
sigmatch_table[DETECT_RAWBYTES].flags |= SIGMATCH_NOOPT;
}
if (nullstr != NULL) {
SCLogError(SC_ERR_INVALID_VALUE, "rawbytes has no value");
- return -1;
+ SCReturnInt(-1);
}
if (s->init_data->list != DETECT_SM_LIST_NOTSET) {
- SCLogError(SC_ERR_RAWBYTES_FILE_DATA, "\"rawbytes\" cannot be combined with \"file_data\"");
+ SCLogError(SC_ERR_RAWBYTES_BUFFER, "\"rawbytes\" cannot be combined "
+ "with the \"%s\" sticky buffer",
+ DetectBufferTypeGetNameById(de_ctx, s->init_data->list));
SCReturnInt(-1);
}
CASE_CODE (SC_ERR_AFP_DISPATCH);
CASE_CODE (SC_ERR_CMD_LINE);
CASE_CODE (SC_ERR_SIZE_PARSE);
- CASE_CODE (SC_ERR_RAWBYTES_FILE_DATA);
+ CASE_CODE (SC_ERR_RAWBYTES_BUFFER);
CASE_CODE (SC_ERR_SOCKET);
CASE_CODE (SC_ERR_PCAP_TRANSLATE);
CASE_CODE (SC_WARN_OUTDATED_LIBHTP);
SC_ERR_MAGIC_OPEN,
SC_ERR_MAGIC_LOAD,
SC_ERR_SIZE_PARSE,
- SC_ERR_RAWBYTES_FILE_DATA,
+ SC_ERR_RAWBYTES_BUFFER,
SC_ERR_SOCKET,
SC_ERR_PCAP_TRANSLATE, /* failed to translate ip to dev */
SC_WARN_OUTDATED_LIBHTP,