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

svn-commits at lists.digium.com svn-commits at lists.digium.com
Mon Oct 30 10:15:19 MST 2006


Author: mattf
Date: Mon Oct 30 11:15:19 2006
New Revision: 60

URL: http://svn.digium.com/view/libss7?rev=60&view=rev
Log:
More MTP3 debug information

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

Modified: trunk/isup.c
URL: http://svn.digium.com/view/libss7/trunk/isup.c?rev=60&r1=59&r2=60&view=diff
==============================================================================
--- trunk/isup.c (original)
+++ trunk/isup.c Mon Oct 30 11:15:19 2006
@@ -272,7 +272,7 @@
 	unsigned char con = parm[0];
 	char *continuity;
 	
-	ss7_message(ss7, "	Satellites in connection: %d\n", con&0x03);
+	ss7_message(ss7, "\tSatellites in connection: %d\n", con&0x03);
 	con>>=2; 
 	switch (con & 0x03) {
 		case 0:
@@ -288,11 +288,11 @@
 			continuity = "spare";
 			break;
 	}
-	ss7_message(ss7, "	Continuity Check: %s\n", continuity);
+	ss7_message(ss7, "\tContinuity Check: %s\n", continuity);
 	con>>=2;
 	con &= 0x01;
 
-	ss7_message(ss7, "	Outgoing half echo control device %s\n", con ? "included" : "not included");
+	ss7_message(ss7, "\tOutgoing half echo control device %s\n", con ? "included" : "not included");
 
 	return 2;
 }
@@ -436,7 +436,7 @@
 static FUNC_DUMP(range_and_status_dump)
 {
 	ss7_message(ss7, "\tPARM: Range and Status\n");
-	ss7_message(ss7, "\t	Range: %d\n", parm[0] & 0xff);
+	ss7_message(ss7, "\t\tRange: %d\n", parm[0] & 0xff);
 	return len;
 }
 

Modified: trunk/mtp3.c
URL: http://svn.digium.com/view/libss7/trunk/mtp3.c?rev=60&r1=59&r2=60&view=diff
==============================================================================
--- trunk/mtp3.c (original)
+++ trunk/mtp3.c Mon Oct 30 11:15:19 2006
@@ -158,6 +158,54 @@
 	return ss7->links[sls % ss7->numlinks];
 }
 
+struct net_mng_message net_mng_messages[] = {
+	{ 1, 1, "COO"},
+	{ 1, 2, "COA"},
+	{ 1, 5, "CBD"},
+	{ 1, 6, "CBA"},
+	{ 2, 1, "ECO"},
+	{ 2, 2, "ECA"},
+	{ 3, 1, "RCT"},
+	{ 3, 2, "TFC"},
+	{ 4, 1, "TFP"},
+	{ 4, 2, "TCP"},
+	{ 4, 3, "TFR"},
+	{ 4, 4, "TCR"},
+	{ 4, 5, "TFA"},
+	{ 4, 6, "TCA"},
+	{ 5, 1, "RST/RSP"},
+	{ 5, 2, "RSR"},
+	{ 5, 3, "RCP"},
+	{ 5, 4, "RCR"},
+	{ 6, 1, "LIN"},
+	{ 6, 2, "LUN"},
+	{ 6, 3, "LIA"},
+	{ 6, 4, "LUA"},
+	{ 6, 5, "LID"},
+	{ 6, 6, "LFU"},
+	{ 6, 7, "LLT/LLI"},
+	{ 6, 8, "LRT/LRI"},
+	{ 7, 1, "TRA"},
+	{ 7, 2, "TRW"},
+	{ 8, 1, "DLC"},
+	{ 8, 2, "CSS"},
+	{ 8, 3, "CNS"},
+	{ 8, 4, "CNP"},
+	{ 0xa, 1, "UPU"},
+};
+
+static char * net_mng_message2str(int h0, int h1)
+{
+	int i;
+
+	for (i = 0; i < (sizeof(net_mng_messages) / sizeof(struct net_mng_message)); i++) {
+		if ((net_mng_messages[i].h0 == h0) && (net_mng_messages[i].h1 == h1))
+			return net_mng_messages[i].name;
+	}
+
+	return "Unknown";
+}
+
 static int net_mng_dump(struct ss7 *ss7, struct mtp2 *mtp2, unsigned char *buf, int len)
 {
 	unsigned char *headerptr = buf + rl_size(ss7);
@@ -169,6 +217,7 @@
 	h0 = get_h0(headerptr);
 
 	ss7_message(ss7, "\tH0: %x H1: %x\n", h0, h1);
+	ss7_message(ss7, "\tMessage type: %s\n", net_mng_message2str(h0, h1));
 	return 0;
 }
 
@@ -227,8 +276,8 @@
 		e->e = SS7_EVENT_UP;
 		return 0;
 	} else {
-		ss7_error(ss7, "!! Unable to handle SIG_NET_MNG message with H1 = %d and H0 = %d\n", h1, h0);
-		return -1;
+		ss7_message(ss7, "NET MNG message type %s received\n", net_mng_message2str(h0, h1));
+		return 0;
 	}
 }
 

Modified: trunk/mtp3.h
URL: http://svn.digium.com/view/libss7/trunk/mtp3.h?rev=60&r1=59&r2=60&view=diff
==============================================================================
--- trunk/mtp3.h (original)
+++ trunk/mtp3.h Mon Oct 30 11:15:19 2006
@@ -38,6 +38,12 @@
 	unsigned char sls;
 };
 
+struct net_mng_message {
+	int h0;
+	int h1;
+	char *name;
+};
+
 /* Process any MTP2 events that occur */
 ss7_event* mtp3_process_event(struct ss7 *ss7, ss7_event *e);
 



More information about the svn-commits mailing list