aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2018-11-16 00:19:26 +0100
committerNeels Hofmeyr <neels@hofmeyr.de>2020-01-07 18:04:24 +0100
commitcd5507b7acad83472f628fdd00d2be8f38eed3d7 (patch)
tree468d033aa4e90e19aba4c077ecb887ef85fd190b
parent5e4643f4bc76a1437621348550b5b2a603e2179b (diff)
add/clean big-endian packed structs (struct_endianess.py)neels/big_endian
-rw-r--r--include/osmocom/mtp/mtp_level3.h17
-rw-r--r--include/osmocom/sccp/sccp_types.h15
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));