pespin has uploaded this change for review.

View Change

ggsn: Submit RATType in CreatePDPContextReq

According to TS 29.060, sec 7.3.1 Create PDP Context Request:
"The SGSN shall include the RAT Type IE during Primary PDP Context
Activation procedure."

Change-Id: Ibc57798e50ccd08ef6126f75f7c8134e56d2778a
---
M ggsn_tests/GGSN_Tests.ttcn
M library/GTP_Templates.ttcn
2 files changed, 26 insertions(+), 8 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/51/27051/1
diff --git a/ggsn_tests/GGSN_Tests.ttcn b/ggsn_tests/GGSN_Tests.ttcn
index a0c7b16..28e34e9 100644
--- a/ggsn_tests/GGSN_Tests.ttcn
+++ b/ggsn_tests/GGSN_Tests.ttcn
@@ -83,7 +83,8 @@
/* TEI (Data) remote side */
OCT4 teid_remote,
/* TEI (Control) remote side */
- OCT4 teic_remote
+ OCT4 teic_remote,
+ OCT1 ratType optional
}

type component GT_CT {
@@ -236,7 +237,7 @@

/* define an (internal) representation of a PDP context */
template PdpContext t_DefinePDP(hexstring imsi, octetstring msisdn, octetstring apn,
- EndUserAddress eua) := {
+ EndUserAddress eua, OCT1 ratType := '02'O /* GERAN */) := {
imsi := imsi,
msisdn := msisdn,
nsapi := f_rnd_nsapi(),
@@ -244,7 +245,8 @@
pco_req := omit,
eua := eua,
teid := f_rnd_tei(),
- teic := f_rnd_tei()
+ teic := f_rnd_tei(),
+ ratType := ratType
}

/* send GTP-C for a given context and increment sequence number */
@@ -316,7 +318,7 @@
log("sending CreatePDP");
f_send_gtpc(ts_GTPC_CreatePDP(g_peer_c, g_c_seq_nr, ctx.imsi, g_restart_ctr,
ctx.teid, ctx.teic, ctx.nsapi, ctx.eua, ctx.apn,
- g_sgsn_ip_c, g_sgsn_ip_u, ctx.msisdn, ctx.pco_req));
+ g_sgsn_ip_c, g_sgsn_ip_u, ctx.msisdn, ctx.pco_req, ctx.ratType));
T_default.start;
d := activate(pingpong());
alt {
diff --git a/library/GTP_Templates.ttcn b/library/GTP_Templates.ttcn
index 9c8d1b6..94f327e 100644
--- a/library/GTP_Templates.ttcn
+++ b/library/GTP_Templates.ttcn
@@ -287,10 +287,25 @@
padding := 'F'H
}

+ function f_ts_RATType(template (omit) OCT1 ratType := omit) return template (omit) RATType {
+ var template (omit) RATType rt;
+ if (istemplatekind(ratType, "omit")) {
+ rt := omit;
+ } else {
+ rt := {
+ type_gtpc := '97'O,
+ lengthf := 1,
+ ratTypeValue := ratType
+ };
+ }
+ return rt;
+ }
+
template GTPC_PDUs ts_CreatePdpPDU(hexstring imsi, OCT1 restart_ctr, OCT4 teid_data, OCT4 teid_ctrl,
BIT4 nsapi, EndUserAddress eua, octetstring apn,
octetstring sgsn_ip_sign, octetstring sgsn_ip_data,
- octetstring msisdn, template ProtConfigOptions pco := omit) := {
+ octetstring msisdn, template ProtConfigOptions pco := omit,
+ template (omit) OCT1 ratType := omit) := {
createPDPContextRequest := {
imsi := ts_Imsi(imsi),
rai := omit,
@@ -329,7 +344,7 @@
omcId := omit,
commonFlags := omit,
aPN_Restriction := omit,
- ratType := omit,
+ ratType := f_ts_RATType(ratType),
userLocationInformation := omit,
mS_TimeZone := omit,
imeisv := omit,
@@ -351,12 +366,13 @@
OCT4 teid_ctrl, BIT4 nsapi, EndUserAddress eua,
octetstring apn, octetstring sgsn_ip_sign,
octetstring sgsn_ip_data, octetstring msisdn,
- template ProtConfigOptions pco := omit) := {
+ template ProtConfigOptions pco := omit,
+ template (omit) OCT1 ratType := omit) := {
peer := peer,
gtpc := ts_GTP1C_PDU(createPDPContextRequest, '00000000'O,
valueof(ts_CreatePdpPDU(imsi, restart_ctr, teid_data, teid_ctrl,
nsapi, eua, apn, sgsn_ip_sign,
- sgsn_ip_data, msisdn, pco)), seq)
+ sgsn_ip_data, msisdn, pco, ratType)), seq)
}



To view, visit change 27051. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ibc57798e50ccd08ef6126f75f7c8134e56d2778a
Gerrit-Change-Number: 27051
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin@sysmocom.de>
Gerrit-MessageType: newchange