[libss7-commits] mattf: trunk r114 - /trunk/parser_debug.c

SVN commits to the libss7 project libss7-commits at lists.digium.com
Fri Oct 5 16:24:07 CDT 2007


Author: mattf
Date: Fri Oct  5 16:24:07 2007
New Revision: 114

URL: http://svn.digium.com/view/libss7?view=rev&rev=114
Log:
Make it easier to switch ss7 types

Modified:
    trunk/parser_debug.c

Modified: trunk/parser_debug.c
URL: http://svn.digium.com/view/libss7/trunk/parser_debug.c?view=diff&rev=114&r1=113&r2=114
==============================================================================
--- trunk/parser_debug.c (original)
+++ trunk/parser_debug.c Fri Oct  5 16:24:07 2007
@@ -1,4 +1,5 @@
 #include <stdio.h>
+#include <string.h>
 #include "libss7.h"
 #include "ss7_internal.h"
 #include "mtp2.h"
@@ -8,16 +9,26 @@
 int main(int argc, char **argv)
 {
 	FILE *fp;
-	struct ss7 *ss7 = ss7_new(SS7_ANSI);
+	struct ss7 *ss7;
 	unsigned char mybuf[512];
 	unsigned int tmp;
+	int ss7type;
 	int res = 0, i = 0, size;
 	ss7_event *e;
 
-	if (argc != 2)
+	if (argc != 3)
 		return -1;
 
-	fp = fopen(argv[1], "r");
+	if (!strcasecmp(argv[1], "ansi"))
+		ss7type = SS7_ANSI;
+	else if (!strcasecmp(argv[1], "itu"))
+		ss7type = SS7_ITU;
+	else
+		return -1;
+
+	ss7 = ss7_new(ss7type);
+
+	fp = fopen(argv[2], "r");
 
 	while (res != EOF) {
 		res = fscanf(fp, "%x ", &tmp);




More information about the libss7-commits mailing list