From cd5507b7acad83472f628fdd00d2be8f38eed3d7 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Fri, 16 Nov 2018 00:19:26 +0100 Subject: add/clean big-endian packed structs (struct_endianess.py) Change-Id: I04ad3795fbaf495cae168aed69124b1dc132a9bd --- include/osmocom/mtp/mtp_level3.h | 17 ++++++++--------- include/osmocom/sccp/sccp_types.h | 15 ++++++--------- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/include/osmocom/mtp/mtp_level3.h b/include/osmocom/mtp/mtp_level3.h index d0d24a1..414b144 100644 --- a/include/osmocom/mtp/mtp_level3.h +++ b/include/osmocom/mtp/mtp_level3.h @@ -131,9 +131,8 @@ struct mtp_level_3_hdr { spare : 2, ni : 2; #elif OSMO_IS_BIG_ENDIAN - uint8_t ni : 2, - spare : 2, - ser_ind : 4; +/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */ + uint8_t ni:2, spare:2, ser_ind:4; #endif uint32_t addr; uint8_t data[0]; @@ -144,8 +143,8 @@ struct mtp_level_3_cmn { uint8_t h0 : 4, h1 : 4; #elif OSMO_IS_BIG_ENDIAN - uint8_t h1 : 4, - h0 : 4; +/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */ + uint8_t h1:4, h0:4; #endif } __attribute__((packed)); @@ -155,8 +154,8 @@ struct mtp_level_3_mng { uint8_t spare : 4, length : 4; #elif OSMO_IS_BIG_ENDIAN - uint8_t length : 4, - spare : 4; +/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */ + uint8_t length:4, spare:4; #endif uint8_t data[0]; } __attribute__((packed)); @@ -175,8 +174,8 @@ struct sccp_con_ctrl_prt_mgt { uint8_t mul_ind : 2, spare : 6; #elif OSMO_IS_BIG_ENDIAN - uint8_t spare : 6, - mul_ind : 2; +/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */ + uint8_t spare:6, mul_ind:2; #endif } __attribute__((packed)); diff --git a/include/osmocom/sccp/sccp_types.h b/include/osmocom/sccp/sccp_types.h index 18b54f4..17c60e4 100644 --- a/include/osmocom/sccp/sccp_types.h +++ b/include/osmocom/sccp/sccp_types.h @@ -97,11 +97,8 @@ struct sccp_called_party_address { routing_indicator : 1, reserved : 1; #elif OSMO_IS_BIG_ENDIAN - uint8_t reserved : 1, - routing_indicator : 1, - global_title_indicator : 4, - ssn_indicator : 1, - point_code_indicator : 1; +/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */ + uint8_t reserved:1, routing_indicator:1, global_title_indicator:4, ssn_indicator:1, point_code_indicator:1; #endif uint8_t data[0]; } __attribute__((packed)); @@ -115,8 +112,8 @@ struct sccp_signalling_point_code { uint8_t msb : 6, reserved : 2; #elif OSMO_IS_BIG_ENDIAN - uint8_t reserved : 2, - msb : 6; +/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */ + uint8_t reserved:2, msb:6; #endif } __attribute__((packed)); @@ -157,8 +154,8 @@ struct sccp_global_title { uint8_t nature_of_addr_ind : 7, odd_even : 1; #elif OSMO_IS_BIG_ENDIAN - uint8_t odd_even : 1, - nature_of_addr_ind : 7; +/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */ + uint8_t odd_even:1, nature_of_addr_ind:7; #endif uint8_t data[0]; } __attribute__((packed)); -- cgit v1.2.3