[L] Change in osmo-ttcn3-hacks[master]: DIAMETER: Split Gy and Gx messages to their own TS files

2024-01-25 Thread pespin
pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/35671?usp=email )

Change subject: DIAMETER: Split Gy and Gx messages to their own TS files
..

DIAMETER: Split Gy and Gx messages to their own TS files

Those interfaces reuse messages from other Diameter RFCs, but changing
the contents of the messages, eg some Mandatory fields like
Service-Context-Id which are mandatory in RFC5006, doesn't even appear
in Gx CCR in TS 29.212.

Keeping them well separated helps in avoiding confusion on users fo the
messages.

Change-Id: Ibe0d5f263813d5083e020c942283f214983162b4
---
M ggsn_tests/GGSN_Tests.ttcn
M ggsn_tests/gen_links.sh
M library/DIAMETER_Templates.ttcn
A library/DIAMETER_ts29_212_Templates.ttcn
A library/DIAMETER_ts32_299_Templates.ttcn
M pgw/PGW_Tests.ttcn
M pgw/gen_links.sh
7 files changed, 262 insertions(+), 187 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved
  osmith: Looks good to me, but someone else must approve




diff --git a/ggsn_tests/GGSN_Tests.ttcn b/ggsn_tests/GGSN_Tests.ttcn
index a1aab9b..d7de443 100644
--- a/ggsn_tests/GGSN_Tests.ttcn
+++ b/ggsn_tests/GGSN_Tests.ttcn
@@ -34,7 +34,9 @@

import from DIAMETER_Types all;
import from DIAMETER_Templates all;
+   import from DIAMETER_ts29_212_Templates all;
import from DIAMETER_ts29_272_Templates all;
+   import from DIAMETER_ts32_299_Templates all;
import from DIAMETER_Emulation all;

const integer GTP0_PORT := 3386;
diff --git a/ggsn_tests/gen_links.sh b/ggsn_tests/gen_links.sh
index b51620e..4981e64 100755
--- a/ggsn_tests/gen_links.sh
+++ b/ggsn_tests/gen_links.sh
@@ -61,7 +61,7 @@
 FILES="Misc_Helpers.ttcn General_Types.ttcn GSM_Types.ttcn Osmocom_Types.ttcn 
Native_Functions.ttcn Native_FunctionDefs.cc IPCP_Types.ttcn PAP_Types.ttcn "
 FILES+="GTP_CodecPort.ttcn GTP_CodecPort_CtrlFunct.ttcn 
GTP_CodecPort_CtrlFunctDef.cc GTP_Templates.ttcn Osmocom_Gb_Types.ttcn "
 FILES+="DIAMETER_Types.ttcn DIAMETER_CodecPort.ttcn 
DIAMETER_CodecPort_CtrlFunct.ttcn DIAMETER_CodecPort_CtrlFunctDef.cc 
DIAMETER_Emulation.ttcn "
-FILES+="DIAMETER_Templates.ttcn DIAMETER_ts29_272_Templates.ttcn "
+FILES+="DIAMETER_Templates.ttcn DIAMETER_ts29_212_Templates.ttcn 
DIAMETER_ts29_272_Templates.ttcn DIAMETER_ts32_299_Templates.ttcn "
 FILES+="Osmocom_VTY_Functions.ttcn "
 gen_links $DIR $FILES

diff --git a/library/DIAMETER_Templates.ttcn b/library/DIAMETER_Templates.ttcn
index 05b63d2..82a433c 100644
--- a/library/DIAMETER_Templates.ttcn
+++ b/library/DIAMETER_Templates.ttcn
@@ -102,10 +102,9 @@
DIAMETER_ERROR_EAP_CODE_UNKNOWN (5048)
 };

-/* Gy : 3GPP TS 32.299 7.1.6, RFC4006 3.1 */
+/* RFC4006 3.1 */
 const uint32_t c_DIAMETER_CREDIT_CONTROL_AID := 4;

-const uint32_t c_DIAMETER_3GPP_Gx_AID := 16777238;
 const uint32_t c_DIAMETER_3GPP_S7_AID := 16777308;

 const octetstring c_def_sess_id := char2oct("ttcn3.session");
@@ -1215,142 +1214,6 @@
return diam_pdu;
 }

