Napatech 3GD Support

For use with Network Cards from Napatech utilizing the 3GD driver/api.

    - Implemented a new run mode in runmode-napatech-3gd.*
    - Implemented capture/decode threads in source-napatech-3gd.*
    - Integrated the new run mode and source into the build infrastructure.
    - Added some default values to suricata.yaml.in for napatech3gd

    New configure switches
    --enabled-napatech-3gd : Turns on the NT 3GD support
    --with-napatech-3gd-includes : The directory containing the NT 3GD header files
    --with-napatech-3gd-libraries : The directory containing the NT 3GD libraries to link against.

    New CLI switch
    --napatech-3gd : Uses the Napatech 3GD run mode

    Notes:
    - napatech3gd.streams in the yaml file must equal the number of streams the Napatech 3GD driver is set to use.
           (Configured in ntservice.ini by setting HostBuffersRx and using NTPL to assign the host buffers to streams)
    - tested with 1 Gbps sustained traffic

Signed-off-by: Matt Keeler <mk@npulsetech.com>

Change some uintmax_t vars to intmax_t

There were some compilation errors after pulling from the main repo and this fixes it.

Signed-off-by: Matt Keeler <mk@npulsetech.com>

Fixed compilation error

Fixed thread group name that was too long

Updated formatting to use 4 spaces instead of tabs

Moved NT_NetRxOpen into Napatech3GDStreamLoop from Napatech3GDStreamThreadInit

Used unlikely macro to speed up some branch prediction

Moved error definitions to the end of the SCError enum

Default locations for nt3gd libs and includes and put out 3gd status into summary

Updated NT3GD Interface to use built in runmodes and auto detect the number of streams and stream ids

Now exposes three runmodes auto, autofp and workers which uses the 3 builtin runmodes.

The builtin runmodes require a "live device" so the in-use stream ids are used to register one live device per stream id. Ex. stream id 1 will get registered as device nt3gd1.

Because the detect and output threading ratios are controlled by suricatas runmodes we no longer need the yaml configuration, also because we autodetect the number of streams we no longer need that value either.

Signed-off-by: Matt Keeler <mk@npulsetech.com>

Fixed some enum orderings

Signed-off-by: Matt Keeler <mk@npulsetech.com>

Finished undo of yaml config

Signed-off-by: Matt Keeler <mk@npulsetech.com>

Removed additions to .gitignore

Signed-off-by: Matt Keeler <mk@npulsetech.com>

Fix to comply with naming conventions and to remove newlines from the end of error messages

Signed-off-by: Matt Keeler <mk@npulsetech.com>

Fixed one last name

nt3gd_init becomes Napatech3GDInit

Signed-off-by: Matt Keeler <mk@npulsetech.com>

Thread Module and Runmode constants needed to be moved before the last "size" element of the enum

Both the runmode enum and thread modules enum have a sentinel size member at the end which is used for creating arrays. The nt3gd related members of the enum needed to be moved before the size member so that the sizes would be correct.

Signed-off-by: Matt Keeler <mk@npulsetech.com>

Pull Request 2 - Fixes

source-napatech-3gd.c
 - updated copyright to 2012
 - Moved timestamp handling cases around so that more likely ones appear first in the switch statement - basically move NDIS timestamp conversion to the end.

source-napatech-3gd.h
 - updated copyright to 2012

runmode-napatech-3gd.c
 - updated copyright to 2012
 - removed SCEnter usage from runmodes

runmode-napatech-3gd.h
 - updated copyright to 2012

Signed-off-by: Matt Keeler <mk@npulsetech.com>