diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2011-02-10 15:32:14 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2011-02-10 20:09:09 +0100 |
commit | e86c02e107d9bef11a69ecef85d923ae4f523ef3 (patch) | |
tree | 7797afa28ff03963e8f84f254b9b91b311b89ad0 /src/bsc_sccp.c | |
parent | ee63d7d15e14ca0b653086043e7a6d1d537a89a1 (diff) |
bsc: Move the BSC<->MSC variables to a new struct.
Move the MSC related information out of the bsc_data and update
the code to use this BSC configuration. This is greatly cleaning
up the code and in theory there might now be two BSC and two MSCs
that one application can handle (minus the missing VTY config)
Diffstat (limited to 'src/bsc_sccp.c')
-rw-r--r-- | src/bsc_sccp.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/bsc_sccp.c b/src/bsc_sccp.c index ea13c43..f0bd600 100644 --- a/src/bsc_sccp.c +++ b/src/bsc_sccp.c @@ -28,9 +28,7 @@ #include <string.h> -extern struct bsc_data bsc; - -struct active_sccp_con *find_con_by_dest_ref(struct sccp_source_reference *ref) +struct active_sccp_con *find_con_by_dest_ref(struct bsc_msc_forward *fw, struct sccp_source_reference *ref) { struct active_sccp_con *con; @@ -39,7 +37,7 @@ struct active_sccp_con *find_con_by_dest_ref(struct sccp_source_reference *ref) return NULL; } - llist_for_each_entry(con, &bsc.sccp_connections, entry) { + llist_for_each_entry(con, &fw->sccp_connections, entry) { if (memcmp(&con->dst_ref, ref, sizeof(*ref)) == 0) return con; } @@ -49,7 +47,7 @@ struct active_sccp_con *find_con_by_dest_ref(struct sccp_source_reference *ref) } -struct active_sccp_con *find_con_by_src_ref(struct sccp_source_reference *src_ref) +struct active_sccp_con *find_con_by_src_ref(struct bsc_msc_forward *fw, struct sccp_source_reference *src_ref) { struct active_sccp_con *con; @@ -57,7 +55,7 @@ struct active_sccp_con *find_con_by_src_ref(struct sccp_source_reference *src_re if (!src_ref) return NULL; - llist_for_each_entry(con, &bsc.sccp_connections, entry) { + llist_for_each_entry(con, &fw->sccp_connections, entry) { if (memcmp(&con->src_ref, src_ref, sizeof(*src_ref)) == 0) return con; } @@ -65,12 +63,13 @@ struct active_sccp_con *find_con_by_src_ref(struct sccp_source_reference *src_re return NULL; } -struct active_sccp_con *find_con_by_src_dest_ref(struct sccp_source_reference *src_ref, +struct active_sccp_con *find_con_by_src_dest_ref(struct bsc_msc_forward *fw, + struct sccp_source_reference *src_ref, struct sccp_source_reference *dst_ref) { struct active_sccp_con *con; - llist_for_each_entry(con, &bsc.sccp_connections, entry) { + llist_for_each_entry(con, &fw->sccp_connections, entry) { if (memcmp(src_ref, &con->src_ref, sizeof(*src_ref)) == 0 && memcmp(dst_ref, &con->dst_ref, sizeof(*dst_ref)) == 0) { return con; @@ -80,11 +79,11 @@ struct active_sccp_con *find_con_by_src_dest_ref(struct sccp_source_reference *s return NULL; } -unsigned int sls_for_src_ref(struct sccp_source_reference *ref) +unsigned int sls_for_src_ref(struct bsc_msc_forward *fw, struct sccp_source_reference *ref) { struct active_sccp_con *con; - con = find_con_by_src_ref(ref); + con = find_con_by_src_ref(fw, ref); if (!con) return -1; return con->sls; |