diff options
Diffstat (limited to 'tests/osmo-pcap-test/osmux_test.c')
-rw-r--r-- | tests/osmo-pcap-test/osmux_test.c | 25 |
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); } } |