]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
log-pcap code cleanups
authorVictor Julien <victor@inliniac.net>
Tue, 7 Jan 2014 12:54:12 +0000 (13:54 +0100)
committerVictor Julien <victor@inliniac.net>
Fri, 18 Jul 2014 06:51:05 +0000 (08:51 +0200)
Code cleanups to make functions static.

src/log-pcap.c
src/log-pcap.h

index 344f0e502edf1623c1d481b20c83835bba036943..84c2f556acafe0f020c24f7305e2a9759f3d1df4 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2011 Open Information Security Foundation
+/* Copyright (C) 2007-2014 Open Information Security Foundation
  *
  * You can copy, redistribute or modify this Program under the terms of
  * the GNU General Public License version 2 as published by the Free
@@ -20,6 +20,7 @@
  * \file
  *
  * \author William Metcalf <William.Metcalf@gmail.com>
+ * \author Victor Julien <victor@inliniac.net>
  *
  * Pcap packet logging module.
  */
 #define USE_STREAM_DEPTH_DISABLED       0
 #define USE_STREAM_DEPTH_ENABLED        1
 
-TmEcode PcapLog(ThreadVars *, Packet *, void *, PacketQueue *, PacketQueue *);
-TmEcode PcapLogDataInit(ThreadVars *, void *, void **);
-TmEcode PcapLogDataDeinit(ThreadVars *, void *);
-static void PcapLogFileDeInitCtx(OutputCtx *);
-
 typedef struct PcapFileName_ {
     char *filename;
     char *dirname;
@@ -119,7 +115,12 @@ typedef struct PcapLogData_ {
     TAILQ_HEAD(, PcapFileName_) pcap_file_list;
 } PcapLogData;
 
-int PcapLogOpenFileCtx(PcapLogData *);
+static int PcapLogOpenFileCtx(PcapLogData *);
+static TmEcode PcapLog(ThreadVars *, Packet *, void *, PacketQueue *, PacketQueue *);
+static TmEcode PcapLogDataInit(ThreadVars *, void *, void **);
+static TmEcode PcapLogDataDeinit(ThreadVars *, void *);
+static void PcapLogFileDeInitCtx(OutputCtx *);
+static OutputCtx *PcapLogInitCtx(ConfNode *);
 
 void TmModulePcapLogRegister(void)
 {
@@ -147,7 +148,7 @@ void TmModulePcapLogRegister(void)
  * \param t Thread Variable containing  input/output queue, cpu affinity etc.
  * \param pl PcapLog thread variable.
  */
-int PcapLogCloseFile(ThreadVars *t, PcapLogData *pl)
+static int PcapLogCloseFile(ThreadVars *t, PcapLogData *pl)
 {
     if (pl != NULL) {
         PCAPLOG_PROFILE_START;
@@ -191,7 +192,7 @@ static void PcapFileNameFree(PcapFileName *pf)
  * \retval 0 on succces
  * \retval -1 on failure
  */
-int PcapLogRotateFile(ThreadVars *t, PcapLogData *pl)
+static int PcapLogRotateFile(ThreadVars *t, PcapLogData *pl)
 {
     PcapFileName *pf;
     PcapFileName *pfnext;
@@ -288,7 +289,7 @@ static int PcapLogOpenHandles(PcapLogData *pl, Packet *p) {
  * \retval TM_ECODE_OK on succes
  * \retval TM_ECODE_FAILED on serious error
  */
-TmEcode PcapLog (ThreadVars *t, Packet *p, void *data, PacketQueue *pq,
+static TmEcode PcapLog (ThreadVars *t, Packet *p, void *data, PacketQueue *pq,
                  PacketQueue *postpq)
 {
     size_t len;
@@ -361,7 +362,7 @@ TmEcode PcapLog (ThreadVars *t, Packet *p, void *data, PacketQueue *pq,
     return TM_ECODE_OK;
 }
 
-TmEcode PcapLogDataInit(ThreadVars *t, void *initdata, void **data)
+static TmEcode PcapLogDataInit(ThreadVars *t, void *initdata, void **data)
 {
     if (initdata == NULL) {
         SCLogDebug("Error getting context for PcapLog. \"initdata\" argument NULL");
@@ -431,7 +432,7 @@ static void ProfileReport(PcapLogData *pl) {
  *  \retval TM_ECODE_FAILED on failure
  */
 
-TmEcode PcapLogDataDeinit(ThreadVars *t, void *data)
+static TmEcode PcapLogDataDeinit(ThreadVars *t, void *data)
 {
     PcapLogData *pl = data;
 
@@ -452,7 +453,7 @@ TmEcode PcapLogDataDeinit(ThreadVars *t, void *data)
  *  \param conf The configuration node for this output.
  *  \retval output_ctx
  * */
-OutputCtx *PcapLogInitCtx(ConfNode *conf)
+static OutputCtx *PcapLogInitCtx(ConfNode *conf)
 {
     PcapLogData *pl = SCMalloc(sizeof(PcapLogData));
     if (unlikely(pl == NULL)) {
@@ -668,7 +669,7 @@ static void PcapLogFileDeInitCtx(OutputCtx *output_ctx)
  *  \retval -1 if failure
  *  \retval 0 if succesful
  */
-int PcapLogOpenFileCtx(PcapLogData *pl)
+static int PcapLogOpenFileCtx(PcapLogData *pl)
 {
     char *filename = NULL;
 
index 65dfe93ce3c078056c761c5abe5833ab667cc19f..3302b49420f8c4c090c7ad13b5b9ab9c3aa0ac45 100644 (file)
@@ -3,11 +3,9 @@
  *  \author Breno Silva <breno.silva@gmail.com>
  */
 
-#ifndef __PCAP_LOG_ALERT_H__
-#define __PCAP_LOG_ALERT_H__
+#ifndef __PCAP_LOG_H__
+#define __PCAP_LOG_H__
 
 void TmModulePcapLogRegister (void);
-OutputCtx *PcapLogInitCtx(ConfNode *);
 
-
-#endif /* __PCAP_LOG_ALERT_H__ */
+#endif /* __PCAP_LOG_H__ */