[svn-commits] mattf: trunk r148 - in /trunk: isup.c isup.h mtp3.c mtp3.h ss7_internal.h

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Mar 21 16:21:58 CDT 2008


Author: mattf
Date: Fri Mar 21 16:21:57 2008
New Revision: 148

URL: http://svn.digium.com/view/libss7?view=rev&rev=148
Log:
Some rearrangement for getting the SLS right for ANSI

Modified:
    trunk/isup.c
    trunk/isup.h
    trunk/mtp3.c
    trunk/mtp3.h
    trunk/ss7_internal.h

Modified: trunk/isup.c
URL: http://svn.digium.com/view/libss7/trunk/isup.c?view=diff&rev=148&r1=147&r2=148
==============================================================================
--- trunk/isup.c (original)
+++ trunk/isup.c Fri Mar 21 16:21:57 2008
@@ -2033,13 +2033,13 @@
 	c->dpc = dpc;
 }
 
-static struct isup_call * isup_find_call(struct ss7 *ss7, unsigned int opc, int cic)
+static struct isup_call * isup_find_call(struct ss7 *ss7, struct routing_label *rl, int cic)
 {
 	struct isup_call *cur, *winner = NULL;
 
 	cur = ss7->calls;
 	while (cur) {
-		if ((cur->cic == cic) && (cur->dpc == opc)) {
+		if ((cur->cic == cic) && (cur->dpc == rl->opc)) {
 			winner = cur;
 			break;
 		}
@@ -2049,7 +2049,8 @@
 	if (!winner) {
 		winner = __isup_new_call(ss7, 0);
 		winner->cic = cic;
-		winner->dpc = opc;
+		winner->dpc = rl->opc;
+		winner->sls = rl->sls;
 	}
 
 	return winner;
@@ -2443,7 +2444,7 @@
 	return 0;
 }
 
-int isup_receive(struct ss7 *ss7, struct mtp2 *link, unsigned int opc, unsigned char *buf, int len)
+int isup_receive(struct ss7 *ss7, struct mtp2 *link, struct routing_label *rl, unsigned char *buf, int len)
 {
 	unsigned short cic;
 	struct isup_h *mh;
@@ -2455,6 +2456,7 @@
 	int fixedparams = 0, varparams = 0, optparams = 0;
 	int res, x;
 	unsigned char *opt_ptr = NULL;
+	unsigned int opc = rl->opc;
 	ss7_event *e;
 
 
@@ -2508,11 +2510,11 @@
 		case ISUP_LPA:
 		case ISUP_CCR:
 			c = __isup_new_call(ss7, 1);
-			c->dpc = opc;
+			c->dpc = rl->opc;
 			c->cic = cic;
 			break;
 		default:
-			c = isup_find_call(ss7, opc, cic);
+			c = isup_find_call(ss7, rl, cic);
 	}
 
 	if (!c) {

Modified: trunk/isup.h
URL: http://svn.digium.com/view/libss7/trunk/isup.h?view=diff&rev=148&r1=147&r2=148
==============================================================================
--- trunk/isup.h (original)
+++ trunk/isup.h Fri Mar 21 16:21:57 2008
@@ -14,6 +14,8 @@
 */
 #ifndef _SS7_ISUP_H
 #define _SS7_ISUP_H
+
+#include "ss7_internal.h"
 
 /* ISUP messages */
 #define ISUP_IAM	0x01
@@ -179,13 +181,13 @@
 	int cicgroupsupervisiontype;
 	unsigned char event_info;
 	unsigned short cic;
-	unsigned short slc;
+	unsigned short sls;
 	struct isup_call *next;
 	/* set DPC according to CIC's DPC, not linkset */
 	unsigned int dpc;
 };
 
-int isup_receive(struct ss7 *ss7, struct mtp2 *sl, unsigned int opc, unsigned char *sif, int len);
+int isup_receive(struct ss7 *ss7, struct mtp2 *sl, struct routing_label *rl, unsigned char *sif, int len);
 
 int isup_dump(struct ss7 *ss7, struct mtp2 *sl, unsigned char *sif, int len);
 #endif /* _SS7_ISUP_H */

Modified: trunk/mtp3.c
URL: http://svn.digium.com/view/libss7/trunk/mtp3.c?view=diff&rev=148&r1=147&r2=148
==============================================================================
--- trunk/mtp3.c (original)
+++ trunk/mtp3.c Fri Mar 21 16:21:57 2008
@@ -528,7 +528,7 @@
 			return std_test_receive(ss7, link, sif, siflen);
 		case SIG_ISUP:
 			/* Skip the routing label */
-			return isup_receive(ss7, link, rl.opc, sif + rlsize, siflen - rlsize);
+			return isup_receive(ss7, link, &rl, sif + rlsize, siflen - rlsize);
 		case SIG_NET_MNG:
 			return net_mng_receive(ss7, link, sif, siflen);
 		case SIG_SCCP:

Modified: trunk/mtp3.h
URL: http://svn.digium.com/view/libss7/trunk/mtp3.h?view=diff&rev=148&r1=147&r2=148
==============================================================================
--- trunk/mtp3.h (original)
+++ trunk/mtp3.h Fri Mar 21 16:21:57 2008
@@ -13,6 +13,8 @@
 */
 #ifndef _MTP3_H
 #define _MTP3_H
+
+#include "ss7_internal.h"
 
 /* Service Indicator bits for Service Information Octet */
 /* Bits 4-1 */
@@ -33,15 +35,6 @@
 #define MTP2_LINKSTATE_INALARM	1
 #define MTP2_LINKSTATE_ALIGNING	2
 #define MTP2_LINKSTATE_UP	3
-
-typedef unsigned int point_code;
-
-struct routing_label {
-	unsigned int type;
-	point_code dpc;
-	point_code opc;
-	unsigned char sls;
-};
 
 struct net_mng_message {
 	int h0;

Modified: trunk/ss7_internal.h
URL: http://svn.digium.com/view/libss7/trunk/ss7_internal.h?view=diff&rev=148&r1=147&r2=148
==============================================================================
--- trunk/ss7_internal.h (original)
+++ trunk/ss7_internal.h Fri Mar 21 16:21:57 2008
@@ -17,8 +17,8 @@
 #include <sys/time.h>
 #include <stdio.h>
 #include "libss7.h"
-#include "mtp2.h"
-#include "mtp3.h"
+/* #include "mtp2.h" */
+/* #include "mtp3.h" */
 
 /* ISUP parameters */
 
@@ -39,8 +39,17 @@
 #define SS7_STATE_DOWN	0
 #define SS7_STATE_UP 1
 
+typedef unsigned int point_code;
+
+struct routing_label {
+	unsigned int type;
+	point_code dpc;
+	point_code opc;
+	unsigned char sls;
+};
+
 struct ss7_msg {
-	unsigned char buf[MTP_MAX_SIZE];
+	unsigned char buf[512];
 	unsigned int size;
 	struct ss7_msg *next;
 };




More information about the svn-commits mailing list