aboutsummaryrefslogtreecommitdiffstats
path: root/tests/osmo-pcap-test
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@gnumonks.org>2012-08-04 19:56:47 +0200
committerPablo Neira Ayuso <pablo@gnumonks.org>2012-08-04 19:59:33 +0200
commitfe9fccd412f2bd52d483f1b8cc5fa2135438d254 (patch)
tree5d9962044e7480c2be2dd06a0f618be0696a6714 /tests/osmo-pcap-test
parentfdc65389864dfd567abaa67797f06b70905f5b19 (diff)
osmux: cleanup tx path
This patch cleans up the transmission path for osmux, this involves the functions that extract the messages from the batch and the one that reconstruct the timing. They now take a list that contains the reconstructed RTP messages: osmux_xfrm_output(osmuxh, &h_output, &list); osmux_tx_sched(&list, &tv, tx_cb, NULL);
Diffstat (limited to 'tests/osmo-pcap-test')
-rw-r--r--tests/osmo-pcap-test/osmux_test.c25
1 files changed, 5 insertions, 20 deletions
diff --git a/tests/osmo-pcap-test/osmux_test.c b/tests/osmo-pcap-test/osmux_test.c
index 5ed3c86..f45f1fd 100644
--- a/tests/osmo-pcap-test/osmux_test.c
+++ b/tests/osmo-pcap-test/osmux_test.c
@@ -52,10 +52,8 @@ static void tx_cb(struct msgb *msg, void *data)
static void deliver(struct msgb *batch_msg)
{
struct osmux_hdr *osmuxh;
- struct msgb *msg;
- int i = 0;
- struct timeval tv = { .tv_sec = 0, .tv_usec = 0 };
- struct timeval delta = { .tv_sec = 0, .tv_usec = 20000 };
+ struct timeval tv;
+ struct llist_head list;
timerclear(&tv);
@@ -63,22 +61,9 @@ static void deliver(struct msgb *batch_msg)
/* This code below belongs to the osmux receiver */
while((osmuxh = osmux_xfrm_output_pull(batch_msg)) != NULL) {
- struct msgb *next;
-
- msg = osmux_xfrm_output(osmuxh, &h_output);
- printf("scheduled transmision in %lu.%6lu seconds, "
- "msg=%p (%d in batch)\n",
- tv.tv_sec, tv.tv_usec, msg, ++i);
- osmux_tx_sched(msg, &tv, tx_cb, NULL);
- timeradd(&tv, &delta, &tv);
-
- llist_for_each_entry(next, &msg->list, list) {
- printf("scheduled transmision in %lu.%6lu seconds, "
- "msg=%p (%d in batch)\n",
- tv.tv_sec, tv.tv_usec, next, ++i);
- osmux_tx_sched(next, &tv, tx_cb, NULL);
- timeradd(&tv, &delta, &tv);
- }
+
+ osmux_xfrm_output(osmuxh, &h_output, &list);
+ osmux_tx_sched(&list, &tv, tx_cb, NULL);
}
}