This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
laforge gerrit-no-reply at lists.osmocom.orglaforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-abis/+/16757 )
Change subject: add/clean big-endian packed structs (struct_endianess.py)
......................................................................
add/clean big-endian packed structs (struct_endianess.py)
Change-Id: I09c56f59631828ad219a5edd7d95cac8df462c84
---
M src/e1_input.c
1 file changed, 8 insertions(+), 0 deletions(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, approved
diff --git a/src/e1_input.c b/src/e1_input.c
index eb973ef..9e2f7b0 100644
--- a/src/e1_input.c
+++ b/src/e1_input.c
@@ -42,6 +42,7 @@
#include <osmocom/core/rate_ctr.h>
#include <osmocom/core/logging.h>
#include <osmocom/core/signal.h>
+#include <osmocom/core/endian.h>
#include <osmocom/abis/e1_input.h>
#define NUM_E1_TS 32
@@ -115,12 +116,19 @@
} __attribute__((packed));
struct lapd_header {
+#if OSMO_IS_LITTLE_ENDIAN
uint8_t ea1 : 1;
uint8_t cr : 1;
uint8_t sapi : 6;
uint8_t ea2 : 1;
uint8_t tei : 7;
uint8_t control_foo; /* fake UM's ... */
+#elif OSMO_IS_BIG_ENDIAN
+/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
+ uint8_t sapi:6, cr:1, ea1:1;
+ uint8_t tei:7, ea2:1;
+ uint8_t control_foo;
+#endif
} __attribute__((packed));
osmo_static_assert(offsetof(struct fake_linux_lapd_header, hatype) == 2, hatype_offset);
--
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/16757
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: I09c56f59631828ad219a5edd7d95cac8df462c84
Gerrit-Change-Number: 16757
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200107/6fd4e249/attachment.htm>