Change in osmo-pcu[master]: rlcmac: Don't pass array element to CSN1 descriptors

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/.

pespin gerrit-no-reply at lists.osmocom.org
Mon Mar 23 17:59:07 UTC 2020


pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/17574 )

Change subject: rlcmac: Don't pass array element to CSN1 descriptors
......................................................................

rlcmac: Don't pass array element to CSN1 descriptors

This way the macros can be used to access the arrays themselves and
calculate its static size to enable validation later.

In the case of Packet_Access_Reject_t, modify the description to use a
M_REC_TARRAY_1 object to get rid of access to 2nd element. The new
description is the correct one, since the first element is mandatory
according to TS 44.060 Table 11.2.1.

Change-Id: I6f10350d4734360c7a15a702c72b59efd84987ee
---
M src/gsm_rlcmac.cpp
1 file changed, 11 insertions(+), 12 deletions(-)

Approvals:
  Jenkins Builder: Verified
  fixeria: Looks good to me, approved
  laforge: Looks good to me, approved



diff --git a/src/gsm_rlcmac.cpp b/src/gsm_rlcmac.cpp
index 40b75ed..db0e54a 100644
--- a/src/gsm_rlcmac.cpp
+++ b/src/gsm_rlcmac.cpp
@@ -902,7 +902,7 @@
 
 static const
 CSN_DESCR_BEGIN       (Additional_access_technologies_t)
-  M_REC_TARRAY        (Additional_access_technologies_t, Additional_access_technologies[0], Additional_access_technologies_struct_t, Count_additional_access_technologies),
+  M_REC_TARRAY        (Additional_access_technologies_t, Additional_access_technologies, Additional_access_technologies_struct_t, Count_additional_access_technologies),
 CSN_DESCR_END         (Additional_access_technologies_t)
 
 gint16 Additional_access_technologies_Dissector(csnStream_t* ar, bitvec* vector, unsigned *readIndex, void* data)
@@ -1365,7 +1365,7 @@
 
 static const
 CSN_DESCR_BEGIN(PSI_Message_List_t)
-  M_REC_TARRAY (PSI_Message_List_t, PSI_Message[0], PSI_Message_t, Count_PSI_Message),
+  M_REC_TARRAY (PSI_Message_List_t, PSI_Message, PSI_Message_t, Count_PSI_Message),
   M_FIXED      (PSI_Message_List_t, 1, 0x00),
   M_UINT       (PSI_Message_List_t,  ADDITIONAL_MSG_TYPE,  1),
 CSN_DESCR_END  (PSI_Message_List_t)
@@ -1402,7 +1402,7 @@
 
 static const
 CSN_DESCR_BEGIN(SI_Message_List_t)
-  M_REC_TARRAY (SI_Message_List_t, SI_Message[0], SI_Message_t, Count_SI_Message),
+  M_REC_TARRAY (SI_Message_List_t, SI_Message, SI_Message_t, Count_SI_Message),
   M_FIXED      (SI_Message_List_t, 1, 0x00),
   M_UINT       (SI_Message_List_t,  ADDITIONAL_MSG_TYPE,  1),
 CSN_DESCR_END  (SI_Message_List_t)
@@ -2602,8 +2602,7 @@
   M_UINT       (Packet_Access_Reject_t,  MESSAGE_TYPE,  6),
   M_UINT       (Packet_Access_Reject_t,  PAGE_MODE,  2),
 
-  M_TYPE       (Packet_Access_Reject_t, Reject, Reject_t),
-  M_REC_TARRAY (Packet_Access_Reject_t, Reject[1], Reject_t, Count_Reject),
+  M_REC_TARRAY_1(Packet_Access_Reject_t, Reject, Reject_t, Count_Reject),
   M_PADDING_BITS(Packet_Access_Reject_t),
 CSN_DESCR_END  (Packet_Access_Reject_t)
 
@@ -3572,7 +3571,7 @@
   M_UINT       (ENH_NC_Measurement_Report_t,  SCALE,  1),
   M_NEXT_EXIST (ENH_NC_Measurement_Report_t, Exist_Serving_Cell_Data, 1),
   M_TYPE       (ENH_NC_Measurement_Report_t, Serving_Cell_Data, Serving_Cell_Data_t),
