Browse Source

Terminology rename: "pinned" -> "assigned"

* File names fixed
* File contents fixed

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>
master
Oron Peled 8 years ago
committed by Tzafrir Cohen
parent
commit
2a84216fe4
  1. 12
      Makefile
  2. 2
      assigned-spans.conf.sample
  3. 18
      doc/span_assignments.8
  4. 2
      handle_device
  5. 18
      span_assignments
  6. 2
      xpp/dahdi_genconf
  7. 10
      xpp/dahdi_registration
  8. 8
      xpp/perl_modules/Dahdi/Config/Gen/Assignedspans.pm

12
Makefile

@ -105,9 +105,9 @@ ifeq (1,$(PBX_HDLC))
endif
MAN_PAGES:=$(wildcard $(BINS:%=doc/%.8))
PINNED_DATA_SCRIPTS:=handle_device span_config
PINNED_UTILS:=span_assignments span_types
PINNED_CONF:=pinned-spans.conf.sample span-types.conf.sample
ASSIGNED_DATA_SCRIPTS:=handle_device span_config
ASSIGNED_UTILS:=span_assignments span_types
ASSIGNED_CONF:=assigned-spans.conf.sample span-types.conf.sample
TEST_BINS:=patgen pattest patlooptest hdlcstress hdlctest hdlcgen hdlcverify timertest dahdi_maint
# All the man pages. Not just installed ones:
@ -228,9 +228,9 @@ ifeq (,$(wildcard $(DESTDIR)$(CONFIG_FILE)))
$(INSTALL) -m 644 system.conf.sample $(DESTDIR)$(CONFIG_FILE)
endif
install -d $(DESTDIR)$(DATA_DIR)
install $(PINNED_DATA_SCRIPTS) $(DESTDIR)$(DATA_DIR)/
install $(PINNED_UTILS) $(DESTDIR)/$(BIN_DIR)/
install -m 644 $(PINNED_CONF) $(DESTDIR)/$(CONFIG_DIR)/
install $(ASSIGNED_DATA_SCRIPTS) $(DESTDIR)$(DATA_DIR)/
install $(ASSIGNED_UTILS) $(DESTDIR)/$(BIN_DIR)/
install -m 644 $(ASSIGNED_CONF) $(DESTDIR)/$(CONFIG_DIR)/
install-libs: libs
$(INSTALL) -d -m 755 $(DESTDIR)/$(LIB_DIR)

2
pinned-spans.conf.sample → assigned-spans.conf.sample

@ -1,5 +1,5 @@
#
# /etc/dahdi/pinned-spans.conf:
# /etc/dahdi/assigned-spans.conf:
#
# This file assigns span and channel numbers to dahdi devices
#

18
doc/span_assignments.8

@ -26,7 +26,7 @@ order.
.B span_assignments
is used to register those spans or to help creating the configuration
file used in their registration:
.B /etc/dahdi/pinned-spans.conf .
.B /etc/dahdi/assigned-spans.conf .
.SH OPTIONS
@ -36,7 +36,7 @@ There are several sub-commands:
.RS
Parameters are paths (in SysFS) to DAHDI devices with unregistered
spans. The command will register with DAHDI according to according to
configuration in \fBpinned-spans.conf\fR.
configuration in \fBassigned-spans.conf\fR.
.RE
.B remove \fIdevpath \fB[\fIdevpath \fB...]
@ -60,10 +60,10 @@ List all spans in the system.
.B dumpconfig
.RS
List all registered spans in the system in a format fit to be used in
\fBpinned-spans.conf\fR. Use this to generate a configuration file after
\fBassigned-spans.conf\fR. Use this to generate a configuration file after
you have (perhaps manually) registered all existing spans.
.B dahdi_genconf pinnedspans
.B dahdi_genconf assignedspans
uses this command internally.
.RE
@ -102,7 +102,7 @@ Path in SysFS to the device node.
.RE
.SH CONFIGURATOIN
.B pinned-spans.conf
.B assigned-spans.conf
is a file with lines specifying registration of spans.
Empty lines or lines beginning with '#' are ignored.
@ -168,13 +168,13 @@ space must be available.
.B DAHDICONFDIR
.RS
The directory in which pinned-spans.conf resides. /etc/dahdi if not
The directory in which assigned-spans.conf resides. /etc/dahdi if not
overridden from the environment.
.RE
.B pinned_spans_conf
.B assigned_spans_conf
.RS
The path to pinned-spans.conf resides. /etc/dahdi/pinned-spans.conf if
The path to assigned-spans.conf resides. /etc/dahdi/assigned-spans.conf if
not overridden from the environment.
.RE
@ -187,7 +187,7 @@ environment.
.SH FILES
.B /etc/dahdi/pinned-spans.conf
.B /etc/dahdi/assigned-spans.conf
.RS
The default location for the configuration file.
.RE

