[dahdi-commits] rmeyerriecks: branch linux/rmeyerriecks/dahdi-tools-maintmodes r7555 - /linux...
SVN commits to the DAHDI project
dahdi-commits at lists.digium.com
Tue Nov 10 11:57:15 CST 2009
Author: rmeyerriecks
Date: Tue Nov 10 11:57:09 2009
New Revision: 7555
URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=7555
Log:
New feature for clearing all error counters
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=7555&r1=7554&r2=7555
==============================================================================
--- linux/team/rmeyerriecks/dahdi-tools-maintmodes/dahdi_maint.c (original)
+++ linux/team/rmeyerriecks/dahdi-tools-maintmodes/dahdi_maint.c Tue Nov 10 11:57:09 2009
@@ -47,18 +47,20 @@
char *darg = NULL;
int gflag = 0;
int c;
+ int rflag = 0;
struct dahdi_maintinfo m;
struct dahdi_spaninfo s;
static struct option long_options[] =
{
- {"help", no_argument, 0, 'h'},
- {"host", required_argument, 0, 'j'},
- {"line", required_argument, 0, 'l'},
- {"payload", required_argument, 0, 'p'},
- {"span", required_argument, 0, 's'},
- {"insert", required_argument, 0, 'd'},
+ {"help", no_argument, 0, 'h'},
+ {"host", required_argument, 0, 'j'},
+ {"line", required_argument, 0, 'l'},
+ {"payload", required_argument, 0, 'p'},
+ {"span", required_argument, 0, 's'},
+ {"insert", required_argument, 0, 'i'},
+ {"reset", no_argument, 0, 'r'},
{0,0,0,0}
};
int option_index = 0;
@@ -68,7 +70,7 @@
exit(1);
}
- while((c = getopt_long(argc, argv, "hj:l:p:s:i:g", long_options, &option_index)) != -1) {
+ 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();
@@ -97,6 +99,9 @@
case 'g': /* generate psuedo random sequence */
gflag = 1;
break;
+ case 'r': /* reset the error counters */
+ rflag = 1;
+ break;
}
}
@@ -106,7 +111,7 @@
return -1;
}
- if(!(localhostloopback || networklineloopback || networkpayloadloopback || gflag)) {
+ if(!(localhostloopback || networklineloopback || networkpayloadloopback || iflag || gflag || rflag)) {
s.spanno = span;
res = ioctl(ctl, DAHDI_SPANSTAT, &s);
printf("Span %d:\n", span);
@@ -197,5 +202,11 @@
res = ioctl(ctl, DAHDI_MAINT, &m);
}
+ if(rflag) {
+ printf("Resetting error counters for span %d\n", span);
+ m.command = DAHDI_RESET_COUNTERS;
+ res = ioctl(ctl, DAHDI_MAINT, &m);
+ }
+
return 0;
}
More information about the dahdi-commits
mailing list