]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
src: remove unused headers-exported functions
authorPhilippe Antoine <pantoine@oisf.net>
Tue, 16 May 2023 09:15:10 +0000 (11:15 +0200)
committerVictor Julien <victor@inliniac.net>
Sat, 13 Apr 2024 06:50:21 +0000 (08:50 +0200)
+ remove double definition of IPPairLock

Ticket: #4083

92 files changed:
src/app-layer-ftp.c
src/app-layer-ftp.h
src/app-layer-htp-body.c
src/app-layer-htp-body.h
src/app-layer-parser.c
src/app-layer-parser.h
src/conf.c
src/conf.h
src/defrag-hash.c
src/defrag-hash.h
src/defrag-queue.c
src/defrag-queue.h
src/detect-engine-address.c
src/detect-engine-address.h
src/detect-engine-mpm.c
src/detect-engine-mpm.h
src/detect-engine-siggroup.c
src/detect-engine-siggroup.h
src/detect-engine-tag.c
src/detect-engine-tag.h
src/detect-engine.c
src/detect-engine.h
src/detect.h
src/device-storage.c
src/device-storage.h
src/flow.c
src/flow.h
src/host-queue.c
src/host-queue.h
src/host-storage.c
src/host-storage.h
src/host-timeout.c
src/host-timeout.h
src/host.c
src/host.h
src/ippair-queue.c
src/ippair-queue.h
src/ippair-storage.c
src/ippair-storage.h
src/ippair-timeout.c
src/ippair-timeout.h
src/ippair.c
src/ippair.h
src/output-flow.c
src/output-flow.h
src/output.c
src/output.h
src/runmode-napatech.c
src/runmode-napatech.h
src/runmodes.c
src/runmodes.h
src/source-af-xdp.c
src/source-af-xdp.h
src/stream-tcp-reassemble.c
src/stream-tcp-reassemble.h
src/stream-tcp.h
src/tm-modules.c
src/tm-modules.h
src/tmqh-packetpool.c
src/tmqh-packetpool.h
src/util-bloomfilter-counting.c
src/util-bloomfilter-counting.h
src/util-bloomfilter.c
src/util-bloomfilter.h
src/util-cpu.c
src/util-cpu.h
src/util-debug-filters.c
src/util-debug-filters.h
src/util-device.c
src/util-device.h
src/util-hash.c
src/util-hash.h
src/util-hashlist.c
src/util-hashlist.h
src/util-pool.c
src/util-pool.h
src/util-print.c
src/util-print.h
src/util-radix-tree.c
src/util-radix-tree.h
src/util-signal.c
src/util-signal.h
src/util-spm-bs.c
src/util-spm-bs.h
src/util-spm-bs2bm.c
src/util-spm-bs2bm.h
src/util-spm.c
src/util-spm.h
src/util-storage.c
src/util-storage.h
src/util-unittest-helper.c
src/util-unittest-helper.h

index 2971996fad763f66b8f273c359fd3fe2e009b50b..d1db0d4ef0c38d0266c97ae34bf85c06c4f2d75c 100644 (file)
@@ -1368,17 +1368,6 @@ void RegisterFTPParsers(void)
 #endif
 }
 
-void FTPAtExitPrintStats(void)
-{
-#ifdef DEBUG
-    SCMutexLock(&ftp_state_mem_lock);
-    SCLogDebug("ftp_state_memcnt %"PRIu64", ftp_state_memuse %"PRIu64"",
-               ftp_state_memcnt, ftp_state_memuse);
-    SCMutexUnlock(&ftp_state_mem_lock);
-#endif
-}
-
-
 /*
  * \brief Returns the ending offset of the next line from a multi-line buffer.
  *
index 353feb3582e2d56eab942512a9ef3c7fa7d27818..5be11d81f81c1a81b2b0fdc8d9f8c770a6f4dd36 100644 (file)
@@ -184,7 +184,6 @@ typedef struct FtpDataState_ {
 
 void RegisterFTPParsers(void);
 void FTPParserRegisterTests(void);
-void FTPAtExitPrintStats(void);
 void FTPParserCleanup(void);
 uint64_t FTPMemuseGlobalCounter(void);
 uint64_t FTPMemcapGlobalCounter(void);
index 11b5941d7e216753029b05f24ec22737ce214e83..818167de9ed1c28b600fd37687cc387ca246fb13 100644 (file)
@@ -91,28 +91,6 @@ int HtpBodyAppendChunk(const HTPCfgDir *hcfg, HtpBody *body,
  * \param body pointer to the HtpBody holding the list
  * \retval none
  */
-void HtpBodyPrint(HtpBody *body)
-{
-    if (SCLogDebugEnabled()||1) {
-        SCEnter();
-
-        if (body->first == NULL)
-            return;
-
-        HtpBodyChunk *cur = NULL;
-        SCLogDebug("--- Start body chunks at %p ---", body);
-        printf("--- Start body chunks at %p ---\n", body);
-        for (cur = body->first; cur != NULL; cur = cur->next) {
-            const uint8_t *data = NULL;
-            uint32_t data_len = 0;
-            StreamingBufferSegmentGetData(body->sb, &cur->sbseg, &data, &data_len);
-            SCLogDebug("Body %p; data %p, len %"PRIu32, body, data, data_len);
-            printf("Body %p; data %p, len %"PRIu32"\n", body, data, data_len);
-            PrintRawDataFp(stdout, data, data_len);
-        }
-        SCLogDebug("--- End body chunks at %p ---", body);
-    }
-}
 
 /**
  * \brief Free the information held in the request body
index bcb58938f3daf40277ca9858c04ee6e14ac36998..b0a408a1acfab659ba73064f45b7560f67bc7c4a 100644 (file)
@@ -29,7 +29,6 @@
 #define SURICATA_APP_LAYER_HTP_BODY_H
 
 int HtpBodyAppendChunk(const HTPCfgDir *, HtpBody *, const uint8_t *, uint32_t);
-void HtpBodyPrint(HtpBody *);
 void HtpBodyFree(const HTPCfgDir *, HtpBody *);
 void HtpBodyPrune(HtpState *, HtpBody *, int);
 
index a856e79cd187edd1f59f3c330c2519c8e82ff159..b92562ef4962465a169a17d9c4e0615eff31bfb2 100644 (file)
@@ -420,12 +420,6 @@ void AppLayerParserRegisterOptionFlags(uint8_t ipproto, AppProto alproto,
     SCReturn;
 }
 
-uint32_t AppLayerParserGetOptionFlags(uint8_t protomap, AppProto alproto)
-{
-    SCEnter();
-    SCReturnUInt(alp_ctx.ctxs[protomap][alproto].option_flags);
-}
-
 void AppLayerParserRegisterStateFuncs(uint8_t ipproto, AppProto alproto,
         void *(*StateAlloc)(void *, AppProto), void (*StateFree)(void *))
 {
@@ -864,11 +858,6 @@ AppLayerDecoderEvents *AppLayerParserGetDecoderEvents(AppLayerParserState *pstat
                 "AppLayerDecoderEvents *");
 }
 
-void AppLayerParserSetDecoderEvents(AppLayerParserState *pstate, AppLayerDecoderEvents *devents)
-{
-    pstate->decoder_events = devents;
-}
-
 AppLayerDecoderEvents *AppLayerParserGetEventsByTx(uint8_t ipproto, AppProto alproto,
                                         void *tx)
 {
@@ -1825,27 +1814,6 @@ static inline void AppLayerParserStreamTruncated(AppLayerParserState *pstate, co
     SCReturn;
 }
 
-#ifdef DEBUG
-void AppLayerParserStatePrintDetails(AppLayerParserState *pstate)
-{
-    SCEnter();
-
-    if (pstate == NULL)
-        SCReturn;
-
-    AppLayerParserState *p = pstate;
-    SCLogDebug("AppLayerParser parser state information for parser state p(%p). "
-               "p->inspect_id[0](%"PRIu64"), "
-               "p->inspect_id[1](%"PRIu64"), "
-               "p->log_id(%"PRIu64"), "
-               "p->decoder_events(%p).",
-               pstate, p->inspect_id[0], p->inspect_id[1], p->log_id,
-               p->decoder_events);
-
-    SCReturn;
-}
-#endif
-
 /***** Unittests *****/
 
 #ifdef UNITTESTS
