[svn-commits] tzafrir: branch tools/tzafrir/sysfs r8613 - /tools/team/tzafrir/sysfs/xpp/
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Wed May 5 05:56:24 CDT 2010
Author: tzafrir
Date: Wed May 5 05:56:21 2010
New Revision: 8613
URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=8613
Log:
dahdi_spanmap: list location/type of spans
A simple utility to list information about spans.
Added:
tools/team/tzafrir/sysfs/xpp/dahdi_spanmap (with props)
Added: tools/team/tzafrir/sysfs/xpp/dahdi_spanmap
URL: http://svnview.digium.com/svn/dahdi/tools/team/tzafrir/sysfs/xpp/dahdi_spanmap?view=auto&rev=8613
==============================================================================
--- tools/team/tzafrir/sysfs/xpp/dahdi_spanmap (added)
+++ tools/team/tzafrir/sysfs/xpp/dahdi_spanmap Wed May 5 05:56:21 2010
@@ -1,0 +1,100 @@
+#! /usr/bin/perl -w
+#
+# Written by Oron Peled <oron at actcom.co.il>
+# Copyright (C) 2007, Xorcom
+# This program is free software; you can redistribute and/or
+# modify it under the same terms as Perl itself.
+#
+# $Id$
+#
+use strict;
+use File::Basename;
+use Getopt::Std;
+BEGIN { my $dir = dirname($0); unshift(@INC, "$dir", "$dir/perl_modules"); }
+
+use Dahdi;
+use Dahdi::Span;
+use Dahdi::Xpp;
+use Dahdi::Xpp::Xbus;
+use Dahdi::Hardware;
+use Dahdi::Xpp::Mpp;
+
+sub usage {
+ die "Usage: $0\n";
+}
+
+my %opts;
+getopts('', \%opts) || usage;
+ at ARGV == 0 or usage;
+
+my @devices = Dahdi::Hardware->device_list;
+my @spans = Dahdi::spans;
+
+my $format = "%-3s %-20s %-30s %-20s %-4s %s\n";
+
+printf $format, "#", "Name", "Location", "Hardware ID", "Port", "Type";
+foreach my $span (sort { $a->num <=> $b->num } @spans) {
+ printf $format,
+ (0+$span->num), $span->name, $span->location, $span->hardware_id,
+ $span->hardware_port, $span->spantype;
+}
+
+__END__
+
+=head1 NAME
+
+dahdi_spanmap - Shows Dahdi spans
+
+=head1 SYNOPSIS
+
+dahdi_spanmap
+
+=head1 DESCRIPTION
+
+I<dahdi_spanmap> presets a list of spans with extra information.
+
+The I<location> column shows a slightly cooked version of the span's
+I<location> field (most non-alpha-numeric characters converted to '_',
+'@' added at the beginning). This indicates how the device is connected
+
+I<Hardware ID> is the span's I<hardware_id> field. It should display the
+serial number or a similar unique identifier of the device contaning the
+span. Though currently most drivers don't provide it.
+
+I<Port> is an identifier of the port contaning this span in the device.
+
+The combination of (I<location>, I<port>) should be a unique identifier of
+the span. Likewise (I<hardware_id>, I<port>), if the I<hardware_id> is set.
+
+Example output:
+
+ # Name Location Hardware ID Port Type
+ 1 B4/0/1 @PCI_Bus_01_Slot_11 00 TE
+ 2 B4/0/2 @PCI_Bus_01_Slot_11 01 TE
+ 3 B4/0/3 @PCI_Bus_01_Slot_11 02 NT
+ 4 B4/0/4 @PCI_Bus_01_Slot_11 03 NT
+ 5 WCFXO/0 @PCI_Bus_01_Slot_10 00 <NULL>
+ 6 WCTDM/0 @PCI_Bus_01_Slot_12 00 <NULL>
+ 7 XBUS-01/XPD-00 @usb_0000:00:1d.7_4.1 usb:12345 00 BRI
+ 8 XBUS-01/XPD-01 @usb_0000:00:1d.7_4.1 usb:12345 01 BRI
+ 9 XBUS-01/XPD-02 @usb_0000:00:1d.7_4.1 usb:12345 02 BRI
+ 10 XBUS-01/XPD-03 @usb_0000:00:1d.7_4.1 usb:12345 03 BRI
+ 11 XBUS-01/XPD-04 @usb_0000:00:1d.7_4.1 usb:12345 04 BRI
+ 12 XBUS-01/XPD-05 @usb_0000:00:1d.7_4.1 usb:12345 05 BRI
+ 13 XBUS-01/XPD-06 @usb_0000:00:1d.7_4.1 usb:12345 06 BRI
+ 14 XBUS-01/XPD-07 @usb_0000:00:1d.7_4.1 usb:12345 07 BRI
+ 15 XBUS-01/XPD-10 @usb_0000:00:1d.7_4.1 usb:12345 10 FXS
+ 16 XBUS-01/XPD-20 @usb_0000:00:1d.7_4.1 usb:12345 20 FXS
+ 17 XBUS-01/XPD-30 @usb_0000:00:1d.7_4.1 usb:12345 30 FXS
+ 18 XBUS-00/XPD-00 @usb_0000:00:1d.7_4.3 usb:543210 00 FXS
+ 19 XBUS-00/XPD-10 @usb_0000:00:1d.7_4.3 usb:543210 10 FXO
+
+
+=head1 FILES
+
+The information is based on properties of the spans under
+F</sys/bus/astribanks/devices>.
+
+=head1 SEE ALSO
+
+lsdahdi(8), Dahdi::Span(3)
Propchange: tools/team/tzafrir/sysfs/xpp/dahdi_spanmap
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tools/team/tzafrir/sysfs/xpp/dahdi_spanmap
------------------------------------------------------------------------------
svn:executable = *
Propchange: tools/team/tzafrir/sysfs/xpp/dahdi_spanmap
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: tools/team/tzafrir/sysfs/xpp/dahdi_spanmap
------------------------------------------------------------------------------
svn:mime-type = text/plain
More information about the svn-commits
mailing list