-/* RFC 4006 3.1.  Credit-Control-Request (CCR) Command */
-template (present) PDU_DIAMETER
-tr_DIA_Gx_CCR(template (present) DCC_NONE_CC_Request_Type req_type := 
INITIAL_REQUEST)
-:= tr_DIAMETER(flags:='1100'B, cmd_code:=Credit_Control,
-   avps := superset(
-   tr_AVP_SessionId,
-   tr_AVP_OriginHost,
-   tr_AVP_OriginRealm,
-   tr_AVP_DestinationRealm,
-   tr_AVP_AuthAppId(int2oct(c_DIAMETER_3GPP_Gx_AID, 4)),
-   tr_AVP_CcReqType(req_type),
-   tr_AVP_CcReqNum(?)
-   ));
-template (present) PDU_DIAMETER
-tr_DIA_Gy_CCR(template (present) DCC_NONE_CC_Request_Type req_type := 
INITIAL_REQUEST)
-:= tr_DIAMETER(flags:='1100'B, cmd_code:=Credit_Control,
-   avps := superset(
-   tr_AVP_SessionId,
-   tr_AVP_OriginHost,
-   tr_AVP_OriginRealm,
-   tr_AVP_DestinationRealm,
-   tr_AVP_AuthAppId(int2oct(c_DIAMETER_CREDIT_CONTROL_AID, 4)),
-   tr_AVP_CcReqType(req_type),
-   tr_AVP_CcReqNum(?)
-   ));
-
-
-
-/* RFC 4006 3.2.  Credit-Control-Answer (CCA) Command */
-template (value) PDU_DIAMETER
-ts_DIA_Gx_CCA(template (value) UINT32 hbh_id, template (value) UINT32 ete_id,
-  template (value) octetstring sess_id,
-  template (value) DCC_NONE_CC_Request_Type req_type,
-  template (value) AVP_Unsigned32 req_num)
-:= ts_DIAMETER(flags:='0100'B, cmd_code:=Credit_Control,
-   app_id:=int2oct(c_DIAMETER_3GPP_Gx_AID, 4), hbh_id:=hbh_id, 
ete_id:=ete_id,
-   avps := {
-   ts_AVP_SessionId(sess_id),
-   ts_AVP_ResultCode(DIAMETER_SUCCESS),
-   ts_AVP_OriginHost("pcrf.localdomain"),
-   ts_AVP_OriginRealm("localdomain"),
-   ts_AVP_AuthAppId(int2oct(c_DIAMETER_3GPP_Gx_AID, 4)),
-   

[L] Change in osmo-ttcn3-hacks[master]: DIAMETER: Split Gy and Gx messages to their own TS files

2024-01-25 Thread laforge
Attention is currently required from: jolly, lynxis lazus, pespin.

laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/35671?usp=email )

Change subject: DIAMETER: Split Gy and Gx messages to their own TS files
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/35671?usp=email
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: Ibe0d5f263813d5083e020c942283f214983162b4
Gerrit-Change-Number: 35671
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: jolly 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: lynxis lazus 
Gerrit-Reviewer: osmith 
Gerrit-Attention: jolly 
Gerrit-Attention: pespin 
Gerrit-Attention: lynxis lazus 
Gerrit-Comment-Date: Thu, 25 Jan 2024 12:19:56 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[L] Change in osmo-ttcn3-hacks[master]: DIAMETER: Split Gy and Gx messages to their own TS files

2024-01-24 Thread osmith
Attention is currently required from: jolly, lynxis lazus, pespin.

osmith has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/35671?usp=email )

Change subject: DIAMETER: Split Gy and Gx messages to their own TS files
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/35671?usp=email
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: Ibe0d5f263813d5083e020c942283f214983162b4
Gerrit-Change-Number: 35671
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: jolly 
Gerrit-Reviewer: lynxis lazus 
Gerrit-Reviewer: osmith 
Gerrit-Attention: jolly 
Gerrit-Attention: pespin 
Gerrit-Attention: lynxis lazus 
Gerrit-Comment-Date: Thu, 25 Jan 2024 07:37:59 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[L] Change in osmo-ttcn3-hacks[master]: DIAMETER: Split Gy and Gx messages to their own TS files

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


Change subject: DIAMETER: Split Gy and Gx messages to their own TS files
..

DIAMETER: Split Gy and Gx messages to their own TS files

Those interfaces reuse messages from other Diameter RFCs, but changing
the contents of the messages, eg some Mandatory fields like
Service-Context-Id which are mandatory in RFC5006, doesn't even appear
in Gx CCR in TS 29.212.

Keeping them well separated helps in avoiding confusion on users fo the
messages.

Change-Id: Ibe0d5f263813d5083e020c942283f214983162b4
---
M ggsn_tests/GGSN_Tests.ttcn
M ggsn_tests/gen_links.sh
M library/DIAMETER_Templates.ttcn
A library/DIAMETER_ts29_212_Templates.ttcn
A library/DIAMETER_ts32_299_Templates.ttcn
M pgw/PGW_Tests.ttcn
M pgw/gen_links.sh
7 files changed, 262 insertions(+), 187 deletions(-)



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

diff --git a/ggsn_tests/GGSN_Tests.ttcn b/ggsn_tests/GGSN_Tests.ttcn
index a1aab9b..d7de443 100644
--- a/ggsn_tests/GGSN_Tests.ttcn
+++ b/ggsn_tests/GGSN_Tests.ttcn
@@ -34,7 +34,9 @@

import from DIAMETER_Types all;
import from DIAMETER_Templates all;
+   import from DIAMETER_ts29_212_Templates all;
import from DIAMETER_ts29_272_Templates all;
+   import from DIAMETER_ts32_299_Templates all;
import from DIAMETER_Emulation all;