index 7fd034195a5aaebf12808cfef03e0c6761fd5c4e..8014cb314e66ffd32bab8c5c5f44c4e517c90a19 100644 (file)
@@ -218,7 +218,6 @@ void AppLayerParserRegisterStateDataFunc(
 
 /***** Get and transaction functions *****/
 
-uint32_t AppLayerParserGetOptionFlags(uint8_t protomap, AppProto alproto);
 AppLayerGetTxIteratorFunc AppLayerGetTxIterator(const uint8_t ipproto,
          const AppProto alproto);
 
@@ -235,7 +234,6 @@ void AppLayerParserSetTransactionInspectId(const Flow *f, AppLayerParserState *p
                                 void *alstate, const uint8_t flags, bool tag_txs_as_inspected);
 
 AppLayerDecoderEvents *AppLayerParserGetDecoderEvents(AppLayerParserState *pstate);
-void AppLayerParserSetDecoderEvents(AppLayerParserState *pstate, AppLayerDecoderEvents *devents);
 AppLayerDecoderEvents *AppLayerParserGetEventsByTx(uint8_t ipproto, AppProto alproto, void *tx);
 AppLayerGetFileState AppLayerParserGetTxFiles(
         const Flow *f, void *state, void *tx, const uint8_t direction);
@@ -315,11 +313,6 @@ void AppLayerParserStateFree(AppLayerParserState *pstate);
 
 void AppLayerParserTransactionsCleanup(Flow *f, const uint8_t pkt_dir);
 
-#ifdef DEBUG
-void AppLayerParserStatePrintDetails(AppLayerParserState *pstate);
-#endif
-
-
 /***** Unittests *****/
 
 #ifdef UNITTESTS
index f2bf978e8c251348409aa1fa8d52b8c738cdded8..e232eb61221d1d8fc4973d0bb18185760273b59b 100644 (file)
@@ -870,36 +870,6 @@ int ConfNodeChildValueIsTrue(const ConfNode *node, const char *key)
  *  \param file The name of the file
  *  \retval str Pointer to the string path + sig_file
  */
-char *ConfLoadCompleteIncludePath(const char *file)
-{
-    const char *defaultpath = NULL;
-    char *path = NULL;
-
-    /* Path not specified */
-    if (PathIsRelative(file)) {
-        if (ConfGet("include-path", &defaultpath) == 1) {
-            SCLogDebug("Default path: %s", defaultpath);
-            size_t path_len = sizeof(char) * (strlen(defaultpath) +
-                          strlen(file) + 2);
-            path = SCMalloc(path_len);
-            if (unlikely(path == NULL))
-                return NULL;
-            strlcpy(path, defaultpath, path_len);
-            if (path[strlen(path) - 1] != '/')
-                strlcat(path, "/", path_len);
-            strlcat(path, file, path_len);
-       } else {
-            path = SCStrdup(file);
-            if (unlikely(path == NULL))
-                return NULL;
-        }
-    } else {
-        path = SCStrdup(file);
-        if (unlikely(path == NULL))
-            return NULL;
-    }
-    return path;
-}
 
 /**
  * \brief Prune a configuration node.
index c1dbd5318a229df5218cabffcb1a07dc57e1a4d8..1857efee9879ad2a316e74dadd2026200c9437a9 100644 (file)
@@ -91,8 +91,8 @@ int ConfGetChildValueInt(const ConfNode *base, const char *name, intmax_t *val);
 int ConfGetChildValueBool(const ConfNode *base, const char *name, int *val);
 int ConfGetChildValueWithDefault(const ConfNode *base, const ConfNode *dflt, const char *name, const char **vptr);
 int ConfGetChildValueIntWithDefault(const ConfNode *base, const ConfNode *dflt, const char *name, intmax_t *val);
-int ConfGetChildValueBoolWithDefault(const ConfNode *base, const ConfNode *dflt, const char *name, int *val);
-char *ConfLoadCompleteIncludePath(const char *);
+int ConfGetChildValueBoolWithDefault(
+        const ConfNode *base, const ConfNode *dflt, const char *name, int *val);
 int ConfNodeIsSequence(const ConfNode *node);
 ConfNode *ConfSetIfaceNode(const char *ifaces_node_name, const char *iface);
 int ConfSetRootAndDefaultNodes(
index 04104ce05645cfbc618caa3bca5eb891418c70ec..52169515eb008c77e7edb1798be49fb23a208896 100644 (file)
@@ -79,11 +79,6 @@ enum ExceptionPolicy DefragGetMemcapExceptionPolicy(void)
     return defrag_config.memcap_policy;
 }
 
-uint32_t DefragTrackerSpareQueueGetSize(void)
-{
-    return DefragTrackerQueueLen(&defragtracker_spare_q);
-}
-
 void DefragTrackerMoveToSpare(DefragTracker *h)
 {
     DefragTrackerEnqueue(&defragtracker_spare_q, h);
index 96368adcec6cb85088b82217fb2a4cb70ac33566..5e7499f31c9c3194384337a78a036c85cd474af5 100644 (file)
@@ -97,7 +97,6 @@ DefragTracker *DefragGetTrackerFromHash(ThreadVars *tv, DecodeThreadVars *dtv, P
 void DefragTrackerRelease(DefragTracker *);
 void DefragTrackerClearMemory(DefragTracker *);
 void DefragTrackerMoveToSpare(DefragTracker *);
-uint32_t DefragTrackerSpareQueueGetSize(void);
 
 int DefragTrackerSetMemcap(uint64_t);
 uint64_t DefragTrackerGetMemcap(void);
index dccff8871f951731b5e1ca7e8118e83ce589a84e..0d07d2196eb32ac16c60af205fa60b6848de11a7 100644 (file)
@@ -130,13 +130,3 @@ DefragTracker *DefragTrackerDequeue (DefragTrackerQueue *q)
     DQLOCK_UNLOCK(q);
     return dt;
 }
-
-uint32_t DefragTrackerQueueLen(DefragTrackerQueue *q)
-{
-    uint32_t len;
-    DQLOCK_LOCK(q);
-    len = q->len;
-    DQLOCK_UNLOCK(q);
-    return len;
-}
-
index 21480635660e324f1b3d0d19a0ff1eadf0cda12f..f527b6fce1ec75cdfb27a67b480e71c3d6b2f67a 100644 (file)
@@ -77,7 +77,6 @@ DefragTrackerQueue *DefragTrackerQueueInit(DefragTrackerQueue *);
 void DefragTrackerQueueDestroy (DefragTrackerQueue *);
 
 void DefragTrackerEnqueue (DefragTrackerQueue *, DefragTracker *);
-DefragTracker *DefragTrackerDequeue (DefragTrackerQueue *);
-uint32_t DefragTrackerQueueLen(DefragTrackerQueue *);
+DefragTracker *DefragTrackerDequeue(DefragTrackerQueue *);
 
 #endif /* SURICATA_DEFRAG_QUEUE_H */
index 59ee5ed7975aae34072b10acd34ada51f1619c24..664eaf569bbb8e7ef785b2c4a3a8c3286a59ca04 100644 (file)
@@ -137,23 +137,6 @@ DetectAddress *DetectAddressCopy(DetectAddress *orig)
     return ag;
 }
 
-#ifdef DEBUG
-/**
- * \brief Prints the address data information for all the DetectAddress
- *        instances in the DetectAddress list sent as the argument.
- *
- * \param head Pointer to a list of DetectAddress instances.
- */
-void DetectAddressPrintList(DetectAddress *head)
-{
-    SCLogInfo("list:");
-    for (DetectAddress *cur = head; cur != NULL; cur = cur->next) {
-        DetectAddressPrint(cur);
-    }
-    SCLogInfo("endlist");
-}
-#endif
-
 /**
  * \internal
  * \brief Frees a list of DetectAddress instances.
index bbeb4bcac26c652cc5025bf07d898befad3b6e5b..a98c016f5d7377804d84917a6fada212b2051a31 100644 (file)
@@ -48,8 +48,4 @@ void DetectAddressMapFree(DetectEngineCtx *de_ctx);
 const DetectAddressHead *DetectParseAddress(DetectEngineCtx *de_ctx,
         const char *string, bool *contains_negation);
 
-#ifdef DEBUG
-void DetectAddressPrintList(DetectAddress *);
-#endif
-
 #endif /* SURICATA_DETECT_ADDRESS_H */
index e7122e90caa9790049439331956831b56fc74736..6ceeaa63f2333e73f2bc5c22600fdeae5f9154d8 100644 (file)
@@ -878,11 +878,6 @@ void PatternMatchDestroy(MpmCtx *mpm_ctx, uint16_t mpm_matcher)
     mpm_table[mpm_matcher].DestroyCtx(mpm_ctx);
 }
 
-void PatternMatchThreadPrint(MpmThreadCtx *mpm_thread_ctx, uint16_t mpm_matcher)
-{
-    SCLogDebug("mpm_thread_ctx %p, mpm_matcher %"PRIu16" defunct", mpm_thread_ctx, mpm_matcher);
-    //mpm_table[mpm_matcher].PrintThreadCtx(mpm_thread_ctx);
-}
 void PatternMatchThreadDestroy(MpmThreadCtx *mpm_thread_ctx, uint16_t mpm_matcher)
 {
     SCLogDebug("mpm_thread_ctx %p, mpm_matcher %"PRIu16"", mpm_thread_ctx, mpm_matcher);
index c331b5f36fa77a4943519d0acab0dd3f1ffa1262..197416fdc941d086244c9718711c0e8aa5a8b12e 100644 (file)
@@ -45,10 +45,8 @@ void PatternMatchThreadPrepare(MpmThreadCtx *, uint16_t type);
 
 void PatternMatchDestroy(MpmCtx *, uint16_t);
 void PatternMatchThreadDestroy(MpmThreadCtx *mpm_thread_ctx, uint16_t);
-void PatternMatchThreadPrint(MpmThreadCtx *, uint16_t);
 
 int PatternMatchPrepareGroup(DetectEngineCtx *, SigGroupHead *);
-void DetectEngineThreadCtxInfo(ThreadVars *, DetectEngineThreadCtx *);
 
 TmEcode DetectEngineThreadCtxInit(ThreadVars *, void *, void **);
 TmEcode DetectEngineThreadCtxDeinit(ThreadVars *, void *);
index b08218193a0074913223e9364ddb3cb84a3b7ad2..7979c0a9da613ee72bdade9fd1d9d0a0eb9a3870 100644 (file)
@@ -283,11 +283,6 @@ int SigGroupHeadHashAdd(DetectEngineCtx *de_ctx, SigGroupHead *sgh)
     return ret;
 }
 
-int SigGroupHeadHashRemove(DetectEngineCtx *de_ctx, SigGroupHead *sgh)
-{
-    return HashListTableRemove(de_ctx->sgh_hash_table, (void *)sgh, 0);
-}
-
 /**
  * \brief Used to lookup a SigGroupHead hash from the detection engine context
  *        SigGroupHead hash table.
index 4b44f2a64799b6f521e121d673e4e0c580610b0f..4798008cbe95f9f970ea93f3690ebe8c18fcd9aa 100644 (file)
@@ -38,8 +38,6 @@ void SigGroupHeadHashFree(DetectEngineCtx *);
 
 int SigGroupHeadHashInit(DetectEngineCtx *);
 
-int SigGroupHeadHashRemove(DetectEngineCtx *, SigGroupHead *);
-
 void SigGroupHeadInitDataFree(SigGroupHeadInitData *sghid);
 void SigGroupHeadSetSigCnt(SigGroupHead *sgh, uint32_t max_idx);
 bool SigGroupHeadEqual(const SigGroupHead *, const SigGroupHead *);
index 21610264ef5bdf7a43a67f26bb31bbf80f57046e..2e8984c288a52dae239f75ad366356ff60b6dc59 100644 (file)
@@ -76,14 +76,6 @@ void TagDestroyCtx(void)
 #endif
 }
 
-/** \brief Reset the tagging engine context
- */
-void TagRestartCtx(void)
-{
-    TagDestroyCtx();
-    TagInitCtx();
-}
-
 int TagHostHasTag(Host *host)
 {
     return HostGetStorageById(host, host_tag_id) ? 1 : 0;
index 17af74851fa51a4e824bb5ca8f67248b9462dc14..64f11f316c48be99fccd3c6e8e2fe86be8de94ea 100644 (file)
@@ -48,7 +48,6 @@ void TagHandlePacket(DetectEngineCtx *, DetectEngineThreadCtx *, Packet *);
 
 void TagInitCtx(void);
 void TagDestroyCtx(void);
-void TagRestartCtx(void);
 
 int TagTimeoutCheck(Host *, SCTime_t);
 
index 13e09be71889fde722baf5e77ddf500e00b2841b..75a198e8fabd8352d29f2fa6dfd25c771d0a34c6 100644 (file)
@@ -163,53 +163,6 @@ void DetectPktInspectEngineRegister(const char *name,
     }
 }
 
-/** \brief register inspect engine at start up time
- *
- *  \note errors are fatal */
-void DetectFrameInspectEngineRegister(const char *name, int dir,
-        InspectionBufferFrameInspectFunc Callback, AppProto alproto, uint8_t type)
-{
-    DetectBufferTypeRegister(name);
-    const int sm_list = DetectBufferTypeGetByName(name);
-    if (sm_list == -1) {
-        FatalError("failed to register inspect engine %s", name);
-    }
-
-    if ((sm_list < DETECT_SM_LIST_MATCH) || (sm_list >= SHRT_MAX) || (Callback == NULL)) {
-        SCLogError("Invalid arguments");
-        BUG_ON(1);
-    }
-
-    uint8_t direction;
-    if (dir == SIG_FLAG_TOSERVER) {
-        direction = 0;
-    } else {
-        direction = 1;
-    }
-
-    DetectEngineFrameInspectionEngine *new_engine = SCCalloc(1, sizeof(*new_engine));
-    if (unlikely(new_engine == NULL)) {
-        FatalError("failed to register inspect engine %s: %s", name, strerror(errno));
-    }
-    new_engine->sm_list = (uint16_t)sm_list;
-    new_engine->sm_list_base = (uint16_t)sm_list;
-    new_engine->dir = direction;
-    new_engine->v1.Callback = Callback;
-    new_engine->alproto = alproto;
-    new_engine->type = type;
-
-    if (g_frame_inspect_engines == NULL) {
-        g_frame_inspect_engines = new_engine;
-    } else {
-        DetectEngineFrameInspectionEngine *t = g_frame_inspect_engines;
-        while (t->next != NULL) {
-            t = t->next;
-        }
-
-        t->next = new_engine;
-    }
-}
-
 /** \brief register inspect engine at start up time
  *
  *  \note errors are fatal */
