[PATCH] osmo-ttcn3-hacks[master]: RLCMAC_EncDec: Fix handling of optional LlcBlockHdr

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

Harald Welte gerrit-no-reply at lists.osmocom.org
Mon Mar 12 14:07:38 UTC 2018


Review at  https://gerrit.osmocom.org/7228

RLCMAC_EncDec: Fix handling of optional LlcBlockHdr

Whenever the OPTIONAL<> construct is used for a member of a record,
we have to add an extra set of parenthsis in order to avoid bogus
"has no RAW decode method" error messages.

It seems the OPTIONAL inherits from Base_Type which will print
"which has no RAW decoding method" from its RAW_decode().

Change-Id: Idfaa11db0e2db4be144800b5bccc44d0515220d7
---
M library/RLCMAC_EncDec.cc
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/28/7228/1

diff --git a/library/RLCMAC_EncDec.cc b/library/RLCMAC_EncDec.cc
index b911c75..0c1dd84 100644
--- a/library/RLCMAC_EncDec.cc
+++ b/library/RLCMAC_EncDec.cc
@@ -35,7 +35,7 @@
 				in.blocks()[i].hdr()().e() = false;
 			else
 				in.blocks()[i].hdr()().e() = true;
-			in.blocks()[i].hdr().encode(LlcBlockHdr_descr_, ttcn_buffer, TTCN_EncDec::CT_RAW);
+			in.blocks()[i].hdr()().encode(LlcBlockHdr_descr_, ttcn_buffer, TTCN_EncDec::CT_RAW);
 		}
 	}
 	if (in.blocks().is_bound()) {
@@ -65,7 +65,7 @@
 		while (1) {
 			/* decode one more extension octet with LlcBlocHdr inside */
 			LlcBlock lb;
-			lb.hdr().decode(LlcBlockHdr_descr_, ttcn_buffer, TTCN_EncDec::CT_RAW);
+			lb.hdr()().decode(LlcBlockHdr_descr_, ttcn_buffer, TTCN_EncDec::CT_RAW);
 			ret_val.blocks()[num_llc_blocks++] = lb;
 
 			/* if E == '1'B, we can proceed further */
@@ -214,7 +214,7 @@
 		while (1) {
 			/* decode one more extension octet with LlcBlocHdr inside */
 			LlcBlock lb;
-			lb.hdr().decode(LlcBlockHdr_descr_, ttcn_buffer, TTCN_EncDec::CT_RAW);
+			lb.hdr()().decode(LlcBlockHdr_descr_, ttcn_buffer, TTCN_EncDec::CT_RAW);
 			ret_val.blocks()[num_llc_blocks++] = lb;
 
 			TTCN_Logger::begin_event(TTCN_Logger::DEBUG_ENCDEC);

-- 
To view, visit https://gerrit.osmocom.org/7228
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idfaa11db0e2db4be144800b5bccc44d0515220d7
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>



More information about the gerrit-log mailing list