pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38573?usp=email )


Change subject: RUA_Emulation: Support passing no RANAP PDU in RUA_Disc_Req
......................................................................

RUA_Emulation: Support passing no RANAP PDU in RUA_Disc_Req

Change-Id: Id9c3d5a1e45aa6ca58a71b61e142dc041a335cc9
---
M hnbgw/ConnHdlr.ttcn
M library/rua/RUA_Emulation.ttcn
M library/rua/RUA_Templates.ttcn
3 files changed, 40 insertions(+), 5 deletions(-)



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

diff --git a/hnbgw/ConnHdlr.ttcn b/hnbgw/ConnHdlr.ttcn
index 2a46bba..803ed8a 100644
--- a/hnbgw/ConnHdlr.ttcn
+++ b/hnbgw/ConnHdlr.ttcn
@@ -362,7 +362,7 @@
        }

        /* send it via Iuh (creating a RUA connection) */
-       RUA.send(RUA_Disc_Req:{tx, cause});
+       RUA.send(RUA_Disc_Req:{cause, tx});

        /* expect to receive it on the Iu side */
        rx := f_bssap_expect(exp_rx);
diff --git a/library/rua/RUA_Emulation.ttcn b/library/rua/RUA_Emulation.ttcn
index a9c445e..26c2da7 100644
--- a/library/rua/RUA_Emulation.ttcn
+++ b/library/rua/RUA_Emulation.ttcn
@@ -65,8 +65,8 @@
 };

 type record RUA_Disc_Req {
-       RANAP_PDU ranap,
-       RUA_IEs.Cause cause
+       RUA_IEs.Cause cause,
+       RANAP_PDU ranap optional
 };

 type record RUA_Disc_Ind {
@@ -327,11 +327,15 @@

        /* Disconnect request from client */
        [] CLIENT.receive(RUA_Disc_Req:?) -> value dreq sender vc_conn {
-               var octetstring enc_ranap := enc_RANAP_PDU(dreq.ranap);
                var integer idx := f_idx_by_comp(vc_conn);
                context_id := int2bit(ConnectionTable[idx].context_id, 24);
                domain_ind := ConnectionTable[idx].domain;
-               RUA.send(ts_RUA_Disconnect(domain_ind, context_id, dreq.cause, 
enc_ranap));
+               if (ispresent(dreq.ranap)) {
+                       var octetstring enc_ranap := enc_RANAP_PDU(dreq.ranap);
+                       RUA.send(ts_RUA_Disconnect(domain_ind, context_id, 
dreq.cause, enc_ranap));
+               } else {
+                       RUA.send(ts_RUA_Disconnect_no_ranap(domain_ind, 
context_id, dreq.cause));
+               }
                f_conn_table_del(context_id);
        }

diff --git a/library/rua/RUA_Templates.ttcn b/library/rua/RUA_Templates.ttcn
index 738042e..6ff91cd 100644
--- a/library/rua/RUA_Templates.ttcn
+++ b/library/rua/RUA_Templates.ttcn
@@ -196,6 +196,37 @@
        }
 }

+/* Same as ts_RUA_Disconnect() but without a ranap arg */
+template (value) RUA_PDU
+ts_RUA_Disconnect_no_ranap(template (value) CN_DomainIndicator domain,
+                          template (value) bitstring context_id,
+                          template (value) Cause cause) := {
+       initiatingMessage := {
+               procedureCode := 3,
+               criticality := reject,
+               value_ := {
+                       disconnect_ := {
+                               protocolIEs := {
+                                       {
+                                               id := 7,
+                                               criticality := reject,
+                                               value_ := { cN_DomainIndicator 
:= domain }
+                                       }, {
+                                               id := 3,
+                                               criticality := reject,
+                                               value_ := { context_ID := 
context_id }
+                                       }, {
+                                               id := 1,
+                                               criticality := reject,
+                                               value_ := { cause := cause }
+                                       }
+                               },
+                               protocolExtensions := omit
+                       }
+               }
+       }
+}
+
 template (present) RUA_PDU
 tr_RUA_Disconnect(template (present) CN_DomainIndicator domain := ?,
                      template (present) bitstring context_id := ?,

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

Gerrit-MessageType: newchange
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Id9c3d5a1e45aa6ca58a71b61e142dc041a335cc9
Gerrit-Change-Number: 38573
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <[email protected]>

Reply via email to