summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlaforge <laforge>2003-08-23 13:02:11 +0000
committerlaforge <laforge>2003-08-23 13:02:11 +0000
commit575649b236d56fb4ba6c4718dda3d4669426e46e (patch)
tree33f623a691833f26f753f2cea1b168f1efa57ac5
parent7a10bb4cd2a697a37c2b9d8092cbbd96027b9cb7 (diff)
make ulogd compile without any kernel headers (Joerg Wendland)
-rw-r--r--extensions/chtons.h32
-rw-r--r--extensions/ulogd_BASE.c14
-rw-r--r--extensions/ulogd_PWSNIFF.c11
3 files changed, 45 insertions, 12 deletions
diff --git a/extensions/chtons.h b/extensions/chtons.h
new file mode 100644
index 0000000..4506e33
--- /dev/null
+++ b/extensions/chtons.h
@@ -0,0 +1,32 @@
+#ifndef _CHTONS_H_
+#define _CHTONS_H_
+
+#include <endian.h>
+
+#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/extensions/ulogd_BASE.c b/extensions/ulogd_BASE.c
index 63d34ba..738d5ef 100644
--- a/extensions/ulogd_BASE.c
+++ b/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 <stdio.h>
#include <stdlib.h>
#include <sys/socket.h>
-#include <linux/ip.h>
-#include <linux/in.h>
-#include <linux/tcp.h>
-#include <linux/icmp.h>
-#include <linux/udp.h>
+#include <netinet/ip.h>
+#include <netinet/in.h>
+#include <netinet/tcp.h>
+#include <netinet/ip_icmp.h>
+#include <netinet/udp.h>
#include <ulogd/ulogd.h>
/***********************************************************************
diff --git a/extensions/ulogd_PWSNIFF.c b/extensions/ulogd_PWSNIFF.c
index 4e8536d..3243b6c 100644
--- a/extensions/ulogd_PWSNIFF.c
+++ b/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 <stdlib.h>
#include <string.h>
#include <sys/socket.h>
-#include <linux/ip.h>
-#include <linux/in.h>
-#include <linux/tcp.h>
+#include <netinet/ip.h>
+#include <netinet/in.h>
+#include <netinet/tcp.h>
+#include "chtons.h"
#include <ulogd/ulogd.h>
#ifdef DEBUG_PWSNIFF