From c5dd31868d8558bacf3bbd30af51273fba588e9f Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Mon, 2 Nov 2009 13:23:44 +0100 Subject: [PATCH] Small detect engine proto cleanups. --- src/detect-engine-proto.c | 26 +++----------------------- src/detect-engine-proto.h | 2 +- 2 files changed, 4 insertions(+), 24 deletions(-) diff --git a/src/detect-engine-proto.c b/src/detect-engine-proto.c index ef980f30e9..fa3f5ace16 100644 --- a/src/detect-engine-proto.c +++ b/src/detect-engine-proto.c @@ -18,8 +18,6 @@ #include "detect-engine-siggroup.h" /*Prototypes*/ -int DetectProtoSetup (DetectEngineCtx *de_ctx, Signature *s, SigMatch *m, - char *sidstr); void DetectProtoTests (void); /** @@ -29,7 +27,7 @@ void DetectProtoRegister (void) { sigmatch_table[DETECT_PROTO].name = "__proto__"; 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].RegisterTests = DetectProtoTests; } @@ -38,14 +36,14 @@ void DetectProtoRegister (void) * \brief Function to initialize the protocol detection and * 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 *dp = malloc(sizeof(DetectProto)); if (dp == NULL) { - SCLogDebug("DetectProtoInit: Error in memory allocation"); + SCLogError(SC_ERR_MEM_ALLOC, "error in memory allocation"); return NULL; } memset(dp,0,sizeof(DetectProto)); @@ -121,24 +119,6 @@ error: 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 */ #ifdef UNITTESTS diff --git a/src/detect-engine-proto.h b/src/detect-engine-proto.h index 1a15d227da..ea6bbbe3df 100644 --- a/src/detect-engine-proto.h +++ b/src/detect-engine-proto.h @@ -5,7 +5,7 @@ is considered as IP */ 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; } DetectProto;