Commit Graph

22 Commits (a6adb5dbbf9cf4ac634f9f85d551a4c777676813)

Author SHA1 Message Date
maxtors 06d74b5775 Module specific error code for init ctx error. 9 years ago
maxtors 69863f7b1c Corrected and unified debugmessages for init data errors in *ThreadInit. 9 years ago
Victor Julien 8394b38941 cppcheck: work around snprintf warning
Cppcheck 1.72 gives a warning on the following code pattern:

    char blah[32] = "";
    snprintf(blah, sizeof(blah), "something");

The warning is:

    (error) Buffer is accessed out of bounds.

While this appears to be a FP, in most cases the initialization to ""
was unnecessary as the snprintf statement immediately follows the
variable declaration.
10 years ago
Victor Julien c446abeb47 jansson: include in suricata-common.h 10 years ago
Victor Julien 8bb1cf08ef eve: fix mishandling of big messages
When the string representation of a JSON message grew bigger than
64k, the JSON record would just be truncated. This lead to errors
in the parser(s) of the JSON stream.

This patch changes the buffer logic to grow the buffer on demand.
10 years ago
Eric Leblond 538f37bd38 output-json: add app_proto key in root
By adding the key in the root of *flow and fileinfo  events it
will be possible to get all events for one application layer by
using a 'event_type:proto OR app_proto:proto' filter. This will
permit to the analyst to get a good view of events related to
one protocol.

This patch also fixes a regression in file logging where app_proto
was available before 94dbd303e4 create
the regression.
10 years ago
Jason Ish b512580bbe logging: integrate rotation into SCConfLogOpenGeneric.
Addresses issue 1492, and will make it harder to omit
rotation on new outputs.
10 years ago
Eric Leblond 39d667ff56 output-json: fix type of data parameter
The cast of data to AlertJsonThread was not correct as the real
type of the void pointer is a OutputJsonCtx. This was working by
luck because they both have a file_ctx as first element.
10 years ago
Victor Julien 4816dcc3d3 flow json log: add 'shutdown' as flow end reason
When engine shuts down all flows in the hash are logged out. They
may not have timed out yet. So they are forced. Log the reason to
be 'shutdown'.
11 years ago
Ken Steele 8f1d75039a Enforce function coding standard
Functions should be defined as:

int foo(void)
{
}

Rather than:
int food(void) {
}

All functions where changed by a script to match this standard.
11 years ago
Victor Julien f1185d051c flow id: quick and dirty first stab at a flow id
Add a 'flow_id' that is the same for all records produced for packets
belonging to the same flow.

This patch simply takes the flow's memory address.
11 years ago
Victor Julien 9f55ca0057 flow: add flow_end_flags field, add logging
The flow end flags field is filled by the flow manager or the flow
hash (in case of forced timeout of a flow) to record the timeout
conditions in the flow:
- emergency mode
- state
- reason (timed out or forced)

Add logging to the flow logger.
11 years ago
Victor Julien e6ed6731b1 flow log: log TCP state
Log the TCP state at timeout.
11 years ago
Victor Julien 6f9a2fcd58 flow: log individual tcp flags
Log the tcp flags.
11 years ago
Victor Julien 07b7f66f3c flow-log: log TCP flags per direction
In addition to flags for the entire session, also log out TCP flags
for both directions separately.
11 years ago
Victor Julien bd490736c2 flow: take flow pkt & byte count out of debug
Until now the flow packet and byte counters were only available in
DEBUG mode. For logging purposes they are now available always.
11 years ago
Victor Julien 7acea2c66d flow: track lastts in struct timeval
Track full timestamp for lastts in flows to be able to log it.
11 years ago
Victor Julien c66a29b67d flow: track bytes per direction
Track bytes in both flow directions for logging purposes.
11 years ago
Victor Julien f828793f8f flow log: log start/end times
Log time of first packet (flow creation) and of the last packet.
11 years ago
Victor Julien 672f6523a7 flow-log: log TCP flags seen
Log TCP flags seen during the life time of a flow/session.
11 years ago
Victor Julien ec7d446f16 flow-log: log pkts, bytes
Only in DEBUG currently.
11 years ago
Victor Julien 3c7af02067 flow-json-log: stub
Stub for JSON flow logger.
11 years ago