2
handle_device

@ -62,7 +62,7 @@ add)
if [ -r "$DAHDICONFDIR/span-types.conf" ]; then
span_types set "/sys$DEVPATH"
fi
if [ -r "$DAHDICONFDIR/pinned-spans.conf" ]; then
if [ -r "$DAHDICONFDIR/assigned-spans.conf" ]; then
span_assignments add "/sys$DEVPATH"
else
# No configuration. No order guaranteed

18
span_assignments

@ -6,17 +6,17 @@
# from the command line to assign/unassign and list
# current span assignments.
#
# It uses a configuration file: $DAHDICONFDIR/pinned-spans.conf
# It uses a configuration file: $DAHDICONFDIR/assigned-spans.conf
# (default DAHDICONFDIR=/etc/dahdi)
#
# The first argument is an action:
# "auto" - trigger driver auto_assign attribute for given devices
# (no configuration file is used)
# "add" - assign (spans which are not already assigned), according
# to /etc/dahdi/pinned-spans.conf configuration file
# to /etc/dahdi/assigned-spans.conf configuration file
# "remove" - unassign spans which are not already unassigned
# "list" - human-readable list of all spans (with/without assignments)
# "dumpconfig" - dump current assignments in a /etc/dahdi/pinned-spans.conf
# "dumpconfig" - dump current assignments in a /etc/dahdi/assigned-spans.conf
# compatible format
#
# Without further arguments, it operates on all existing spans
@ -54,7 +54,7 @@
devbase='/sys/bus/dahdi_devices/devices'
DAHDICONFDIR="${DAHDICONFDIR:-/etc/dahdi}"
pinned_spans_conf="$DAHDICONFDIR/pinned-spans.conf"
assigned_spans_conf="$DAHDICONFDIR/assigned-spans.conf"
SPAN_ASSIGNMENTS_KEY=${SPAN_ASSIGNMENTS_KEY:-hwid}
dry_run=
verbose=
@ -63,7 +63,7 @@ usage() {
echo >&2 "Usage: $0 [options] action [devpath ...]"
echo >&2 " action:"
echo >&2 " auto - trigger driver auto_assign attribute for given devices"
echo >&2 " add - assign spans, according to /etc/dahdi/pinned-spans.conf"
echo >&2 " add - assign spans, according to /etc/dahdi/assigned-spans.conf"
echo >&2 " remove - unassign spans"
echo >&2 " list - human-readable list of all spans"
echo >&2 " dumpconfig - dump current state as new configuration"
@ -228,7 +228,7 @@ unassign_all_spans() {
# Allow comments and empty lines in config file
filter_conf() {
sed -e 's/#.*//' -e '/^[ \t]*$/d' "$pinned_spans_conf"
sed -e 's/#.*//' -e '/^[ \t]*$/d' "$assigned_spans_conf"
}
assign_device_spans() {
@ -289,11 +289,11 @@ match_device() {
}
assign_devices() {
if [ ! -f "$pinned_spans_conf" ]; then
echo >&2 "$0: Missing '$pinned_spans_conf'"
if [ ! -f "$assigned_spans_conf" ]; then
echo >&2 "$0: Missing '$assigned_spans_conf'"
exit 1
fi
echo "using '$pinned_spans_conf'"
echo "using '$assigned_spans_conf'"
for device in $DEVICES
do
match_device "$device"

2
xpp/dahdi_genconf

@ -54,7 +54,7 @@ sub generator_list($) {
}
} else {
# No files given. Use the defaults.
@genlist = ('spantypes', 'pinnedspans', 'system', 'chandahdi');
@genlist = ('spantypes', 'assignedspans', 'system', 'chandahdi');
if($gconfig->{'pri_connection_type'} eq 'R2') {
push @genlist, 'unicall';
}

10
xpp/dahdi_registration

@ -36,9 +36,9 @@ getopts('vRs:', \%opts) || usage;
my $dahdi_autoreg = check_param('/sys/module/xpp/parameters/dahdi_autoreg') eq 'Y';
my $auto_assign_spans = check_param('/sys/module/dahdi/parameters/auto_assign_spans') eq '1';
my $pinned_spans_config = $ENV{'PINNED_SPANS_CONF_FILE'} || '/etc/dahdi/pinned-spans.conf';
my $assigned_spans_config = $ENV{'ASSIGNED_SPANS_CONF_FILE'} || '/etc/dahdi/assigned-spans.conf';
my $span_types_config = $ENV{'SPAN_TYPES_CONF_FILE'} || '/etc/dahdi/span-types.conf';
my $have_pinned_spans_config = -f $pinned_spans_config || 0;
my $have_assigned_spans_config = -f $assigned_spans_config || 0;
my $have_span_types_config = -f $span_types_config || 0;
my $sorter;
@ -60,7 +60,7 @@ my $on = shift;
my $verbose = $opts{'v'};
my $should_output = 1;
#print "dahdi_autoreg=$dahdi_autoreg auto_assign_spans=$auto_assign_spans have_pinned_spans_config='$have_pinned_spans_config' have_span_types_config='$have_span_types_config'\n";
#print "dahdi_autoreg=$dahdi_autoreg auto_assign_spans=$auto_assign_spans have_assigned_spans_config='$have_assigned_spans_config' have_span_types_config='$have_span_types_config'\n";
if(defined($on)) { # Translate to booleans
$on = uc($on);
@ -100,8 +100,8 @@ foreach my $xbus (Dahdi::Xpp::xbuses($sorter)) {
}
myprintf "%3s ==> %3s\n", state2str($prev), state2str($on);
}
if (defined($on) && $on && ! $have_pinned_spans_config && ! $auto_assign_spans) {
# Emulate /etc/dahdi/pinned-spans.conf:
if (defined($on) && $on && ! $have_assigned_spans_config && ! $auto_assign_spans) {
# Emulate /etc/dahdi/assigned-spans.conf:
# - We iterate over $xbus according to /etc/dahdi/xpp_order
# - We "auto" assign all spans of current $xbus
my $devpath = sprintf "/sys/bus/dahdi_devices/devices/astribanks:xbus-%02d", $xbus->num;

8
xpp/perl_modules/Dahdi/Config/Gen/Pinnedspans.pm → xpp/perl_modules/Dahdi/Config/Gen/Assignedspans.pm

@ -1,4 +1,4 @@
package Dahdi::Config::Gen::Pinnedspans;
package Dahdi::Config::Gen::Assignedspans;
use strict;
use Dahdi::Config::Gen qw(is_true);
@ -7,7 +7,7 @@ sub new($$$) {
my $pack = shift || die;
my $gconfig = shift || die;
my $genopts = shift || die;
my $file = $ENV{PINNED_SPANS_CONF_FILE} || "/etc/dahdi/pinned-spans.conf";
my $file = $ENV{ASSIGNED_SPANS_CONF_FILE} || "/etc/dahdi/assigned-spans.conf";
my $self = {
FILE => $file,
GCONFIG => $gconfig,
@ -57,7 +57,7 @@ dahdi - Generate configuration for dahdi drivers.
=head1 DESCRIPTION
Generate the F</etc/dahdi/pinned-spans.conf>.
Generate the F</etc/dahdi/assigned-spans.conf>.
This is the configuration for span_assignments.
Its location may be overriden via the environment variable F<PINNED_SPANS_CONF_FILE>.
Its location may be overriden via the environment variable F<ASSIGNED_SPANS_CONF_FILE>.
Loading…
Cancel
Save