[Snort-devel] Re: [Snort-users] Multiple IP address matching

Fyodor fygrave at ...1...
Fri Sep 22 11:02:11 EDT 2000


Thanks for the code snapshot, I think we will reuse parts of it for our
implementation :), I just have a little comment regarding following piece:

~ :
~ :	    /* since PC's store things the "wrong" way, shuffle the bytes into
~ :	       the right order */
~ :#ifndef WORDS_BIGENDIAN
~ :	    cur->netmask = htonl(cur->netmask);
~ :#endif
~ :

As far as I know on big-endian machines hton*/htoh* functions do nothing
(since bigendian bitstream matches network bitstream order) so you can
remove `#ifndef/#endif' statement here.

from /usr/include/sys/byteorder.h on solaris/sparc 7 machine, I have
around:

#if defined(_BIG_ENDIAN) && !defined(ntohl) && !defined(lint)
/* big-endian */
#define ntohl(x)        (x)
#define ntohs(x)        (x)
#define htonl(x)        (x)
#define htons(x)        (x)
#elif !defined(ntohl) /* little-endian */
..
#endif


Are things any different anywhere else?




More information about the Snort-devel mailing list