mncc: Support IPv6 addresses (new version mncc 7)
Apparently commit 06b859ca314f53a902329ed95848dbafef1d4f87 forgot to
bump the MNCC_SOCK_VERSION field from 5 to 6.
Change-Id: I5448ff931ec33f24f4837a51376f1703fe97683b
diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn
index 24a56b2..9218c76 100644
--- a/msc/BSC_ConnectionHandler.ttcn
+++ b/msc/BSC_ConnectionHandler.ttcn
@@ -15,6 +15,7 @@
import from General_Types all;
import from Osmocom_Types all;
import from Native_Functions all;
+import from Misc_Helpers all;
import from GSM_Types all;
import from IPL4asp_Types all;
import from SCCPasp_Types all;
@@ -813,6 +814,8 @@
/* MNCC related parameters */
uint32_t mncc_callref optional, /* call reference on the MNCC side */
MNCC_bearer_cap mncc_bearer_cap optional, /* MNCC-side bearer capabilities */
+ HostName mncc_rtp_ip optional, /* MNCC Side RTP IP */
+ PortNumber mncc_rtp_port optional, /* MNCC Side RTP port */
/* RTP related parameters */
HostName bss_rtp_ip optional, /* BSS Side RTP IP */
@@ -845,6 +848,8 @@
emergency := false,
mncc_callref := omit,
mncc_bearer_cap := valueof(ts_MNCC_bcap_voice),
+ mncc_rtp_ip := "42.23.11.5",
+ mncc_rtp_port := 423,
bss_rtp_ip := "9.8.7.6",
bss_rtp_port := 9000,
mss_rtp_ip := omit,
@@ -979,9 +984,16 @@
[] MNCC.receive(tr_MNCC_SETUP_cnf(cpars.mncc_callref)) {
log("f_mt_call_complete 7");
+ var octetstring ip;
+ var boolean is_ipv6 := f_addr_is_ipv6(cpars.mncc_rtp_ip);
+ if (is_ipv6) {
+ ip := f_inet6_addr(cpars.mncc_rtp_ip);
+ } else {
+ ip := f_inet_addr(cpars.mncc_rtp_ip);
+ }
MNCC.send(ts_MNCC_RTP_CONNECT(cpars.mncc_callref,
- /* ip 42.23.11.5 */ hex2int('42231105'H),
- /* port 423 */ 423,
+ is_ipv6, ip,
+ cpars.mncc_rtp_port,
/* payload type 3 = GSM FR */ 3));
}
@@ -1064,9 +1076,16 @@
[] MNCC.receive(tr_MNCC_SETUP_cnf(cpars.mncc_callref)) {
log("f_mt_call_complete 7.iu");
+ var octetstring ip;
+ var boolean is_ipv6 := f_addr_is_ipv6(cpars.mncc_rtp_ip);
+ if (is_ipv6) {
+ ip := f_inet6_addr(cpars.mncc_rtp_ip);
+ } else {
+ ip := f_inet_addr(cpars.mncc_rtp_ip);
+ }
MNCC.send(ts_MNCC_RTP_CONNECT(cpars.mncc_callref,
- /* ip 42.23.11.5 */ hex2int('42231105'H),
- /* port 423 */ 423,
+ is_ipv6, ip,
+ cpars.mncc_rtp_port,
/* payload type 3 = GSM FR */ 3));
}
@@ -1458,9 +1477,16 @@
cpars.mncc_callref := mncc.u.signal.callref;
/* Call Proceeding */
+ var octetstring ip;
+ var boolean is_ipv6 := f_addr_is_ipv6(cpars.mncc_rtp_ip);
+ if (is_ipv6) {
+ ip := f_inet6_addr(cpars.mncc_rtp_ip);
+ } else {
+ ip := f_inet_addr(cpars.mncc_rtp_ip);
+ }
MNCC.send(ts_MNCC_RTP_CONNECT(cpars.mncc_callref,
- /* ip 42.23.11.5 */ hex2int('42231105'H),
- /* port 423 */ 423,
+ is_ipv6, ip,
+ cpars.mncc_rtp_port,
/* payload type 3 = GSM FR */ 3));
MNCC.send(ts_MNCC_SETUP_rsp(cpars.mncc_callref));
}
diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn
index fb2a46e..5129c5b 100644
--- a/msc/MSC_Tests.ttcn
+++ b/msc/MSC_Tests.ttcn
@@ -1979,6 +1979,7 @@
cpars.mgw_conn_1.mgw_rtp_ip := "::1";
cpars.mgw_conn_2.mgw_rtp_ip := "::2";
cpars.bss_rtp_ip := "::3";
+ cpars.mncc_rtp_ip := "::9";
f_perform_lu();
f_mt_call(cpars);
}