diff --git a/include/osmocom/netif/amr.h b/include/osmocom/netif/amr.h index 729d0ae..6e37c99 100644 --- a/include/osmocom/netif/amr.h +++ b/include/osmocom/netif/amr.h @@ -43,16 +43,7 @@ */ struct amr_hdr { -#if OSMO_IS_BIG_ENDIAN - /* Payload Header */ - uint8_t cmr:4, /* Codec Mode Request */ - pad1:4; - /* Table of Contents */ - uint8_t f:1, /* followed by another speech frame? */ - ft:4, /* coding mode */ - q:1, /* OK (not damaged) at origin? */ - pad2:2; -#elif OSMO_IS_LITTLE_ENDIAN +#if OSMO_IS_LITTLE_ENDIAN /* Payload Header */ uint8_t pad1:4, cmr:4; /* Codec Mode Request */ @@ -61,6 +52,10 @@ struct amr_hdr { q:1, /* OK (not damaged) at origin? */ ft:4, /* coding mode */ f:1; /* followed by another speech frame? */ +#elif OSMO_IS_BIG_ENDIAN +/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */ + uint8_t cmr:4, pad1:4; + uint8_t f:1, ft:4, q:1, pad2:2; #endif } __attribute__((packed)); diff --git a/include/osmocom/netif/osmux.h b/include/osmocom/netif/osmux.h index 7dee438..6305dc8 100644 --- a/include/osmocom/netif/osmux.h +++ b/include/osmocom/netif/osmux.h @@ -30,28 +30,25 @@ #define OSMUX_FT_DUMMY 2 struct osmux_hdr { -#if OSMO_IS_BIG_ENDIAN - uint8_t rtp_m:1, - ft:2, - ctr:3, - amr_f:1, - amr_q:1; -#elif OSMO_IS_LITTLE_ENDIAN +#if OSMO_IS_LITTLE_ENDIAN uint8_t amr_q:1, amr_f:1, ctr:3, ft:2, rtp_m:1; +#elif OSMO_IS_BIG_ENDIAN +/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */ + uint8_t rtp_m:1, ft:2, ctr:3, amr_f:1, amr_q:1; #endif uint8_t seq; #define OSMUX_CID_MAX 255 /* determined by circuit_id */ uint8_t circuit_id; -#if OSMO_IS_BIG_ENDIAN - uint8_t amr_ft:4, - amr_cmr:4; -#elif OSMO_IS_LITTLE_ENDIAN +#if OSMO_IS_LITTLE_ENDIAN uint8_t amr_cmr:4, amr_ft:4; +#elif OSMO_IS_BIG_ENDIAN +/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */ + uint8_t amr_ft:4, amr_cmr:4; #endif } __attribute__((packed)); diff --git a/include/osmocom/netif/rtp.h b/include/osmocom/netif/rtp.h index c01df41..4e40745 100644 --- a/include/osmocom/netif/rtp.h +++ b/include/osmocom/netif/rtp.h @@ -13,12 +13,9 @@ struct rtp_hdr { uint8_t payload_type:7, marker:1; #elif OSMO_IS_BIG_ENDIAN - uint8_t version:2, - padding:1, - extension:1, - csrc_count:4; - uint8_t marker:1, - payload_type:7; +/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */ + uint8_t version:2, padding:1, extension:1, csrc_count:4; + uint8_t marker:1, payload_type:7; #endif uint16_t sequence; uint32_t timestamp;