summaryrefslogtreecommitdiff
path: root/src/libsystemd-bus/sd-bus-protocol.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-03-20 05:29:20 +0100
committerLennart Poettering <lennart@poettering.net>2013-03-20 23:00:10 +0100
commit80a46c7313b8fc4682881cb3a2ca9e4d743fcb2b (patch)
tree20ebf80690e694bf13eb484f7993e73c3328e5a5 /src/libsystemd-bus/sd-bus-protocol.h
parent9a17484d986f6cb8828afdf911db425b574c63fd (diff)
bus: demarshal header fields properly
Diffstat (limited to 'src/libsystemd-bus/sd-bus-protocol.h')
-rw-r--r--src/libsystemd-bus/sd-bus-protocol.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/libsystemd-bus/sd-bus-protocol.h b/src/libsystemd-bus/sd-bus-protocol.h
index 9d7615ff09..942422f008 100644
--- a/src/libsystemd-bus/sd-bus-protocol.h
+++ b/src/libsystemd-bus/sd-bus-protocol.h
@@ -22,6 +22,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <endian.h>
+
/* Types of message */
#define SD_BUS_DEFAULT_TIMEOUT ((usec_t) (25 * USEC_PER_SEC))
@@ -67,7 +69,14 @@ enum {
enum {
_SD_BUS_INVALID_ENDIAN = 0,
SD_BUS_LITTLE_ENDIAN = 'l',
- SD_BUS_BIG_ENDIAN = 'B'
+ SD_BUS_BIG_ENDIAN = 'B',
+#if __BYTE_ORDER == __BIG_ENDIAN
+ SD_BUS_NATIVE_ENDIAN = SD_BUS_BIG_ENDIAN,
+ SD_BUS_REVERSE_ENDIAN = SD_BUS_LITTLE_ENDIAN
+#else
+ SD_BUS_NATIVE_ENDIAN = SD_BUS_LITTLE_ENDIAN,
+ SD_BUS_REVERSE_ENDIAN = SD_BUS_BIG_ENDIAN
+#endif
};
/* Flags */