wip

Change-Id: I4fdcebf3b006a72c5318a9105a2be2cc7057dca1
diff --git a/tests/iuup/iuup_test.c b/tests/iuup/iuup_test.c
index 8f32a95..8d96f06 100644
--- a/tests/iuup/iuup_test.c
+++ b/tests/iuup/iuup_test.c
@@ -27,12 +27,12 @@
 }
 
 const char *expect_rx_payload = NULL;
-int rx_payload(struct msgb *msg, void *node_priv, void *pdu_priv)
+int rx_payload(struct msgb *msg, void *node_priv)
 {
 	printf("rx_payload() invoked by iuup_cn!\n");
 	printf("        [IuUP] -RTP->\n");
 	printf("%s\n", dump(msg));
-	printf("node_priv=%p pdu_priv=%p\n", node_priv, pdu_priv);
+	printf("node_priv=%p\n", node_priv);
 	if (!expect_rx_payload) {
 		printf("ERROR: did not expect rx_payload()\n");
 		exit(-1);
@@ -41,18 +41,17 @@
 		exit(-1);
 	} else
 		printf("ok: matches expected msg\n");
-	msgb_free(msg);
 	expect_rx_payload = NULL;
 	return 0;
 }
 
 const char *expect_tx_msg = NULL;
-int tx_msg(struct msgb *msg, void *node_priv, void *pdu_priv)
+int tx_msg(struct msgb *msg, void *node_priv)
 {
 	printf("tx_msg() invoked by iuup_cn!\n");
 	printf(" <-PDU- [IuUP]\n");
 	printf("%s\n", dump(msg));
-	printf("node_priv=%p pdu_priv=%p\n", node_priv, pdu_priv);
+	printf("node_priv=%p\n", node_priv);
 	if (!expect_tx_msg) {
 		printf("ERROR: did not expect tx_msg()\n");
 		exit(-1);
@@ -61,29 +60,26 @@
 		exit(-1);
 	} else
 		printf("ok: matches expected msg\n");
-	msgb_free(msg);
 	expect_tx_msg = NULL;
 	return 0;
 }
 
-static int rx_pdu(struct osmo_iuup_cn *cn, struct msgb *msg, void *pdu_priv)
+static int rx_pdu(struct osmo_iuup_cn *cn, struct msgb *msg)
 {
 	int rc;
 	printf(" -PDU-> [IuUP]\n");
 	printf("%s\n", dump(msg));
-	printf("pdu_priv=%p\n", pdu_priv);
-	rc = osmo_iuup_cn_rx_pdu(cn, msg, pdu_priv);
+	rc = osmo_iuup_cn_rx_pdu(cn, msg);
 	printf("rc=%d\n", rc);
 	return rc;
 }
 
-static int tx_payload(struct osmo_iuup_cn *cn, struct msgb *msg, void *pdu_priv)
+static int tx_payload(struct osmo_iuup_cn *cn, struct msgb *msg)
 {
 	int rc;
 	printf("        [IuUP] <-RTP-\n");
 	printf("%s\n", dump(msg));
-	printf("pdu_priv=%p\n", pdu_priv);
-	rc = osmo_iuup_cn_tx_payload(cn, msg, pdu_priv);
+	rc = osmo_iuup_cn_tx_payload(cn, msg);
 	printf("rc=%d\n", rc);
 	return rc;
 }
@@ -91,7 +87,6 @@
 void test_cn_session()
 {
 	void *node_priv = (void*)0x2342;
-	void *pdu_priv = (void*)0xfeed;
 
 	struct osmo_iuup_cn_cfg cfg = {
 		.node_priv = node_priv,
@@ -103,13 +98,13 @@
 	OSMO_ASSERT(cn);
 
 	printf("\nSend IuUP Initialization. Expecting direct tx_msg() of the Initialization Ack\n");
-	expect_tx_msg = "e400240000";
+	expect_tx_msg = "8060dc5219495e3f00010111" /* RTP header */
+			"e4002400"; /* IuUP Init Ack */
 	rx_pdu(cn,
 	       msgb_from_hex("IuUP-Init",
 			     "8060dc5219495e3f00010111" /* <- RTP header */
 			     "e000df99" /* <- IuUP header */
-			     "160051673c01270000820000001710000100" /* IuUP params */),
-	       pdu_priv);
+			     "160051673c01270000820000001710000100" /* IuUP params */));
 
 #define RTP_HEADER "8060944c6256042c00010102"
 #define IUUP_HEADER "0100e2b3"