@@ -3516,12 +3469,6 @@ TmEcode DetectEngineThreadCtxDeinit(ThreadVars *tv, void *data)
     return TM_ECODE_OK;
 }
 
-void DetectEngineThreadCtxInfo(ThreadVars *t, DetectEngineThreadCtx *det_ctx)
-{
-    /* XXX */
-    PatternMatchThreadPrint(&det_ctx->mtc, det_ctx->de_ctx->mpm_matcher);
-}
-
 static uint32_t DetectKeywordCtxHashFunc(HashListTable *ht, void *data, uint16_t datalen)
 {
     DetectEngineThreadKeywordCtxItem *ctx = data;
@@ -4906,11 +4853,6 @@ void DetectEngineSetEvent(DetectEngineThreadCtx *det_ctx, uint8_t e)
     det_ctx->events++;
 }
 
-AppLayerDecoderEvents *DetectEngineGetEvents(DetectEngineThreadCtx *det_ctx)
-{
-    return det_ctx->decoder_events;
-}
-
 /*************************************Unittest*********************************/
 
 #ifdef UNITTESTS
index a7fa737efe1100a509ec71cff72b80e2fab4500f..0741aabc0c273c22d05ce7a040757c28a1500b9e 100644 (file)
@@ -168,8 +168,6 @@ void DetectPktInspectEngineRegister(const char *name,
         InspectionBufferGetPktDataPtr GetPktData,
         InspectionBufferPktInspectFunc Callback);
 
-void DetectFrameInspectEngineRegister(const char *name, int dir,
-        InspectionBufferFrameInspectFunc Callback, AppProto alproto, uint8_t type);
 void DetectEngineFrameInspectEngineRegister(DetectEngineCtx *de_ctx, const char *name, int dir,
         InspectionBufferFrameInspectFunc Callback, AppProto alproto, uint8_t type);
 
index 886fe1db2ef4176f3c7699ce0af4ef732cae4c3d..4828eba087274426f5398e00e745b2f9fc32927d 100644 (file)
@@ -1590,7 +1590,6 @@ void DetectMetadataHashFree(DetectEngineCtx *de_ctx);
 
 /* events */
 void DetectEngineSetEvent(DetectEngineThreadCtx *det_ctx, uint8_t e);
-AppLayerDecoderEvents *DetectEngineGetEvents(DetectEngineThreadCtx *det_ctx);
 
 void DumpPatterns(DetectEngineCtx *de_ctx);
 
index d4314c021ea59b8dd3889c0e7a7aff464b640f9e..979b0fd64cb30d0f65ea7126d0efa14da3e4559b 100644 (file)
@@ -97,16 +97,6 @@ void *LiveDevGetStorageById(LiveDevice *d, LiveDevStorageId id)
 
 /* Start of "private" function */
 
-void *LiveDevAllocStorageById(LiveDevice *d, LiveDevStorageId id)
-{
-    return StorageAllocByIdPrealloc(d->storage, STORAGE_DEVICE, id.id);
-}
-
-void LiveDevFreeStorageById(LiveDevice *d, LiveDevStorageId id)
-{
-    StorageFreeById(d->storage, STORAGE_DEVICE, id.id);
-}
-
 void LiveDevFreeStorage(LiveDevice *d)
 {
     if (LiveDevStorageSize() > 0)
index 31339b09edb7de0ff2dc3e57aa3b9754fe1dfda3..5846b2259fc0356353e35db48698172c706cdd32 100644 (file)
@@ -36,9 +36,7 @@ unsigned int LiveDevStorageSize(void);
 
 void *LiveDevGetStorageById(LiveDevice *d, LiveDevStorageId id);
 int LiveDevSetStorageById(LiveDevice *d, LiveDevStorageId id, void *ptr);
-void *LiveDevAllocStorageById(LiveDevice *d, LiveDevStorageId id);
 
-void LiveDevFreeStorageById(LiveDevice *d, LiveDevStorageId id);
 void LiveDevFreeStorage(LiveDevice *d);
 
 LiveDevStorageId LiveDevStorageRegister(const char *name, const unsigned int size,
index aff504754c31204eea7d5ed94bab6504677851d5..7e4629d4b111e630d919fe190102b3ef2c13e282 100644 (file)
@@ -195,23 +195,6 @@ int FlowHasAlerts(const Flow *f)
     return 0;
 }
 
-bool FlowHasGaps(const Flow *f, uint8_t way)
-{
-    if (f->proto == IPPROTO_TCP) {
-        TcpSession *ssn = (TcpSession *)f->protoctx;
-        if (ssn != NULL) {
-            if (way == STREAM_TOCLIENT) {
-                if (ssn->server.flags & STREAMTCP_STREAM_FLAG_HAS_GAP)
-                    return 1;
-            } else {
-                if (ssn->client.flags & STREAMTCP_STREAM_FLAG_HAS_GAP)
-                    return 1;
-            }
-        }
-    }
-    return 0;
-}
-
 /** \brief Set flag to indicate to change proto for the flow
  *
  * \param f flow
index 97424c97fade4ddf07993a9c7ed79e9b4dd04266..952dd34e89da5f3f34fc0d320775b87111425db0 100644 (file)
@@ -556,7 +556,6 @@ void FlowShutdown(void);
 void FlowSetIPOnlyFlag(Flow *, int);
 void FlowSetHasAlertsFlag(Flow *);
 int FlowHasAlerts(const Flow *);
-bool FlowHasGaps(const Flow *, uint8_t way);
 void FlowSetChangeProtoFlag(Flow *);
 void FlowUnsetChangeProtoFlag(Flow *);
 int FlowChangeProto(Flow *);
index f81cb54c771386f57fff1bbea850454873ae843f..8584bbf9ee2c6d5c4b4eb701d83b17560a09785b 100644 (file)
@@ -131,13 +131,3 @@ Host *HostDequeue (HostQueue *q)
     HQLOCK_UNLOCK(q);
     return h;
 }
-
-uint32_t HostQueueLen(HostQueue *q)
-{
-    uint32_t len;
-    HQLOCK_LOCK(q);
-    len = q->len;
-    HQLOCK_UNLOCK(q);
-    return len;
-}
-
index bd6ed8f880d7af99caace6f112d240615b2e7b8b..13f4c36b029cdb658ebabdea166bb3609ac5d50e 100644 (file)
@@ -77,7 +77,6 @@ HostQueue *HostQueueInit(HostQueue *);
 void HostQueueDestroy (HostQueue *);
 
 void HostEnqueue (HostQueue *, Host *);
-Host *HostDequeue (HostQueue *);
-uint32_t HostQueueLen(HostQueue *);
+Host *HostDequeue(HostQueue *);
 
 #endif /* SURICATA_HOST_QUEUE_H */
index 234c67112edf7353e73f6f957c12f4ab2de23964..db7bd40bc5b840335c00acbe6f4ba5f432aa9f3a 100644 (file)
@@ -101,11 +101,6 @@ void *HostAllocStorageById(Host *h, HostStorageId id)
     return StorageAllocByIdPrealloc(h->storage, STORAGE_HOST, id.id);
 }
 
-void HostFreeStorageById(Host *h, HostStorageId id)
-{
-    StorageFreeById(h->storage, STORAGE_HOST, id.id);
-}
-
 void HostFreeStorage(Host *h)
 {
     if (HostStorageSize() > 0)
index 64356e4313e79ff46daf97fd621e8b91ec342c04..2d9224a2017ed7526793ea5c61986bd386afff65 100644 (file)
@@ -38,7 +38,6 @@ void *HostGetStorageById(Host *h, HostStorageId id);
 int HostSetStorageById(Host *h, HostStorageId id, void *ptr);
 void *HostAllocStorageById(Host *h, HostStorageId id);
 
-void HostFreeStorageById(Host *h, HostStorageId id);
 void HostFreeStorage(Host *h);
 
 void RegisterHostStorageTests(void);
index 8542d5f78abb01188f2c5618fa452be9a92f9c0d..d1e358c1b1ca31327fc97310d290bd21b1f025b8 100644 (file)
 
 #include "reputation.h"
 
-uint32_t HostGetSpareCount(void)
-{
-    return HostSpareQueueGetSize();
-}
-
-uint32_t HostGetActiveCount(void)
-{
-    return SC_ATOMIC_GET(host_counter);
-}
-
 /** \internal
  *  \brief See if we can really discard this host. Check use_cnt reference.
  *
index 545d65fb31667312b39172e8d69c400eb96e9165..5292d4b98eb1452e16c519d77016a6af6fa7cb28 100644 (file)
@@ -26,8 +26,5 @@
 
 uint32_t HostTimeoutHash(SCTime_t ts);
 
-uint32_t HostGetSpareCount(void);
-uint32_t HostGetActiveCount(void);
-
 #endif
 
index 37c0f4dad479582f5c458ce0603e05ec192eaaad..2e53789cbff8e90e8fd9b12c7f44273c432156f2 100644 (file)
@@ -97,11 +97,6 @@ uint64_t HostGetMemuse(void)
     return memuse;
 }
 
-uint32_t HostSpareQueueGetSize(void)
-{
-    return HostQueueLen(&host_spare_q);
-}
-
 void HostMoveToSpare(Host *h)
 {
     HostEnqueue(&host_spare_q, h);
index ac83474fb9dbeedacb2858a220ff2b160f03bd8c..32d52271b8172cdf2e66b319c398327e4e1d6afa 100644 (file)
@@ -143,7 +143,6 @@ void HostRelease(Host *);
 void HostLock(Host *);
 void HostClearMemory(Host *);
 void HostMoveToSpare(Host *);
-uint32_t HostSpareQueueGetSize(void);
 void HostPrintStats (void);
 
 void HostRegisterUnittests(void);
index dac6b7e9c93518fc40f07fd71de50fb7ca5095a3..ef43b7f0251dd8d061bf90e64683c0f2687dd1a5 100644 (file)
@@ -131,12 +131,3 @@ IPPair *IPPairDequeue (IPPairQueue *q)
     HQLOCK_UNLOCK(q);
     return h;
 }
-
-uint32_t IPPairQueueLen(IPPairQueue *q)
-{
-    uint32_t len;
-    HQLOCK_LOCK(q);
-    len = q->len;
-    HQLOCK_UNLOCK(q);
-    return len;
-}
index 59a23f8859ab2b0a051ffe7e99b7a528ee8cb2c0..24253648c8f882f14b62215dfec5c8355b8a8695 100644 (file)
@@ -77,7 +77,6 @@ IPPairQueue *IPPairQueueInit(IPPairQueue *);
 void IPPairQueueDestroy (IPPairQueue *);
 
 void IPPairEnqueue (IPPairQueue *, IPPair *);
-IPPair *IPPairDequeue (IPPairQueue *);
-uint32_t IPPairQueueLen(IPPairQueue *);
+IPPair *IPPairDequeue(IPPairQueue *);
 
 #endif /* SURICATA_IPPAIR_QUEUE_H */
index a0e65c75df392df9537b2618825672ad8f64c3b5..8733605f71da4c7f652776241fc29b17e7f2bbed 100644 (file)
@@ -47,11 +47,6 @@ void *IPPairAllocStorageById(IPPair *h, IPPairStorageId id)
     return StorageAllocByIdPrealloc(h->storage, STORAGE_IPPAIR, id.id);
 }
 
