DIAMETER: parametrize CEA template
So far, we hard-coded the Capabilities-Exchange-Answer for
HSS emulation. As we want to emulate other DIAMETER network
elements, let's parametrize the template as well as the respective
parameters for the emulation component.
Change-Id: Ie30ff1bac40ab3dc6058587f0586b643ff2b0cb6
diff --git a/library/DIAMETER_Emulation.ttcn b/library/DIAMETER_Emulation.ttcn
index 6dd44b3..cff4d63 100644
--- a/library/DIAMETER_Emulation.ttcn
+++ b/library/DIAMETER_Emulation.ttcn
@@ -33,6 +33,7 @@
import from DIAMETER_Templates all;
import from Osmocom_Types all;
import from IPL4asp_Types all;
+import from Native_Functions all;
type hexstring IMSI;
@@ -94,7 +95,10 @@
HostName remote_ip,
PortNumber remote_sctp_port,
HostName local_ip,
- PortNumber local_sctp_port
+ PortNumber local_sctp_port,
+ charstring origin_host,
+ charstring origin_realm,
+ uint32_t vendor_app_id
}
function tr_DIAMETER_RecvFrom_R(template PDU_DIAMETER msg)
@@ -312,7 +316,8 @@
/* handle CER/CEA handshake */
[] DIAMETER.receive(tr_DIAMETER_RecvFrom_R(tr_DIAMETER_R(cmd_code := Capabilities_Exchange))) -> value mrf {
var template (value) PDU_DIAMETER resp;
- resp := ts_DIA_CEA(mrf.msg.hop_by_hop_id, mrf.msg.end_to_end_id);
+ resp := ts_DIA_CEA(mrf.msg.hop_by_hop_id, mrf.msg.end_to_end_id, p.origin_host,
+ p.origin_realm, f_inet_addr(p.local_ip), p.vendor_app_id);
DIAMETER.send(t_DIAMETER_Send(g_diameter_conn_id, resp));
}