[svn-commits] mattf: branch mattf/bug13495 r248 - /team/mattf/bug13495/
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Wed Dec 24 17:20:02 CST 2008
Author: mattf
Date: Wed Dec 24 17:20:01 2008
New Revision: 248
URL: http://svn.digium.com/view/libss7?view=rev&rev=248
Log:
Milestone reached. Able to forward messages to the given client properly with ISUP TCP masquerading
Modified:
team/mattf/bug13495/isup.c
team/mattf/bug13495/isup_masq.c
team/mattf/bug13495/mtp3.c
team/mattf/bug13495/ss7.c
Modified: team/mattf/bug13495/isup.c
URL: http://svn.digium.com/view/libss7/team/mattf/bug13495/isup.c?view=diff&rev=248&r1=247&r2=248
==============================================================================
--- team/mattf/bug13495/isup.c (original)
+++ team/mattf/bug13495/isup.c Wed Dec 24 17:20:01 2008
@@ -3160,8 +3160,6 @@
mh = (struct isup_h*) buf;
- len -= 3; /* ISUP msg header size !*/
-
if (ss7->switchtype == SS7_ITU) {
cic = mh->cic[0] | ((mh->cic[1] & 0x0f) << 8);
} else {
@@ -3171,6 +3169,8 @@
if (isup_needs_masquerade(ss7, rl, cic, buf, len))
return 0;
+ len -= 3; /* ISUP msg header size !*/
+
/* Find us in the message list */
for (x = 0; x < sizeof(messages)/sizeof(struct message_data); x++)
if (messages[x].messagetype == mh->type)
Modified: team/mattf/bug13495/isup_masq.c
URL: http://svn.digium.com/view/libss7/team/mattf/bug13495/isup_masq.c?view=diff&rev=248&r1=247&r2=248
==============================================================================
--- team/mattf/bug13495/isup_masq.c (original)
+++ team/mattf/bug13495/isup_masq.c Wed Dec 24 17:20:01 2008
@@ -49,10 +49,13 @@
ss7_message(link->master, "%c\n", prefix);
+#if 0
if (prefix == '<')
mtp3_dump(link->master, NULL, &msg[1], len - 1);
else
mtp3_dump(link->master, NULL, &msg[0], len);
+#endif
+ mtp3_dump(link->master, NULL, &msg[1], len - 1);
return 0;
}
@@ -254,7 +257,7 @@
if (masq_table->numentries >= ISUP_MASQ_MAX_ENTRIES)
return -1;
- i = masq_table->numentries;
+ i = masq_table->numentries++;
masq_table->routes[i].startcic = startcic;
masq_table->routes[i].endcic = endcic;
@@ -280,11 +283,11 @@
txbuf[0] = 5; /* ISUP MESSAGE */
txbuf[1] = (link->master->ni << 6) | SIG_ISUP;
- rlsize = set_routinglabel(&txbuf[1], rl);
-
- memcpy(&txbuf[rlsize], buf, len);
-
- isup_ip_send(link, txbuf, len);
+ rlsize = set_routinglabel(&txbuf[2], rl);
+
+ memcpy(&txbuf[2 + rlsize], buf, len);
+
+ isup_ip_send(link, txbuf, len + 2 + rlsize);
return 0;
}
Modified: team/mattf/bug13495/mtp3.c
URL: http://svn.digium.com/view/libss7/team/mattf/bug13495/mtp3.c?view=diff&rev=248&r1=247&r2=248
==============================================================================
--- team/mattf/bug13495/mtp3.c (original)
+++ team/mattf/bug13495/mtp3.c Wed Dec 24 17:20:01 2008
@@ -1822,12 +1822,15 @@
return std_test_receive(ss7, link, sif, siflen);
case SIG_ISUP:
/* Skip the routing label */
+#if 0
if (link->adj_sp->state == MTP3_UP)
return isup_receive(ss7, link, &rl, sif + rlsize, siflen - rlsize);
else {
ss7_error(ss7, "Got ISUP message on link while MTP3 state is not UP!\n");
return 0;
}
+#endif
+ return isup_receive(ss7, link, &rl, sif + rlsize, siflen - rlsize);
case SIG_NET_MNG:
return net_mng_receive(ss7, link, &rl, sif, siflen);
case SIG_SCCP:
Modified: team/mattf/bug13495/ss7.c
URL: http://svn.digium.com/view/libss7/team/mattf/bug13495/ss7.c?view=diff&rev=248&r1=247&r2=248
==============================================================================
--- team/mattf/bug13495/ss7.c (original)
+++ team/mattf/bug13495/ss7.c Wed Dec 24 17:20:01 2008
@@ -500,11 +500,14 @@
if (winner != -1) {
if (ss7->links[winner]->flags & MTP2_FLAG_TCP) {
res = isup_ip_receive(ss7->links[winner]);
+ goto exit;
} else {
res = mtp2_receive(ss7->links[winner]);
- }
-
- }
+ goto exit;
+ }
+
+ }
+
/* Maybe it's a lite link */
for (i = 0; i < ss7->numslavelinks; i++) {
@@ -517,6 +520,8 @@
if (winner != -1) {
res = isup_ip_receive(ss7->links[winner]);
}
+
+exit:
return res;
More information about the svn-commits
mailing list