-  M_REC_TARRAY (ENH_NC_Measurement_Report_t, RepeatedInvalid_BSIC_Info[0], RepeatedInvalid_BSIC_Info_t, Count_RepeatedInvalid_BSIC_Info),
+  M_REC_TARRAY (ENH_NC_Measurement_Report_t, RepeatedInvalid_BSIC_Info, RepeatedInvalid_BSIC_Info_t, Count_RepeatedInvalid_BSIC_Info),
   M_NEXT_EXIST (ENH_NC_Measurement_Report_t, Exist_ReportBitmap, 1),
   M_VAR_TARRAY (ENH_NC_Measurement_Report_t, REPORTING_QUANTITY_Instances, REPORTING_QUANTITY_Instance_t, Count_REPORTING_QUANTITY_Instances),
 CSN_DESCR_END  (ENH_NC_Measurement_Report_t)
@@ -3713,7 +3712,7 @@
   M_UINT          (EnhancedMeasurementReport_t,  SCALE,  1),
   M_NEXT_EXIST    (EnhancedMeasurementReport_t, Exist_ServingCellData, 1),
   M_TYPE          (EnhancedMeasurementReport_t, ServingCellData, EMR_ServingCell_t),
-  M_REC_TARRAY    (EnhancedMeasurementReport_t, RepeatedInvalid_BSIC_Info[0], RepeatedInvalid_BSIC_Info_t,
+  M_REC_TARRAY    (EnhancedMeasurementReport_t, RepeatedInvalid_BSIC_Info, RepeatedInvalid_BSIC_Info_t,
                     Count_RepeatedInvalid_BSIC_Info),
   M_NEXT_EXIST    (EnhancedMeasurementReport_t, Exist_ReportBitmap, 1),
   M_VAR_TARRAY    (EnhancedMeasurementReport_t, REPORTING_QUANTITY_Instances, REPORTING_QUANTITY_Instance_t, Count_REPORTING_QUANTITY_Instances),
@@ -4472,7 +4471,7 @@
 
 static const
 CSN_DESCR_BEGIN(NonHoppingPCCCH_t)
-  M_REC_TARRAY (NonHoppingPCCCH_t, Carriers[0], Non_Hopping_PCCCH_Carriers_t, Count_Carriers),
+  M_REC_TARRAY (NonHoppingPCCCH_t, Carriers, Non_Hopping_PCCCH_Carriers_t, Count_Carriers),
 CSN_DESCR_END  (NonHoppingPCCCH_t)
 
 static const
@@ -4484,7 +4483,7 @@
 static const
 CSN_DESCR_BEGIN(HoppingPCCCH_t)
   M_UINT(HoppingPCCCH_t, MA_NUMBER, 4),
-  M_REC_TARRAY (HoppingPCCCH_t, Carriers[0], Hopping_PCCCH_Carriers_t, Count_Carriers),
+  M_REC_TARRAY (HoppingPCCCH_t, Carriers, Hopping_PCCCH_Carriers_t, Count_Carriers),
 CSN_DESCR_END  (HoppingPCCCH_t)
 
 static const
@@ -4510,10 +4509,10 @@
   M_NEXT_EXIST (PSI2_t, Exist_Non_GPRS_Cell_Options, 1),
   M_TYPE       (PSI2_t,  Non_GPRS_Cell_Options, Non_GPRS_Cell_Options_t),
 
-  M_REC_TARRAY (PSI2_t, Reference_Frequency[0], Reference_Frequency_t, Count_Reference_Frequency),
+  M_REC_TARRAY (PSI2_t, Reference_Frequency, Reference_Frequency_t, Count_Reference_Frequency),
   M_TYPE       (PSI2_t,  Cell_Allocation, Cell_Allocation_t),
-  M_REC_TARRAY (PSI2_t, GPRS_MA[0], PSI2_MA_t, Count_GPRS_MA),
-  M_REC_TARRAY (PSI2_t, PCCCH_Description[0], PCCCH_Description_t, Count_PCCCH_Description),
+  M_REC_TARRAY (PSI2_t, GPRS_MA, PSI2_MA_t, Count_GPRS_MA),
+  M_REC_TARRAY (PSI2_t, PCCCH_Description, PCCCH_Description_t, Count_PCCCH_Description),
   M_PADDING_BITS(PSI2_t),
 CSN_DESCR_END  (PSI2_t)
 /*< End Packet System Information Type 2 message content >*/

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/17574
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: I6f10350d4734360c7a15a702c72b59efd84987ee
Gerrit-Change-Number: 17574
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <axilirator at gmail.com>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200323/de3aede2/attachment.htm>


More information about the gerrit-log mailing list