diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-10-13 17:56:22 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-10-13 23:55:52 +0200 |
commit | 4d44fc56e782dd0598ddfb8fc963c46c3b1b5a20 (patch) | |
tree | fd5f75db93f10f7b8c98d2f74813e221f65d0c94 /openbsc/src | |
parent | 19c530c5e7be14c518c8c0e65855c658b78d0146 (diff) |
nat: Make the queue routine work on any write_queue
Diffstat (limited to 'openbsc/src')
-rw-r--r-- | openbsc/src/nat/bsc_nat_utils.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/openbsc/src/nat/bsc_nat_utils.c b/openbsc/src/nat/bsc_nat_utils.c index 4fda517c2..9c155ccaf 100644 --- a/openbsc/src/nat/bsc_nat_utils.c +++ b/openbsc/src/nat/bsc_nat_utils.c @@ -265,10 +265,15 @@ int bsc_write_mgcp(struct bsc_connection *bsc, const uint8_t *data, unsigned int int bsc_write(struct bsc_connection *bsc, struct msgb *msg, int proto) { + return bsc_do_write(&bsc->write_queue, msg, proto); +} + +int bsc_do_write(struct write_queue *queue, struct msgb *msg, int proto) +{ /* prepend the header */ ipaccess_prepend_header(msg, proto); - if (write_queue_enqueue(&bsc->write_queue, msg) != 0) { + if (write_queue_enqueue(queue, msg) != 0) { LOGP(DINP, LOGL_ERROR, "Failed to enqueue the write.\n"); msgb_free(msg); return -1; |