aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-12-17 17:36:03 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-12-20 17:24:23 +0100
commit9260b24428a6ed9833e547a3aba66cad4ce5c597 (patch)
treee1a9f7ed121ab9a7e94d09b9fa2c0bb91bac862f
parent882082c1f67523613b6a83a887e4863df5e44ed4 (diff)
iusp: Make isup parsing work on big endian machines
-rw-r--r--include/isup_types.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/isup_types.h b/include/isup_types.h
index 51c5e79..1b4983b 100644
--- a/include/isup_types.h
+++ b/include/isup_types.h
@@ -23,6 +23,7 @@
#define isup_types_h
#include <stdint.h>
+#include <endian.h>
struct msgb;
struct mtp_link;
@@ -32,8 +33,13 @@ struct mtp_link;
#define ISUP_MSG_GRA 0x29
struct isup_msg_hdr {
+#if __BYTE_ORDER == __LITTLE_ENDIAN
uint16_t cic : 12,
spare : 4;
+#elif __BYTE_ORDER == __BIG_ENDIAN
+ uint16_t spare : 4,
+ cic : 12;
+#endif
uint8_t msg_type;
uint8_t data[0];
} __attribute__((packed));