]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
classtype: reduce scope of functions
authorVictor Julien <victor@inliniac.net>
Tue, 1 Oct 2019 09:59:58 +0000 (11:59 +0200)
committerVictor Julien <victor@inliniac.net>
Tue, 8 Oct 2019 18:31:09 +0000 (20:31 +0200)
src/util-classification-config.c
src/util-classification-config.h

index b4dbf37ead940373a8cd2d4660b792c1fcd8da37..2978b71a78afa7dab6384da4f7f058b2c30a1054 100644 (file)
@@ -56,6 +56,10 @@ char SCClassConfClasstypeHashCompareFunc(void *data1, uint16_t datalen1,
 void SCClassConfClasstypeHashFree(void *ch);
 static const char *SCClassConfGetConfFilename(const DetectEngineCtx *de_ctx);
 
+static SCClassConfClasstype *SCClassConfAllocClasstype(uint8_t classtype_id,
+        const char *classtype, const char *classtype_desc, int priority);
+static void SCClassConfDeAllocClasstype(SCClassConfClasstype *ct);
+
 void SCClassConfInit(void)
 {
     const char *eb = NULL;
@@ -374,6 +378,7 @@ static void SCClassConfParseFile(DetectEngineCtx *de_ctx, FILE *fd)
 }
 
 /**
+ * \internal
  * \brief Returns a new SCClassConfClasstype instance.  The classtype string
  *        is converted into lowercase, before being assigned to the instance.
  *
@@ -384,7 +389,7 @@ static void SCClassConfParseFile(DetectEngineCtx *de_ctx, FILE *fd)
  * \retval ct Pointer to the new instance of SCClassConfClasstype on success;
  *            NULL on failure.
  */
-SCClassConfClasstype *SCClassConfAllocClasstype(uint8_t classtype_id,
+static SCClassConfClasstype *SCClassConfAllocClasstype(uint8_t classtype_id,
                                                 const char *classtype,
                                                 const char *classtype_desc,
                                                 int priority)
@@ -420,11 +425,12 @@ SCClassConfClasstype *SCClassConfAllocClasstype(uint8_t classtype_id,
 }
 
 /**
+ * \internal
  * \brief Frees a SCClassConfClasstype instance
  *
  * \param Pointer to the SCClassConfClasstype instance that has to be freed
  */
-void SCClassConfDeAllocClasstype(SCClassConfClasstype *ct)
+static void SCClassConfDeAllocClasstype(SCClassConfClasstype *ct)
 {
     if (ct != NULL) {
         if (ct->classtype != NULL)
index 7e916c2cd2efa64a0be9551902b8a60cdf0462d6..b161c540811e158b36dca4678651183dcccd87b8 100644 (file)
@@ -42,9 +42,6 @@ typedef struct SCClassConfClasstype_ {
     int priority;
 } SCClassConfClasstype;
 
-SCClassConfClasstype *SCClassConfAllocClasstype(uint8_t, const char *,
-                                                const char *, int);
-void SCClassConfDeAllocClasstype(SCClassConfClasstype *);
 void SCClassConfLoadClassficationConfigFile(DetectEngineCtx *, FILE *fd);
 SCClassConfClasstype *SCClassConfGetClasstype(const char *,
                                               DetectEngineCtx *);