From 08600df6b1f900c25aa7da5cc9d66939ecf71e10 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Thu, 8 Apr 2010 14:47:11 +0200 Subject: [PATCH] Small uri cleanups. --- src/Makefile.am | 2 +- src/detect-distance.c | 2 +- ...{detect-engine-uricontent.c => detect-engine-uri.c} | 10 +++++++--- ...{detect-engine-uricontent.h => detect-engine-uri.h} | 0 src/detect-uricontent.c | 2 +- src/detect-uricontent.h | 2 +- src/detect-within.c | 2 +- src/detect.c | 3 ++- 8 files changed, 14 insertions(+), 9 deletions(-) rename src/{detect-engine-uricontent.c => detect-engine-uri.c} (97%) rename src/{detect-engine-uricontent.h => detect-engine-uri.h} (100%) diff --git a/src/Makefile.am b/src/Makefile.am index 576bec31fe..ff09178127 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -56,7 +56,7 @@ detect-engine-siggroup.c detect-engine-siggroup.h \ detect-engine-mpm.c detect-engine-mpm.h \ detect-engine-iponly.c detect-engine-iponly.h \ detect-engine-payload.c detect-engine-payload.h \ -detect-engine-uricontent.c detect-engine-uricontent.h \ +detect-engine-uri.c detect-engine-uri.h \ detect-parse.c detect-parse.h \ detect-ack.c detect-ack.h \ detect-seq.c detect-seq.h \ diff --git a/src/detect-distance.c b/src/detect-distance.c index dc3b462b79..e9db8267c5 100644 --- a/src/detect-distance.c +++ b/src/detect-distance.c @@ -65,7 +65,7 @@ static int DetectDistanceSetup (DetectEngineCtx *de_ctx, Signature *s, char *dis } } - pm = DetectUriGetLastPattern(s->umatch_tail->prev); + pm = DetectUricontentGetLastPattern(s->umatch_tail->prev); if (pm == NULL) { SCLogError(SC_ERR_DISTANCE_MISSING_CONTENT, "distance needs two preceeding content options"); goto error; diff --git a/src/detect-engine-uricontent.c b/src/detect-engine-uri.c similarity index 97% rename from src/detect-engine-uricontent.c rename to src/detect-engine-uri.c index 74949ab069..26d28cb395 100644 --- a/src/detect-engine-uricontent.c +++ b/src/detect-engine-uri.c @@ -1,7 +1,11 @@ -/** - * Copyright (c) 2009 Open Information Security Foundation +/* Copyright (c) 2010 Open Information Security Foundation */ + +/** \file + * + * \author Victor Julien + * \author Pablo Rincon Crespo * - * \author Pablo Rincon Crespo + * Based on detect-engine-payload.c */ #include "suricata-common.h" diff --git a/src/detect-engine-uricontent.h b/src/detect-engine-uri.h similarity index 100% rename from src/detect-engine-uricontent.h rename to src/detect-engine-uri.h diff --git a/src/detect-uricontent.c b/src/detect-uricontent.c index 1c2628e635..44dfd84bd5 100644 --- a/src/detect-uricontent.c +++ b/src/detect-uricontent.c @@ -118,7 +118,7 @@ void DetectUricontentPrint(DetectUricontentData *cd) * \retval pointer to the SigMatch that has the previous SigMatch * of type DetectUricontent */ -SigMatch *DetectUriGetLastPattern(SigMatch *sm) +SigMatch *DetectUricontentGetLastPattern(SigMatch *sm) { if (sm == NULL) return NULL; diff --git a/src/detect-uricontent.h b/src/detect-uricontent.h index 608335f76a..2904e7d401 100644 --- a/src/detect-uricontent.h +++ b/src/detect-uricontent.h @@ -34,7 +34,7 @@ typedef struct DetectUricontentData_ { void DetectUricontentRegister (void); uint32_t DetectUricontentMaxId(DetectEngineCtx *); uint32_t DetectUricontentInspectMpm(ThreadVars *th_v, DetectEngineThreadCtx *det_ctx, void *alstate); -SigMatch *DetectUriGetLastPattern(SigMatch *); +SigMatch *DetectUricontentGetLastPattern(SigMatch *); void DetectUricontentPrint(DetectUricontentData *); #endif /* __DETECT_URICONTENT_H__ */ diff --git a/src/detect-within.c b/src/detect-within.c index 020363cc91..12848ae33e 100644 --- a/src/detect-within.c +++ b/src/detect-within.c @@ -85,7 +85,7 @@ static int DetectWithinSetup (DetectEngineCtx *de_ctx, Signature *s, char *withi } } - pm = DetectUriGetLastPattern(s->umatch_tail->prev); + pm = DetectUricontentGetLastPattern(s->umatch_tail->prev); if (pm == NULL) { SCLogError(SC_ERR_WITHIN_MISSING_CONTENT, "within needs two preceeding content options"); goto error; diff --git a/src/detect.c b/src/detect.c index 6da81f221f..6da60e50b1 100644 --- a/src/detect.c +++ b/src/detect.c @@ -17,8 +17,9 @@ #include "detect-engine-mpm.h" #include "detect-engine-iponly.h" #include "detect-engine-threshold.h" + #include "detect-engine-payload.h" -#include "detect-engine-uricontent.h" +#include "detect-engine-uri.h" #include "detect-http-cookie.h" #include "detect-http-method.h"