diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2011-01-17 11:29:07 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2011-01-17 11:29:07 +0100 |
commit | 4a3743440bd77aa0cec240e103aa2c7ce954b714 (patch) | |
tree | 1c6eb6a441fafc15bf2048441bc8ee71e29623d7 /src/msc_conn.c | |
parent | de56c2270268ff6e8945d5e03ec58ad52c3da64b (diff) | |
parent | d91f94024ed9c0b9d2c674c09fe1466182002b5a (diff) |
Merge branch 'on-waves/multiple-links'
Diffstat (limited to 'src/msc_conn.c')
-rw-r--r-- | src/msc_conn.c | 45 |
1 files changed, 5 insertions, 40 deletions
diff --git a/src/msc_conn.c b/src/msc_conn.c index 77c4039..bc05744 100644 --- a/src/msc_conn.c +++ b/src/msc_conn.c @@ -46,48 +46,13 @@ static void msc_send_id_response(struct bsc_data *bsc); static void msc_send(struct bsc_data *bsc, struct msgb *msg, int proto); static void msc_schedule_reconnect(struct bsc_data *bsc); -void mtp_link_slta_recv(struct mtp_link *link) +int send_or_queue_bsc_msg(struct mtp_link_set *link, int sls, struct msgb *msg) { - struct msgb *msg; - unsigned int sls; - - while (!llist_empty(&link->pending_msgs)) { - msg = msgb_dequeue(&link->pending_msgs); - sls = (unsigned int) msg->l3h; - - if (mtp_link_submit_sccp_data(link, sls, msg->l2h, msgb_l2len(msg)) != 0) - LOGP(DMSC, LOGL_ERROR, "Could not forward SCCP message.\n"); - - msgb_free(msg); - } -} - -int send_or_queue_bsc_msg(struct mtp_link *link, int sls, struct msgb *msg) -{ - if (link->sltm_pending) { - LOGP(DMSC, LOGL_NOTICE, "Queueing msg for pending SLTM.\n"); - msg->l3h = (uint8_t *) sls; - msgb_enqueue(&link->pending_msgs, msg); - return 1; - } - - if (mtp_link_submit_sccp_data(link, sls, msg->l2h, msgb_l2len(msg)) != 0) + if (mtp_link_set_submit_sccp_data(link, sls, msg->l2h, msgb_l2len(msg)) != 0) LOGP(DMSC, LOGL_ERROR, "Could not forward SCCP message.\n"); return 0; } - -void msc_clear_queue(struct bsc_data *data) -{ - struct msgb *msg; - - LOGP(DMSC, LOGL_NOTICE, "Clearing the MSC to BSC queue.\n"); - while (!llist_empty(&data->link.the_link->pending_msgs)) { - msg = msgb_dequeue(&data->link.the_link->pending_msgs); - msgb_free(msg); - } -} - void msc_close_connection(struct bsc_data *bsc) { struct bsc_fd *bfd = &bsc->msc_connection.bfd; @@ -157,7 +122,7 @@ static int ipaccess_a_fd_cb(struct bsc_fd *bfd) { int error; struct ipaccess_head *hh; - struct mtp_link *link; + struct mtp_link_set *link; struct bsc_data *bsc; struct msgb *msg; @@ -181,7 +146,7 @@ static int ipaccess_a_fd_cb(struct bsc_fd *bfd) hh = (struct ipaccess_head *) msg->data; ipaccess_rcvmsg_base(msg, bfd); - link = bsc->link.the_link; + link = bsc->link_set; /* initialize the networking. This includes sending a GSM08.08 message */ if (hh->proto == IPAC_PROTO_IPACCESS) { @@ -203,7 +168,7 @@ static int ipaccess_a_fd_cb(struct bsc_fd *bfd) /* we can not forward it right now */ if (bsc->forward_only && link->sccp_up) { - if (send_or_queue_bsc_msg(link, 13, msg) != 1) + if (send_or_queue_bsc_msg(link, -1, msg) != 1) msgb_free(msg); return 0; } |