Subsections

4.2 Required Functions

Each dynamic module must define a set of functions and data objects to work within this framework.

4.2.1 Preprocessors

Each dynamic preprocessor must define the following items. These must be defined in the global scope of a source file (e.g. spp_example.c).

The preprocessor must be built with the same macros defined as the Snort binary and linked with the dynamic preprocessor library that was created during the Snort build. A package configuration file is exported as part of the Snort build and can be accessed using the following commands with PKG_CONFIG_PATH=$<$snort build prefix/lib/pkgconfig$>$:

4.2.2 Detection Engine

Each dynamic detection engine library must define the following functions.

The sample code provided with Snort predefines those functions and defines the following APIs to be used by a dynamic rules library.

4.2.3 Rules

Each dynamic rules library must define the following functions. Examples are defined in the file sfnort_dynamic_detection_lib.c. The metadata and setup function for the preprocessor should be defined in sfsnort_dynamic_detection_lib.h.

The sample code provided with Snort predefines those functions and uses the following data within the dynamic rules library.