log: spelling

pull/8828/head
Victor Julien 2 years ago
parent 449df7c351
commit c53265bf0e

@ -63,7 +63,7 @@ LogCustomFormat *LogCustomFormatAlloc(void)
/** /**
* \brief Frees memory held by a custom format node * \brief Frees memory held by a custom format node
* \param LogCustomFormatNode * node - node to relaease * \param LogCustomFormatNode * node - node to release
*/ */
void LogCustomFormatNodeFree(LogCustomFormatNode *node) void LogCustomFormatNodeFree(LogCustomFormatNode *node)
{ {
@ -75,7 +75,7 @@ void LogCustomFormatNodeFree(LogCustomFormatNode *node)
/** /**
* \brief Frees memory held by a custom format * \brief Frees memory held by a custom format
* \param LogCustomFormat * cf - format to relaease * \param LogCustomFormat * cf - format to release
*/ */
void LogCustomFormatFree(LogCustomFormat *cf) void LogCustomFormatFree(LogCustomFormat *cf)
{ {
@ -205,7 +205,7 @@ void LogCustomFormatAddNode(LogCustomFormat *cf, LogCustomFormatNode *node)
* \brief Writes a timestamp with given format into a MemBuffer * \brief Writes a timestamp with given format into a MemBuffer
* \param MemBuffer * buffer - where to write * \param MemBuffer * buffer - where to write
* \param const char * fmt - format to be used write timestamp * \param const char * fmt - format to be used write timestamp
* \param const struct timeveal *ts - the timetstamp * \param const struct timeveal *ts - the timestamp
* *
*/ */
void LogCustomFormatWriteTimestamp(MemBuffer *buffer, const char *fmt, const SCTime_t ts) void LogCustomFormatWriteTimestamp(MemBuffer *buffer, const char *fmt, const SCTime_t ts)

@ -22,7 +22,7 @@
* \author Ignacio Sanchez <sanchezmartin.ji@gmail.com> * \author Ignacio Sanchez <sanchezmartin.ji@gmail.com>
* \author Paulo Pacheco <fooinha@gmail.com> * \author Paulo Pacheco <fooinha@gmail.com>
* *
* Common custom loggging format * Common custom logging format
*/ */
#ifndef __LOG_CF_COMMON_H__ #ifndef __LOG_CF_COMMON_H__
@ -50,8 +50,7 @@
#define LOG_CF_SPACE_SEPARATOR " " #define LOG_CF_SPACE_SEPARATOR " "
#define LOG_CF_UNKNOWN_VALUE "-" #define LOG_CF_UNKNOWN_VALUE "-"
#define LOG_CF_WRITE_STAR_SEPATATOR(buffer) \ #define LOG_CF_WRITE_STAR_SEPARATOR(buffer) MemBufferWriteString(buffer, LOG_CF_STAR_SEPARATOR);
MemBufferWriteString(buffer, LOG_CF_STAR_SEPARATOR);
#define LOG_CF_WRITE_SPACE_SEPARATOR(buffer) \ #define LOG_CF_WRITE_SPACE_SEPARATOR(buffer) \
MemBufferWriteString(buffer, LOG_CF_SPACE_SEPARATOR); MemBufferWriteString(buffer, LOG_CF_SPACE_SEPARATOR);
@ -65,7 +64,7 @@
typedef struct LogCustomFormatNode_ { typedef struct LogCustomFormatNode_ {
uint32_t type; /**< Node format type. ie: LOG_CF_LITERAL, ... */ uint32_t type; /**< Node format type. ie: LOG_CF_LITERAL, ... */
uint32_t maxlen; /**< Maximun length of the data */ uint32_t maxlen; /**< Maximum length of the data */
char data[LOG_NODE_STRLEN]; /**< optional data. ie: http header name */ char data[LOG_NODE_STRLEN]; /**< optional data. ie: http header name */
} LogCustomFormatNode; } LogCustomFormatNode;

@ -316,7 +316,7 @@ static void LogHttpLogCustom(LogHttpLogThread *aft, htp_tx_t *tx, const SCTime_t
static void LogHttpLogExtended(LogHttpLogThread *aft, htp_tx_t *tx) static void LogHttpLogExtended(LogHttpLogThread *aft, htp_tx_t *tx)
{ {
LOG_CF_WRITE_STAR_SEPATATOR(aft->buffer); LOG_CF_WRITE_STAR_SEPARATOR(aft->buffer);
/* referer */ /* referer */
htp_header_t *h_referer = NULL; htp_header_t *h_referer = NULL;
@ -331,7 +331,7 @@ static void LogHttpLogExtended(LogHttpLogThread *aft, htp_tx_t *tx)
MemBufferWriteString(aft->buffer, "<no referer>"); MemBufferWriteString(aft->buffer, "<no referer>");
} }
LOG_CF_WRITE_STAR_SEPATATOR(aft->buffer); LOG_CF_WRITE_STAR_SEPARATOR(aft->buffer);
/* method */ /* method */
if (tx->request_method != NULL) { if (tx->request_method != NULL) {
@ -339,7 +339,7 @@ static void LogHttpLogExtended(LogHttpLogThread *aft, htp_tx_t *tx)
(uint8_t *)bstr_ptr(tx->request_method), (uint8_t *)bstr_ptr(tx->request_method),
bstr_len(tx->request_method)); bstr_len(tx->request_method));
} }
LOG_CF_WRITE_STAR_SEPATATOR(aft->buffer); LOG_CF_WRITE_STAR_SEPARATOR(aft->buffer);
/* protocol */ /* protocol */
if (tx->request_protocol != NULL) { if (tx->request_protocol != NULL) {
@ -349,7 +349,7 @@ static void LogHttpLogExtended(LogHttpLogThread *aft, htp_tx_t *tx)
} else { } else {
MemBufferWriteString(aft->buffer, "<no protocol>"); MemBufferWriteString(aft->buffer, "<no protocol>");
} }
LOG_CF_WRITE_STAR_SEPATATOR(aft->buffer); LOG_CF_WRITE_STAR_SEPARATOR(aft->buffer);
/* response status */ /* response status */
if (tx->response_status != NULL) { if (tx->response_status != NULL) {
@ -372,7 +372,7 @@ static void LogHttpLogExtended(LogHttpLogThread *aft, htp_tx_t *tx)
} }
/* length */ /* length */
LOG_CF_WRITE_STAR_SEPATATOR(aft->buffer); LOG_CF_WRITE_STAR_SEPARATOR(aft->buffer);
MemBufferWriteString(aft->buffer, "%"PRIuMAX" bytes", (uintmax_t)tx->response_message_len); MemBufferWriteString(aft->buffer, "%"PRIuMAX" bytes", (uintmax_t)tx->response_message_len);
} }
@ -440,7 +440,7 @@ static TmEcode LogHttpLogIPWrapper(ThreadVars *tv, void *data, const Packet *p,
} else { } else {
MemBufferWriteString(aft->buffer, "<hostname unknown>"); MemBufferWriteString(aft->buffer, "<hostname unknown>");
} }
LOG_CF_WRITE_STAR_SEPATATOR(aft->buffer); LOG_CF_WRITE_STAR_SEPARATOR(aft->buffer);
/* uri */ /* uri */
if (tx->request_uri != NULL) { if (tx->request_uri != NULL) {
@ -448,7 +448,7 @@ static TmEcode LogHttpLogIPWrapper(ThreadVars *tv, void *data, const Packet *p,
(uint8_t *)bstr_ptr(tx->request_uri), (uint8_t *)bstr_ptr(tx->request_uri),
bstr_len(tx->request_uri)); bstr_len(tx->request_uri));
} }
LOG_CF_WRITE_STAR_SEPATATOR(aft->buffer); LOG_CF_WRITE_STAR_SEPARATOR(aft->buffer);
/* user agent */ /* user agent */
htp_header_t *h_user_agent = NULL; htp_header_t *h_user_agent = NULL;
@ -467,7 +467,7 @@ static TmEcode LogHttpLogIPWrapper(ThreadVars *tv, void *data, const Packet *p,
} }
/* ip/tcp header info */ /* ip/tcp header info */
LOG_CF_WRITE_STAR_SEPATATOR(aft->buffer); LOG_CF_WRITE_STAR_SEPARATOR(aft->buffer);
MemBufferWriteString(aft->buffer, MemBufferWriteString(aft->buffer,
"%s:%" PRIu16 " -> %s:%" PRIu16 "\n", "%s:%" PRIu16 " -> %s:%" PRIu16 "\n",
srcip, sp, dstip, dp); srcip, sp, dstip, dp);
@ -521,7 +521,7 @@ TmEcode LogHttpLogThreadInit(ThreadVars *t, const void *initdata, void **data)
return TM_ECODE_FAILED; return TM_ECODE_FAILED;
} }
/* Use the Ouptut Context (file pointer and mutex) */ /* Use the Output Context (file pointer and mutex) */
aft->httplog_ctx= ((OutputCtx *)initdata)->data; aft->httplog_ctx= ((OutputCtx *)initdata)->data;
*data = (void *)aft; *data = (void *)aft;

