<p>neels has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/18257">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">cosmetic: apply changes to match struct_endianess.py output<br><br>gsm48_pag_resp and gsm48_service_request: omit comments in big endian part.<br>dtap_header: better segment the substruct.<br>gsm23041_msg_param_gsm: match up whitespace / comments.<br><br>Rationale: the script is a good way to avoid bugs from manually composing the<br>big endian parts (for example, it detected the missing endian.h include, fixed<br>in I593cc5e8272469b570559206bb02b6e79797340b). However, it becomes cumbersome<br>if it creates numerous edits in the source tree, which cause more time spent<br>for whoever wanted to rather save time with it. So let's keep the code tree<br>matching that struct's output.<br><br>Change-Id: I7432f5337d6589262c31f5186dfd0ac32221c467<br>---<br>M include/osmocom/gsm/protocol/gsm_04_08.h<br>M include/osmocom/gsm/protocol/gsm_08_08.h<br>M include/osmocom/gsm/protocol/gsm_23_041.h<br>3 files changed, 8 insertions(+), 14 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/57/18257/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/include/osmocom/gsm/protocol/gsm_04_08.h b/include/osmocom/gsm/protocol/gsm_04_08.h</span><br><span>index 1bca068..f8f2eab 100644</span><br><span>--- a/include/osmocom/gsm/protocol/gsm_04_08.h</span><br><span>+++ b/include/osmocom/gsm/protocol/gsm_04_08.h</span><br><span>@@ -664,7 +664,7 @@</span><br><span> /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */</span><br><span>        uint8_t key_seq:4, spare:4;</span><br><span>  union {</span><br><span style="color: hsl(0, 100%, 40%);">-         uint32_t classmark2;  /* Backward compatibility */</span><br><span style="color: hsl(120, 100%, 40%);">+            uint32_t classmark2;</span><br><span>                 struct {</span><br><span>                     uint8_t cm2_len;</span><br><span>                     struct gsm48_classmark2 cm2;</span><br><span>@@ -815,7 +815,7 @@</span><br><span> /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */</span><br><span>       uint8_t cipher_key_seq:4, cm_service_type:4;</span><br><span>         union {</span><br><span style="color: hsl(0, 100%, 40%);">-         uint32_t classmark;  /* Backward compatibility */</span><br><span style="color: hsl(120, 100%, 40%);">+             uint32_t classmark;</span><br><span>          struct {</span><br><span>                     uint8_t cm2_len;</span><br><span>                     struct gsm48_classmark2 classmark2;</span><br><span>diff --git a/include/osmocom/gsm/protocol/gsm_08_08.h b/include/osmocom/gsm/protocol/gsm_08_08.h</span><br><span>index e791b07..d8a7773 100644</span><br><span>--- a/include/osmocom/gsm/protocol/gsm_08_08.h</span><br><span>+++ b/include/osmocom/gsm/protocol/gsm_08_08.h</span><br><span>@@ -41,27 +41,21 @@</span><br><span> } __attribute__((packed));</span><br><span> </span><br><span> struct dtap_header {</span><br><span style="color: hsl(0, 100%, 40%);">-#if OSMO_IS_LITTLE_ENDIAN</span><br><span>    uint8_t type;</span><br><span>        union {</span><br><span>              uint8_t link_id;  /* Backward compatibility */</span><br><span>               struct {</span><br><span style="color: hsl(120, 100%, 40%);">+#if OSMO_IS_LITTLE_ENDIAN</span><br><span>                  uint8_t dlci_cc:2,</span><br><span>                   dlci_spare:3,</span><br><span>                        dlci_sapi:3; /* enum gsm0406_dlc_sapi */</span><br><span style="color: hsl(0, 100%, 40%);">-                };</span><br><span style="color: hsl(0, 100%, 40%);">-      };</span><br><span style="color: hsl(0, 100%, 40%);">-      uint8_t length;</span><br><span> #elif OSMO_IS_BIG_ENDIAN</span><br><span style="color: hsl(0, 100%, 40%);">-     uint8_t type;</span><br><span style="color: hsl(0, 100%, 40%);">-   union {</span><br><span style="color: hsl(0, 100%, 40%);">-         uint8_t link_id;</span><br><span style="color: hsl(0, 100%, 40%);">-                struct {</span><br><span style="color: hsl(120, 100%, 40%);">+/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */</span><br><span>                   uint8_t dlci_sapi:3, dlci_spare:3, dlci_cc:2;</span><br><span style="color: hsl(120, 100%, 40%);">+#endif</span><br><span>                };</span><br><span>   };</span><br><span>   uint8_t length;</span><br><span style="color: hsl(0, 100%, 40%);">-#endif</span><br><span> } __attribute__((packed));</span><br><span> </span><br><span> /* Data Link Control SAPI, GSM 08.06 § 6.3.2, GSM 04.06 § 3.3.3 */</span><br><span>diff --git a/include/osmocom/gsm/protocol/gsm_23_041.h b/include/osmocom/gsm/protocol/gsm_23_041.h</span><br><span>index e60c324..e726cff 100644</span><br><span>--- a/include/osmocom/gsm/protocol/gsm_23_041.h</span><br><span>+++ b/include/osmocom/gsm/protocol/gsm_23_041.h</span><br><span>@@ -11,9 +11,9 @@</span><br><span> #if OSMO_IS_LITTLE_ENDIAN</span><br><span>            uint8_t num_pages:4,</span><br><span>                         page_nr:4;</span><br><span style="color: hsl(0, 100%, 40%);">-#else</span><br><span style="color: hsl(0, 100%, 40%);">-         uint8_t page_nr:4,</span><br><span style="color: hsl(0, 100%, 40%);">-                      num_pages:4;</span><br><span style="color: hsl(120, 100%, 40%);">+#elif OSMO_IS_BIG_ENDIAN</span><br><span style="color: hsl(120, 100%, 40%);">+/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */</span><br><span style="color: hsl(120, 100%, 40%);">+              uint8_t page_nr:4, num_pages:4;</span><br><span> #endif</span><br><span>    } page_param;</span><br><span>        uint8_t content[0];</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmocore/+/18257">change 18257</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/libosmocore/+/18257"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmocore </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I7432f5337d6589262c31f5186dfd0ac32221c467 </div>
<div style="display:none"> Gerrit-Change-Number: 18257 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: neels <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>