-void IPPairFreeStorageById(IPPair *h, IPPairStorageId id)
-{
-    StorageFreeById(h->storage, STORAGE_IPPAIR, id.id);
-}
-
 void IPPairFreeStorage(IPPair *h)
 {
     if (IPPairStorageSize() > 0)
index e8d686d11313e092bc98970de1f4ea2847c16b3b..191793ef306ba319f81a1627a961c92bc14d8062 100644 (file)
@@ -38,7 +38,6 @@ void *IPPairGetStorageById(IPPair *h, IPPairStorageId id);
 int IPPairSetStorageById(IPPair *h, IPPairStorageId id, void *ptr);
 void *IPPairAllocStorageById(IPPair *h, IPPairStorageId id);
 
-void IPPairFreeStorageById(IPPair *h, IPPairStorageId id);
 void IPPairFreeStorage(IPPair *h);
 
 void RegisterIPPairStorageTests(void);
index 0f510fbd7d5db9f7b9f3de4b693416cafac5ad77..a3627c1ea91149b8fda4426ea695871fa6eeb9e4 100644 (file)
 #include "ippair-timeout.h"
 #include "detect-engine-threshold.h"
 
-uint32_t IPPairGetSpareCount(void)
-{
-    return IPPairSpareQueueGetSize();
-}
-
-uint32_t IPPairGetActiveCount(void)
-{
-    return SC_ATOMIC_GET(ippair_counter);
-}
-
 /** \internal
  *  \brief See if we can really discard this ippair. Check use_cnt reference.
  *
index 9370ef3d17ec8aaafb7bcf8d81e12f76db27c870..ee7250941b4b991103fb5e108b85badafefd4313 100644 (file)
@@ -26,7 +26,4 @@
 
 uint32_t IPPairTimeoutHash(SCTime_t ts);
 
-uint32_t IPPairGetSpareCount(void);
-uint32_t IPPairGetActiveCount(void);
-
 #endif
index b06f3d164414f106bb8283ee0df16c505e2a057e..ae77d7ca387dbc4c3b42352fca2eaed7c2978216 100644 (file)
@@ -95,11 +95,6 @@ uint64_t IPPairGetMemuse(void)
     return memusecopy;
 }
 
-uint32_t IPPairSpareQueueGetSize(void)
-{
-    return IPPairQueueLen(&ippair_spare_q);
-}
-
 void IPPairMoveToSpare(IPPair *h)
 {
     IPPairEnqueue(&ippair_spare_q, h);
@@ -519,11 +514,6 @@ void IPPairRelease(IPPair *h)
     SCMutexUnlock(&h->m);
 }
 
-void IPPairLock(IPPair *h)
-{
-    SCMutexLock(&h->m);
-}
-
 void IPPairUnlock(IPPair *h)
 {
     SCMutexUnlock(&h->m);
index e12b0656ca72dae0af0a9f64ef36fbb574f01755..4f42ab92e40e71cd54fc534974effeb219fb5d77 100644 (file)
@@ -122,10 +122,8 @@ void IPPairCleanup(void);
 IPPair *IPPairLookupIPPairFromHash (Address *, Address *);
 IPPair *IPPairGetIPPairFromHash (Address *, Address *);
 void IPPairRelease(IPPair *);
-void IPPairLock(IPPair *);
 void IPPairClearMemory(IPPair *);
 void IPPairMoveToSpare(IPPair *);
-uint32_t IPPairSpareQueueGetSize(void);
 void IPPairPrintStats (void);
 
 void IPPairRegisterUnittests(void);
@@ -133,7 +131,6 @@ void IPPairRegisterUnittests(void);
 IPPair *IPPairAlloc(void);
 void IPPairFree(IPPair *);
 
-void IPPairLock(IPPair *);
 void IPPairUnlock(IPPair *);
 
 int IPPairSetMemcap(uint64_t size);
index 5231a3667942ca2c0d4fb88e497f37f6c468b74b..85a2d7164d655be7fdd05057c1f26150f87f138a 100644 (file)
@@ -184,22 +184,6 @@ TmEcode OutputFlowLogThreadDeinit(ThreadVars *tv, void *thread_data)
     return TM_ECODE_OK;
 }
 
-void OutputFlowLogExitPrintStats(ThreadVars *tv, void *thread_data)
-{
-    OutputFlowLoggerThreadData *op_thread_data = (OutputFlowLoggerThreadData *)thread_data;
-    OutputLoggerThreadStore *store = op_thread_data->store;
-    OutputFlowLogger *logger = list;
-
-    while (logger && store) {
-        if (logger->ThreadExitPrintStats) {
-            logger->ThreadExitPrintStats(tv, store->thread_data);
-        }
-
-        logger = logger->next;
-        store = store->next;
-    }
-}
-
 void OutputFlowShutdown(void)
 {
     OutputFlowLogger *logger = list;
index da9ecf98e9f2bd3938c2feac19693f4b5ea7e51a..6fb7fcbb23e6c7f61ab4874b70f46a377408fb30 100644 (file)
@@ -40,6 +40,5 @@ void OutputFlowShutdown(void);
 TmEcode OutputFlowLog(ThreadVars *tv, void *thread_data, Flow *f);
 TmEcode OutputFlowLogThreadInit(ThreadVars *tv, void *initdata, void **data);
 TmEcode OutputFlowLogThreadDeinit(ThreadVars *tv, void *thread_data);
-void OutputFlowLogExitPrintStats(ThreadVars *tv, void *thread_data);
 
 #endif /* SURICATA_OUTPUT_FLOW_H */
index 913717ee23ca73dbe81756ccf56ca46a703cbf21..a1594926943f383664e39cd6e096f5538ce03f6f 100644 (file)
@@ -412,44 +412,6 @@ void OutputRegisterTxSubModule(LoggerId id, const char *parent_name,
         ThreadExitPrintStats);
 }
 
-/**
- * \brief Register a file output module.
- *
- * This function will register an output module so it can be
- * configured with the configuration file.
- *
- * \retval Returns 0 on success, -1 on failure.
- */
-void OutputRegisterFileModule(LoggerId id, const char *name,
-    const char *conf_name, OutputInitFunc InitFunc, FileLogger FileLogFunc,
-    ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit,
-    ThreadExitPrintStatsFunc ThreadExitPrintStats)
-{
-    if (unlikely(FileLogFunc == NULL)) {
-        goto error;
-    }
-
-    OutputModule *module = SCCalloc(1, sizeof(*module));
-    if (unlikely(module == NULL)) {
-        goto error;
-    }
-
-    module->logger_id = id;
-    module->name = name;
-    module->conf_name = conf_name;
-    module->InitFunc = InitFunc;
-    module->FileLogFunc = FileLogFunc;
-    module->ThreadInit = ThreadInit;
-    module->ThreadDeinit = ThreadDeinit;
-    module->ThreadExitPrintStats = ThreadExitPrintStats;
-    TAILQ_INSERT_TAIL(&output_modules, module, entries);
-
-    SCLogDebug("File logger \"%s\" registered.", name);
-    return;
-error:
-    FatalError("Fatal error encountered. Exiting...");
-}
-
 /**
  * \brief Register a file output sub-module.
  *
@@ -529,46 +491,6 @@ error:
     FatalError("Fatal error encountered. Exiting...");
 }
 
-/**
- * \brief Register a file data output sub-module.
- *
- * This function will register an output module so it can be
- * configured with the configuration file.
- *
- * \retval Returns 0 on success, -1 on failure.
- */
-void OutputRegisterFiledataSubModule(LoggerId id, const char *parent_name,
-    const char *name, const char *conf_name, OutputInitSubFunc InitFunc,
-    FiledataLogger FiledataLogFunc, ThreadInitFunc ThreadInit,
-    ThreadDeinitFunc ThreadDeinit,
-    ThreadExitPrintStatsFunc ThreadExitPrintStats)
-{
-    if (unlikely(FiledataLogFunc == NULL)) {
-        goto error;
-    }
-
-    OutputModule *module = SCCalloc(1, sizeof(*module));
-    if (unlikely(module == NULL)) {
-        goto error;
-    }
-
-    module->logger_id = id;
-    module->name = name;
-    module->conf_name = conf_name;
-    module->parent_name = parent_name;
-    module->InitSubFunc = InitFunc;
-    module->FiledataLogFunc = FiledataLogFunc;
-    module->ThreadInit = ThreadInit;
-    module->ThreadDeinit = ThreadDeinit;
-    module->ThreadExitPrintStats = ThreadExitPrintStats;
-    TAILQ_INSERT_TAIL(&output_modules, module, entries);
-
-    SCLogDebug("Filedata logger \"%s\" registered.", name);
-    return;
-error:
-    FatalError("Fatal error encountered. Exiting...");
-}
-
 /**
  * \brief Register a flow output sub-module.
  *
@@ -650,47 +572,6 @@ error:
     FatalError("Fatal error encountered. Exiting...");
 }
 
-/**
- * \brief Register a streaming data output sub-module.
- *
- * This function will register an output module so it can be
- * configured with the configuration file.
- *
- * \retval Returns 0 on success, -1 on failure.
- */
-void OutputRegisterStreamingSubModule(LoggerId id, const char *parent_name,
-    const char *name, const char *conf_name, OutputInitSubFunc InitFunc,
-    StreamingLogger StreamingLogFunc, enum OutputStreamingType stream_type,
-    ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit,
-    ThreadExitPrintStatsFunc ThreadExitPrintStats)
-{
-    if (unlikely(StreamingLogFunc == NULL)) {
-        goto error;
-    }
-
-    OutputModule *module = SCCalloc(1, sizeof(*module));
-    if (unlikely(module == NULL)) {
-        goto error;
-    }
-
-    module->logger_id = id;
-    module->name = name;
-    module->conf_name = conf_name;
-    module->parent_name = parent_name;
-    module->InitSubFunc = InitFunc;
-    module->StreamingLogFunc = StreamingLogFunc;
-    module->stream_type = stream_type;
-    module->ThreadInit = ThreadInit;
-    module->ThreadDeinit = ThreadDeinit;
-    module->ThreadExitPrintStats = ThreadExitPrintStats;
-    TAILQ_INSERT_TAIL(&output_modules, module, entries);
-
-    SCLogDebug("Streaming logger \"%s\" registered.", name);
-    return;
-error:
-    FatalError("Fatal error encountered. Exiting...");
-}
-
 /**
  * \brief Register a stats data output module.
  *
index 76b432a92663a1530c8496cbb9189aa11ff0df60..6c477547e66fc56a4efd12df8bb26b2bfa5ed410 100644 (file)
@@ -132,27 +132,15 @@ void OutputRegisterTxSubModuleWithProgress(LoggerId id, const char *parent_name,
     ThreadDeinitFunc ThreadDeinit,
     ThreadExitPrintStatsFunc ThreadExitPrintStats);
 
-void OutputRegisterFileModule(LoggerId id, const char *name,
-    const char *conf_name, OutputInitFunc InitFunc,
-    FileLogger FileLogFunc, ThreadInitFunc ThreadInit,
-    ThreadDeinitFunc ThreadDeinit,
-    ThreadExitPrintStatsFunc ThreadExitPrintStats);
 void OutputRegisterFileSubModule(LoggerId id, const char *parent_name,
     const char *name, const char *conf_name,
     OutputInitSubFunc InitFunc, FileLogger FileLogFunc,
     ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit,
     ThreadExitPrintStatsFunc ThreadExitPrintStats);
 
-void OutputRegisterFiledataModule(LoggerId id, const char *name,
-    const char *conf_name, OutputInitFunc InitFunc,
-    FiledataLogger FiledataLogFunc, ThreadInitFunc ThreadInit,
-    ThreadDeinitFunc ThreadDeinit,
-    ThreadExitPrintStatsFunc ThreadExitPrintStats);
-void OutputRegisterFiledataSubModule(LoggerId, const char *parent_name,
-    const char *name, const char *conf_name, OutputInitSubFunc InitFunc,
-    FiledataLogger FiledataLogFunc, ThreadInitFunc ThreadInit,
-    ThreadDeinitFunc ThreadDeinit,
-    ThreadExitPrintStatsFunc ThreadExitPrintStats);
+void OutputRegisterFiledataModule(LoggerId id, const char *name, const char *conf_name,
+        OutputInitFunc InitFunc, FiledataLogger FiledataLogFunc, ThreadInitFunc ThreadInit,
+        ThreadDeinitFunc ThreadDeinit, ThreadExitPrintStatsFunc ThreadExitPrintStats);
 
 void OutputRegisterFlowSubModule(LoggerId id, const char *parent_name,
     const char *name, const char *conf_name, OutputInitSubFunc InitFunc,
@@ -160,17 +148,10 @@ void OutputRegisterFlowSubModule(LoggerId id, const char *parent_name,
     ThreadDeinitFunc ThreadDeinit,
     ThreadExitPrintStatsFunc ThreadExitPrintStats);
 
-void OutputRegisterStreamingModule(LoggerId id, const char *name,
-    const char *conf_name, OutputInitFunc InitFunc,
-    StreamingLogger StreamingLogFunc, enum OutputStreamingType stream_type,
-    ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit,
-    ThreadExitPrintStatsFunc ThreadExitPrintStats);
-void OutputRegisterStreamingSubModule(LoggerId id, const char *parent_name,
-    const char *name, const char *conf_name,
-    OutputInitSubFunc InitFunc, StreamingLogger StreamingLogFunc,
-    enum OutputStreamingType stream_type,
-    ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit,
-    ThreadExitPrintStatsFunc ThreadExitPrintStats);
+void OutputRegisterStreamingModule(LoggerId id, const char *name, const char *conf_name,
+        OutputInitFunc InitFunc, StreamingLogger StreamingLogFunc,
+        enum OutputStreamingType stream_type, ThreadInitFunc ThreadInit,
+        ThreadDeinitFunc ThreadDeinit, ThreadExitPrintStatsFunc ThreadExitPrintStats);
 
 void OutputRegisterStatsModule(LoggerId id, const char *name,
     const char *conf_name, OutputInitFunc InitFunc,
index 3d503b965573c61cf7726d0f194116176d3de2b6..9b02b8748fc5c60d201f9565eed424c8cb684339 100644 (file)
@@ -261,11 +261,6 @@ static int NapatechInit(int runmode)
     return 0;
 }
 
-int RunModeNapatechAutoFp(void)
-{
-    return NapatechInit(NT_RUNMODE_AUTOFP);
-}
-
 int RunModeNapatechWorkers(void)
 {
     return NapatechInit(NT_RUNMODE_WORKERS);
index 5a264429d1bd6df48afe84384ae19bd2064ee22e..b849d7758eee45cbd4e62e12a263bc933909ad20 100644 (file)
@@ -29,7 +29,6 @@
 #include <nt.h>
 #endif /* HAVE_NAPATECH */
 
