mkdir -p /path/to/my_build
cd /path/to/my_build
- Cmake /path/to/Snort++
+ cmake /path/to/Snort++
* An alternate method for building with Cmake and make is to run the
configure_cmake.sh script. It will automatically create and populate
mkdir -p /path/to/my_build
cd /path/to/my_build
- Cmake /path/to/Snort++ -G Xcode
+ cmake /path/to/Snort++ -G Xcode
* An alternate method for building with Xcode is to run the
configure_cmake.sh script. It will automatically create and populate
void pcre_setup(SnortConfig* sc)
{
- for ( unsigned i = 0; i < get_instance_max(); ++i )
+ for ( unsigned i = 0; i < sc->num_slots; ++i )
{
SnortState* ss = sc->state + i;
ss->pcre_ovector = (int *) SnortAlloc(s_ovector_max*sizeof(int));
void pcre_cleanup(SnortConfig* sc)
{
- for ( unsigned i = 0; i < get_instance_max(); ++i )
+ for ( unsigned i = 0; i < sc->num_slots; ++i )
{
SnortState* ss = sc->state + i;
struct PHClass
{
const InspectApi& api;
- bool init; // call pin->tinit()
- bool term; // call pin->tterm()
+ bool* init; // call pin->tinit()
+ bool* term; // call pin->tterm()
PHClass(const InspectApi& p) : api(p)
- { init = term = true; };
+ {
+ init = new bool[get_instance_max()];
+ term = new bool[get_instance_max()];
+ for ( unsigned i = 0; i < get_instance_max(); ++i )
+ init[i] = term[i] = true;
+ }
+ ~PHClass()
+ {
+ delete[] init;
+ delete[] term;
+ }
static bool comp (PHClass* a, PHClass* b)
{ return ( a->api.type < b->api.type ); };
if ( pi && pi->framework_policy )
{
+ unsigned slot = get_instance_id();
+
for ( auto* p : pi->framework_policy->ilist )
- if ( p->pp_class.init )
+ if ( p->pp_class.init[slot] )
{
p->handler->tinit();
- p->pp_class.init = false;
- p->pp_class.term = true;
+ p->pp_class.init[slot] = false;
+ p->pp_class.term[slot] = true;
}
}
}
if ( pi && pi->framework_policy )
{
+ unsigned slot = get_instance_id();
+
for ( auto* p : pi->framework_policy->ilist )
if ( p->pp_class.term )
{
p->handler->tterm();
- p->pp_class.term = false;
- p->pp_class.init = true;
+ p->pp_class.term[slot] = false;
+ p->pp_class.init[slot] = true;
}
}
}