]> git.ipfire.org Git - thirdparty/ulogd2.git/commitdiff
make ulogd compile without any kernel headers (Joerg Wendland)
authorlaforge <laforge>
Sat, 23 Aug 2003 13:02:11 +0000 (13:02 +0000)
committerlaforge <laforge>
Sat, 23 Aug 2003 13:02:11 +0000 (13:02 +0000)
extensions/chtons.h [new file with mode: 0644]
extensions/ulogd_BASE.c
extensions/ulogd_PWSNIFF.c

diff --git a/extensions/chtons.h b/extensions/chtons.h
new file mode 100644 (file)
index 0000000..4506e33
--- /dev/null
@@ -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
index 63d34bafd5eb143f1e32fda044808fb6094cce6a..738d5effc2ba6bc40130bff1e8a26eb33e4752df 100644 (file)
@@ -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
  *  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>
 
 /***********************************************************************
index 4e8536d099305a24c015bcba519ea4b79a384d6e..3243b6cc5e8b026333db30b0f20c9e9cb166d1dd 100644 (file)
@@ -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 $
  *
  */
 
 #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