aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2020-03-25 14:27:22 +0100
committerPascal Quantin <pascal@wireshark.org>2020-03-25 20:16:50 +0000
commit439005cc2c78258d47a85e4b161df9c37041e60a (patch)
tree441fb1e56e9875b6a2e24d0e84945400dc63daff
parent69a47691cdf6a9304ef8689d3a39d510e81e001c (diff)
rlcmac: Introduce MS Radio Access Capabilities 2 to fix related spare bits
There's two variants for the Ms Radio Access Capabilities. * The usual encoding with spare bits (usually to fill up to octet boundary) as defined in TS 24.008 Table 10.5.146 And there's too: * MS Radio Access Capabilities 2 IE from TS44.060 section 12.30, which is the same but removing all spare bits, and which is used in messages like Packet Resource Request and Additional MS RAC messages. The later is used basically for messages having extra IEs after the MS Radio Access capabilities IE, since they are encoded immediatelly afterwards. So this patch does: * Adds the expected spare bits (M_PADDING) to MS_Radio_Access_capability_t * Creates a new MS_Radio_Access_capability2_t without padding * Updates code to use the new "2" version where needed. The new MS_Radio_Access_capability_t with padding is disabled since it's not used in wirehsark because it's using an ad-hoc decoder for that TS 24.008 IE: see packet-gsm_a_gm.c de_gmm_ms_radio_acc_cap() Port from osmo-pcu.git e50ce6e45c4509805807d599cadf1a1b23d37f63 Related: https://osmocom.org/issues/4463 Change-Id: Ie2844bd94437c8d7a50787cc7c8c4d81a4fc48ba Reviewed-on: https://code.wireshark.org/review/36574 Petri-Dish: Pascal Quantin <pascal@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Pascal Quantin <pascal@wireshark.org>
-rw-r--r--epan/dissectors/packet-gsm_rlcmac.c24
-rw-r--r--epan/dissectors/packet-gsm_rlcmac.h6
2 files changed, 20 insertions, 10 deletions
diff --git a/epan/dissectors/packet-gsm_rlcmac.c b/epan/dissectors/packet-gsm_rlcmac.c
index a1ca59b11a..e48228a0b5 100644
--- a/epan/dissectors/packet-gsm_rlcmac.c
+++ b/epan/dissectors/packet-gsm_rlcmac.c
@@ -2815,14 +2815,24 @@ CSN_DESCR_BEGIN(MS_RA_capability_value_t)
M_CHOICE (MS_RA_capability_value_t, IndexOfAccTech, MS_RA_capability_value_Choice, ElementsOf(MS_RA_capability_value_Choice), &hf_ms_ra_capability_value_choice),
CSN_DESCR_END (MS_RA_capability_value_t)
+/*
+ * TS 24.008 section 10.5.5.12a "MS Radio Access capability".
+ * This one would be used to decode for instance MS RA Capabilities IE SGSN->MS on the PCU.
+ * However, an ad-hoc decoder is used in this scenario in wireshark: See packet-gsm_a_gm.c de_gmm_ms_radio_acc_cap().
+ */
+#if 0
static const
CSN_DESCR_BEGIN (MS_Radio_Access_capability_t)
-/*Will be done in the main routines:*/
-/*M_UINT (MS_Radio_Access_capability_t, IEI, 8, &hf_ms_radio_access_capability_iei),*/
-/*M_UINT (MS_Radio_Access_capability_t, Length, 8, &hf_ms_radio_access_capability_length),*/
-
M_REC_TARRAY_1(MS_Radio_Access_capability_t, MS_RA_capability_value, MS_RA_capability_value_t, Count_MS_RA_capability_value, &hf_ms_ra_capability_value),
+ M_PADDING_BITS(MS_Radio_Access_capability_t, &hf_padding),
CSN_DESCR_END (MS_Radio_Access_capability_t)
+#endif
+
+/* TS44.060 section 12.30 "MS Radio Access Capability 2". Same as above but without spare bits */
+static const
+CSN_DESCR_BEGIN (MS_Radio_Access_capability2_t)
+ M_REC_TARRAY_1(MS_Radio_Access_capability_t, MS_RA_capability_value, MS_RA_capability_value_t, Count_MS_RA_capability_value, &hf_ms_ra_capability_value),
+CSN_DESCR_END (MS_Radio_Access_capability2_t)
/* < MS Classmark 3 IE > */
#if 0
@@ -3198,8 +3208,8 @@ CSN_DESCR_BEGIN (Packet_Resource_Request_t)
M_TYPE (Packet_Resource_Request_t, ID, PacketResourceRequestID_t),
- M_NEXT_EXIST (Packet_Resource_Request_t, Exist_MS_Radio_Access_capability, 1, &hf_ms_radio_access_capability_exist),
- M_TYPE (Packet_Resource_Request_t, MS_Radio_Access_capability, MS_Radio_Access_capability_t),
+ M_NEXT_EXIST (Packet_Resource_Request_t, Exist_MS_Radio_Access_capability2, 1, &hf_ms_radio_access_capability_exist),
+ M_TYPE (Packet_Resource_Request_t, MS_Radio_Access_capability2, MS_Radio_Access_capability2_t),
M_TYPE (Packet_Resource_Request_t, Channel_Request_Description, Channel_Request_Description_t),
@@ -6895,7 +6905,7 @@ CSN_DESCR_BEGIN (Additional_MS_Rad_Access_Cap_t)
/* Mac header */
M_TYPE (Additional_MS_Rad_Access_Cap_t, ID, AdditionalMsRadAccessCapID_t),
- M_TYPE (Additional_MS_Rad_Access_Cap_t, MS_Radio_Access_capability, MS_Radio_Access_capability_t),
+ M_TYPE (Additional_MS_Rad_Access_Cap_t, MS_Radio_Access_capability2, MS_Radio_Access_capability2_t),
M_PADDING_BITS (Additional_MS_Rad_Access_Cap_t, &hf_padding),
CSN_DESCR_END (Additional_MS_Rad_Access_Cap_t)
diff --git a/epan/dissectors/packet-gsm_rlcmac.h b/epan/dissectors/packet-gsm_rlcmac.h
index bd64e1b330..2b50c9c9f7 100644
--- a/epan/dissectors/packet-gsm_rlcmac.h
+++ b/epan/dissectors/packet-gsm_rlcmac.h
@@ -1594,8 +1594,8 @@ typedef struct
PacketResourceRequestID_t ID;
- guint8 Exist_MS_Radio_Access_capability;
- MS_Radio_Access_capability_t MS_Radio_Access_capability;
+ guint8 Exist_MS_Radio_Access_capability2;
+ MS_Radio_Access_capability_t MS_Radio_Access_capability2;
Channel_Request_Description_t Channel_Request_Description;
@@ -4949,7 +4949,7 @@ typedef struct
guint8 R;
AdditionalMsRadAccessCapID_t ID;
- MS_Radio_Access_capability_t MS_Radio_Access_capability;
+ MS_Radio_Access_capability_t MS_Radio_Access_capability2;
} Additional_MS_Rad_Access_Cap_t;
/* End ADDITIONAL MS RADIO ACCESS CAPABILITIES */