-int RunModeNapatechAutoFp(void);
 int RunModeNapatechWorkers(void);
 void RunModeNapatechRegister(void);
 const char *RunModeNapatechGetDefaultMode(void);
index 852155332d7535df0bdeaedf24c1570ae302ef53..c6e5f77351d7152869526b8f9c41b8329e36df97 100644 (file)
@@ -548,11 +548,6 @@ static int file_logger_count = 0;
 static int filedata_logger_count = 0;
 static LoggerId logger_bits[ALPROTO_MAX];
 
-int RunModeOutputFileEnabled(void)
-{
-    return file_logger_count > 0;
-}
-
 int RunModeOutputFiledataEnabled(void)
 {
     return filedata_logger_count > 0;
index af39fe13766b6ef31df6c7a61eafc0cb5e1753c3..ee156db0c69147865818b45b6c96789ee2cb67ec 100644 (file)
@@ -89,8 +89,6 @@ void RunModeInitializeThreadSettings(void);
 void RunModeInitializeOutputs(void);
 void RunModeShutDown(void);
 
-/* bool indicating if file logger is enabled */
-int RunModeOutputFileEnabled(void);
 /* bool indicating if filedata logger is enabled */
 int RunModeOutputFiledataEnabled(void);
 /** bool indicating if run mode is offline */
index b69fd497dc8c99d84f13b89618345e5b15d0b36d..013769a06d5a033a36988dc40162f078e8248e29 100644 (file)
@@ -283,11 +283,6 @@ TmEcode AFXDPQueueProtectionInit(void)
     SCReturnInt(TM_ECODE_OK);
 }
 
-void AFXDPMutexClean(void)
-{
-    SCMutexDestroy(&xsk_protect.queue_protect);
-}
-
 static TmEcode AFXDPAssignQueueID(AFXDPThreadVars *ptv)
 {
     if (ptv->xsk.queue.assigned == false) {
index 70a56a13fa02d82607b5d2520ab5a7f16fb9d646..e6ce0bc3e46816828bf8227e0ff0810028e7e499 100644 (file)
@@ -64,6 +64,5 @@ void TmModuleReceiveAFXDPRegister(void);
 void TmModuleDecodeAFXDPRegister(void);
 
 TmEcode AFXDPQueueProtectionInit(void);
-void AFXDPMutexClean(void);
 
 #endif /* SURICATA_SOURCE_AFXDP_H */
index 114b98e051df8cce1810ecd447000958fc3309b8..5a8bffec0f493694ab3a53b87f19da259fc8b96c 100644 (file)
@@ -412,11 +412,6 @@ static inline uint64_t GetAbsLastAck(const TcpStream *stream)
     }
 }
 
