Small detect engine proto cleanups.

remotes/origin/master-1.0.x
Victor Julien 17 years ago
parent 34e526d853
commit c5dd31868d

@ -18,8 +18,6 @@
#include "detect-engine-siggroup.h" #include "detect-engine-siggroup.h"
/*Prototypes*/ /*Prototypes*/
int DetectProtoSetup (DetectEngineCtx *de_ctx, Signature *s, SigMatch *m,
char *sidstr);
void DetectProtoTests (void); void DetectProtoTests (void);
/** /**
@ -29,7 +27,7 @@ void DetectProtoRegister (void)
{ {
sigmatch_table[DETECT_PROTO].name = "__proto__"; sigmatch_table[DETECT_PROTO].name = "__proto__";
sigmatch_table[DETECT_PROTO].Match = NULL; sigmatch_table[DETECT_PROTO].Match = NULL;
sigmatch_table[DETECT_PROTO].Setup = DetectProtoSetup; sigmatch_table[DETECT_PROTO].Setup = NULL;
sigmatch_table[DETECT_PROTO].Free = NULL; sigmatch_table[DETECT_PROTO].Free = NULL;
sigmatch_table[DETECT_PROTO].RegisterTests = DetectProtoTests; sigmatch_table[DETECT_PROTO].RegisterTests = DetectProtoTests;
} }
@ -38,14 +36,14 @@ void DetectProtoRegister (void)
* \brief Function to initialize the protocol detection and * \brief Function to initialize the protocol detection and
* allocate memory to the DetectProto structure. * allocate memory to the DetectProto structure.
* *
* \retval DetectProtoc instance pointer if successful otherwise NULL * \retval DetectProto instance pointer if successful otherwise NULL
*/ */
DetectProto *DetectProtoInit(void) DetectProto *DetectProtoInit(void)
{ {
DetectProto *dp = malloc(sizeof(DetectProto)); DetectProto *dp = malloc(sizeof(DetectProto));
if (dp == NULL) { if (dp == NULL) {
SCLogDebug("DetectProtoInit: Error in memory allocation"); SCLogError(SC_ERR_MEM_ALLOC, "error in memory allocation");
return NULL; return NULL;
} }
memset(dp,0,sizeof(DetectProto)); memset(dp,0,sizeof(DetectProto));
@ -121,24 +119,6 @@ error:
return -1; return -1;
} }
/**
* \brief this function is used to add the parsed protocol into the current
* signature currently it is not used for the defined function.
*
* \param de_ctx pointer to the Detection Engine Context
* \param s pointer to the Current Signature
* \param m pointer to the Current SigMatch
* \param str pointer to the user provided protocol string
*
* \retval 0 on Success
*/
/* XXX remove */
int DetectProtoSetup (DetectEngineCtx *de_ctx, Signature *s, SigMatch *m,
char *str)
{
return 0;
}
/* TESTS */ /* TESTS */
#ifdef UNITTESTS #ifdef UNITTESTS

@ -5,7 +5,7 @@
is considered as IP */ is considered as IP */
typedef struct DetectProto_ { typedef struct DetectProto_ {
uint8_t proto[256/8]; /* bit array for 256 bits */ uint8_t proto[256/8]; /**< bit array for 256 protocol bits */
uint8_t flags; uint8_t flags;
} DetectProto; } DetectProto;

Loading…
Cancel
Save