openbsd-ports/security/aircrack-ng/patches/patch-src_osdep_osdep_h
kili 00090a234c aircrack is an 802.11 WEP and WPA-PSK keys cracking program that
can recover keys once enough data packets have been captured.

  It implements the standard FMS attack along with some optimizations
  like KoreK attacks, thus making the attack much faster compared to
  other WEP cracking tools. In fact, aircrack is a set of tools for
  auditing wireless networks.

From Benoit Lecocq.

Note: aireplay-ng can cause kernel panics (as reported by David
Coppa), so this isn't yet connected to the build. But having it in
the tree may get some more people testing driver patches.

prodded by and ok fgsch@
"sounds like a plan" ckuethe@
2009-05-06 20:39:29 +00:00

40 lines
1.4 KiB
Plaintext

$OpenBSD: patch-src_osdep_osdep_h,v 1.1.1.1 2009/05/06 20:39:29 kili Exp $
--- src/osdep/osdep.h.orig Thu Jan 1 12:51:45 2009
+++ src/osdep/osdep.h Thu Jan 1 12:59:31 2009
@@ -13,6 +13,35 @@
#include "packed.h"
+/* XXX: There are no standard functions to byte-swap 64-bit integers */
+#ifdef __MACH__
+#include <libkern/OSByteOrder.h>
+#define aircrack_ntohl64(x) OSSwapBigToHostInt64(x)
+#define aircrack_htonl64(x) OSSwapHostToBigInt64(x)
+#elif __linux__
+#include <asm/byteorder.h>
+#define aircrack_ntohl64(x) __be64_to_cpu(x)
+#define aircrack_htonl64(x) __cpu_to_be64(x)
+#elif defined (__sun) && defined (__sparc) /* Solaris SPARC, not Solaris x86 */
+#include <sys/byteorder.h>
+#define aircrack_ntohl64(x) __be64_to_cpu(x)
+#define aircrack_htonl64(x) __cpu_to_be64(x)
+#elif __FreeBSD__
+#include <sys/endian.h>
+#define aircrack_ntohl64(x) betoh64(x)
+#define aircrack_htonl64(x) htobe64(x)
+#elif __OpenBSD__
+#include <machine/endian.h>
+#define aircrack_ntohl64(x) betoh64(x)
+#define aircrack_htonl64(x) htobe64(x)
+#elif __NetBSD__
+#include <sys/endian.h>
+#define aircrack_ntohl64(x) be64toh(x)
+#define aircrack_htonl64(x) h64tobe(x)
+#else
+#error "FIXME: Don't know how to byte-swap 64-bit integers on this platform"
+#endif /* __MACH__ */
+
/* For all structures, when adding new fields, always append them to the end.
* This way legacy binary code does not need to be recompiled. This is
* particularly useful for DLLs. -sorbo