-uint64_t StreamTcpGetAcked(const TcpStream *stream)
-{
-    return GetAbsLastAck(stream);
-}
-
 // may contain gaps
 uint64_t StreamDataRightEdge(const TcpStream *stream, const bool eof)
 {
@@ -2178,16 +2173,6 @@ void StreamTcpCreateTestPacket(uint8_t *payload, uint8_t value,
  *  \param  stream          Reassembled stream returned from the reassembly functions
  */
 
-int StreamTcpCheckStreamContents(uint8_t *stream_policy, uint16_t sp_size, TcpStream *stream)
-{
-    if (StreamingBufferCompareRawData(&stream->sb, stream_policy,(uint32_t)sp_size) == 0)
-    {
-        //PrintRawDataFp(stdout, stream_policy, sp_size);
-        return 0;
-    }
-    return 1;
-}
-
 static int VALIDATE(TcpStream *stream, uint8_t *data, uint32_t data_len)
 {
     if (StreamingBufferCompareRawData(&stream->sb,
index 9a13b023afc1ff4361ab907208ad6d25128d5aa2..d2482bf5eabaae73e29f425384c23526bf0fc5af 100644 (file)
@@ -131,10 +131,6 @@ uint64_t StreamTcpReassembleMemuseGlobalCounter(void);
 void StreamTcpDisableAppLayer(Flow *f);
 int StreamTcpAppLayerIsDisabled(Flow *f);
 
-#ifdef UNITTESTS
-int StreamTcpCheckStreamContents(uint8_t *, uint16_t , TcpStream *);
-#endif
-
 bool StreamReassembleRawHasDataReady(TcpSession *ssn, Packet *p);
 void StreamTcpReassemblySetMinInspectDepth(TcpSession *ssn, int direction, uint32_t depth);
 
index 4f5bb35e7711b3b6f8f769492204719d18731811..065db5f6e837f547183413914acb9244ea9c8a99 100644 (file)
@@ -202,7 +202,6 @@ int TcpSessionPacketSsnReuse(const Packet *p, const Flow *f, const void *tcp_ssn
 void StreamTcpUpdateAppLayerProgress(TcpSession *ssn, char direction,
         const uint32_t progress);
 
-uint64_t StreamTcpGetAcked(const TcpStream *stream);
 uint64_t StreamTcpGetUsable(const TcpStream *stream, const bool eof);
 uint64_t StreamDataRightEdge(const TcpStream *stream, const bool eof);
 
index 8f6082a91a600dfd541c53ca5e845f56a9e8f7c3..b9542b48f083ddab25aa5bba6144b384713950b2 100644 (file)
@@ -68,17 +68,6 @@ TmModule *TmModuleGetByName(const char *name)
     return NULL;
 }
 
-/** \brief get the id of a module from it's name
- *  \param name registered name of the module
- *  \retval id the id or -1 in case of error */
-int TmModuleGetIdByName(const char *name)
-{
-    TmModule *tm = TmModuleGetByName(name);
-    if (tm == NULL)
-        return -1;
-    return TmModuleGetIDForTM(tm);
-}
-
 /**
  * \brief Returns a TM Module by its id.
  *
index 5788e66f581f89a817e95ce71998d24d8735c1d3..70817fb0792dd41293ae1d17042a70d194eaccbc 100644 (file)
@@ -95,7 +95,6 @@ typedef struct OutputCtx_ {
 
 TmModule *TmModuleGetByName(const char *name);
 TmModule *TmModuleGetById(int id);
-int TmModuleGetIdByName(const char *name);
 int TmModuleGetIDForTM(TmModule *tm);
 TmEcode TmModuleRegister(char *name, int (*module_func)(ThreadVars *, Packet *, void *));
 void TmModuleDebugList(void);
index fb2f211012fc5a5bab03d3443bdb3584fa3b0e7e..48322bfb633ee3b1c0bd9516017094d17a90a1a8 100644 (file)
@@ -243,22 +243,6 @@ void PacketPoolReturnPacket(Packet *p)
     }
 }
 
-void PacketPoolInitEmpty(void)
-{
-    PktPool *my_pool = GetThreadPacketPool();
-
-#ifdef DEBUG_VALIDATION
-    BUG_ON(my_pool->initialized);
-    my_pool->initialized = 1;
-    my_pool->destroyed = 0;
-#endif /* DEBUG_VALIDATION */
-
-    SCMutexInit(&my_pool->return_stack.mutex, NULL);
-    SCCondInit(&my_pool->return_stack.cond, NULL);
-    SC_ATOMIC_INIT(my_pool->return_stack.return_threshold);
-    SC_ATOMIC_SET(my_pool->return_stack.return_threshold, 32);
-}
-
 void PacketPoolInit(void)
 {
     PktPool *my_pool = GetThreadPacketPool();
index 8d274c9e12e87896d093f4ce58e2604be8182fb2..f2dedd93a610dd1181c515202d4df41de47bbbff 100644 (file)
@@ -80,7 +80,6 @@ Packet *PacketPoolGetPacket(void);
 void PacketPoolWait(void);
 void PacketPoolReturnPacket(Packet *p);
 void PacketPoolInit(void);
-void PacketPoolInitEmpty(void);
 void PacketPoolDestroy(void);
 void PacketPoolPostRunmodes(void);
 
index 620b507dfa9999f5f154ab83990e7ad3fd2a6d2c..a1aaa92dd37f8af01bea6bf731be74455715e94c 100644 (file)
@@ -83,17 +83,6 @@ void BloomFilterCountingFree(BloomFilterCounting *bf)
     }
 }
 
-void BloomFilterCountingPrint(BloomFilterCounting *bf)
-{
-    printf("\n------ Counting Bloom Filter Stats ------\n");
-    printf("Buckets:               %" PRIu32 "\n", bf->array_size);
-    printf("Counter size:          %" PRIu32 "\n", bf->type);
-    printf("Memory size:           %" PRIu32 " bytes\n", bf->array_size * bf->type);
-    printf("Hash function pointer: %p\n", bf->Hash);
-    printf("Hash functions:        %" PRIu32 "\n", bf->hash_iterations);
-    printf("-----------------------------------------\n");
-}
-
 int BloomFilterCountingAdd(BloomFilterCounting *bf, const void *data, uint16_t datalen)
 {
     uint8_t iter = 0;
index 1614de1ac7edc18912742699eb27096dde862f54..91c723011589e224b924560eb02df971d54e8633 100644 (file)
@@ -36,7 +36,6 @@ typedef struct BloomFilterCounting_ {
 /* prototypes */
 BloomFilterCounting *BloomFilterCountingInit(uint32_t, uint8_t, uint8_t, uint32_t (*Hash)(const void *, uint16_t, uint8_t, uint32_t));
 void BloomFilterCountingFree(BloomFilterCounting *);
-void BloomFilterCountingPrint(BloomFilterCounting *);
 int BloomFilterCountingAdd(BloomFilterCounting *, const void *, uint16_t);
 int BloomFilterCountingRemove(BloomFilterCounting *, const void *, uint16_t);
 int BloomFilterCountingTest(BloomFilterCounting *, const void *, uint16_t);
index 5d2549c6a9a4631b7c4063f8b60af3878fd9a976..8278a980d431a60db5892805ae52e657f407e492 100644 (file)
@@ -74,16 +74,6 @@ void BloomFilterFree(BloomFilter *bf)
     }
 }
 
-void BloomFilterPrint(BloomFilter *bf)
-{
-    printf("\n---------- Bloom Filter Stats -----------\n");
-    printf("Buckets:               %" PRIu32 "\n", bf->bitarray_size);
-    printf("Memory size:           %" PRIu32 " bytes\n", bf->bitarray_size/8 + 1);
-    printf("Hash function pointer: %p\n", bf->Hash);
-    printf("Hash functions:        %" PRIu32 "\n", bf->hash_iterations);
-    printf("-----------------------------------------\n");
-}
-
 int BloomFilterAdd(BloomFilter *bf, const void *data, uint16_t datalen)
 {
     uint8_t iter = 0;
@@ -100,22 +90,6 @@ int BloomFilterAdd(BloomFilter *bf, const void *data, uint16_t datalen)
     return 0;
 }
 
-uint32_t BloomFilterMemoryCnt(BloomFilter *bf)
-{
-     if (bf == NULL)
-         return 0;
-
-     return 2;
-}
-
-uint32_t BloomFilterMemorySize(BloomFilter *bf)
-{
-     if (bf == NULL)
-         return 0;
-
-     return (sizeof(BloomFilter) + (bf->bitarray_size/8) + 1);
-}
-
 /*
  * ONLY TESTS BELOW THIS COMMENT
  */
index 2eecdf3d7d6d513d252c22f6fbe328aa6fe09057..b15b340b488a5a22f19b0a15375e674490fd204e 100644 (file)
@@ -35,10 +35,7 @@ typedef struct BloomFilter_ {
 /* prototypes */
 BloomFilter *BloomFilterInit(uint32_t, uint8_t, uint32_t (*Hash)(const void *, uint16_t, uint8_t, uint32_t));
 void BloomFilterFree(BloomFilter *);
-void BloomFilterPrint(BloomFilter *);
 int BloomFilterAdd(BloomFilter *, const void *, uint16_t);
-uint32_t BloomFilterMemoryCnt(BloomFilter *);
-uint32_t BloomFilterMemorySize(BloomFilter *);
 
 void BloomFilterRegisterTests(void);
 
index c73d5221e3476a0dad86b2d1bdd7bc2dc37ec4c3..897eabfa7e406e25054a91c4407f9c4a32b1f30d 100644 (file)
@@ -134,39 +134,6 @@ uint16_t UtilCpuGetNumProcessorsOnline(void)
 #endif
 }
 
-/**
- * \brief Get the maximum number of cpus allowed in the system
- *        This syscall is present on Solaris, but it's not on linux
- *        or macosx. Maybe you should look at UtilCpuGetNumProcessorsConfigured()
- * \retval 0 if the syscall is not available or we have an error;
- *           otherwise it will return the number of cpus allowed
- */
-uint16_t UtilCpuGetNumProcessorsMax(void)
-{
-#ifdef SYSCONF_NPROCESSORS_MAX_COMPAT
-    long nprocs = -1;
-    nprocs = sysconf(_SC_NPROCESSORS_MAX);
-    if (nprocs < 1) {
-        SCLogError("Couldn't retrieve the maximum number of cpus "
-                   "allowed by the system (%s)",
-                strerror(errno));
-        return 0;
-    }
-
-    if (nprocs > UINT16_MAX) {
-        SCLogDebug("It seems that the system support more that %"PRIu16" CPUs. You "
-                   "can modify util-cpu.{c,h} to use uint32_t to support it", UINT16_MAX);
-        return UINT16_MAX;
-    }
-
-    return (uint16_t)nprocs;
-#else
-    SCLogError("Couldn't retrieve the maximum number of cpus allowed by "
-               "the system, synconf macro unavailable");
-    return 0;
-#endif
-}
-
 /**
  * \brief Print a summary of CPUs detected (configured and online)
  */
index 4799490ee024f82fa1f4d8d490e4986e98b7a313..8e31c338f2f4e3995b9a08e7fca5147e23ccb0f0 100644 (file)
@@ -29,9 +29,6 @@ uint16_t UtilCpuGetNumProcessorsConfigured(void);
 /* Processors online: */
 uint16_t UtilCpuGetNumProcessorsOnline(void);
 
-/* Only on Solaris */
-uint16_t UtilCpuGetNumProcessorsMax(void);
-
 void UtilCpuPrintSummary(void);
 
 uint64_t UtilCpuGetTicks(void);
index fd66375cb9fc2baf983b3025ef75c4c7c0fd7be4..65074fac0ef9874a6f89e3f05f3099da77d6e9e6 100644 (file)
@@ -314,27 +314,6 @@ int SCLogMatchFGFilterBL(const char *file, const char *function, int line)
     return SCLogMatchFGFilter(file, function, line, SC_LOG_FILTER_BL);
 }
 
-/**
- * \brief Adds a Whitelist(WL) fine-grained(FG) filter.  A FG filter WL filter
- *        allows messages that match this filter, to be logged, while the filter
- *        is defined using a file_name, function_name and line_number.
- *
- *        If a particular parameter in the fg-filter(file, function and line),
- *        shouldn't be considered while logging the message, one can supply
- *        NULL for the file_name or function_name and a negative line_no.
- *
- * \param file     File_name of the filter
- * \param function Function_name of the filter
- * \param line     Line number of the filter
- *
- * \retval  0 on successfully adding the filter;
- * \retval -1 on failure
- */
-int SCLogAddFGFilterWL(const char *file, const char *function, int line)
-{
-    return SCLogAddFGFilter(file, function, line, SC_LOG_FILTER_WL);
-}
-
 /**
  * \brief Adds a Blacklist(BL) fine-grained(FG) filter.  A FG filter BL filter
  *        allows messages that don't match this filter, to be logged, while the
index 5007f7b9677a320df6956e6aac70fb73fd754e0f..9272a147cbf4b1900119c8e166440f5faa6126f4 100644 (file)
@@ -91,9 +91,6 @@ extern int sc_log_fg_filters_present;
 
 extern int sc_log_fd_filters_present;
 
-
-int SCLogAddFGFilterWL(const char *, const char *, int);
-
 int SCLogAddFGFilterBL(const char *, const char *, int);
 
 int SCLogMatchFGFilterBL(const char *, const char *, int);
index b624cf07342be1a2f903318ae8d701d4eec6ea04..a329be4786ba84cb5ddf17291b0a957ff5a19f8c 100644 (file)
@@ -486,25 +486,6 @@ int LiveDevUseBypass(LiveDevice *dev)
     return 0;
 }
 
-/**
- * Set number of currently bypassed flows for a protocol family
- *
- * \param dev pointer to LiveDevice to set stats for
- * \param cnt number of currently bypassed flows
- * \param family AF_INET to set IPv4 count or AF_INET6 to set IPv6 count
- */
-void LiveDevSetBypassStats(LiveDevice *dev, uint64_t cnt, int family)
-{
-    BypassInfo *bpfdata = LiveDevGetStorageById(dev, g_bypass_storage_id);
-    if (bpfdata) {
-        if (family == AF_INET) {
-            SC_ATOMIC_SET(bpfdata->ipv4_hash_count, cnt);
-        } else if (family == AF_INET6) {
-            SC_ATOMIC_SET(bpfdata->ipv6_hash_count, cnt);
-        }
-    }
-}
-
 /**
  * Increase number of currently bypassed flows for a protocol family
  *
index 8e5cedbbd0b980bea6c924a554f4c310c5859567..0774825385a355b4b72402f97b16377bcc64ccb6 100644 (file)
@@ -81,7 +81,6 @@ void LiveDevRegisterExtension(void);
 int LiveRegisterDeviceName(const char *dev);
 int LiveRegisterDevice(const char *dev);
 int LiveDevUseBypass(LiveDevice *dev);
-void LiveDevSetBypassStats(LiveDevice *dev, uint64_t cnt, int family);
 void LiveDevAddBypassStats(LiveDevice *dev, uint64_t cnt, int family);
 void LiveDevSubBypassStats(LiveDevice *dev, uint64_t cnt, int family);
 void LiveDevAddBypassFail(LiveDevice *dev, uint64_t cnt, int family);
index 412a46fa7eb9fa8f7b01c05c869742a3794a3175..ea04f2d7bb94e19b765f6f225ea623681000ee17 100644 (file)
@@ -101,14 +101,6 @@ void HashTableFree(HashTable *ht)
     SCFree(ht);
 }
 
-void HashTablePrint(HashTable *ht)
-{
-    printf("\n----------- Hash Table Stats ------------\n");
-    printf("Buckets:               %" PRIu32 "\n", ht->array_size);
-    printf("Hash function pointer: %p\n", ht->Hash);
-    printf("-----------------------------------------\n");
-}
-
 int HashTableAdd(HashTable *ht, void *data, uint16_t datalen)
 {
     if (ht == NULL || data == NULL)
index 1f25cfdf076975233bed821612ad6f1cbbb15d83..ec96f5bcac7148f2529a6ab3fb7db657b8838c54 100644 (file)
@@ -48,7 +48,6 @@ typedef struct HashTable_ {
 /* prototypes */
 HashTable* HashTableInit(uint32_t, uint32_t (*Hash)(struct HashTable_ *, void *, uint16_t), char (*Compare)(void *, uint16_t, void *, uint16_t), void (*Free)(void *));
 void HashTableFree(HashTable *);
-void HashTablePrint(HashTable *);
 int HashTableAdd(HashTable *, void *, uint16_t);
 int HashTableRemove(HashTable *, void *, uint16_t);
 void *HashTableLookup(HashTable *, void *, uint16_t);
index e4b62a613d6e6556ac28c0695b7721cc03fb3e58..085a988afe766157ecce0aad430ed2e7fb175d4a 100644 (file)
@@ -111,14 +111,6 @@ void HashListTableFree(HashListTable *ht)
     SCFree(ht);
 }
 
-void HashListTablePrint(HashListTable *ht)
-{
-    printf("\n----------- Hash Table Stats ------------\n");
-    printf("Buckets:               %" PRIu32 "\n", ht->array_size);
-    printf("Hash function pointer: %p\n", ht->Hash);
-    printf("-----------------------------------------\n");
-}
-
 int HashListTableAdd(HashListTable *ht, void *data, uint16_t datalen)
 {
     if (ht == NULL || data == NULL)
index cfbc0287dfab2aaf0a7607157ce9987173e8e99d..15bd578e5319f1aeed672fe1521b8040e199650d 100644 (file)
@@ -47,7 +47,6 @@ typedef struct HashListTable_ {
 /* prototypes */
 HashListTable* HashListTableInit(uint32_t, uint32_t (*Hash)(struct HashListTable_ *, void *, uint16_t), char (*Compare)(void *, uint16_t, void *, uint16_t), void (*Free)(void *));
 void HashListTableFree(HashListTable *);
-void HashListTablePrint(HashListTable *);
 int HashListTableAdd(HashListTable *, void *, uint16_t);
 int HashListTableRemove(HashListTable *, void *, uint16_t);
 void *HashListTableLookup(HashListTable *, void *, uint16_t);
index bb9ff520c965eb528a61dd128030eb61c412de43..1d7523f75beee707c27cb9fbfae1bc9e19ca8d9a 100644 (file)
@@ -268,13 +268,6 @@ void PoolFree(Pool *p)
     SCFree(p);
 }
 
-void PoolPrint(Pool *p)
-{
-    printf("\n----------- Hash Table Stats ------------\n");
-    printf("Buckets:               %" PRIu32 "\n", p->empty_stack_size + p->alloc_stack_size);
-    printf("-----------------------------------------\n");
-}
-
 void *PoolGet(Pool *p)
 {
     SCEnter();
@@ -373,18 +366,6 @@ void PoolReturn(Pool *p, void *data)
     SCReturn;
 }
 
-void PoolPrintSaturation(Pool *p)
-{
-    if (p->max_buckets > 0) {
-        SCLogDebug("pool %p is using %" PRIu32 " out of %" PRIu32 " items (%02.1f%%), max %" PRIu32
-                   " (%02.1f%%): pool struct memory %" PRIu64 ".",
-                p, p->outstanding, p->max_buckets,
-                (float)(p->outstanding) / (float)(p->max_buckets) * 100, p->max_outstanding,
-                (float)(p->max_outstanding) / (float)(p->max_buckets) * 100,
-                (uint64_t)(p->max_buckets * sizeof(PoolBucket)));
-    }
-}
-
 /*
  * ONLY TESTS BELOW THIS COMMENT
  */
index a2cc68d53129a96d97d8533ee95e3eaa8c954eb4..b34a524cb34d1223f72d2215fabe2e4ac0aa0749 100644 (file)
@@ -74,8 +74,6 @@ typedef struct Pool_ {
 /* prototypes */
 Pool* PoolInit(uint32_t, uint32_t, uint32_t, void *(*Alloc)(void), int (*Init)(void *, void *), void *, void (*Cleanup)(void *), void (*Free)(void *));
 void PoolFree(Pool *);
-void PoolPrint(Pool *);
-void PoolPrintSaturation(Pool *p);
 
 void *PoolGet(Pool *);
 void PoolReturn(Pool *, void *);
index be87af1ccfdaa9d205c662b77f05fe9edbf57768..8fa2cba5969fea0c35a1d863adb8665cf5cced5a 100644 (file)
@@ -66,27 +66,6 @@ void PrintRawLineHexBuf(char *retbuf, uint32_t retbuflen, const uint8_t *buf, ui
     }
 }
 
-void PrintRawJsonFp(FILE *fp, uint8_t *buf, uint32_t buflen)
-{
-#define BUFFER_LENGTH 2048
-    char nbuf[BUFFER_LENGTH] = "";
-    uint32_t offset = 0;
-
-    for (uint32_t u = 0; u < buflen; u++) {
-        if (buf[u] == '\\' || buf[u] == '/' || buf[u] == '\"') {
-            PrintBufferData(nbuf, &offset, BUFFER_LENGTH,
-                             "\\%c", buf[u]);
-        } else if (isprint(buf[u])) {
-            PrintBufferData(nbuf, &offset, BUFFER_LENGTH,
-                             "%c", buf[u]);
-        } else {
-            PrintBufferData(nbuf, &offset, BUFFER_LENGTH,
-                            "\\\\x%02X", buf[u]);
-        }
-    }
-    fprintf(fp, "%s", nbuf);
-}
-
 void PrintRawUriFp(FILE *fp, uint8_t *buf, uint32_t buflen)
 {
 #define BUFFER_LENGTH 2048
index debb8953bc14e90fcab583bc98057f22ff30740a..e33de781997f9a0f6864c34a7a2990be641afde7 100644 (file)
@@ -41,9 +41,7 @@
 
 void PrintBufferRawLineHex(char *, int *,int, const uint8_t *, uint32_t);
 void PrintRawUriFp(FILE *, uint8_t *, uint32_t);
-void PrintRawUriBuf(char *, uint32_t *, uint32_t,
-                    uint8_t *, uint32_t);
-void PrintRawJsonFp(FILE *, uint8_t *, uint32_t);
+void PrintRawUriBuf(char *, uint32_t *, uint32_t, uint8_t *, uint32_t);
 void PrintRawDataFp(FILE *, const uint8_t *, uint32_t);
 void PrintRawDataToBuffer(uint8_t *dst_buf, uint32_t *dst_buf_offset_ptr, uint32_t dst_buf_size,
                           const uint8_t *src_buf, uint32_t src_buf_len);
index 861d1256f409ce37b1520988e9cf0443e9e5b94c..0362f21f2919a8d92f35553e99da9e04c2ac4d2c 100644 (file)
@@ -1355,21 +1355,6 @@ static void SCRadixRemoveKey(uint8_t *key_stream, uint16_t key_bitlen,
     return;
 }
 
-/**
- * \brief Removes a key from the Radix tree
- *
- * \param key_stream Data that has to be removed from the Radix tree
- * \param key_bitlen The bitlen of the above stream.
- * \param tree       Pointer to the Radix tree from which the key has to be
- *                   removed
- */
-void SCRadixRemoveKeyGeneric(uint8_t *key_stream, uint16_t key_bitlen,
-                             SCRadixTree *tree)
-{
-    SCRadixRemoveKey(key_stream, key_bitlen, tree, 255);
-    return;
-}
-
 /**
  * \brief Removes an IPV4 address netblock key from the Radix tree.
  *
index 240c2690733174c2a87d3b1e855960a3d16897bb..4a6b8d7f6cbde22b2c936e78a02aef2f01f1ac63 100644 (file)
@@ -105,7 +105,6 @@ SCRadixNode *SCRadixAddKeyIPV6Netblock(uint8_t *, SCRadixTree *, void *,
 bool SCRadixAddKeyIPV4String(const char *, SCRadixTree *, void *);
 bool SCRadixAddKeyIPV6String(const char *, SCRadixTree *, void *);
 
-void SCRadixRemoveKeyGeneric(uint8_t *, uint16_t, SCRadixTree *);
 void SCRadixRemoveKeyIPV4Netblock(uint8_t *, SCRadixTree *, uint8_t);
 void SCRadixRemoveKeyIPV4(uint8_t *, SCRadixTree *);
 void SCRadixRemoveKeyIPV6Netblock(uint8_t *, SCRadixTree *, uint8_t);
index 9e3ec0cdf81263497b7336cbd26aeb3e4dd38ddb..f96190f9aedd2cae8ca612b04981f0815b6b6197 100644 (file)
@@ -74,15 +74,3 @@ void UtilSignalHandlerSetup(int sig, void (*handler)(int))
 
     return;
 }
-
-#if 0
-int UtilSignalIsHandler(int sig, void (*handler)(int))
-{
-    struct sigaction action;
-    memset(&action, 0x00, sizeof(struct sigaction));
-
-    sigaction(sig, NULL, &action);
-
-    return (action.sa_handler == handler);
-}
-#endif
index 7061b6bb733440b655511889b9601bd46a3507c9..53e7682123595f50e4c339a9a07723470aadc7a7 100644 (file)
@@ -27,7 +27,4 @@
 int UtilSignalBlock(int);
 int UtilSignalUnblock(int);
 void UtilSignalHandlerSetup(int, void (*handler)(int));
-#if 0
-int UtilSignalIsHandler(int sig, void (*handler)(int));
-#endif
 #endif /* SURICATA_UTIL_SIGNAL_H */
index 823e2a646b68acb6e1a0407fac32db64d585f8a5..08eacca70cf5152cc3609da7c3db0f756c761978 100644 (file)
@@ -130,9 +130,3 @@ uint8_t *BasicSearchNocase(const uint8_t *haystack, uint32_t haystack_len, const
 
     return NULL;
 }
-
-void BasicSearchInit (void)
-{
-    /* nothing no more */
-}
-
index 87f028ab6381a8ec26d5dd885303975b6880dfcd..81151c45abb4d1c3fd23209345421056368f1b39 100644 (file)
@@ -29,6 +29,5 @@
 
 uint8_t *BasicSearch(const uint8_t *, uint32_t, const uint8_t *, uint16_t);
 uint8_t *BasicSearchNocase(const uint8_t *, uint32_t, const uint8_t *, uint16_t);
-void BasicSearchInit (void);
 
 #endif /* SURICATA_UTIL_SPM_BS */
index 589e6e9d92db1d7d228e81c4556bd8787a15f88a..4fcf26b20db2a68455c1dd760ad21ca68f1ae041 100644 (file)
@@ -53,29 +53,6 @@ void Bs2BmBadchars(const uint8_t *needle, uint16_t needle_len, uint8_t *badchars
         badchars[needle[i]] = 0;
 }
 
-/**
- * \brief Array setup function for Bs2BmNocase of bad characters index (not found at the needle)
- *
- * \param needle pointer to the pattern we ar searching for
- * \param needle_len length limit of the needle
- * \param badchars pointer to an empty array of bachars. The array prepared contains
- *                 characters that can't be inside the needle_len. So the skips can be
- *                 faster
- */
-void Bs2BmBadcharsNocase(const uint8_t *needle, uint16_t needle_len, uint8_t *badchars)
-{
-    uint32_t i;
-    for (i = 0; i < ALPHABET_SIZE; i++)
-        badchars[i] = 1;
-
-    /* set to 0 the values where index as ascii is present
-     * because they are not badchars
-     */
-    for (i = 0; i < needle_len; i++) {
-        badchars[u8_tolower(needle[i])] = 0;
-    }
-}
-
 /**
  * \brief Basic search with a bad characters array. The array badchars contains
  *        flags at character's ascii index that can't be inside the needle. So the skips can be
index c502d5314c4364f049d3e32913eb946116572903..7eedf01da1ac5a31ea33060f3d3055533dab3a8f 100644 (file)
@@ -29,7 +29,6 @@
 #define ALPHABET_SIZE 256
 
 void Bs2BmBadchars(const uint8_t *, uint16_t, uint8_t *);
-void Bs2BmBadcharsNocase(const uint8_t *, uint16_t, uint8_t *);
 uint8_t *Bs2Bm(const uint8_t *, uint32_t, const uint8_t *, uint16_t, const uint8_t[]);
 uint8_t *Bs2BmNocase(const uint8_t *, uint32_t, const uint8_t *, uint16_t, const uint8_t[]);
 
index 15b33398a62af4ad1326dddf089eead811349101..63510596c7a333567e560fee79dbdbb938d118d3 100644 (file)
@@ -220,23 +220,6 @@ uint8_t *Bs2bmSearch(const uint8_t *text, uint32_t textlen,
     return Bs2Bm(text, textlen, needle, needlelen, badchars);
 }
 
-/**
- * \brief Search a pattern in the text using the Bs2Bm nocase algorithm (build a bad characters array)
- *
- * \param text Text to search in
- * \param textlen length of the text
- * \param needle pattern to search for
- * \param needlelen length of the pattern
- */
-uint8_t *Bs2bmNocaseSearch(const uint8_t *text, uint32_t textlen,
-        const uint8_t *needle, uint16_t needlelen)
-{
-    uint8_t badchars[ALPHABET_SIZE];
-    Bs2BmBadchars(needle, needlelen, badchars);
-
-    return Bs2BmNocase(text, textlen, needle, needlelen, badchars);
-}
-
 /**
  * \brief Search a pattern in the text using Boyer Moore algorithm
  *        (build a bad character shifts array and good prefixes shift array)
index 2daeab85c740bf382c7e555aa4d8571ea24ec493..d923d19180feaf5e3137f7d1b9e526fb7af2b8a4 100644 (file)
@@ -90,8 +90,8 @@ uint8_t *SpmScan(const SpmCtx *ctx, SpmThreadCtx *thread_ctx,
                  const uint8_t *haystack, uint32_t haystack_len);
 
 /** Default algorithm to use: Boyer Moore */
-uint8_t *Bs2bmSearch(const uint8_t *text, uint32_t textlen, const uint8_t *needle, uint16_t needlelen);
-uint8_t *Bs2bmNocaseSearch(const uint8_t *text, uint32_t textlen, const uint8_t *needle, uint16_t needlelen);
+uint8_t *Bs2bmSearch(
+        const uint8_t *text, uint32_t textlen, const uint8_t *needle, uint16_t needlelen);
 uint8_t *BoyerMooreSearch(const uint8_t *text, uint32_t textlen, const uint8_t *needle, uint16_t needlelen);
 uint8_t *BoyerMooreNocaseSearch(const uint8_t *text, uint32_t textlen, uint8_t *needle, uint16_t needlelen);
 
index 493b139ee85f844aee2f44f86914886e1630aca0..02f69a568cd2eb0500b58c58c59bf861a25ce799 100644 (file)
@@ -295,115 +295,3 @@ void StorageFreeAll(Storage *storage, StorageEnum type)
         }
     }
 }