@@ -119,28 +114,23 @@
 	expect_rx_payload = RTP_HEADER RTP_PAYLOAD;
 	rx_pdu(cn,
 	       msgb_from_hex("IuUP-Data",
-			     RTP_HEADER IUUP_HEADER RTP_PAYLOAD),
-	       pdu_priv);
+			     RTP_HEADER IUUP_HEADER RTP_PAYLOAD));
 
 	printf("\nTransmit RTP. Expecting tx_msg() with inserted IuUP header\n");
 	expect_tx_msg = RTP_HEADER "000002b3" RTP_PAYLOAD;
 	tx_payload(cn,
-		   msgb_from_hex("RTP data", RTP_HEADER RTP_PAYLOAD),
-		   pdu_priv);
+		   msgb_from_hex("RTP data", RTP_HEADER RTP_PAYLOAD));
 
 	printf("\nMore RTP, each time the Frame Nr advances, causing a new header CRC.\n");
 	expect_tx_msg = RTP_HEADER "0100e2b3" RTP_PAYLOAD;
 	tx_payload(cn,
-		   msgb_from_hex("RTP data", RTP_HEADER RTP_PAYLOAD),
-		   pdu_priv);
+		   msgb_from_hex("RTP data", RTP_HEADER RTP_PAYLOAD));
 	expect_tx_msg = RTP_HEADER "02007eb3" RTP_PAYLOAD;
 	tx_payload(cn,
-		   msgb_from_hex("RTP data", RTP_HEADER RTP_PAYLOAD),
-		   pdu_priv);
+		   msgb_from_hex("RTP data", RTP_HEADER RTP_PAYLOAD));
 	expect_tx_msg = RTP_HEADER "03009eb3" RTP_PAYLOAD;
 	tx_payload(cn,
-		   msgb_from_hex("RTP data", RTP_HEADER RTP_PAYLOAD),
-		   pdu_priv);
+		   msgb_from_hex("RTP data", RTP_HEADER RTP_PAYLOAD));
 
 	printf("All done.\n");
 }
diff --git a/tests/iuup/iuup_test.ok b/tests/iuup/iuup_test.ok
index fa46635..2b09c66 100644
--- a/tests/iuup/iuup_test.ok
+++ b/tests/iuup/iuup_test.ok
@@ -2,11 +2,10 @@
 Send IuUP Initialization. Expecting direct tx_msg() of the Initialization Ack
  -PDU-> [IuUP]
 8060dc5219495e3f00010111e000df99160051673c01270000820000001710000100
-pdu_priv=0xfeed
 tx_msg() invoked by iuup_cn!
  <-PDU- [IuUP]
-e400240000
-node_priv=0x2342 pdu_priv=0xfeed
+8060dc5219495e3f00010111e4002400
+node_priv=0x2342
 ok: matches expected msg
 rc=0
 
@@ -14,51 +13,46 @@
 i.e. should strip away 0100e2b3
  -PDU-> [IuUP]
 8060944c6256042c000101020100e2b36cfb23bc46d18180c3e5ffe040045600005a7d35b625b80005fff03214ced0
-pdu_priv=0xfeed
 rx_payload() invoked by iuup_cn!
         [IuUP] -RTP->
 8060944c6256042c000101026cfb23bc46d18180c3e5ffe040045600005a7d35b625b80005fff03214ced0
-node_priv=0x2342 pdu_priv=0xfeed
+node_priv=0x2342
 ok: matches expected msg
 rc=0
 
 Transmit RTP. Expecting tx_msg() with inserted IuUP header
         [IuUP] <-RTP-
 8060944c6256042c000101026cfb23bc46d18180c3e5ffe040045600005a7d35b625b80005fff03214ced0
-pdu_priv=0xfeed
 tx_msg() invoked by iuup_cn!
  <-PDU- [IuUP]
 8060944c6256042c00010102000002b36cfb23bc46d18180c3e5ffe040045600005a7d35b625b80005fff03214ced0
-node_priv=0x2342 pdu_priv=0xfeed
+node_priv=0x2342
 ok: matches expected msg
 rc=0
 
 More RTP, each time the Frame Nr advances, causing a new header CRC.
         [IuUP] <-RTP-
 8060944c6256042c000101026cfb23bc46d18180c3e5ffe040045600005a7d35b625b80005fff03214ced0
-pdu_priv=0xfeed
 tx_msg() invoked by iuup_cn!
  <-PDU- [IuUP]
 8060944c6256042c000101020100e2b36cfb23bc46d18180c3e5ffe040045600005a7d35b625b80005fff03214ced0
-node_priv=0x2342 pdu_priv=0xfeed
+node_priv=0x2342
 ok: matches expected msg
 rc=0
         [IuUP] <-RTP-
 8060944c6256042c000101026cfb23bc46d18180c3e5ffe040045600005a7d35b625b80005fff03214ced0
-pdu_priv=0xfeed
 tx_msg() invoked by iuup_cn!
  <-PDU- [IuUP]
 8060944c6256042c0001010202007eb36cfb23bc46d18180c3e5ffe040045600005a7d35b625b80005fff03214ced0
-node_priv=0x2342 pdu_priv=0xfeed
+node_priv=0x2342
 ok: matches expected msg
 rc=0
         [IuUP] <-RTP-
 8060944c6256042c000101026cfb23bc46d18180c3e5ffe040045600005a7d35b625b80005fff03214ced0
-pdu_priv=0xfeed
 tx_msg() invoked by iuup_cn!
  <-PDU- [IuUP]
 8060944c6256042c0001010203009eb36cfb23bc46d18180c3e5ffe040045600005a7d35b625b80005fff03214ced0
-node_priv=0x2342 pdu_priv=0xfeed
+node_priv=0x2342
 ok: matches expected msg
 rc=0
 All done.