svn commit: r245028 - user/adrian/ath_radar_stuff/src/pktlog
Adrian Chadd
adrian at FreeBSD.org
Fri Jan 4 05:50:45 UTC 2013
Author: adrian
Date: Fri Jan 4 05:50:44 2013
New Revision: 245028
URL: http://svnweb.freebsd.org/changeset/base/245028
Log:
.. another part from the radiotap import.
Added:
user/adrian/ath_radar_stuff/src/pktlog/platform.h
Added: user/adrian/ath_radar_stuff/src/pktlog/platform.h
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ user/adrian/ath_radar_stuff/src/pktlog/platform.h Fri Jan 4 05:50:44 2013 (r245028)
@@ -0,0 +1,19 @@
+#include <stddef.h>
+#include <errno.h>
+#ifndef _BSD_SOURCE
+#define _BSD_SOURCE
+#endif
+#include <sys/endian.h>
+
+#define le16_to_cpu le16toh
+#define le32_to_cpu le32toh
+#define get_unaligned(p) \
+({ \
+ struct packed_dummy_struct { \
+ typeof(*(p)) __val; \
+ } __attribute__((packed)) *__ptr = (void *) (p); \
+ \
+ __ptr->__val; \
+})
+#define get_unaligned_le16(p) le16_to_cpu(get_unaligned((uint16_t *)(p)))
+#define get_unaligned_le32(p) le32_to_cpu(get_unaligned((uint32_t *)(p)))
More information about the svn-src-user
mailing list