-
-#ifdef UNITTESTS
-
-static void *StorageTestAlloc(unsigned int size)
-{
-    void *x = SCMalloc(size);
-    return x;
-}
-static void StorageTestFree(void *x)
-{
-    if (x)
-        SCFree(x);
-}
-
-static int StorageTest01(void)
-{
-    StorageInit();
-
-    int id = StorageRegister(STORAGE_HOST, "test", 8, StorageTestAlloc, StorageTestFree);
-    if (id < 0)
-        goto error;
-    id = StorageRegister(STORAGE_HOST, "variable", 24, StorageTestAlloc, StorageTestFree);
-    if (id < 0)
-        goto error;
-    id = StorageRegister(STORAGE_FLOW, "store", sizeof(void *), StorageTestAlloc, StorageTestFree);
-    if (id < 0)
-        goto error;
-
-    if (StorageFinalize() < 0)
-        goto error;
-
-    StorageCleanup();
-    return 1;
-error:
-    StorageCleanup();
-    return 0;
-}
-
-static int StorageTest03(void)
-{
-    StorageInit();
-
-    int id = StorageRegister(STORAGE_HOST, "test", 8, StorageTestAlloc, StorageTestFree);
-    if (id < 0)
-        goto error;
-    id = StorageRegister(STORAGE_HOST, "test", 8, StorageTestAlloc, StorageTestFree);
-    if (id != -1) {
-        printf("duplicate registration should have failed: ");
-        goto error;
-    }
-
-    id = StorageRegister(STORAGE_HOST, "test1", 6, NULL, StorageTestFree);
-    if (id != -1) {
-        printf("duplicate registration should have failed (2): ");
-        goto error;
-    }
-
-    id = StorageRegister(STORAGE_HOST, "test2", 8, StorageTestAlloc, NULL);
-    if (id != -1) {
-        printf("duplicate registration should have failed (3): ");
-        goto error;
-    }
-
-    id = StorageRegister(STORAGE_HOST, "test3", 0, StorageTestAlloc, StorageTestFree);
-    if (id != -1) {
-        printf("duplicate registration should have failed (4): ");
-        goto error;
-    }
-
-    id = StorageRegister(STORAGE_HOST, "", 8, StorageTestAlloc, StorageTestFree);
-    if (id != -1) {
-        printf("duplicate registration should have failed (5): ");
-        goto error;
-    }
-
-    id = StorageRegister(STORAGE_HOST, NULL, 8, StorageTestAlloc, StorageTestFree);
-    if (id != -1) {
-        printf("duplicate registration should have failed (6): ");
-        goto error;
-    }
-
-    id = StorageRegister(STORAGE_MAX, "test4", 8, StorageTestAlloc, StorageTestFree);
-    if (id != -1) {
-        printf("duplicate registration should have failed (7): ");
-        goto error;
-    }
-
-    id = StorageRegister(38, "test5", 8, StorageTestAlloc, StorageTestFree);
-    if (id != -1) {
-        printf("duplicate registration should have failed (8): ");
-        goto error;
-    }
-
-    id = StorageRegister(-1, "test6", 8, StorageTestAlloc, StorageTestFree);
-    if (id != -1) {
-        printf("duplicate registration should have failed (9): ");
-        goto error;
-    }
-
-    StorageCleanup();
-    return 1;
-error:
-    StorageCleanup();
-    return 0;
-}
-
-void StorageRegisterTests(void)
-{
-    UtRegisterTest("StorageTest01", StorageTest01);
-    UtRegisterTest("StorageTest03", StorageTest03);
-}
-#endif
index 84860e622cf2bcb7fc2a0aa430ce70b7e2aa9243..11d64bdbecbd454445a9d36676c3f3383080140e 100644 (file)
@@ -71,5 +71,4 @@ void *StorageAllocByIdPrealloc(Storage *storage, StorageEnum type, int id);
 void StorageFreeById(Storage *storage, const StorageEnum type, const int id);
 void StorageFreeAll(Storage *storage, const StorageEnum type);
 
