[libss7-commits] mattf: trunk r46 - /trunk/mtp3.c

libss7-commits at lists.digium.com libss7-commits at lists.digium.com
Mon Sep 11 10:48:56 MST 2006


Author: mattf
Date: Mon Sep 11 12:48:55 2006
New Revision: 46

URL: http://svn.digium.com/view/libss7?rev=46&view=rev
Log:
Add a little more useful output if the network indiciator is set incorrectly.

Modified:
    trunk/mtp3.c

Modified: trunk/mtp3.c
URL: http://svn.digium.com/view/libss7/trunk/mtp3.c?rev=46&r1=45&r2=46&view=diff
==============================================================================
--- trunk/mtp3.c (original)
+++ trunk/mtp3.c Mon Sep 11 12:48:55 2006
@@ -29,6 +29,22 @@
 			return "SCCP";
 		case SIG_ISUP:
 			return "ISUP";
+		default:
+			return "Unknown";
+	}
+}
+
+static char * ss7_ni2str(unsigned char ni)
+{
+	switch (ni) {
+		case SS7_NI_INT:
+			return "international";
+		case SS7_NI_INT_SPARE:
+			return "international_spare";
+		case SS7_NI_NAT:
+			return "national";
+		case SS7_NI_NAT_SPARE:
+			return "national_spare";
 		default:
 			return "Unknown";
 	}
@@ -366,10 +382,9 @@
 	struct routing_label rl;
 	int rlsize;
 
-
 	/* Check NI to make sure it's set correct */
 	if (ss7->ni != ni) {
-		mtp_error(ss7, "Received MSU with network indicator of %d, but we are %d\n", ni, ss7->ni);
+		mtp_error(ss7, "Received MSU with network indicator of %s, but we are %s\n", ss7_ni2str(ni), ss7_ni2str(ss7->ni));
 		return -1;
 	}
 



More information about the libss7-commits mailing list