aboutsummaryrefslogtreecommitdiffstats
path: root/src/main_stp.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-01-17 15:53:06 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2011-01-20 11:37:50 +0100
commit9cf11bc1098671e06c7284babfa5a3327a40346e (patch)
tree5dbcf3375fa5f565b83d726c90d361c20b785fbe /src/main_stp.c
parenta93b83bf9979f5a9e0a5591436f419eed744445c (diff)
stp: Create a M2UA link by hand and connect the SCCP routines
This is a hacked version that will just forward SCCP from one linkset to another one. It is missing configuration and ISUP.
Diffstat (limited to 'src/main_stp.c')
-rw-r--r--src/main_stp.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/main_stp.c b/src/main_stp.c
index 568a4a6..c038b2b 100644
--- a/src/main_stp.c
+++ b/src/main_stp.c
@@ -27,6 +27,7 @@
#include <bsc_data.h>
#include <snmp_mtp.h>
#include <cellmgr_debug.h>
+#include <sctp_m2ua.h>
#include <osmocore/talloc.h>
@@ -68,6 +69,10 @@ extern void cell_vty_init(void);
*/
void mtp_link_set_forward_sccp(struct mtp_link_set *link, struct msgb *_msg, int sls)
{
+ struct mtp_link_set *target;
+
+ target = bsc.m2ua_set == link ? bsc.link_set : bsc.m2ua_set;
+ mtp_link_set_submit_sccp_data(target, sls, _msg->l2h, msgb_l2len(_msg));
}
void mtp_linkset_down(struct mtp_link_set *set)
@@ -167,6 +172,8 @@ static void handle_options(int argc, char **argv)
int main(int argc, char **argv)
{
int rc;
+ struct mtp_link *data;
+ struct mtp_m2ua_link *lnk;
INIT_LLIST_HEAD(&bsc.sccp_connections);
bsc.dpc = 1;
@@ -224,6 +231,21 @@ int main(int argc, char **argv)
if (link_init(&bsc) != 0)
return -1;
+ bsc.m2ua_set = mtp_link_set_alloc();
+ bsc.m2ua_set->dpc = 92;
+ bsc.m2ua_set->opc = 9;
+ bsc.m2ua_set->sccp_opc = 9;
+ bsc.m2ua_set->ni = 3;
+ bsc.m2ua_set->bsc = &bsc;
+
+ lnk = sctp_m2ua_transp_create("0.0.0.0", 2904);
+ lnk->base.pcap_fd = -1;
+ lnk->base.the_link = bsc.m2ua_set;
+ mtp_link_set_add_link(bsc.m2ua_set, (struct mtp_link *) lnk);
+
+ llist_for_each_entry(data, &bsc.m2ua_set->links, entry)
+ data->start(data);
+
while (1) {
bsc_select_main(0);
}