classtype: reduce scope of functions

pull/4288/head
Victor Julien 7 years ago
parent a37e09cbe0
commit e104c3d913

@ -56,6 +56,10 @@ char SCClassConfClasstypeHashCompareFunc(void *data1, uint16_t datalen1,
void SCClassConfClasstypeHashFree(void *ch); void SCClassConfClasstypeHashFree(void *ch);
static const char *SCClassConfGetConfFilename(const DetectEngineCtx *de_ctx); 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) void SCClassConfInit(void)
{ {
const char *eb = NULL; 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 * \brief Returns a new SCClassConfClasstype instance. The classtype string
* is converted into lowercase, before being assigned to the instance. * 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; * \retval ct Pointer to the new instance of SCClassConfClasstype on success;
* NULL on failure. * NULL on failure.
*/ */
SCClassConfClasstype *SCClassConfAllocClasstype(uint8_t classtype_id, static SCClassConfClasstype *SCClassConfAllocClasstype(uint8_t classtype_id,
const char *classtype, const char *classtype,
const char *classtype_desc, const char *classtype_desc,
int priority) int priority)
@ -420,11 +425,12 @@ SCClassConfClasstype *SCClassConfAllocClasstype(uint8_t classtype_id,
} }
/** /**
* \internal
* \brief Frees a SCClassConfClasstype instance * \brief Frees a SCClassConfClasstype instance
* *
* \param Pointer to the SCClassConfClasstype instance that has to be freed * \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 != NULL) {
if (ct->classtype != NULL) if (ct->classtype != NULL)

@ -42,9 +42,6 @@ typedef struct SCClassConfClasstype_ {
int priority; int priority;
} SCClassConfClasstype; } SCClassConfClasstype;
SCClassConfClasstype *SCClassConfAllocClasstype(uint8_t, const char *,
const char *, int);
void SCClassConfDeAllocClasstype(SCClassConfClasstype *);
void SCClassConfLoadClassficationConfigFile(DetectEngineCtx *, FILE *fd); void SCClassConfLoadClassficationConfigFile(DetectEngineCtx *, FILE *fd);
SCClassConfClasstype *SCClassConfGetClasstype(const char *, SCClassConfClasstype *SCClassConfGetClasstype(const char *,
DetectEngineCtx *); DetectEngineCtx *);

Loading…
Cancel
Save