Q931ToPcap patch

git-svn-id: http://svn.openzap.org/svn/openzap/trunk@628 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
Helmut Kuper 2009-01-30 11:37:11 +00:00
parent ac172da18b
commit 8333afcb59
6 changed files with 977 additions and 322 deletions

View File

@ -34,6 +34,11 @@ CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
DEFS = @DEFS@
CFLAGS=@CFLAGS@ @COMP_VENDOR_CFLAGS@ @DEFS@
###For libpcap
CFLAGS+=-D_GNU_SOURCE
####
LIBS = @LIBS@
DYNAMIC_LIB_EXTEN = @DYNAMIC_LIB_EXTEN@
SOLINK = @SOLINK@
@ -270,6 +275,8 @@ $(SRC)/ozmod/ozmod_isdn/ozmod_isdn.$(DYNAMIC_LIB_EXTEN): $(MYLIB) $(ISDN_OBJS) $
$(LINK) $(SOLINK) $(ISDN_OBJS) $(SRC)/ozmod/ozmod_isdn/ozmod_isdn.o $(MYLIB) -rpath $(libdir)
isdnmod: $(SRC)/ozmod/ozmod_isdn/ozmod_isdn.$(DYNAMIC_LIB_EXTEN)
$(ISDN_OBJS2): $(ISDN_HEADERS) $(ISDN_SOURCES) $(SRC)/ozmod/ozmod_isdn_libpcap/ozmod_isdn.c
$(SRC)/ozmod/ozmod_analog/ozmod_analog.$(DYNAMIC_LIB_EXTEN): $(MYLIB) $(SRC)/ozmod/ozmod_analog/ozmod_analog.o
$(LINK) $(SOLINK) $(SRC)/ozmod/ozmod_analog/ozmod_analog.o $(MYLIB) -rpath $(libdir)
analogmod: $(SRC)/ozmod/ozmod_analog/ozmod_analog.$(DYNAMIC_LIB_EXTEN)

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +1,10 @@
#! /bin/sh
# Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
# Inc.
timestamp='2003-07-04'
timestamp='2007-06-28'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
@ -21,14 +22,15 @@ timestamp='2003-07-04'
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
# 02110-1301, USA.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Please send patches to <config-patches@gnu.org>. Submit a context
# diff and a properly formatted ChangeLog entry.
#
@ -70,7 +72,7 @@ Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.sub ($timestamp)
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
@ -83,11 +85,11 @@ Try \`$me --help' for more information."
while test $# -gt 0 ; do
case $1 in
--time-stamp | --time* | -t )
echo "$timestamp" ; exit 0 ;;
echo "$timestamp" ; exit ;;
--version | -v )
echo "$version" ; exit 0 ;;
echo "$version" ; exit ;;
--help | --h* | -h )
echo "$usage"; exit 0 ;;
echo "$usage"; exit ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
@ -99,7 +101,7 @@ while test $# -gt 0 ; do
*local*)
# First pass through any local machine types.
echo $1
exit 0;;
exit ;;
* )
break ;;
@ -144,7 +146,7 @@ case $os in
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-apple | -axis)
-apple | -axis | -knuth | -cray)
os=
basic_machine=$1
;;
@ -169,6 +171,10 @@ case $os in
-hiux*)
os=-hiuxwe2
;;
-sco6)
os=-sco5v6
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco5)
os=-sco3.2v5
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
@ -185,6 +191,10 @@ case $os in
# Don't forget version if it is 3.2v4 or newer.
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco5v6*)
# Don't forget version if it is 3.2v4 or newer.
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco*)
os=-sco3.2v2
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
@ -228,14 +238,17 @@ case $basic_machine in
| a29k \
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
| am33_2.0 \
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
| bfin \
| c4x | clipper \
| d10v | d30v | dlx | dsp16xx \
| fr30 | frv \
| fido | fr30 | frv \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| i370 | i860 | i960 | ia64 \
| ip2k \
| m32r | m68000 | m68k | m88k | mcore \
| ip2k | iq2000 \
| m32c | m32r | m32rle | m68000 | m68k | m88k \
| maxq | mb | microblaze | mcore | mep \
| mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \
| mips64 | mips64el \
@ -244,27 +257,42 @@ case $basic_machine in
| mips64vr4100 | mips64vr4100el \
| mips64vr4300 | mips64vr4300el \
| mips64vr5000 | mips64vr5000el \
| mips64vr5900 | mips64vr5900el \
| mipsisa32 | mipsisa32el \
| mipsisa32r2 | mipsisa32r2el \
| mipsisa64 | mipsisa64el \
| mipsisa64r2 | mipsisa64r2el \
| mipsisa64sb1 | mipsisa64sb1el \
| mipsisa64sr71k | mipsisa64sr71kel \
| mipstx39 | mipstx39el \
| mn10200 | mn10300 \
| mt \
| msp430 \
| nios | nios2 \
| ns16k | ns32k \
| openrisc | or32 \
| or32 \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
| pyramid \
<<<<<<< .mine
| score \
| sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
=======
| sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
>>>>>>> .r627
| sh64 | sh64le \
<<<<<<< .mine
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
| spu | strongarm \
=======
| sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
| strongarm \
>>>>>>> .r627
| tahoe | thumb | tic4x | tic80 | tron \
| v850 | v850e \
| we32k \
| x86 | xscale | xstormy16 | xtensa \
| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
| z8k)
basic_machine=$basic_machine-unknown
;;
@ -275,6 +303,9 @@ case $basic_machine in
;;
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
;;
ms1)
basic_machine=mt-unknown
;;
# We use `pc' rather than `unknown'
# because (1) that's what they normally are, and
@ -294,20 +325,20 @@ case $basic_machine in
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
| alphapca5[67]-* | alpha64pca5[67]-* | amd64-* | arc-* \
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| avr-* \
| bs2000-* \
| avr-* | avr32-* \
| bfin-* | bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
| clipper-* | cydra-* \
| clipper-* | craynv-* | cydra-* \
| d10v-* | d30v-* | dlx-* \
| elxsi-* \
| f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
| h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| i*86-* | i860-* | i960-* | ia64-* \
| ip2k-* \
| m32r-* \
| ip2k-* | iq2000-* \
| m32c-* | m32r-* | m32rle-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
| m88110-* | m88k-* | mcore-* \
| m88110-* | m88k-* | maxq-* | mcore-* \
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
| mips16-* \
| mips64-* | mips64el-* \
@ -316,30 +347,45 @@ case $basic_machine in
| mips64vr4100-* | mips64vr4100el-* \
| mips64vr4300-* | mips64vr4300el-* \
| mips64vr5000-* | mips64vr5000el-* \
| mips64vr5900-* | mips64vr5900el-* \
| mipsisa32-* | mipsisa32el-* \
| mipsisa32r2-* | mipsisa32r2el-* \
| mipsisa64-* | mipsisa64el-* \
| mipsisa64r2-* | mipsisa64r2el-* \
| mipsisa64sb1-* | mipsisa64sb1el-* \
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
| mipstx39-* | mipstx39el-* \
| mmix-* \
| mt-* \
| msp430-* \
| none-* | np1-* | nv1-* | ns16k-* | ns32k-* \
| nios-* | nios2-* \
| none-* | np1-* | ns16k-* | ns32k-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
| pyramid-* \
| romp-* | rs6000-* \
<<<<<<< .mine
| sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
=======
| sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
>>>>>>> .r627
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
<<<<<<< .mine
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
| sparclite-* \
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
=======
| sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
| sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
>>>>>>> .r627
| tahoe-* | thumb-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
| tron-* \
| v850-* | v850e-* | vax-* \
| we32k-* \
| x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
| xtensa-* \
| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
| xstormy16-* | xtensa-* \
| ymp-* \
| z8k-*)
;;
@ -359,6 +405,9 @@ case $basic_machine in
basic_machine=a29k-amd
os=-udi
;;
abacus)
basic_machine=abacus-unknown
;;
adobe68k)
basic_machine=m68010-adobe
os=-scout
@ -376,6 +425,9 @@ case $basic_machine in
amd64)
basic_machine=x86_64-pc
;;
amd64-*)
basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
amdahl)
basic_machine=580-amdahl
os=-sysv
@ -435,12 +487,27 @@ case $basic_machine in
basic_machine=j90-cray
os=-unicos
;;
craynv)
basic_machine=craynv-cray
os=-unicosmp
;;
cr16)
basic_machine=cr16-unknown
os=-elf
;;
crds | unos)
basic_machine=m68k-crds
;;
crisv32 | crisv32-* | etraxfs*)
basic_machine=crisv32-axis
;;
cris | cris-* | etrax*)
basic_machine=cris-axis
;;
crx)
basic_machine=crx-unknown
os=-elf
;;
da30 | da30-*)
basic_machine=m68k-da30
;;
@ -463,6 +530,10 @@ case $basic_machine in
basic_machine=m88k-motorola
os=-sysv3
;;
djgpp)
basic_machine=i586-pc
os=-msdosdjgpp
;;
dpx20 | dpx20-*)
basic_machine=rs6000-bull
os=-bosx
@ -628,6 +699,10 @@ case $basic_machine in
basic_machine=i386-pc
os=-mingw32
;;
mingw32ce)
basic_machine=arm-unknown
os=-mingw32ce
;;
miniframe)
basic_machine=m68000-convergent
;;
@ -641,10 +716,6 @@ case $basic_machine in
mips3*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
;;
mmix*)
basic_machine=mmix-knuth
os=-mmixware
;;
monitor)
basic_machine=m68k-rom68k
os=-coff
@ -657,6 +728,9 @@ case $basic_machine in
basic_machine=i386-pc
os=-msdos
;;
ms1-*)
basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
;;
mvs)
basic_machine=i370-ibm
os=-mvs
@ -725,10 +799,6 @@ case $basic_machine in
np1)
basic_machine=np1-gould
;;
nv1)
basic_machine=nv1-cray
os=-unicosmp
;;
nsr-tandem)
basic_machine=nsr-tandem
;;
@ -736,9 +806,12 @@ case $basic_machine in
basic_machine=hppa1.1-oki
os=-proelf
;;
or32 | or32-*)
openrisc | openrisc-*)
basic_machine=or32-unknown
os=-coff
;;
os400)
basic_machine=powerpc-ibm
os=-os400
;;
OSE68000 | ose68000)
basic_machine=m68000-ericsson
@ -765,6 +838,12 @@ case $basic_machine in
pc532 | pc532-*)
basic_machine=ns32k-pc532
;;
pc98)
basic_machine=i386-pc
;;
pc98-*)
basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentium | p5 | k5 | k6 | nexgen | viac3)
basic_machine=i586-pc
;;
@ -821,6 +900,10 @@ case $basic_machine in
basic_machine=i586-unknown
os=-pw32
;;
rdos)
basic_machine=i386-pc
os=-rdos
;;
rom68k)
basic_machine=m68k-rom68k
os=-coff
@ -847,6 +930,10 @@ case $basic_machine in
sb1el)
basic_machine=mipsisa64sb1el-unknown
;;
sde)
basic_machine=mipsisa32-sde
os=-elf
;;
sei)
basic_machine=mips-sei
os=-seiux
@ -858,6 +945,9 @@ case $basic_machine in
basic_machine=sh-hitachi
os=-hms
;;
sh5el)
basic_machine=sh5le-unknown
;;
sh64)
basic_machine=sh64-unknown
;;
@ -960,6 +1050,10 @@ case $basic_machine in
tower | tower-32)
basic_machine=m68k-ncr
;;
tpf)
basic_machine=s390x-ibm
os=-tpf
;;
udi29k)
basic_machine=a29k-amd
os=-udi
@ -1003,6 +1097,10 @@ case $basic_machine in
basic_machine=hppa1.1-winbond
os=-proelf
;;
xbox)
basic_machine=i686-pc
os=-mingw32
;;
xps | xps100)
basic_machine=xps100-honeywell
;;
@ -1033,6 +1131,9 @@ case $basic_machine in
romp)
basic_machine=romp-ibm
;;
mmix)
basic_machine=mmix-knuth
;;
rs6000)
basic_machine=rs6000-ibm
;;
@ -1049,13 +1150,17 @@ case $basic_machine in
we32k)
basic_machine=we32k-att
;;
sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
basic_machine=sh-unknown
;;
<<<<<<< .mine
sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
=======
sh64)
basic_machine=sh64-unknown
;;
sparc | sparcv9 | sparcv9b)
>>>>>>> .r627
basic_machine=sparc-sun
;;
cydra)
@ -1128,19 +1233,28 @@ case $os in
| -aos* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
<<<<<<< .mine
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
| -openbsd* | -solidbsd* \
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
=======
| -hiux* | -386bsd* | -netbsd* | -openbsd* | -kfreebsd* | -freebsd* | -riscix* \
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
>>>>>>> .r627
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
| -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
| -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei*)
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
| -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
@ -1158,12 +1272,15 @@ case $os in
os=`echo $os | sed -e 's|nto|nto-qnx|'`
;;
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
| -windows* | -osx | -abug | -netware* | -os9* | -beos* \
| -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
| -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
;;
-mac*)
os=`echo $os | sed -e 's|mac|macos|'`
;;
-linux-dietlibc)
os=-linux-dietlibc
;;
-linux*)
os=`echo $os | sed -e 's|linux|linux-gnu|'`
;;
@ -1176,6 +1293,9 @@ case $os in
-opened*)
os=-openedition
;;
-os400*)
os=-os400
;;
-wince*)
os=-wince
;;
@ -1197,6 +1317,9 @@ case $os in
-atheos*)
os=-atheos
;;
-syllable*)
os=-syllable
;;
-386bsd)
os=-bsd
;;
@ -1219,6 +1342,9 @@ case $os in
-sinix*)
os=-sysv4
;;
-tpf*)
os=-tpf
;;
-triton*)
os=-sysv3
;;
@ -1255,6 +1381,9 @@ case $os in
-kaos*)
os=-kaos
;;
-zvmoe)
os=-zvmoe
;;
-none)
;;
*)
@ -1277,6 +1406,12 @@ else
# system, and we'll never get to this point.
case $basic_machine in
score-*)
os=-elf
;;
spu-*)
os=-elf
;;
*-acorn)
os=-riscix1.2
;;
@ -1286,9 +1421,15 @@ case $basic_machine in
arm*-semi)
os=-aout
;;
<<<<<<< .mine
c4x-* | tic4x-*)
os=-coff
;;
=======
c4x-* | tic4x-*)
os=-coff
;;
>>>>>>> .r627
# This must come before the *-dec entry.
pdp10-*)
os=-tops20
@ -1314,6 +1455,9 @@ case $basic_machine in
m68*-cisco)
os=-aout
;;
mep-*)
os=-elf
;;
mips*-cisco)
os=-elf
;;
@ -1332,9 +1476,15 @@ case $basic_machine in
*-be)
os=-beos
;;
*-haiku)
os=-haiku
;;
*-ibm)
os=-aix
;;
*-knuth)
os=-mmixware
;;
*-wec)
os=-proelf
;;
@ -1467,9 +1617,15 @@ case $basic_machine in
-mvs* | -opened*)
vendor=ibm
;;
-os400*)
vendor=ibm
;;
-ptx*)
vendor=sequent
;;
-tpf*)
vendor=ibm
;;
-vxsim* | -vxworks* | -windiss*)
vendor=wrs
;;
@ -1494,7 +1650,7 @@ case $basic_machine in
esac
echo $basic_machine$os
exit 0
exit
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)

