aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-10-08 23:18:15 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-10-08 23:18:15 +0800
commit5d930f8745ae6ecbe995cc353217d50c542d9b9f (patch)
tree932778d949654f9308bc3154f5ea28b2621c8510
parentdedb7ce3fef7a14c52c62c22acdc043016f2563d (diff)
mtp: Store the mtp_link inside the connection
Prepare to have multiple links to the BSC.
-rw-r--r--include/bsc_data.h2
-rw-r--r--include/bsc_sccp.h3
-rw-r--r--src/main.c7
-rw-r--r--src/msc_conn.c4
4 files changed, 10 insertions, 6 deletions
diff --git a/include/bsc_data.h b/include/bsc_data.h
index e48e5b7..67d9d02 100644
--- a/include/bsc_data.h
+++ b/include/bsc_data.h
@@ -131,7 +131,7 @@ void msc_clear_queue(struct bsc_data *data);
void msc_close_connection(struct bsc_data *data);
/* connection tracking and action */
-void update_con_state(int rc, struct sccp_parse_result *result, struct msgb *msg, int from_msc, int sls);
+void update_con_state(struct mtp_link *link, int rc, struct sccp_parse_result *result, struct msgb *msg, int from_msc, int sls);
unsigned int sls_for_src_ref(struct sccp_source_reference *ref);
/* c7 init */
diff --git a/include/bsc_sccp.h b/include/bsc_sccp.h
index aed5daa..eee9a93 100644
--- a/include/bsc_sccp.h
+++ b/include/bsc_sccp.h
@@ -54,6 +54,9 @@ struct active_sccp_con {
/* how often did we send a RLSD this */
unsigned int rls_tries;
+ /* MTP link this was coming in */
+ struct mtp_link *link;
+
/* sls id */
int sls;
};
diff --git a/src/main.c b/src/main.c
index 8005666..bcb4035 100644
--- a/src/main.c
+++ b/src/main.c
@@ -142,7 +142,7 @@ void mtp_link_forward_sccp(struct mtp_link *link, struct msgb *_msg, int sls)
}
/* update the connection state */
- update_con_state(rc, &result, _msg, 0, sls);
+ update_con_state(link, rc, &result, _msg, 0, sls);
if (rc == BSS_FILTER_CLEAR_COMPL) {
send_local_rlsd(link, &result);
@@ -208,7 +208,7 @@ static void handle_local_sccp(struct mtp_link *link, struct msgb *inpt, struct s
/* Update the state, maybe the connection was released? */
- update_con_state(0, result, inpt, 0, sls);
+ update_con_state(link, 0, result, inpt, 0, sls);
if (llist_empty(&bsc.sccp_connections))
bsc_resources_released(&bsc);
return;
@@ -423,7 +423,7 @@ static void handle_rlsd(struct sccp_connection_released *rlsd, int from_msc)
* 1.) We are destroying the connection, we might send a RLC to
* the MSC if we are waiting for one.
*/
-void update_con_state(int rc, struct sccp_parse_result *res, struct msgb *msg, int from_msc, int sls)
+void update_con_state(struct mtp_link *link, int rc, struct sccp_parse_result *res, struct msgb *msg, int from_msc, int sls)
{
struct active_sccp_con *con;
struct sccp_connection_request *cr;
@@ -459,6 +459,7 @@ void update_con_state(int rc, struct sccp_parse_result *res, struct msgb *msg, i
con->src_ref = cr->source_local_reference;
con->sls = sls;
+ con->link = link;
llist_add_tail(&con->entry, &bsc.sccp_connections);
LOGP(DINP, LOGL_DEBUG, "Adding CR: local ref: 0x%x\n", sccp_src_ref_to_int(&con->src_ref));
break;
diff --git a/src/msc_conn.c b/src/msc_conn.c
index 3d0d93f..6e996d9 100644
--- a/src/msc_conn.c
+++ b/src/msc_conn.c
@@ -207,7 +207,7 @@ static int ipaccess_a_fd_cb(struct bsc_fd *bfd)
LOGP(DMSC, LOGL_NOTICE, "Filtering reset ack from the MSC\n");
} else if (rc == BSS_FILTER_RLSD) {
LOGP(DMSC, LOGL_DEBUG, "Filtering RLSD from the MSC\n");
- update_con_state(rc, &result, msg, 1, 0);
+ update_con_state(NULL, rc, &result, msg, 1, 0);
} else if (rc == BSS_FILTER_RLC) {
/* if we receive this we have forwarded a RLSD to the network */
LOGP(DMSC, LOGL_ERROR, "RLC from the network. BAD!\n");
@@ -216,7 +216,7 @@ static int ipaccess_a_fd_cb(struct bsc_fd *bfd)
} else if (link->sccp_up) {
unsigned int sls;
- update_con_state(rc, &result, msg, 1, 0);
+ update_con_state(NULL, rc, &result, msg, 1, 0);
sls = sls_for_src_ref(result.destination_local_reference);
/* Check for Location Update Accept */