[svn-commits] mattf: trunk r130 - in /trunk: libss7.h ss7.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Nov 6 13:19:56 CST 2007


Author: mattf
Date: Tue Nov  6 13:19:56 2007
New Revision: 130

URL: http://svn.digium.com/view/libss7?view=rev&rev=130
Log:
Add a new transport option for eventual SS7 over IP support

Modified:
    trunk/libss7.h
    trunk/ss7.c

Modified: trunk/libss7.h
URL: http://svn.digium.com/view/libss7/trunk/libss7.h?view=diff&rev=130&r1=129&r2=130
==============================================================================
--- trunk/libss7.h (original)
+++ trunk/libss7.h Tue Nov  6 13:19:56 2007
@@ -92,6 +92,10 @@
 #define CPG_EVENT_CFNR		0x05
 #define CPG_EVENT_CFU		0x06
 
+/* SS7 transport types */
+#define SS7_TRANSPORT_ZAP	0
+#define SS7_TRANSPORT_TCP	1
+
 struct ss7;
 struct isup_call;
 
@@ -214,7 +218,7 @@
 
 struct timeval *ss7_schedule_next(struct ss7 *ss7);
 
-int ss7_add_link(struct ss7 *ss7, int fd);
+int ss7_add_link(struct ss7 *ss7, int transport, int fd);
 
 int ss7_set_adjpc(struct ss7 *ss7, int fd, unsigned int pc);
 

Modified: trunk/ss7.c
URL: http://svn.digium.com/view/libss7/trunk/ss7.c?view=diff&rev=130&r1=129&r2=130
==============================================================================
--- trunk/ss7.c (original)
+++ trunk/ss7.c Tue Nov  6 13:19:56 2007
@@ -161,23 +161,29 @@
 	mtp3_noalarm(ss7, fd);
 }
 
-int ss7_add_link(struct ss7 *ss7, int fd)
+int ss7_add_link(struct ss7 *ss7, int transport, int fd)
 {
 	struct mtp2 *m;
 
 	if (ss7->numlinks >= SS7_MAX_LINKS)
 		return -1;
 
-	m = mtp2_new(fd, ss7->switchtype);
-	
-	if (!m)
-		return -1;
-
-	m->slc = ss7->numlinks;
-	ss7->numlinks += 1;
-	m->master = ss7;
-
-	ss7->links[ss7->numlinks - 1] = m;
+	if (transport == SS7_TRANSPORT_ZAP) {
+		m = mtp2_new(fd, ss7->switchtype);
+		
+		if (!m)
+			return -1;
+
+		m->slc = ss7->numlinks;
+		ss7->numlinks += 1;
+		m->master = ss7;
+
+		ss7->links[ss7->numlinks - 1] = m;
+	}
+
+	if (transport == SS7_TRANSPORT_TCP) {
+		/* TODO */
+	}
 
 	return 0;
 }




More information about the svn-commits mailing list