View File

@ -113,7 +113,8 @@ esac
# These must not be set unconditionally because not all systems understand
# e.g. LANG=C (notably SCO).
# We save the old values to restore during execute mode.
for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
lt_env=
for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
do
eval "if test \"\${$lt_var+set}\" = set; then
save_$lt_var=\$$lt_var
@ -122,6 +123,10 @@ do
fi"
done
if test -n "$lt_env"; then
lt_env="env $lt_env"
fi
# Make sure IFS has a sensible default
lt_nl='
'
@ -817,6 +822,7 @@ if test -z "$show_help"; then
*.for) xform=for ;;
*.java) xform=java ;;
*.obj) xform=obj ;;
*.sx) xform=sx ;;
esac
libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
@ -985,7 +991,7 @@ EOF
$run $rm "$lobj" "$output_obj"
$show "$command"
if $run eval "$command"; then :
if $run eval $lt_env "$command"; then :
else
test -n "$output_obj" && $run $rm $removelist
exit $EXIT_FAILURE
@ -1057,7 +1063,7 @@ EOF
command="$command$suppress_output"
$run $rm "$obj" "$output_obj"
$show "$command"
if $run eval "$command"; then :
if $run eval $lt_env "$command"; then :
else
$run $rm $removelist
exit $EXIT_FAILURE
@ -1190,6 +1196,7 @@ EOF
thread_safe=no
vinfo=
vinfo_number=no
single_module="${wl}-single_module"
func_infer_tag $base_compile
@ -1676,6 +1683,11 @@ EOF
continue
;;
-multi_module)
single_module="${wl}-multi_module"
continue
;;
-module)
module=yes
continue
@ -2152,7 +2164,10 @@ EOF
case $pass in
dlopen) libs="$dlfiles" ;;
dlpreopen) libs="$dlprefiles" ;;
link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
link)
libs="$deplibs %DEPLIBS%"
test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
;;
esac
fi
if test "$pass" = dlopen; then
@ -2202,7 +2217,12 @@ EOF
continue
fi
name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
if test "$linkmode" = lib; then
searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
else
searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
fi
for searchdir in $searchdirs; do
for search_ext in .la $std_shrext .so .a; do
# Search the libtool library
lib="$searchdir/lib${name}${search_ext}"
@ -2998,12 +3018,18 @@ EOF
# we do not want to link against static libs,
# but need to link against shared
eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
eval deplibdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
if test -n "$deplibrary_names" ; then
for tmp in $deplibrary_names ; do
depdepl=$tmp
done
if test -f "$path/$depdepl" ; then
if test -f "$deplibdir/$depdepl" ; then
depdepl="$deplibdir/$depdepl"
elif test -f "$path/$depdepl" ; then
depdepl="$path/$depdepl"
else
# Can't find it, oh well...
depdepl=
fi
# do not add paths which are already there
case " $newlib_search_path " in
@ -3151,9 +3177,10 @@ EOF
case $linkmode in
oldlib)
if test -n "$deplibs"; then
$echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
fi
case " $deplibs" in
*\ -l* | *\ -L*)
$echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 ;;
esac
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
$echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
@ -3297,6 +3324,11 @@ EOF
revision="$number_minor"
lt_irix_increment=no
;;
*)
$echo "$modename: unknown library version type \`$version_type'" 1>&2
$echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
exit $EXIT_FAILURE
;;
esac
;;
no)
@ -4290,9 +4322,10 @@ EOF
;;
obj)
if test -n "$deplibs"; then
$echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
fi
case " $deplibs" in
*\ -l* | *\ -L*)
$echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 ;;
esac
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
$echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
@ -6534,7 +6567,7 @@ relink_command=\"$relink_command\""
fi
# Restore saved environment variables
for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
do
eval "if test \"\${save_$lt_var+set}\" = set; then
$lt_var=\$save_$lt_var; export $lt_var

