From 55f46df314fb1e74751f3527d480e920f16ed22a Mon Sep 17 00:00:00 2001 From: laforge Date: Sat, 23 Aug 2003 13:02:11 +0000 Subject: make ulogd compile without any kernel headers (Joerg Wendland) --- ulogd/extensions/chtons.h | 32 ++++++++++++++++++++++++++++++++ ulogd/extensions/ulogd_BASE.c | 14 +++++++------- ulogd/extensions/ulogd_PWSNIFF.c | 11 ++++++----- 3 files changed, 45 insertions(+), 12 deletions(-) create mode 100644 ulogd/extensions/chtons.h (limited to 'ulogd') diff --git a/ulogd/extensions/chtons.h b/ulogd/extensions/chtons.h new file mode 100644 index 0000000..4506e33 --- /dev/null +++ b/ulogd/extensions/chtons.h @@ -0,0 +1,32 @@ +#ifndef _CHTONS_H_ +#define _CHTONS_H_ + +#include + +#if __BYTE_ORDER == __BIG_ENDIAN +# define BITNR(X) ((X)^31) +# if !defined(__constant_htonl) +# define __constant_htonl(x) (x) +# endif +# if !defined(__constant_htons) +# define __constant_htons(x) (x) +# endif +#elif __BYTE_ORDER == __LITTLE_ENDIAN +# define BITNR(X) ((X)^7) +# if !defined(__constant_htonl) +# define __constant_htonl(x) \ + ((unsigned long int)((((unsigned long int)(x) & 0x000000ffU) << 24) | \ + (((unsigned long int)(x) & 0x0000ff00U) << 8) | \ + (((unsigned long int)(x) & 0x00ff0000U) >> 8) | \ + (((unsigned long int)(x) & 0xff000000U) >> 24))) +# endif +# if !defined(__constant_htons) +# define __constant_htons(x) \ + ((unsigned short int)((((unsigned short int)(x) & 0x00ff) << 8) | \ + (((unsigned short int)(x) & 0xff00) >> 8))) +# endif +#else +# error "Don't know if bytes are big- or little-endian!" +#endif + +#endif diff --git a/ulogd/extensions/ulogd_BASE.c b/ulogd/extensions/ulogd_BASE.c index 63d34ba..738d5ef 100644 --- a/ulogd/extensions/ulogd_BASE.c +++ b/ulogd/extensions/ulogd_BASE.c @@ -1,4 +1,4 @@ -/* ulogd_MAC.c, Version $Revision: 1.17 $ +/* ulogd_MAC.c, Version $Revision: 1.18 $ * * ulogd interpreter plugin for * o MAC addresses @@ -26,18 +26,18 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * $Id: ulogd_BASE.c,v 1.17 2003/04/27 07:43:37 laforge Exp $ + * $Id: ulogd_BASE.c,v 1.18 2003/04/27 20:56:15 laforge Exp $ * */ #include #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include /*********************************************************************** diff --git a/ulogd/extensions/ulogd_PWSNIFF.c b/ulogd/extensions/ulogd_PWSNIFF.c index 4e8536d..3243b6c 100644 --- a/ulogd/extensions/ulogd_PWSNIFF.c +++ b/ulogd/extensions/ulogd_PWSNIFF.c @@ -1,4 +1,4 @@ -/* ulogd_PWSNIFF.c, Version $Revision: 1.7 $ +/* ulogd_PWSNIFF.c, Version $Revision: 1.8 $ * * ulogd logging interpreter for POP3 / FTP like plaintext passwords. * @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: ulogd_PWSNIFF.c,v 1.7 2003/01/13 13:35:21 laforge Exp $ + * $Id: ulogd_PWSNIFF.c,v 1.8 2003/05/03 12:44:15 laforge Exp $ * */ @@ -25,9 +25,10 @@ #include #include #include -#include -#include -#include +#include +#include +#include +#include "chtons.h" #include #ifdef DEBUG_PWSNIFF -- cgit v1.2.3