/**
* \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)
{
/**
* \brief Frees memory held by a custom format
- * \param LogCustomFormat * cf - format to relaease
+ * \param LogCustomFormat * cf - format to release
*/
void LogCustomFormatFree(LogCustomFormat *cf)
{
* \brief Writes a timestamp with given format into a MemBuffer
* \param MemBuffer * buffer - where to write
* \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)
* \author Ignacio Sanchez <sanchezmartin.ji@gmail.com>
* \author Paulo Pacheco <fooinha@gmail.com>
*
- * Common custom loggging format
+ * Common custom logging format
*/
#ifndef __LOG_CF_COMMON_H__
#define LOG_CF_SPACE_SEPARATOR " "
#define LOG_CF_UNKNOWN_VALUE "-"
-#define LOG_CF_WRITE_STAR_SEPATATOR(buffer) \
- MemBufferWriteString(buffer, LOG_CF_STAR_SEPARATOR);
+#define LOG_CF_WRITE_STAR_SEPARATOR(buffer) MemBufferWriteString(buffer, LOG_CF_STAR_SEPARATOR);
#define LOG_CF_WRITE_SPACE_SEPARATOR(buffer) \
MemBufferWriteString(buffer, LOG_CF_SPACE_SEPARATOR);
typedef struct LogCustomFormatNode_ {
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 */
} LogCustomFormatNode;
static void LogHttpLogExtended(LogHttpLogThread *aft, htp_tx_t *tx)
{
- LOG_CF_WRITE_STAR_SEPATATOR(aft->buffer);
+ LOG_CF_WRITE_STAR_SEPARATOR(aft->buffer);
/* referer */
htp_header_t *h_referer = NULL;
MemBufferWriteString(aft->buffer, "<no referer>");
}
- LOG_CF_WRITE_STAR_SEPATATOR(aft->buffer);
+ LOG_CF_WRITE_STAR_SEPARATOR(aft->buffer);
/* method */
if (tx->request_method != NULL) {
(uint8_t *)bstr_ptr(tx->request_method),
bstr_len(tx->request_method));
}
- LOG_CF_WRITE_STAR_SEPATATOR(aft->buffer);
+ LOG_CF_WRITE_STAR_SEPARATOR(aft->buffer);
/* protocol */
if (tx->request_protocol != NULL) {
} else {
MemBufferWriteString(aft->buffer, "<no protocol>");
}
- LOG_CF_WRITE_STAR_SEPATATOR(aft->buffer);
+ LOG_CF_WRITE_STAR_SEPARATOR(aft->buffer);
/* response status */
if (tx->response_status != NULL) {
}
/* 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);
}
} else {
MemBufferWriteString(aft->buffer, "<hostname unknown>");
}
- LOG_CF_WRITE_STAR_SEPATATOR(aft->buffer);
+ LOG_CF_WRITE_STAR_SEPARATOR(aft->buffer);
/* uri */
if (tx->request_uri != NULL) {
(uint8_t *)bstr_ptr(tx->request_uri),
bstr_len(tx->request_uri));
}
- LOG_CF_WRITE_STAR_SEPATATOR(aft->buffer);
+ LOG_CF_WRITE_STAR_SEPARATOR(aft->buffer);
/* user agent */
htp_header_t *h_user_agent = NULL;
}
/* ip/tcp header info */
- LOG_CF_WRITE_STAR_SEPATATOR(aft->buffer);
+ LOG_CF_WRITE_STAR_SEPARATOR(aft->buffer);
MemBufferWriteString(aft->buffer,
"%s:%" PRIu16 " -> %s:%" PRIu16 "\n",
srcip, sp, dstip, dp);
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;
*data = (void *)aft;
* \param t Thread Variable containing input/output queue, cpu affinity etc.
* \param pl PcapLog thread variable.
*
- * \retval 0 on succces
+ * \retval 0 on success
* \retval -1 on failure
*/
static int PcapLogRotateFile(ThreadVars *t, PcapLogData *pl)
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_usec = SCTIME_USECS(p->ts);
if (IS_TUNNEL_PKT(p) && !IS_TUNNEL_ROOT_PKT(p)) {
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->pcap_dead_handle = NULL;
td->pcap_log->pcap_dumper = NULL;
*
* \param t Thread Variable containing input/output queue, cpu affinity etc.
* \param data PcapLog thread data.
- * \retval TM_ECODE_OK on succces
+ * \retval TM_ECODE_OK on success
* \retval TM_ECODE_FAILED on failure
*/
static TmEcode PcapLogDataDeinit(ThreadVars *t, void *thread_data)
const char *filename = NULL;
- if (conf != NULL) { /* To faciliate unit tests. */
+ if (conf != NULL) { /* To facilitate unit tests. */
filename = ConfNodeLookupChildValue(conf, "filename");
}
}
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");
}
if (ts_format != 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");
}
if (use_stream_depth != 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");
}
if (honor_pass_rules != NULL) {
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;
*data = (void *)aft;
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;
*data = (void *)aft;
output_ctx->data = NULL;
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;
s_default_log_dir = ConfigGetLogDirectory();