View File

@ -1682,6 +1682,7 @@ static switch_status_t load_config(void)
zap_log(ZAP_LOG_ERROR, "Error starting OpenZAP span %d\n", span_id);
continue;
}
zap_log(ZAP_LOG_ERROR, "SPANID = %i\n", span->span_id);
SPAN_CONFIG[span->span_id].span = span;
switch_set_string(SPAN_CONFIG[span->span_id].context, context);
@ -1838,7 +1839,7 @@ static switch_status_t load_config(void)
int q921loglevel = -1;
int q931loglevel = -1;
// quick debug
// switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ID: '%s', Name:'%s'\n",id,name);
//switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ID: '%s', Name:'%s'\n",id,name);
for (param = switch_xml_child(myspan, "param"); param; param = param->next) {
char *var = (char *) switch_xml_attr_soft(param, "name");
@ -1895,11 +1896,11 @@ static switch_status_t load_config(void)
zap_log(ZAP_LOG_ERROR, "Error finding OpenZAP span id:%s name:%s\n", switch_str_nil(id), switch_str_nil(name));
continue;
}
if (!span_id) {
span_id = span->span_id;
}
if (!span_id) {
span_id = span->span_id;
}
if (!tonegroup) {
tonegroup = "us";
}
@ -2055,7 +2056,7 @@ void dump_chan(zap_span_t *span, uint32_t chan_id, switch_stream_handle_t *strea
);
}
#define OZ_SYNTAX "list || dump <span_id> [<chan_id>]"
#define OZ_SYNTAX "list || dump <span_id> [<chan_id>] || bounce <span_id> [<chan_id>] || q931_pcap <span_id> on|off [pcapfilename without suffix]"
SWITCH_STANDARD_API(oz_function)
{
char *mycmd = NULL, *argv[10] = { 0 };
@ -2139,7 +2140,7 @@ SWITCH_STANDARD_API(oz_function)
} else if (!strcasecmp(argv[0], "bounce")) {
/* MSC testing "oz bounce" command */
if (argc < 2) {
stream->write_function(stream, "-ERR Usage: oz dump <span_id> [<chan_id>]\n");
stream->write_function(stream, "-ERR Usage: oz bounce <span_id> [<chan_id>]\n");
goto end;
} else {
int32_t span_id, chan_id = 0;
@ -2169,9 +2170,59 @@ SWITCH_STANDARD_API(oz_function)
}
}
}
/*Q931ToPcap enhancement*/
} else if (!strcasecmp(argv[0], "q931_pcap")) {
int32_t span_id = 0;
zap_span_t *span;
char *pcapfn = NULL;
char *tmp_path = NULL;
if (argc < 3) {
stream->write_function(stream, "-ERR Usage: oz q931_pcap <span_id> on|off [pcapfilename without suffix]\n");
goto end;
}
span_id = atoi(argv[1]);
if (!(span_id && (span = SPAN_CONFIG[span_id].span))) {
stream->write_function(stream, "-ERR invalid span\n");
goto end;
}
/*Look for a given file name or use default file name*/
if (argc > 3) {
if(argv[3]){
pcapfn=argv[3];
}
}
else {
pcapfn="q931";
}
/*Add log directory path to file name*/
tmp_path=switch_mprintf("%s%s%s.pcap", SWITCH_GLOBAL_dirs.log_dir, SWITCH_PATH_SEPARATOR, pcapfn);
if(!strcasecmp(argv[2], "on")) {
if (zap_configure_span("isdn", span, on_clear_channel_signal, "q931topcap", 1, "pcapfilename", tmp_path, TAG_END) != ZAP_SUCCESS) {
zap_log(ZAP_LOG_WARNING, "Error couldn't (re-)enable Q931-To-Pcap!\n");
goto end;
} else {
stream->write_function(stream, "+OK\n");
}
} else if(!strcasecmp(argv[2], "off")) {
if (zap_configure_span("isdn", span, on_clear_channel_signal, "q931topcap", 0, TAG_END) != ZAP_SUCCESS) {
zap_log(ZAP_LOG_ERROR, "Error couldn't enable Q931-To-Pcap!\n");
goto end;
} else {
stream->write_function(stream, "+OK\n");
}
} else {
stream->write_function(stream, "-ERR Usage: oz q931_pcap on|off [pcapfilename without suffix]\n");
goto end;
}
} else {
stream->write_function(stream, "-ERR Usage: oz list || dump <span_id> [<chan_id>]\n");
stream->write_function(stream, "-ERR Usage: %s\n", OZ_SYNTAX);
}
/*Q931ToPcap enhancement done*/
end:

