GSUP: Convert PDP-Type IE to PDP-Address IE
The previous PDP-Type IE should have been a PDP-Address from the
start, since having only PDP-Type with no address is only a specific
case (dynamic addressing).
This becomes clear by looking at other similar protocols like:
* MAP: APN-Configuration IE has servedPartyIP-IP{v4,v6}-Address IEs
* Diameter S6b, 3GPP TS 29.272 7.3.35 APN-Configuration contains
Served-Party-IP-Address AVPs
* Diameter SWx, 3GPP TS 29.273 APN-Configuration.
* GTPv1C Ts 29.060 7.7.29 PDP Context containing PDP Address.
Since PDP-Type on its own really makes no sense, being it a special case
of PDP-Address, let's keep the IE by renaming it (keeping old name too
for API backward compat) and extend it to support lengths > 2 bytes.
Old implementation of libosmogsm gsup actually ignored lengths > 2
bytes, so we are safe acting against older implementations here, both
on the sending and receiving side on the wire.
Change-Id: I3e92368fff61694bcef6a48320595b59ae8f54ca
Related: OS#6091
Related: libosmocore.git Change-Id I775ff9c3be165d9f30d6ab55d03f99b6104eadd6
Related: osmo-gsm-manuals.git Change-Id I775ff9c3be165d9f30d6ab55d03f99b6104eadd6
diff --git a/library/GSUP_Templates.ttcn b/library/GSUP_Templates.ttcn
index 0e9a2e5..634cfc3 100644
--- a/library/GSUP_Templates.ttcn
+++ b/library/GSUP_Templates.ttcn
@@ -59,7 +59,15 @@
digits := digits
}
-
+template (value) GSUP_PDP_Address ts_GSUP_PDP_Address_IPv4(template (omit) OCT4 ip_addr) := {
+ ipv4 := {
+ pdp_typeorg := '0001'B,
+ spare := '1111'B,
+ pdp_typenum := '21'O,
+ ipv4_address := ip_addr
+ }
+}
+template (value) GSUP_PDP_Address ts_EuaIPv4Dyn := ts_GSUP_PDP_Address_IPv4(omit);
template GSUP_IE ts_GSUP_IE_AuthTuple2G(octetstring rand, octetstring sres,
octetstring kc) := {
@@ -151,13 +159,15 @@
}
}
-template GSUP_IE ts_GSUP_IE_PdpInfo(octetstring apn, octetstring pdp_type, octetstring pdp_qos) := {
+template GSUP_IE ts_GSUP_IE_PdpInfo(template (value) octetstring apn,
+ template (value) GSUP_PDP_Address pdp_address,
+ template (value) octetstring pdp_qos) := {
tag := OSMO_GSUP_PDP_INFO_IE,
len := 0, /* overwritten */
val := {
pdp_info := {
valueof(ts_GSUP_IE_APN(apn)),
- valueof(ts_GSUP_IE_PDP_TYPE(pdp_type)),
+ valueof(ts_GSUP_IE_PDP_ADDRESS(pdp_address)),
valueof(ts_GSUP_IE_PDP_QOS(pdp_qos))
}
}
@@ -180,15 +190,15 @@
}
-template (value) GSUP_IE ts_GSUP_IE_PDP_TYPE(OCT2 pdp_type) := {
- tag := OSMO_GSUP_PDP_TYPE_IE,
+template (value) GSUP_IE ts_GSUP_IE_PDP_ADDRESS(template (value) GSUP_PDP_Address pdp_address) := {
+ tag := OSMO_GSUP_PDP_ADDRESS_IE,
len := 0,
val := {
- pdp_type := pdp_type
+ pdp_address := pdp_address
}
}
-template (value) GSUP_IE ts_GSUP_IE_PDP_QOS(octetstring pdp_qos) := {
+template (value) GSUP_IE ts_GSUP_IE_PDP_QOS(template (value) octetstring pdp_qos) := {
tag := OSMO_GSUP_PDP_QOS_IE,
len := 0,
val := {
@@ -633,7 +643,7 @@
}
}
-template (value) GSUP_IE ts_GSUP_IE_APN(octetstring apn) := {
+template (value) GSUP_IE ts_GSUP_IE_APN(template (value) octetstring apn) := {
tag := OSMO_GSUP_ACCESS_POINT_NAME_IE,
len := 0, /* overwritten */
val := {