Change in osmo-ttcn3-hacks[master]: library/PCUIF_Types: use PADDING attribute for 'PCUIF_Message'

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

fixeria gerrit-no-reply at lists.osmocom.org
Tue Mar 23 05:54:11 UTC 2021


fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/23461 )


Change subject: library/PCUIF_Types: use PADDING attribute for 'PCUIF_Message'
......................................................................

library/PCUIF_Types: use PADDING attribute for 'PCUIF_Message'

PCUIFv9 compatibility has been dropped in [1], so now we can tell
TITAN's RAW codec what kind of padding to expect in received
messages and to append to encoded messages.  This eliminates
thousands of warnings about unhandled tail octets.

Change-Id: Id5ab587f7984a91f3603efc5d427aa4cb4fa6757
Related: [1] Ia9f366ca1fdad700a90ca3367e43523f7bac39a1
Related: OS#5083
---
M library/PCUIF_CodecPort.ttcn
M library/PCUIF_Types.ttcn
2 files changed, 3 insertions(+), 23 deletions(-)



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

diff --git a/library/PCUIF_CodecPort.ttcn b/library/PCUIF_CodecPort.ttcn
index 0411c39..4b2a8ce 100644
--- a/library/PCUIF_CodecPort.ttcn
+++ b/library/PCUIF_CodecPort.ttcn
@@ -23,7 +23,7 @@
 
 private function PCUIF_to_UD(in PCUIF_send_data pin, out UD_send_data pout) {
 	pout.id := pin.id;
-	pout.data := enc_pad_PCUIF_Message(pin.data);
+	pout.data := enc_PCUIF_Message(pin.data);
 } with { extension "prototype(fast)" };
 
 private function fix_padding(inout PCUIF_data data) {
diff --git a/library/PCUIF_Types.ttcn b/library/PCUIF_Types.ttcn
index 2216a0e..b259cfc 100644
--- a/library/PCUIF_Types.ttcn
+++ b/library/PCUIF_Types.ttcn
@@ -18,8 +18,6 @@
 modulepar {
 	/* PCUIF version supported by the IUT */
 	PCUIF_Version mp_pcuif_version := 10;
-	/* Whether to pad outgoing messages */
-	boolean mp_pcuif_padding := true;
 };
 
 const charstring PCU_SOCK_DEFAULT := "/tmp/pcu_bts";
@@ -282,6 +280,8 @@
 				time_ind,	msg_type = PCU_IF_MSG_TIME_IND;
 				pag_req,	msg_type = PCU_IF_MSG_PAG_REQ;
 				app_info_req,	msg_type = PCU_IF_MSG_APP_INFO_REQ)"
+	/* PCUIFv10: 1006 * 8 = 8048 bits */
+	variant "PADDING(8048)"
 };
 
 external function enc_PCUIF_Message(in PCUIF_Message pdu) return octetstring
@@ -289,26 +289,6 @@
 external function dec_PCUIF_Message(in octetstring stream) return PCUIF_Message
 	with { extension "prototype(convert) decode(RAW)" };
 
-function enc_pad_PCUIF_Message(in PCUIF_Message pdu)
-return octetstring {
-	var octetstring stream;
-	var integer len;
-
-	stream := enc_PCUIF_Message(pdu);
-	if (not mp_pcuif_padding) {
-		return stream;
-	}
-
-	select (mp_pcuif_version) {
-	case  (9) { len := 212; }
-	/* FIXME: 1006 % 4 > 0 (alignment) */
-	case (10) { len := 1006; }
-	case else { len := 0; }
-	}
-
-	return f_pad_oct(stream, len, '00'O);
-}
-
 
 /* Generic template for matching messages by type and/or the BTS number */
 template PCUIF_Message tr_PCUIF_MSG(template PCUIF_MsgType msg_type := ?,

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

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Id5ab587f7984a91f3603efc5d427aa4cb4fa6757
Gerrit-Change-Number: 23461
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210323/c7ccd688/attachment.htm>


More information about the gerrit-log mailing list