All pastes #1218178 Raw Edit

clueless

public text v1 · immutable
#1218178 ·published 2008-10-03 16:57 UTC
rendered paste body
Index: doc/dahdi_scan.8===================================================================--- doc/dahdi_scan.8	(revision 5037)+++ doc/dahdi_scan.8	(working copy)@@ -24,11 +24,11 @@ .SH EXAMPLES Printing information for spans 1, 2 and 4: -  dahdi_span 1 2 4+  dahdi_scan 1 2 4  And to print all the spans: -  dahdi_span+  dahdi_scan  Information about a certain analog span: Index: dahdi_scan.c===================================================================--- dahdi_scan.c	(revision 5037)+++ dahdi_scan.c	(working copy)@@ -40,19 +40,40 @@ int main(int argc, char *argv[]) { 	int ctl;-	int x, y;+	int x, y, z; 	struct dahdi_params params; 	unsigned int basechan = 1; 	struct dahdi_spaninfo s; 	char buf[100]; 	char alarms[50];+	int filter_count = 0;+	int span_filter[DAHDI_MAX_SPANS];  	if ((ctl = open("/dev/dahdi/ctl", O_RDWR)) < 0) { 		fprintf(stderr, "Unable to open /dev/dahdi/ctl: %s\n", strerror(errno)); 		exit(1); 	}++	for (x = 1; x < argc; x++) {+		int s = atoi(argv[x]);+		if (s > 0) {+			span_filter[filter_count++] = s;+		}+	} 	 	for (x = 1; x < DAHDI_MAX_SPANS; x++) {+		if (filter_count > 0) {+			int match = 0;+			for (z = 0; z < filter_count; z++) {+				if (x == span_filter[z]) {+					match = 1;+					break;+				}+			}+			if (!match) {+				continue;+			}+		} 		memset(&s, 0, sizeof(s)); 		s.spanno = x; 		if (ioctl(ctl, DAHDI_SPANSTAT, &s))