@ -341,7 +341,7 @@ static void PcapFileNameFree(PcapFileName *pf)
* \param t Thread Variable containing input/output queue, cpu affinity etc. * \param t Thread Variable containing input/output queue, cpu affinity etc.
* \param pl PcapLog thread variable. * \param pl PcapLog thread variable.
* *
* \retval 0 on succces * \retval 0 on success
* \retval -1 on failure * \retval -1 on failure
*/ */
static int PcapLogRotateFile(ThreadVars *t, PcapLogData *pl) static int PcapLogRotateFile(ThreadVars *t, PcapLogData *pl)
@ -680,7 +680,7 @@ static int PcapLog (ThreadVars *t, void *thread_data, const Packet *p)
return TM_ECODE_OK; return TM_ECODE_OK;
} }
/* PcapLogDumpSegment has writtens over the PcapLogData variables so need to update */ /* PcapLogDumpSegment has written over the PcapLogData variables so need to update */
pl->h->ts.tv_sec = SCTIME_SECS(p->ts); pl->h->ts.tv_sec = SCTIME_SECS(p->ts);
pl->h->ts.tv_usec = SCTIME_USECS(p->ts); pl->h->ts.tv_usec = SCTIME_USECS(p->ts);
if (IS_TUNNEL_PKT(p) && !IS_TUNNEL_ROOT_PKT(p)) { if (IS_TUNNEL_PKT(p) && !IS_TUNNEL_ROOT_PKT(p)) {
@ -1068,7 +1068,7 @@ static TmEcode PcapLogDataInit(ThreadVars *t, const void *initdata, void **data)
PcapLogLock(td->pcap_log); PcapLogLock(td->pcap_log);
/** Use the Ouptut Context (file pointer and mutex) */ /** Use the Output Context (file pointer and mutex) */
td->pcap_log->pkt_cnt = 0; td->pcap_log->pkt_cnt = 0;
td->pcap_log->pcap_dead_handle = NULL; td->pcap_log->pcap_dead_handle = NULL;
td->pcap_log->pcap_dumper = NULL; td->pcap_log->pcap_dumper = NULL;
@ -1186,7 +1186,7 @@ static void PcapLogDataFree(PcapLogData *pl)
* *
* \param t Thread Variable containing input/output queue, cpu affinity etc. * \param t Thread Variable containing input/output queue, cpu affinity etc.
* \param data PcapLog thread data. * \param data PcapLog thread data.
* \retval TM_ECODE_OK on succces * \retval TM_ECODE_OK on success
* \retval TM_ECODE_FAILED on failure * \retval TM_ECODE_FAILED on failure
*/ */
static TmEcode PcapLogDataDeinit(ThreadVars *t, void *thread_data) static TmEcode PcapLogDataDeinit(ThreadVars *t, void *thread_data)
@ -1371,7 +1371,7 @@ static OutputInitResult PcapLogInitCtx(ConfNode *conf)
const char *filename = NULL; const char *filename = NULL;
if (conf != NULL) { /* To faciliate unit tests. */ if (conf != NULL) { /* To facilitate unit tests. */
filename = ConfNodeLookupChildValue(conf, "filename"); filename = ConfNodeLookupChildValue(conf, "filename");
} }
@ -1615,7 +1615,7 @@ static OutputInitResult PcapLogInitCtx(ConfNode *conf)
} }
const char *ts_format = NULL; const char *ts_format = NULL;
if (conf != NULL) { /* To faciliate unit tests. */ if (conf != NULL) { /* To facilitate unit tests. */
ts_format = ConfNodeLookupChildValue(conf, "ts-format"); ts_format = ConfNodeLookupChildValue(conf, "ts-format");
} }
if (ts_format != NULL) { if (ts_format != NULL) {
@ -1630,7 +1630,7 @@ static OutputInitResult PcapLogInitCtx(ConfNode *conf)
} }
const char *use_stream_depth = NULL; const char *use_stream_depth = NULL;
if (conf != NULL) { /* To faciliate unit tests. */ if (conf != NULL) { /* To facilitate unit tests. */
use_stream_depth = ConfNodeLookupChildValue(conf, "use-stream-depth"); use_stream_depth = ConfNodeLookupChildValue(conf, "use-stream-depth");
} }
if (use_stream_depth != NULL) { if (use_stream_depth != NULL) {
@ -1644,7 +1644,7 @@ static OutputInitResult PcapLogInitCtx(ConfNode *conf)
} }
const char *honor_pass_rules = NULL; const char *honor_pass_rules = NULL;
if (conf != NULL) { /* To faciliate unit tests. */ if (conf != NULL) { /* To facilitate unit tests. */
honor_pass_rules = ConfNodeLookupChildValue(conf, "honor-pass-rules"); honor_pass_rules = ConfNodeLookupChildValue(conf, "honor-pass-rules");
} }
if (honor_pass_rules != NULL) { if (honor_pass_rules != NULL) {

@ -183,7 +183,7 @@ TmEcode LogStatsLogThreadInit(ThreadVars *t, const void *initdata, void **data)
return TM_ECODE_FAILED; return TM_ECODE_FAILED;
} }
/* Use the Ouptut Context (file pointer and mutex) */ /* Use the Output Context (file pointer and mutex) */
aft->statslog_ctx= ((OutputCtx *)initdata)->data; aft->statslog_ctx= ((OutputCtx *)initdata)->data;
*data = (void *)aft; *data = (void *)aft;

@ -183,7 +183,7 @@ TmEcode LogTcpDataLogThreadInit(ThreadVars *t, const void *initdata, void **data
return TM_ECODE_FAILED; return TM_ECODE_FAILED;
} }
/* Use the Ouptut Context (file pointer and mutex) */ /* Use the Output Context (file pointer and mutex) */
aft->tcpdatalog_ctx= ((OutputCtx *)initdata)->data; aft->tcpdatalog_ctx= ((OutputCtx *)initdata)->data;
*data = (void *)aft; *data = (void *)aft;

@ -363,7 +363,7 @@ static OutputInitResult LogTlsStoreLogInitCtx(ConfNode *conf)
output_ctx->data = NULL; output_ctx->data = NULL;
output_ctx->DeInit = LogTlsStoreLogDeInitCtx; output_ctx->DeInit = LogTlsStoreLogDeInitCtx;
/* FIXME we need to implement backward compability here */ /* FIXME we need to implement backward compatibility here */
const char *s_default_log_dir = NULL; const char *s_default_log_dir = NULL;
s_default_log_dir = ConfigGetLogDirectory(); s_default_log_dir = ConfigGetLogDirectory();

Loading…
Cancel
Save