-void StorageRegisterTests(void);
 #endif
index 2b03cdeb439780d80d6d297c00b8ca676290ede2..ea8de3ee7ff1de96384e99657c0af5f7f1abaccb 100644 (file)
@@ -345,46 +345,6 @@ Packet *UTHBuildPacket(uint8_t *payload, uint16_t payload_len,
                               41424, 80);
 }
 
-/**
- * \brief UTHBuildPacketArrayFromEth is a wrapper that build a packets from an array of
- *        packets in ethernet rawbytes. Hint: It also share the flows.
- *
- * \param raw_eth pointer to the array of ethernet packets in rawbytes
- * \param pktsize pointer to the array of sizes corresponding to each buffer pointed
- *                from pktsize.
- * \param numpkts number of packets in the array
- *
- * \retval Packet pointer to the array of built in packets; NULL if something fail
- */
-Packet **UTHBuildPacketArrayFromEth(uint8_t *raw_eth[], int *pktsize, int numpkts)
-{
-    DecodeThreadVars dtv;
-    ThreadVars th_v;
-    if (raw_eth == NULL || pktsize == NULL || numpkts <= 0) {
-        SCLogError("The arrays cant be null, and the number"
-                   " of packets should be grater thatn zero");
-        return NULL;
-    }
-    Packet **p = NULL;
-    p = SCMalloc(sizeof(Packet *) * numpkts);
-    if (unlikely(p == NULL))
-        return NULL;
-
-    memset(&dtv, 0, sizeof(DecodeThreadVars));
-    memset(&th_v, 0, sizeof(th_v));
-
-    int i = 0;
-    for (; i < numpkts; i++) {
-        p[i] = PacketGetFromAlloc();
-        if (p[i] == NULL) {
-            SCFree(p);
-            return NULL;
-        }
-        DecodeEthernet(&th_v, &dtv, p[i], raw_eth[i], pktsize[i]);
-    }
-    return p;
-}
-
 /**
  * \brief UTHBuildPacketFromEth is a wrapper that build a packet for the rawbytes
  *
index ed6a023d10116fe7ef8c05b8930b4ee71aa72f42..f27dc5f1a21c7029ade23177d7875d9267142582 100644 (file)
@@ -46,7 +46,6 @@ Packet *UTHBuildPacketSrcDstPorts(uint8_t *, uint16_t, uint8_t ipproto, uint16_t
 Packet *UTHBuildPacketIPV6SrcDst(uint8_t *, uint16_t, uint8_t ipproto, const char *, const char *);
 
 int UTHPacketMatchSigMpm(Packet *, char *, uint16_t);
-Packet **UTHBuildPacketArrayFromEth(uint8_t **, int *, int);
 Packet *UTHBuildPacketFromEth(uint8_t *, uint16_t);
 
 void UTHFreePacket(Packet *);