View File

@ -49,6 +49,207 @@
#define ZAP_SPAN_IS_NT(x) (((zap_isdn_data_t *)(x)->signal_data)->mode == Q921_NT)
/*-------------------------------------------------------------------------*/
/*Q931ToPcap functions*/
#include <pcap.h>
#include <stdio.h>
#include <arpa/inet.h>
#include <sys/types.h>
#include <string.h>
#define SNAPLEN 1522
#define MAX_ETHER_PAYLOAD_SIZE 1500
#define MIN_ETHER_PAYLOAD_SIZE 42
#define SIZE_ETHERNET 18
#define VLANID_OFFSET 15
#define SIZE_IP 20
#define SIZE_TCP 20
#define SIZE_TPKT 4
#define SIZE_ETHERNET_CRC 4
#define OVERHEAD SIZE_ETHERNET+SIZE_IP+SIZE_TCP+SIZE_TPKT
#define MAX_Q931_SIZE MAX_ETHER_PAYLOAD_SIZE-SIZE_IP-SIZE_TCP-SIZE_TPKT
#define TPKT_SIZE_OFFSET SIZE_ETHERNET+SIZE_IP+SIZE_TCP+2
#define IP_SIZE_OFFSET SIZE_ETHERNET+2
#define TCP_SEQ_OFFSET SIZE_ETHERNET+SIZE_IP+4
/*Some globals*/
unsigned long pcapfilesize = 0;
unsigned long tcp_next_seq_no_send = 0;
unsigned long tcp_next_seq_no_rec = 0;
pcap_dumper_t *pcapfile = NULL;
struct pcap_pkthdr pcaphdr;
pcap_t *pcaphandle = NULL;
char *pcapfn = NULL;
int do_q931ToPcap= 0;
static zap_status_t openPcapFile(void)
{
if(!pcaphandle)
{
pcaphandle = pcap_open_dead(DLT_EN10MB, SNAPLEN);
if (!pcaphandle)
{
zap_log(ZAP_LOG_ERROR, "Can't open pcap session: (%s)\n", pcap_geterr(pcaphandle));
return ZAP_FAIL;
}
}
if(!pcapfile){
/* Open the dump file */
if(!(pcapfile=pcap_dump_open(pcaphandle, pcapfn))){
zap_log(ZAP_LOG_ERROR, "Error opening output file (%s)\n", pcap_geterr(pcaphandle));
return ZAP_FAIL;
}
}
else{
zap_log(ZAP_LOG_WARNING, "Pcap file is already open!\n");
return ZAP_FAIL;
}
zap_log(ZAP_LOG_DEBUG, "Pcap file '%s' successfully opened!\n", pcapfn);
pcaphdr.ts.tv_sec = 0;
pcaphdr.ts.tv_usec = 0;
pcapfilesize = 24; /*current pcap file header seems to be 24 bytes*/
tcp_next_seq_no_send = 0;
tcp_next_seq_no_rec = 0;
return ZAP_SUCCESS;
}
static zap_status_t closePcapFile(void)
{
if(pcapfile){
pcap_dump_close(pcapfile);
if(pcaphandle) pcap_close(pcaphandle);
zap_log(ZAP_LOG_DEBUG, "Pcap file closed! File size is %lu bytes.\n", pcapfilesize);
pcaphdr.ts.tv_sec = 0;
pcaphdr.ts.tv_usec = 0;
pcapfile = NULL;
pcaphandle = NULL;
pcapfilesize = 0;
tcp_next_seq_no_send = 0;
tcp_next_seq_no_rec = 0;
}
/*We have allways success with this? I think so*/
return ZAP_SUCCESS;
}
static zap_status_t writeQ931PacketToPcap(L3UCHAR* q931buf, L3USHORT q931size, L3ULONG span_id, L3USHORT direction)
{
L3UCHAR *frame = NULL;
u_char spanid = (u_char)span_id;
unsigned long *tcp_next_seq_no = NULL;
spanid=span_id;
/*Predefined Ethernet Frame with Q931-over-IP encapsulated - From remote TDM host to FreeSWITCH*/
L3UCHAR recFrame[SNAPLEN]= {
/*IEEE 802.3 VLAN 802.1q Ethernet Frame Header*/
2,0,1,0xAA,0xAA,0xAA,2,0,1,0xBB,0xBB,0xBB,0x81,0,0xE0,0,0x08,0,
/*IPv4 Header (minimal size; no options)*/
0x45,0,0,44,0,0,0,0,64,6,0,0,2,2,2,2,1,1,1,1,
/*TCP-Header*/
0,0x66,0,0x66,0,0,0,0,0,0,0,0,0x50,0,0,1,0,0,0,0,
/*TPKT-Header RFC 1006*/
3,0,0,0
};
/*Predefined Ethernet Frame with Q931-over-IP encapsulated - Frome FreeSWITCH to remote TDM host*/
L3UCHAR sendFrame[SNAPLEN]= {
/*IEEE 802.3 VLAN 802.1q Ethernet Frame Header*/
2,0,1,0xBB,0xBB,0xBB,2,0,1,0xAA,0xAA,0xAA,0x81,0,0xE0,0,0x08,0,
/*IPv4 Header (minimal size; no options)*/
0x45,0,0,44,0,0,0,0,64,6,0,0,1,1,1,1,2,2,2,2,
/*TCP-Header*/
0,0x66,0,0x66,0,0,0,0,0,0,0,0,0x50,0,0,1,0,0,0,0,
/*TPKT-Header RFC 1006*/
3,0,0,0
};
/*The total length of the ethernet frame generated by this function has a min length of 66
so we don't have to care about padding :)*/
/*FS is sending the packet*/
if(direction==0){
frame=sendFrame;
tcp_next_seq_no = &tcp_next_seq_no_send;
}
/*FS is receiving the packet*/
else{
frame=recFrame;
tcp_next_seq_no = &tcp_next_seq_no_rec;
}
/*Set spanid in VLAN-ID tag*/
frame[VLANID_OFFSET] = spanid;
/*** Write sent packet ***/
if(q931size > MAX_Q931_SIZE)
{
/*WARNING*/
zap_log(ZAP_LOG_WARNING, "Q931 packet size is too big (%u)! Limitting it to %u! Q931 packet will be corrupt.\n", q931size, MAX_Q931_SIZE);
q931size=MAX_Q931_SIZE;
}
/*Copy q931 buffer into frame*/
memcpy(frame+OVERHEAD,q931buf,q931size);
/*Store TCP sequence number in TCP header*/
frame[TCP_SEQ_OFFSET]=(*tcp_next_seq_no>>24)&0xFF;
frame[TCP_SEQ_OFFSET+1]=(*tcp_next_seq_no>>16)&0xFF;
frame[TCP_SEQ_OFFSET+2]=(*tcp_next_seq_no>>8)&0xFF;
frame[TCP_SEQ_OFFSET+3]=*tcp_next_seq_no & 0xFF;
/*Store size of TPKT packet*/
q931size+=4;
frame[TPKT_SIZE_OFFSET]=(q931size>>8)&0xFF;
frame[TPKT_SIZE_OFFSET+1]=q931size&0xFF;
/*Calc next TCP sequence number*/
*tcp_next_seq_no+=q931size;
/*Store size of IP packet*/
q931size+=SIZE_IP+SIZE_TCP;
frame[IP_SIZE_OFFSET]=(q931size>>8)&0xFF;
frame[IP_SIZE_OFFSET+1]=q931size&0xFF;
pcaphdr.caplen = SIZE_ETHERNET+SIZE_ETHERNET_CRC+q931size;
pcaphdr.len = pcaphdr.caplen;
pcap_dump((u_char*)pcapfile, &pcaphdr, frame);
pcap_dump_flush(pcapfile);
/*Increase microsecond timestamp by 1*/
pcaphdr.ts.tv_usec++;
if(pcaphdr.ts.tv_usec==1000000)
{
pcaphdr.ts.tv_sec++;
pcaphdr.ts.tv_usec=0;
}
/*Maintain pcap file size*/
pcapfilesize+=pcaphdr.caplen;
pcapfilesize+=sizeof(struct pcap_pkthdr);
zap_log(ZAP_LOG_DEBUG, "Added %u bytes to pcap file. File size is now %lu, \n", q931size, pcapfilesize);
return ZAP_SUCCESS;
}
static ZIO_IO_UNLOAD_FUNCTION(close_pcap)
{
return closePcapFile();
}
/*Q931ToPcap functions DONE*/
/*-------------------------------------------------------------------------*/
static L2ULONG zap_time_now(void)
{
return (L2ULONG)zap_current_time_in_ms();
@ -769,12 +970,20 @@ static int zap_isdn_921_23(void *pvt, Q921DLMsg_t ind, L2UCHAR tei, L2UCHAR *msg
{
int ret, offset = (ind == Q921_DL_DATA) ? 4 : 3;
char bb[4096] = "";
zap_span_t *span = (zap_span_t *) pvt; /*To get access to spanid for Q931ToPcap*/
switch(ind) {
case Q921_DL_DATA:
case Q921_DL_UNIT_DATA:
print_hex_bytes(msg + offset, mlen - offset, bb, sizeof(bb));
zap_log(ZAP_LOG_DEBUG, "READ %d\n%s\n%s\n\n", (int)mlen - offset, LINE, bb);
/*Q931ToPcap*/
if(do_q931ToPcap==1){
if(writeQ931PacketToPcap(msg + offset, mlen - offset, span->span_id, 1) != ZAP_SUCCESS){
zap_log(ZAP_LOG_WARNING, "Couldn't write Q931 buffer to pcap file!\n");
}
}
/*Q931ToPcap done*/
zap_log(ZAP_LOG_DEBUG, "READ %d\n%s\n%s\n\n\n", (int)mlen - offset, LINE, bb);
default:
ret = Q931Rx23(pvt, ind, tei, msg, mlen);
if (ret != 0)
@ -1519,6 +1728,7 @@ static int q931_rx_32(void *pvt, Q921DLMsg_t ind, L3UCHAR tei, L3UCHAR *msg, L3I
{
int offset = 4;
char bb[4096] = "";
zap_span_t *span = (zap_span_t *) pvt; /*To get access to span_id for Q931ToPcap*/
switch(ind) {
case Q921_DL_UNIT_DATA:
@ -1526,6 +1736,13 @@ static int q931_rx_32(void *pvt, Q921DLMsg_t ind, L3UCHAR tei, L3UCHAR *msg, L3I
case Q921_DL_DATA:
print_hex_bytes(msg + offset, mlen - offset, bb, sizeof(bb));
/*Q931ToPcap*/
if(do_q931ToPcap==1){
if(writeQ931PacketToPcap(msg + offset, mlen - offset, span->span_id, 0) != ZAP_SUCCESS){
zap_log(ZAP_LOG_WARNING, "Couldn't write Q931 buffer to pcap file!\n");
}
}
/*Q931ToPcap done*/
zap_log(ZAP_LOG_DEBUG, "WRITE %d\n%s\n%s\n\n", (int)mlen - offset, LINE, bb);
break;
@ -1696,8 +1913,38 @@ static ZIO_SIG_CONFIGURE_FUNCTION(zap_isdn_configure_span)
int32_t digit_timeout = 0;
int q921loglevel = -1;
int q931loglevel = -1;
int q931topcap = -1; /*Q931ToPcap*/
int openPcap = 0; /*Flag: open Pcap file please*/
if (span->signal_type) {
/*Q931ToPcap: Get the content of the q931topcap and pcapfilename args given by mod_openzap */
while((var = va_arg(ap, char *))) {
if (!strcasecmp(var, "q931topcap")) {
q931topcap = va_arg(ap, int);
if(q931topcap==1) {
/*PCAP on*/;
openPcap=1;
}
else if(q931topcap==0){
/*PCAP off*/
if(closePcapFile() != ZAP_SUCCESS) return ZAP_FAIL;
do_q931ToPcap=0;
return ZAP_SUCCESS;
}
}
if (!strcasecmp(var, "pcapfilename")) {
/*Put filename into global var*/
pcapfn = va_arg(ap, char*);
}
}
/*We know now, that user wants to enable Q931ToPcap and what file name he wants, so open it please*/
if(openPcap==1){
if(openPcapFile() != ZAP_SUCCESS) return ZAP_FAIL;
do_q931ToPcap=1;
return ZAP_SUCCESS;
}
/*Q931ToPcap done*/
snprintf(span->last_error, sizeof(span->last_error), "Span is already configured for signalling [%d].", span->signal_type);
return ZAP_FAIL;
}
@ -1863,17 +2110,17 @@ static ZIO_SIG_CONFIGURE_FUNCTION(zap_isdn_configure_span)
return ZAP_SUCCESS;
}
zap_module_t zap_module = {
"isdn",
NULL,
NULL,
close_pcap,
zap_isdn_init,
zap_isdn_configure_span,
NULL
};
/* For Emacs:
* Local Variables:
* mode:c