[Snort-devel] Testing New Code

dogbert at ...2630... dogbert at ...2630...
Mon Jan 24 09:40:14 EST 2005

Hi all,

   I am working on a new function which will log the number of
packets per hour/minute/second every hour to /var/log/messages,
but I am trying to write better code, so I would like some help

(This function is currently operational under Snort-2.3.0RC2,
so if anyone would like to see the code, I can post it here,
if there are no objections).

1. Where does one find the member types (float, int) for the
   structure 'pcap_stat' (so that i'm working with the right
   data types initially).

2. I understand that the concept of casting should be avoided
   in general, due to imcomplete or improper conversions, is
   this correct?

3. I am using <signal.h> to gain access to the alarm() function,
   but is there a already a signal handler of this type in
   the snort code already?

4. Should the use of 'extern' definitions be kept to a minimum
   when writing code (in general)?

Sorry to be asking what might sound like stupid questions, but
I'm trying to make an effort to write cleaner code after getting
some help with the function I wrote yesterday (and having more
than a few people start laughing) :)


More information about the Snort-devel mailing list