[Snort-devel] [snort-cvs] CVS: snort plugbase.h,1.8,1.9 rules.c,1.5,1.6 rules.h,1.2,1.3 sp_react.c,1.4,1.5 sp_react.h,1.5,1.6 sp_respond.c,1.2,1.3 sp_respond.h,1.2,1.3 (fwd)

Fyodor fygrave at ...1...
Sat Sep 23 22:49:20 EDT 2000


~ :> Should we modify plugin-data handling to be in `void *' pointer of
~ :
~ :If you do any pointer arithmetic in Win32 with a void pointer you
~ :will get a compile error. I don't know if you want to make it a char
~ :pointer or just let me ifdef WIN32 the code so it is a char pointer
~ :instead of a void.


Well, there's no pointer arythmetic in it so far. When plugin function is
called, it basically resigns void pointer to pointer of it's own data
structure:

myplug(Packet *p, RspFpList *fp_list) {

MyData *ptr;
int param1;
float param2;

 ptr = (MyData *)fp_list->params;

 param1 = ptr->param1;
 param2 = ptr->param2;
...
}

This code should compile on WIN32 without problems AFAIK too:)
  
That's basically what I am suggesting, but if void would give troubles on
some platforms, we can switch to char, it doesn't really make difference.





More information about the Snort-devel mailing list