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

Change subject: GTPv2_Templates: Add enum for PDN Type and use it in pgw 
testsuite
......................................................................

GTPv2_Templates: Add enum for PDN Type and use it in pgw testsuite

Change-Id: I9833e998522a09a15b93c8fed0e18a5e8159d760
---
M library/GTPv2_Templates.ttcn
M pgw/PGW_Tests.ttcn
2 files changed, 12 insertions(+), 3 deletions(-)

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




diff --git a/library/GTPv2_Templates.ttcn b/library/GTPv2_Templates.ttcn
index 925735a..539251c 100644
--- a/library/GTPv2_Templates.ttcn
+++ b/library/GTPv2_Templates.ttcn
@@ -13,6 +13,15 @@
 import from Osmocom_Types all;
 import from GTPv2_Types all;

+/* 8.14 */
+type enumerated GTP2C_PDN_Type {
+       GTP2C_PDN_IPv4          ('001'B),
+       GTP2C_PDN_IPv6          ('010'B),
+       GTP2C_PDN_IPv4v6        ('011'B),
+       GTP2C_PDN_non_IP        ('100'B),
+       GTP2C_PDN_Ethernet      ('101'B)
+} with { variant "FIELDLENGTH(3)" encode "RAW" };
+
 private function fs_GTP2C_t_bit(template (omit) OCT4 teid) return BIT1 {
        if (istemplatekind(teid, "omit")) {
                return '0'B;
diff --git a/pgw/PGW_Tests.ttcn b/pgw/PGW_Tests.ttcn
index 1ba58f4..9f15919 100644
--- a/pgw/PGW_Tests.ttcn
+++ b/pgw/PGW_Tests.ttcn
@@ -154,7 +154,7 @@
        charstring      apn,
        /* Apn subscribed or non-subscribed */
        boolean         selection_mode,
-       BIT3            pdn_type,
+       GTP2C_PDN_Type  pdn_type,
        /* PAA */
        /* Max APN Restriction */
        /* APN-AMBR */
@@ -181,7 +181,7 @@
             GTP2C_RAT_Type rat_type := GTP2C_RAT_EUTRAN,
             charstring apn := "internet",
             boolean selection_mode := false,
-            BIT3 pdn_type := '001'B) := {
+            GTP2C_PDN_Type pdn_type := GTP2C_PDN_IPv4) := {
        imsi := imsi,
        msisdn := msisdn,
        rat_type := rat_type,
@@ -748,7 +748,7 @@
                                          rat_type := enum2int(g_pars.rat_type),
                                          sender_fteid := fteid_c_ie,
                                          apn := f_enc_dns_hostname(g_pars.apn),
-                                         pdn_type := g_pars.pdn_type,
+                                         pdn_type := 
int2bit(enum2int(g_pars.pdn_type), 3),
                                          teid_list := { fteid_u_ie },
                                          chg_car := '0000'O,
                                          bearer_id := g_pars.bearer.ebi,

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

Gerrit-MessageType: merged
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I9833e998522a09a15b93c8fed0e18a5e8159d760
Gerrit-Change-Number: 42498
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>

Reply via email to