[svn-commits] rmeyerriecks: branch linux/rmeyerriecks/dahdi-tools-maintmodes r8068 - /linux...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Feb 22 13:42:17 CST 2010


Author: rmeyerriecks
Date: Mon Feb 22 13:42:10 2010
New Revision: 8068

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=8068
Log:
minor formatting changes

Modified:
    linux/team/rmeyerriecks/dahdi-tools-maintmodes/dahdi_maint.c

Modified: linux/team/rmeyerriecks/dahdi-tools-maintmodes/dahdi_maint.c
URL: http://svnview.digium.com/svn/dahdi/linux/team/rmeyerriecks/dahdi-tools-maintmodes/dahdi_maint.c?view=diff&rev=8068&r1=8067&r2=8068
==============================================================================
--- linux/team/rmeyerriecks/dahdi-tools-maintmodes/dahdi_maint.c (original)
+++ linux/team/rmeyerriecks/dahdi-tools-maintmodes/dahdi_maint.c Mon Feb 22 13:42:10 2010
@@ -53,29 +53,35 @@
 	fprintf(stderr, "Options:\n");
 	fprintf(stderr, "        -h, --help		display help\n");
 	fprintf(stderr, "        -s, --span <span num>	specify the span\n");
-	fprintf(stderr, "        -j, --host <on|off>	turn on/off local host looopback\n");
-	fprintf(stderr, "        -l, --line <on|off>	turn on/off network line looopback\n");
-	fprintf(stderr, "        -p, --payload <on|off>	turn on/off network payload looopback\n");
-	fprintf(stderr, "        -i, --insert <fas|multi|crc|cas|prbs|bipolar>	insert an error of a specific type\n");
-	fprintf(stderr, "        -r, --reset		reset the error counters\n\n");
+	fprintf(stderr, "        -j, --host <on|off>	"\
+			"turn on/off local host looopback\n");
+	fprintf(stderr, "        -l, --line <on|off>	"\
+			"turn on/off network line looopback\n");
+	fprintf(stderr, "        -p, --payload <on|off>	"\
+			"turn on/off network payload looopback\n");
+	fprintf(stderr, "        -i, --insert <fas|multi|crc|cas|prbs|bipolar>"\
+			"  insert an error of a specific type\n");
+	fprintf(stderr, "        -r, --reset		"\
+			"reset the error counters\n\n");
 	fprintf(stderr, "Examples: \n");
-	fprintf(stderr, "Enable local host loopback (virtual loopback plug)\n");
+	fprintf(stderr, "Enable local host loopback(virtual loopback plug)\n");
 	fprintf(stderr, "	dahdi_maint -s 1 --local on\n");
-	fprintf(stderr, "Disable local host loopback (virtual loopback plug)\n");
+	fprintf(stderr, "Disable local host loopback(virtual loopback plug)\n");
 	fprintf(stderr, "	dahdi_maint -s 1 --local off\n\n");
 
 	exit(exitcode);
 }
 
-int main(int argc, char *argv[]) {
+int main(int argc, char *argv[])
+{
 	static int ctl = -1;
 	int res;
 
 	int localhostloopback = 0;
 	char *jarg = NULL;
-	int networklineloopback= 0;
+	int networklineloopback = 0;
 	char *larg = NULL;
-	int networkpayloadloopback= 0;
+	int networkpayloadloopback = 0;
 	char *parg = NULL;
 	int sflag = 0;
 	int span = 1;
@@ -88,8 +94,7 @@
 	struct dahdi_maintinfo m;
 	struct dahdi_spaninfo s;
 
-	static struct option long_options[] =
-	{
+	static struct option long_options[] = {
 		{"help",	no_argument,	   0, 'h'},
 		{"host",	required_argument, 0, 'j'},
 		{"line",	required_argument, 0, 'l'},
@@ -97,7 +102,7 @@
 		{"span",	required_argument, 0, 's'},
 		{"insert",	required_argument, 0, 'i'},
 		{"reset",	no_argument, 	   0, 'r'},
-		{0,0,0,0}
+		{0, 0, 0, 0}
 	};
 	int option_index = 0;
 
@@ -105,8 +110,9 @@
 		display_help(argv[0], 1);
 	}
 
-	while((c = getopt_long(argc, argv, "hj:l:p:s:i:g:r", long_options, &option_index)) != -1) {
-			switch(c) {
+	while ((c = getopt_long(argc, argv, "hj:l:p:s:i:g:r",
+				long_options, &option_index)) != -1) {
+			switch (c) {
 			case 'h': /* local host loopback */
 				display_help(argv[0], 0);
 				break;
@@ -140,14 +146,15 @@
 	}
 
 	ctl = open(DAHDI_CTL, O_RDWR);
-	if(ctl<0) {
+	if (ctl < 0) {
 		fprintf(stderr, "Unable to open %s\n", DAHDI_CTL);
 		return -1;
 	}
 
-	if(!(localhostloopback || networklineloopback || networkpayloadloopback || iflag || gflag || rflag)) {
+	if (!(localhostloopback || networklineloopback || networkpayloadloopback 
+				|| iflag || gflag || rflag)) {
 		s.spanno = span;
-		res = ioctl(ctl, DAHDI_SPANSTAT, &s);	
+		res = ioctl(ctl, DAHDI_SPANSTAT, &s);
 		printf("Span %d:\n", span);
 		printf(">FEC : %d:\n", s.count.fe);
 		printf(">CEC : %d:\n", s.count.crc4);
@@ -156,7 +163,7 @@
 		printf(">BEC : %d:\n", s.count.be);
 		printf(">PRBS: %d:\n", s.count.prbs);
 		printf(">GES : %d:\n", s.count.errsec);
-	
+
 		return 0;
 	}
 
@@ -228,7 +235,8 @@
 	}
 
 	if (gflag) {
-		printf("Enabled the Pseudo-Random Binary Sequence Generation and Monitor\n");
+		printf("Enabled the Pseudo-Random Binary Sequence Generation"\
+			" and Monitor\n");
 		m.command = DAHDI_MAINT_PRBS;
 		res = ioctl(ctl, DAHDI_MAINT, &m);
 	}




More information about the svn-commits mailing list