ipa: Pull everything together: L3->BSSAP->SCCP->IPA
diff --git a/library/IPA_Emulation.ttcn b/library/IPA_Emulation.ttcn
index 31f5c27..4d21bb4 100644
--- a/library/IPA_Emulation.ttcn
+++ b/library/IPA_Emulation.ttcn
@@ -12,11 +12,22 @@
 }
 */
 
+type record ASP_IPA_Unitdata {
+	IpaStreamId	streamId,
+	octetstring	payload
+}
+
+type port IPA_SP_PT message {
+	inout ASP_IPA_Unitdata;
+} with { extension "internal" }
+
 type component IPA_Emulation_CT {
 	/* down-facing port to IPA codec port */
 	port IPA_CODEC_PT IPA_PORT;
 	/* up-facing port to SCCP */
 	port MTP3asp_SP_PT MTP3_SP_PORT;
+	/* up-facing port for other streams */
+	port IPA_SP_PT IPA_SP_PORT;
 
 	var boolean g_initialized := false;
 	var ConnectionId g_ipa_conn_id := -1;
@@ -114,9 +125,26 @@
 	}
 }
 
+private function f_to_asp(IPA_RecvFrom ipa_rx) return ASP_IPA_Unitdata {
+	var ASP_IPA_Unitdata ret := {
+		streamId := ipa_rx.streamId,
+		payload := ipa_rx.msg
+	}
+	return ret;
+}
+
+private function f_from_asp(ConnectionId connId, ASP_IPA_Unitdata ipa_tx) return IPA_Send {
+	var IPA_Send ret := {
+		connId := connId,
+		streamId := ipa_tx.streamId,
+		msg := ipa_tx.payload
+	}
+	return ret;
+}
 
 function ScanEvents() runs on IPA_Emulation_CT {
 	var IPA_RecvFrom ipa_rx;
+	var ASP_IPA_Unitdata ipa_ud;
 	var ASP_MTP3_TRANSFERreq mtp_req;
 
 	f_connect("127.0.0.1", 5000, "127.0.0.1", 49999);
@@ -137,7 +165,7 @@
 				MTP3_SP_PORT.send(mtp);
 				}
 			case else {
-				log("Unknown/unsupported IPA Stream ID", ipa_rx);
+				IPA_SP_PORT.send(f_to_asp(ipa_rx));
 				}
 			}
 		}
@@ -151,6 +179,13 @@
 			}
 			IPA_PORT.send(ipa_tx);
 		}
+
+		/* Received MISC (RSL/OML/CTRL/MGCP) -> down into IPA */
+		[] IPA_SP_PORT.receive(ASP_IPA_Unitdata: ?) -> value ipa_ud {
+			IPA_PORT.send(f_from_asp(g_ipa_conn_id, ipa_ud));
+		}
+
+
 		}
 	}
 }