diff options
Diffstat (limited to 'net-dialup/isdn4k-utils/files')
18 files changed, 1051 insertions, 0 deletions
diff --git a/net-dialup/isdn4k-utils/files/auerswald.usermap b/net-dialup/isdn4k-utils/files/auerswald.usermap new file mode 100644 index 0000000..9d9f177 --- /dev/null +++ b/net-dialup/isdn4k-utils/files/auerswald.usermap @@ -0,0 +1,6 @@ +# /etc/hotplug/usb/capi.usermap + +auerswald 0x0003 0x09bf 0x00c0 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 +auerswald 0x0003 0x09bf 0x00db 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 +auerswald 0x0003 0x09bf 0x00f1 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 +auerswald 0x0003 0x09bf 0x00f2 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 diff --git a/net-dialup/isdn4k-utils/files/config-3.23_pre20120508 b/net-dialup/isdn4k-utils/files/config-3.23_pre20120508 new file mode 100644 index 0000000..51e36ce --- /dev/null +++ b/net-dialup/isdn4k-utils/files/config-3.23_pre20120508 @@ -0,0 +1,130 @@ +# +# Automatically generated by make menuconfig: don't edit +# + +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y + +# +# General configuration +# +CONFIG_BUILDX11=y +CONFIG_KERNELDIR='/usr/src/linux' +CONFIG_BINDIR='/usr/bin' +CONFIG_SBINDIR='/usr/sbin' +CONFIG_CARD_SBINDIR='/usr/sbin' +CONFIG_MANDIR='/usr/share/man' +CONFIG_FIRMWAREDIR='/lib/firmware/isdn' +CONFIG_RUNDIR='/var/run' +CONFIG_LOCKDIR='/var/lock' +CONFIG_LOCKFILE='LCK..' +CONFIG_I4LCONFDIR='/etc/isdn' +CONFIG_CONFFILE='isdn.conf' +CONFIG_CALLERIDFILE='callerid.conf' +CONFIG_USERCONFFILE='~/.isdn' +CONFIG_COUNTRYCODE='49' +CONFIG_AREACODE='89' +CONFIG_COUNTRY_PREFIX='+' +CONFIG_AREA_PREFIX='0' +CONFIG_DATADIR='/usr/share/isdn' + +# +# Runtime configuration tools +# +CONFIG_ISDNCTRL=y +CONFIG_ISDNCTRL_CONF=y +CONFIG_ISDNCTRL_TIMRU=y +CONFIG_ISDNCTRL_DWABC_UDP_INFO=y +CONFIG_IPROFD=y +CONFIG_DIVERTCTRL=y + +# +# Card configuration tools +# +CONFIG_HISAXCTRL=y +CONFIG_ICNCTRL=y +# CONFIG_ICNCTRL_DEBUG=y +CONFIG_ACTCTRL=y +CONFIG_PCBITCTL=y +# CONFIG_AVMCAPICTRL is not set +CONFIG_ACTCTRL=y +CONFIG_EICONCTRL=y +CONFIG_LOOPCTRL=y + +# +# Tools for monitoring activity +# +CONFIG_IMON=y +CONFIG_IMONTTY=y +CONFIG_ISDNLOG=y + +# +# Options for isdnlog package +# +CONFIG_ISDNLOG_SERV_PORT=20011 +CONFIG_ISDNLOG_USERFILE='isdnlog.users' +CONFIG_ISDNLOG_CHARGEFILE='charge.dat' +CONFIG_ISDNLOG_LOGFILE='/var/log/isdn.log' +CONFIG_ISDNLOG_RELOADCMD='/etc/init.d/isdn restart' +CONFIG_ISDNLOG_STOPCMD='/etc/init.d/isdn stop' +CONFIG_ISDNLOG_REBOOTCMD='/sbin/reboot' +CONFIG_ISDNLOG_DOCDIR='' +CONFIG_ISDNLOG_OLDI4LCONFDIR='/etc/isdnlog' +CONFIG_ISDNLOG_OLDI4LCONFFILE='isdnlog.conf' +# CONFIG_ISDNLOG_POSTGRES=y +# CONFIG_ISDNLOG_POSTGRESDIR='/usr' +# CONFIG_ISDNLOG_MYSQLDB=y +# CONFIG_ISDNLOG_MYSQLDIR='/usr' +# CONFIG_ISDNLOG_ORACLE=y +CONFIG_ISDN_LOG_XX=y +CONFIG_ISDN_LOG_CC='' +CONFIG_ISDN_LOG_CC_EN=y +CONFIG_ISDN_LOG_DEST_DE=y +CONFIG_ISDN_LOG_DEST_AT=y +CONFIG_ISDN_LOG_DEST_NL=y +CONFIG_ISDN_LOG_DEST_CH=y +CONFIG_ISDN_LOG_DEST_BE=y +CONFIG_ISDN_LOG_DEST_CN=y +CONFIG_IPPPSTATS=y +CONFIG_XISDNLOAD=y +CONFIG_XMONISDN=y + +# +# Options for xmonisdn +# +CONFIG_XMONISDN_UPCMD='/etc/isdn/netup' +CONFIG_XMONISDN_DOWNCMD='/etc/isdn/netdown' + +# +# Applications +# +# CONFIG_VBOX is not set +CONFIG_IPPPD=y + +# +# Options for ipppd +# +CONFIG_IPPPD_MSCHAP=y +CONFIG_IPPP_FILTER=y +# CONFIG_IPPPD_RADIUS=y +# CONFIG_RADIUS_WTMP_LOGGING=y +# RADIUS_CLIENT_CONFIG_FILE='' +# CONFIG_CAPIFAX is not set +# CONFIG_RCAPID is not set +# CONFIG_PPPDCAPIPLUGIN is not set +CONFIG_EUROFILE=y + +# +# Options for eurofile +# +CONFIG_EFTD=y +CONFIG_EFTP=y +CONFIG_EFT_INSTALL_CONF=y + +# +# Documentation +# +CONFIG_GENMAN=y +# CONFIG_FAQ is not set diff --git a/net-dialup/isdn4k-utils/files/eiconctrl-3.23_pre20120508.patch b/net-dialup/isdn4k-utils/files/eiconctrl-3.23_pre20120508.patch new file mode 100644 index 0000000..4d9f9ec --- /dev/null +++ b/net-dialup/isdn4k-utils/files/eiconctrl-3.23_pre20120508.patch @@ -0,0 +1,11 @@ +--- eicon/eiconctrl.c.orig 2012-05-21 10:21:00.447058737 +0200 ++++ eicon/eiconctrl.c 2012-05-21 10:21:55.570437203 +0200 +@@ -204,7 +204,7 @@ + }; + + +-#if HAVE_XLOG || HAVE_TRACE ++#if defined(HAVE_XLOG) || defined(HAVE_TRACE) + /*********** XLOG stuff **********/ + + #define byte __u8 diff --git a/net-dialup/isdn4k-utils/files/hisax.conf b/net-dialup/isdn4k-utils/files/hisax.conf new file mode 100644 index 0000000..4c2ae52 --- /dev/null +++ b/net-dialup/isdn4k-utils/files/hisax.conf @@ -0,0 +1,46 @@ +# /etc/hisax.conf - HiSax configuration file +# +# Please read the HiSax kernel documentation first: +# /usr/src/linux/Documentation/isdn/README.HiSax +# +# Then uncomment your cards below or add your own settings. +# If you want your specific card to be added to the list +# below, then drop me a line with your settings: +# Stefan Briesenick <sbriesen@gentoo.org> + +# 'proto' can be: 1TR6 DSS1 NI1 LEASED +# 'debug' is optional, default is 4 (D-Channel Frames for isdnlog) +# 'id' is optional, but should be unique (see README.HiSax) + +# type proto io (io0,io1) irq mem debug id (optional) + +# Teles 16.0 +#1 DSS1 0xd80 5 0xd0000 - teles + +# Teles 16.3 +#3 DSS1 0x280 10 - - teles + +# Teles 16.3 PnP (values from isapnp setup, uses io0/io1) +#4 DSS1 0x580,0x180 10 - - teles + +# Fritz A1 +#5 DSS1 0x340 10 - - fritz + +# ELSA PCC/PCF +#6 DSS1 - - - - elsa + +# ELSA-QS3000 (values from isapnp setup) +#7 DSS1 0x160 3 - - qs3000 + +# Teles PCMCIA +#8 DSS1 0x180 15 - - teles + +# Sedlbauer Speed Fax+ PCI +#28 DSS1 - - - - speedfax + +# HFC-PCI (see README.hfc-pci) +#35 DSS1 - - - - hfc-pci + +# AVM Fritz PCI/PnP (fake type, will use hisax_fcpcipnp) +#99 DSS1 - - - - + diff --git a/net-dialup/isdn4k-utils/files/hisax.initd b/net-dialup/isdn4k-utils/files/hisax.initd new file mode 100644 index 0000000..34ab583 --- /dev/null +++ b/net-dialup/isdn4k-utils/files/hisax.initd @@ -0,0 +1,235 @@ +#!/sbin/runscript +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-dialup/isdn4k-utils/files/hisax.initd,v 1.5 2006/09/10 15:35:40 sbriesen Exp $ + +depend() { + use isapnp pcmcia +} + +# possible firmware locations (list and order taken from 'capiinit') +FWDIRS=(/lib/firmware/isdn /lib/firmware /usr/share/isdn /usr/lib/isdn /lib/isdn) + +# Firmware search +findfw() { # <fw_name> + local DIR + for DIR in ${FWDIRS[*]}; do + if [ -f "${DIR}/${1}" ]; then + echo "${DIR}/${1}"; return 0 + fi + done + return 1 +} + +check_module() { + /bin/grep 2>/dev/null -q "^${1} " /proc/modules +} + +get_first_free_idx() { + local -a _idxa + local _it _lin _idx=-1 + if ! read _it _lin < <(/bin/head 2>/dev/null -n1 /dev/isdninfo); then + echo "0"; return + fi + read -a _idxa < <(echo ${_lin}) + while [ ${_idx} -lt 65 ]; do + : $((_idx++)) + if [ "${_idxa[$_idx]}" = "-" ]; then + echo $((_idx / 2)); return + fi + done +} + +read_config() { + HISAX_TYPE="" + HISAXFC_TYPE="" + HISAX_DEBUG="" + HISAX_FIRMWARE="" + HISAX_CNT=$(get_first_free_idx) + while read H_TYPE H_PROTO H_IO H_IRQ H_MEM H_DEBUG H_ID; do + + # check and set card id + case "${H_TYPE}" in + 99) # AVM Fritz PCI/PnP + H_ID="#<FC>#" # fixed later + ;; + *) # all others + [ -z "${H_ID}" -o "${H_ID}" = "-" ] && H_ID="hisax${HISAX_CNT}" + H_ID="${H_ID//\%/-}"; H_ID="${H_ID// /_}" + ;; + esac + + # convert protocol to number + case "${H_PROTO}" in + [eE][dD][sS][sS]1) H_PROTO_NR=2 ;; # EDSS1 + [eE][uU][rR][oO]) H_PROTO_NR=2 ;; # EDSS1 + [dD][sS][sS]1) H_PROTO_NR=2 ;; # EDSS1 + 1[tT][rR]6) H_PROTO_NR=1 ;; # 1TR6 + [nN][iI]1) H_PROTO_NR=4 ;; # NI1 + [lL][eE][aA][sS][eE][dD]) H_PROTO_NR=3 ;; # leased + *) return 1 ;; # error! + esac + + # split IO option (needed for Teles PnP) + if [ "${H_IO/,}" = "${H_IO}" ]; then + H_IO0="-" + H_IO1="-" + else + H_IO0="${H_IO%%,*}" + H_IO1="${H_IO##*,}" + H_IO="-" + fi + + # check debug option and build list + [ -z "${H_DEBUG}" -o "${H_DEBUG}" = "-" ] && H_DEBUG=4 + [ -z "${HISAX_DEBUG}" ] \ + && HISAX_DEBUG="${H_ID}%${H_DEBUG//\%}" \ + || HISAX_DEBUG="${HISAX_DEBUG} ${H_ID}%${H_DEBUG//\%}" + + # build list of cards which needs ISAR.BIN firmware + case "${H_TYPE}" in + 28|29) [ -z "${HISAX_FIRMWARE}" ] \ + && HISAX_FIRMWARE="${H_ID}" \ + || HISAX_FIRMWARE="${HISAX_FIRMWARE} ${H_ID}" + ;; + esac + + # build options + case "${H_TYPE}" in + 99) # AVM Fritz PCI/PnP + if [ -z "${HISAXFC_TYPE}" ]; then + HISAXFC_TYPE="${H_TYPE}" + HISAXFC_PROTO="${H_PROTO_NR}" + else + HISAXFC_TYPE="${HISAXFC_TYPE},${H_TYPE}" + HISAXFC_PROTO="${HISAXFC_PROTO},${H_PROTO_NR}" + fi + ;; + *) # all others + : $((HISAX_CNT++)) + if [ -z "${HISAX_TYPE}" ]; then + HISAX_TYPE="${H_TYPE}" + HISAX_IRQ="${H_IRQ//-}" + HISAX_MEM="${H_MEM//-}" + HISAX_IO="${H_IO//-}" + HISAX_IO0="${H_IO0//-}" + HISAX_IO1="${H_IO1//-}" + HISAX_ID="${H_ID}" + HISAX_PROTO="${H_PROTO_NR}" + HISAX_DUMMY="" + else + HISAX_TYPE="${HISAX_TYPE},${H_TYPE}" + HISAX_IRQ="${HISAX_IRQ},${H_IRQ//-}" + HISAX_IO="${HISAX_IO},${H_IO//-}" + HISAX_IO0="${HISAX_IO0},${H_IO0//-}" + HISAX_IO1="${HISAX_IO1},${H_IO1//-}" + HISAX_MEM="${HISAX_MEM},${H_MEM//-}" + HISAX_ID="${HISAX_ID}%${H_ID}" + HISAX_PROTO="${HISAX_PROTO},${H_PROTO_NR}" + HISAX_DUMMY="${HISAX_DUMMY}," + fi + ;; + esac + + done < <(/bin/sed 2>/dev/null -ne "s:^[[:space:]]*\([1-9][0-9]\?[[:space:]]\+[^#]*\)[#]*.*$:\1:p" "$@") + + # build final hisax options + if [ -n "${HISAX_TYPE}" ]; then + HISAX_OPTIONS="type=${HISAX_TYPE}" + [ "${HISAX_IRQ}" = "${HISAX_DUMMY}" ] || HISAX_OPTIONS="${HISAX_OPTIONS} irq=${HISAX_IRQ}" + [ "${HISAX_IO}" = "${HISAX_DUMMY}" ] || HISAX_OPTIONS="${HISAX_OPTIONS} io=${HISAX_IO}" + [ "${HISAX_IO0}" = "${HISAX_DUMMY}" ] || HISAX_OPTIONS="${HISAX_OPTIONS} io0=${HISAX_IO0}" + [ "${HISAX_IO1}" = "${HISAX_DUMMY}" ] || HISAX_OPTIONS="${HISAX_OPTIONS} io1=${HISAX_IO1}" + [ "${HISAX_MEM}" = "${HISAX_DUMMY}" ] || HISAX_OPTIONS="${HISAX_OPTIONS} mem=${HISAX_MEM}" + HISAX_OPTIONS="${HISAX_OPTIONS} protocol=${HISAX_PROTO} id=${HISAX_ID}" + fi + + # build final hisax_fcpcipnp options + if [ -n "${HISAXFC_TYPE}" ]; then + HISAXFC_OPTIONS="protocol=${HISAXFC_PROTO}" + fi + + return 0 +} + +start() { + if [ ! -f /etc/hisax.conf ]; then + eerror "You're missing /etc/hisax.conf" + return 1 + fi + + if ! read_config /etc/hisax.conf; then + eerror "You have an configuration error in /etc/hisax.conf" + return 1 + fi + + if [ -z "${HISAX_TYPE}" -a -z "${HISAXFC_TYPE}" ]; then + eerror "You have not configured /etc/hisax.conf" + return 1 + fi + + ebegin "Loading HiSax driver" + if [ -n "${HISAX_TYPE}" ]; then + /sbin/modprobe -s hisax ${HISAX_OPTIONS} && check_module hisax + if [ $? -ne 0 ]; then + /sbin/modprobe -sqr hisax_fcpcipnp + /sbin/modprobe -sqr hisax + eend 1; return 1 + fi + fi + if [ -n "${HISAXFC_TYPE}" ]; then + /sbin/modprobe -s hisax_fcpcipnp ${HISAXFC_OPTIONS} && check_module hisax_fcpcipnp + if [ $? -ne 0 ]; then + /sbin/modprobe -sqr hisax_fcpcipnp + /sbin/modprobe -sqr hisax + eend 1; return 1 + fi + fi + eend $? + + # create ISDN devices if necessary + [ -c /dev/isdninfo -a -c /dev/isdnctrl0 ] || /etc/init.d/isdn makedev + + if [ -n "${HISAX_FIRMWARE}" ]; then + for ID in ${HISAX_FIRMWARE}; do + FW=$(findfw "ISAR.BIN") + if [ -n "${FW}" ]; then + ebegin "Loading firmware '${FW##*/}' onto ${ID}" + /usr/sbin/hisaxctrl "${ID}" 9 "${FW}" + if ! eend $?; then + /sbin/modprobe -sqr hisax_fcpcipnp + /sbin/modprobe -sqr hisax + return 1 + fi + else + eerror "Firmware 'ISAR.BIN' not found in ${FWDIRS[0]}" + /sbin/modprobe -sqr hisax_fcpcipnp + /sbin/modprobe -sqr hisax + return 1 + fi + done + fi + + local CARDS="" ID VAL + if [ -n "${HISAX_DEBUG}" ]; then + for DBG in ${HISAX_DEBUG}; do + ID="${DBG%%\%*}" + VAL="${DBG##*\%}" + if [ "${ID}" = "#<FC>#" ]; then + ID="fcpcipnp${HISAX_CNT}" + : $((HISAX_CNT++)) + fi + /usr/sbin/hisaxctrl "${ID}" 1 "${VAL}" + [ -z "${CARDS}" ] && CARDS="${ID}" || CARDS="${CARDS} ${ID}" + done + fi + + [ -n "${CARDS}" ] && einfo "HiSax cards: ${CARDS}" +} + +stop() { + ebegin "Unloading HiSax driver" + /sbin/modprobe -sqr hisax_fcpcipnp + /sbin/modprobe -sqr hisax + eend $? +} diff --git a/net-dialup/isdn4k-utils/files/hisax.usermap b/net-dialup/isdn4k-utils/files/hisax.usermap new file mode 100644 index 0000000..9219619 --- /dev/null +++ b/net-dialup/isdn4k-utils/files/hisax.usermap @@ -0,0 +1,3 @@ +# /etc/hotplug/usb/hisax.usermap + +hisax 0x0003 0x0483 0x4810 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 diff --git a/net-dialup/isdn4k-utils/files/ioptions.txt b/net-dialup/isdn4k-utils/files/ioptions.txt new file mode 100644 index 0000000..39cd232 --- /dev/null +++ b/net-dialup/isdn4k-utils/files/ioptions.txt @@ -0,0 +1,2 @@ +# System-wide configuration for ipppd. +# Normally, put all options into options.ipppX diff --git a/net-dialup/isdn4k-utils/files/ipppd-pcap-0.9.3.patch b/net-dialup/isdn4k-utils/files/ipppd-pcap-0.9.3.patch new file mode 100644 index 0000000..df4b85b --- /dev/null +++ b/net-dialup/isdn4k-utils/files/ipppd-pcap-0.9.3.patch @@ -0,0 +1,51 @@ +--- ipppd/options.c.orig 2005-08-07 15:47:50.000000000 +0200 ++++ ipppd/options.c 2005-08-21 00:01:06.000000000 +0200 +@@ -2633,6 +2633,10 @@ + + #ifdef IPPP_FILTER + ++#if !defined(DLT_PPP_WITHDIRECTION) && defined(DLT_PPP_WITH_DIRECTION) ++#define DLT_PPP_WITHDIRECTION DLT_PPP_WITH_DIRECTION ++#endif ++ + #ifndef DLT_PPP_PPPD + #define DLT_PPP_PPPD DLT_PPP + #warning "please update your pcap version to support in/outbound DLT_PPP_PPPD filter" +@@ -2646,9 +2650,17 @@ + int argc; + char **argv; + { +- if (pcap_compile_nopcap(65535, DLT_PPP_PPPD, &pass_filter, *argv, 1, netmask) == 0) ++ pcap_t* pc = pcap_open_dead (DLT_PPP_WITHDIRECTION, PPP_HDRLEN); ++ if (!pc) { ++ option_error("error in pass-filter expression: pcap_open_dead failed\n"); ++ return 0; ++ } ++ if (pcap_compile(pc, &pass_filter, *argv, 1, netmask) == 0) { ++ pcap_close(pc); + return 1; ++ } + option_error("error in pass-filter expression.\n"); ++ pcap_close(pc); + return 0; + } + +@@ -2660,9 +2672,17 @@ + int argc; + char **argv; + { +- if (pcap_compile_nopcap(65535, DLT_PPP_PPPD, &active_filter, *argv, 1, netmask) == 0) ++ pcap_t* pc = pcap_open_dead (DLT_PPP_WITHDIRECTION, PPP_HDRLEN); ++ if (!pc) { ++ option_error("error in active-filter expression: pcap_open_dead failed\n"); ++ return 0; ++ } ++ if (pcap_compile(pc, &active_filter, *argv, 1, netmask) == 0) { ++ pcap_close(pc); + return 1; ++ } + option_error("error in active-filter expression.\n"); ++ pcap_close(pc); + return 0; + } + #endif /* IPPP_FILTER */ diff --git a/net-dialup/isdn4k-utils/files/isdn.blacklist b/net-dialup/isdn4k-utils/files/isdn.blacklist new file mode 100644 index 0000000..9c7ec30 --- /dev/null +++ b/net-dialup/isdn4k-utils/files/isdn.blacklist @@ -0,0 +1,16 @@ +# /etc/hotplug/blacklist.d/isdn + +# handled by /etc/init.d/hisax +hisax +hisax_fcpcipnp +hisax_st5481 + +# temporarily disabled, because we need an init-script first +#auerswald +#divas +#act2000 +#hysdn +#icn +#pcbit +#sc +#tpam diff --git a/net-dialup/isdn4k-utils/files/isdn.confd b/net-dialup/isdn4k-utils/files/isdn.confd new file mode 100644 index 0000000..de4b15b --- /dev/null +++ b/net-dialup/isdn4k-utils/files/isdn.confd @@ -0,0 +1,21 @@ +# configuraton file for /etc/init.d/isdn + +# if you have CAPI based cards connected to I4L via 'capidrv' +DEPEND_ON_CAPI="yes" + +# How many ISDN channels should be used. On UDEV this limit +# will be used to create the device nodes in /dev. +# chan = cards * 2 (max = 64) +ISDN_MAX_CHANNELS=16 + +# MODE/GROUP when creating ISDN devices +ISDNDEV_MODE="660" +ISDNDEV_GROUP="dialout" + +# Location where isdnctrl will save its configuration +ISDNCTRL_CONFIG="/var/lib/isdn/isdnctrl.conf" + +# Location where iprofd will save the modem-register settings +# comment out if you don't want to use iprofd +IPROFD_SETTINGS="/var/lib/isdn/modem-register.dat" + diff --git a/net-dialup/isdn4k-utils/files/isdn.initd b/net-dialup/isdn4k-utils/files/isdn.initd new file mode 100644 index 0000000..9b29ee6 --- /dev/null +++ b/net-dialup/isdn4k-utils/files/isdn.initd @@ -0,0 +1,150 @@ +#!/sbin/runscript +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-dialup/isdn4k-utils/files/isdn.initd,v 1.4 2006/02/04 21:14:17 sbriesen Exp $ + +opts="${opts} save reload makedev info" + +depend() { + use hisax + [ "$DEPEND_ON_CAPI" = "yes" ] && need capi +} + +# gets list of installed cards +card_list() { # output: <contr> <chan> <card> + local IDMAP=() IDX=1 CONTR=0 LAST='-' CARD='' +# read -a IDMAP < <(/bin/head 2>/dev/null -n1 /dev/isdninfo) || return 1 + for IDLINE in $(/bin/head 2>/dev/null -n1 /dev/isdninfo); do + IDMAP[$((IDX-1))]=${IDLINE}; : $((IDX++)) + done + IDX=1 + while [ ${IDX} -lt ${#IDMAP[*]} ]; do + CARD=${IDMAP[$IDX]} + if [ "${CARD}" != "-" -a "${CARD}" != "${LAST}" ]; then + echo "${CONTR} $((IDX-1)) ${CARD}"; : $((CONTR++)) + fi + LAST="${CARD}"; : $((IDX++)) + done +} + +# gets CAPI controller name +capi_name() { # <contr> + /bin/sed -n "s:^${1} \+[^ ]\+ \+[^ ]\+ \+\([^ ]\+\) \+.\+\$:\1:p" \ + /proc/capi/controller 2>/dev/null +} + +# displays installed ISDN cards +show_cards() { # < $(card_list) + local CONTR CHAN CARD CAPI + while read CONTR CHAN CARD; do + case "${CARD}" in + capidrv-[1-9]*) + CAPI=$(capi_name ${CARD/capidrv-}) + einfo "${1}${CONTR} ${CARD} (${CAPI})" + ;; + *) + einfo "${1}${CONTR} ${CARD}" + ;; + esac + done +} + +# creates ISDN devices for static /dev and udev +makedev() { + if [ ! -e /dev/.devfsd ]; then + local CHAN + pushd /dev >/dev/null || return 1 + ebegin "Creating ISDN devices" + /bin/rm -f isdninfo isdnctrl* ippp[0-9]* isdn[0-9]* ttyI[0-9]* + for ((CHAN = 0; CHAN < ISDN_MAX_CHANNELS; CHAN++)); do + /bin/mknod -m "${ISDNDEV_MODE}" isdn${CHAN} c 45 $((CHAN)) # b + /bin/mknod -m "${ISDNDEV_MODE}" isdnctrl${CHAN} c 45 $((CHAN + 64)) # ctrl + /bin/mknod -m "${ISDNDEV_MODE}" ippp${CHAN} c 45 $((CHAN + 128)) # ppp + /bin/mknod -m "${ISDNDEV_MODE}" ttyI${CHAN} c 43 $((CHAN)) # tty + done + /bin/chgrp "${ISDNDEV_GROUP}" isdnctrl* ippp[0-9]* isdn[0-9]* ttyI[0-9]* + /bin/mknod -m 444 isdninfo c 45 255 + /bin/ln -snf isdnctrl0 isdnctrl + popd >/dev/null + eend 0 + fi +} + + +start() { + # create ISDN devices if necessary + [ -c /dev/isdninfo -a -c /dev/isdnctrl0 ] || makedev + + local LIST="$(card_list)" + + if [ -z "${LIST}" ]; then + eerror "ERROR: no ISDN cards available" + return 1 + fi + + ebegin "Loading isdnctrl configuration" + [ ! -f "${ISDNCTRL_CONFIG}" ] || /usr/sbin/isdnctrl readconf "${ISDNCTRL_CONFIG}" >/dev/null + eend $? + + if [ -n "${IPROFD_SETTINGS}" ]; then + ebegin "Starting modem-register daemon" + start-stop-daemon 2>/dev/null --start --quiet --exec /usr/sbin/iprofd -- "${IPROFD_SETTINGS}" + eend $? + fi + + einfo "Available ISDN cards:" +# show_cards " " < <(echo "${LIST}") + echo "${LIST}" | show_cards + return 0 +} + +stop() { + local RET FCNT=0 + + # if some other monitoring processes are running, kill 'em + if /bin/fuser 2>/dev/null -s /dev/isdninfo; then + ebegin "Stopping monitoring processes" + /bin/fuser -ks /dev/isdninfo; RET=$? + while [ ${RET} -eq 0 -a ${FCNT} -lt 10 ]; do + : $((FCNT++)); sleep 0.5; /bin/fuser -s /dev/isdninfo; RET=$? + done + [ $RET -ne 0 ] + eend $? + fi + + if [ -n "${IPROFD_SETTINGS}" ]; then + ebegin "Stopping modem-register daemon" + start-stop-daemon 2>/dev/null --stop --quiet --retry 5 --exec /usr/sbin/iprofd + eend $? + fi + + ebegin "Unloading isdnctrl configuration" + /usr/sbin/isdnctrl reset force &>/dev/null + eend $? + + return 0 # ignore errors +} + +save() { + ebegin "Saving isdnctrl configuration" + /usr/sbin/isdnctrl writeconf "${ISDNCTRL_CONFIG}" >/dev/null + eend $? +} + +reload() { + ebegin "Reloading isdnctrl configuration" + /usr/sbin/isdnctrl reset >/dev/null + [ ! -f "${ISDNCTRL_CONFIG}" ] || \ + /usr/sbin/isdnctrl readconf "${ISDNCTRL_CONFIG}" >/dev/null + eend $? +} + +info() { + local LIST="$(card_list)" + if [ -z "${LIST}" ]; then + eerror "ERROR: no ISDN cards available" + return 1 + fi +# show_cards < <(echo "${LIST}") + echo "${LIST}" | show_cards +} diff --git a/net-dialup/isdn4k-utils/files/isdn.pcmcia b/net-dialup/isdn4k-utils/files/isdn.pcmcia new file mode 100644 index 0000000..faf1c25 --- /dev/null +++ b/net-dialup/isdn4k-utils/files/isdn.pcmcia @@ -0,0 +1,22 @@ +#!/bin/bash +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-dialup/isdn4k-utils/files/isdn.pcmcia,v 1.1 2005/09/03 20:56:26 sbriesen Exp $ + +. /etc/pcmcia/shared +. /etc/conf.d/isdn + +# Syslog output +syslog() { # <msg> + /usr/bin/logger -t "isdn-pcmcia" "$@" +} + +case "${ACTION}" in + start) + # create ISDN devices if necessary + [ -c /dev/isdninfo -a -c /dev/isdnctrl0 ] || /etc/init.d/isdn makedev + ;; + stop) + ;; +esac +exit 0 diff --git a/net-dialup/isdn4k-utils/files/isdn.pcmcia.conf b/net-dialup/isdn4k-utils/files/isdn.pcmcia.conf new file mode 100644 index 0000000..d0008ef --- /dev/null +++ b/net-dialup/isdn4k-utils/files/isdn.pcmcia.conf @@ -0,0 +1,117 @@ +############################################################################### +# Device driver definitions for passive ISDN cards (I4L) # +# Please read "man 5 pcmcia" for detailed informations. # +############################################################################### + + +############################################################################### +# Device driver definitions for AVM cards # +# Protocol is 1 for 1TR6 and 2 for EDSS1 # +# # +# ATTENTION: card definition below is disabled by default since there # +# is also a (propritary) CAPI driver available for this card which has # +# T.30 Fax G3 support. # +############################################################################### + +device "avma1_cs" + class "isdn" module "hisax" opts "type=26 protocol=2 id=avma1_cs" module "avma1_cs" +# class "isdn" module "hisax" opts "type=26" module "avma1_cs" opts "irq_list=15,12,11,10,9,7" + + +############################################################################### +# Device driver definition for ELSA cards # +# Protocol is 1 for 1TR6 and 2 for EDSS1 # +############################################################################### + +device "elsa_cs" + class "isdn" module "hisax" opts "type=10 protocol=2", "elsa_cs" + + +############################################################################### +# Device driver definitions for for the Sedlbauer Speed Star ISDN adapter # +# Protocol is 1 for 1TR6 and 2 for EDSS1 # +# # +# -> sedl_cs is the older but proofed module. This is used by default. # +# -> sedlbauer_cs is the newer one and will replace sedl_cs one day. # +# Please test this module and report your experience to the author. # +############################################################################### + +device "sedl_cs" + class "isdn" module "hisax" opts "type=22 protocol=2", "sedl_cs" + +device "sedlbauer_cs" + class "isdn" module "hisax" opts "type=22 protocol=2", "sedlbauer_cs" + + +############################################################################### +# Device driver definitions for Teles ISDN cards # +# Protocol is 1 for 1TR6 and 2 for EDSS1 # +############################################################################### + +device "teles_cs" + class "isdn" module "hisax" opts "type=0", "teles_cs" opts "protocol=2" + + +############################################################################### +# Card definitions # +############################################################################### + +#card "AVM ISDN-Controller A1" +# version "AVM", "ISDN A" +# bind "avma1_cs" + +card "Elsa ISDN Adapter" + version "ELSA GmbH, Aachen", "MicroLink ISDN/MC ", "*" + bind "elsa_cs" + +card "Elsa ISDN Adapter" + version "ELSA AG (Aachen, Germany)", "MicroLink ISDN/MC ", "*" + bind "elsa_cs" + +card "Sedlbauer PCMCIA ISDN-Card" + version "SEDLBAUER", "*", "*","*" + bind "sedlbauer_cs" +# bind "sedl_cs" + +card "Sedlbauer Speed Star PCMCIA ISDN-Card" + version "SEDLBAUER", "ISDN-Adapter", "*","*" + bind "sedlbauer_cs" +# bind "sedl_cs" + +card "Sedlbauer Speed Star PCMCIA ISDN-Card" + version "SEDLBAUER", "ISDN-Adapter", " (c) 93-95 VK&CB","*" + bind "sedlbauer_cs" +# bind "sedl_cs" + +card "Sedlbauer Speed Star PCMCIA ISDN-Card" + version "SEDLBAUER", "ISDN-Adapter", " (C) 93-94 VK&CB","*" + bind "sedlbauer_cs" +# bind "sedl_cs" + +card "Sedlbauer Speed Star PCMCIA ISDN-Card" + version "SEDLBAUER", "ISDN-Adapter (c) 93,94 VK&CB" + bind "sedlbauer_cs" + +card "Sedlbauer Speed Star PCMCIA ISDN-Card" + version "SEDLBAUER", "ISDN-Adapter", "4D98","*" + bind "sedlbauer_cs" +# bind "sedl_cs" + +card "Sedlbauer Speed Star PCMCIA ISDN-Card" + version "SEDLBAUER", "ISDN-Adapter", "4D67","*" + bind "sedlbauer_cs" +# bind "sedl_cs" + +card "Sedlbauer Speed Star II PCMCIA ISDN-Card" + version "SEDLBAUER", "speed star II", "V 3.1","(c) 93 - 98 cb & vk" + bind "sedlbauer_cs" +# bind "sedl_cs" + +card "(c) RFI Elektronik GmbH, AnyCom ECO ISDN" + manfid 0x020c, 0x0103 + bind "sedl_cs" + +card "TELES S0/PC ISDN" + version "TELES", "S0/PC" + bind "teles_cs" + diff --git a/net-dialup/isdn4k-utils/files/isdnlog.confd b/net-dialup/isdn4k-utils/files/isdnlog.confd new file mode 100644 index 0000000..2d2ede1 --- /dev/null +++ b/net-dialup/isdn4k-utils/files/isdnlog.confd @@ -0,0 +1,20 @@ +# configuraton file for /etc/init.d/isdnlog.* + +# naming conventions +# ~~~~~~~~~~~~~~~~~~ +# An ISDN controller is either identified by controller number, +# by channel number or by name. So you have the following options +# to select your init-script extension: +# +# 1. isdnlog.contrX (selecting by controller number) +# 2. isdnlog.isdnctrlX (selecting by channel number) +# 3. isdnlog.XXXXX (selecting by card name) + +# Here you can add some switches not covered by the +# corresponding /etc/isdn/isdnlog.options.contrX file. +# Of course, instead of 'contrX' you can also use the +# other modifiers mentioned above. +# +# see "man (8) isdnlog" for further informations + +ISDNLOG_OPTIONS="" diff --git a/net-dialup/isdn4k-utils/files/isdnlog.initd b/net-dialup/isdn4k-utils/files/isdnlog.initd new file mode 100644 index 0000000..c453cff --- /dev/null +++ b/net-dialup/isdn4k-utils/files/isdnlog.initd @@ -0,0 +1,84 @@ +#!/sbin/runscript +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-dialup/isdn4k-utils/files/isdnlog.initd,v 1.4 2006/02/04 21:14:17 sbriesen Exp $ + +depend() { + need isdn +} + +# gets list of installed cards +card_list() { # output: <contr> <chan> <card> + local IDMAP=() IDX=1 CONTR=0 LAST='-' CARD='' + read -a IDMAP < <(/bin/head 2>/dev/null -n1 /dev/isdninfo) || return 1 + while [ ${IDX} -lt ${#IDMAP[*]} ]; do + CARD=${IDMAP[$IDX]} + if [ "${CARD}" != "-" -a "${CARD}" != "${LAST}" ]; then + echo "${CONTR} $((IDX-1)) ${CARD}"; : $((CONTR++)) + fi + LAST="${CARD}"; : $((IDX++)) + done +} + +# get info by contr, chan or card +card_info() { + local MASK + case "${1}" in + contr[0-9]*) + MASK="^${1#contr*} [0-9]\+ .*\$" + ;; + isdnctrl[0-9]*) + MASK="^[0-9]\+ ${1#isdnctrl*} .*\$" + ;; + *) + MASK="^[0-9]\+ [0-9]\+ ${1}\$" + ;; + esac + /bin/grep "${MASK}" <(card_list) +} + +start() { + local CONTR CHAN CARD TYPE="${myservice#*.*}" + read CONTR CHAN CARD < <(card_info "${TYPE}") + + if [ -z "${CARD}" ]; then + eerror "ISDNLOG: Selected controller not available (${TYPE})" + return 1 + fi + + # try to find a configuration file + local CONFIG="/etc/isdn/isdnlog.isdnctrl${CHAN}.options" + [ -f "${CONFIG}" ] || CONFIG="/etc/isdn/isdnlog.options.contr${CONTR}" + [ -f "${CONFIG}" ] || CONFIG="/etc/isdn/isdnlog.options.isdnctrl${CHAN}" + [ -f "${CONFIG}" ] || CONFIG="/etc/isdn/isdnlog.options.${CARD}" + + if [ ! -f "${CONFIG}" ]; then + eerror "ISDNLOG: You're missing /etc/isdn/isdnlog.options.${TYPE}" + return 1 + fi + + rm -f "/var/run/${myservice}" # cleanup + + ebegin "Starting ISDNLOG for controller #${CONTR} (${CARD})" + start-stop-daemon --start --quiet --pidfile "/var/run/isdnlog.isdnctrl${CHAN}.pid" \ + --exec /usr/sbin/isdnlog -- ${ISDNLOG_OPTIONS} -f "${CONFIG}" "/dev/isdnctrl${CHAN}" && \ + echo "${CONTR} ${CHAN} ${CARD} ${CONFIG##*/}" > "/var/run/${myservice}" + eend $? +} + +stop() { + if [ ! -f "/var/run/${myservice}" ]; then + eerror "ISDNLOG: Controller setup not found (${myservice#*.*})" + return 1 + fi + + local CONTR CHAN CARD CONF + read CONTR CHAN CARD CONF < "/var/run/${myservice}" + + ebegin "Stopping ISDNLOG for controller #${CONTR} (${CARD})" + start-stop-daemon --stop --quiet --retry 5 --pidfile "/var/run/isdnlog.isdnctrl${CHAN}.pid" + eend $? + + rm -f "/var/run/${myservice}" + return 0 # ignore errors +} diff --git a/net-dialup/isdn4k-utils/files/isdnlog.logrotated b/net-dialup/isdn4k-utils/files/isdnlog.logrotated new file mode 100644 index 0000000..952377e --- /dev/null +++ b/net-dialup/isdn4k-utils/files/isdnlog.logrotated @@ -0,0 +1,11 @@ +# isdnlog logrotate snippet for Gentoo Linux +# contributed by Stefan Briesenick + +/var/log/isdn.log { + compress + rotate 99 + size=4096k + notifempty + missingok + copytruncate +} diff --git a/net-dialup/isdn4k-utils/files/net.ippp0 b/net-dialup/isdn4k-utils/files/net.ippp0 new file mode 100644 index 0000000..b072ec1 --- /dev/null +++ b/net-dialup/isdn4k-utils/files/net.ippp0 @@ -0,0 +1,101 @@ +#!/sbin/runscript +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-dialup/isdn4k-utils/files/net.ippp0,v 1.1 2005/03/29 08:40:14 mrness Exp $ + +#NB: Config is in /etc/conf.d/net + +depend() { + need isdn +} + +checkconfig() { + if [ -z "$(eval echo \$\{iface_${IFACE}\})" ] + then + eerror "Please make sure that /etc/conf.d/net has \$iface_$IFACE set" + return 1 + fi +} + +start() { + checkconfig || return 1 + + local iface_args="$(eval echo \$\{iface_${IFACE}\})" + local ipppd_opts="" + + ebegin "Starting ipppd for ${IFACE}" + [ -n "${gateway}" ] && [ "${gateway%/*}" = "${IFACE}" ] && ipppd_opts='defaultroute' + /usr/sbin/ipppd ${ipppd_opts} pidfile /var/run/ipppd.${IFACE}.pid file /etc/ppp/options.${IFACE} || { + local retval=$? + eend ${retval} "Failed to start ipppd" + return ${retval} + } + eend 0 + + ebegin "Bringing ${IFACE} up" + /sbin/ifconfig ${IFACE} ${iface_args} >/dev/null || { + local retval=$? + eend ${retval} "Failed to bring ${IFACE} up" + stop + return ${retval} + } + eend 0 + + if [ -n "$(eval echo \$\{inet6_${IFACE}\})" ] + then + local x="" + ebegin " Adding inet6 addresses" + for x in $(eval echo \$\{inet6_${IFACE}\}) + do + ebegin " ${IFACE} inet6 add ${x}" + /sbin/ifconfig ${IFACE} inet6 add ${x} >/dev/null + eend 0 + done + save_options "inet6" "$(eval echo \$\{inet6_${IFACE}\})" + fi + + if [ -n "${gateway}" ] && [ "${gateway%/*}" = "${IFACE}" ] + then + ebegin " Setting default gateway" + /sbin/route add default dev ${gateway%/*} >/dev/null || { + local retval=$? + eend ${retval} "Failed to bring ${IFACE} up" + stop + return ${retval} + } + eend 0 + fi + + # Enabling rp_filter causes wacky packets to be auto-dropped by + # the kernel + if [ -e /proc/sys/net/ipv4/conf/${IFACE}/rp_filter ] + then + echo 1 > /proc/sys/net/ipv4/conf/${IFACE}/rp_filter + fi +} + +stop() { + local myinet6="$(get_options inet6)" + local pidfile="/var/run/ipppd.${IFACE}.pid" + + ebegin "Bringing ${IFACE} down" + + # Also down the inet6 interfaces + if [ -n "${myinet6}" ] + then + local x="" + for x in ${myinet6} + do + /sbin/ifconfig ${IFACE} inet6 del ${x} >/dev/null + done + fi + + /sbin/ifconfig ${IFACE} down >/dev/null + + # Kill ipppd + test -s "${pidfile}" && kill `cat ${pidfile}` + sleep 1 + test -s "${pidfile}" && sleep 2 && test -s "${pidfile}" && einfon "Killing ipppd" && kill -KILL `cat ${pidfile}` + + eend 0 +} diff --git a/net-dialup/isdn4k-utils/files/options.ippp0 b/net-dialup/isdn4k-utils/files/options.ippp0 new file mode 100644 index 0000000..13983f1 --- /dev/null +++ b/net-dialup/isdn4k-utils/files/options.ippp0 @@ -0,0 +1,25 @@ +# Example config for a personal ISP dialin +# see "man ipppd" for explanation of all possible options + +# for the defaultroute setting, look in /etc/conf.d/net + +/dev/isdn/ippp0 + +# you have to put login and password into /etc/ppp/pap-secrets too + +name "insert ppp login here" + +lock +ipcp-accept-local +ipcp-accept-remote +noipdefault + +# You might want to try these if you have problems: +#-vj +#-vjccomp +#-ac +#-pc +#-bsdcomp +#mru 1524 +#mtu 1500 +#noccp |