const integer GTP0_PORT := 3386;
diff --git a/ggsn_tests/gen_links.sh b/ggsn_tests/gen_links.sh
index b51620e..4981e64 100755
--- a/ggsn_tests/gen_links.sh
+++ b/ggsn_tests/gen_links.sh
@@ -61,7 +61,7 @@
 FILES="Misc_Helpers.ttcn General_Types.ttcn GSM_Types.ttcn Osmocom_Types.ttcn 
Native_Functions.ttcn Native_FunctionDefs.cc IPCP_Types.ttcn PAP_Types.ttcn "
 FILES+="GTP_CodecPort.ttcn GTP_CodecPort_CtrlFunct.ttcn 
GTP_CodecPort_CtrlFunctDef.cc GTP_Templates.ttcn Osmocom_Gb_Types.ttcn "
 FILES+="DIAMETER_Types.ttcn DIAMETER_CodecPort.ttcn 
DIAMETER_CodecPort_CtrlFunct.ttcn DIAMETER_CodecPort_CtrlFunctDef.cc 
DIAMETER_Emulation.ttcn "
-FILES+="DIAMETER_Templates.ttcn DIAMETER_ts29_272_Templates.ttcn "
+FILES+="DIAMETER_Templates.ttcn DIAMETER_ts29_212_Templates.ttcn 
DIAMETER_ts29_272_Templates.ttcn DIAMETER_ts32_299_Templates.ttcn "
 FILES+="Osmocom_VTY_Functions.ttcn "
 gen_links $DIR $FILES

diff --git a/library/DIAMETER_Templates.ttcn b/library/DIAMETER_Templates.ttcn
index 05b63d2..82a433c 100644
--- a/library/DIAMETER_Templates.ttcn
+++ b/library/DIAMETER_Templates.ttcn
@@ -102,10 +102,9 @@
DIAMETER_ERROR_EAP_CODE_UNKNOWN (5048)
 };

-/* Gy : 3GPP TS 32.299 7.1.6, RFC4006 3.1 */
+/* RFC4006 3.1 */
 const uint32_t c_DIAMETER_CREDIT_CONTROL_AID := 4;

-const uint32_t c_DIAMETER_3GPP_Gx_AID := 16777238;
 const uint32_t c_DIAMETER_3GPP_S7_AID := 16777308;

 const octetstring c_def_sess_id := char2oct("ttcn3.session");
@@ -1215,142 +1214,6 @@
return diam_pdu;
 }

-/* RFC 4006 3.1.  Credit-Control-Request (CCR) Command */
-template (present) PDU_DIAMETER
-tr_DIA_Gx_CCR(template (present) DCC_NONE_CC_Request_Type req_type := 
INITIAL_REQUEST)
-:= tr_DIAMETER(flags:='1100'B, cmd_code:=Credit_Control,
-   avps := superset(
-   tr_AVP_SessionId,
-   tr_AVP_OriginHost,
-   tr_AVP_OriginRealm,
-   tr_AVP_DestinationRealm,
-   tr_AVP_AuthAppId(int2oct(c_DIAMETER_3GPP_Gx_AID, 4)),
-   tr_AVP_CcReqType(req_type),
-   tr_AVP_CcReqNum(?)
-   ));
-template (present) PDU_DIAMETER
-tr_DIA_Gy_CCR(template (present) DCC_NONE_CC_Request_Type req_type := 
INITIAL_REQUEST)
-:= tr_DIAMETER(flags:='1100'B, cmd_code:=Credit_Control,
-   avps := superset(
-   tr_AVP_SessionId,
-   tr_AVP_OriginHost,
-   tr_AVP_OriginRealm,
-   tr_AVP_DestinationRealm,
-   tr_AVP_AuthAppId(int2oct(c_DIAMETER_CREDIT_CONTROL_AID, 4)),
-   tr_AVP_CcReqType(req_type),
-   tr_AVP_CcReqNum(?)
-   ));
-
-
-
-/* RFC 4006 3.2.  Credit-Control-Answer (CCA) Command */
-template (value) PDU_DIAMETER
-ts_DIA_Gx_CCA(template (value) UINT32 hbh_id, template (value) UINT32 ete_id,
-  template (value) octetstring sess_id,
-  template (value) DCC_NONE_CC_Request_Type req_type,
-  template (value) AVP_Unsigned32 req_num)
-:= ts_DIAMETER(flags:='0100'B, cmd_code:=Credit_Control,
-   app_id:=int2oct(c_DIAMETER_3GPP_Gx_AID, 4), hbh_id:=hbh_id, 
ete_id:=ete_id,
-   avps := {
-   ts_AVP_SessionId(sess_id),
-   ts_AVP_ResultCode(DIAMETER_SUCCESS),
-   ts_AVP_OriginHost("pcrf.localdomain"),
-   ts_AVP_OriginRealm("localdomain"),
-   ts_AVP_AuthAppId(int2oct(c_DIAMETER_3GPP_Gx_AID, 4)),
-   ts_AVP_CcReqType(req_type),
-