From: <kr...@us...> - 2007-04-19 18:46:39
|
Revision: 899 http://svn.sourceforge.net/astlinux/?rev=899&view=rev Author: krisk84 Date: 2007-04-19 11:46:33 -0700 (Thu, 19 Apr 2007) Log Message: ----------- add ethtool package Modified Paths: -------------- trunk/package/Config.in Added Paths: ----------- trunk/package/ethtool/ trunk/package/ethtool/Config.in trunk/package/ethtool/ethtool.mk Modified: trunk/package/Config.in =================================================================== --- trunk/package/Config.in 2007-04-19 18:22:55 UTC (rev 898) +++ trunk/package/Config.in 2007-04-19 18:46:33 UTC (rev 899) @@ -61,6 +61,7 @@ source "package/dnsmasq/Config.in" source "package/dropbear/Config.in" source "package/efax/Config.in" +source "package/ethtool/Config.in" source "package/expat/Config.in" source "package/e2fsprogs/Config.in" source "package/fakeroot/Config.in" Added: trunk/package/ethtool/Config.in =================================================================== --- trunk/package/ethtool/Config.in (rev 0) +++ trunk/package/ethtool/Config.in 2007-04-19 18:46:33 UTC (rev 899) @@ -0,0 +1,8 @@ +config BR2_PACKAGE_ETHTOOL + bool "ethtool" + default n + help + ethtool is a small utility for examining and tuning your + ethernet-based network interface. + + http://sourceforge.net/projects/gkernel/ Added: trunk/package/ethtool/ethtool.mk =================================================================== --- trunk/package/ethtool/ethtool.mk (rev 0) +++ trunk/package/ethtool/ethtool.mk 2007-04-19 18:46:33 UTC (rev 899) @@ -0,0 +1,58 @@ +############################################################# +# +# ethtool +# +############################################################# + +ETHTOOL_VERSION=3 +ETHTOOL_SOURCE=ethtool-$(ETHTOOL_VERSION).tar.gz +ETHTOOL_SITE=http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/gkernel/ +ETHTOOL_DIR=$(BUILD_DIR)/ethtool-$(ETHTOOL_VERSION) +ETHTOOL_CAT:=zcat + +$(DL_DIR)/$(ETHTOOL_SOURCE): + $(WGET) -P $(DL_DIR) $(ETHTOOL_SITE)/$(ETHTOOL_SOURCE) + +$(ETHTOOL_DIR)/.unpacked: $(DL_DIR)/$(ETHTOOL_SOURCE) + $(ETHTOOL_CAT) $(DL_DIR)/$(ETHTOOL_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) - + touch $(ETHTOOL_DIR)/.unpacked + +$(ETHTOOL_DIR)/.configured: $(ETHTOOL_DIR)/.unpacked + (cd $(ETHTOOL_DIR); rm -rf config.cache; \ + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS)" \ + LDFLAGS="$(TARGET_LDFLAGS)" \ + ./configure \ + --target=$(GNU_TARGET_NAME) \ + --host=$(GNU_TARGET_NAME) \ + --build=$(GNU_HOST_NAME) \ + --prefix=/usr \ + --sysconfdir=/etc \ + ); + touch $(ETHTOOL_DIR)/.configured + +$(ETHTOOL_DIR)/ethtool: $(ETHTOOL_DIR)/.configured + $(MAKE) CC=$(TARGET_CC) -C $(ETHTOOL_DIR) + +$(TARGET_DIR)/usr/sbin/ethtool: $(ETHTOOL_DIR)/ethtool + $(INSTALL) -D -m 0755 $(ETHTOOL_DIR)/ethtool $(TARGET_DIR)/usr/sbin/ethtool + $(STRIP) $(TARGET_DIR)/usr/sbin/ethtool + +ethtool: uclibc $(TARGET_DIR)/usr/sbin/ethtool + +ethtool-source: $(DL_DIR)/$(ETHTOOL_SOURCE) + +ethtool-clean: + $(MAKE) -C $(ETHTOOL_DIR) clean + -rm $(TARGET_DIR)/usr/sbin/ethtool + +ethtool-dirclean: + rm -rf $(ETHTOOL_DIR) +############################################################# +# +# Toplevel Makefile options +# +############################################################# +ifeq ($(strip $(BR2_PACKAGE_ETHTOOL)),y) +TARGETS+=ethtool +endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kr...@us...> - 2007-04-25 01:50:18
|
Revision: 945 http://svn.sourceforge.net/astlinux/?rev=945&view=rev Author: krisk84 Date: 2007-04-24 18:50:20 -0700 (Tue, 24 Apr 2007) Log Message: ----------- remove microcom - dead mirrors Modified Paths: -------------- trunk/package/Config.in Removed Paths: ------------- trunk/package/microcom/ Modified: trunk/package/Config.in =================================================================== --- trunk/package/Config.in 2007-04-25 01:46:58 UTC (rev 944) +++ trunk/package/Config.in 2007-04-25 01:50:20 UTC (rev 945) @@ -114,7 +114,6 @@ source "package/mdadm/Config.in" source "package/mdnsresponder/Config.in" source "package/memtester/Config.in" -source "package/microcom/Config.in" source "package/microperl/Config.in" source "package/microwin/Config.in" source "package/minihttpd/Config.in" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kr...@us...> - 2007-04-25 01:54:59
|
Revision: 946 http://svn.sourceforge.net/astlinux/?rev=946&view=rev Author: krisk84 Date: 2007-04-24 18:55:00 -0700 (Tue, 24 Apr 2007) Log Message: ----------- remove mrouted - dead mirrors Modified Paths: -------------- trunk/package/Config.in Removed Paths: ------------- trunk/package/mrouted/ Modified: trunk/package/Config.in =================================================================== --- trunk/package/Config.in 2007-04-25 01:50:20 UTC (rev 945) +++ trunk/package/Config.in 2007-04-25 01:55:00 UTC (rev 946) @@ -122,7 +122,6 @@ source "package/modutils/Config.in" source "package/mpfr/Config.in" source "package/mpg123/Config.in" -source "package/mrouted/Config.in" source "package/msmtp/Config.in" source "package/mtd/Config.in" source "package/nano/Config.in" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kr...@us...> - 2007-04-25 01:59:07
|
Revision: 948 http://svn.sourceforge.net/astlinux/?rev=948&view=rev Author: krisk84 Date: 2007-04-24 18:59:08 -0700 (Tue, 24 Apr 2007) Log Message: ----------- remote netkit stuff - use busybox Modified Paths: -------------- trunk/package/Config.in Removed Paths: ------------- trunk/package/netkitbase/ trunk/package/netkittelnet/ Modified: trunk/package/Config.in =================================================================== --- trunk/package/Config.in 2007-04-25 01:57:40 UTC (rev 947) +++ trunk/package/Config.in 2007-04-25 01:59:08 UTC (rev 948) @@ -126,8 +126,6 @@ source "package/mtd/Config.in" source "package/nano/Config.in" source "package/ncurses/Config.in" -source "package/netkitbase/Config.in" -source "package/netkittelnet/Config.in" source "package/netplug/Config.in" source "package/netsnmp/Config.in" source "package/newt/Config.in" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kr...@us...> - 2007-04-25 02:38:01
|
Revision: 951 http://svn.sourceforge.net/astlinux/?rev=951&view=rev Author: krisk84 Date: 2007-04-24 19:38:00 -0700 (Tue, 24 Apr 2007) Log Message: ----------- remove tn5250 package Modified Paths: -------------- trunk/package/Config.in Removed Paths: ------------- trunk/package/tn5250/ Modified: trunk/package/Config.in =================================================================== --- trunk/package/Config.in 2007-04-25 02:32:40 UTC (rev 950) +++ trunk/package/Config.in 2007-04-25 02:38:00 UTC (rev 951) @@ -180,7 +180,6 @@ source "package/thttpd/Config.in" source "package/tinylogin/Config.in" source "package/tinyx/Config.in" -source "package/tn5250/Config.in" source "package/ttcp/Config.in" source "package/udev/Config.in" source "package/udhcp/Config.in" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kr...@us...> - 2007-04-25 16:15:17
|
Revision: 964 http://svn.sourceforge.net/astlinux/?rev=964&view=rev Author: krisk84 Date: 2007-04-25 09:15:17 -0700 (Wed, 25 Apr 2007) Log Message: ----------- at compile fixes Modified Paths: -------------- trunk/package/asterisk/asterisk.mk trunk/package/at/at-crosscompile.patch trunk/package/at/at.mk Added Paths: ----------- trunk/package/at/at-sendmailfix.patch Modified: trunk/package/asterisk/asterisk.mk =================================================================== --- trunk/package/asterisk/asterisk.mk 2007-04-25 15:57:26 UTC (rev 963) +++ trunk/package/asterisk/asterisk.mk 2007-04-25 16:15:17 UTC (rev 964) @@ -66,7 +66,7 @@ endif ifeq ($(strip $(BR2_PACKAGE_SPANDSP)),y) - toolchain/patch-kernel.sh $(ASTERISK_DIR)/apps package/asterisk/ spandsp.patch + toolchain/patch-kernel.sh $(ASTERISK_DIR) package/asterisk/ spandsp.patch cp package/asterisk/app_?xfax.c $(ASTERISK_DIR)/apps cp $(TARGET_DIR)/usr/lib/libspandsp* $(STAGING_DIR)/usr/lib cp $(TARGET_DIR)/usr/lib/libtiff* $(STAGING_DIR)/usr/lib Modified: trunk/package/at/at-crosscompile.patch =================================================================== --- trunk/package/at/at-crosscompile.patch 2007-04-25 15:57:26 UTC (rev 963) +++ trunk/package/at/at-crosscompile.patch 2007-04-25 16:15:17 UTC (rev 964) @@ -1,15 +1,38 @@ ---- at/config.h.in -+++ at/config.h.in -@@ -182,3 +182,6 @@ +diff -rdup at-3.1.10.orig/Makefile.in at-3.1.10/Makefile.in +--- at-3.1.10.orig/Makefile.in 2007-01-22 14:35:41.000000000 +0100 ++++ at-3.1.10/Makefile.in 2007-01-22 14:41:41.000000000 +0100 +@@ -62,6 +62,8 @@ MISC = COPYING Makefile.in configure a + DIST = $(CSRCS) $(HEADERS) $(MISC) $(OTHERS) + LIST = Filelist Filelist.asc ++IROOT = $(DESTDIR) ++ + .PHONY: all install clean dist distclean + + all: at atd atrun +@@ -78,7 +80,7 @@ atd: $(RUNOBJECTS) + y.tab.c y.tab.h: parsetime.y + $(YACC) -d parsetime.y + +-lex.yy.c: parsetime.l ++lex.yy.c: parsetime.l y.tab.h + $(LEX) -i parsetime.l + + atrun: atrun.in +diff -rdup at-3.1.10.orig/config.h.in at-3.1.10/config.h.in +--- at-3.1.10.orig/config.h.in 2007-01-22 14:35:41.000000000 +0100 ++++ at-3.1.10/config.h.in 2007-01-22 14:35:35.000000000 +0100 +@@ -181,3 +181,6 @@ + #undef HAVE_ATTRIBUTE_NORETURN #undef HAVE_PAM + +#undef NEED_YYWRAP + ---- at/configure -+++ at/configure -@@ -1037,7 +1037,7 @@ +diff -rdup at-3.1.10.orig/configure at-3.1.10/configure +--- at-3.1.10.orig/configure 2007-01-22 14:35:41.000000000 +0100 ++++ at-3.1.10/configure 2007-01-22 14:35:35.000000000 +0100 +@@ -1037,7 +1037,7 @@ esac echo $ac_n "checking Trying to compile a trivial ANSI C program""... $ac_c" 1>&6 echo "configure:1039: checking Trying to compile a trivial ANSI C program" >&5 if test "$cross_compiling" = yes; then @@ -18,9 +41,10 @@ else cat > conftest.$ac_ext <<EOF #line 1044 "configure" ---- at/getloadavg.c -+++ at/getloadavg.c -@@ -66,11 +66,12 @@ +diff -rdup at-3.1.10.orig/getloadavg.c at-3.1.10/getloadavg.c +--- at-3.1.10.orig/getloadavg.c 2007-01-22 14:35:41.000000000 +0100 ++++ at-3.1.10/getloadavg.c 2007-01-22 14:35:35.000000000 +0100 +@@ -66,11 +66,12 @@ Boston, MA 02110-1301 USA */ /* This should always be first. */ #ifdef HAVE_CONFIG_H @@ -36,22 +60,23 @@ #ifndef HAVE_GETLOADAVG ---- at/Makefile.in -+++ at/Makefile.in -@@ -62,6 +62,8 @@ - DIST = $(CSRCS) $(HEADERS) $(MISC) $(OTHERS) - LIST = Filelist Filelist.asc +diff -rdup at-3.1.10.orig/parsetime.h at-3.1.10/parsetime.h +--- at-3.1.10.orig/parsetime.h 2005-08-05 05:16:01.000000000 +0200 ++++ at-3.1.10/parsetime.h 2007-01-22 14:45:41.000000000 +0100 +@@ -17,6 +17,7 @@ + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ -+IROOT = $(DESTDIR) -+ - .PHONY: all install clean dist distclean ++#include "panic.h" + time_t parsetime(int argc, char **argv); - all: at atd atrun ---- at/parsetime.l -+++ at/parsetime.l + extern char *last_token; +diff -rdup at-3.1.10.orig/parsetime.l at-3.1.10/parsetime.l +--- at-3.1.10.orig/parsetime.l 2007-01-22 14:35:41.000000000 +0100 ++++ at-3.1.10/parsetime.l 2007-01-22 14:35:35.000000000 +0100 @@ -1,5 +1,6 @@ %{ - + +#include "config.h" #include <string.h> #include <time.h> Added: trunk/package/at/at-sendmailfix.patch =================================================================== --- trunk/package/at/at-sendmailfix.patch (rev 0) +++ trunk/package/at/at-sendmailfix.patch 2007-04-25 16:15:17 UTC (rev 964) @@ -0,0 +1,12 @@ +diff -ur at-3.1.10.orig/atd.c at-3.1.10/atd.c +--- at-3.1.10.orig/atd.c 2005-08-30 19:42:56.000000000 -0400 ++++ at-3.1.10/atd.c 2007-04-25 12:12:46.000000000 -0400 +@@ -494,8 +494,6 @@ + + #if defined(SENDMAIL) + execl(SENDMAIL, "sendmail", mailname, (char *) NULL); +-#else +-#error "No mail command specified." + #endif + perr("Exec failed for mail command"); + Modified: trunk/package/at/at.mk =================================================================== --- trunk/package/at/at.mk 2007-04-25 15:57:26 UTC (rev 963) +++ trunk/package/at/at.mk 2007-04-25 16:15:17 UTC (rev 964) @@ -9,24 +9,29 @@ AT_DIR:=$(BUILD_DIR)/at-$(AT_VER) AT_CAT:=zcat AT_TARGET_BINARY:=usr/bin/at +AT_BINARY:=at $(DL_DIR)/$(AT_SOURCE): $(WGET) -P $(DL_DIR) $(AT_SITE)/$(AT_SOURCE) +at-source: $(DL_DIR)/$(AT_SOURCE) + $(AT_DIR)/.unpacked: $(DL_DIR)/$(AT_SOURCE) $(AT_CAT) $(DL_DIR)/$(AT_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) - toolchain/patch-kernel.sh $(AT_DIR) package/at/ at\*.patch - touch $(AT_DIR)/.unpacked + touch $@ $(AT_DIR)/.configured: $(AT_DIR)/.unpacked (cd $(AT_DIR); rm -rf config.cache; \ $(TARGET_CONFIGURE_OPTS) \ CFLAGS="$(TARGET_CFLAGS)" \ + LDFLAGS="$(TARGET_LDFLAGS)" \ ./configure \ --target=$(GNU_TARGET_NAME) \ --host=$(GNU_TARGET_NAME) \ --build=$(GNU_HOST_NAME) \ --prefix=/usr \ + --libdir=/lib \ --libexecdir=/usr/lib \ --sysconfdir=/etc \ --localstatedir=/var \ @@ -35,19 +40,20 @@ --with-daemon_username=at \ --with-daemon_groupname=at \ ); - touch $(AT_DIR)/.configured + touch $@ $(AT_DIR)/$(AT_BINARY): $(AT_DIR)/.configured $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(AT_DIR) + touch -c $(AT_DIR)/$(AT_BINARY) $(TARGET_DIR)/$(AT_TARGET_BINARY): $(AT_DIR)/$(AT_BINARY) # Use fakeroot to pretend to do 'make install' as root - rm -f $(STAGING_DIR)/.fakeroot.at - $(STAGING_DIR)/usr/bin/fakeroot -s $(STAGING_DIR)/.fakeroot.at -- \ - $(MAKE) DAEMON_USERNAME=root DAEMON_GROUPNAME=root \ - $(TARGET_CONFIGURE_OPTS) DESTDIR=$(TARGET_DIR) -C $(AT_DIR) install + echo "$(MAKE) DAEMON_USERNAME=root DAEMON_GROUPNAME=root " \ + "$(TARGET_CONFIGURE_OPTS) DESTDIR=$(TARGET_DIR) -C $(AT_DIR) install" \ + > $(STAGING_DIR)/.fakeroot.at + echo "rm -rf $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/doc/at" >> $(STAGING_DIR)/.fakeroot.at $(INSTALL) -m 0755 -D $(AT_DIR)/debian/rc $(TARGET_DIR)/etc/init.d/S99at - rm -rf $(TARGET_DIR)/usr/man + touch -c $(TARGET_DIR)/$(AT_TARGET_BINARY) at: uclibc host-fakeroot $(TARGET_DIR)/$(AT_TARGET_BINARY) @@ -57,7 +63,6 @@ at-dirclean: rm -rf $(AT_DIR) - ############################################################# # # Toplevel Makefile options This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kr...@us...> - 2007-04-25 16:20:19
|
Revision: 965 http://svn.sourceforge.net/astlinux/?rev=965&view=rev Author: krisk84 Date: 2007-04-25 09:20:15 -0700 (Wed, 25 Apr 2007) Log Message: ----------- remove support for seperate syslogs Modified Paths: -------------- trunk/package/Config.in trunk/package/busybox/busybox.mk Removed Paths: ------------- trunk/package/sysklogd/ Modified: trunk/package/Config.in =================================================================== --- trunk/package/Config.in 2007-04-25 16:15:17 UTC (rev 964) +++ trunk/package/Config.in 2007-04-25 16:20:15 UTC (rev 965) @@ -172,7 +172,6 @@ source "package/strace/Config.in" source "package/stunnel/Config.in" source "package/sysfsutils/Config.in" -source "package/sysklogd/Config.in" source "package/sysvinit/Config.in" source "package/tcl/Config.in" source "package/tcpdump/Config.in" Modified: trunk/package/busybox/busybox.mk =================================================================== --- trunk/package/busybox/busybox.mk 2007-04-25 16:15:17 UTC (rev 964) +++ trunk/package/busybox/busybox.mk 2007-04-25 16:20:15 UTC (rev 965) @@ -28,10 +28,6 @@ $(BUSYBOX_DIR)/.unpacked: $(DL_DIR)/$(BUSYBOX_SOURCE) $(BUSYBOX_UNZIP) $(DL_DIR)/$(BUSYBOX_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) - -ifeq ($(BR2_PACKAGE_SYSKLOGD),y) - # if we have external syslogd, force busybox to use it - $(SED) "/#include.*busybox\.h/a#define CONFIG_SYSLOGD" $(BUSYBOX_DIR)/init/init.c -endif # Allow busybox patches. ifeq ($(strip $(BR2_PACKAGE_BUSYBOX_SNAPSHOT)),y) toolchain/patch-kernel.sh $(BUSYBOX_DIR) package/busybox busybox.\*.patch @@ -46,10 +42,6 @@ $(BUSYBOX_DIR)-initrd/.unpacked: $(DL_DIR)/$(BUSYBOX_SOURCE) $(BUSYBOX_UNZIP) $(DL_DIR)/$(BUSYBOX_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) - mv $(BUSYBOX_DIR) $(BUSYBOX_DIR)-initrd -ifeq ($(BR2_PACKAGE_SYSKLOGD),y) - # if we have external syslogd, force busybox to use it - $(SED) "/#include.*busybox\.h/a#define CONFIG_SYSLOGD" $(BUSYBOX_DIR)-initrd/init/init.c -endif # Allow busybox patches. ifeq ($(strip $(BR2_PACKAGE_BUSYBOX_SNAPSHOT)),y) toolchain/patch-kernel.sh $(BUSYBOX_DIR)-initrd package/busybox busybox.\*.patch This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kr...@us...> - 2007-04-25 21:52:48
|
Revision: 966 http://svn.sourceforge.net/astlinux/?rev=966&view=rev Author: krisk84 Date: 2007-04-25 14:52:49 -0700 (Wed, 25 Apr 2007) Log Message: ----------- remove lvm2 Modified Paths: -------------- trunk/package/Config.in Removed Paths: ------------- trunk/package/lvm2/ Modified: trunk/package/Config.in =================================================================== --- trunk/package/Config.in 2007-04-25 16:20:15 UTC (rev 965) +++ trunk/package/Config.in 2007-04-25 21:52:49 UTC (rev 966) @@ -107,7 +107,6 @@ source "package/ltp-testsuite/Config.in" source "package/ltrace/Config.in" source "package/ltt/Config.in" -source "package/lvm2/Config.in" source "package/lzo/Config.in" source "package/m4/Config.in" source "package/madwifi/Config.in" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kr...@us...> - 2007-05-08 14:21:45
|
Revision: 1022 http://svn.sourceforge.net/astlinux/?rev=1022&view=rev Author: krisk84 Date: 2007-05-08 07:21:45 -0700 (Tue, 08 May 2007) Log Message: ----------- merge php5, delete php4 Modified Paths: -------------- trunk/package/Config.in Added Paths: ----------- trunk/package/php5/ trunk/package/php5/Config.in trunk/package/php5/php5.mk Removed Paths: ------------- trunk/package/php4/ trunk/package/php5/Config.in trunk/package/php5/php5.mk Modified: trunk/package/Config.in =================================================================== --- trunk/package/Config.in 2007-05-07 20:02:04 UTC (rev 1021) +++ trunk/package/Config.in 2007-05-08 14:21:45 UTC (rev 1022) @@ -138,7 +138,7 @@ source "package/openvpn/Config.in" source "package/pciutils/Config.in" source "package/pcmcia/Config.in" -source "package/php4/Config.in" +source "package/php5/Config.in" source "package/pika_aob/Config.in" source "package/portage/Config.in" source "package/portmap/Config.in" Copied: trunk/package/php5 (from rev 1018, branches/asterisk-beta/package/php5) Deleted: trunk/package/php5/Config.in =================================================================== --- branches/asterisk-beta/package/php5/Config.in 2007-05-06 03:44:36 UTC (rev 1018) +++ trunk/package/php5/Config.in 2007-05-08 14:21:45 UTC (rev 1022) @@ -1,7 +0,0 @@ -config BR2_PACKAGE_PHP5 - bool "php5" - default n - help - This adds php5 support. - - http://www.php.net Copied: trunk/package/php5/Config.in (from rev 1018, branches/asterisk-beta/package/php5/Config.in) =================================================================== --- trunk/package/php5/Config.in (rev 0) +++ trunk/package/php5/Config.in 2007-05-08 14:21:45 UTC (rev 1022) @@ -0,0 +1,7 @@ +config BR2_PACKAGE_PHP5 + bool "php5" + default n + help + This adds php5 support. + + http://www.php.net Deleted: trunk/package/php5/php5.mk =================================================================== --- branches/asterisk-beta/package/php5/php5.mk 2007-05-06 03:44:36 UTC (rev 1018) +++ trunk/package/php5/php5.mk 2007-05-08 14:21:45 UTC (rev 1022) @@ -1,66 +0,0 @@ -############################################################# -# -# php5 -# -############################################################# -PHP5_VERSION:=5.2.2 -PHP5_SOURCE:=php-$(PHP5_VERSION).tar.bz2 -PHP5_SITE:=http://www.php.net/distributions -PHP5_DIR:=$(BUILD_DIR)/php-$(PHP5_VERSION) -PHP5_BINARY:=sapi/cgi/php -PHP5_TARGET_BINARY:=usr/bin/php - -$(DL_DIR)/$(PHP5_SOURCE): - $(WGET) -P $(DL_DIR) $(PHP5_SITE)/$(PHP5_SOURCE) - -$(PHP5_DIR)/.source: $(DL_DIR)/$(PHP5_SOURCE) - bzcat $(DL_DIR)/$(PHP5_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) - - toolchain/patch-kernel.sh $(PHP5_DIR) package/php5/ php\*.patch - touch $(PHP5_DIR)/.source - -$(PHP5_DIR)/.configured: $(PHP5_DIR)/.source - (cd $(PHP5_DIR); \ - $(TARGET_CONFIGURE_OPTS) \ - CFLAGS="$(TARGET_CFLAGS)" \ - ac_cv_path_PROG_SENDMAIL="/usr/sbin/sendmail" \ - ./configure \ - --target=$(GNU_TARGET_NAME) \ - --host=$(GNU_TARGET_NAME) \ - --build=$(GNU_HOST_NAME) \ - --prefix=/usr \ - --sysconfdir=/etc \ - --without-iconv --without-pear --without-gd --disable-simplexml \ - --disable-bcmath --disable-libxml --disable-dom --disable-xml \ - --disable-xmlreader --disable-xmlwriter --without-sqlite \ - --without-pdo-sqlite --disable-ipv6 \ - ); - touch $(PHP5_DIR)/.configured; - -$(PHP5_DIR)/$(PHP5_BINARY): $(PHP5_DIR)/.configured - $(MAKE) CC=$(TARGET_CC) -C $(PHP5_DIR) - -$(TARGET_DIR)/$(PHP5_TARGET_BINARY): $(PHP5_DIR)/$(PHP5_BINARY) - $(MAKE) prefix=$(STAGING_DIR)/usr -C $(PHP5_DIR) install - $(INSTALL) -D -m 0755 $(PHP5_DIR)/$(PHP5_BINARY) $(TARGET_DIR)/$(PHP5_TARGET_BINARY) - $(STRIP) $(TARGET_DIR)/$(PHP5_TARGET_BINARY) - -php5: uclibc ncurses $(TARGET_DIR)/$(PHP5_TARGET_BINARY) - -php5-source: $(DL_DIR)/$(PHP5_SOURCE) - -php5-clean: - # $(MAKE) prefix=$(TARGET_DIR)/usr -C $(PHP5_DIR) uninstall - rm -Rf $(TARGET_DIR)/$(PHP5_TARGET_BINARY) - -$(MAKE) -C $(PHP5_DIR) clean - -php5-dirclean: - rm -rf $(PHP5_DIR) - -############################################################ - -#Toplevel Makefile options - -############################################################ -ifeq ($(strip $(BR2_PACKAGE_PHP5)),y) -TARGETS+=php5 -endif Copied: trunk/package/php5/php5.mk (from rev 1018, branches/asterisk-beta/package/php5/php5.mk) =================================================================== --- trunk/package/php5/php5.mk (rev 0) +++ trunk/package/php5/php5.mk 2007-05-08 14:21:45 UTC (rev 1022) @@ -0,0 +1,66 @@ +############################################################# +# +# php5 +# +############################################################# +PHP5_VERSION:=5.2.2 +PHP5_SOURCE:=php-$(PHP5_VERSION).tar.bz2 +PHP5_SITE:=http://www.php.net/distributions +PHP5_DIR:=$(BUILD_DIR)/php-$(PHP5_VERSION) +PHP5_BINARY:=sapi/cgi/php +PHP5_TARGET_BINARY:=usr/bin/php + +$(DL_DIR)/$(PHP5_SOURCE): + $(WGET) -P $(DL_DIR) $(PHP5_SITE)/$(PHP5_SOURCE) + +$(PHP5_DIR)/.source: $(DL_DIR)/$(PHP5_SOURCE) + bzcat $(DL_DIR)/$(PHP5_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) - + toolchain/patch-kernel.sh $(PHP5_DIR) package/php5/ php\*.patch + touch $(PHP5_DIR)/.source + +$(PHP5_DIR)/.configured: $(PHP5_DIR)/.source + (cd $(PHP5_DIR); \ + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS)" \ + ac_cv_path_PROG_SENDMAIL="/usr/sbin/sendmail" \ + ./configure \ + --target=$(GNU_TARGET_NAME) \ + --host=$(GNU_TARGET_NAME) \ + --build=$(GNU_HOST_NAME) \ + --prefix=/usr \ + --sysconfdir=/etc \ + --without-iconv --without-pear --without-gd --disable-simplexml \ + --disable-bcmath --disable-libxml --disable-dom --disable-xml \ + --disable-xmlreader --disable-xmlwriter --without-sqlite \ + --without-pdo-sqlite --disable-ipv6 \ + ); + touch $(PHP5_DIR)/.configured; + +$(PHP5_DIR)/$(PHP5_BINARY): $(PHP5_DIR)/.configured + $(MAKE) CC=$(TARGET_CC) -C $(PHP5_DIR) + +$(TARGET_DIR)/$(PHP5_TARGET_BINARY): $(PHP5_DIR)/$(PHP5_BINARY) + $(MAKE) prefix=$(STAGING_DIR)/usr -C $(PHP5_DIR) install + $(INSTALL) -D -m 0755 $(PHP5_DIR)/$(PHP5_BINARY) $(TARGET_DIR)/$(PHP5_TARGET_BINARY) + $(STRIP) $(TARGET_DIR)/$(PHP5_TARGET_BINARY) + +php5: uclibc ncurses $(TARGET_DIR)/$(PHP5_TARGET_BINARY) + +php5-source: $(DL_DIR)/$(PHP5_SOURCE) + +php5-clean: + # $(MAKE) prefix=$(TARGET_DIR)/usr -C $(PHP5_DIR) uninstall + rm -Rf $(TARGET_DIR)/$(PHP5_TARGET_BINARY) + -$(MAKE) -C $(PHP5_DIR) clean + +php5-dirclean: + rm -rf $(PHP5_DIR) + +############################################################ + +#Toplevel Makefile options + +############################################################ +ifeq ($(strip $(BR2_PACKAGE_PHP5)),y) +TARGETS+=php5 +endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kr...@us...> - 2007-06-27 20:54:03
|
Revision: 1106 http://svn.sourceforge.net/astlinux/?rev=1106&view=rev Author: krisk84 Date: 2007-06-27 13:54:00 -0700 (Wed, 27 Jun 2007) Log Message: ----------- Initial support for VIA padlock. This should enable hardware AES acceleration for certain apps: - openssh - mini_httpd - more to come I haven't tested it yet, but it all looks good! Modified Paths: -------------- trunk/package/minihttpd/minihttpd.mk trunk/package/openssh/openssh.mk trunk/package/openssl/openssl.mk Added Paths: ----------- trunk/package/minihttpd/padlock.patch trunk/package/openssh/padlock.patch trunk/package/openssl/padlock.patch Modified: trunk/package/minihttpd/minihttpd.mk =================================================================== --- trunk/package/minihttpd/minihttpd.mk 2007-06-27 20:00:30 UTC (rev 1105) +++ trunk/package/minihttpd/minihttpd.mk 2007-06-27 20:54:00 UTC (rev 1106) @@ -18,6 +18,9 @@ $(MINIHTTPD_DIR)/.unpacked: $(DL_DIR)/$(MINIHTTPD_SOURCE) $(MINIHTTPD_CAT) $(DL_DIR)/$(MINIHTTPD_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) - +ifeq ($(strip $(BR2_TARGET_VIA)),y) + toolchain/patch-kernel.sh $(MINIHTTPD_DIR) package/minihttpd/ padlock\*.patch +endif toolchain/patch-kernel.sh $(MINIHTTPD_DIR) package/minihttpd/ minihttpd\*.patch touch $(MINIHTTPD_DIR)/.unpacked Added: trunk/package/minihttpd/padlock.patch =================================================================== --- trunk/package/minihttpd/padlock.patch (rev 0) +++ trunk/package/minihttpd/padlock.patch 2007-06-27 20:54:00 UTC (rev 1106) @@ -0,0 +1,21 @@ +diff -ur mini_httpd-1.19.orig/mini_httpd.c mini_httpd-1.19/mini_httpd.c +--- mini_httpd-1.19.orig/mini_httpd.c 2005-06-29 13:31:17.000000000 -0400 ++++ mini_httpd-1.19/mini_httpd.c 2007-06-27 15:32:25.000000000 -0400 +@@ -68,6 +68,7 @@ + #ifdef USE_SSL + #include <openssl/ssl.h> + #include <openssl/err.h> ++#include <openssl/engine.h> + #endif /* USE_SSL */ + + extern char* crypt( const char* key, const char* setting ); +@@ -542,6 +543,9 @@ + { + SSL_load_error_strings(); + SSLeay_add_ssl_algorithms(); ++ ENGINE_load_builtin_engines(); ++ ENGINE_register_all_complete(); ++ ENGINE_set_default_ciphers(ENGINE_by_id("padlock")); + ssl_ctx = SSL_CTX_new( SSLv23_server_method() ); + if ( certfile[0] != '\0' ) + if ( SSL_CTX_use_certificate_file( ssl_ctx, certfile, SSL_FILETYPE_PEM ) == 0 || Modified: trunk/package/openssh/openssh.mk =================================================================== --- trunk/package/openssh/openssh.mk 2007-06-27 20:00:30 UTC (rev 1105) +++ trunk/package/openssh/openssh.mk 2007-06-27 20:54:00 UTC (rev 1106) @@ -13,6 +13,9 @@ $(OPENSSH_DIR)/.unpacked: $(DL_DIR)/$(OPENSSH_SOURCE) zcat $(DL_DIR)/$(OPENSSH_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) - +ifeq ($(strip $(BR2_TARGET_VIA)),y) + toolchain/patch-kernel.sh $(OPENSSH_DIR) package/openssh/ padlock\*.patch +endif # toolchain/patch-kernel.sh $(OPENSSH_DIR) package/openssh/ openssh\*.patch touch $(OPENSSH_DIR)/.unpacked Added: trunk/package/openssh/padlock.patch =================================================================== --- trunk/package/openssh/padlock.patch (rev 0) +++ trunk/package/openssh/padlock.patch 2007-06-27 20:54:00 UTC (rev 1106) @@ -0,0 +1,144 @@ +diff -ur openssh-4.6p1.orig/ssh-add.c openssh-4.6p1/ssh-add.c +--- openssh-4.6p1.orig/ssh-add.c 2006-09-01 01:38:37.000000000 -0400 ++++ openssh-4.6p1/ssh-add.c 2007-06-27 15:23:26.000000000 -0400 +@@ -42,6 +42,7 @@ + #include <sys/param.h> + + #include <openssl/evp.h> ++#include <openssl/engine.h> + + #include <fcntl.h> + #include <pwd.h> +@@ -343,6 +344,11 @@ + + SSLeay_add_all_algorithms(); + ++ /* Init available hardware crypto engines. */ ++ ENGINE_load_builtin_engines(); ++ ENGINE_register_all_complete(); ++ ENGINE_set_default_ciphers(ENGINE_by_id("padlock")); ++ + /* At first, get a connection to the authentication agent. */ + ac = ssh_get_authentication_connection(); + if (ac == NULL) { +diff -ur openssh-4.6p1.orig/ssh-agent.c openssh-4.6p1/ssh-agent.c +--- openssh-4.6p1.orig/ssh-agent.c 2007-02-28 05:19:58.000000000 -0500 ++++ openssh-4.6p1/ssh-agent.c 2007-06-27 15:23:26.000000000 -0400 +@@ -51,6 +51,7 @@ + + #include <openssl/evp.h> + #include <openssl/md5.h> ++#include <openssl/engine.h> + + #include <errno.h> + #include <fcntl.h> +@@ -1043,6 +1044,11 @@ + + SSLeay_add_all_algorithms(); + ++ /* Init available hardware crypto engines. */ ++ ENGINE_load_builtin_engines(); ++ ENGINE_register_all_complete(); ++ ENGINE_set_default_ciphers(ENGINE_by_id("padlock")); ++ + __progname = ssh_get_progname(av[0]); + init_rng(); + seed_rng(); +Only in openssh-4.6p1: ssh-agent.c.orig +diff -ur openssh-4.6p1.orig/ssh.c openssh-4.6p1/ssh.c +--- openssh-4.6p1.orig/ssh.c 2007-01-05 00:30:17.000000000 -0500 ++++ openssh-4.6p1/ssh.c 2007-06-27 15:23:26.000000000 -0400 +@@ -72,6 +72,7 @@ + + #include <openssl/evp.h> + #include <openssl/err.h> ++#include <openssl/engine.h> + + #include "xmalloc.h" + #include "ssh.h" +@@ -556,6 +557,11 @@ + SSLeay_add_all_algorithms(); + ERR_load_crypto_strings(); + ++ /* Init available hardware crypto engines. */ ++ ENGINE_load_builtin_engines(); ++ ENGINE_register_all_complete(); ++ ENGINE_set_default_ciphers(ENGINE_by_id("padlock")); ++ + /* Initialize the command to execute on remote host. */ + buffer_init(&command); + +diff -ur openssh-4.6p1.orig/sshd.c openssh-4.6p1/sshd.c +--- openssh-4.6p1.orig/sshd.c 2007-02-25 04:37:22.000000000 -0500 ++++ openssh-4.6p1/sshd.c 2007-06-27 15:23:26.000000000 -0400 +@@ -75,6 +75,7 @@ + #include <openssl/bn.h> + #include <openssl/md5.h> + #include <openssl/rand.h> ++#include <openssl/engine.h> + #ifdef HAVE_SECUREWARE + #include <sys/security.h> + #include <prot.h> +@@ -1027,6 +1028,11 @@ + for (i = 0; i < options.max_startups; i++) + startup_pipes[i] = -1; + ++ /* Init available hardware crypto engines. */ ++ ENGINE_load_builtin_engines(); ++ ENGINE_register_all_complete(); ++ ENGINE_set_default_ciphers(ENGINE_by_id("padlock")); ++ + /* + * Stay listening for connections until the system crashes or + * the daemon is killed with a signal. +Only in openssh-4.6p1: sshd.c.orig +diff -ur openssh-4.6p1.orig/ssh-keygen.c openssh-4.6p1/ssh-keygen.c +--- openssh-4.6p1.orig/ssh-keygen.c 2007-02-19 06:10:25.000000000 -0500 ++++ openssh-4.6p1/ssh-keygen.c 2007-06-27 15:25:27.000000000 -0400 +@@ -21,6 +21,7 @@ + + #include <openssl/evp.h> + #include <openssl/pem.h> ++#include <openssl/engine.h> + + #include <errno.h> + #include <fcntl.h> +@@ -1073,6 +1074,12 @@ + __progname = ssh_get_progname(argv[0]); + + SSLeay_add_all_algorithms(); ++ ++ /* Init available hardware crypto engines. */ ++ ENGINE_load_builtin_engines(); ++ ENGINE_register_all_complete(); ++ ENGINE_set_default_ciphers(ENGINE_by_id("padlock")); ++ + log_init(argv[0], SYSLOG_LEVEL_INFO, SYSLOG_FACILITY_USER, 1); + + init_rng(); +Only in openssh-4.6p1: ssh-keygen.c.orig +Only in openssh-4.6p1: ssh-keygen.c.rej +diff -ur openssh-4.6p1.orig/ssh-keysign.c openssh-4.6p1/ssh-keysign.c +--- openssh-4.6p1.orig/ssh-keysign.c 2006-09-01 01:38:37.000000000 -0400 ++++ openssh-4.6p1/ssh-keysign.c 2007-06-27 15:23:26.000000000 -0400 +@@ -38,6 +38,7 @@ + #include <openssl/evp.h> + #include <openssl/rand.h> + #include <openssl/rsa.h> ++#include <openssl/engine.h> + + #include "xmalloc.h" + #include "log.h" +@@ -195,6 +196,12 @@ + fatal("could not open any host key"); + + SSLeay_add_all_algorithms(); ++ ++ /* Init available hardware crypto engines. */ ++ ENGINE_load_builtin_engines(); ++ ENGINE_register_all_complete(); ++ ENGINE_set_default_ciphers(ENGINE_by_id("padlock")); ++ + for (i = 0; i < 256; i++) + rnd[i] = arc4random(); + RAND_seed(rnd, sizeof(rnd)); Modified: trunk/package/openssl/openssl.mk =================================================================== --- trunk/package/openssl/openssl.mk 2007-06-27 20:00:30 UTC (rev 1105) +++ trunk/package/openssl/openssl.mk 2007-06-27 20:54:00 UTC (rev 1106) @@ -29,6 +29,9 @@ openssl-unpack: $(OPENSSL_DIR)/.unpacked $(OPENSSL_DIR)/.unpacked: $(DL_DIR)/$(OPENSSL_SOURCE) gunzip -c $(DL_DIR)/$(OPENSSL_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) - +ifeq ($(strip $(BR2_TARGET_VIA)),y) + toolchain/patch-kernel.sh $(OPENSSL_DIR) package/openssl/ padlock\*.patch +endif toolchain/patch-kernel.sh $(OPENSSL_DIR) package/openssl/ openssl\*.patch # sigh... we have to resort to this just to set a gcc flag. $(SED) 's,/CFLAG=,/CFLAG= $(TARGET_SOFT_FLOAT) ,g' \ Added: trunk/package/openssl/padlock.patch =================================================================== --- trunk/package/openssl/padlock.patch (rev 0) +++ trunk/package/openssl/padlock.patch 2007-06-27 20:54:00 UTC (rev 1106) @@ -0,0 +1,1139 @@ +diff -urN openssl-0.9.7l.orig/crypto/engine/eng_all.c openssl-0.9.7l/crypto/engine/eng_all.c +--- openssl-0.9.7l.orig/crypto/engine/eng_all.c 2003-01-16 13:29:33.000000000 -0500 ++++ openssl-0.9.7l/crypto/engine/eng_all.c 2007-06-27 15:11:34.000000000 -0400 +@@ -98,6 +98,9 @@ + #if defined(__OpenBSD__) || defined(__FreeBSD__) + ENGINE_load_cryptodev(); + #endif ++#ifndef OPENSSL_NO_HW_PADLOCK ++ ENGINE_load_padlock(); ++#endif + #endif + } + +diff -urN openssl-0.9.7l.orig/crypto/engine/engine.h openssl-0.9.7l/crypto/engine/engine.h +--- openssl-0.9.7l.orig/crypto/engine/engine.h 2003-11-29 05:25:41.000000000 -0500 ++++ openssl-0.9.7l/crypto/engine/engine.h 2007-06-27 15:12:12.000000000 -0400 +@@ -310,6 +310,7 @@ + void ENGINE_load_atalla(void); + void ENGINE_load_nuron(void); + void ENGINE_load_ubsec(void); ++void ENGINE_load_padlock(void); + void ENGINE_load_aep(void); + void ENGINE_load_sureware(void); + void ENGINE_load_4758cca(void); +diff -urN openssl-0.9.7l.orig/crypto/engine/hw_padlock.c openssl-0.9.7l/crypto/engine/hw_padlock.c +--- openssl-0.9.7l.orig/crypto/engine/hw_padlock.c 1969-12-31 19:00:00.000000000 -0500 ++++ openssl-0.9.7l/crypto/engine/hw_padlock.c 2007-06-27 15:12:56.000000000 -0400 +@@ -0,0 +1,1091 @@ ++/* ++ * Support for VIA PadLock Advanced Cryptography Engine (ACE) ++ * Written by Michal Ludvig <mi...@lo...> ++ * http://www.logix.cz/michal ++ * ++ * Big thanks to Andy Polyakov for a help with optimization, ++ * assembler fixes, port to MS Windows and a lot of other ++ * valuable work on this engine! ++ */ ++ ++/* ==================================================================== ++ * Copyright (c) 1999-2001 The OpenSSL Project. All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in ++ * the documentation and/or other materials provided with the ++ * distribution. ++ * ++ * 3. All advertising materials mentioning features or use of this ++ * software must display the following acknowledgment: ++ * "This product includes software developed by the OpenSSL Project ++ * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" ++ * ++ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to ++ * endorse or promote products derived from this software without ++ * prior written permission. For written permission, please contact ++ * lic...@Op.... ++ * ++ * 5. Products derived from this software may not be called "OpenSSL" ++ * nor may "OpenSSL" appear in their names without prior written ++ * permission of the OpenSSL Project. ++ * ++ * 6. Redistributions of any form whatsoever must retain the following ++ * acknowledgment: ++ * "This product includes software developed by the OpenSSL Project ++ * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY ++ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ++ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR ++ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ++ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; ++ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, ++ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ++ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED ++ * OF THE POSSIBILITY OF SUCH DAMAGE. ++ * ==================================================================== ++ * ++ * This product includes cryptographic software written by Eric Young ++ * (ea...@cr...). This product includes software written by Tim ++ * Hudson (tj...@cr...). ++ * ++ */ ++ ++ ++#include <stdio.h> ++#include <string.h> ++ ++#include <openssl/crypto.h> ++#include <openssl/dso.h> ++#include <openssl/engine.h> ++#include <openssl/evp.h> ++#include <openssl/aes.h> ++ ++#ifdef OPENSSL_SYS_VMS ++# include <builtins.h> ++# define alloca __ALLOCA ++#else ++# include <malloc.h> ++# ifdef _MSC_VER ++# define alloca _alloca ++# endif ++#endif ++ ++#ifndef OPENSSL_NO_HW ++#ifndef OPENSSL_NO_HW_PADLOCK ++ ++/* Attempt to have a single source for both 0.9.7 and 0.9.8 :-) */ ++#if (OPENSSL_VERSION_NUMBER >= 0x00908000L) ++# ifndef OPENSSL_NO_DYNAMIC_ENGINE ++# define DYNAMIC_ENGINE ++# endif ++#elif (OPENSSL_VERSION_NUMBER >= 0x00907000L) ++# ifdef ENGINE_DYNAMIC_SUPPORT ++# define DYNAMIC_ENGINE ++# endif ++#else ++# error "Only OpenSSL >= 0.9.7 is supported" ++#endif ++ ++/* VIA PadLock AES is available *ONLY* on some x86 CPUs. ++ Not only that it doesn't exist elsewhere, but it ++ even can't be compiled on other platforms! ++ ++ In addition, because of the heavy use of inline assembler, ++ compiler choice is limited to GCC and Microsoft C. */ ++#undef COMPILE_HW_PADLOCK ++#if !defined(I386_ONLY) && !defined(OPENSSL_NO_INLINE_ASM) ++# if defined(__i386__) || defined(__i386) || defined(_M_IX86) ++# define COMPILE_HW_PADLOCK ++static ENGINE *ENGINE_padlock (void); ++# endif ++#endif ++ ++void ENGINE_load_padlock (void) ++{ ++/* On non-x86 CPUs it just returns. */ ++#ifdef COMPILE_HW_PADLOCK ++ ENGINE *toadd = ENGINE_padlock (); ++ if (!toadd) return; ++ ENGINE_add (toadd); ++ ENGINE_free (toadd); ++ ERR_clear_error (); ++#endif ++} ++ ++#ifdef COMPILE_HW_PADLOCK ++/* Function for ENGINE detection and control */ ++static int padlock_available(void); ++static int padlock_init(ENGINE *e); ++ ++/* RNG Stuff */ ++static RAND_METHOD padlock_rand; ++ ++/* Cipher Stuff */ ++static int padlock_ciphers(ENGINE *e, const EVP_CIPHER **cipher, const int **nids, int nid); ++ ++/* Engine names */ ++static const char *padlock_id = "padlock"; ++static char padlock_name[100]; ++ ++/* Available features */ ++static int padlock_use_ace = 0; /* Advanced Cryptography Engine */ ++static int padlock_use_rng = 0; /* Random Number Generator */ ++static int padlock_aes_align_required = 1; ++ ++/* ===== Engine "management" functions ===== */ ++ ++/* Prepare the ENGINE structure for registration */ ++static int ++padlock_bind_helper(ENGINE *e) ++{ ++ /* Check available features */ ++ padlock_available(); ++ ++#if 1 /* disable RNG for now, see commentary in vicinity of RNG code */ ++ padlock_use_rng=0; ++#endif ++ ++ /* Generate a nice engine name with available features */ ++ BIO_snprintf(padlock_name, sizeof(padlock_name), ++ "VIA PadLock (%s, %s)", ++ padlock_use_rng ? "RNG" : "no-RNG", ++ padlock_use_ace ? "ACE" : "no-ACE"); ++ ++ /* Register everything or return with an error */ ++ if (!ENGINE_set_id(e, padlock_id) || ++ !ENGINE_set_name(e, padlock_name) || ++ ++ !ENGINE_set_init_function(e, padlock_init) || ++ ++ (padlock_use_ace && !ENGINE_set_ciphers (e, padlock_ciphers)) || ++ (padlock_use_rng && !ENGINE_set_RAND (e, &padlock_rand))) { ++ return 0; ++ } ++ ++ /* Everything looks good */ ++ return 1; ++} ++ ++/* Constructor */ ++static ENGINE * ++ENGINE_padlock(void) ++{ ++ ENGINE *eng = ENGINE_new(); ++ ++ if (!eng) { ++ return NULL; ++ } ++ ++ if (!padlock_bind_helper(eng)) { ++ ENGINE_free(eng); ++ return NULL; ++ } ++ ++ return eng; ++} ++ ++/* Check availability of the engine */ ++static int ++padlock_init(ENGINE *e) ++{ ++ return (padlock_use_rng || padlock_use_ace); ++} ++ ++/* This stuff is needed if this ENGINE is being compiled into a self-contained ++ * shared-library. ++ */ ++#ifdef DYNAMIC_ENGINE ++static int ++padlock_bind_fn(ENGINE *e, const char *id) ++{ ++ if (id && (strcmp(id, padlock_id) != 0)) { ++ return 0; ++ } ++ ++ if (!padlock_bind_helper(e)) { ++ return 0; ++ } ++ ++ return 1; ++} ++ ++IMPLEMENT_DYNAMIC_CHECK_FN (); ++IMPLEMENT_DYNAMIC_BIND_FN (padlock_bind_fn); ++#endif /* DYNAMIC_ENGINE */ ++ ++/* ===== Here comes the "real" engine ===== */ ++ ++/* Some AES-related constants */ ++#define AES_BLOCK_SIZE 16 ++#define AES_KEY_SIZE_128 16 ++#define AES_KEY_SIZE_192 24 ++#define AES_KEY_SIZE_256 32 ++ ++/* Here we store the status information relevant to the ++ current context. */ ++/* BIG FAT WARNING: ++ * Inline assembler in PADLOCK_XCRYPT_ASM() ++ * depends on the order of items in this structure. ++ * Don't blindly modify, reorder, etc! ++ */ ++struct padlock_cipher_data ++{ ++ unsigned char iv[AES_BLOCK_SIZE]; /* Initialization vector */ ++ union { unsigned int pad[4]; ++ struct { ++ int rounds:4; ++ int algo:3; ++ int keygen:1; ++ int interm:1; ++ int encdec:1; ++ int ksize:2; ++ } b; ++ } cword; /* Control word */ ++ AES_KEY ks; /* Encryption key */ ++}; ++ ++/* ++ * Essentially this variable belongs in thread local storage. ++ * Having this variable global on the other hand can only cause ++ * few bogus key reloads [if any at all on single-CPU system], ++ * so we accept the penatly... ++ */ ++static volatile struct padlock_cipher_data *padlock_saved_context; ++ ++/* ++ * ======================================================= ++ * Inline assembler section(s). ++ * ======================================================= ++ * Order of arguments is chosen to facilitate Windows port ++ * using __fastcall calling convention. If you wish to add ++ * more routines, keep in mind that first __fastcall ++ * argument is passed in %ecx and second - in %edx. ++ * ======================================================= ++ */ ++#if defined(__GNUC__) && __GNUC__>=2 ++/* ++ * As for excessive "push %ebx"/"pop %ebx" found all over. ++ * When generating position-independent code GCC won't let ++ * us use "b" in assembler templates nor even respect "ebx" ++ * in "clobber description." Therefore the trouble... ++ */ ++ ++/* Helper function - check if a CPUID instruction ++ is available on this CPU */ ++static int ++padlock_insn_cpuid_available(void) ++{ ++ int result = -1; ++ ++ /* We're checking if the bit #21 of EFLAGS ++ can be toggled. If yes = CPUID is available. */ ++ asm volatile ( ++ "pushf\n" ++ "popl %%eax\n" ++ "xorl $0x200000, %%eax\n" ++ "movl %%eax, %%ecx\n" ++ "andl $0x200000, %%ecx\n" ++ "pushl %%eax\n" ++ "popf\n" ++ "pushf\n" ++ "popl %%eax\n" ++ "andl $0x200000, %%eax\n" ++ "xorl %%eax, %%ecx\n" ++ "movl %%ecx, %0\n" ++ : "=r" (result) : : "eax", "ecx"); ++ ++ return (result == 0); ++} ++ ++/* Load supported features of the CPU to see if ++ the PadLock is available. */ ++static int ++padlock_available(void) ++{ ++ char vendor_string[16]; ++ unsigned int eax, edx; ++ ++ /* First check if the CPUID instruction is available at all... */ ++ if (! padlock_insn_cpuid_available()) ++ return 0; ++ ++ /* Are we running on the Centaur (VIA) CPU? */ ++ eax = 0x00000000; ++ vendor_string[12] = 0; ++ asm volatile ( ++ "pushl %%ebx\n" ++ "cpuid\n" ++ "movl %%ebx,(%%edi)\n" ++ "movl %%edx,4(%%edi)\n" ++ "movl %%ecx,8(%%edi)\n" ++ "popl %%ebx" ++ : "+a"(eax) : "D"(vendor_string) : "ecx", "edx"); ++ if (strcmp(vendor_string, "CentaurHauls") != 0) ++ return 0; ++ ++ /* Check for Centaur Extended Feature Flags presence */ ++ eax = 0xC0000000; ++ asm volatile ("pushl %%ebx; cpuid; popl %%ebx" ++ : "+a"(eax) : : "ecx", "edx"); ++ if (eax < 0xC0000001) ++ return 0; ++ ++ /* Read the Centaur Extended Feature Flags */ ++ eax = 0xC0000001; ++ asm volatile ("pushl %%ebx; cpuid; popl %%ebx" ++ : "+a"(eax), "=d"(edx) : : "ecx"); ++ ++ /* Fill up some flags */ ++ padlock_use_ace = ((edx & (0x3<<6)) == (0x3<<6)); ++ padlock_use_rng = ((edx & (0x3<<2)) == (0x3<<2)); ++ ++ return padlock_use_ace + padlock_use_rng; ++} ++ ++/* Our own htonl()/ntohl() */ ++static inline void ++padlock_bswapl(AES_KEY *ks) ++{ ++ size_t i = sizeof(ks->rd_key)/sizeof(ks->rd_key[0]); ++ unsigned long *key = ks->rd_key; ++ ++ while (i--) { ++ asm volatile ("bswapl %0" : "+r"(*key)); ++ key++; ++ } ++} ++ ++/* Force key reload from memory to the CPU microcode. ++ Loading EFLAGS from the stack clears EFLAGS[30] ++ which does the trick. */ ++static inline void ++padlock_reload_key(void) ++{ ++ asm volatile ("pushfl; popfl"); ++} ++ ++/* ++ * This is heuristic key context tracing. At first one ++ * believes that one should use atomic swap instructions, ++ * but it's not actually necessary. Point is that if ++ * padlock_saved_context was changed by another thread ++ * after we've read it and before we compare it with cdata, ++ * our key *shall* be reloaded upon thread context switch ++ * and we are therefore set in either case... ++ */ ++static inline void ++padlock_verify_context(struct padlock_cipher_data *cdata) ++{ ++ asm volatile ( ++ "pushfl\n" ++" bt $30,(%%esp)\n" ++" jnc 1f\n" ++" cmp %2,%1\n" ++" je 1f\n" ++" popfl\n" ++" sub $4,%%esp\n" ++"1: add $4,%%esp\n" ++" mov %2,%0\n" ++ :"+m"(padlock_saved_context) ++ : "r"(padlock_saved_context), "r"(cdata) : "cc"); ++} ++ ++/* Template for padlock_xcrypt_* modes */ ++/* BIG FAT WARNING: ++ * The offsets used with 'leal' instructions ++ * describe items of the 'padlock_cipher_data' ++ * structure. ++ */ ++#define PADLOCK_XCRYPT_ASM(name,rep_xcrypt) \ ++static inline void *name(size_t cnt, \ ++ struct padlock_cipher_data *cdata, \ ++ void *out, const void *inp) \ ++{ void *iv; \ ++ asm volatile ( "pushl %%ebx\n" \ ++ " leal 16(%0),%%edx\n" \ ++ " leal 32(%0),%%ebx\n" \ ++ rep_xcrypt "\n" \ ++ " popl %%ebx" \ ++ : "=a"(iv), "=c"(cnt), "=D"(out), "=S"(inp) \ ++ : "0"(cdata), "1"(cnt), "2"(out), "3"(inp) \ ++ : "edx", "cc"); \ ++ return iv; \ ++} ++ ++/* Generate all functions with appropriate opcodes */ ++PADLOCK_XCRYPT_ASM(padlock_xcrypt_ecb, ".byte 0xf3,0x0f,0xa7,0xc8") /* rep xcryptecb */ ++PADLOCK_XCRYPT_ASM(padlock_xcrypt_cbc, ".byte 0xf3,0x0f,0xa7,0xd0") /* rep xcryptcbc */ ++PADLOCK_XCRYPT_ASM(padlock_xcrypt_cfb, ".byte 0xf3,0x0f,0xa7,0xe0") /* rep xcryptcfb */ ++PADLOCK_XCRYPT_ASM(padlock_xcrypt_ofb, ".byte 0xf3,0x0f,0xa7,0xe8") /* rep xcryptofb */ ++ ++/* The RNG call itself */ ++static inline unsigned int ++padlock_xstore(void *addr, unsigned int edx_in) ++{ ++ unsigned int eax_out; ++ ++ asm volatile (".byte 0x0f,0xa7,0xc0" /* xstore */ ++ : "=a"(eax_out),"=m"(*(unsigned *)addr) ++ : "D"(addr), "d" (edx_in) ++ ); ++ ++ return eax_out; ++} ++ ++/* Why not inline 'rep movsd'? I failed to find information on what ++ * value in Direction Flag one can expect and consequently have to ++ * apply "better-safe-than-sorry" approach and assume "undefined." ++ * I could explicitly clear it and restore the original value upon ++ * return from padlock_aes_cipher, but it's presumably too much ++ * trouble for too little gain... ++ * ++ * In case you wonder 'rep xcrypt*' instructions above are *not* ++ * affected by the Direction Flag and pointers advance toward ++ * larger addresses unconditionally. ++ */ ++static inline unsigned char * ++padlock_memcpy(void *dst,const void *src,size_t n) ++{ ++ long *d=dst; ++ const long *s=src; ++ ++ n /= sizeof(*d); ++ do { *d++ = *s++; } while (--n); ++ ++ return dst; ++} ++ ++#elif defined(_MSC_VER) ++/* ++ * Unlike GCC these are real functions. In order to minimize impact ++ * on performance we adhere to __fastcall calling convention in ++ * order to get two first arguments passed through %ecx and %edx. ++ * Which kind of suits very well, as instructions in question use ++ * both %ecx and %edx as input:-) ++ */ ++#define REP_XCRYPT(code) \ ++ _asm _emit 0xf3 \ ++ _asm _emit 0x0f _asm _emit 0xa7 \ ++ _asm _emit code ++ ++/* BIG FAT WARNING: ++ * The offsets used with 'lea' instructions ++ * describe items of the 'padlock_cipher_data' ++ * structure. ++ */ ++#define PADLOCK_XCRYPT_ASM(name,code) \ ++static void * __fastcall \ ++ name (size_t cnt, void *cdata, \ ++ void *outp, const void *inp) \ ++{ _asm mov eax,edx \ ++ _asm lea edx,[eax+16] \ ++ _asm lea ebx,[eax+32] \ ++ _asm mov edi,outp \ ++ _asm mov esi,inp \ ++ REP_XCRYPT(code) \ ++} ++ ++PADLOCK_XCRYPT_ASM(padlock_xcrypt_ecb,0xc8) ++PADLOCK_XCRYPT_ASM(padlock_xcrypt_cbc,0xd0) ++PADLOCK_XCRYPT_ASM(padlock_xcrypt_cfb,0xe0) ++PADLOCK_XCRYPT_ASM(padlock_xcrypt_ofb,0xe8) ++ ++static int __fastcall ++padlock_xstore(void *outp,unsigned int code) ++{ _asm mov edi,ecx ++ _asm _emit 0x0f _asm _emit 0xa7 _asm _emit 0xc0 ++} ++ ++static void __fastcall ++padlock_reload_key(void) ++{ _asm pushfd _asm popfd } ++ ++static void __fastcall ++padlock_verify_context(void *cdata) ++{ _asm { ++ pushfd ++ bt DWORD PTR[esp],30 ++ jnc skip ++ cmp ecx,padlock_saved_context ++ je skip ++ popfd ++ sub esp,4 ++ skip: add esp,4 ++ mov padlock_saved_context,ecx ++ } ++} ++ ++static int ++padlock_available(void) ++{ _asm { ++ pushfd ++ pop eax ++ mov ecx,eax ++ xor eax,1<<21 ++ push eax ++ popfd ++ pushfd ++ pop eax ++ xor eax,ecx ++ bt eax,21 ++ jnc noluck ++ mov eax,0 ++ cpuid ++ xor eax,eax ++ cmp ebx,'tneC' ++ jne noluck ++ cmp edx,'Hrua' ++ jne noluck ++ cmp ecx,'slua' ++ jne noluck ++ mov eax,0xC0000000 ++ cpuid ++ mov edx,eax ++ xor eax,eax ++ cmp edx,0xC0000001 ++ jb noluck ++ mov eax,0xC0000001 ++ cpuid ++ xor eax,eax ++ bt edx,6 ++ jnc skip_a ++ bt edx,7 ++ jnc skip_a ++ mov padlock_use_ace,1 ++ inc eax ++ skip_a: bt edx,2 ++ jnc skip_r ++ bt edx,3 ++ jnc skip_r ++ mov padlock_use_rng,1 ++ inc eax ++ skip_r: ++ noluck: ++ } ++} ++ ++static void __fastcall ++padlock_bswapl(void *key) ++{ _asm { ++ pushfd ++ cld ++ mov esi,ecx ++ mov edi,ecx ++ mov ecx,60 ++ up: lodsd ++ bswap eax ++ stosd ++ loop up ++ popfd ++ } ++} ++ ++/* MS actually specifies status of Direction Flag and compiler even ++ * manages to compile following as 'rep movsd' all by itself... ++ */ ++#define padlock_memcpy(o,i,n) ((unsigned char *)memcpy((o),(i),(n)&~3U)) ++#endif ++ ++/* ===== AES encryption/decryption ===== */ ++ ++#if defined(NID_aes_128_cfb128) && ! defined (NID_aes_128_cfb) ++#define NID_aes_128_cfb NID_aes_128_cfb128 ++#endif ++ ++#if defined(NID_aes_128_ofb128) && ! defined (NID_aes_128_ofb) ++#define NID_aes_128_ofb NID_aes_128_ofb128 ++#endif ++ ++#if defined(NID_aes_192_cfb128) && ! defined (NID_aes_192_cfb) ++#define NID_aes_192_cfb NID_aes_192_cfb128 ++#endif ++ ++#if defined(NID_aes_192_ofb128) && ! defined (NID_aes_192_ofb) ++#define NID_aes_192_ofb NID_aes_192_ofb128 ++#endif ++ ++#if defined(NID_aes_256_cfb128) && ! defined (NID_aes_256_cfb) ++#define NID_aes_256_cfb NID_aes_256_cfb128 ++#endif ++ ++#if defined(NID_aes_256_ofb128) && ! defined (NID_aes_256_ofb) ++#define NID_aes_256_ofb NID_aes_256_ofb128 ++#endif ++ ++/* List of supported ciphers. */ ++static int padlock_cipher_nids[] = { ++ NID_aes_128_ecb, ++ NID_aes_128_cbc, ++ NID_aes_128_cfb, ++ NID_aes_128_ofb, ++ ++ NID_aes_192_ecb, ++ NID_aes_192_cbc, ++#if 0 ++ NID_aes_192_cfb, /* FIXME: AES192/256 CFB/OFB don't work. */ ++ NID_aes_192_ofb, ++#endif ++ ++ NID_aes_256_ecb, ++ NID_aes_256_cbc, ++#if 0 ++ NID_aes_256_cfb, ++ NID_aes_256_ofb, ++#endif ++}; ++static int padlock_cipher_nids_num = (sizeof(padlock_cipher_nids)/ ++ sizeof(padlock_cipher_nids[0])); ++ ++/* Function prototypes ... */ ++static int padlock_aes_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, ++ const unsigned char *iv, int enc); ++static int padlock_aes_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, ++ const unsigned char *in, size_t nbytes); ++ ++#define NEAREST_ALIGNED(ptr) ( (unsigned char *)(ptr) + \ ++ ( (0x10 - ((size_t)(ptr) & 0x0F)) & 0x0F ) ) ++#define ALIGNED_CIPHER_DATA(ctx) ((struct padlock_cipher_data *)\ ++ NEAREST_ALIGNED(ctx->cipher_data)) ++ ++/* Declaring so many ciphers by hand would be a pain. ++ Instead introduce a bit of preprocessor magic :-) */ ++#define DECLARE_AES_EVP(ksize,lmode,umode) \ ++static const EVP_CIPHER padlock_aes_##ksize##_##lmode = { \ ++ NID_aes_##ksize##_##lmode, \ ++ AES_BLOCK_SIZE, \ ++ AES_KEY_SIZE_##ksize, \ ++ AES_BLOCK_SIZE, \ ++ 0 | EVP_CIPH_##umode##_MODE, \ ++ padlock_aes_init_key, \ ++ padlock_aes_cipher, \ ++ NULL, \ ++ sizeof(struct padlock_cipher_data) + 16, \ ++ EVP_CIPHER_set_asn1_iv, \ ++ EVP_CIPHER_get_asn1_iv, \ ++ NULL, \ ++ NULL \ ++} ++ ++DECLARE_AES_EVP(128,ecb,ECB); ++DECLARE_AES_EVP(128,cbc,CBC); ++DECLARE_AES_EVP(128,cfb,CFB); ++DECLARE_AES_EVP(128,ofb,OFB); ++ ++DECLARE_AES_EVP(192,ecb,ECB); ++DECLARE_AES_EVP(192,cbc,CBC); ++DECLARE_AES_EVP(192,cfb,CFB); ++DECLARE_AES_EVP(192,ofb,OFB); ++ ++DECLARE_AES_EVP(256,ecb,ECB); ++DECLARE_AES_EVP(256,cbc,CBC); ++DECLARE_AES_EVP(256,cfb,CFB); ++DECLARE_AES_EVP(256,ofb,OFB); ++ ++static int ++padlock_ciphers (ENGINE *e, const EVP_CIPHER **cipher, const int **nids, int nid) ++{ ++ /* No specific cipher => return a list of supported nids ... */ ++ if (!cipher) { ++ *nids = padlock_cipher_nids; ++ return padlock_cipher_nids_num; ++ } ++ ++ /* ... or the requested "cipher" otherwise */ ++ switch (nid) { ++ case NID_aes_128_ecb: ++ *cipher = &padlock_aes_128_ecb; ++ break; ++ case NID_aes_128_cbc: ++ *cipher = &padlock_aes_128_cbc; ++ break; ++ case NID_aes_128_cfb: ++ *cipher = &padlock_aes_128_cfb; ++ break; ++ case NID_aes_128_ofb: ++ *cipher = &padlock_aes_128_ofb; ++ break; ++ ++ case NID_aes_192_ecb: ++ *cipher = &padlock_aes_192_ecb; ++ break; ++ case NID_aes_192_cbc: ++ *cipher = &padlock_aes_192_cbc; ++ break; ++ case NID_aes_192_cfb: ++ *cipher = &padlock_aes_192_cfb; ++ break; ++ case NID_aes_192_ofb: ++ *cipher = &padlock_aes_192_ofb; ++ break; ++ ++ case NID_aes_256_ecb: ++ *cipher = &padlock_aes_256_ecb; ++ break; ++ case NID_aes_256_cbc: ++ *cipher = &padlock_aes_256_cbc; ++ break; ++ case NID_aes_256_cfb: ++ *cipher = &padlock_aes_256_cfb; ++ break; ++ case NID_aes_256_ofb: ++ *cipher = &padlock_aes_256_ofb; ++ break; ++ ++ default: ++ /* Sorry, we don't support this NID */ ++ *cipher = NULL; ++ return 0; ++ } ++ ++ return 1; ++} ++ ++/* Prepare the encryption key for PadLock usage */ ++static int ++padlock_aes_init_key (EVP_CIPHER_CTX *ctx, const unsigned char *key, ++ const unsigned char *iv, int enc) ++{ ++ struct padlock_cipher_data *cdata; ++ int key_len = EVP_CIPHER_CTX_key_length(ctx) * 8; ++ ++ if (key==NULL) return 0; /* ERROR */ ++ ++ cdata = ALIGNED_CIPHER_DATA(ctx); ++ memset(cdata, 0, sizeof(struct padlock_cipher_data)); ++ ++ /* Prepare Control word. */ ++ cdata->cword.b.encdec = (ctx->encrypt == 0); ++ cdata->cword.b.rounds = 10 + (key_len - 128) / 32; ++ cdata->cword.b.ksize = (key_len - 128) / 64; ++ ++ switch(key_len) { ++ case 128: ++ /* PadLock can generate an extended key for ++ AES128 in hardware */ ++ memcpy(cdata->ks.rd_key, key, AES_KEY_SIZE_128); ++ cdata->cword.b.keygen = 0; ++ break; ++ ++ case 192: ++ case 256: ++ /* Generate an extended AES key in software. ++ Needed for AES192/AES256 */ ++ /* Well, the above applies to Stepping 8 CPUs ++ and is listed as hardware errata. They most ++ likely will fix it at some point and then ++ a check for stepping would be due here. */ ++ if (enc) ++ AES_set_encrypt_key(key, key_len, &cdata->ks); ++ else ++ AES_set_decrypt_key(key, key_len, &cdata->ks); ++ ++ /* OpenSSL internal functions use byte-swapped extended key. */ ++ padlock_bswapl(&cdata->ks); ++ ++ cdata->cword.b.keygen = 1; ++ break; ++ ++ default: ++ /* ERROR */ ++ return 0; ++ } ++ ++ /* ++ * This is done to cover for cases when user reuses the ++ * context for new key. The catch is that if we don't do ++ * this, padlock_eas_cipher might proceed with old key... ++ */ ++ padlock_reload_key (); ++ ++ return 1; ++} ++ ++/* ++ * Simplified version of padlock_aes_cipher() used when ++ * 1) both input and output buffers are at aligned addresses. ++ * or when ++ * 2) running on a newer CPU that doesn't require aligned buffers. ++ */ ++static int ++padlock_aes_cipher_omnivorous(EVP_CIPHER_CTX *ctx, unsigned char *out_arg, ++ const unsigned char *in_arg, size_t nbytes) ++{ ++ struct padlock_cipher_data *cdata; ++ void *iv; ++ ++ cdata = ALIGNED_CIPHER_DATA(ctx); ++ padlock_verify_context(cdata); ++ ++ switch (EVP_CIPHER_CTX_mode(ctx)) { ++ case EVP_CIPH_ECB_MODE: ++ padlock_xcrypt_ecb(nbytes/AES_BLOCK_SIZE, cdata, out_arg, in_arg); ++ break; ++ ++ case EVP_CIPH_CBC_MODE: ++ memcpy(cdata->iv, ctx->iv, AES_BLOCK_SIZE); ++ iv = padlock_xcrypt_cbc(nbytes/AES_BLOCK_SIZE, cdata, out_arg, in_arg); ++ memcpy(ctx->iv, iv, AES_BLOCK_SIZE); ++ break; ++ ++ case EVP_CIPH_CFB_MODE: ++ memcpy(cdata->iv, ctx->iv, AES_BLOCK_SIZE); ++ iv = padlock_xcrypt_cfb(nbytes/AES_BLOCK_SIZE, cdata, out_arg, in_arg); ++ memcpy(ctx->iv, iv, AES_BLOCK_SIZE); ++ break; ++ ++ case EVP_CIPH_OFB_MODE: ++ memcpy(cdata->iv, ctx->iv, AES_BLOCK_SIZE); ++ padlock_xcrypt_ofb(nbytes/AES_BLOCK_SIZE, cdata, out_arg, in_arg); ++ memcpy(ctx->iv, cdata->iv, AES_BLOCK_SIZE); ++ break; ++ ++ default: ++ return 0; ++ } ++ ++ memset(cdata->iv, 0, AES_BLOCK_SIZE); ++ ++ return 1; ++} ++ ++#ifndef PADLOCK_CHUNK ++# define PADLOCK_CHUNK 4096 /* Must be a power of 2 larger than 16 */ ++#endif ++#if PADLOCK_CHUNK<16 || PADLOCK_CHUNK&(PADLOCK_CHUNK-1) ++# error "insane PADLOCK_CHUNK..." ++#endif ++ ++/* Re-align the arguments to 16-Bytes boundaries and run the ++ encryption function itself. This function is not AES-specific. */ ++static int ++padlock_aes_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out_arg, ++ const unsigned char *in_arg, size_t nbytes) ++{ ++ struct padlock_cipher_data *cdata; ++ const void *inp; ++ unsigned char *out; ++ void *iv; ++ int inp_misaligned, out_misaligned, realign_in_loop; ++ size_t chunk, allocated=0; ++ ++ if (nbytes == 0) ++ return 1; ++ if (nbytes % AES_BLOCK_SIZE) ++ return 0; /* are we expected to do tail processing? */ ++ ++ /* VIA promises CPUs that won't require alignment in the future. ++ For now padlock_aes_align_required is initialized to 1 and ++ the condition is never met... */ ++ if (!padlock_aes_align_required) ++ return padlock_aes_cipher_omnivorous(ctx, out_arg, in_arg, nbytes); ++ ++ inp_misaligned = (((size_t)in_arg) & 0x0F); ++ out_misaligned = (((size_t)out_arg) & 0x0F); ++ ++ /* Note that even if output is aligned and input not, ++ * I still prefer to loop instead of copy the whole ++ * input and then encrypt in one stroke. This is done ++ * in order to improve L1 cache utilization... */ ++ realign_in_loop = out_misaligned|inp_misaligned; ++ ++ if (!realign_in_loop) ++ return padlock_aes_cipher_omnivorous(ctx, out_arg, in_arg, nbytes); ++ ++ /* this takes one "if" out of the loops */ ++ chunk = nbytes; ++ chunk %= PADLOCK_CHUNK; ++ if (chunk==0) chunk = PADLOCK_CHUNK; ++ ++ if (out_misaligned) { ++ /* optmize for small input */ ++ allocated = (chunk<nbytes?PADLOCK_CHUNK:nbytes); ++ out = alloca(0x10 + allocated); ++ out = NEAREST_ALIGNED(out); ++ } ++ else ++ out = out_arg; ++ ++ cdata = ALIGNED_CIPHER_DATA(ctx); ++ padlock_verify_context(cdata); ++ ++ switch (EVP_CIPHER_CTX_mode(ctx)) { ++ case EVP_CIPH_ECB_MODE: ++ do { ++ if (inp_misaligned) ++ inp = padlock_memcpy(out, in_arg, chunk); ++ else ++ inp = in_arg; ++ in_arg += chunk; ++ ++ padlock_xcrypt_ecb(chunk/AES_BLOCK_SIZE, cdata, out, inp); ++ ++ if (out_misaligned) ++ out_arg = padlock_memcpy(out_arg, out, chunk) + chunk; ++ else ++ out = out_arg+=chunk; ++ ++ nbytes -= chunk; ++ chunk = PADLOCK_CHUNK; ++ } while (nbytes); ++ break; ++ ++ case EVP_CIPH_CBC_MODE: ++ memcpy(cdata->iv, ctx->iv, AES_BLOCK_SIZE); ++ goto cbc_shortcut; ++ do { ++ if (iv != cdata->iv) ++ memcpy(cdata->iv, iv, AES_BLOCK_SIZE); ++ chunk = PADLOCK_CHUNK; ++ cbc_shortcut: /* optimize for small input */ ++ if (inp_misaligned) ++ inp = padlock_memcpy(out, in_arg, chunk); ++ else ++ inp = in_arg; ++ in_arg += chunk; ++ ++ iv = padlock_xcrypt_cbc(chunk/AES_BLOCK_SIZE, cdata, out, inp); ++ ++ if (out_misaligned) ++ out_arg = padlock_memcpy(out_arg, out, chunk) + chunk; ++ else ++ out = out_arg+=chunk; ++ ++ } while (nbytes -= chunk); ++ memcpy(ctx->iv, iv, AES_BLOCK_SIZE); ++ break; ++ ++ case EVP_CIPH_CFB_MODE: ++ memcpy (cdata->iv, ctx->iv, AES_BLOCK_SIZE); ++ goto cfb_shortcut; ++ do { ++ if (iv != cdata->iv) ++ memcpy(cdata->iv, iv, AES_BLOCK_SIZE); ++ chunk = PADLOCK_CHUNK; ++ cfb_shortcut: /* optimize for small input */ ++ if (inp_misaligned) ++ inp = padlock_memcpy(out, in_arg, chunk); ++ else ++ inp = in_arg; ++ in_arg += chunk; ++ ++ iv = padlock_xcrypt_cfb(chunk/AES_BLOCK_SIZE, cdata, out, inp); ++ ++ if (out_misaligned) ++ out_arg = padlock_memcpy(out_arg, out, chunk) + chunk; ++ else ++ out = out_arg+=chunk; ++ ++ } while (nbytes -= chunk); ++ memcpy(ctx->iv, iv, AES_BLOCK_SIZE); ++ break; ++ ++ case EVP_CIPH_OFB_MODE: ++ memcpy(cdata->iv, ctx->iv, AES_BLOCK_SIZE); ++ do { ++ if (inp_misaligned) ++ inp = padlock_memcpy(out, in_arg, chunk); ++ else ++ inp = in_arg; ++ in_arg += chunk; ++ ++ padlock_xcrypt_ofb(chunk/AES_BLOCK_SIZE, cdata, out, inp); ++ ++ if (out_misaligned) ++ out_arg = padlock_memcpy(out_arg, out, chunk) + chunk; ++ else ++ out = out_arg+=chunk; ++ ++ nbytes -= chunk; ++ chunk = PADLOCK_CHUNK; ++ } while (nbytes); ++ memcpy(ctx->iv, cdata->iv, AES_BLOCK_SIZE); ++ break; ++ ++ default: ++ return 0; ++ } ++ ++ /* Clean the realign buffer if it was used */ ++ if (out_misaligned) { ++ volatile unsigned long *p=(void *)out; ++ size_t n = allocated/sizeof(*p); ++ while (n--) *p++=0; ++ } ++ ++ memset(cdata->iv, 0, AES_BLOCK_SIZE); ++ ++ return 1; ++} ++ ++/* ===== Random Number Generator ===== */ ++/* ++ * This code is not engaged. The reason is that it does not comply ++ * with recommendations for VIA RNG usage for secure applications ++ * (posted at http://www.via.com.tw/en/viac3/c3.jsp) nor does it ++ * provide meaningful error control... ++ */ ++/* Wrapper that provides an interface between the API and ++ the raw PadLock RNG */ ++static int ++padlock_rand_bytes(unsigned char *output, int count) ++{ ++ unsigned int eax, buf; ++ ++ while (count >= 8) { ++ eax = padlock_xstore(output, 0); ++ if (!(eax&(1<<6))) return 0; /* RNG disabled */ ++ /* this ---vv--- covers DC bias, Raw Bits and String Filter */ ++ if (eax&(0x1F<<10)) return 0; ++ if ((eax&0x1F)==0) continue; /* no data, retry... */ ++ if ((eax&0x1F)!=8) return 0; /* fatal failure... */ ++ output += 8; ++ count -= 8; ++ } ++ while (count > 0) { ++ eax = padlock_xstore(&buf, 3); ++ if (!(eax&(1<<6))) return 0; /* RNG disabled */ ++ /* this ---vv--- covers DC bias, Raw Bits and String Filter */ ++ if (eax&(0x1F<<10)) return 0; ++ if ((eax&0x1F)==0) continue; /* no data, retry... */ ++ if ((eax&0x1F)!=1) return 0; /* fatal failure... */ ++ *output++ = (unsigned char)buf; ++ count--; ++ } ++ *(volatile unsigned int *)&buf=0; ++ ++ return 1; ++} ++ ++/* Dummy but necessary function */ ++static int ++padlock_rand_status(void) ++{ ++ return 1; ++} ++ ++/* Prepare structure for registration */ ++static RAND_METHOD padlock_rand = { ++ NULL, /* seed */ ++ padlock_rand_bytes, /* bytes */ ++ NULL, /* cleanup */ ++ NULL, /* add */ ++ padlock_rand_bytes, /* pseudorand */ ++ padlock_rand_status, /* rand status */ ++}; ++ ++#endif /* COMPILE_HW_PADLOCK */ ++ ++#endif /* !OPENSSL_NO_HW_PADLOCK */ ++#endif /* !OPENSSL_NO_HW */ +diff -urN openssl-0.9.7l.orig/crypto/engine/Makefile openssl-0.9.7l/crypto/engine/Makefile +--- openssl-0.9.7l.orig/crypto/engine/Makefile 2004-11-02 18:53:11.000000000 -0500 ++++ openssl-0.9.7l/crypto/engine/Makefile 2007-06-27 15:10:34.000000000 -0400 +@@ -27,13 +27,15 @@ + tb_rsa.c tb_dsa.c tb_dh.c tb_rand.c tb_cipher.c tb_digest.c \ + eng_openssl.c eng_dyn.c eng_cnf.c \ + hw_atalla.c hw_cswift.c hw_ncipher.c hw_nuron.c hw_ubsec.c \ +- hw_cryptodev.c hw_aep.c hw_sureware.c hw_4758_cca.c ++ hw_cryptodev.c hw_aep.c hw_sureware.c hw_4758_cca.c \ ++ hw_padlock.c + LIBOBJ= eng_err.o eng_lib.o eng_list.o eng_init.o eng_ctrl.o \ + eng_table.o eng_pkey.o eng_fat.o eng_all.o \ + tb_rsa.o tb_dsa.o tb_dh.o tb_rand.o tb_cipher.o tb_digest.o \ + eng_openssl.o eng_dyn.o eng_cnf.o \ + hw_atalla.o hw_cswift.o hw_ncipher.o hw_nuron.o hw_ubsec.o \ +- hw_cryptodev.o hw_aep.o hw_sureware.o hw_4758_cca.o ++ hw_cryptodev.o hw_aep.o hw_sureware.o hw_4758_cca.o \ ++ hw_padlock.o + + SRC= $(LIBSRC) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kr...@us...> - 2007-07-10 00:23:47
|
Revision: 1131 http://svn.sourceforge.net/astlinux/?rev=1131&view=rev Author: krisk84 Date: 2007-07-09 17:23:49 -0700 (Mon, 09 Jul 2007) Log Message: ----------- asterisk and libpri version bumps Modified Paths: -------------- trunk/package/asterisk/asterisk.mk trunk/package/libpri/libpri.mk Modified: trunk/package/asterisk/asterisk.mk =================================================================== --- trunk/package/asterisk/asterisk.mk 2007-07-10 00:21:09 UTC (rev 1130) +++ trunk/package/asterisk/asterisk.mk 2007-07-10 00:23:49 UTC (rev 1131) @@ -3,7 +3,7 @@ # asterisk # ############################################################## -ASTERISK_VERSION := 1.2.20 +ASTERISK_VERSION := 1.2.21 ASTERISK_SOURCE := asterisk-$(ASTERISK_VERSION).tar.gz ASTERISK_SITE := ftp://ftp.digium.com/pub/asterisk/releases ASTERISK_DIR := $(BUILD_DIR)/asterisk-$(ASTERISK_VERSION) Modified: trunk/package/libpri/libpri.mk =================================================================== --- trunk/package/libpri/libpri.mk 2007-07-10 00:21:09 UTC (rev 1130) +++ trunk/package/libpri/libpri.mk 2007-07-10 00:23:49 UTC (rev 1131) @@ -3,7 +3,7 @@ # libpri # ############################################################## -LIBPRI_VERSION := 1.2.4 +LIBPRI_VERSION := 1.2.5 LIBPRI_SOURCE := libpri-$(LIBPRI_VERSION).tar.gz LIBPRI_SITE := ftp://ftp.digium.com/pub/libpri/releases LIBPRI_DIR := $(BUILD_DIR)/libpri-$(LIBPRI_VERSION) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kr...@us...> - 2007-07-19 02:29:57
|
Revision: 1143 http://svn.sourceforge.net/astlinux/?rev=1143&view=rev Author: krisk84 Date: 2007-07-18 19:29:55 -0700 (Wed, 18 Jul 2007) Log Message: ----------- more config cleanups Modified Paths: -------------- trunk/package/Config.in trunk/package/asterisk/Config.in trunk/package/chansccp/chansccp.mk trunk/package/resconv/resconv.mk Removed Paths: ------------- trunk/package/resconv/Config.in Modified: trunk/package/Config.in =================================================================== --- trunk/package/Config.in 2007-07-11 16:26:04 UTC (rev 1142) +++ trunk/package/Config.in 2007-07-19 02:29:55 UTC (rev 1143) @@ -148,7 +148,6 @@ source "package/quagga/Config.in" source "package/raidtools/Config.in" source "package/readline/Config.in" -source "package/resconv/Config.in" source "package/rhino/Config.in" source "package/rp-pppoe/Config.in" source "package/rsync/Config.in" Modified: trunk/package/asterisk/Config.in =================================================================== --- trunk/package/asterisk/Config.in 2007-07-11 16:26:04 UTC (rev 1142) +++ trunk/package/asterisk/Config.in 2007-07-19 02:29:55 UTC (rev 1143) @@ -1,10 +1,10 @@ config BR2_PACKAGE_ASTERISK bool "asterisk" default n - depends BR2_PACKAGE_NCURSES - depends BR2_PACKAGE_ZLIB - depends BR2_PACKAGE_OPENSSL - depends BR2_PACKAGE_LIBELF + select BR2_PACKAGE_NCURSES + select BR2_PACKAGE_ZLIB + select BR2_PACKAGE_OPENSSL + select BR2_PACKAGE_LIBELF help Asterisk - the Open Source PBX @@ -24,7 +24,7 @@ help Compile Asterisk with custom PostgreSQL support -config BR2_PACKAGE_CHANSCCP +config BR2_PACKAGE_ASTERISK_CHANSCCP bool "Asterisk chan_sccp Support" default n depends BR2_PACKAGE_ASTERISK @@ -45,7 +45,6 @@ bool "Asterisk res_conv Support" default n depends BR2_PACKAGE_ASTERISK - select BR2_PACKAGE_RESCONV help Compile Asterisk with res_conv, the audio conversion module for Asterisk Modified: trunk/package/chansccp/chansccp.mk =================================================================== --- trunk/package/chansccp/chansccp.mk 2007-07-11 16:26:04 UTC (rev 1142) +++ trunk/package/chansccp/chansccp.mk 2007-07-19 02:29:55 UTC (rev 1143) @@ -45,6 +45,6 @@ # Toplevel Makefile options # ############################################################# -ifeq ($(strip $(BR2_PACKAGE_CHANSCCP)),y) +ifeq ($(strip $(BR2_PACKAGE_ASTERISK_CHANSCCP)),y) TARGETS+=chansccp endif Deleted: trunk/package/resconv/Config.in =================================================================== --- trunk/package/resconv/Config.in 2007-07-11 16:26:04 UTC (rev 1142) +++ trunk/package/resconv/Config.in 2007-07-19 02:29:55 UTC (rev 1143) @@ -1,8 +0,0 @@ -config BR2_PACKAGE_RESCONV - bool "resconv" - default n - help - res_conv - Convert audio files with Asterisk - - http://redice.krisk.org - Modified: trunk/package/resconv/resconv.mk =================================================================== --- trunk/package/resconv/resconv.mk 2007-07-11 16:26:04 UTC (rev 1142) +++ trunk/package/resconv/resconv.mk 2007-07-19 02:29:55 UTC (rev 1143) @@ -42,6 +42,6 @@ # Toplevel Makefile options # ############################################################# -ifeq ($(strip $(BR2_PACKAGE_RESCONV)),y) +ifeq ($(strip $(BR2_PACKAGE_ASTERISK_RESCONV)),y) TARGETS+=resconv endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kr...@us...> - 2007-07-19 02:34:18
|
Revision: 1144 http://svn.sourceforge.net/astlinux/?rev=1144&view=rev Author: krisk84 Date: 2007-07-18 19:34:21 -0700 (Wed, 18 Jul 2007) Log Message: ----------- update asterisk to 1.2.22 and zaptel to 1.2.19 Modified Paths: -------------- trunk/package/asterisk/asterisk.mk trunk/package/zaptel/zaptel.mk Modified: trunk/package/asterisk/asterisk.mk =================================================================== --- trunk/package/asterisk/asterisk.mk 2007-07-19 02:29:55 UTC (rev 1143) +++ trunk/package/asterisk/asterisk.mk 2007-07-19 02:34:21 UTC (rev 1144) @@ -3,7 +3,7 @@ # asterisk # ############################################################## -ASTERISK_VERSION := 1.2.21.1 +ASTERISK_VERSION := 1.2.22 ASTERISK_SOURCE := asterisk-$(ASTERISK_VERSION).tar.gz ASTERISK_SITE := ftp://ftp.digium.com/pub/asterisk/releases ASTERISK_DIR := $(BUILD_DIR)/asterisk-$(ASTERISK_VERSION) Modified: trunk/package/zaptel/zaptel.mk =================================================================== --- trunk/package/zaptel/zaptel.mk 2007-07-19 02:29:55 UTC (rev 1143) +++ trunk/package/zaptel/zaptel.mk 2007-07-19 02:34:21 UTC (rev 1144) @@ -3,7 +3,7 @@ # zaptel # ############################################################## -ZAPTEL_VERSION := 1.2.18 +ZAPTEL_VERSION := 1.2.19 ZAPTEL_SOURCE := zaptel-$(ZAPTEL_VERSION).tar.gz ZAPTEL_SITE := ftp://ftp.digium.com/pub/zaptel/releases ZAPTEL_DIR := $(BUILD_DIR)/zaptel-$(ZAPTEL_VERSION) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dha...@us...> - 2007-07-27 05:07:44
|
Revision: 1154 http://astlinux.svn.sourceforge.net/astlinux/?rev=1154&view=rev Author: dhartman Date: 2007-07-26 22:07:47 -0700 (Thu, 26 Jul 2007) Log Message: ----------- version bump on asterisk, mod download paths to Digium's new standard Modified Paths: -------------- trunk/package/asterisk/asterisk.mk trunk/package/zaptel/zaptel.mk Modified: trunk/package/asterisk/asterisk.mk =================================================================== --- trunk/package/asterisk/asterisk.mk 2007-07-24 22:25:50 UTC (rev 1153) +++ trunk/package/asterisk/asterisk.mk 2007-07-27 05:07:47 UTC (rev 1154) @@ -3,9 +3,9 @@ # asterisk # ############################################################## -ASTERISK_VERSION := 1.2.22 +ASTERISK_VERSION := 1.2.23 ASTERISK_SOURCE := asterisk-$(ASTERISK_VERSION).tar.gz -ASTERISK_SITE := ftp://ftp.digium.com/pub/asterisk/releases +ASTERISK_SITE := http://downloads.digium.com/pub/asterisk/releases ASTERISK_DIR := $(BUILD_DIR)/asterisk-$(ASTERISK_VERSION) ASTERISK_BINARY := asterisk ASTERISK_TARGET_BINARY := usr/sbin/asterisk Modified: trunk/package/zaptel/zaptel.mk =================================================================== --- trunk/package/zaptel/zaptel.mk 2007-07-24 22:25:50 UTC (rev 1153) +++ trunk/package/zaptel/zaptel.mk 2007-07-27 05:07:47 UTC (rev 1154) @@ -5,7 +5,7 @@ ############################################################## ZAPTEL_VERSION := 1.2.19 ZAPTEL_SOURCE := zaptel-$(ZAPTEL_VERSION).tar.gz -ZAPTEL_SITE := ftp://ftp.digium.com/pub/zaptel/releases +ZAPTEL_SITE := http://downloads.digium.com/pub/zaptel/releases ZAPTEL_DIR := $(BUILD_DIR)/zaptel-$(ZAPTEL_VERSION) ZAPTEL_BINARY := ztcfg ZAPTEL_TARGET_BINARY := sbin/ztcfg This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kr...@us...> - 2007-08-23 21:06:55
|
Revision: 1204 http://astlinux.svn.sourceforge.net/astlinux/?rev=1204&view=rev Author: krisk84 Date: 2007-08-23 14:06:57 -0700 (Thu, 23 Aug 2007) Log Message: ----------- Somewhat hack-ish implementation of ATM support for Linux I have to clean up the clean targets and integrate these tools with config and startup but it should work for now Modified Paths: -------------- trunk/package/Config.in Added Paths: ----------- trunk/package/linux-atm/ trunk/package/linux-atm/Config.in trunk/package/linux-atm/linux-atm-2.4.1-cross.patch trunk/package/linux-atm/linux-atm-2.4.1-gcc4.patch trunk/package/linux-atm/linux-atm-2.4.1-mkerrnos_pl.patch trunk/package/linux-atm/linux-atm-2.4.1-types-h.patch trunk/package/linux-atm/linux-atm-2.4.1-uclibc-1.patch trunk/package/linux-atm/linux-atm.mk Modified: trunk/package/Config.in =================================================================== --- trunk/package/Config.in 2007-08-23 15:51:06 UTC (rev 1203) +++ trunk/package/Config.in 2007-08-23 21:06:57 UTC (rev 1204) @@ -99,6 +99,7 @@ source "package/libusb/Config.in" source "package/lighttpd/Config.in" source "package/links/Config.in" +source "package/linux-atm/Config.in" source "package/lmsensors/Config.in" source "package/lrzsz/Config.in" source "package/ltp-testsuite/Config.in" Added: trunk/package/linux-atm/Config.in =================================================================== --- trunk/package/linux-atm/Config.in (rev 0) +++ trunk/package/linux-atm/Config.in 2007-08-23 21:06:57 UTC (rev 1204) @@ -0,0 +1,12 @@ +config BR2_PACKAGE_LINUX-ATM + bool "linux-atm" + default n + help + A collection of utilities for Linux to deal with ATM + connections. This also includes support for RFC2684 + bridging. + + + http://sourceforge.net/projects/linux-atm/ + http://www.bitshrine.org/gpp/linux-atm*.patch + http://download.gna.org/ueagleatm/ Added: trunk/package/linux-atm/linux-atm-2.4.1-cross.patch =================================================================== --- trunk/package/linux-atm/linux-atm-2.4.1-cross.patch (rev 0) +++ trunk/package/linux-atm/linux-atm-2.4.1-cross.patch 2007-08-23 21:06:57 UTC (rev 1204) @@ -0,0 +1,722 @@ +diff --exclude CVS -uNr linux-atm-2.4.1/src/arpd/Makefile.in linux-atm-2.4.1.modified/src/arpd/Makefile.in +--- linux-atm-2.4.1/src/arpd/Makefile.in 2003-04-30 09:44:05.000000000 -0500 ++++ linux-atm-2.4.1.modified/src/arpd/Makefile.in 2006-02-17 18:28:34.000000000 -0600 +@@ -326,21 +326,21 @@ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +-arp.o: arp.c ../../config.h ../../src/include/stdint.h \ ++arp.o: arp.c ../../config.h \ + ../../src/include/atm.h ../../src/include/atmd.h atmarp.h \ + atmarpd.h table.h itf.h io.h arp.h +-atmarp.o: atmarp.c ../../config.h ../../src/include/stdint.h \ ++atmarp.o: atmarp.c ../../config.h \ + ../../src/include/atm.h ../../src/include/atmd.h atmarpd.h + atmarpd.o: atmarpd.c ../../config.h ../../src/include/atm.h \ +- ../../src/include/stdint.h ../../src/include/atmd.h atmarpd.h \ ++ ../../src/include/atmd.h atmarpd.h \ + io.h table.h +-io.o: io.c ../../config.h ../../src/include/stdint.h \ ++io.o: io.c ../../config.h \ + ../../src/include/atm.h ../../src/include/atmd.h atmarpd.h \ + table.h arp.h atmarp.h itf.h io.h +-itf.o: itf.c ../../config.h ../../src/include/stdint.h \ ++itf.o: itf.c ../../config.h \ + ../../src/include/atmd.h ../../src/include/atm.h table.h io.h \ + itf.h arp.h atmarp.h atmarpd.h +-table.o: table.c ../../config.h ../../src/include/stdint.h \ ++table.o: table.c ../../config.h \ + ../../src/include/atm.h ../../src/include/atmd.h atmarpd.h \ + table.h + +diff --exclude CVS -uNr linux-atm-2.4.1/src/debug/Makefile.in linux-atm-2.4.1.modified/src/debug/Makefile.in +--- linux-atm-2.4.1/src/debug/Makefile.in 2003-04-30 09:44:00.000000000 -0500 ++++ linux-atm-2.4.1.modified/src/debug/Makefile.in 2006-02-17 18:28:34.000000000 -0600 +@@ -250,10 +250,8 @@ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +-delay.o: delay.c ../../config.h ../../src/include/atm.h \ +- ../../src/include/stdint.h +-svctor.o: svctor.c ../../config.h ../../src/include/atm.h \ +- ../../src/include/stdint.h ++delay.o: delay.c ../../config.h ../../src/include/atm.h ++svctor.o: svctor.c ../../config.h ../../src/include/atm.h + + info-am: + info: info-am +diff --exclude CVS -uNr linux-atm-2.4.1/src/ilmid/Makefile.in linux-atm-2.4.1.modified/src/ilmid/Makefile.in +--- linux-atm-2.4.1/src/ilmid/Makefile.in 2003-04-30 09:44:06.000000000 -0500 ++++ linux-atm-2.4.1.modified/src/ilmid/Makefile.in 2006-02-17 18:28:34.000000000 -0600 +@@ -335,15 +335,15 @@ + asn1/asn_len.h asn1/asn_tag.h asn1/asn_int.h asn1/asn_octs.h \ + asn1/asn_bits.h asn1/asn_oid.h asn1/asn_null.h asn1/asn_list.h \ + rfc1155_smi.h rfc1157_snmp.h mib.h ../../src/include/atmd.h \ +- ../../src/include/stdint.h ../../src/include/atm.h util.h ++ ../../src/include/atm.h util.h + ilmid.o: ilmid.c ../../config.h asn1/asn_incl.h asn1/asn_config.h \ + asn1/nibble_alloc.h asn1/sbuf.h asn1/print.h asn1/asn_len.h \ + asn1/asn_tag.h asn1/asn_int.h asn1/asn_octs.h asn1/asn_bits.h \ + asn1/asn_oid.h asn1/asn_null.h asn1/asn_list.h rfc1155_smi.h \ + rfc1157_snmp.h message.h util.h ../../src/include/atmd.h \ +- ../../src/include/stdint.h ../../src/include/atm.h io.h mib.h \ ++ ../../src/include/atm.h io.h mib.h \ + atmf_uni.h sysgroup.h +-io.o: io.c ../../config.h ../../src/include/stdint.h \ ++io.o: io.c ../../config.h \ + ../../src/include/atm.h io.h asn1/asn_incl.h asn1/asn_config.h \ + asn1/nibble_alloc.h asn1/sbuf.h asn1/print.h asn1/asn_len.h \ + asn1/asn_tag.h asn1/asn_int.h asn1/asn_octs.h asn1/asn_bits.h \ +@@ -354,10 +354,10 @@ + asn1/asn_len.h asn1/asn_tag.h asn1/asn_int.h asn1/asn_octs.h \ + asn1/asn_bits.h asn1/asn_oid.h asn1/asn_null.h asn1/asn_list.h \ + rfc1155_smi.h rfc1157_snmp.h atmf_uni.h mib.h \ +- ../../src/include/atmd.h ../../src/include/stdint.h \ ++ ../../src/include/atmd.h \ + ../../src/include/atm.h util.h + mib.o: mib.c ../../config.h mib.h ../../src/include/atmd.h \ +- ../../src/include/stdint.h ../../src/include/atm.h \ ++ ../../src/include/atm.h \ + asn1/asn_incl.h asn1/asn_config.h asn1/nibble_alloc.h \ + asn1/sbuf.h asn1/print.h asn1/asn_len.h asn1/asn_tag.h \ + asn1/asn_int.h asn1/asn_octs.h asn1/asn_bits.h asn1/asn_oid.h \ +@@ -378,13 +378,13 @@ + asn1/asn_len.h asn1/asn_tag.h asn1/asn_int.h asn1/asn_octs.h \ + asn1/asn_bits.h asn1/asn_oid.h asn1/asn_null.h asn1/asn_list.h \ + rfc1155_smi.h rfc1157_snmp.h mib.h ../../src/include/atmd.h \ +- ../../src/include/stdint.h ../../src/include/atm.h ++ ../../src/include/atm.h + util.o: util.c ../../config.h util.h asn1/asn_incl.h asn1/asn_config.h \ + asn1/nibble_alloc.h asn1/sbuf.h asn1/print.h asn1/asn_len.h \ + asn1/asn_tag.h asn1/asn_int.h asn1/asn_octs.h asn1/asn_bits.h \ + asn1/asn_oid.h asn1/asn_null.h asn1/asn_list.h rfc1155_smi.h \ + rfc1157_snmp.h ../../src/include/atmd.h \ +- ../../src/include/stdint.h ../../src/include/atm.h ++ ../../src/include/atm.h + + info-am: + info: info-recursive +diff --exclude CVS -uNr linux-atm-2.4.1/src/include/Makefile.in linux-atm-2.4.1.modified/src/include/Makefile.in +--- linux-atm-2.4.1/src/include/Makefile.in 2003-04-30 09:43:57.000000000 -0500 ++++ linux-atm-2.4.1.modified/src/include/Makefile.in 2006-02-17 18:28:34.000000000 -0600 +@@ -86,7 +86,7 @@ + YACC = @YACC@ + + include_HEADERS = atm.h atmd.h atmsap.h +-noinst_HEADERS = stdint.h ++#noinst_HEADERS = stdint.h + mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs + CONFIG_HEADER = ../../config.h + CONFIG_CLEAN_FILES = +diff --exclude CVS -uNr linux-atm-2.4.1/src/lane/Makefile.in linux-atm-2.4.1.modified/src/lane/Makefile.in +--- linux-atm-2.4.1/src/lane/Makefile.in 2003-04-30 09:44:10.000000000 -0500 ++++ linux-atm-2.4.1.modified/src/lane/Makefile.in 2006-02-17 18:28:34.000000000 -0600 +@@ -331,58 +331,58 @@ + fi; \ + done + atm_lecs.o: atm_lecs.c ../../config.h ../../src/include/atm.h \ +- ../../src/include/stdint.h ../../src/include/atmsap.h \ ++ ../../src/include/atmsap.h \ + atm_lecs.h +-connect.o: connect.c ../../config.h ../../src/include/stdint.h mem.h \ ++connect.o: connect.c ../../config.h mem.h \ + units.h lane.h dump.h ../../src/include/atm.h \ + ../../src/include/atmsap.h load.h connect.h timers.h events.h \ + db.h packet.h lane_atm.h +-connect_bus.o: connect_bus.c ../../config.h ../../src/include/stdint.h \ ++connect_bus.o: connect_bus.c ../../config.h \ + mem.h units.h lane.h dump.h ../../src/include/atm.h \ + ../../src/include/atmsap.h load.h connect.h timers.h events.h \ + lane_atm.h +-db.o: db.c ../../config.h ../../src/include/stdint.h mem.h units.h \ ++db.o: db.c ../../config.h mem.h units.h \ + lane.h dump.h ../../src/include/atm.h \ + ../../src/include/atmsap.h load.h connect.h timers.h events.h \ + db.h +-dump.o: dump.c ../../config.h ../../src/include/stdint.h \ ++dump.o: dump.c ../../config.h \ + ../../src/include/atm.h ../../src/include/atmsap.h dump.h \ + units.h lane.h load.h + events.o: events.c ../../config.h events.h units.h load.h lane.h dump.h \ +- ../../src/include/atm.h ../../src/include/stdint.h \ ++ ../../src/include/atm.h \ + ../../src/include/atmsap.h mem.h timers.h connect.h + lane.o: lane.c ../../config.h units.h load.h lane.h dump.h \ +- ../../src/include/atm.h ../../src/include/stdint.h \ ++ ../../src/include/atm.h \ + ../../src/include/atmsap.h mem.h connect.h timers.h events.h + lane_atm.o: lane_atm.c ../../config.h lane_atm.h units.h lane.h \ + connect.h timers.h load.h events.h ../../src/include/atmsap.h \ +- ../../src/include/stdint.h dump.h ../../src/include/atm.h mem.h ++ dump.h ../../src/include/atm.h mem.h + ldb.o: ldb.c ../../config.h ../../src/include/atm.h \ +- ../../src/include/stdint.h lecs.h ldb.h mem_lecs.h +-lecs.o: lecs.c ../../config.h ../../src/include/stdint.h \ ++ lecs.h ldb.h mem_lecs.h ++lecs.o: lecs.c ../../config.h \ + ../../src/include/atm.h lecs_load.h ldb.h mem_lecs.h lecs.h \ + atm_lecs.h + lecs_db.o: lecs_db.c ../../config.h lecs_load.h lecs_db.h + lecs_load.o: lecs_load.c ../../config.h lecs_load.h lecs_db.h ldb.h \ + lecs.h + load.o: load.c ../../config.h load.h units.h lane.h dump.h \ +- ../../src/include/atm.h ../../src/include/stdint.h \ ++ ../../src/include/atm.h \ + ../../src/include/atmsap.h mem.h load_lex.h +-load_lex.o: load_lex.c ../../config.h ../../src/include/stdint.h \ ++load_lex.o: load_lex.c ../../config.h \ + load_lex.h lane.h units.h load.h mem.h + mem.o: mem.c ../../config.h mem.h units.h dump.h ../../src/include/atm.h \ +- ../../src/include/stdint.h ../../src/include/atmsap.h lane.h \ ++ ../../src/include/atmsap.h lane.h \ + load.h + mem_lecs.o: mem_lecs.c ../../config.h mem_lecs.h +-packet.o: packet.c ../../config.h ../../src/include/stdint.h mem.h \ ++packet.o: packet.c ../../config.h mem.h \ + units.h lane.h dump.h ../../src/include/atm.h \ + ../../src/include/atmsap.h load.h connect.h timers.h events.h \ + db.h packet.h + timers.o: timers.c ../../config.h timers.h units.h load.h lane.h dump.h \ +- ../../src/include/atm.h ../../src/include/stdint.h \ ++ ../../src/include/atm.h \ + ../../src/include/atmsap.h mem.h + units.o: units.c ../../config.h units.h mem.h lane.h load.h dump.h \ +- ../../src/include/atm.h ../../src/include/stdint.h \ ++ ../../src/include/atm.h \ + ../../src/include/atmsap.h connect.h timers.h events.h \ + lane_atm.h + +diff --exclude CVS -uNr linux-atm-2.4.1/src/led/Makefile.in linux-atm-2.4.1.modified/src/led/Makefile.in +--- linux-atm-2.4.1/src/led/Makefile.in 2003-04-30 09:44:09.000000000 -0500 ++++ linux-atm-2.4.1.modified/src/led/Makefile.in 2006-02-17 18:28:34.000000000 -0600 +@@ -298,25 +298,25 @@ + fi; \ + done + address.o: address.c ../../config.h ../../src/include/atm.h \ +- ../../src/include/stdint.h ../../src/include/atmd.h address.h ++ ../../src/include/atmd.h address.h + conn.o: conn.c ../../config.h ../../src/include/atm.h \ +- ../../src/include/stdint.h ../../src/include/atmsap.h \ ++ ../../src/include/atmsap.h \ + ../../src/include/atmd.h conn.h display.h lec.h frames.h \ + frame_defs.h kernel.h + display.o: display.c ../../config.h ../../src/include/atm.h \ +- ../../src/include/stdint.h ../../src/include/atmd.h display.h \ ++ ../../src/include/atmd.h display.h \ + frame_defs.h + frames.o: frames.c ../../config.h ../../src/include/atm.h \ +- ../../src/include/stdint.h ../../src/include/atmd.h conn.h \ ++ ../../src/include/atmd.h conn.h \ + lec.h frames.h frame_defs.h display.h kernel.h + join.o: join.c ../../config.h ../../src/include/atm.h \ +- ../../src/include/stdint.h ../../src/include/atmd.h conn.h \ ++ ../../src/include/atmd.h conn.h \ + lec.h join.h frames.h frame_defs.h display.h + kernel.o: kernel.c ../../config.h ../../src/include/atm.h \ +- ../../src/include/stdint.h ../../src/include/atmd.h kernel.h \ ++ ../../src/include/atmd.h kernel.h \ + lec.h conn.h frames.h frame_defs.h + main.o: main.c ../../config.h ../../src/include/atm.h \ +- ../../src/include/stdint.h ../../src/include/atmd.h join.h \ ++ ../../src/include/atmd.h join.h \ + lec.h conn.h address.h display.h kernel.h + + info-am: +diff --exclude CVS -uNr linux-atm-2.4.1/src/lib/Makefile.am linux-atm-2.4.1.modified/src/lib/Makefile.am +--- linux-atm-2.4.1/src/lib/Makefile.am 2001-10-09 16:46:42.000000000 -0500 ++++ linux-atm-2.4.1.modified/src/lib/Makefile.am 2006-02-17 18:28:34.000000000 -0600 +@@ -13,7 +13,6 @@ + libatm_la_LIBADD = -lresolv + libatm_la_DEPENDENCIES = $(top_builddir)/src/include/atm.h \ + $(top_builddir)/src/include/atmsap.h \ +- $(top_builddir)/src/include/stdint.h \ + $(top_builddir)/src/include/atmd.h + + +diff --exclude CVS -uNr linux-atm-2.4.1/src/lib/Makefile.in linux-atm-2.4.1.modified/src/lib/Makefile.in +--- linux-atm-2.4.1/src/lib/Makefile.in 2003-04-30 09:43:58.000000000 -0500 ++++ linux-atm-2.4.1.modified/src/lib/Makefile.in 2006-02-17 18:28:34.000000000 -0600 +@@ -100,7 +100,6 @@ + libatm_la_LIBADD = -lresolv + libatm_la_DEPENDENCIES = $(top_builddir)/src/include/atm.h \ + $(top_builddir)/src/include/atmsap.h \ +- $(top_builddir)/src/include/stdint.h \ + $(top_builddir)/src/include/atmd.h + + mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +@@ -258,47 +257,47 @@ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +-ans.lo ans.o : ans.c ../../config.h ../../src/include/stdint.h \ ++ans.lo ans.o : ans.c ../../config.h \ + ../../src/include/atm.h atmres.h + atm2text.lo atm2text.o : atm2text.c ../../config.h \ +- ../../src/include/atm.h ../../src/include/stdint.h atmres.h ++ ../../src/include/atm.h atmres.h + atmequal.lo atmequal.o : atmequal.c ../../config.h \ +- ../../src/include/atm.h ../../src/include/stdint.h +-common.lo common.o : common.c ../../config.h ../../src/include/stdint.h \ ++ ../../src/include/atm.h ++common.lo common.o : common.c ../../config.h \ + ../../src/include/atmd.h ../../src/include/atm.h + diag.lo diag.o : diag.c ../../config.h ../../src/include/atmd.h \ +- ../../src/include/stdint.h ../../src/include/atm.h ++ ../../src/include/atm.h + kptr.lo kptr.o : kptr.c ../../config.h ../../src/include/atm.h \ +- ../../src/include/stdint.h ../../src/include/atmd.h +-misc.lo misc.o : misc.c ../../config.h ../../src/include/stdint.h \ ++ ../../src/include/atmd.h ++misc.lo misc.o : misc.c ../../config.h \ + ../../src/include/atm.h ../../src/include/atmsap.h + qos2text.lo qos2text.o : qos2text.c ../../config.h \ +- ../../src/include/atm.h ../../src/include/stdint.h ++ ../../src/include/atm.h + qosequal.lo qosequal.o : qosequal.c ../../config.h \ +- ../../src/include/atm.h ../../src/include/stdint.h ++ ../../src/include/atm.h + sap2text.lo sap2text.o : sap2text.c ../../config.h \ +- ../../src/include/atmsap.h ../../src/include/stdint.h \ ++ ../../src/include/atmsap.h \ + ../../src/include/atm.h + sapequal.lo sapequal.o : sapequal.c ../../config.h \ +- ../../src/include/atm.h ../../src/include/stdint.h \ ++ ../../src/include/atm.h \ + ../../src/include/atmsap.h + sdu2cell.lo sdu2cell.o : sdu2cell.c ../../config.h \ +- ../../src/include/atm.h ../../src/include/stdint.h ++ ../../src/include/atm.h + text2atm.lo text2atm.o : text2atm.c ../../config.h \ +- ../../src/include/atm.h ../../src/include/stdint.h \ ++ ../../src/include/atm.h \ + ../../src/include/atmsap.h atmres.h + text2ip.lo text2ip.o : text2ip.c ../../config.h \ +- ../../src/include/stdint.h ../../src/include/atm.h \ ++ ../../src/include/atm.h \ + ../../src/include/atmd.h + text2qos.lo text2qos.o : text2qos.c ../../config.h \ +- ../../src/include/atm.h ../../src/include/stdint.h ++ ../../src/include/atm.h + text2sap.lo text2sap.o : text2sap.c ../../config.h \ +- ../../src/include/atmsap.h ../../src/include/stdint.h \ ++ ../../src/include/atmsap.h \ + ../../src/include/atm.h + timer.lo timer.o : timer.c ../../config.h ../../src/include/atmd.h \ +- ../../src/include/stdint.h ../../src/include/atm.h ++ ../../src/include/atm.h + unix.lo unix.o : unix.c ../../config.h ../../src/include/atmd.h \ +- ../../src/include/stdint.h ../../src/include/atm.h ++ ../../src/include/atm.h + + info-am: + info: info-am +diff --exclude CVS -uNr linux-atm-2.4.1/src/lib/sapequal.c linux-atm-2.4.1.modified/src/lib/sapequal.c +--- linux-atm-2.4.1/src/lib/sapequal.c 2001-09-03 13:41:05.000000000 -0500 ++++ linux-atm-2.4.1.modified/src/lib/sapequal.c 2006-02-17 18:28:34.000000000 -0600 +@@ -65,6 +65,7 @@ + CHECK(l2.itu.window,a.l2.itu.window > b.l2.itu.window); + break; + default: ++ break; + } + switch (a.l3_proto) { + case ATM_L3_X25: +@@ -83,6 +84,7 @@ + if (a.l3.user != b.l3.user) return 0; + break; + default: ++ break; + } + return 1; + } +diff --exclude CVS -uNr linux-atm-2.4.1/src/maint/Makefile.in linux-atm-2.4.1.modified/src/maint/Makefile.in +--- linux-atm-2.4.1/src/maint/Makefile.in 2003-04-30 09:44:04.000000000 -0500 ++++ linux-atm-2.4.1.modified/src/maint/Makefile.in 2006-02-17 18:28:34.000000000 -0600 +@@ -414,27 +414,20 @@ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +-atmaddr.o: atmaddr.c ../../config.h ../../src/include/atm.h \ +- ../../src/include/stdint.h +-atmdiag.o: atmdiag.c ../../config.h ../../src/include/atm.h \ +- ../../src/include/stdint.h +-atmdump.o: atmdump.c ../../config.h ../../src/include/stdint.h \ ++atmaddr.o: atmaddr.c ../../config.h ../../src/include/atm.h ++atmdiag.o: atmdiag.c ../../config.h ../../src/include/atm.h ++atmdump.o: atmdump.c ../../config.h \ + ../../src/include/atm.h +-atmloop.o: atmloop.c ../../config.h ../../src/include/atm.h \ +- ../../src/include/stdint.h +-atmtcp.o: atmtcp.c ../../config.h ../../src/include/stdint.h \ ++atmloop.o: atmloop.c ../../config.h ../../src/include/atm.h ++atmtcp.o: atmtcp.c ../../config.h \ + ../../src/include/atm.h ../../src/include/atmd.h +-enitune.o: enitune.c ../../config.h ../../src/include/atm.h \ +- ../../src/include/stdint.h +-esi.o: esi.c ../../config.h ../../src/include/atm.h \ +- ../../src/include/stdint.h ++enitune.o: enitune.c ../../config.h ../../src/include/atm.h ++esi.o: esi.c ../../config.h ../../src/include/atm.h + saaldump.o: saaldump.c ../../config.h ../../src/include/atm.h \ +- ../../src/include/stdint.h ../../src/saal/pdu.h \ ++ ../../src/saal/pdu.h \ + ../../src/include/atmd.h ../../src/qgen/qlib.h +-sonetdiag.o: sonetdiag.c ../../config.h ../../src/include/atm.h \ +- ../../src/include/stdint.h +-zntune.o: zntune.c ../../config.h ../../src/include/atm.h \ +- ../../src/include/stdint.h ++sonetdiag.o: sonetdiag.c ../../config.h ../../src/include/atm.h ++zntune.o: zntune.c ../../config.h ../../src/include/atm.h + + info-am: + info: info-am +diff --exclude CVS -uNr linux-atm-2.4.1/src/maint/enitune.c linux-atm-2.4.1.modified/src/maint/enitune.c +--- linux-atm-2.4.1/src/maint/enitune.c 2001-09-03 13:41:06.000000000 -0500 ++++ linux-atm-2.4.1.modified/src/maint/enitune.c 2006-02-17 18:28:34.000000000 -0600 +@@ -44,6 +44,7 @@ + if (*end || mult.rx <= 100) usage(name); + break; + default: ++ break; + } + if (argc != optind+1) usage(name); + sioc.number = strtol(argv[optind],&end,0); +diff --exclude CVS -uNr linux-atm-2.4.1/src/mpoad/Makefile.in linux-atm-2.4.1.modified/src/mpoad/Makefile.in +--- linux-atm-2.4.1/src/mpoad/Makefile.in 2003-04-30 09:44:11.000000000 -0500 ++++ linux-atm-2.4.1.modified/src/mpoad/Makefile.in 2006-02-17 18:28:34.000000000 -0600 +@@ -300,28 +300,27 @@ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +-get_vars.o: get_vars.c ../../config.h ../../src/include/stdint.h \ ++get_vars.o: get_vars.c ../../config.h \ + ../../src/include/atm.h packets.h get_vars.h io.h + id_list.o: id_list.c ../../config.h ../../src/include/atm.h \ +- ../../src/include/stdint.h packets.h ++ packets.h + io.o: io.c ../../config.h ../../src/include/atm.h \ +- ../../src/include/stdint.h packets.h k_interf.h io.h get_vars.h \ ++ packets.h k_interf.h io.h get_vars.h \ + poll2select.h +-k_interf.o: k_interf.c ../../config.h ../../src/include/stdint.h \ ++k_interf.o: k_interf.c ../../config.h \ + ../../src/include/atm.h k_interf.h packets.h io.h get_vars.h +-lecs.o: lecs.c ../../config.h ../../src/include/stdint.h \ ++lecs.o: lecs.c ../../config.h \ + ../../src/include/atm.h ../../src/include/atmsap.h lecs.h \ + k_interf.h + main.o: main.c ../../config.h ../../src/include/atm.h \ +- ../../src/include/stdint.h packets.h io.h k_interf.h get_vars.h \ ++ packets.h io.h k_interf.h get_vars.h \ + lecs.h +-p_factory.o: p_factory.c ../../config.h ../../src/include/stdint.h \ ++p_factory.o: p_factory.c ../../config.h \ + ../../src/include/atm.h packets.h get_vars.h io.h + p_recogn.o: p_recogn.c ../../config.h ../../src/include/atm.h \ +- ../../src/include/stdint.h io.h k_interf.h packets.h ++ io.h k_interf.h packets.h + poll2select.o: poll2select.c ../../config.h +-tag_list.o: tag_list.c ../../config.h packets.h ../../src/include/atm.h \ +- ../../src/include/stdint.h ++tag_list.o: tag_list.c ../../config.h packets.h ../../src/include/atm.h + + info-am: + info: info-am +diff --exclude CVS -uNr linux-atm-2.4.1/src/qgen/Makefile.in linux-atm-2.4.1.modified/src/qgen/Makefile.in +--- linux-atm-2.4.1/src/qgen/Makefile.in 2003-04-30 09:44:01.000000000 -0500 ++++ linux-atm-2.4.1.modified/src/qgen/Makefile.in 2006-02-17 18:39:45.000000000 -0600 +@@ -65,6 +65,7 @@ + target_triplet = @target@ + AS = @AS@ + CC = @CC@ ++HOSTCC = @HOSTCC@ + DLLTOOL = @DLLTOOL@ + ECHO = @ECHO@ + EXEEXT = @EXEEXT@ +@@ -136,9 +137,9 @@ + q_test_OBJECTS = qtest.$(OBJEXT) + q_test_LDADD = $(LDADD) + q_test_LDFLAGS = +-qgen_OBJECTS = common.$(OBJEXT) file.$(OBJEXT) first.$(OBJEXT) \ +-ql_y.$(OBJEXT) ql_l.$(OBJEXT) qgen.$(OBJEXT) second.$(OBJEXT) \ +-third.$(OBJEXT) ++qgen_OBJECTS = common.host.$(OBJEXT) file.host.$(OBJEXT) first.host.$(OBJEXT) \ ++ql_y.host.$(OBJEXT) ql_l.host.$(OBJEXT) qgen.host.$(OBJEXT) second.host.$(OBJEXT) \ ++third.host.$(OBJEXT) + qgen_DEPENDENCIES = + qgen_LDFLAGS = + q_dump_OBJECTS = common.$(OBJEXT) +@@ -239,7 +240,7 @@ + + qgen$(EXEEXT): $(qgen_OBJECTS) $(qgen_DEPENDENCIES) + @rm -f qgen$(EXEEXT) +- $(LINK) $(qgen_LDFLAGS) $(qgen_OBJECTS) $(qgen_LDADD) $(LIBS) ++ $(HOSTCC) -o $@ $(qgen_LDFLAGS) $(qgen_OBJECTS) $(qgen_LDADD) $(LIBS) + + q.dump: $(q_dump_OBJECTS) $(q_dump_DEPENDENCIES) + @rm -f q.dump +@@ -417,3 +418,31 @@ + # Tell versions [3.59,3.63) of GNU make to not export all variables. + # Otherwise a system limit (for SysV at least) may be exceeded. + .NOEXPORT: ++ ++qgen_OBJECTS = common.host.$(OBJEXT) file.host.$(OBJEXT) first.host.$(OBJEXT) \ ++ql_y.host.$(OBJEXT) ql_l.host.$(OBJEXT) qgen.host.$(OBJEXT) second.host.$(OBJEXT) \ ++third.host.$(OBJEXT) ++ ++common.host.o: common.c ../../config.h common.h ++ $(HOSTCC) $(DEFS) $(CFLAGS) -c common.c -o $@ ++ ++file.host.o: file.c ../../config.h common.h file.h ++ $(HOSTCC) $(DEFS) $(CFLAGS) -c file.c -o $@ ++ ++first.host.o: first.c ../../config.h common.h qgen.h file.h ++ $(HOSTCC) $(DEFS) $(CFLAGS) -c first.c -o $@ ++ ++ql_y.host.o: ql_y.c ../../config.h common.h qgen.h file.h ++ $(HOSTCC) $(DEFS) $(CFLAGS) -c ql_y.c -o $@ ++ ++ql_l.host.o: ql_l.c ../../config.h common.h qgen.h ql_y.h ++ $(HOSTCC) $(DEFS) $(CFLAGS) -c ql_l.c -o $@ ++ ++qgen.host.o: qgen.c ../../config.h common.h file.h qgen.h ++ $(HOSTCC) $(DEFS) $(CFLAGS) -c qgen.c -o $@ ++ ++second.host.o: second.c ../../config.h common.h qgen.h file.h ++ $(HOSTCC) $(DEFS) $(CFLAGS) -c second.c -o $@ ++ ++third.host.o: third.c ../../config.h common.h qgen.h file.h ++ $(HOSTCC) $(DEFS) $(CFLAGS) -c third.c -o $@ +diff --exclude CVS -uNr linux-atm-2.4.1/src/saal/Makefile.in linux-atm-2.4.1.modified/src/saal/Makefile.in +--- linux-atm-2.4.1/src/saal/Makefile.in 2003-04-30 09:44:02.000000000 -0500 ++++ linux-atm-2.4.1.modified/src/saal/Makefile.in 2006-02-17 18:28:34.000000000 -0600 +@@ -232,17 +232,17 @@ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +-pdu.o: pdu.c ../../config.h ../../src/include/stdint.h pdu.h \ ++pdu.o: pdu.c ../../config.h pdu.h \ + ../../src/include/atmd.h ../../src/include/atm.h + queue.o: queue.c ../../config.h ../../src/include/atmd.h \ +- ../../src/include/stdint.h ../../src/include/atm.h queue.h +-saal.o: saal.c ../../config.h sscop.h ../../src/include/stdint.h \ ++ ../../src/include/atm.h queue.h ++saal.o: saal.c ../../config.h sscop.h \ + ../../src/include/atmd.h ../../src/include/atm.h queue.h saal.h \ + sscf.h + sscf.o: sscf.c ../../config.h ../../src/include/atmd.h \ +- ../../src/include/stdint.h ../../src/include/atm.h sscop.h \ ++ ../../src/include/atm.h sscop.h \ + queue.h sscf.h +-sscop.o: sscop.c ../../config.h ../../src/include/stdint.h \ ++sscop.o: sscop.c ../../config.h \ + ../../src/include/atmd.h ../../src/include/atm.h sscop.h \ + queue.h pdu.h + +diff --exclude CVS -uNr linux-atm-2.4.1/src/sigd/Makefile.in linux-atm-2.4.1.modified/src/sigd/Makefile.in +--- linux-atm-2.4.1/src/sigd/Makefile.in 2003-04-30 09:44:03.000000000 -0500 ++++ linux-atm-2.4.1.modified/src/sigd/Makefile.in 2006-02-17 18:28:34.000000000 -0600 +@@ -374,25 +374,25 @@ + fi; \ + done + atmsigd.o: atmsigd.c ../../config.h ../../src/include/atm.h \ +- ../../src/include/stdint.h ../../src/include/atmd.h \ ++ ../../src/include/atmd.h \ + ../../src/qgen/qlib.h io.h proto.h ../../src/include/atmsap.h \ + ../../src/saal/saal.h ../../src/saal/sscf.h \ + ../../src/saal/sscop.h ../../src/saal/queue.h trace.h + cfg_l.o: cfg_l.c ../../config.h ../../src/include/atm.h \ +- ../../src/include/stdint.h cfg_y.h ++ cfg_y.h + cfg_y.o: cfg_y.c ../../config.h ../../src/include/atm.h \ +- ../../src/include/stdint.h ../../src/include/atmd.h proto.h \ ++ ../../src/include/atmd.h proto.h \ + ../../src/include/atmsap.h ../../src/saal/saal.h \ + ../../src/saal/sscf.h ../../src/saal/sscop.h \ + ../../src/saal/queue.h io.h trace.h policy.h + io.o: io.c ../../config.h ../../src/include/atm.h \ +- ../../src/include/stdint.h ../../src/include/atmd.h \ ++ ../../src/include/atmd.h \ + ../../src/qgen/uni.h ../../src/saal/pdu.h proto.h \ + ../../src/include/atmsap.h ../../src/saal/saal.h \ + ../../src/saal/sscf.h ../../src/saal/sscop.h \ + ../../src/saal/queue.h io.h trace.h + kernel.o: kernel.c ../../config.h ../../src/include/atm.h \ +- ../../src/include/stdint.h ../../src/include/atmd.h \ ++ ../../src/include/atmd.h \ + ../../src/qgen/uni.h ../../src/qgen/qlib.h \ + ../../src/qgen/q.out.h proto.h ../../src/include/atmsap.h \ + ../../src/saal/saal.h ../../src/saal/sscf.h \ +@@ -400,36 +400,36 @@ + policy.h timeout.h + mess.o: mess.c ../../config.h + policy.o: policy.c ../../config.h ../../src/include/atm.h \ +- ../../src/include/stdint.h ../../src/include/atmd.h proto.h \ ++ ../../src/include/atmd.h proto.h \ + ../../src/include/atmsap.h ../../src/saal/saal.h \ + ../../src/saal/sscf.h ../../src/saal/sscop.h \ + ../../src/saal/queue.h policy.h + proto.o: proto.c ../../config.h ../../src/include/atmd.h \ +- ../../src/include/stdint.h ../../src/include/atm.h \ ++ ../../src/include/atm.h \ + ../../src/qgen/uni.h ../../src/qgen/qlib.h \ + ../../src/qgen/q.out.h io.h proto.h ../../src/include/atmsap.h \ + ../../src/saal/saal.h ../../src/saal/sscf.h \ + ../../src/saal/sscop.h ../../src/saal/queue.h sap.h + sap.o: sap.c ../../config.h ../../src/include/atm.h \ +- ../../src/include/stdint.h ../../src/include/atmd.h \ ++ ../../src/include/atmd.h \ + ../../src/qgen/uni.h ../../src/qgen/qlib.h \ + ../../src/qgen/q.out.h ../../src/qgen/common.h proto.h \ + ../../src/include/atmsap.h ../../src/saal/saal.h \ + ../../src/saal/sscf.h ../../src/saal/sscop.h \ + ../../src/saal/queue.h sap.h + timeout.o: timeout.c ../../config.h ../../src/include/atm.h \ +- ../../src/include/stdint.h ../../src/include/atmd.h \ ++ ../../src/include/atmd.h \ + ../../src/qgen/uni.h proto.h ../../src/include/atmsap.h \ + ../../src/saal/saal.h ../../src/saal/sscf.h \ + ../../src/saal/sscop.h ../../src/saal/queue.h timeout.h + trace.o: trace.c ../../config.h ../../src/include/atm.h \ +- ../../src/include/stdint.h ../../src/include/atmd.h \ ++ ../../src/include/atmd.h \ + ../../src/include/atmsap.h trace.h proto.h \ + ../../src/saal/saal.h ../../src/saal/sscf.h \ + ../../src/saal/sscop.h ../../src/saal/queue.h \ + ../../src/qgen/qlib.h + uni.o: uni.c ../../config.h ../../src/include/atm.h \ +- ../../src/include/stdint.h ../../src/include/atmd.h \ ++ ../../src/include/atmd.h \ + ../../src/qgen/uni.h ../../src/qgen/qlib.h \ + ../../src/qgen/q.out.h proto.h ../../src/include/atmsap.h \ + ../../src/saal/saal.h ../../src/saal/sscf.h \ +diff --exclude CVS -uNr linux-atm-2.4.1/src/sigd/proto.c linux-atm-2.4.1.modified/src/sigd/proto.c +--- linux-atm-2.4.1/src/sigd/proto.c 2001-09-03 13:41:06.000000000 -0500 ++++ linux-atm-2.4.1.modified/src/sigd/proto.c 2006-02-17 18:28:34.000000000 -0600 +@@ -259,6 +259,7 @@ + break; + } + default: ++ break; + } + va_end(ap); + if ((size = q_close(&dsc)) >= 0) to_signaling(sock->sig,q_buffer,size); +@@ -288,6 +289,7 @@ + } + break; + default: ++ break; + } + va_end(ap); + } +diff --exclude CVS -uNr linux-atm-2.4.1/src/switch/Makefile.in linux-atm-2.4.1.modified/src/switch/Makefile.in +--- linux-atm-2.4.1/src/switch/Makefile.in 2003-04-30 09:44:12.000000000 -0500 ++++ linux-atm-2.4.1.modified/src/switch/Makefile.in 2006-02-17 18:28:34.000000000 -0600 +@@ -343,30 +343,30 @@ + fi; \ + done + cfg_l.o: cfg_l.c ../../config.h ../../src/include/atm.h \ +- ../../src/include/stdint.h cfg_y.h ++ cfg_y.h + cfg_y.o: cfg_y.c ../../config.h ../../src/include/atm.h \ +- ../../src/include/stdint.h fab.h proto.h \ ++ fab.h proto.h \ + ../../src/include/atmsap.h ../../src/include/atmd.h sig.h \ + route.h swc.h + control.o: control.c ../../config.h ../../src/include/atm.h \ +- ../../src/include/stdint.h ../../src/include/atmd.h fab.h \ ++ ../../src/include/atmd.h fab.h \ + proto.h ../../src/include/atmsap.h sig.h dispatch.h swc.h + dispatch.o: dispatch.c ../../config.h ../../src/include/atmd.h \ +- ../../src/include/stdint.h ../../src/include/atm.h dispatch.h ++ ../../src/include/atm.h dispatch.h + proto.o: proto.c ../../config.h ../../src/include/atm.h \ +- ../../src/include/stdint.h ../../src/include/atmd.h sig.h fab.h \ ++ ../../src/include/atmd.h sig.h fab.h \ + proto.h ../../src/include/atmsap.h + relay.o: relay.c ../../config.h ../../src/include/atm.h \ +- ../../src/include/stdint.h ../../src/include/atmd.h fab.h \ ++ ../../src/include/atmd.h fab.h \ + proto.h ../../src/include/atmsap.h sig.h dispatch.h route.h + route.o: route.c ../../config.h ../../src/include/atm.h \ +- ../../src/include/stdint.h ../../src/include/atmd.h route.h \ ++ ../../src/include/atmd.h route.h \ + sig.h +-sig.o: sig.c ../../config.h ../../src/include/stdint.h \ ++sig.o: sig.c ../../config.h \ + ../../src/include/atmd.h ../../src/include/atm.h dispatch.h \ + proto.h ../../src/include/atmsap.h sig.h route.h fab.h + swc.o: swc.c ../../config.h ../../src/include/atm.h \ +- ../../src/include/stdint.h ../../src/include/atmd.h swc.h ++ ../../src/include/atmd.h swc.h + + info-am: + info: info-recursive +diff --exclude CVS -uNr linux-atm-2.4.1/src/switch/debug/Makefile.in linux-atm-2.4.1.modified/src/switch/debug/Makefile.in +--- linux-atm-2.4.1/src/switch/debug/Makefile.in 2003-04-30 09:44:13.000000000 -0500 ++++ linux-atm-2.4.1.modified/src/switch/debug/Makefile.in 2006-02-17 18:28:34.000000000 -0600 +@@ -239,7 +239,7 @@ + fi; \ + done + debug.o: debug.c ../../../config.h ../../../src/include/atm.h \ +- ../../../src/include/stdint.h ../../../src/include/atmd.h \ ++ ../../../src/include/atmd.h \ + ../../../src/qgen/uni.h ../fab.h ../proto.h \ + ../../../src/include/atmsap.h ../sig.h + +diff --exclude CVS -uNr linux-atm-2.4.1/src/switch/tcp/Makefile.in linux-atm-2.4.1.modified/src/switch/tcp/Makefile.in +--- linux-atm-2.4.1/src/switch/tcp/Makefile.in 2003-04-30 09:44:14.000000000 -0500 ++++ linux-atm-2.4.1.modified/src/switch/tcp/Makefile.in 2006-02-17 18:28:34.000000000 -0600 +@@ -237,7 +237,7 @@ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +-tcpsw.o: tcpsw.c ../../../config.h ../../../src/include/stdint.h \ ++tcpsw.o: tcpsw.c ../../../config.h \ + ../../../src/include/atm.h ../../../src/include/atmd.h \ + ../../../src/qgen/uni.h ../fab.h ../proto.h \ + ../../../src/include/atmsap.h ../sig.h ../dispatch.h ../swc.h +diff --exclude CVS -uNr linux-atm-2.4.1/src/test/Makefile.in linux-atm-2.4.1.modified/src/test/Makefile.in +--- linux-atm-2.4.1/src/test/Makefile.in 2003-04-30 09:43:59.000000000 -0500 ++++ linux-atm-2.4.1.modified/src/test/Makefile.in 2006-02-17 18:28:34.000000000 -0600 +@@ -351,29 +351,22 @@ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +-align.o: align.c ../../config.h ../../src/include/atm.h \ +- ../../src/include/stdint.h +-aping.o: aping.c ../../config.h ../../src/include/atm.h \ +- ../../src/include/stdint.h +-aread.o: aread.c ../../config.h ../../src/include/atm.h \ +- ../../src/include/stdint.h +-awrite.o: awrite.c ../../config.h ../../src/include/atm.h \ +- ../../src/include/stdint.h +-br.o: br.c ../../config.h ../../src/include/atm.h \ +- ../../src/include/stdint.h +-bw.o: bw.c ../../config.h ../../src/include/atm.h \ +- ../../src/include/stdint.h ++align.o: align.c ../../config.h ../../src/include/atm.h ++aping.o: aping.c ../../config.h ../../src/include/atm.h ++aread.o: aread.c ../../config.h ../../src/include/atm.h ++awrite.o: awrite.c ../../config.h ../../src/include/atm.h ++br.o: br.c ../../config.h ../../src/include/atm.h ++bw.o: bw.c ../../config.h ../../src/include/atm.h + isp.o: isp.c ../../config.h ../../src/include/atm.h \ +- ../../src/include/stdint.h ../../src/include/atmd.h isp.h \ ++ ../../src/include/atmd.h isp.h \ + errnos.inc +-ispl_l.o: ispl_l.c ../../config.h ../../src/include/stdint.h isp.h \ ++ispl_l.o: ispl_l.c ../../config.h isp.h \ + ../../src/include/atm.h ispl_y.h + ispl_y.o: ispl_y.c ../../config.h ../../src/include/atm.h \ +- ../../src/include/stdint.h isp.h +-ttcp.o: ttcp.c ../../config.h ../../src/include/stdint.h \ ++ isp.h ++ttcp.o: ttcp.c ../../config.h \ + ../../src/include/atm.h ../../src/include/atmsap.h +-window.o: window.c ../../config.h ../../src/include/atm.h \ +- ../../src/include/stdint.h ++window.o: window.c ../../config.h ../../src/include/atm.h + + info-am: + info: info-am Added: trunk/package/linux-atm/linux-atm-2.4.1-gcc4.patch =================================================================== --- trunk/package/linux-atm/linux-atm-2.4.1-gcc4.patch (rev 0) +++ trunk/package/linux-atm/linux-atm-2.4.1-gcc4.patch 2007-08-23 21:06:57 UTC (rev 1204) @@ -0,0 +1,108 @@ +--- linux-atm-2.4.1/src/qgen/qlib.c.gcc4 2001-09-03 14:41:05.000000000 -0400 ++++ linux-atm-2.4.1/src/qgen/qlib.c 2005-08-22 09:04:36.000000000 -0400 +@@ -26,8 +26,6 @@ int q_dump = 0; + #include "op.h" + + +-static int debug = 0; +- + + void PREFIX(report)(int severity,const char *msg,...) + { +@@ -830,6 +828,8 @@ int PREFIX(close)(Q_DSC *dsc) + + #ifdef STANDALONE + ++int debug = 0; ++ + int main(int argc,const char **argv) + { + unsigned char msg[5000]; /* should be large enough for that */ +--- linux-atm-2.4.1/src/qgen/qlib.h.gcc4 2001-09-03 14:41:05.000000000 -0400 ++++ linux-atm-2.4.1/src/qgen/qlib.h 2005-08-22 09:05:07.000000000 -0400 +@@ -22,8 +22,9 @@ + #define Q_ERROR 0 + #define Q_FATAL -1 + +- ++#ifndef DUMP_MODE + extern int q_dump; ++#endif + extern void q_report(int severity,const char *msg,...); + + #ifdef DUMP_MODE +--- linux-atm-2.4.1/src/maint/atmtcp.c.gcc4 2001-09-03 14:41:06.000000000 -0400 ++++ linux-atm-2.4.1/src/maint/atmtcp.c 2005-08-22 09:04:36.000000000 -0400 +@@ -60,7 +60,7 @@ static OUT *outputs = NULL; + static IN *inputs = NULL; + static fd_set in_set; + static int fds = 0; +-static int debug = 0; ++int debug = 0; + static int links = 0; + + +--- linux-atm-2.4.1/src/ilmid/atmf_uni.c.gcc4 2001-09-03 14:41:06.000000000 -0400 ++++ linux-atm-2.4.1/src/ilmid/atmf_uni.c 2005-08-22 09:04:36.000000000 -0400 +@@ -187,7 +187,7 @@ AsnInt setNetPrefix(VarBind *varbind, Va + newPrefix->name = alloc_t(AsnOid); + newPrefix->name->octs = alloc(varBindName->octetLen); + AsnOidCopy(newPrefix->name, varBindName); +- Q_INSERT_BEFORE((NetPrefixNode *) var->value, newPrefix, prefix); ++ Q_INSERT_BEFORE((*((NetPrefixNode **)&var->value)), newPrefix, prefix); + if(atmNetPrefix.octs == NULL) + { + atmNetPrefix.octetLen = varBindName->octetLen - NETPREFIX_LEN - 2; +@@ -197,7 +197,7 @@ AsnInt setNetPrefix(VarBind *varbind, Va + } + else if (varbind->value->a.simple->a.number == INVALID && cmp == AsnOidEqual) + { +- Q_REMOVE((NetPrefixNode *) var->value, prefix); ++ Q_REMOVE((*((NetPrefixNode **) &var->value)), prefix); + } + + return NOERROR; +--- linux-atm-2.4.1/src/mpoad/p_factory.c.gcc4 2001-09-03 14:41:06.000000000 -0400 ++++ linux-atm-2.4.1/src/mpoad/p_factory.c 2005-08-22 09:04:36.000000000 -0400 +@@ -31,16 +31,17 @@ unsigned short compute_ip_csum(unsigned + * beginning at location "addr". + */ + uint32_t sum = 0; ++ uint16_t *addr16 = addr; + + while( count > 1 ) { + /* This is the inner loop */ +- sum += * ((uint16_t *) addr)++; ++ sum += * addr16++; + count -= 2; + } + + /* Add left-over byte, if any */ + if( count > 0 ) +- sum += * (unsigned char *) addr; ++ sum += * (unsigned char *) addr16; + + /* Fold 32-bit sum to 16 bits */ + while (sum>>16) +--- linux-atm-2.4.1/src/switch/debug/debug.c.gcc4 2001-09-03 14:41:06.000000000 -0400 ++++ linux-atm-2.4.1/src/switch/debug/debug.c 2005-08-22 09:04:36.000000000 -0400 +@@ -18,7 +18,7 @@ + #define COMPONENT "FAB(debug)" + + +-#define PRV(call) ((FAB *) (call)->fab) ++#define PRV(call) (*((FAB **) &(call)->fab)) + + + typedef struct _fab { +--- linux-atm-2.4.1/src/switch/tcp/tcpsw.c.gcc4 2001-09-03 14:41:06.000000000 -0400 ++++ linux-atm-2.4.1/src/switch/tcp/tcpsw.c 2005-08-22 09:04:36.000000000 -0400 +@@ -27,7 +27,7 @@ + + #define COMPONENT "FAB(tcp)" + +-#define PRV(call) ((FAB *) (call)->fab) ++#define PRV(call) (*((FAB **) &(call)->fab)) + + #define MAX_VCI 1024 + Added: trunk/package/linux-atm/linux-atm-2.4.1-mkerrnos_pl.patch =================================================================== --- trunk/package/linux-atm/linux-atm-2.4.1-mkerrnos_pl.patch (rev 0) +++ trunk/package/linux-atm/linux-atm-2.4.1-mkerrnos_pl.patch 2007-08-23 21:06:57 UTC (rev 1204) @@ -0,0 +1,43 @@ +Fri Jun 9 2006, Stuart Hughes, <st...@fr...> + +We need to user asm/errno.h from the cross compiler, not the absolute path. +This gets rid of errors like: + +gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../../src/include -g -O2 -Wall -Wshadow -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -c isp.c +In file included from isp.c:61: +errnos.inc:126: error: `ENOKEY' undeclared here (not in a function) + + +diff --exclude CVS -uNr linux-atm-2.4.1/src/test/mkerrnos.pl linux-atm-2.4.1.modified/src/test/mkerrnos.pl +--- linux-atm-2.4.1/src/test/mkerrnos.pl 2001-09-03 19:41:06.000000000 +0100 ++++ linux-atm-2.4.1.modified/src/test/mkerrnos.pl 2006-06-09 18:24:20.000000000 +0100 +@@ -1,5 +1,28 @@ + #!/usr/bin/perl +-while (<>) { ++ ++# Fri Jun 9 2006, Stuart Hughes, <st...@fr...> ++# we may be using a cross compiler, so we need to use errno.h from that ++open(GCC, "gcc -v -E - 2>&1 </dev/null |") or die "can't run gcc -v -E -"; ++$slurp = 0; ++$inc = ""; ++while(<GCC>) { ++ s,\s+,,g; ++ m,^#include<\.\.\.>searchstartshere:, && do { $slurp=1; next }; ++ m,^Endofsearchlist, && do { $slurp=0; last }; ++ push @dirs, $_ if $slurp; ++} ++close GCC; ++ ++foreach $dir (@dirs) { ++ if($en = `find $dir -name errno.h | xargs grep -l ECONNREFUSED`) { ++ warn "using $en"; ++ chomp $en; ++ last; ++ } ++} ++ ++open(ERRNO, $en) or die "open $en: $!\n"; ++while (<ERRNO>) { + next unless /^#define\s+(E\S+)\s*/; + printf(" { \"%s\", %s },\n",$1,$1) || die "print: $!"; + } Added: trunk/package/linux-atm/linux-atm-2.4.1-types-h.patch =================================================================== --- trunk/package/linux-atm/linux-atm-2.4.1-types-h.patch (rev 0) +++ trunk/package/linux-atm/linux-atm-2.4.1-types-h.patch 2007-08-23 21:06:57 UTC (rev 1204) @@ -0,0 +1,112 @@ +Steve Papacharalambous <st...@fr...> 12jun07: + +This patch fixes the build errors caused by the change in the linux kernel +headers to move the definitions of the __bexx types to linux/types.h in +the later 2.6 kernel headers. +Typical error caused by this change that this patch fixes: +[snip] +gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../../src/include -g -O2 -Wall -Wshadow -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -c atmarpd.c +gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../../src/include -g -O2 -Wall -Wshadow -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -c arp.c +In file included from arp.c:19: +/opt/freescale/usr/local/gcc-4.1.59-eglibc-2.5.59/powerpc-linux-gnu/powerpc-linux-gnu/libc/usr/include/linux/if_arp.h:133: +error: expected specifier-qualifier-list before '__be16' +make[3]: *** [arp.o] Error 1 +make[3]: Leaving directory +`/home/stevep/work/ltib/rpm/BUILD/linux-atm-2.4.1/src/arpd' +make[2]: *** [all-recursive] Error 1 +make[2]: Leaving directory +`/home/stevep/work/ltib/rpm/BUILD/linux-atm-2.4.1/src +[/snip] + +Patch originated by Steve Papacharalambous. + + + +diff --exclude CVS -uNr linux-atm-2.4.1/src/arpd/arp.c linux-atm-2.4.1.modified/src/arpd/arp.c +--- linux-atm-2.4.1/src/arpd/arp.c Mon Sep 3 19:41:05 2001 ++++ linux-atm-2.4.1.modified/src/arpd/arp.c Tue Jun 12 11:22:43 2007 +@@ -16,6 +16,7 @@ + #include <sys/socket.h> /* for linux/if_arp.h */ + #include <netinet/in.h> /* for ntohs, etc. */ + #define _LINUX_NETDEVICE_H /* very crude hack for glibc2 */ ++#include <linux/types.h> + #include <linux/if_arp.h> + #include <linux/if_ether.h> + #include <atm.h> +diff --exclude CVS -uNr linux-atm-2.4.1/src/arpd/itf.c linux-atm-2.4.1.modified/src/arpd/itf.c +--- linux-atm-2.4.1/src/arpd/itf.c Mon Sep 3 19:41:05 2001 ++++ linux-atm-2.4.1.modified/src/arpd/itf.c Tue Jun 12 11:23:46 2007 +@@ -13,6 +13,7 @@ + #include <linux/atmclip.h> + #include <sys/socket.h> + #define _LINUX_NETDEVICE_H /* glibc2 */ ++#include <linux/types.h> + #include <linux/if_arp.h> + + #include "atmd.h" +diff --exclude CVS -uNr linux-atm-2.4.1/src/mpoad/io.c linux-atm-2.4.1.modified/src/mpoad/io.c +--- linux-atm-2.4.1/src/mpoad/io.c Mon Sep 3 19:41:06 2001 ++++ linux-atm-2.4.1.modified/src/mpoad/io.c Tue Jun 12 11:25:30 2007 +@@ -19,6 +19,7 @@ + _syscall3(int,poll,struct pollfd *,ufds,unsigned int,nfds,int,timeout); + #endif + #include <atm.h> ++#include <linux/types.h> + #include <linux/atmioc.h> + #include <linux/atmmpc.h> + #include <sys/types.h> +diff --exclude CVS -uNr linux-atm-2.4.1/src/mpoad/k_interf.c linux-atm-2.4.1.modified/src/mpoad/k_interf.c +--- linux-atm-2.4.1/src/mpoad/k_interf.c Mon Sep 3 19:41:06 2001 ++++ linux-atm-2.4.1.modified/src/mpoad/k_interf.c Tue Jun 12 11:26:34 2007 +@@ -9,6 +9,7 @@ + #include <sys/param.h> /* for OPEN_MAX */ + #include <stdint.h> + #include <netinet/in.h> /* for ntohl() */ ++#include <linux/types.h> + #include <linux/atmmpc.h> + #include <atm.h> + #include "k_interf.h" +diff --exclude CVS -uNr linux-atm-2.4.1/src/mpoad/lecs.c linux-atm-2.4.1.modified/src/mpoad/lecs.c +--- linux-atm-2.4.1/src/mpoad/lecs.c Mon Sep 3 19:41:06 2001 ++++ linux-atm-2.4.1.modified/src/mpoad/lecs.c Tue Jun 12 11:31:00 2007 +@@ -11,6 +11,7 @@ + #include <errno.h> + #include <atm.h> + #include <atmsap.h> ++#include <linux/types.h> /* for MPOA Device type TLV */ + #include <linux/atmmpc.h> /* for MPOA Device type TLV */ + #include "lecs.h" + #include "k_interf.h" +diff --exclude CVS -uNr linux-atm-2.4.1/src/mpoad/main.c linux-atm-2.4.1.modified/src/mpoad/main.c +--- linux-atm-2.4.1/src/mpoad/main.c Mon Sep 3 19:41:06 2001 ++++ linux-atm-2.4.1.modified/src/mpoad/main.c Tue Jun 12 11:28:35 2007 +@@ -9,6 +9,7 @@ + #include <time.h> + #include <sys/ioctl.h> + #include <atm.h> ++#include <linux/types.h> + #include <linux/atmdev.h> + #include <linux/atmmpc.h> + #include <sys/socket.h> +diff --exclude CVS -uNr linux-atm-2.4.1/src/mpoad/p_factory.c linux-atm-2.4.1.modified/src/mpoad/p_factory.c +--- linux-atm-2.4.1/src/mpoad/p_factory.c Tue Jun 12 11:32:01 2007 ++++ linux-atm-2.4.1.modified/src/mpoad/p_factory.c Tue Jun 12 11:29:36 2007 +@@ -5,6 +5,7 @@ + #include <sys/types.h> + #include <stdint.h> + #include <netinet/in.h> ++#include <linux/types.h> + #include <linux/atmmpc.h> + #include <sys/socket.h> + #include <unistd.h> +diff --exclude CVS -uNr linux-atm-2.4.1/src/mpoad/p_recogn.c linux-atm-2.4.1.modified/src/mpoad/p_recogn.c +--- linux-atm-2.4.1/src/mpoad/p_recogn.c Mon Sep 3 19:41:06 2001 ++++ linux-atm-2.4.1.modified/src/mpoad/p_recogn.c Tue Jun 12 11:30:14 2007 +@@ -7,6 +7,7 @@ + #include <stdlib.h> + #include <sys/time.h> + #include <atm.h> ++#include <linux/types.h> + #include <linux/atmmpc.h> + #include <netinet/in.h> + #include <limits.h> /* For UINT_MAX */ Added: trunk/package/linux-atm/linux-atm-2.4.1-uclibc-1.patch =================================================================== --- trunk/package/linux-atm/linux-atm-2.4.1-uclibc-1.patch (rev 0) +++ trunk/package/linux-atm/linux-atm-2.4.1-uclibc-1.patch 2007-08-23 21:06:57 UTC (rev 1204) @@ -0,0 +1,60 @@ +Thu Aug 17 2006 Stuart Hughes <st...@fr...> + +This patch fixes uClibc builds. The symptom was: + +make[3]: Entering directory `/home/yashpald/ltib-mpc832xemds-20060615/rpm/BUILD/linux-atm-2.4.1/src/test' +/usr/bin/perl ./mkerrnos.pl </usr/include/asm/errno.h \ + >errnos.inc || { rm -f errnos.inc; exit 1; } +open : No such file or directory +make[3]: *** [errnos.inc] Error 1 +make[3]: Leaving directory `/home/yashpald/ltib-mpc832xemds-20060615/rpm/BUILD/linux-atm-2.4.1/src/test' + +diff --exclude CVS -uNr linux-atm-2.4.1/src/test/isp.c linux-atm-2.4.1.modified/src/test/isp.c +--- linux-atm-2.4.1/src/test/isp.c 2001-09-03 19:41:06.000000000 +0100 ++++ linux-atm-2.4.1.modified/src/test/isp.c 2006-08-17 11:19:48.000000000 +0100 +@@ -20,6 +20,22 @@ + + #include "isp.h" + ++/* ++ * seh: uclibc does not have these, I thought cleaner than directly ++ * including the kernel headers (copied from asm-generic/errno.h) ++ */ ++#ifdef __UCLIBC__ ++#ifndef ENOKEY ++#define ENOKEY 126 /* Required key not available */ ++#define EKEYEXPIRED 127 /* Key has expired */ ++#define EKEYREVOKED 128 /* Key has been revoked */ ++#define EKEYREJECTED 129 /* Key was rejected by service */ ++ ++/* for robust mutexes */ ++#define EOWNERDEAD 130 /* Owner died */ ++#define ENOTRECOVERABLE 131 /* State not recoverable */ ++#endif ++#endif + + extern int yyparse(void); + +diff --exclude CVS -uNr linux-atm-2.4.1/src/test/mkerrnos.pl linux-atm-2.4.1.modified/src/test/mkerrnos.pl +--- linux-atm-2.4.1/src/test/mkerrnos.pl 2006-08-17 11:21:48.000000000 +0100 ++++ linux-atm-2.4.1.modified/src/test/mkerrnos.pl 2006-08-17 11:20:34.000000000 +0100 +@@ -14,15 +14,18 @@ + close GCC; + + foreach $dir (@dirs) { +- if($en = `find $dir -name errno.h | xargs grep -l ECONNREFUSED`) { ++ warn "checking dir $dir\n"; ++ if($en = `find $dir -name errno.h -follow | xargs grep -l ECONNREFUSED`) { + warn "using $en"; + chomp $en; + last; + } + } ++die "Cannot find an errno.h in any paths containing ECONNREFUSED\n" unless $en; + + open(ERRNO, $en) or die "open $en: $!\n"; + while (<ERRNO>) { + next unless /^#define\s+(E\S+)\s*/; ++ next if m,(?:ERESTARTSYS|ERESTARTNOINTR|ERESTARTNOHAND|ENOIOCTLCMD|_LAST_ERRNO),; + printf(" { \"%s\", %s },\n",$1,$1) || die "print: $!"; + } Added: trunk/package/linux-atm/linux-atm.mk =================================================================== --- trunk/package/linux-atm/linux-atm.mk (rev 0) +++ trunk/package/linux-atm/linux-atm.mk 2007-08-23 21:06:57 UTC (rev 1204) @@ -0,0 +1,90 @@ +############################################################# +# +# linux-atm +# +############################################################# + +LINUX-ATM_VERSION=2.4.1 +LINUX-ATM_SOURCE=linux-atm-$(LINUX-ATM_VERSION).tar.gz +LINUX-ATM_SITE=http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/linux-atm/ +LINUX-ATM_DIR=$(BUILD_DIR)/linux-atm-$(LINUX-ATM_VERSION) +LINUX-ATM_CAT:=zcat + +$(DL_DIR)/$(LINUX-ATM_SOURCE): + $(WGET) -P $(DL_DIR) $(LINUX-ATM_SITE)/$(LINUX-ATM_SOURCE) + +$(LINUX-ATM_DIR)/.unpacked: $(DL_DIR)/$(LINUX-ATM_SOURCE) + $(LINUX-ATM_CAT) $(DL_DIR)/$(LINUX-ATM_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) - + toolchain/patch-kernel.sh $(LINUX-ATM_DIR) package/linux-atm/ linux-atm\*.patch + touch $(LINUX-ATM_DIR)/.unpacked + +$(LINUX-ATM_DIR)/.configured: $(LINUX-ATM_DIR)/.unpacked + (cd $(LINUX-ATM_DIR); rm -rf config.cache; \ + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS)" \ + LDFLAGS="$(TARGET_LDFLAGS)" \ + ./configure \ + --target=$(GNU_TARGET_NAME) \ + --host=$(GNU_TARGET_NAME) \ + --build=$(GNU_HOST_NAME) \ + --prefix=/usr \ + --sysconfdir=/etc \ + ); + touch $(LINUX-ATM_DIR)/.configured + +$(LINUX-ATM_DIR)/src/sigd/atmsigd: $(LINUX-ATM_DIR)/.configured + $(MAKE1) $(TARGET_CONFIGURE_OPTS) HOSTCC=gcc -C $(LINUX-ATM_DIR) + +$(TARGET_DIR)/usr/sbin/atmsigd: $(LINUX-ATM_DIR)/src/sigd/atmsigd + $(MAKE1) PREFIX=$(TARGET_DIR)/usr \ + prefix=$(TARGET_DIR)/usr \ + sysconfdir=$(STAGING_DIR)/etc \ + exec_prefix=$(TARGET_DIR)/usr \ + persistentdir=$(TARGET_DIR)/var/lib \ + infodir=$(STAGING_DIR)/usr/info \ + mandir=$(STAGING_DIR)/usr/man \ + includedir=$(STAGING_DIR)/include \ + -C $(LINUX-ATM_DIR) install; + $(STRIP) $(TARGET_DIR)/usr/sbin/atmsigd + cp $(TARGET_DIR)/usr/lib/*atm* $(STAGING_DIR)/usr/lib/ + rm -rf $(TARGET_DIR)/usr/lib/libatm.a $(TARGET_DIR)/usr/lib/libatm.la + +$(DL_DIR)/atm2684.tar.gz: + $(WGET) -P $(DL_DIR) http://download.gna.org/ueagleatm/atm2684.tar.gz + +$(BUILD_DIR)/atm2684/.unpacked: $(DL_DIR)/atm2684.tar.gz + zcat $(DL_DIR)/atm2684.tar.gz | tar -C $(BUILD_DIR) $(TAR_OPTIONS) - + touch $(BUILD_DIR)/atm2684/.unpacked + +$(BUILD_DIR)/atm2684/atm2684/br2684ctl/br2684ctl: $(BUILD_DIR)/atm2684/.unpacked + # Too simple to run their Makefile... + $(TARGET_CC) -o $(BUILD_DIR)/atm2684/atm2684/br2684ctl/br2684ctl \ + -Os $(BUILD_DIR)/atm2684/atm2684/br2684ctl/br2684ctl.c \ + -latm -L$(STAGING_DIR)/usr/lib -I$(LINUX_DIR)/include + +$(TARGET_DIR)/usr/sbin/br2684ctl: $(BUILD_DIR)/atm2684/atm2684/br2684ctl/br2684ctl + $(INSTALL) -D -m 0755 $(BUILD_DIR)/atm2684/atm2684/br2684ctl/br2684ctl $(TARGET_DIR)/usr/sbin/br2684ctl + +linux-atm: uclibc $(TARGET_DIR)/usr/sbin/atmsigd br2684ctl + +br2684ctl: $(TARGET_DIR)/usr/sbin/br2684ctl + +linux-atm-source: $(DL_DIR)/$(LINUX-ATM_SOURCE) + +linux-atm-clean: + $(MAKE) -C $(LINUX-ATM_DIR) clean + -rm $(BUILD_DIR)/atm2684/atm2684/br2684ctl/br2684ctl + -rm $(TARGET_DIR)/usr/sbin/br2684ctl + -rm $(TARGET_DIR)/usr/sbin/atmsigd + +linux-atm-dirclean: + rm -rf $(LINUX-ATM_DIR) + rm -rf $(BUILD_DIR)/atm2684 +############################################################# +# +# Toplevel Makefile options +# +############################################################# +ifeq ($(strip $(BR2_PACKAGE_LINUX-ATM)),y) +TARGETS+=linux-atm +endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kr...@us...> - 2007-09-13 16:33:37
|
Revision: 1246 http://astlinux.svn.sourceforge.net/astlinux/?rev=1246&view=rev Author: krisk84 Date: 2007-09-13 09:33:17 -0700 (Thu, 13 Sep 2007) Log Message: ----------- Add sipp package with HACK to partially disable IPv6 DO NOT use this on a network with IPv6, it will probably crash! Modified Paths: -------------- trunk/package/Config.in Added Paths: ----------- trunk/package/sipp/ trunk/package/sipp/Config.in trunk/package/sipp/sipp-noipv6.patch trunk/package/sipp/sipp.mk Modified: trunk/package/Config.in =================================================================== --- trunk/package/Config.in 2007-09-13 16:15:56 UTC (rev 1245) +++ trunk/package/Config.in 2007-09-13 16:33:17 UTC (rev 1246) @@ -159,6 +159,7 @@ source "package/screen/Config.in" source "package/sdl/Config.in" source "package/sfdisk/Config.in" +source "package/sipp/Config.in" source "package/slang/Config.in" source "package/smartmontools/Config.in" source "package/socat/Config.in" Added: trunk/package/sipp/Config.in =================================================================== --- trunk/package/sipp/Config.in (rev 0) +++ trunk/package/sipp/Config.in 2007-09-13 16:33:17 UTC (rev 1246) @@ -0,0 +1,13 @@ +config BR2_PACKAGE_SIPP + bool "sipp" + select BR2_PACKAGE_NCURSES + select BR2_PACKAGE_OPENSSL + select BR2_PACKAGE_LIBPCAP + default n + help + + sipp is a SIP stress tester and call generator + This version includes support for PCAPPLAY and TLS + + http://sipp.sourceforge.net + Added: trunk/package/sipp/sipp-noipv6.patch =================================================================== --- trunk/package/sipp/sipp-noipv6.patch (rev 0) +++ trunk/package/sipp/sipp-noipv6.patch 2007-09-13 16:33:17 UTC (rev 1246) @@ -0,0 +1,74 @@ +diff -ur sipp-2.0.1.src.orig/sipp.cpp sipp-2.0.1.src/sipp.cpp +--- sipp-2.0.1.src.orig/sipp.cpp 2007-05-16 05:03:38.000000000 -0400 ++++ sipp-2.0.1.src/sipp.cpp 2007-09-13 12:06:01.000000000 -0400 +@@ -3407,7 +3407,7 @@ + } else { + + // create a new socket +- if((L_socket= socket(P_use_ipv6 ? AF_INET6 : AF_INET, ++ if((L_socket= socket(AF_INET, + P_type_socket, + 0))== -1) { + ERROR_P1("Unable to get a %s socket", TRANSPORT_TO_STRING(transport)); +@@ -4021,14 +4021,14 @@ + _RCAST(struct sockaddr_storage *,local_addr->ai_addr))); + freeaddrinfo(local_addr); + +- if((media_socket = socket(media_ip_is_ipv6 ? AF_INET6 : AF_INET, ++ if((media_socket = socket(AF_INET, + SOCK_DGRAM, 0)) == -1) { + char msg[512]; + sprintf(msg, "Unable to get the audio RTP socket (IP=%s, port=%d)", media_ip, media_port); + ERROR_NO(msg); + } + /* create a second socket for video */ +- if((media_socket_video = socket(media_ip_is_ipv6 ? AF_INET6 : AF_INET, ++ if((media_socket_video = socket(AF_INET, + SOCK_DGRAM, 0)) == -1) { + char msg[512]; + sprintf(msg, "Unable to get the video RTP socket (IP=%s, port=%d)", media_ip, media_port+2); +@@ -4321,7 +4321,7 @@ + } + + /* Creating and binding the local socket */ +- if((main_socket = socket(local_ip_is_ipv6 ? AF_INET6 : AF_INET, ++ if((main_socket = socket(AF_INET, + (transport == T_UDP) ? SOCK_DGRAM : SOCK_STREAM, + 0)) == -1) { + ERROR_NO("Unable to get the local socket"); +@@ -4492,7 +4492,7 @@ + j = map_perip_fd.find(peripaddr); + + if (j == map_perip_fd.end()) { +- if((sock = socket(is_ipv6 ? AF_INET6 : AF_INET, ++ if((sock = socket(AF_INET, + (transport == T_UDP) ? SOCK_DGRAM : SOCK_STREAM, + 0)) == -1) { + ERROR_NO("Unable to get server socket"); +@@ -4541,7 +4541,7 @@ + #endif + (toolMode != MODE_SERVER)) { + +- if((tcp_multiplex = socket(local_ip_is_ipv6 ? AF_INET6 : AF_INET, ++ if((tcp_multiplex = socket(AF_INET, + SOCK_STREAM, + 0))== -1) { + ERROR_NO("Unable to get a TCP socket"); +@@ -4678,7 +4678,7 @@ + is_ipv6 = true; + } + strcpy(peer_ip, get_inet_address(peer_sockaddr)); +- if((*peer_socket = socket(is_ipv6 ? AF_INET6 : AF_INET, ++ if((*peer_socket = socket(AF_INET, + SOCK_STREAM, 0))== -1) { + ERROR_NO("Unable to get a twin sipp TCP socket"); + } +@@ -4783,7 +4783,7 @@ + } + strcpy(twinSippIp, get_inet_address(&twinSipp_sockaddr)); + +- if((localTwinSippSocket = socket(is_ipv6 ? AF_INET6 : AF_INET, ++ if((localTwinSippSocket = socket(AF_INET, + SOCK_STREAM, 0))== -1) { + ERROR_NO("Unable to get a listener TCP socket "); + } Added: trunk/package/sipp/sipp.mk =================================================================== --- trunk/package/sipp/sipp.mk (rev 0) +++ trunk/package/sipp/sipp.mk 2007-09-13 16:33:17 UTC (rev 1246) @@ -0,0 +1,53 @@ +############################################################# +# +# sipp +# +############################################################# + +SIPP_VERSION=2.0.1 +SIPP_SOURCE=sipp-$(SIPP_VERSION).src.tar.gz +SIPP_SITE=http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/sipp/ +SIPP_DIR=$(BUILD_DIR)/sipp-$(SIPP_VERSION).src +SIPP_CAT:=zcat + +$(DL_DIR)/$(SIPP_SOURCE): + $(WGET) -P $(DL_DIR) $(SIPP_SITE)/$(SIPP_SOURCE) + +$(SIPP_DIR)/.unpacked: $(DL_DIR)/$(SIPP_SOURCE) + $(SIPP_CAT) $(DL_DIR)/$(SIPP_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) - + toolchain/patch-kernel.sh $(SIPP_DIR) package/sipp/ sipp\*.patch + touch $(SIPP_DIR)/.unpacked + +$(SIPP_DIR)/sipp: $(SIPP_DIR)/.unpacked + $(MAKE1) OSNAME=Linux CC_linux=$(TARGET_CC) \ + CPP_linux=$(TARGET_CC) CCLINK_linux=$(TARGET_CC) \ + LIBS_linux="-ldl -lpthread -lncurses -lstdc++ -lm -L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \ + INCDIR_linux="-I." \ + OBJ_TLS="auth.o sslinit.o sslthreadsafe.o milenage.o rijndael.o" \ + TLS_LIBS="-lssl -lcrypto" TLS="-D_USE_OPENSSL -DOPENSSL_NO_KRB5" \ + OBJ_PCAPPLAY="send_packets.o prepare_pcap.o" \ + PCAPPLAY_LIBS="-lpcap -L$(STAGING_DIR)/lib" \ + PCAPPLAY="-DPCAPPLAY -I$(STAGING_DIR)/include" sipp -C $(SIPP_DIR) + +$(TARGET_DIR)/usr/sbin/sipp: $(SIPP_DIR)/sipp + $(INSTALL) -D -m 0755 $(SIPP_DIR)/sipp $(TARGET_DIR)/usr/sbin/sipp + $(STRIP) $(TARGET_DIR)/usr/sbin/sipp + +sipp: uclibc libpcap ncurses openssl $(TARGET_DIR)/usr/sbin/sipp + +sipp-source: $(DL_DIR)/$(SIPP_SOURCE) + +sipp-clean: + $(MAKE) -C $(SIPP_DIR) clean + -rm $(TARGET_DIR)/usr/sbin/sipp + +sipp-dirclean: + rm -rf $(SIPP_DIR) +############################################################# +# +# Toplevel Makefile options +# +############################################################# +ifeq ($(strip $(BR2_PACKAGE_SIPP)),y) +TARGETS+=sipp +endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kr...@us...> - 2007-09-13 20:42:12
|
Revision: 1247 http://astlinux.svn.sourceforge.net/astlinux/?rev=1247&view=rev Author: krisk84 Date: 2007-09-13 13:42:13 -0700 (Thu, 13 Sep 2007) Log Message: ----------- fix bash and zaptel clean targets Modified Paths: -------------- trunk/package/bash/bash.mk trunk/package/zaptel/zaptel.mk Modified: trunk/package/bash/bash.mk =================================================================== --- trunk/package/bash/bash.mk 2007-09-13 16:33:17 UTC (rev 1246) +++ trunk/package/bash/bash.mk 2007-09-13 20:42:13 UTC (rev 1247) @@ -73,7 +73,7 @@ endif bash-clean: - $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(BASH_DIR) uninstall + -$(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(BASH_DIR) uninstall -$(MAKE) -C $(BASH_DIR) clean bash-dirclean: Modified: trunk/package/zaptel/zaptel.mk =================================================================== --- trunk/package/zaptel/zaptel.mk 2007-09-13 16:33:17 UTC (rev 1246) +++ trunk/package/zaptel/zaptel.mk 2007-09-13 20:42:13 UTC (rev 1247) @@ -98,9 +98,12 @@ rm -Rf $(STAGING_DIR)/usr/include/zaptel.h rm -Rf $(TARGET_DIR)/lib/libtone* rm -Rf $(STAGING_DIR)/lib/modules/$(LINUX_VER)/misc - $(DEPMOD) -ae -F $(BUILD_DIR)/linux/System.map -b $(BUILD_DIR)/root -r $(LINUX_VER) - rm $(BUILD_DIR)/zaptel - -$(MAKE) -C $(ZAPTEL_DIR) PWD=$(ZAPTEL_DIR) clean + (DEPMOD) -ae -F $(BUILD_DIR)/linux/System.map -b $(BUILD_DIR)/root -r $(LINUX_VER) + rm -Rf $(BUILD_DIR)/zaptel + -$(MAKE) -C $(ZAPTEL_DIR) CC=$(TARGET_CC) HOTPLUG_FIRMWARE=no ARCH=$(ZAPTEL_TARGET_ARCH) \ + PROC=$(OPTIMIZE_FOR_CPU) KSRC=$(BUILD_DIR)/linux KVERS=$(LINUX_VER) \ + $(TARGET_CONFIGURE_OPTS) PATH="$(ZAPTEL_DIR):$(PATH)" ZTTOOL=zttool INSTALL_BASE=/ \ + PWD=$(ZAPTEL_DIR) clean zaptel-dirclean: rm -rf $(ZAPTEL_DIR) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dha...@us...> - 2007-10-18 18:09:09
|
Revision: 1289 http://astlinux.svn.sourceforge.net/astlinux/?rev=1289&view=rev Author: dhartman Date: 2007-10-18 11:09:06 -0700 (Thu, 18 Oct 2007) Log Message: ----------- updates to openssl and openssh Modified Paths: -------------- trunk/package/openssh/openssh.mk trunk/package/openssl/openssl.mk Modified: trunk/package/openssh/openssh.mk =================================================================== --- trunk/package/openssh/openssh.mk 2007-10-18 17:43:25 UTC (rev 1288) +++ trunk/package/openssh/openssh.mk 2007-10-18 18:09:06 UTC (rev 1289) @@ -5,8 +5,8 @@ ############################################################# OPENSSH_SITE:=ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable -OPENSSH_DIR:=$(BUILD_DIR)/openssh-4.6p1 -OPENSSH_SOURCE:=openssh-4.6p1.tar.gz +OPENSSH_DIR:=$(BUILD_DIR)/openssh-4.7p1 +OPENSSH_SOURCE:=openssh-4.7p1.tar.gz $(DL_DIR)/$(OPENSSH_SOURCE): $(WGET) -P $(DL_DIR) $(OPENSSH_SITE)/$(OPENSSH_SOURCE) Modified: trunk/package/openssl/openssl.mk =================================================================== --- trunk/package/openssl/openssl.mk 2007-10-18 17:43:25 UTC (rev 1288) +++ trunk/package/openssl/openssl.mk 2007-10-18 18:09:06 UTC (rev 1289) @@ -5,7 +5,7 @@ ############################################################# # TARGETS -OPENSSL_VER:=0.9.7l +OPENSSL_VER:=0.9.7m OPENSSL_SITE:=http://www.openssl.org/source OPENSSL_SOURCE:=openssl-$(OPENSSL_VER).tar.gz OPENSSL_DIR:=$(BUILD_DIR)/openssl-$(OPENSSL_VER) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kr...@us...> - 2007-10-18 19:24:14
|
Revision: 1290 http://astlinux.svn.sourceforge.net/astlinux/?rev=1290&view=rev Author: krisk84 Date: 2007-10-18 12:24:09 -0700 (Thu, 18 Oct 2007) Log Message: ----------- Update astshape to use iptables to CLASSIFY packets Update iptables init to not clear the mangle tables if we are using QoS Update astfw to clamp the MSS on outgoing traffic if we are using PPPoE Modified Paths: -------------- trunk/package/iproute2/astshape trunk/package/iptables/astfw trunk/package/iptables/iptables.init Modified: trunk/package/iproute2/astshape =================================================================== --- trunk/package/iproute2/astshape 2007-10-18 18:09:06 UTC (rev 1289) +++ trunk/package/iproute2/astshape 2007-10-18 19:24:09 UTC (rev 1290) @@ -1,15 +1,52 @@ #!/bin/bash # AstShape -# Based off of WonderShaper (HTB) +# Based off of WonderShaper (HTB) http://lartc.org +# HFSC inspired by Maciej Bliziński, http://automatthias.wordpress.com/ +# Updated to use iptables CLASSIFY instead of tc u32, etc # Enhanced by Kristian Kielhofner <kr...@kr...> # Make sure that all of your VoIP devices set tos on RTP to 0x18 # iax.conf: tos=0x18 sip.conf: tos=0x18 +# Set mandatory parameters here +#DOWNLINK=4500 +#UPLINK=600 +#DEV=eth0 + +# Optional tweaking below + +# Interactive ports +# These ports (source OR destination) will be mapped into the +# interactive class. Standard iptables ranges are valid. +#INTPORTS="110" + +# VoIP ports +# These ports (source OR destination) will be mapped into the +# VoIP class. Standard iptables ranges are valid. +# This will only match UDP traffic. Why is your VoIP TCP? +#VOIPPORTS="4569 5060 10000:20000" + +# Specify QDISC type here. Available QDISCs are htb, hfsc +# HFSC is experimental! +QDISC="htb" + +# Traffic to shape. Can be "host" "router" or "all" +# If you define host, only traffic from this machine will be shaped. +# If you define router, only traffic flowing through this machine will +# be shaped. +# If you define all, both will be shaped. +# The default (recommended) is all. +TRAFFIC="all" + +# Override them if you are using AstLinux +if [ -r /etc/astlinux-release ] +then . /etc/rc.conf DOWNLINK=$EXTDOWN UPLINK=$EXTUP +# Auto detect QoS on bridges +# Isn't it nice to use AstLinux? :) if [ "$EXTIF" = "br0" ] then DEV=`echo $BRIDGE0 | cut -d" " -f1` @@ -17,6 +54,28 @@ DEV="$EXTIF" fi +if [ "$SHAPETYPE" ] +then +QDISC="$SHAPETYPE" +else +QDISC="htb" +fi + +if [ "$SHAPETRAFFIC" ] +then +TRAFFIC="$SHAPETRAFFIC" +else +TRAFFIC="all" +fi + +fi + +if [ ! "$DOWNLINK" -a "$UPLINK" -a "$DEV" -a "$QDISC" -a "$TRAFFIC" ] +then +echo "You need to configure AstShape before it can work properly" +exit 1 +fi + if [ "$1" = "status" ] then echo "Showing AstShape status for $DEV" @@ -30,21 +89,58 @@ # clean existing down- and uplink qdiscs, hide errors tc qdisc del dev $DEV root 2> /dev/null > /dev/null tc qdisc del dev $DEV ingress 2> /dev/null > /dev/null +iptables -t mangle -F astshape 2> /dev/null > /dev/null +iptables -t mangle -X astshape 2> /dev/null > /dev/null -if [ "$1" = "stop" ] +# Get POSTROUTING,OUTPUT out of our way +iptables -t mangle -F POSTROUTING 2> /dev/null > /dev/null +iptables -t mangle -F OUTPUT 2> /dev/null > /dev/null + +if [ "$1" = "stop" ] then exit fi -###### uplink +# Determine QDISC for uplink +case "$QDISC" in +hfsc|HFSC) +# add HFSC root qdisc +tc qdisc add dev $DEV root handle 1: hfsc default 5 + +# add main rate limit class +tc class add dev $DEV parent 1: classid 1:1 hfsc sc rate ${UPLINK}kbit ul rate ${UPLINK}kbit + +# Interactive traffic: guarantee realtime full uplink for 50ms, then +# 5/10 of the uplink +tc class add dev $DEV parent 1:1 classid 1:20 hfsc rt m1 ${UPLINK}kbit d 50ms m2 $((5*$UPLINK/10))kbit \ +ls m1 ${UPLINK}kbit d 50ms m2 $((7*$UPLINK/10))kbit ul rate ${UPLINK}kbit + +# VoIP: guarantee full uplink for 200ms, then 3/10 +tc class add dev $DEV parent 1:1 classid 1:10 hfsc sc m1 ${UPLINK}kbit d 200ms m2 $((3*$UPLINK/10))kbit \ +ul rate ${UPLINK}kbit + +# Browsing: Don't guarantee anything for the first second, then guarantee 1/10 +#tc class add dev $DEV parent 1:1 classid 1:40 hfsc sc m1 0 d 1s m2 $((1*$UPLINK/10))kbit \ +#ul rate ${UPLINK}kbit + +# Default traffic: don't guarantee anything for the first two seconds, then guarantee 1/20 +tc class add dev $DEV parent 1:1 classid 1:30 hfsc sc m1 0 d 2s m2 $((1*$UPLINK/20))kbit \ +ul rate ${UPLINK}kbit + +# Default traffic: don't guarantee anything for the first 10 seconds, then guarantee 1/20 +tc class add dev $DEV parent 1:1 classid 1:40 hfsc sc m1 0 d 10s m2 $((1*$UPLINK/20))kbit \ +ul rate ${UPLINK}kbit +;; + +htb|HTB) #install root HTB, point default traffic to 1:30 tc qdisc add dev $DEV root handle 1: htb default 30 #shape everything at $UPLINK speed to prevent queing tc class add dev $DEV parent 1: classid 1:1 htb rate ${UPLINK}kbit burst 6k -#voip class 1:10 - "the crown prince of bandwidth" +#voip class 1:10 tc class add dev $DEV parent 1:1 classid 1:10 htb rate ${UPLINK}kbit burst 6k prio 1 #high prio class 1:20 @@ -61,70 +157,75 @@ tc qdisc add dev $DEV parent 1:20 handle 20: sfq perturb 10 tc qdisc add dev $DEV parent 1:30 handle 30: sfq perturb 10 tc qdisc add dev $DEV parent 1:40 handle 40: sfq perturb 10 +;; -#Voip TOS in 1:10 -tc filter add dev $DEV parent 1:0 protocol ip prio 10 u32 match ip tos 0x18 0xff flowid 1:10 +*) +echo "AstShape: Unsupported QDISC type" +exit 1 +;; -#Ports as defined above -for a in $VOIPPORTS -do - tc filter add dev $DEV parent 1:0 protocol ip prio 11 u32 match ip dport $a 0xffff flowid 1:10 - tc filter add dev $DEV parent 1:0 protocol ip prio 11 u32 match ip sport $a 0xffff flowid 1:10 -done +esac -#TOS Minimum Delay (ssh, NOT scp) in 1:20 -tc filter add dev $DEV parent 1:0 protocol ip prio 20 u32 match ip tos 0x10 0xff flowid 1:20 +# Create possibility to match with iptables +iptables -t mangle -N astshape -#DNS in interactive class 1:20 -tc filter add dev $DEV parent 1:0 protocol ip prio 21 u32 match ip sport 53 0xffff flowid 1:20 -tc filter add dev $DEV parent 1:0 protocol ip prio 22 u32 match ip dport 53 0xffff flowid 1:20 +# Types of traffic to shape +if [ "$TRAFFIC" = "router" -o "$TRAFFIC" = "all" ] +then +iptables -t mangle -A POSTROUTING -o $DEV -j astshape +fi -#only give TCP ACK's higher priority if this connection is asymmetrical -if [ ! $DOWNLINK = $UPLINK ] +if [ "$TRAFFIC" = "host" -o "$TRAFFIC" = "all" ] then -#give TCP ACK's higher priority in 1:20 -tc filter add dev $DEV parent 1: protocol ip prio 23 u32 \ - match ip protocol 6 0xff \ - match u8 0x05 0x0f at 0 \ - match u16 0x0000 0xffc0 at 2 \ - match u8 0x10 0xff at 33 \ - flowid 1:20 +iptables -t mangle -A OUTPUT -o $DEV -j astshape fi -#Ports as defined above -for a in $INTPORTS +# Actually match traffic here +#Our VoIP TOS flags (this is disabled right now) +#iptables -t mangle -A astshape -m udp -p udp -m tos --tos 0x18 -j CLASSIFY --set-class 1:10 + +#VoIP ports +if [ "$VOIPPORTS" ] +then +for i in $VOIPPORTS do - tc filter add dev $DEV parent 1:0 protocol ip prio 24 u32 match ip dport $a 0xffff flowid 1:20 - tc filter add dev $DEV parent 1:0 protocol ip prio 24 u32 match ip sport $a 0xffff flowid 1:20 +iptables -t mangle -A astshape -m udp -p udp --dport $i -j CLASSIFY --set-class 1:10 +iptables -t mangle -A astshape -m udp -p udp --sport $i -j CLASSIFY --set-class 1:10 done +fi -#ICMP (ip protocol 1) in the interactive class 1:20 -tc filter add dev $DEV parent 1: protocol ip prio 25 u32 match ip protocol 1 0xff flowid 1:20 +# Interactive SSH in 2 (does NOT match SCP) +iptables -t mangle -A astshape -m tcp -p tcp --dport 22 -m tos --tos 0x10 -j CLASSIFY --set-class 1:20 +iptables -t mangle -A astshape -m tcp -p tcp --sport 22 -m tos --tos 0x10 -j CLASSIFY --set-class 1:20 -#the slowest of the slow -for a in $NOPRIOPORTDST -do - tc filter add dev $DEV parent 1: protocol ip prio 40 u32 match ip dport $a 0xffff flowid 1:40 -done +# DNS in 2 +iptables -t mangle -A astshape -m udp -p udp --dport 53 -j CLASSIFY --set-class 1:20 +iptables -t mangle -A astshape -m udp -p udp --sport 53 -j CLASSIFY --set-class 1:20 -for a in $NOPRIOPORTSRC +#Interactive ports +if [ "$INTPORTS" ] +then +for i in $INTPORTS do - tc filter add dev $DEV parent 1: protocol ip prio 41 u32 match ip sport $a 0xffff flowid 1:40 +iptables -t mangle -A astshape -m udp -p udp --dport $i -j CLASSIFY --set-class 1:20 +iptables -t mangle -A astshape -m udp -p udp --sport $i -j CLASSIFY --set-class 1:20 +iptables -t mangle -A astshape -m tcp -p tcp --dport $i -j CLASSIFY --set-class 1:20 +iptables -t mangle -A astshape -m tcp -p tcp --sport $i -j CLASSIFY --set-class 1:20 done +fi -for a in $NOPRIOHOSTSRC -do - tc filter add dev $DEV parent 1: protocol ip prio 42 u32 match ip src $a flowid 1:40 -done +# PRIO TCP ACKs +iptables -t mangle -A astshape -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK ACK \ +-m length --length :64 -j CLASSIFY --set-class 1:20 -for a in $NOPRIOHOSTDST -do - tc filter add dev $DEV parent 1: protocol ip prio 43 u32 match ip dst $a flowid 1:40 -done +# put large (512+) icmp packets in default category +#iptables -t mangle -A astshape -p icmp -m length --length 512: -j CLASSIFY --set-class 1:30 -#rest is 'non-interactive' ie 'bulk' and ends up in 1:30 -tc filter add dev $DEV parent 1: protocol ip prio 30 u32 match ip dst 0.0.0.0/0 flowid 1:30 +# Small ICMP (ip protocol 1) in the interactive class +iptables -t mangle -A astshape -p icmp -m length --length :512 -j CLASSIFY --set-class 1:20 +# Downlink is always the same + ########## downlink ############# # slow downloads down to somewhat less than the real speed to prevent # queuing at our ISP. Tune to see how high you can set it. Modified: trunk/package/iptables/astfw =================================================================== --- trunk/package/iptables/astfw 2007-10-18 18:09:06 UTC (rev 1289) +++ trunk/package/iptables/astfw 2007-10-18 19:24:09 UTC (rev 1290) @@ -75,6 +75,12 @@ iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT +#Do MSS clamping if we are configured for PPPoE +if [ "$EXTIF" = "ppp0" ] +then +iptables -A FORWARD -o "$EXTIF" -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu +fi + #DMZ Support if [ "$DMZIF" ] then Modified: trunk/package/iptables/iptables.init =================================================================== --- trunk/package/iptables/iptables.init 2007-10-18 18:09:06 UTC (rev 1289) +++ trunk/package/iptables/iptables.init 2007-10-18 19:24:09 UTC (rev 1290) @@ -64,11 +64,16 @@ /usr/sbin/iptables -t nat -P POSTROUTING ACCEPT /usr/sbin/iptables -t nat -P OUTPUT ACCEPT elif [ "$a" = "mangle" ]; then +if [ "$EXTUP" -a "$EXTDOWN" ] +then +echo "Refusing to clear mangle because QoS is enabled" +else /usr/sbin/iptables -t mangle -P PREROUTING ACCEPT /usr/sbin/iptables -t mangle -P INPUT ACCEPT /usr/sbin/iptables -t mangle -P FORWARD ACCEPT /usr/sbin/iptables -t mangle -P OUTPUT ACCEPT /usr/sbin/iptables -t mangle -P POSTROUTING ACCEPT +fi elif [ "$a" = "filter" ]; then /usr/sbin/iptables -t filter -P INPUT ACCEPT /usr/sbin/iptables -t filter -P FORWARD ACCEPT This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kr...@us...> - 2007-10-18 19:29:54
|
Revision: 1291 http://astlinux.svn.sourceforge.net/astlinux/?rev=1291&view=rev Author: krisk84 Date: 2007-10-18 12:29:58 -0700 (Thu, 18 Oct 2007) Log Message: ----------- maybe its better to have mss clamping in mangle... Modified Paths: -------------- trunk/package/iproute2/astshape trunk/package/iptables/astfw Modified: trunk/package/iproute2/astshape =================================================================== --- trunk/package/iproute2/astshape 2007-10-18 19:24:09 UTC (rev 1290) +++ trunk/package/iproute2/astshape 2007-10-18 19:29:58 UTC (rev 1291) @@ -93,8 +93,8 @@ iptables -t mangle -X astshape 2> /dev/null > /dev/null # Get POSTROUTING,OUTPUT out of our way -iptables -t mangle -F POSTROUTING 2> /dev/null > /dev/null -iptables -t mangle -F OUTPUT 2> /dev/null > /dev/null +#iptables -t mangle -F POSTROUTING 2> /dev/null > /dev/null +#iptables -t mangle -F OUTPUT 2> /dev/null > /dev/null if [ "$1" = "stop" ] then Modified: trunk/package/iptables/astfw =================================================================== --- trunk/package/iptables/astfw 2007-10-18 19:24:09 UTC (rev 1290) +++ trunk/package/iptables/astfw 2007-10-18 19:29:58 UTC (rev 1291) @@ -78,7 +78,9 @@ #Do MSS clamping if we are configured for PPPoE if [ "$EXTIF" = "ppp0" ] then -iptables -A FORWARD -o "$EXTIF" -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu +# Not sure which one... +# iptables -A FORWARD -o "$EXTIF" -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu +iptables -t mangle -A POSTROUTING -p tcp --tcp-flags SYN,RST SYN -o "$EXTIF" -j TCPMSS --clamp-mss-to-pmtu fi #DMZ Support This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kr...@us...> - 2007-10-30 16:50:16
|
Revision: 1339 http://astlinux.svn.sourceforge.net/astlinux/?rev=1339&view=rev Author: krisk84 Date: 2007-10-30 09:50:17 -0700 (Tue, 30 Oct 2007) Log Message: ----------- completely broken ebtables support Added Paths: ----------- trunk/package/ebtables/ trunk/package/ebtables/Config.in trunk/package/ebtables/ebtables.mk Added: trunk/package/ebtables/Config.in =================================================================== --- trunk/package/ebtables/Config.in (rev 0) +++ trunk/package/ebtables/Config.in 2007-10-30 16:50:17 UTC (rev 1339) @@ -0,0 +1,7 @@ +config BR2_PACKAGE_EPTABLES + bool "eptables" + default n + help + Filtering tool for bridging firewall + + http://ebtables.sf.net Added: trunk/package/ebtables/ebtables.mk =================================================================== --- trunk/package/ebtables/ebtables.mk (rev 0) +++ trunk/package/ebtables/ebtables.mk 2007-10-30 16:50:17 UTC (rev 1339) @@ -0,0 +1,60 @@ +############################################################# +# +# ebtables +# +############################################################# +EBTABLES_VER:= 2.0.8-2 +EBTABLES_SOURCE_URL:=ftp.netfilter.org/pub/ebtables/ +EBTABLES_SOURCE:= ebtables-v$(EBTABLES_VER).tar.gz +EBTABLES_BUILD_DIR:=$(BUILD_DIR)/ebtables-v$(EBTABLES_VER) + +$(DL_DIR)/$(EBTABLES_SOURCE): + $(WGET) -P $(DL_DIR) $(EBTABLES_SOURCE_URL)/$(EBTABLES_SOURCE) + +$(EBTABLES_BUILD_DIR)/.unpacked: $(DL_DIR)/$(EBTABLES_SOURCE) + zcat $(DL_DIR)/$(EBTABLES_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) - + touch $(EBTABLES_BUILD_DIR)/.unpacked + +$(EBTABLES_BUILD_DIR)/.configured: $(EBTABLES_BUILD_DIR)/.unpacked + toolchain/patch-kernel.sh $(EBTABLES_BUILD_DIR) package/ebtables/ ebtables\*.patch + touch $(EBTABLES_BUILD_DIR)/.configured + +$(EBTABLES_BUILD_DIR)/ebtables: $(EBTABLES_BUILD_DIR)/.configured + $(TARGET_CONFIGURE_OPTS) \ + $(MAKE) -C $(EBTABLES_BUILD_DIR) LIBDIR=$(STAGING_DIR)/usr/lib \ + KERNEL_INCLUDES=$(LINUX_DIR) PREFIX=/usr \ + CC=$(TARGET_CC) CFLAGS="-Wall -Wunused -L$(STAGING_DIR)/lib -I$(STAGING_DIR)/include" + +$(TARGET_DIR)/usr/sbin/ebtables: $(EBTABLES_BUILD_DIR)/ebtables + $(TARGET_CONFIGURE_OPTS) \ + $(MAKE) -C $(EBTABLES_BUILD_DIR) LIBDIR=$(STAGING_DIR)/usr/lib \ + KERNEL_INCLUDES=$(LINUX_DIR) PREFIX=/usr \ + CC=$(TARGET_CC) CFLAGS="-Wall -Wunused -L$(STAGING_DIR)/lib -I$(STAGING_DIR)/include" \ + DESTDIR=$(STAGING_DIR) install + $(INSTALL) -D -m 0755 $(STAGING_DIR)/usr/sbin/ebtables $(TARGET_DIR)/usr/sbin/ebtables + $(STRIP) $(TARGET_DIR)/usr/sbin/ebtables + # $(INSTALL) -D -m 0755 package/ebtables/ebtables.init $(TARGET_DIR)/etc/init.d/ebtables + # $(INSTALL) -D -m 0755 package/ebtables/astfw $(TARGET_DIR)/usr/sbin/astfw + +ebtables: uclibc linux $(TARGET_DIR)/usr/sbin/ebtables + +ebtables-source: $(DL_DIR)/$(EBTABLES_SOURCE) + +ebtables-clean: + -$(MAKE) -C $(EBTABLES_BUILD_DIR) KERNEL_DIR=$(LINUX_DIR) clean + -rm -rf $(STAGING_DIR)/usr/sbin/ebtables + -rm -rf $(TARGET_DIR)/usr/sbin/ebtables + -rm -rf $(STAGING_DIR)/usr/sbin/ip6tables + -rm -rf $(TARGET_DIR)/usr/sbin/ip6tables + rm -rf $(TARGET_DIR)/etc/init.d/ebtables + +ebtables-dirclean: + rm -rf $(EBTABLES_BUILD_DIR) +############################################################# +# +# Toplevel Makefile options +# +############################################################# +ifeq ($(strip $(BR2_PACKAGE_EBTABLES)),y) +TARGETS+=ebtables +endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <isc...@us...> - 2007-11-28 10:21:31
|
Revision: 1397 http://astlinux.svn.sourceforge.net/astlinux/?rev=1397&view=rev Author: ischraub Date: 2007-11-28 02:21:29 -0800 (Wed, 28 Nov 2007) Log Message: ----------- mISDN version bump, chan_misdn version bump, rowe oslec patch integrated Modified Paths: -------------- trunk/package/chan_misdn/chan_misdn.mk trunk/package/mqueue-isdn/mqueue-isdn-make.patch trunk/package/mqueue-isdn/mqueue-isdn.mk Added Paths: ----------- trunk/package/mqueue-isdn/config-Makefile.patch trunk/package/mqueue-isdn/mISDN_alaw.patch trunk/package/mqueue-isdn/mISDN_oslec_patch_v1.1.5_rowe Modified: trunk/package/chan_misdn/chan_misdn.mk =================================================================== --- trunk/package/chan_misdn/chan_misdn.mk 2007-11-27 21:45:41 UTC (rev 1396) +++ trunk/package/chan_misdn/chan_misdn.mk 2007-11-28 10:21:29 UTC (rev 1397) @@ -3,7 +3,7 @@ # chan_misdn # ############################################################# -CHANMISDN_VER:=0.3.1-rc29 +CHANMISDN_VER:=0.3.1-rc36 CHANMISDN_SOURCE:=chan_misdn-$(CHANMISDN_VER).tar.gz CHANMISDN_SITE:=http://www.beronet.com/downloads/chan_misdn/stable/candidates CHANMISDN_DIR:=$(BUILD_DIR)/chan_misdn @@ -19,14 +19,16 @@ $(CHANMISDN_DIR)/.configured: $(CHANMISDN_DIR)/.unpacked toolchain/patch-kernel.sh $(CHANMISDN_DIR) package/chan_misdn/ chan_misdn\*.patch + cp $(BUILD_DIR)/asterisk/include/asterisk/lock.h $(BUILD_DIR)/asterisk/include/asterisk/lock.h.backup toolchain/patch-kernel.sh $(BUILD_DIR)/asterisk/include/asterisk package/chan_misdn/ astlock.patch touch $(CHANMISDN_DIR)/.configured $(CHANMISDN_DIR)/.built: $(CHANMISDN_DIR)/.configured - $(MAKE) MISDNUSERLIB=$(TARGET_DIR)/usr/lib CFLAGS+=-I$(BUILD_DIR)/asterisk/include CFLAGS+=-I$(CHANMISDN_DIR)/misdn CFLAGS+=-I$(STAGING_DIR)/include CFLAGS+=-I$(STAGING_DIR)/usr/include CC=$(TARGET_CC) -C $(CHANMISDN_DIR) + $(MAKE) PREFIX=$(STAGING_DIR) MISDNUSERLIB=$(TARGET_DIR)/usr/lib CFLAGS+=-I$(BUILD_DIR)/asterisk/include CFLAGS+=-I$(CHANMISDN_DIR)/misdn CFLAGS+=-I$(STAGING_DIR)/include CFLAGS+=-I$(STAGING_DIR)/usr/include CC=$(TARGET_CC) -C $(CHANMISDN_DIR) $(INSTALL) -m 644 $(CHANMISDN_DIR)/chan_misdn.so $(TARGET_DIR)/usr/lib/asterisk/modules/ $(STRIP) --strip-unneeded $(TARGET_DIR)/usr/lib/asterisk/modules/chan_misdn.so cp $(CHANMISDN_DIR)/misdn.conf $(TARGET_DIR)/stat/etc/asterisk/ + cp $(BUILD_DIR)/asterisk/include/asterisk/lock.h.backup $(BUILD_DIR)/asterisk/include/asterisk/lock.h touch $(CHANMISDN_DIR)/.built chan_misdn: uclibc linux asterisk mqueue_misdn $(CHANMISDN_DIR)/.built Added: trunk/package/mqueue-isdn/config-Makefile.patch =================================================================== --- trunk/package/mqueue-isdn/config-Makefile.patch (rev 0) +++ trunk/package/mqueue-isdn/config-Makefile.patch 2007-11-28 10:21:29 UTC (rev 1397) @@ -0,0 +1,9 @@ +--- config/Makefile.orig 2007-05-29 14:23:39.000000000 +0200 ++++ config/Makefile 2007-05-29 14:24:13.000000000 +0200 +@@ -7,5 +7,5 @@ + for file in $(shell echo *.xsl); do install -D -m644 $${file} $(INSTALL_PREFIX)/usr/lib/mISDN/$${file}; done + if [ -d $(INSTALL_PREFIX)/etc/init.d ]; then \ + if [ -e $(INSTALL_PREFIX)/etc/init.d/mISDN ]; then rm -rf $(INSTALL_PREFIX)/etc/init.d/mISDN; fi; \ +- ln -s $(INSTALL_PREFIX)/usr/sbin/mISDN $(INSTALL_PREFIX)/etc/init.d/mISDN; \ ++ ln -s ../../usr/sbin/mISDN $(INSTALL_PREFIX)/etc/init.d/mISDN; \ + fi Added: trunk/package/mqueue-isdn/mISDN_alaw.patch =================================================================== --- trunk/package/mqueue-isdn/mISDN_alaw.patch (rev 0) +++ trunk/package/mqueue-isdn/mISDN_alaw.patch 2007-11-28 10:21:29 UTC (rev 1397) @@ -0,0 +1,634 @@ +--- /home/peter/src/mISDN-1_1_5/drivers/isdn/hardware/mISDN/dsp_audio.c 2007-07-02 11:31:34.000000000 +0200 ++++ ./dsp_audio.c 2007-11-23 18:33:02.000000000 +0100 +@@ -15,331 +15,173 @@ + #include "dsp.h" + + /* ulaw[unsigned char] -> signed 16-bit */ +-s32 dsp_audio_ulaw_to_s32[256] = +-{ +- 0xffff8284, 0xffff8684, 0xffff8a84, 0xffff8e84, +- 0xffff9284, 0xffff9684, 0xffff9a84, 0xffff9e84, +- 0xffffa284, 0xffffa684, 0xffffaa84, 0xffffae84, +- 0xffffb284, 0xffffb684, 0xffffba84, 0xffffbe84, +- 0xffffc184, 0xffffc384, 0xffffc584, 0xffffc784, +- 0xffffc984, 0xffffcb84, 0xffffcd84, 0xffffcf84, +- 0xffffd184, 0xffffd384, 0xffffd584, 0xffffd784, +- 0xffffd984, 0xffffdb84, 0xffffdd84, 0xffffdf84, +- 0xffffe104, 0xffffe204, 0xffffe304, 0xffffe404, +- 0xffffe504, 0xffffe604, 0xffffe704, 0xffffe804, +- 0xffffe904, 0xffffea04, 0xffffeb04, 0xffffec04, +- 0xffffed04, 0xffffee04, 0xffffef04, 0xfffff004, +- 0xfffff0c4, 0xfffff144, 0xfffff1c4, 0xfffff244, +- 0xfffff2c4, 0xfffff344, 0xfffff3c4, 0xfffff444, +- 0xfffff4c4, 0xfffff544, 0xfffff5c4, 0xfffff644, +- 0xfffff6c4, 0xfffff744, 0xfffff7c4, 0xfffff844, +- 0xfffff8a4, 0xfffff8e4, 0xfffff924, 0xfffff964, +- 0xfffff9a4, 0xfffff9e4, 0xfffffa24, 0xfffffa64, +- 0xfffffaa4, 0xfffffae4, 0xfffffb24, 0xfffffb64, +- 0xfffffba4, 0xfffffbe4, 0xfffffc24, 0xfffffc64, +- 0xfffffc94, 0xfffffcb4, 0xfffffcd4, 0xfffffcf4, +- 0xfffffd14, 0xfffffd34, 0xfffffd54, 0xfffffd74, +- 0xfffffd94, 0xfffffdb4, 0xfffffdd4, 0xfffffdf4, +- 0xfffffe14, 0xfffffe34, 0xfffffe54, 0xfffffe74, +- 0xfffffe8c, 0xfffffe9c, 0xfffffeac, 0xfffffebc, +- 0xfffffecc, 0xfffffedc, 0xfffffeec, 0xfffffefc, +- 0xffffff0c, 0xffffff1c, 0xffffff2c, 0xffffff3c, +- 0xffffff4c, 0xffffff5c, 0xffffff6c, 0xffffff7c, +- 0xffffff88, 0xffffff90, 0xffffff98, 0xffffffa0, +- 0xffffffa8, 0xffffffb0, 0xffffffb8, 0xffffffc0, +- 0xffffffc8, 0xffffffd0, 0xffffffd8, 0xffffffe0, +- 0xffffffe8, 0xfffffff0, 0xfffffff8, 0xffffffff, +- 0x00007d7c, 0x0000797c, 0x0000757c, 0x0000717c, +- 0x00006d7c, 0x0000697c, 0x0000657c, 0x0000617c, +- 0x00005d7c, 0x0000597c, 0x0000557c, 0x0000517c, +- 0x00004d7c, 0x0000497c, 0x0000457c, 0x0000417c, +- 0x00003e7c, 0x00003c7c, 0x00003a7c, 0x0000387c, +- 0x0000367c, 0x0000347c, 0x0000327c, 0x0000307c, +- 0x00002e7c, 0x00002c7c, 0x00002a7c, 0x0000287c, +- 0x0000267c, 0x0000247c, 0x0000227c, 0x0000207c, +- 0x00001efc, 0x00001dfc, 0x00001cfc, 0x00001bfc, +- 0x00001afc, 0x000019fc, 0x000018fc, 0x000017fc, +- 0x000016fc, 0x000015fc, 0x000014fc, 0x000013fc, +- 0x000012fc, 0x000011fc, 0x000010fc, 0x00000ffc, +- 0x00000f3c, 0x00000ebc, 0x00000e3c, 0x00000dbc, +- 0x00000d3c, 0x00000cbc, 0x00000c3c, 0x00000bbc, +- 0x00000b3c, 0x00000abc, 0x00000a3c, 0x000009bc, +- 0x0000093c, 0x000008bc, 0x0000083c, 0x000007bc, +- 0x0000075c, 0x0000071c, 0x000006dc, 0x0000069c, +- 0x0000065c, 0x0000061c, 0x000005dc, 0x0000059c, +- 0x0000055c, 0x0000051c, 0x000004dc, 0x0000049c, +- 0x0000045c, 0x0000041c, 0x000003dc, 0x0000039c, +- 0x0000036c, 0x0000034c, 0x0000032c, 0x0000030c, +- 0x000002ec, 0x000002cc, 0x000002ac, 0x0000028c, +- 0x0000026c, 0x0000024c, 0x0000022c, 0x0000020c, +- 0x000001ec, 0x000001cc, 0x000001ac, 0x0000018c, +- 0x00000174, 0x00000164, 0x00000154, 0x00000144, +- 0x00000134, 0x00000124, 0x00000114, 0x00000104, +- 0x000000f4, 0x000000e4, 0x000000d4, 0x000000c4, +- 0x000000b4, 0x000000a4, 0x00000094, 0x00000084, +- 0x00000078, 0x00000070, 0x00000068, 0x00000060, +- 0x00000058, 0x00000050, 0x00000048, 0x00000040, +- 0x00000038, 0x00000030, 0x00000028, 0x00000020, +- 0x00000018, 0x00000010, 0x00000008, 0x00000000 +-}; +- ++s32 dsp_audio_ulaw_to_s32[256]; + /* alaw[unsigned char] -> signed 16-bit */ +-s32 dsp_audio_alaw_to_s32[256] = +-{ +- 0x000013fc, 0xffffec04, 0x00000144, 0xfffffebc, +- 0x0000517c, 0xffffae84, 0x0000051c, 0xfffffae4, +- 0x00000a3c, 0xfffff5c4, 0x00000048, 0xffffffb8, +- 0x0000287c, 0xffffd784, 0x0000028c, 0xfffffd74, +- 0x00001bfc, 0xffffe404, 0x000001cc, 0xfffffe34, +- 0x0000717c, 0xffff8e84, 0x0000071c, 0xfffff8e4, +- 0x00000e3c, 0xfffff1c4, 0x000000c4, 0xffffff3c, +- 0x0000387c, 0xffffc784, 0x0000039c, 0xfffffc64, +- 0x00000ffc, 0xfffff004, 0x00000104, 0xfffffefc, +- 0x0000417c, 0xffffbe84, 0x0000041c, 0xfffffbe4, +- 0x0000083c, 0xfffff7c4, 0x00000008, 0xfffffff8, +- 0x0000207c, 0xffffdf84, 0x0000020c, 0xfffffdf4, +- 0x000017fc, 0xffffe804, 0x0000018c, 0xfffffe74, +- 0x0000617c, 0xffff9e84, 0x0000061c, 0xfffff9e4, +- 0x00000c3c, 0xfffff3c4, 0x00000084, 0xffffff7c, +- 0x0000307c, 0xffffcf84, 0x0000030c, 0xfffffcf4, +- 0x000015fc, 0xffffea04, 0x00000164, 0xfffffe9c, +- 0x0000597c, 0xffffa684, 0x0000059c, 0xfffffa64, +- 0x00000b3c, 0xfffff4c4, 0x00000068, 0xffffff98, +- 0x00002c7c, 0xffffd384, 0x000002cc, 0xfffffd34, +- 0x00001dfc, 0xffffe204, 0x000001ec, 0xfffffe14, +- 0x0000797c, 0xffff8684, 0x000007bc, 0xfffff844, +- 0x00000f3c, 0xfffff0c4, 0x000000e4, 0xffffff1c, +- 0x00003c7c, 0xffffc384, 0x000003dc, 0xfffffc24, +- 0x000011fc, 0xffffee04, 0x00000124, 0xfffffedc, +- 0x0000497c, 0xffffb684, 0x0000049c, 0xfffffb64, +- 0x0000093c, 0xfffff6c4, 0x00000028, 0xffffffd8, +- 0x0000247c, 0xffffdb84, 0x0000024c, 0xfffffdb4, +- 0x000019fc, 0xffffe604, 0x000001ac, 0xfffffe54, +- 0x0000697c, 0xffff9684, 0x0000069c, 0xfffff964, +- 0x00000d3c, 0xfffff2c4, 0x000000a4, 0xffffff5c, +- 0x0000347c, 0xffffcb84, 0x0000034c, 0xfffffcb4, +- 0x000012fc, 0xffffed04, 0x00000134, 0xfffffecc, +- 0x00004d7c, 0xffffb284, 0x000004dc, 0xfffffb24, +- 0x000009bc, 0xfffff644, 0x00000038, 0xffffffc8, +- 0x0000267c, 0xffffd984, 0x0000026c, 0xfffffd94, +- 0x00001afc, 0xffffe504, 0x000001ac, 0xfffffe54, +- 0x00006d7c, 0xffff9284, 0x000006dc, 0xfffff924, +- 0x00000dbc, 0xfffff244, 0x000000b4, 0xffffff4c, +- 0x0000367c, 0xffffc984, 0x0000036c, 0xfffffc94, +- 0x00000f3c, 0xfffff0c4, 0x000000f4, 0xffffff0c, +- 0x00003e7c, 0xffffc184, 0x000003dc, 0xfffffc24, +- 0x000007bc, 0xfffff844, 0x00000008, 0xfffffff8, +- 0x00001efc, 0xffffe104, 0x000001ec, 0xfffffe14, +- 0x000016fc, 0xffffe904, 0x00000174, 0xfffffe8c, +- 0x00005d7c, 0xffffa284, 0x000005dc, 0xfffffa24, +- 0x00000bbc, 0xfffff444, 0x00000078, 0xffffff88, +- 0x00002e7c, 0xffffd184, 0x000002ec, 0xfffffd14, +- 0x000014fc, 0xffffeb04, 0x00000154, 0xfffffeac, +- 0x0000557c, 0xffffaa84, 0x0000055c, 0xfffffaa4, +- 0x00000abc, 0xfffff544, 0x00000058, 0xffffffa8, +- 0x00002a7c, 0xffffd584, 0x000002ac, 0xfffffd54, +- 0x00001cfc, 0xffffe304, 0x000001cc, 0xfffffe34, +- 0x0000757c, 0xffff8a84, 0x0000075c, 0xfffff8a4, +- 0x00000ebc, 0xfffff144, 0x000000d4, 0xffffff2c, +- 0x00003a7c, 0xffffc584, 0x0000039c, 0xfffffc64, +- 0x000010fc, 0xffffef04, 0x00000114, 0xfffffeec, +- 0x0000457c, 0xffffba84, 0x0000045c, 0xfffffba4, +- 0x000008bc, 0xfffff744, 0x00000018, 0xffffffe8, +- 0x0000227c, 0xffffdd84, 0x0000022c, 0xfffffdd4, +- 0x000018fc, 0xffffe704, 0x0000018c, 0xfffffe74, +- 0x0000657c, 0xffff9a84, 0x0000065c, 0xfffff9a4, +- 0x00000cbc, 0xfffff344, 0x00000094, 0xffffff6c, +- 0x0000327c, 0xffffcd84, 0x0000032c, 0xfffffcd4 +-}; ++s32 dsp_audio_alaw_to_s32[256]; + + s32 *dsp_audio_law_to_s32; + + /* signed 16-bit -> law */ + u8 dsp_audio_s16_to_law[65536]; + +-/* table is used to generate s16_to_alaw */ +-static short dsp_audio_alaw_relations[512] = ++/* alaw -> ulaw */ ++u8 dsp_audio_alaw_to_ulaw[256]; ++/* ulaw -> alaw */ ++u8 dsp_audio_ulaw_to_alaw[256]; ++u8 dsp_silence; ++ ++ ++/***************************************************** ++ * generate table for conversion of s16 to alaw/ulaw * ++ *****************************************************/ ++ ++#define AMI_MASK 0x55 ++ ++static inline unsigned char linear2alaw (short int linear) + { +- 0x8684, 0x55, 0x8a84, 0xd5, 0x8e84, 0x15, 0x9284, 0x95, +- 0x9684, 0x75, 0x9a84, 0xf5, 0x9e84, 0x35, 0xa284, 0xb5, +- 0xa684, 0x45, 0xaa84, 0xc5, 0xae84, 0x05, 0xb284, 0x85, +- 0xb684, 0x65, 0xba84, 0xe5, 0xbe84, 0x25, 0xc184, 0xa5, +- 0xc384, 0x5d, 0xc584, 0xdd, 0xc784, 0x1d, 0xc984, 0x9d, +- 0xcb84, 0x7d, 0xcd84, 0xfd, 0xcf84, 0x3d, 0xd184, 0xbd, +- 0xd384, 0x4d, 0xd584, 0xcd, 0xd784, 0x0d, 0xd984, 0x8d, +- 0xdb84, 0x6d, 0xdd84, 0xed, 0xdf84, 0x2d, 0xe104, 0xad, +- 0xe204, 0x51, 0xe304, 0xd1, 0xe404, 0x11, 0xe504, 0x91, +- 0xe604, 0x71, 0xe704, 0xf1, 0xe804, 0x31, 0xe904, 0xb1, +- 0xea04, 0x41, 0xeb04, 0xc1, 0xec04, 0x01, 0xed04, 0x81, +- 0xee04, 0x61, 0xef04, 0xe1, 0xf004, 0x21, 0xf0c4, 0x59, +- 0xf0c4, 0xa1, 0xf144, 0xd9, 0xf1c4, 0x19, 0xf244, 0x99, +- 0xf2c4, 0x79, 0xf344, 0xf9, 0xf3c4, 0x39, 0xf444, 0xb9, +- 0xf4c4, 0x49, 0xf544, 0xc9, 0xf5c4, 0x09, 0xf644, 0x89, +- 0xf6c4, 0x69, 0xf744, 0xe9, 0xf7c4, 0x29, 0xf844, 0x57, +- 0xf844, 0xa9, 0xf8a4, 0xd7, 0xf8e4, 0x17, 0xf924, 0x97, +- 0xf964, 0x77, 0xf9a4, 0xf7, 0xf9e4, 0x37, 0xfa24, 0xb7, +- 0xfa64, 0x47, 0xfaa4, 0xc7, 0xfae4, 0x07, 0xfb24, 0x87, +- 0xfb64, 0x67, 0xfba4, 0xe7, 0xfbe4, 0x27, 0xfc24, 0x5f, +- 0xfc24, 0xa7, 0xfc64, 0x1f, 0xfc64, 0xdf, 0xfc94, 0x9f, +- 0xfcb4, 0x7f, 0xfcd4, 0xff, 0xfcf4, 0x3f, 0xfd14, 0xbf, +- 0xfd34, 0x4f, 0xfd54, 0xcf, 0xfd74, 0x0f, 0xfd94, 0x8f, +- 0xfdb4, 0x6f, 0xfdd4, 0xef, 0xfdf4, 0x2f, 0xfe14, 0x53, +- 0xfe14, 0xaf, 0xfe34, 0x13, 0xfe34, 0xd3, 0xfe54, 0x73, +- 0xfe54, 0x93, 0xfe74, 0x33, 0xfe74, 0xf3, 0xfe8c, 0xb3, +- 0xfe9c, 0x43, 0xfeac, 0xc3, 0xfebc, 0x03, 0xfecc, 0x83, +- 0xfedc, 0x63, 0xfeec, 0xe3, 0xfefc, 0x23, 0xff0c, 0xa3, +- 0xff1c, 0x5b, 0xff2c, 0xdb, 0xff3c, 0x1b, 0xff4c, 0x9b, +- 0xff5c, 0x7b, 0xff6c, 0xfb, 0xff7c, 0x3b, 0xff88, 0xbb, +- 0xff98, 0x4b, 0xffa8, 0xcb, 0xffb8, 0x0b, 0xffc8, 0x8b, +- 0xffd8, 0x6b, 0xffe8, 0xeb, 0xfff8, 0x2b, 0xfff8, 0xab, +- 0x0008, 0x2a, 0x0008, 0xaa, 0x0018, 0xea, 0x0028, 0x6a, +- 0x0038, 0x8a, 0x0048, 0x0a, 0x0058, 0xca, 0x0068, 0x4a, +- 0x0078, 0xba, 0x0084, 0x3a, 0x0094, 0xfa, 0x00a4, 0x7a, +- 0x00b4, 0x9a, 0x00c4, 0x1a, 0x00d4, 0xda, 0x00e4, 0x5a, +- 0x00f4, 0xa2, 0x0104, 0x22, 0x0114, 0xe2, 0x0124, 0x62, +- 0x0134, 0x82, 0x0144, 0x02, 0x0154, 0xc2, 0x0164, 0x42, +- 0x0174, 0xb2, 0x018c, 0x32, 0x018c, 0xf2, 0x01ac, 0x72, +- 0x01ac, 0x92, 0x01cc, 0x12, 0x01cc, 0xd2, 0x01ec, 0x52, +- 0x01ec, 0xae, 0x020c, 0x2e, 0x022c, 0xee, 0x024c, 0x6e, +- 0x026c, 0x8e, 0x028c, 0x0e, 0x02ac, 0xce, 0x02cc, 0x4e, +- 0x02ec, 0xbe, 0x030c, 0x3e, 0x032c, 0xfe, 0x034c, 0x7e, +- 0x036c, 0x9e, 0x039c, 0x1e, 0x039c, 0xde, 0x03dc, 0x5e, +- 0x03dc, 0xa6, 0x041c, 0x26, 0x045c, 0xe6, 0x049c, 0x66, +- 0x04dc, 0x86, 0x051c, 0x06, 0x055c, 0xc6, 0x059c, 0x46, +- 0x05dc, 0xb6, 0x061c, 0x36, 0x065c, 0xf6, 0x069c, 0x76, +- 0x06dc, 0x96, 0x071c, 0x16, 0x075c, 0xd6, 0x07bc, 0x56, +- 0x07bc, 0xa8, 0x083c, 0x28, 0x08bc, 0xe8, 0x093c, 0x68, +- 0x09bc, 0x88, 0x0a3c, 0x08, 0x0abc, 0xc8, 0x0b3c, 0x48, +- 0x0bbc, 0xb8, 0x0c3c, 0x38, 0x0cbc, 0xf8, 0x0d3c, 0x78, +- 0x0dbc, 0x98, 0x0e3c, 0x18, 0x0ebc, 0xd8, 0x0f3c, 0x58, +- 0x0f3c, 0xa0, 0x0ffc, 0x20, 0x10fc, 0xe0, 0x11fc, 0x60, +- 0x12fc, 0x80, 0x13fc, 0x00, 0x14fc, 0xc0, 0x15fc, 0x40, +- 0x16fc, 0xb0, 0x17fc, 0x30, 0x18fc, 0xf0, 0x19fc, 0x70, +- 0x1afc, 0x90, 0x1bfc, 0x10, 0x1cfc, 0xd0, 0x1dfc, 0x50, +- 0x1efc, 0xac, 0x207c, 0x2c, 0x227c, 0xec, 0x247c, 0x6c, +- 0x267c, 0x8c, 0x287c, 0x0c, 0x2a7c, 0xcc, 0x2c7c, 0x4c, +- 0x2e7c, 0xbc, 0x307c, 0x3c, 0x327c, 0xfc, 0x347c, 0x7c, +- 0x367c, 0x9c, 0x387c, 0x1c, 0x3a7c, 0xdc, 0x3c7c, 0x5c, +- 0x3e7c, 0xa4, 0x417c, 0x24, 0x457c, 0xe4, 0x497c, 0x64, +- 0x4d7c, 0x84, 0x517c, 0x04, 0x557c, 0xc4, 0x597c, 0x44, +- 0x5d7c, 0xb4, 0x617c, 0x34, 0x657c, 0xf4, 0x697c, 0x74, +- 0x6d7c, 0x94, 0x717c, 0x14, 0x757c, 0xd4, 0x797c, 0x54 +-}; ++ int mask; ++ int seg; ++ int pcm_val; ++ static int seg_end[8] = { ++ 0xFF, 0x1FF, 0x3FF, 0x7FF, 0xFFF, 0x1FFF, 0x3FFF, 0x7FFF ++ }; ++ ++ pcm_val = linear; ++ if (pcm_val >= 0) { ++ /* Sign (7th) bit = 1 */ ++ mask = AMI_MASK | 0x80; ++ } else { ++ /* Sign bit = 0 */ ++ mask = AMI_MASK; ++ pcm_val = -pcm_val; ++ } + ++ /* Convert the scaled magnitude to segment number. */ ++ for (seg = 0; seg < 8; seg++) { ++ if (pcm_val <= seg_end[seg]) ++ break; ++ } ++ /* Combine the sign, segment, and quantization bits. */ ++ return ((seg << 4) | ++ ((pcm_val >> ((seg) ? (seg + 3) : 4)) & 0x0F)) ^ mask; ++} + +-/* alaw -> ulaw */ +-u8 dsp_audio_alaw_to_ulaw[256] = ++ ++static inline short int alaw2linear (unsigned char alaw) + { +- 0xab, 0x2b, 0xe3, 0x63, 0x8b, 0x0b, 0xc9, 0x49, +- 0xba, 0x3a, 0xf6, 0x76, 0x9b, 0x1b, 0xd7, 0x57, +- 0xa3, 0x23, 0xdd, 0x5d, 0x83, 0x03, 0xc1, 0x41, +- 0xb2, 0x32, 0xeb, 0x6b, 0x93, 0x13, 0xcf, 0x4f, +- 0xaf, 0x2f, 0xe7, 0x67, 0x8f, 0x0f, 0xcd, 0x4d, +- 0xbe, 0x3e, 0xfe, 0x7e, 0x9f, 0x1f, 0xdb, 0x5b, +- 0xa7, 0x27, 0xdf, 0x5f, 0x87, 0x07, 0xc5, 0x45, +- 0xb6, 0x36, 0xef, 0x6f, 0x97, 0x17, 0xd3, 0x53, +- 0xa9, 0x29, 0xe1, 0x61, 0x89, 0x09, 0xc7, 0x47, +- 0xb8, 0x38, 0xf2, 0x72, 0x99, 0x19, 0xd5, 0x55, +- 0xa1, 0x21, 0xdc, 0x5c, 0x81, 0x01, 0xbf, 0x3f, +- 0xb0, 0x30, 0xe9, 0x69, 0x91, 0x11, 0xce, 0x4e, +- 0xad, 0x2d, 0xe5, 0x65, 0x8d, 0x0d, 0xcb, 0x4b, +- 0xbc, 0x3c, 0xfa, 0x7a, 0x9d, 0x1d, 0xd9, 0x59, +- 0xa5, 0x25, 0xde, 0x5e, 0x85, 0x05, 0xc3, 0x43, +- 0xb4, 0x34, 0xed, 0x6d, 0x95, 0x15, 0xd1, 0x51, +- 0xac, 0x2c, 0xe4, 0x64, 0x8c, 0x0c, 0xca, 0x4a, +- 0xbb, 0x3b, 0xf8, 0x78, 0x9c, 0x1c, 0xd8, 0x58, +- 0xa4, 0x24, 0xde, 0x5e, 0x84, 0x04, 0xc2, 0x42, +- 0xb3, 0x33, 0xec, 0x6c, 0x94, 0x14, 0xd0, 0x50, +- 0xb0, 0x30, 0xe8, 0x68, 0x90, 0x10, 0xce, 0x4e, +- 0xbf, 0x3f, 0xfe, 0x7e, 0xa0, 0x20, 0xdc, 0x5c, +- 0xa8, 0x28, 0xe0, 0x60, 0x88, 0x08, 0xc6, 0x46, +- 0xb7, 0x37, 0xf0, 0x70, 0x98, 0x18, 0xd4, 0x54, +- 0xaa, 0x2a, 0xe2, 0x62, 0x8a, 0x0a, 0xc8, 0x48, +- 0xb9, 0x39, 0xf4, 0x74, 0x9a, 0x1a, 0xd6, 0x56, +- 0xa2, 0x22, 0xdd, 0x5d, 0x82, 0x02, 0xc0, 0x40, +- 0xb1, 0x31, 0xea, 0x6a, 0x92, 0x12, 0xcf, 0x4f, +- 0xae, 0x2e, 0xe6, 0x66, 0x8e, 0x0e, 0xcc, 0x4c, +- 0xbd, 0x3d, 0xfc, 0x7c, 0x9e, 0x1e, 0xda, 0x5a, +- 0xa6, 0x26, 0xdf, 0x5f, 0x86, 0x06, 0xc4, 0x44, +- 0xb5, 0x35, 0xee, 0x6e, 0x96, 0x16, 0xd2, 0x52 +-}; ++ int i; ++ int seg; + +-/* ulaw -> alaw */ +-u8 dsp_audio_ulaw_to_alaw[256] = ++ alaw ^= AMI_MASK; ++ i = ((alaw & 0x0F) << 4) + 8 /* rounding error */; ++ seg = (((int) alaw & 0x70) >> 4); ++ if (seg) ++ i = (i + 0x100) << (seg - 1); ++ return (short int) ((alaw & 0x80) ? i : -i); ++} ++ ++static inline short int ulaw2linear(unsigned char ulaw) + { +- 0xab, 0x55, 0xd5, 0x15, 0x95, 0x75, 0xf5, 0x35, +- 0xb5, 0x45, 0xc5, 0x05, 0x85, 0x65, 0xe5, 0x25, +- 0xa5, 0x5d, 0xdd, 0x1d, 0x9d, 0x7d, 0xfd, 0x3d, +- 0xbd, 0x4d, 0xcd, 0x0d, 0x8d, 0x6d, 0xed, 0x2d, +- 0xad, 0x51, 0xd1, 0x11, 0x91, 0x71, 0xf1, 0x31, +- 0xb1, 0x41, 0xc1, 0x01, 0x81, 0x61, 0xe1, 0x21, +- 0x59, 0xd9, 0x19, 0x99, 0x79, 0xf9, 0x39, 0xb9, +- 0x49, 0xc9, 0x09, 0x89, 0x69, 0xe9, 0x29, 0xa9, +- 0xd7, 0x17, 0x97, 0x77, 0xf7, 0x37, 0xb7, 0x47, +- 0xc7, 0x07, 0x87, 0x67, 0xe7, 0x27, 0xa7, 0xdf, +- 0x9f, 0x7f, 0xff, 0x3f, 0xbf, 0x4f, 0xcf, 0x0f, +- 0x8f, 0x6f, 0xef, 0x2f, 0x53, 0x13, 0x73, 0x33, +- 0xb3, 0x43, 0xc3, 0x03, 0x83, 0x63, 0xe3, 0x23, +- 0xa3, 0x5b, 0xdb, 0x1b, 0x9b, 0x7b, 0xfb, 0x3b, +- 0xbb, 0xbb, 0x4b, 0x4b, 0xcb, 0xcb, 0x0b, 0x0b, +- 0x8b, 0x8b, 0x6b, 0x6b, 0xeb, 0xeb, 0x2b, 0x2b, +- 0xab, 0x54, 0xd4, 0x14, 0x94, 0x74, 0xf4, 0x34, +- 0xb4, 0x44, 0xc4, 0x04, 0x84, 0x64, 0xe4, 0x24, +- 0xa4, 0x5c, 0xdc, 0x1c, 0x9c, 0x7c, 0xfc, 0x3c, +- 0xbc, 0x4c, 0xcc, 0x0c, 0x8c, 0x6c, 0xec, 0x2c, +- 0xac, 0x50, 0xd0, 0x10, 0x90, 0x70, 0xf0, 0x30, +- 0xb0, 0x40, 0xc0, 0x00, 0x80, 0x60, 0xe0, 0x20, +- 0x58, 0xd8, 0x18, 0x98, 0x78, 0xf8, 0x38, 0xb8, +- 0x48, 0xc8, 0x08, 0x88, 0x68, 0xe8, 0x28, 0xa8, +- 0xd6, 0x16, 0x96, 0x76, 0xf6, 0x36, 0xb6, 0x46, +- 0xc6, 0x06, 0x86, 0x66, 0xe6, 0x26, 0xa6, 0xde, +- 0x9e, 0x7e, 0xfe, 0x3e, 0xbe, 0x4e, 0xce, 0x0e, +- 0x8e, 0x6e, 0xee, 0x2e, 0x52, 0x12, 0x72, 0x32, +- 0xb2, 0x42, 0xc2, 0x02, 0x82, 0x62, 0xe2, 0x22, +- 0xa2, 0x5a, 0xda, 0x1a, 0x9a, 0x7a, 0xfa, 0x3a, +- 0xba, 0xba, 0x4a, 0x4a, 0xca, 0xca, 0x0a, 0x0a, +- 0x8a, 0x8a, 0x6a, 0x6a, 0xea, 0xea, 0x2a, 0x2a +-}; ++ short mu, e, f, y; ++ static short etab[] = {0,132,396,924,1980,4092,8316,16764}; + +-u8 dsp_silence; ++ mu = 255 - ulaw; ++ e = (mu & 0x70) / 16; ++ f = mu & 0x0f; ++ y = f * (1 << (e + 3)); ++ y += etab[e]; ++ if (mu & 0x80) ++ y = -y; ++ return y; ++} + ++#define BIAS 0x84 /*!< define the add-in bias for 16 bit samples */ + +-/***************************************************** +- * generate table for conversion of s16 to alaw/ulaw * +- *****************************************************/ ++static unsigned char linear2ulaw(short sample) ++{ ++ static int exp_lut[256] = { ++ 0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3, ++ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, ++ 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, ++ 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, ++ 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, ++ 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, ++ 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, ++ 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, ++ 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, ++ 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, ++ 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, ++ 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, ++ 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, ++ 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, ++ 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, ++ 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7 }; ++ int sign, exponent, mantissa; ++ unsigned char ulawbyte; ++ ++ /* Get the sample into sign-magnitude. */ ++ sign = (sample >> 8) & 0x80; /* set aside the sign */ ++ if (sign != 0) ++ sample = -sample; /* get magnitude */ ++ ++ /* Convert from 16 bit linear to ulaw. */ ++ sample = sample + BIAS; ++ exponent = exp_lut[(sample >> 7) & 0xFF]; ++ mantissa = (sample >> (exponent + 3)) & 0x0F; ++ ulawbyte = ~(sign | (exponent << 4) | mantissa); ++ ++ return ulawbyte; ++} ++ ++static int reverse_bits(int i) ++{ ++ int z,j; ++ z = 0; ++ ++ for (j = 0; j < 8; j++) { ++ if ((i & (1 << j)) != 0) { ++ z |= 1 << (7 - j); ++ } ++ } ++ return z; ++} ++ ++ ++void dsp_audio_generate_law_tables(void) ++{ ++ int i; ++ for (i = 0; i < 256; i++) { ++ dsp_audio_alaw_to_s32[i] = alaw2linear(reverse_bits(i)); ++ } ++ ++ for (i = 0; i < 256; i++) { ++ dsp_audio_ulaw_to_s32[i] = ulaw2linear(reverse_bits(i)); ++ } ++ ++ for (i = 0; i < 256; i++) { ++ dsp_audio_alaw_to_ulaw[i] = ++ linear2ulaw(dsp_audio_alaw_to_s32[i]); ++ dsp_audio_ulaw_to_alaw[i] = ++ linear2alaw(dsp_audio_ulaw_to_s32[i]); ++ } ++} + + void + dsp_audio_generate_s2law_table(void) + { +- int i, j; ++ int i; + + if (dsp_options & DSP_OPT_ULAW) { + /* generating ulaw-table */ +- i = j = 0; +- while(i < 32768) { +- if (i-32768 > dsp_audio_law_to_s32[j]) +- j++; +- dsp_audio_s16_to_law[(i-32768) & 0xffff] = j; +- i++; +- } +- j = 255; +- while(i < 65536) { +- if (i-32768 > dsp_audio_law_to_s32[j]) +- j--; +- dsp_audio_s16_to_law[(i-32768) & 0xffff] = j; +- i++; ++ for (i = -32768; i < 32768; i++) { ++ dsp_audio_s16_to_law[i & 0xffff] = ++ reverse_bits(linear2ulaw(i)); + } + } else { + /* generating alaw-table */ +- i = j = 0; +- while(i < 65536) { +- if (i-32768 > dsp_audio_alaw_relations[j<<1]) +- j++; +- if (j>255) +- j=255; +- dsp_audio_s16_to_law[(i-32768) & 0xffff] +- = dsp_audio_alaw_relations[(j<<1)|1]; +- i++; ++ for (i = -32768; i < 32768; i++) { ++ dsp_audio_s16_to_law[i & 0xffff] = ++ reverse_bits(linear2alaw(i)); + } + } + } +@@ -359,43 +201,42 @@ + void + dsp_audio_generate_seven(void) + { +- int i, j; +- u8 spl; +- +- /* conversion from law to seven bit audio */ +- i = 0; +- while(i < 256) { +- /* spl is the source: the law-sample (converted to alaw) */ +- spl = i; +- if (dsp_options & DSP_OPT_ULAW) +- spl = dsp_audio_ulaw_to_alaw[i]; +- /* find the 7-bit-sample */ +- j = 0; +- while(j < 256) { +- if (dsp_audio_alaw_relations[(j<<1)|1] == spl) +- break; +- j++; +- } +- if (j == 256) { +- printk(KERN_WARNING "fatal error in %s: alaw-sample '0x%2x' not found in relations-table.\n", __FUNCTION__, spl); +- } +- /* write 7-bit audio value */ +- dsp_audio_law2seven[i] = j >> 1; +- i++; +- } +- +- /* conversion from seven bit audio to law */ +- i = 0; +- while(i < 128) { +- /* find alaw-spl */ +- spl = dsp_audio_alaw_relations[(i<<2)|1]; +- /* convert to ulaw, if required */ +- if (dsp_options & DSP_OPT_ULAW) +- spl = dsp_audio_alaw_to_ulaw[spl]; +- /* write 8-bit law sample */ +- dsp_audio_seven2law[i] = spl; +- i++; +- } ++ int i, j, k; ++ u8 spl; ++ u8 sorted_alaw[256]; ++ ++ /* generate alaw table, sorted by the linear value */ ++ for (i = 0; i < 256; i++) { ++ j = 0; ++ for (k = 0; k < 256; k++) { ++ if (dsp_audio_alaw_to_s32[k] ++ < dsp_audio_alaw_to_s32[i]) { ++ j++; ++ } ++ } ++ sorted_alaw[j] = i; ++ } ++ ++ /* generate tabels */ ++ for (i = 0; i < 256; i++) { ++ /* spl is the source: the law-sample (converted to alaw) */ ++ spl = i; ++ if (dsp_options & DSP_OPT_ULAW) ++ spl = dsp_audio_ulaw_to_alaw[i]; ++ /* find the 7-bit-sample */ ++ for (j = 0; j < 256; j++) { ++ if (sorted_alaw[j] == spl) ++ break; ++ } ++ /* write 7-bit audio value */ ++ dsp_audio_law2seven[i] = j >> 1; ++ } ++ for (i = 0; i < 128; i++) { ++ spl = sorted_alaw[i << 1]; ++ if (dsp_options & DSP_OPT_ULAW) ++ spl = dsp_audio_alaw_to_ulaw[spl]; ++ dsp_audio_seven2law[i] = spl; ++ } + } + + +@@ -475,60 +316,62 @@ + { + register s32 sample; + int i; ++ int num[] = { 110, 125, 150, 175, 200, 300, 400, 500 }; ++ int denum[] = { 100, 100, 100, 100, 100, 100, 100, 100 }; + + i = 0; + while(i < 256) { +- dsp_audio_reduce8[i] = dsp_audio_s16_to_law[(dsp_audio_law_to_s32[i]>>8) & 0xffff]; +- dsp_audio_reduce7[i] = dsp_audio_s16_to_law[(dsp_audio_law_to_s32[i]>>7) & 0xffff]; +- dsp_audio_reduce6[i] = dsp_audio_s16_to_law[(dsp_audio_law_to_s32[i]>>6) & 0xffff]; +- dsp_audio_reduce5[i] = dsp_audio_s16_to_law[(dsp_audio_law_to_s32[i]>>5) & 0xffff]; +- dsp_audio_reduce4[i] = dsp_audio_s16_to_law[(dsp_audio_law_to_s32[i]>>4) & 0xffff]; +- dsp_audio_reduce3[i] = dsp_audio_s16_to_law[(dsp_audio_law_to_s32[i]>>3) & 0xffff]; +- dsp_audio_reduce2[i] = dsp_audio_s16_to_law[(dsp_audio_law_to_s32[i]>>2) & 0xffff]; +- dsp_audio_reduce1[i] = dsp_audio_s16_to_law[(dsp_audio_law_to_s32[i]>>1) & 0xffff]; +- sample = dsp_audio_law_to_s32[i] << 1; ++ dsp_audio_reduce8[i] = dsp_audio_s16_to_law[(dsp_audio_law_to_s32[i] * denum[7] / num[7] ) & 0xffff]; ++ dsp_audio_reduce7[i] = dsp_audio_s16_to_law[(dsp_audio_law_to_s32[i] * denum[6] / num[6]) & 0xffff]; ++ dsp_audio_reduce6[i] = dsp_audio_s16_to_law[(dsp_audio_law_to_s32[i] * denum[5] / num[5]) & 0xffff]; ++ dsp_audio_reduce5[i] = dsp_audio_s16_to_law[(dsp_audio_law_to_s32[i] * denum[4] / num[4]) & 0xffff]; ++ dsp_audio_reduce4[i] = dsp_audio_s16_to_law[(dsp_audio_law_to_s32[i] * denum[3] / num[3]) & 0xffff]; ++ dsp_audio_reduce3[i] = dsp_audio_s16_to_law[(dsp_audio_law_to_s32[i] * denum[2] / num[2]) & 0xffff]; ++ dsp_audio_reduce2[i] = dsp_audio_s16_to_law[(dsp_audio_law_to_s32[i] * denum[1] / num[1]) & 0xffff]; ++ dsp_audio_reduce1[i] = dsp_audio_s16_to_law[(dsp_audio_law_to_s32[i] * denum[0] / num[0]) & 0xffff]; ++ sample = dsp_audio_law_to_s32[i] * num[0] / denum[0]; + if (sample < -32768) + sample = -32768; + else if (sample > 32767) + sample = 32767; + dsp_audio_increase1[i] = dsp_audio_s16_to_law[sample & 0xffff]; +- sample = dsp_audio_law_to_s32[i] << 2; ++ sample = dsp_audio_law_to_s32[i] * num[1] / denum[1]; + if (sample < -32768) + sample = -32768; + else if (sample > 32767) + sample = 32767; + dsp_audio_increase2[i] = dsp_audio_s16_to_law[sample & 0xffff]; +- sample = dsp_audio_law_to_s32[i] << 3; ++ sample = dsp_audio_law_to_s32[i] * num[2] / denum[2]; + if (sample < -32768) + sample = -32768; + else if (sample > 32767) + sample = 32767; + dsp_audio_increase3[i] = dsp_audio_s16_to_law[sample & 0xffff]; +- sample = dsp_audio_law_to_s32[i] << 4; ++ sample = dsp_audio_law_to_s32[i] * num[3] / denum[3]; + if (sample < -32768) + sample = -32768; + else if (sample > 32767) + sample = 32767; + dsp_audio_increase4[i] = dsp_audio_s16_to_law[sample & 0xffff]; +- sample = dsp_audio_law_to_s32[i] << 5; ++ sample = dsp_audio_law_to_s32[i] * num[4] / denum[4]; + if (sample < -32768) + sample = -32768; + else if (sample > 32767) + sample = 32767; + dsp_audio_increase5[i] = dsp_audio_s16_to_law[sample & 0xffff]; +- sample = dsp_audio_law_to_s32[i] << 6; ++ sample = dsp_audio_law_to_s32[i] * num[5] / denum[5]; + if (sample < -32768) + sample = -32768; + else if (sample > 32767) + sample = 32767; + dsp_audio_increase6[i] = dsp_audio_s16_to_law[sample & 0xffff]; +- sample = dsp_audio_law_to_s32[i] << 7; ++ sample = dsp_audio_law_to_s32[i] * num[6] / denum[6]; + if (sample < -32768) + sample = -32768; + else if (sample > 32767) + sample = 32767; + dsp_audio_increase7[i] = dsp_audio_s16_to_law[sample & 0xffff]; +- sample = dsp_audio_law_to_s32[i] << 8; ++ sample = dsp_audio_law_to_s32[i] * num[7] / denum[7]; + if (sample < -32768) + sample = -32768; + else if (sample > 32767) Added: trunk/package/mqueue-isdn/mISDN_oslec_patch_v1.1.5_rowe =================================================================== --- trunk/package/mqueue-isdn/mISDN_oslec_patch_v1.1.5_rowe (rev 0) +++ trunk/package/mqueue-isdn/mISDN_oslec_patch_v1.1.5_rowe 2007-11-28 10:21:29 UTC (rev 1397) @@ -0,0 +1,3504 @@ +diff -ruN mISDN-orig/drivers/isdn/hardware/mISDN/dsp_cancel.c mISDN/drivers/isdn/hardware/mISDN/dsp_cancel.c +--- mISDN-orig/drivers/isdn/hardware/mISDN/dsp_cancel.c 2007-07-02 19:01:34.000000000 +0930 ++++ mISDN/drivers/isdn/hardware/mISDN/dsp_cancel.c 2007-09-16 01:31:20.000000000 +0930 +@@ -52,6 +52,8 @@ + int bchdev_echocancel_activate(dsp_t* dev, int deftaps, int train); + void bchdev_echocancel_deactivate(dsp_t* dev); + ++static int samples; ++extern int sample_impulse; + + void + dsp_cancel_tx(dsp_t *dsp, u8 *data, int len) +@@ -60,6 +62,23 @@ + if (!data) return; + + if (dsp->txbuflen + len < ECHOCAN_BUFLEN) { ++ ++ /* Start Zaptap code -----------------------------------------*/ ++ ++ if (sample_impulse) { ++ int x; ++ for (x=0;x<len;x++) { ++ if (samples++ == 1000) { ++ data[0] = dsp_audio_s16_to_law[10000]; ++ samples = 0; ++ } ++ else ++ data[x] = dsp_audio_s16_to_law[0]; ++ } ++ } ++ ++ /* End Zaptap code -----------------------------------------*/ ++ + memcpy(&dsp->txbuf[dsp->txbuflen],data,len); + dsp->txbuflen+=len; + } else { +@@ -152,6 +171,7 @@ + + //printk("Enabling EC\n"); + dsp->cancel_enable = 1; ++ samples = 0; + return(0); + } + +@@ -301,6 +321,10 @@ + dev->ecdis_wr = NULL; + } + ++extern int ec_debug; ++void sample_echo_before(int channo, short rxlin, short txlin); ++void sample_echo_after(int channo, short rxlin); ++ + /** Processes one TX- and one RX-packet with echocancellation */ + void bchdev_echocancel_chunk(dsp_t* ss, uint8_t *rxchunk, uint8_t *txchunk, uint16_t size) + { +@@ -338,10 +362,16 @@ + } + } else { + for (x=0;x<size;x++) { ++ if (ec_debug & 0x2) { + rxlin = dsp_audio_law_to_s32[rxchunk[x]&0xff]; + txlin = dsp_audio_law_to_s32[txchunk[x]&0xff]; +- rxlin = echo_can_update(ss->ec, txlin, rxlin); ++ if (ec_debug & 0x4) { ++ sample_echo_before(1, rxlin, txlin); ++ rxlin = echo_can_update(ss->ec, txlin, rxlin); ++ sample_echo_after(1, rxlin); ++ } + rxchunk[x] = dsp_audio_s16_to_law[rxlin &0xffff]; ++ } + } + } + } +diff -ruN mISDN-orig/drivers/isdn/hardware/mISDN/dsp_core.c mISDN/drivers/isdn/hardware/mISDN/dsp_core.c +--- mISDN-orig/drivers/isdn/hardware/mISDN/dsp_core.c 2007-07-02 19:01:34.000000000 +0930 ++++ mISDN/drivers/isdn/hardware/mISDN/dsp_core.c 2007-09-16 01:06:14.000000000 +0930 +@@ -174,6 +174,7 @@ + #include <linux/delay.h> + #include <linux/module.h> + #include <linux/vmalloc.h> ++#include <linux/proc_fs.h> + #include "core.h" + #include "layer1.h" + #include "helper.h" +@@ -183,6 +184,8 @@ + static char DSPName[] = "DSP"; + mISDNobject_t dsp_obj; + ++int ec_debug; ++ + static int debug = 0; + int dsp_debug; + static int options = 0; +@@ -210,6 +213,169 @@ + #endif + #endif + ++/* Zaptap code -----------------------------------------------------------*/ ++ ++#define SAMPLE_BUF_SZ 1000 ++#define SAMPLE_IDLE 0 ++#define SAMPLE_PING 1 ++#define SAMPLE_PONG 2 ++ ++DECLARE_WAIT_QUEUE_HEAD(sample_wait); ++static int sample_state = 0; ++int samples = 0; ++static short *psample; ++static short ping[3*SAMPLE_BUF_SZ]; ++static short pong[3*SAMPLE_BUF_SZ]; ++static int sample_ch = 1; ++int sample_impulse = 0; ++static int tmp1,tmp2; ++ ++void sample_echo_before(int channo, short rxlin, short txlin) { ++ ++ // Sample echo canceller signals ++ // Notes: ++ // 1. Samples are multiplexed in buffer: ++ // tx sample ++ // rx sample ++ // ec sample ++ // 2. We needs to sample rx here before echo can as it is ++ // overwritten. ++ ++ tmp1++; ++ tmp2 = channo; ++ if ((sample_state != SAMPLE_IDLE) && (channo == sample_ch)) { ++ *psample++ = txlin; ++ *psample++ = rxlin; ++ } ++} ++ ++void sample_echo_after(int channo, short rxlin) { ++ ++ if ((sample_state != SAMPLE_IDLE) && (channo == sample_ch)) { ++ ++ *psample++ = rxlin; ++ ++ // sample collection ping-pong buffer logic ++ ++ samples++; ++ if (samples >= SAMPLE_BUF_SZ) { ++ // time to swap buffers ++ samples = 0; ++ ++ if (sample_state == SAMPLE_PING) { ++ sample_state = SAMPLE_PONG; ++ psample = pong; ++ } ++ else { ++ sample_state = SAMPLE_PING; ++ psample = ping; ++ } ++ wake_up_interruptible(&sample_wait); ++ } ++ } ++} ++ ++/* end Zaptap code -----------------------------------------------------*/ ++ ++/* Zaptap code -----------------------------------------------------*/ ++ ++static int sample_open (struct inode *inode, struct file *file) { ++ printk("sample_open:\n"); ++ tmp1 = tmp2 = -1; ++ ++ psample = ping; ++ samples = 0; ++ sample_state = SAMPLE_PING; ++ ++ return 0; ++} ++ ++static int sample_release (struct inode *inode, struct file *file) { ++ printk("sample_release: tmp1 = %d tmp2 = %d\n", tmp1, tmp2); ++ ++ sample_state = SAMPLE_IDLE; ++ sample_impulse = 0; ++ samples = 0; ++ ++ return 0; ++} ++ ++static ssize_t sample_read(struct file *file, char *buf, ++ size_t count, loff_t *ppos) { ++ int err, len; ++ short *pread; ++ ++ /* wait for next buffer to be prepared by ISR, we read ++ alternate buffer just after transition. ++ */ ++ interruptible_sleep_on(&sample_wait); ++ ++ if (sample_state == SAMPLE_PING) { ++ pread = pong; ++ } ++ else { ++ pread = ping; ++ } ++ ++ len = 3*sizeof(short)*SAMPLE_BUF_SZ; ++ err = copy_to_user(buf, pread, len); ++ ++ if (err != 0) ++ return -EFAULT; ++ ++ return len; ++} ++ ++/* ioctls for sample */ ++ ++#define SAMPLE_SET_CHANNEL 0 ++#define SAMPLE_TX_IMPULSE 1 ++ ++static int sample_ioctl(struct inode *inode, struct file *file, ++ unsigned int cmd, unsigned long arg) { ++ int retval = 0; ++ ++ switch ( cmd ) { ++ case SAMPLE_SET_CHANNEL: ++ if (copy_from_user(&sample_ch, (int *)arg, sizeof(int))) ++ return -EFAULT; ++ printk("sample_ioctl: sample_ch = %d\n", sample_ch); ++ break; ++ case SAMPLE_TX_IMPULSE: ++ sample_impulse = 1; ++ printk("sample_ioctl: under impulse power\n"); ++ break; ++ default: ++ retval = -EINVAL; ++ } ++ ++ return retval; ++} ++ ++// define which file operations are supported ++struct file_operations sample_fops = { ++ .owner = THIS_MODULE, ++ .llseek = NULL, ++ .read = sample_read, ++ .write = NULL, ++ .readdir= NULL, ++ .poll = NULL, ++ .ioctl = sample_ioctl, ++ .mmap = NULL, ++ .open = sample_open, ++ .flush = NULL, ++ .release= sample_release, ++ .fsync = NULL, ++ .fasync = NULL, ++ .lock = NULL, ++ ++ ++}; ++ ++#define SAMPLE_NAME "sample" ++#define SAMPLE_MAJOR 34 ++ ++/* end Zaptap code -----------------------------------------------------*/ + + /* + * special message process for DL_CONTROL | REQUEST +@@ -462,7 +628,7 @@ + if (dsp->tx_volume) + dsp_change_volume(skb, dsp->tx_volume); + /* cancel echo */ +- if (dsp->cancel_enable) ++ if (dsp->cancel_enable && ec_debug) + dsp_cancel_tx(dsp, skb->data, skb->len); + /* crypt */ + if (dsp->bf_enable) +@@ -570,7 +736,7 @@ + if (dsp->bf_enable) + dsp_bf_decrypt(dsp, skb->data, skb->len); + /* if echo cancellation is enabled */ +- if (dsp->cancel_enable) ++ if (dsp->cancel_enable && ec_debug) + dsp_cancel_rx(dsp, skb->data, skb->len); + /* check if dtmf soft decoding is turned on */ + if (dsp->dtmf.software) { +@@ -960,6 +1126,27 @@ + return(ret); + } + ++static int proc_read_debug(char *buf, char **start, off_t offset, ++ int count, int *eof, void *data) ++{ ++ int len; ++ ++ *eof = 1; ++ ++ len = sprintf(buf, "%d\n", ec_debug); ++ return len; ++} ++ ++ ++static int proc_write_debug(struct file *file, const char *buffer, ++ unsigned long count, void *data) ++{ ++ ++ char *endbuffer; ++ ++ ec_debug = simple_strtol (buffer, &endbuffer, 10); ++ return count; ++} + + /* + * initialize DSP object +@@ -1013,6 +1200,7 @@ + INIT_LIST_HEAD(&dsp_obj.ilist); + + /* initialize audio tables */ ++ dsp_audio_generate_law_tables(); + dsp_silence = (dsp_options&DSP_OPT_ULAW)?0xff:0x2a; + dsp_audio_law_to_s32 = (dsp_options&DSP_OPT_ULAW)?dsp_audio_ulaw_to_s32:dsp_audio_alaw_to_s32; + dsp_audio_generate_s2law_table(); +@@ -1037,7 +1225,34 @@ + add_timer(&dsp_spl_tl); + + mISDN_module_register(THIS_MODULE); ++ ++ /* proc interface for debugging echo can noise */ ++ ++ { ++ struct proc_dir_entry *proc_misdn, *proc_debug; ++ ++ printk("dsp_core.c: Creating /proc/misdn debug interface\n"); ++ ++ proc_misdn = proc_mkdir("misdn", 0); ++ proc_debug = create_proc_read_entry("misdn/debug", 0, NULL, proc_read_debug, NULL); ++ proc_debug->write_proc = proc_write_debug; ++ } + ++ /* start Zaptap code ----------------------------------------*/ ++ ++ { ++ int res; ++ sample_state = SAMPLE_IDLE; ++ sample_impulse = 0; ++ if ((res = register_chrdev (SAMPLE_MAJOR, SAMPLE_NAME, &sample_fops))) { ++ printk(KERN_ERR "Zaptap unable to register %s char driver on %d\n", SAMPLE_NAME, SAMPLE_MAJOR); ++ return res; ++ } ++ } ++ printk("Registered %s char driver on major %d\n", SAMPLE_NAME, SAMPLE_MAJOR); ++ ++ /* end Zaptap code ------------------------------------------*/ ++ + return(0); + } + +@@ -1050,6 +1265,13 @@ + dsp_t *dspl, *nd; + int err; + ++ unregister_chrdev (SAMPLE_MAJOR, SAMPLE_NAME); /* Zaptap code */ ++ ++ { ++ remove_proc_entry("misdn/debug", NULL); ++ remove_proc_entry("misdn", NULL); ++ } ++ + mISDN_module_unregister(THIS_MODULE); + + if (timer_pending(&dsp_spl_tl)) +diff -ruN mISDN-orig/drivers/isdn/hardware/mISDN/dsp_core.c.orig mISDN/drivers/isdn/hardware/mISDN/dsp_core.c.orig +--- mISDN-orig/drivers/isdn/hardware/mISDN/dsp_core.c.orig 1970-01-01 09:30:00.000000000 +0930 ++++ mISDN/drivers/isdn/hardware/mISDN/dsp_core.c.orig 2007-09-15 00:22:16.000000000 +0930 +@@ -0,0 +1,1120 @@ ++/* $Id: dsp_core.c,v 1.29 2007/03/27 15:06:29 jolly Exp $ ++ * ++ * Author Andreas Eversberg (jo...@ev...) ++ * Based on source code structure by ++ * Karsten Keil (ke...@is...) ++ * ++ * This file is (c) under GNU PUBLIC LICENSE ++ * For changes and modifications please read ++ * ../../../Documentation/isdn/mISDN.cert ++ * ++ * Thanks to Karsten Keil (great drivers) ++ * Cologne Chip (great chips) ++ * ++ * This module does: ++ * Real-time tone generation ++ * DTMF detection ++ * Real-time cross-connection and conferrence ++ * Compensate jitter due to system load and hardware fault. ++ * All features are done in kernel space and will be realized ++ * using hardware, if available and supported by chip set. ++ * Blowfish encryption/decryption ++ */ ++ ++/* STRUCTURE: ++ * ++ * The dsp module provides layer 2 for b-channels (64kbit). It provides ++ * transparent audio forwarding with special digital signal processing: ++ * ++ * - (1) generation of tones ++ * - (2) detection of dtmf tones ++ * - (3) crossconnecting and conferences ++ * - (4) echo generation for delay test ++ * - (5) volume control ++ * - (6) disable receive data ++ * - (7) echo cancelation ++ * - (8) encryption/decryption ++ * ++ * Look: ++ * TX RX ++ * ------upper layer------ ++ * | ^ ++ * | |(6) ++ * v | ++ * +-----+-------------+-----+ ++ * |(3)(4) | ++ * | CMX | ++ * | | ++ * | +-------------+ ++ * | | ^ ++ * | | | ++ * |+---------+| +----+----+ ++ * ||(1) || |(5) | ++ * || || | | ++ * || Tones || |RX Volume| ++ * || || | | ++ * || || | | ++ * |+----+----+| +----+----+ ++ * +-----+-----+ ^ ++ * | | ++ * v | ++ * +----+----+ +----+----+ ++ * |(5) | |(2) | ++ * | | | | ++ * |TX Volume| | DTMF | ++ * | | | | ++ * | | | | ++ * +----+----+ +----+----+ ++ * | ^ ++ * | | ++ * v | ++ * +----+-------------+----+ ++ * |(7) | ++ * | | ++ * | Echo Cancellation | ++ * | | ++ * | | ++ * +----+-------------+----+ ++ * | ^ ++ * | | ++ * v | ++ * +----+----+ +----+----+ ++ * |(8) | |(8) | ++ * | | | | ++ * | Encrypt | | Decrypt | ++ * | | | | ++ * | | | | ++ * +----+----+ +----+----+ ++ * | ^ ++ * | | ++ * v | ++ * ------card layer------ ++ * TX RX ++ * ++ * Above you can see the logical data flow. If software is used to do the ++ * process, it is actually the real data flow. If hardware is used, data ++ * may not flow, but hardware commands to the card, to provide the data flow ++ * as shown. ++ * ++ * NOTE: The channel must be activated in order to make dsp work, even if ++ * no data flow to the upper layer is intended. Activation can be done ++ * after and before controlling the setting using PH_CONTROL requests. ++ * ++ * DTMF: Will be detected by hardware if possible. It is done before CMX ++ * processing. ++ * ++ * Tones: Will be generated via software if endless looped audio fifos are ++ * not supported by hardware. Tones will override all data from CMX. ++ * It is not required to join a conference to use tones at any time. ++ * ++ * CMX: Is transparent when not used. When it is used, it will do ++ * crossconnections and conferences via software if not possible through ++ * hardware. If hardware capability is available, hardware is used. ++ * ++ * Echo: Is generated by CMX and is used to check performane of hard and ++ * software CMX. ++ * ++ * The CMX has special functions for conferences with one, two and more ++ * members. It will allow different types of data flow. Receive and transmit ++ * data to/form upper layer may be swithed on/off individually without loosing ++ * features of CMX, Tones and DTMF. ++ * ++ * Echo Cancellation: Sometimes we like to cancel echo from the interface. ++ * Note that a VoIP call may not have echo caused by the IP phone. The echo ++ * is generated by the telephone line connected to it. Because the delay ++ * is high, it becomes an echo. RESULT: Echo Cachelation is required if ++ * both echo AND delay is applied to an interface. ++ * Remember that software CMX always generates a more or less delay. ++ * ++ * If all used features can be realized in hardware, and if transmit and/or ++ * receive data ist disabled, the card may not send/receive any data at all. ++ * Not receiving is usefull if only announcements are played. Not sending is ++ * usefull if an answering machine records audio. Not sending and receiving is ++ * usefull during most states of the call. If supported by hardware, tones ++ * will be played without cpu load. Small PBXs and NT-Mode applications will ++ * not need expensive hardware when processing calls. ++ * ++ * ++ * LOCKING: ++ * ++ * When data is received from upper or lower layer (card), the complete dsp ++ * module is locked by a global lock. When data is ready to be transmitted ++ * to a different layer, the module is unlocked. It is not allowed to hold a ++ * lock outside own layer. ++ * Reasons: Multiple threads must not process cmx at the same time, if threads ++ * serve instances, that are connected in same conference. ++ * PH_CONTROL must not change any settings, join or split conference members ++ * during process of data. ++ * ++ * ++ * TRANSMISSION: ++ * ++ ++TBD ++ ++There are three things that need to receive data from card: ++ - software DTMF decoder ++ - software cmx (if conference exists) ++ - upper layer, if rx-data not disabled ++ ++Whenever dtmf decoder is turned on or off, software cmx changes, rx-data is disabled or enabled, or card becomes activated, then rx-data is disabled or enabled using a special command to the card. ++ ++There are three things that need to transmit data to card: ++ - software tone generation (part of cmx) ++ - software cmx ++ - upper layer, if tx-data is written to tx-buffer ++ ++ ++ ++ ++ */ ++ ++const char *dsp_revision = "$Revision: 1.29 $"; ++ ++#include <linux/delay.h> ++#include <linux/module.h> ++#include <linux/vmalloc.h> ++#include <linux/proc_fs.h> ++#include "core.h" ++#include "layer1.h" ++#include "helper.h" ++#include "debug.h" ++#include "dsp.h" ++ ++static char DSPName[] = "DSP"; ++mISDNobject_t dsp_obj; ++ ++int ec_debug; ++ ++static int debug = 0; ++int dsp_debug; ++static int options = 0; ++int dsp_options; ++static int poll = 0; ++int dsp_poll, dsp_tics; ++ ++int dtmfthreshold=100L; ++ ++#ifdef MODULE ++MODULE_AUTHOR("Andreas Eversberg"); ++#ifdef OLD_MODULE_PARAM ++MODULE_PARM(debug, "1i"); ++MODULE_PARM(options, "1i"); ++MODULE_PARM(poll, "1i"); ++MODULE_PARM(dtmfthreshold, "1i"); ++#else ++module_param(debug, uint, S_IRUGO | S_IWUSR); ++module_param(options, uint, S_IRUGO | S_IWUSR); ++module_param(poll, uint, S_IRUGO | S_IWUSR); ++module_param(dtmfthreshold, uint, S_IRUGO | S_IWUSR); ++#endif ++#ifdef MODULE_LICENSE ++MODULE_LICENSE("GPL"); ++#endif ++#endif ++ ++ ++/* ++ * special message process for DL_CONTROL | REQUEST ++ */ ++static int ++dsp_control_req(dsp_t *dsp, mISDN_head_t *hh, struct sk_buff *skb) ++{ ++ struct sk_buff *nskb; ++ int ret = 0; ++ int cont; ++ u8 *data; ++ int len; ++ ++ if (skb->len < sizeof(int)) { ++ printk(KERN_ERR "%s: PH_CONTROL message too short\n", __FUNCTION__); ++ } ++ cont = *((int *)skb->data); ++ len = skb->len - sizeof(int); ++ data = skb->data + sizeof(int); ++ ++ switch (cont) { ++ case DTMF_TONE_START: /* turn on DTMF */ ++ if (dsp_debug & DEBUG_DSP_CORE) ++ printk(KERN_DEBUG "%s: start dtmf\n", __FUNCTION__); ++#if 0 ++ if (len == sizeof(int)) { ++ printk(KERN_NOTICE "changing DTMF Threshold to %d\n",*((int*)data)); ++ dsp->dtmf.treshold=(*(int*)data)*10000; ++ } ++#endif ++ ++ dsp_dtmf_goertzel_init(dsp); ++ /* checking for hardware capability */ ++ if (dsp->features.hfc_dtmf) { ++ dsp->dtmf.hardware = 1; ++ dsp->dtmf.software = 0; ++ } else { ++ dsp->dtmf.hardware = 0; ++ dsp->dtmf.software = 1; ++ } ++ break; ++ case DTMF_TONE_STOP: /* turn off DTMF */ ++ if (dsp_debug & DEBUG_DSP_CORE) ++ printk(KERN_DEBUG "%s: stop dtmf\n", __FUNCTION__); ++ dsp->dtmf.hardware = 0; ++ dsp->dtmf.software = 0; ++ break; ++ case CMX_CONF_JOIN: /* join / update conference */ ++ if (len != sizeof(int)) { ++ ret = -EINVAL; ++ break; ++ } ++ if (*((u32 *)data) == 0) ++ goto conf_split; ++ if (dsp_debug & DEBUG_DSP_CORE) ++ printk(KERN_DEBUG "%s: join conference %d\n", __FUNCTION__, *((u32 *)data)); ++ ret = dsp_cmx_conf(dsp, *((u32 *)data)); ++ if (dsp_debug & DEBUG_DSP_CMX) ++ dsp_cmx_debug(dsp); ++ break; ++ case CMX_CONF_SPLIT: /* remove from conference */ ++ conf_split: ++ if (dsp_debug & DEBUG_DSP_CORE) ++ printk(KERN_DEBUG "%s: release conference\n", __FUNCTION__); ++ ret = dsp_cmx_conf(dsp, 0); ++ if (dsp_debug & DEBUG_DSP_CMX) ++ dsp_cmx_debug(dsp); ++ break; ++ case TONE_PATT_ON: /* play tone */ ++ if (len != sizeof(int)) { ++ ret = -EINVAL; ++ break; ++ } ++ if (dsp_debug & DEBUG_DSP_CORE) ++ printk(KERN_DEBUG "%s: turn tone 0x%x on\n", __FUNCTION__, *((int *)skb->data)); ++ ret = dsp_tone(dsp, *((int *)data)); ++ if (!ret) ++ dsp_cmx_hardware(dsp->conf, dsp); ++ if (!dsp->tone.tone) ++ goto tone_off; ++ break; ++ case TONE_PATT_OFF: /* stop tone */ ++ if (dsp_debug & DEBUG_DSP_CORE) ++ printk(KERN_DEBUG "%s: turn tone off\n", __FUNCTION__); ++ dsp_tone(dsp, 0); ++ dsp_cmx_hardware(dsp->conf, dsp); ++ /* reset tx buffers (user space data) */ ++ tone_off: ++ dsp->tx_R = dsp->tx_W = 0; ++ break; ++ case VOL_CHANGE_TX: /* change volume */ ++ if (len != sizeof(int)) { ++ ret = -EINVAL; ++ break; ++ } ++ dsp->tx_volume = *((int *)data); ++ if (dsp_debug & DEBUG_DSP_CORE) ++ printk(KERN_DEBUG "%s: change tx volume to %d\n", __FUNCTION__, dsp->tx_volume); ++ dsp_cmx_hardware(dsp->conf, dsp); ++ break; ++ case VOL_CHANGE_RX: /* change volume */ ++ if (len != sizeof(int)) { ++ ret = -EINVAL; ++ break; ++ } ++ dsp->rx_volume = *((int *)data); ++ if (dsp_debug & DEBUG_DSP_CORE) ++ printk(KERN_DEBUG "%s: change rx volume to %d\n", __FUNCTION__, dsp->tx_volume); ++ dsp_cmx_hardware(dsp->conf, dsp); ++ break; ++ case CMX_ECHO_ON: /* enable echo */ ++ dsp->echo = 1; /* soft echo */ ++ if (dsp_debug & DEBUG_DSP_CORE) ++ printk(KERN_DEBUG "%s: enable cmx-echo\n", __FUNCTION__); ++ dsp_cmx_hardware(dsp->conf, dsp); ++ if (dsp_debug & DEBUG_DSP_CMX) ++ dsp_cmx_debug(dsp); ++ break; ++ case CMX_ECHO_OFF: /* disable echo */ ++ dsp->echo = 0; ++ if (dsp_debug & DEBUG_DSP_CORE) ++ printk(KERN_DEBUG "%s: disable cmx-echo\n", __FUNCTION__); ++ dsp_cmx_hardware(dsp->conf, dsp); ++ if (dsp_debug & DEBUG_DSP_CMX) ++ dsp_cmx_debug(dsp); ++ break; ++ case CMX_RECEIVE_ON: /* enable receive to user space */ ++ if (dsp_debug & DEBUG_DSP_CORE) ++ printk(KERN_DEBUG "%s: enable receive to user space\n", __FUNCTION__); ++ dsp->rx_disabled = 0; ++ dsp_cmx_hardware(dsp->conf, dsp); ++ break; ++ case CMX_RECEIVE_OFF: /* disable receive to user space */ ++ if (dsp_debug & DEBUG_DSP_CORE) ++ printk(KERN_DEBUG "%s: disable receive to user space\n", __FUNCTION__); ++ dsp->rx_disabled = 1; ++ dsp_cmx_hardware(dsp->conf, dsp); ++ break; ++ case CMX_MIX_ON: /* enable mixing of transmit data with conference members */ ++ if (dsp_debug & DEBUG_DSP_CORE) ++ printk(KERN_DEBUG "%s: enable mixing of tx-data with conf mebers\n", __FUNCTION__); ++ dsp->tx_mix = 1; ++ dsp_cmx_hardware(dsp->conf, dsp); ++ if (dsp_debug & DEBUG_DSP_CMX) ++ dsp_cmx_debug(dsp); ++ break; ++ case CMX_MIX_OFF: /* disable mixing of transmit data with conference members */ ++ if (dsp_debug & DEBUG_DSP_CORE) ++ printk(KERN_DEBUG "%s: disable mixing of tx-data with conf mebers\n", __FUNCTION__); ++ dsp->tx_mix = 0; ++ dsp_cmx_hardware(dsp->conf, dsp); ++ if (dsp_debug & DEBUG_DSP_CMX) ++ dsp_cmx_debug(dsp); ++ break; ++ case ECHOCAN_ON: /* turn echo calcellation on */ ++ if (len<4) { ++ ret = -EINVAL; ++ } else { ++ int ec_arr[2]; ++ memcpy(&ec_arr,data,sizeof(ec_arr)); ++ if (dsp_debug & DEBUG_DSP_CORE) ++ printk(KERN_DEBUG "%s: turn echo cancelation on (delay=%d attenuation-shift=%d\n", ++ __FUNCTION__, ec_arr[0], ec_arr[1]); ++ ++ ret = dsp_cancel_init(dsp, ec_arr[0], ec_arr[1] ,1); ++ dsp_cmx_hardware(dsp->conf, dsp); ++ } ++ break; ++ case ECHOCAN_OFF: /* turn echo calcellation off */ ++ if (dsp_debug & DEBUG_DSP_CORE) ++ printk(KERN_DEBUG "%s: turn echo cancelation off\n", __FUNCTION__); ++ ++ ret = dsp_cancel_init(dsp, 0,0,-1); ++ dsp_cmx_hardware(dsp->conf, dsp); ++ break; ++ case BF_ENABLE_KEY: /* turn blowfish on */ ++ if (len<4 || len>56) { ++ ret = -EINVAL; ++ break; ++ } ++ if (dsp_debug & DEBUG_DSP_CORE) ++ printk(KERN_DEBUG "%s: turn blowfish on (key not shown)\n", __FUNCTION__); ++ ret = dsp_bf_init(dsp, (u8*)data, len); ++ /* set new cont */ ++ if (!ret) ++ cont = BF_ACCEPT; ++ else ++ cont = BF_REJECT; ++ /* send indication if it worked to set it */ ++ nskb = create_link_skb(PH_CONTROL | INDICATION, 0, sizeof(int), &cont, 0); ++ if (mISDN_queue_up(&dsp->inst, 0, nskb)) ++ dev_kfree_skb(nskb); ++ if (!ret) ++ dsp_cmx_hardware(dsp->conf, dsp); ++ break; ++ case BF_DISABLE: /* turn blowfish off */ ++ if (dsp_debug & DEBUG_DSP_CORE) ++ printk(KERN_DEBUG "%s: turn blowfish off\n", __FUNCTION__); ++ dsp_bf_cleanup(dsp); ++ dsp_cmx_hardware(dsp->conf, dsp); ++ break; ++ default: ++ if (dsp_debug & DEBUG_DSP_CORE) ++ printk(KERN_DEBUG "%s: ctrl req %x unhandled\n", __FUNCTION__, cont); ++ ret = -EINVAL; ++ } ++ if (!ret) ++ dev_kfree_skb(skb); ++ return(ret); ++} ++ ++ ++/* ++ * messages from upper layers ++ */ ++static int ++dsp_from_up(mISDNinstance_t *inst, struct sk_buff *skb) ++{ ++ dsp_t *dsp; ++ mISDN_head_t *hh; ++ int ret = 0; ++ u_long flags; ++ ++ if (!skb) ++ return(-EINVAL); ++ dsp = inst->privat; ++ if (!dsp) { ++ return(-EIO); ++ } ++ ++ hh = mISDN_HEAD_P(skb); ++ switch(hh->prim) { ++ case DL_DATA | RESPONSE: ++ case PH_DATA | RESPONSE: ++ /* ignore response */ ++ dev_kfree_skb(skb); ++ break; ++ case DL_DATA | REQUEST: ++ case PH_DATA | REQUEST: ++ if (skb->len < 1) ++ return(-EINVAL); ++ ++ if (!dsp->conf_id) { ++ /* PROCESS TONES/TX-DATA ONLY */ ++ if (dsp->tone.tone) { ++ /* -> copy tone */ ++ dsp_tone_copy(dsp, skb->data, skb->len); ++ } ++ ++ if (dsp->tx_volume) ++ dsp_change_volume(skb, dsp->tx_volume); ++ /* cancel echo */ ++ if (dsp->cancel_enable && ec_debug) ++ dsp_cancel_tx(dsp, skb->data, skb->len); ++ /* crypt */ ++ if (dsp->bf_enable) ++ dsp_bf_encrypt(dsp, skb->data, skb->len); ++ /* send packet */ ++ if (mISDN_queue_down(&dsp->inst, 0, skb)) { ++ dev_kfree_skb(skb); ++ printk(KERN_ERR "%s: failed to send tx-packet\n", __FUNCTION__); ++ ++ return (-EIO); ++ } ++ ++ } else { ++ if (dsp->features.pcm_id>=0) { ++ printk("Not sending Data to CMX -- > returning because of HW bridge\n"); ++ dev_kfree_skb(skb); ++ break; ++ } ++ /* send data to tx-buffer (if no tone is played) */ ++ spin_lock_irqsave(&dsp_obj.lock, flags); ++ if (!dsp->tone.tone) { ++ dsp_cmx_transmit(dsp, skb); ++ } ++ spin_unlock_irqrestore(&dsp_obj.lock, flags); ++ ++ dev_kfree_skb(skb); ++ } ++ break; ++ case PH_CONTROL | REQUEST: ++ ++ spin_lock_irqsave(&dsp_obj.lock, flags); ++ ret = dsp_control_req(dsp, hh, skb); ++ spin_unlock_irqrestore(&dsp_obj.lock, flags); ++ ++ break; ++ case DL_ESTABLISH | REQUEST: ++ case PH_ACTIVATE | REQUEST: ++ if (dsp_debug & DEBUG_DSP_CORE) ++ printk(KERN_DEBUG "%s: activating b_channel %s\n", __FUNCTION__, dsp->inst.name); ++ ++ if (dsp->dtmf.hardware || dsp->dtmf.software) ++ dsp_dtmf_goertzel_init(dsp); ++ hh->prim = PH_ACTIVATE | REQUEST; ++ ret = mISDN_queue_down(&dsp->inst, 0, skb); ++ ++ break; ++ case DL_RELEASE | REQUEST: ++ case PH_DEACTIVATE | REQUEST: ++ if (dsp_debug & DEBUG_DSP_CORE) ++ printk(KERN_DEBUG "%s: releasing b_channel %s\n", __FUNCTION__, dsp->inst.name); ++ ++ dsp->tone.tone = dsp->tone.hardware = dsp->tone.software = 0; ++ if (timer_pending(&dsp->tone.tl)) ++ del_timer(&dsp->tone.tl); ++ hh->prim = PH_DEACTIVATE | REQUEST; ++ ret = mISDN_queue_down(&dsp->inst, 0, skb); ++ ++ break; ++ default: ++ if (dsp_debug & DEBUG_DSP_CORE) ++ printk(KERN_DEBUG "%s: msg %x unhandled %s\n", __FUNCTION__, hh->prim, dsp->inst.name); ++ ret = -EINVAL; ++ break; ++ } ++ return(ret); ++} ++ ++ ++/* ++ * messages from lower layers ++ */ ++static int ++dsp_from_down(mISDNinstance_t *inst, struct sk_buff *skb) ++{ ++ dsp_t *dsp; ++ mISDN_head_t *hh; ++ int ret = 0; ++ u8 *digits; ++ int cont; ++ struct sk_buff *nskb; ++ u_long flags; ++ ++ if (!skb) ++ return(-EINVAL); ++ dsp = inst->privat; ++ if (!dsp) ++ return(-EIO); ++ ++ hh = mISDN_HEAD_P(skb); ++ switch(hh->prim) ++ { ++ case PH_DATA | CONFIRM: ++ case DL_DATA | CONFIRM: ++ /* flush response, because no relation to upper layer */ ++ dev_kfree_skb(skb); ++ break; ++ case PH_DATA | INDICATION: ++ case DL_DATA | INDICATION: ++ if (skb->len < 1) ++ return(-EINVAL); ++ ++ ++ ++ /* decrypt if enabled */ ++ if (dsp->bf_enable) ++ dsp_bf_decrypt(dsp, skb->data, skb->len); ++ /* if echo cancellation is enabled */ ++ if (dsp->cancel_enable && ec_debug) ++ dsp_cancel_rx(dsp, skb->data, skb->len); ++ /* check if dtmf soft decoding is turned on */ ++ if (dsp->dtmf.software) { ++ digits = dsp_dtmf_goertzel_decode(dsp, skb->data, skb->len, (dsp_options&DSP_OPT_ULAW)?1:0); ++ if (digits) while(*digits) { ++ if (dsp_debug & DEBUG_DSP_DTMF) ++ printk(KERN_DEBUG "%s: sending software decoded digit(%c) to upper layer %s\n", __FUNCTION__, *digits, dsp->inst.name); ++ cont = DTMF_TONE_VAL | *digits; ++ nskb = create_link_skb(PH_CONTROL | INDICATION, 0, sizeof(int), &cont, 0); ++ if (mISDN_queue_up(&dsp->inst, 0, nskb)) ++ dev_kfree_skb(nskb); ++ digits++; ++ } ++ } ++ /* change volume if requested */ ++ if (dsp->rx_volume) ++ dsp_change_volume(skb, dsp->rx_volume); ++ ++ if (dsp->conf_id) { ++ /* we need to process receive data if software */ ++ spin_lock_irqsave(&dsp_obj.lock, flags); ++ if (dsp->pcm_slot_tx<0 && dsp->pcm_slot_rx<0) { ++ /* process data from card at cmx */ ++ dsp_cmx_receive(dsp, skb); ++ } ++ spin_unlock_irqrestore(&dsp_obj.lock, flags); ++ } ++ ++ if (dsp->rx_disabled) { ++ /* if receive is not allowed */ ++ dev_kfree_skb(skb); ++ ++ break; ++ } ++ hh->prim = DL_DATA | INDICATION; ++ ret = mISDN_queue_up(&dsp->inst, 0, skb); ++ ++ break; ++ case PH_CONTROL | INDICATION: ++ ++ if (dsp_debug & DEBUG_DSP_DTMFCOEFF) ++ printk(KERN_DEBUG "%s: PH_CONTROL received: %x (len %d) %s\n", __FUNCTION__, hh->dinfo, skb->len, dsp->inst.name); ++ switch (hh->dinfo) { ++ case HW_HFC_COEFF: /* getting coefficients */ ++ if (!dsp->dtmf.hardware) { ++ if (dsp_debug & DEBUG_DSP_DTMFCOEFF) ++ printk(KERN_DEBUG "%s: ignoring DTMF coefficients from HFC\n", __FUNCTION__); ++ dev_kfree_skb(skb); ++ break; ++ } ++ digits = dsp_dtmf_goertzel_decode(dsp, skb->data, skb->len, 2); ++ if (digits) while(*digits) { ++ int k; ++ struct sk_buff *nskb; ++ if (dsp_debug & DEBUG_DSP_DTMF) ++ printk(KERN_DEBUG "%s: now sending software decoded digit(%c) to upper layer %s\n", __FUNCTION__, *digits, dsp->inst.name); ++ k = *digits | DTMF_TONE_VAL; ++ nskb = create_link_skb(PH_CONTROL | INDICATION, 0, sizeof(int), &k, 0); ++ if (mISDN_queue_up(&dsp->inst, 0, nskb)) ++ dev_kfree_skb(nskb); ++ digits++; ++ } ++ dev_kfree_skb(skb); ++ break; ++ ++ case VOL_CHANGE_TX: /* change volume */ ++ if (skb->len != sizeof(int)) { ++ ret = -EINVAL; ++ break; ++ } ++ dsp->tx_volume = *((int *)skb->data); ++ if (dsp_debug & DEBUG_DSP_CORE) ++ printk(KERN_DEBUG "%s: change tx volume to %d\n", __FUNCTION__, dsp... [truncated message content] |
From: <dha...@us...> - 2007-12-14 21:56:21
|
Revision: 1442 http://astlinux.svn.sourceforge.net/astlinux/?rev=1442&view=rev Author: dhartman Date: 2007-12-14 13:56:06 -0800 (Fri, 14 Dec 2007) Log Message: ----------- vim package from Philip. Still needs some work Modified Paths: -------------- trunk/package/Config.in Added Paths: ----------- trunk/package/vim/ trunk/package/vim/Config.in trunk/package/vim/vim-7.1-akira-cross.patch trunk/package/vim/vim.mk Modified: trunk/package/Config.in =================================================================== --- trunk/package/Config.in 2007-12-13 21:42:01 UTC (rev 1441) +++ trunk/package/Config.in 2007-12-14 21:56:06 UTC (rev 1442) @@ -183,6 +183,7 @@ source "package/usbutils/Config.in" source "package/util-linux/Config.in" source "package/valgrind/Config.in" +source "package/vim/Config.in" source "package/vsftpd/Config.in" source "package/vtun/Config.in" source "package/wanpipe/Config.in" Added: trunk/package/vim/Config.in =================================================================== --- trunk/package/vim/Config.in (rev 0) +++ trunk/package/vim/Config.in 2007-12-14 21:56:06 UTC (rev 1442) @@ -0,0 +1,7 @@ +config BR2_PACKAGE_VIM + bool "vim" + default n + help + As good a 'vi' clone as any. + + http://www.vim.org/ Added: trunk/package/vim/vim-7.1-akira-cross.patch =================================================================== --- trunk/package/vim/vim-7.1-akira-cross.patch (rev 0) +++ trunk/package/vim/vim-7.1-akira-cross.patch 2007-12-14 21:56:06 UTC (rev 1442) @@ -0,0 +1,506 @@ +diff -Nur vim71.orig/src/configure.in vim71/src/configure.in +--- vim71.orig/src/configure.in 2007-05-12 11:19:27.000000000 +0200 ++++ vim71/src/configure.in 2007-09-21 14:58:23.000000000 +0200 +@@ -47,13 +47,6 @@ + fi + fi + +-dnl If configure thinks we are cross compiling, there is probably something +-dnl wrong with the CC or CFLAGS settings, give an understandable error message +-if test "$cross_compiling" = yes; then +- AC_MSG_ERROR([cannot compile a simple program, check CC and CFLAGS +- (cross compiling doesn't work)]) +-fi +- + dnl gcc-cpp has the wonderful -MM option to produce nicer dependencies. + dnl But gcc 3.1 changed the meaning! See near the end. + test "$GCC" = yes && CPP_MM=M; AC_SUBST(CPP_MM) +@@ -1986,11 +1979,24 @@ + + dnl Checks for libraries and include files. + +-AC_MSG_CHECKING(quality of toupper) +-AC_TRY_RUN([#include <ctype.h> +-main() { exit(toupper('A') == 'A' && tolower('z') == 'z'); }], +- AC_DEFINE(BROKEN_TOUPPER) AC_MSG_RESULT(bad), +- AC_MSG_RESULT(good), AC_MSG_ERROR(failed to compile test program)) ++AC_CACHE_CHECK([toupper is broken],[vim_cv_toupper_broken], ++ [ ++ AC_RUN_IFELSE([ ++#include <ctype.h> ++main() { exit(toupper('A') == 'A' && tolower('z') == 'z'); } ++ ],[ ++ vim_cv_toupper_broken=yes ++ AC_MSG_RESULT(yes) ++ ],[ ++ vim_cv_toupper_broken=no ++ AC_MSG_RESULT(no) ++ ],[ ++ AC_MSG_ERROR(cross-compiling: please set 'vim_cv_toupper_broken') ++ ])]) ++ ++if test "x$vim_cv_toupper_broken" = "xyes" ; then ++ AC_DEFINE(BROKEN_TOUPPER) ++fi + + AC_MSG_CHECKING(whether __DATE__ and __TIME__ work) + AC_TRY_COMPILE(, [printf("(" __DATE__ " " __TIME__ ")");], +@@ -2202,28 +2208,52 @@ + Or specify the name of the library with --with-tlib.])) + fi + +-AC_MSG_CHECKING(whether we talk terminfo) +-AC_TRY_RUN([ ++AC_CACHE_CHECK([whether we talk terminfo], [vim_cv_terminfo], ++ [ ++ AC_RUN_IFELSE([ + #ifdef HAVE_TERMCAP_H + # include <termcap.h> + #endif + main() +-{char *s; s=(char *)tgoto("%p1%d", 0, 1); exit(!strcmp(s==0 ? "" : s, "1")); }], +- AC_MSG_RESULT([no -- we are in termcap land]), +- AC_MSG_RESULT([yes -- terminfo spoken here]); AC_DEFINE(TERMINFO), +- AC_MSG_ERROR(failed to compile test program.)) ++{char *s; s=(char *)tgoto("%p1%d", 0, 1); exit(!strcmp(s==0 ? "" : s, "1")); } ++ ],[ ++ vim_cv_terminfo=no ++ AC_MSG_RESULT([no -- we are in termcap land]) ++ ],[ ++ vim_cv_terminfo=yes ++ AC_MSG_RESULT([yes -- terminfo spoken here]) ++ ],[ ++ AC_MSG_ERROR(cross-compiling: please set 'vim_cv_terminfo') ++ ]) ++ ]) ++ ++if test "x$vim_cv_terminfo" = "xyes" ; then ++ AC_DEFINE(TERMINFO) ++fi + + if test "x$olibs" != "x$LIBS"; then +- AC_MSG_CHECKING(what tgetent() returns for an unknown terminal) +- AC_TRY_RUN([ ++ AC_CACHE_CHECK([what tgetent() returns for an unknown terminal], [vim_cv_tgent], ++ [ ++ AC_RUN_IFELSE([ + #ifdef HAVE_TERMCAP_H + # include <termcap.h> + #endif + main() +-{char s[10000]; int res = tgetent(s, "thisterminaldoesnotexist"); exit(res != 0); }], +- AC_MSG_RESULT(zero); AC_DEFINE(TGETENT_ZERO_ERR, 0), +- AC_MSG_RESULT(non-zero), +- AC_MSG_ERROR(failed to compile test program.)) ++{char s[10000]; int res = tgetent(s, "thisterminaldoesnotexist"); exit(res != 0); } ++ ],[ ++ vim_cv_tgent=zero ++ AC_MSG_RESULT(zero) ++ ],[ ++ vim_cv_tgent=non-zero ++ AC_MSG_RESULT(non-zero) ++ ],[ ++ AC_MSG_ERROR(failed to compile test program.) ++ ]) ++ ]) ++ ++ if test "x$vim_cv_tgent" = "xzero" ; then ++ AC_DEFINE(TGETENT_ZERO_ERR, 0) ++ fi + fi + + AC_MSG_CHECKING(whether termcap.h contains ospeed) +@@ -2333,9 +2363,10 @@ + dnl **** pty mode/group handling **** + dnl + dnl support provided by Luke Mewburn <lm...@rm...>, 931222 +-AC_MSG_CHECKING(default tty permissions/group) + rm -f conftest_grp +-AC_TRY_RUN([ ++AC_CACHE_CHECK([default tty permissions/group], [vim_cv_tty_group], ++ [ ++ AC_RUN_IFELSE([ + #include <sys/types.h> + #include <sys/stat.h> + #include <stdio.h> +@@ -2363,20 +2394,35 @@ + fclose(fp); + exit(0); + } +-],[ +- if test -f conftest_grp; then +- ptygrp=`cat conftest_grp` +- AC_MSG_RESULT([pty mode: 0620, group: $ptygrp]) +- AC_DEFINE(PTYMODE, 0620) +- AC_DEFINE_UNQUOTED(PTYGROUP,$ptygrp) +- else ++ ],[ ++ if test -f conftest_grp; then ++ vim_cv_tty_group=`cat conftest_grp` ++ if test "x$vim_cv_tty_mode" = "x" ; then ++ vim_cv_tty_mode=0620 ++ fi ++ AC_MSG_RESULT([pty mode: $vim_cv_tty_mode, group: $vim_cv_tty_group]) ++ else ++ vim_cv_tty_group=world + AC_MSG_RESULT([ptys are world accessable]) +- fi +-], +- AC_MSG_RESULT([can't determine - assume ptys are world accessable]), +- AC_MSG_ERROR(failed to compile test program)) ++ fi ++ ],[ ++ vim_cv_tty_group=world ++ AC_MSG_RESULT([can't determine - assume ptys are world accessable]) ++ ],[ ++ AC_MSG_ERROR(cross-compiling: please set 'vim_cv_tty_group' and 'vim_cv_tty_mode') ++ ]) ++ ]) + rm -f conftest_grp + ++if test "x$vim_cv_tty_group" != "xworld" ; then ++ AC_DEFINE_UNQUOTED(PTYGROUP,$vim_cv_tty_group) ++ if test "x$vim_cv_tty_mode" = "x" ; then ++ AC_MSG_ERROR([It seems you're cross compiling and have 'vim_cv_tty_group' set, please also set the environment variable 'vim_cv_tty_mode' to the correct mode (propably 0620)]) ++ else ++ AC_DEFINE(PTYMODE, 0620) ++ fi ++fi ++ + dnl Checks for library functions. =================================== + + AC_TYPE_SIGNAL +@@ -2404,8 +2450,9 @@ + + dnl tricky stuff: try to find out if getcwd() is implemented with + dnl system("sh -c pwd") +-AC_MSG_CHECKING(getcwd implementation) +-AC_TRY_RUN([ ++AC_CACHE_CHECK([getcwd implementation is broken], [vim_cv_getcwd_broken], ++ [ ++ AC_RUN_IFELSE([ + char *dagger[] = { "IFS=pwd", 0 }; + main() + { +@@ -2413,11 +2460,21 @@ + extern char **environ; + environ = dagger; + return getcwd(buffer, 500) ? 0 : 1; +-}], +- AC_MSG_RESULT(it is usable), +- AC_MSG_RESULT(it stinks) +- AC_DEFINE(BAD_GETCWD), +- AC_MSG_ERROR(failed to compile test program)) ++} ++ ],[ ++ vim_cv_getcwd_broken=no ++ AC_MSG_RESULT(no) ++ ],[ ++ vim_cv_getcwd_broken=yes ++ AC_MSG_RESULT(yes) ++ ],[ ++ AC_MSG_ERROR(cross-compiling: please set 'vim_cv_getcwd_broken') ++ ]) ++ ]) ++ ++if test "x$vim_cv_getcwd_broken" = "xyes" ; then ++ AC_DEFINE(BAD_GETCWD) ++fi + + dnl Check for functions in one big call, to reduce the size of configure + AC_CHECK_FUNCS(bcmp fchdir fchown fseeko fsync ftello getcwd getpseudotty \ +@@ -2441,14 +2498,27 @@ + AC_MSG_RESULT(yes); AC_DEFINE(HAVE_ST_BLKSIZE), + AC_MSG_RESULT(no)) + +-AC_MSG_CHECKING(whether stat() ignores a trailing slash) +-AC_TRY_RUN( ++AC_CACHE_CHECK([whether stat() ignores a trailing slash], [vim_cv_stat_ignores_slash], ++ [ ++ AC_RUN_IFELSE( + [#include <sys/types.h> + #include <sys/stat.h> +-main() {struct stat st; exit(stat("configure/", &st) != 0); }], +- AC_MSG_RESULT(yes); AC_DEFINE(STAT_IGNORES_SLASH), +- AC_MSG_RESULT(no), AC_MSG_ERROR(failed to compile test program)) ++main() {struct stat st; exit(stat("configure/", &st) != 0); } ++ ],[ ++ vim_cv_stat_ignores_slash=yes ++ AC_MSG_RESULT(yes) ++ ],[ ++ vim_cv_stat_ignores_slash=no ++ AC_MSG_RESULT(no) ++ ],[ ++ AC_MSG_ERROR(cross-compiling: please set 'vim_cv_stat_ignores_slash') ++ ]) ++ ]) + ++if test "x$vim_cv_stat_ignores_slash" = "xyes" ; then ++ AC_DEFINE(STAT_IGNORES_SLASH) ++fi ++ + dnl Link with iconv for charset translation, if not found without library. + dnl check for iconv() requires including iconv.h + dnl Add "-liconv" when possible; Solaris has iconv but use GNU iconv when it +@@ -2641,7 +2711,10 @@ + AC_MSG_RESULT($ac_cv_sizeof_int) + AC_DEFINE_UNQUOTED(SIZEOF_INT, $ac_cv_sizeof_int) + +-AC_MSG_CHECKING(whether memmove/bcopy/memcpy handle overlaps) ++ ++dnl Check for memmove() before bcopy(), makes memmove() be used when both are ++dnl present, fixes problem with incompatibility between Solaris 2.4 and 2.5. ++ + [bcopy_test_prog=' + main() { + char buf[10]; +@@ -2656,18 +2729,60 @@ + exit(0); /* libc version works properly. */ + }'] + +-dnl Check for memmove() before bcopy(), makes memmove() be used when both are +-dnl present, fixes problem with incompatibility between Solaris 2.4 and 2.5. ++AC_CACHE_CHECK([whether memmove handles overlaps],[vim_cv_memmove_handles_overlap], ++ [ ++ AC_RUN_IFELSE([#define mch_memmove(s,d,l) memmove(d,s,l) $bcopy_test_prog], ++ [ ++ vim_cv_memmove_handles_overlap=yes ++ AC_MSG_RESULT(yes) ++ ],[ ++ vim_cv_memmove_handles_overlap=no ++ AC_MSG_RESULT(no) ++ ],[ ++ AC_MSG_ERROR(cross-compiling: please set 'vim_cv_memmove_handles_overlap') ++ ]) ++ ]) ++ ++if test "x$vim_cv_memmove_handles_overlap" = "xyes" ; then ++ AC_DEFINE(USEMEMMOVE) ++else ++ AC_CACHE_CHECK([whether bcopy handles overlaps],[vim_cv_bcopy_handles_overlap], ++ [ ++ AC_RUN_IFELSE([#define mch_bcopy(s,d,l) bcopy(d,s,l) $bcopy_test_prog], ++ [ ++ vim_cv_bcopy_handles_overlap=yes ++ AC_MSG_RESULT(yes) ++ ],[ ++ vim_cv_bcopy_handles_overlap=no ++ AC_MSG_RESULT(no) ++ ],[ ++ AC_MSG_ERROR(cross-compiling: please set 'vim_cv_bcopy_handles_overlap') ++ ]) ++ ]) ++ ++ if test "x$vim_cv_bcopy_handles_overlap" = "xyes" ; then ++ AC_DEFINE(USEBCOPY) ++ else ++ AC_CACHE_CHECK([whether memcpy handles overlaps],[vim_cv_memcpy_handles_overlap], ++ [ ++ AC_RUN_IFELSE([#define mch_memcpy(s,d,l) memcpy(d,s,l) $bcopy_test_prog], ++ [ ++ vim_cv_memcpy_handles_overlap=yes ++ AC_MSG_RESULT(yes) ++ ],[ ++ vim_cv_memcpy_handles_overlap=no ++ AC_MSG_RESULT(no) ++ ],[ ++ AC_MSG_ERROR(cross-compiling: please set 'vim_cv_memcpy_handles_overlap') ++ ]) ++ ]) ++ ++ if test "x$vim_cv_memcpy_handles_overlap" = "xyes" ; then ++ AC_DEFINE(USEMEMCPY) ++ fi ++ fi ++fi + +-AC_TRY_RUN([#define mch_memmove(s,d,l) memmove(d,s,l) $bcopy_test_prog], +- AC_DEFINE(USEMEMMOVE) AC_MSG_RESULT(memmove does), +- AC_TRY_RUN([#define mch_memmove(s,d,l) bcopy(d,s,l) $bcopy_test_prog], +- AC_DEFINE(USEBCOPY) AC_MSG_RESULT(bcopy does), +- AC_TRY_RUN([#define mch_memmove(s,d,l) memcpy(d,s,l) $bcopy_test_prog], +- AC_DEFINE(USEMEMCPY) AC_MSG_RESULT(memcpy does), AC_MSG_RESULT(no), +- AC_MSG_ERROR(failed to compile test program)), +- AC_MSG_ERROR(failed to compile test program)), +- AC_MSG_ERROR(failed to compile test program)) + + dnl Check for multibyte locale functions + dnl Find out if _Xsetlocale() is supported by libX11. +diff -Nur vim71.orig/src/INSTALL vim71/src/INSTALL +--- vim71.orig/src/INSTALL 2007-05-11 23:13:27.000000000 +0200 ++++ vim71/src/INSTALL 2007-09-24 18:56:06.000000000 +0200 +@@ -14,6 +14,7 @@ + See INSTALLmac.txt for Macintosh + See INSTALLpc.txt for PC (MS-DOS, Windows 95/98/NT/XP) + See INSTALLvms.txt for VMS ++See INSTALLcross.txt for cross-compiling on Unix + See ../runtime/doc/os_390.txt for OS/390 Unix + See ../runtime/doc/os_beos.txt for BeBox + +diff -Nur vim71.orig/src/INSTALLcross.txt vim71/src/INSTALLcross.txt +--- vim71.orig/src/INSTALLcross.txt 1970-01-01 01:00:00.000000000 +0100 ++++ vim71/src/INSTALLcross.txt 2007-09-21 16:43:58.000000000 +0200 +@@ -0,0 +1,163 @@ ++Content: ++ 1. Introduction ++ 2. Necessary arguments for "configure" ++ 3. Necessary environment variables for "configure" ++ 4. Example ++ ++ ++1. INTRODUCTION ++=============== ++ ++This document discusses cross-compiling VIM on Unix-like systems. We assume ++you are already familiar with cross-compiling and have a working cross-compile ++environment with at least the following components: ++ ++ * a cross-compiler ++ * a libc to link against ++ * ncurses library to link against ++ ++Discussing how to set up a cross-compile environment would go beyond the scope ++of this document. See http://www.kegel.com/crosstool/ for more information and ++a script that aids in setting up such an environment. ++ ++ ++The problem is that "configure" needs to compile and run small test programs ++to check for certain features. Running these test programs can't be done when ++cross-compiling so we need to pass the results these checks would produce via ++environment variables. See the list of variables and the examples at the end of ++this document. ++ ++ ++2. NECESSARY ARGUMENTS FOR "configure" ++====================================== ++ ++You need to set the following "configure" command line switches: ++ ++--build=... : ++ The build system (i.e. the platform name of the system you compile on ++ right now). ++ For example, "i586-linux". ++ ++--host=... : ++ The system on which VIM will be run. Quite often this the name of your ++ cross-compiler without the "-gcc". ++ For example, "powerpc-603-linux-gnu". ++ ++--target=... : ++ Only relevant for compiling compilers. Set this to the same value as ++ --host. ++ ++--with-tlib=... : ++ Which terminal library to. ++ For example, "ncurses". ++ ++ ++3. NECESSARY ENVIRONMENT VARIABLES FOR "configure" ++================================================== ++ ++Additionally to the variables listed here you might want to set the CPPFLAGS ++environment variable to enable optimization for your target system (e.g. ++"CPPFLAGS=-march=arm5te"). ++ ++The following variables need to be set: ++ ++ac_cv_sizeof_int: ++ The size of an "int" C type in bytes. Should be "4" on all 32bit ++ machines. ++ ++vi_cv_path_python_conf: ++ If Python support is enabled, set this variables to the path for ++ Python's library implementation. This is a path like ++ "/usr/lib/pythonX.Y/config" (the directory contains a file ++ "config.c"). ++ ++vi_cv_var_python_epfx: ++ If Python support is enabled, set this variables to the execution ++ prefix of your Python interpreter (that is, where it thinks it is ++ running). ++ This is the output of the following Python script: ++ import sys; print sys.exec_prefix ++ ++vi_cv_var_python_pfx: ++ If Python support is enabled, set this variables to the prefix of your ++ Python interpreter (that is, where was installed). ++ This is the output of the following Python script: ++ import sys; print sys.prefix ++ ++vi_cv_var_python_version: ++ If Python support is enabled, set this variables to the version of the ++ Python interpreter that will be used. ++ This is the output of the following Python script: ++ import sys; print sys.version[:3] ++ ++vim_cv_bcopy_handles_overlap: ++ Whether the "memmove" C library call is able to copy overlapping ++ memory regions. Set to "yes" if it does or "no" if it does not. ++ You only need to set this if vim_cv_memmove_handles_overlap is set ++ to "no". ++ ++vim_cv_getcwd_broken: ++ Whether the "getcwd" C library call is broken. Set to "yes" if you ++ know that "getcwd" is implemented as 'system("sh -c pwd")', set to ++ "no" otherwise. ++ ++vim_cv_memcpy_handles_overlap: ++ Whether the "memcpy" C library call is able to copy overlapping ++ memory regions. Set to "yes" if it does or "no" if it does not. ++ You only need to set this if both vim_cv_memmove_handles_overlap ++ and vim_cv_bcopy_handles_overlap are set to "no". ++ ++vim_cv_memmove_handles_overlap: ++ Whether the "memmove" C library call is able to copy overlapping ++ memory regions. Set to "yes" if it does or "no" if it does not. ++ ++vim_cv_stat_ignores_slash: ++ Whether the "stat" C library call ignores trailing slashes in the path ++ name. Set to "yes" if it ignores them or "no" if it does not ignore ++ them. ++ ++vim_cv_tgetent: ++ Whether the "tgetent" terminal library call returns a zero or non-zero ++ value when it encounters an unknown terminal. Set to either the string ++ "zero" or "non-zero", corresponding. ++ ++vim_cv_terminfo: ++ Whether the environment has terminfo support. Set to "yes" if so, ++ otherwise set to "no". ++ ++vim_cv_toupper_broken: ++ Whether the "toupper" C library function works correctly. Set to "yes" ++ if you know it's broken, otherwise set to "no". ++ ++vim_cv_tty_group: ++ The default group of pseudo terminals. Either set to the numeric value ++ of the your tty group or to "world" if they are world accessable. ++ ++vim_cv_tty_mode: ++ The default mode of pseudo terminals if they are not world accessable. ++ Most propably the value "0620". ++ ++ ++4. EXAMPLE: ++=========== ++ ++Assuming the target system string is "armeb-xscale-linux-gnu" (a Intel XScale ++system) with glibc and ncurses, the call to configure would look like this: ++ ++ac_cv_sizeof_int=4 \ ++vim_cv_getcwd_broken=no \ ++vim_cv_memmove_handles_overlap=yes \ ++vim_cv_stat_ignores_slash=yes \ ++vim_cv_tgetent=zero \ ++vim_cv_terminfo=yes \ ++vim_cv_toupper_broken=no \ ++vim_cv_tty_group=world \ ++./configure \ ++ --build=i586-linux \ ++ --host=armeb-xscale-linux-gnu \ ++ --target=armeb-xscale-linux-gnu \ ++ --with-tlib=ncurses ++ ++ ++ ++Written 2007 by Marc Haisenko <ma...@da...> for the VIM project. Added: trunk/package/vim/vim.mk =================================================================== --- trunk/package/vim/vim.mk (rev 0) +++ trunk/package/vim/vim.mk 2007-12-14 21:56:06 UTC (rev 1442) @@ -0,0 +1,78 @@ +############################################################# +# +# vim +# +############################################################# +VIM_VER:=7.1 +VIM_SOURCE:=vim-$(VIM_VER).tar.bz2 +VIM_SITE:=ftp://ftp.vim.org/pub/vim/unix +VIM_DIR:=$(BUILD_DIR)/vim$(subst .,,$(VIM_VER)) +VIM_CAT:=bzcat +VIM_BINARY:=src/vim +VIM_TARGET_BINARY:=usr/bin/vim +VIM_CONFIGURE_OPTIONS:=\ + ac_cv_sizeof_int=4 \ + vim_cv_getcwd_broken=no \ + vim_cv_memmove_handles_overlap=yes \ + vim_cv_stat_ignores_slash=yes \ + vim_cv_tgetent=zero \ + vim_cv_terminfo=yes \ + vim_cv_toupper_broken=no \ + vim_cv_tty_group=world + +TAR_OPTIONS:=-b1 $(TAR_OPTIONS) + +$(DL_DIR)/$(VIM_SOURCE): + $(WGET) -P $(DL_DIR) $(VIM_SITE)/$(VIM_SOURCE) + +$(VIM_DIR)/.unpacked: $(DL_DIR)/$(VIM_SOURCE) + $(VIM_CAT) $(DL_DIR)/$(VIM_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) - + touch $(VIM_DIR)/.unpacked + +$(VIM_DIR)/.patched: $(VIM_DIR)/.unpacked + toolchain/patch-kernel.sh $(VIM_DIR) package/vim/ vim-\*.patch + (cd $(VIM_DIR)/src; autoconf) + touch $(VIM_DIR)/.patched + +$(VIM_DIR)/.configured: $(VIM_DIR)/.patched + (cd $(VIM_DIR); rm -rf config.cache; \ + $(TARGET_CONFIGURE_OPTS) CC_FOR_BUILD=$(HOSTCC) \ + CFLAGS="$(TARGET_CFLAGS)" \ + $(VIM_CONFIGURE_OPTIONS) \ + ./configure \ + --target=$(GNU_TARGET_NAME) \ + --host=$(GNU_TARGET_NAME) \ + --build=$(GNU_HOST_NAME) \ + --prefix=/usr \ + --enable-gui=no \ + --disable-netbeans \ + --without-x \ + --with-tlib=ncurses \ + ) + touch $(VIM_DIR)/.configured + +$(VIM_DIR)/$(VIM_BINARY): $(VIM_DIR)/.configured + $(MAKE) CC=$(TARGET_CC) -C $(VIM_DIR) + +$(TARGET_DIR)/$(VIM_TARGET_BINARY): $(VIM_DIR)/$(VIM_BINARY) + $(MAKE) -C $(VIM_DIR)/src install_normal DESTDIR=$(TARGET_DIR) + + # install -D $(VIM_DIR)/$(VIM_BINARY) $(TARGET_DIR)/$(VIM_TARGET_BINARY) + +vim: uclibc $(TARGET_DIR)/$(VIM_TARGET_BINARY) + +vim-clean: + rm -f $(TARGET_DIR)/$(VIM_TARGET_BINARY) + -$(MAKE) -C $(VIM_DIR) clean + +vim-dirclean: + rm -rf $(VIM_DIR) + +############################################################# +# +# Toplevel Makefile options +# +############################################################# +ifeq ($(strip $(BR2_PACKAGE_VIM)),y) +TARGETS+=vim +endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kr...@us...> - 2008-01-08 20:37:15
|
Revision: 1493 http://astlinux.svn.sourceforge.net/astlinux/?rev=1493&view=rev Author: krisk84 Date: 2008-01-08 12:37:20 -0800 (Tue, 08 Jan 2008) Log Message: ----------- Asterisk 1.4 is now in trunk - thanks everyone Modified Paths: -------------- trunk/package/Config.in trunk/package/asterisk/Config.in trunk/package/asterisk/asterisk.init trunk/package/asterisk/asterisk.mk trunk/package/digiumg729/codec_g729a.so trunk/package/libpri/libpri.mk trunk/package/mqueue-isdn/Config.in trunk/package/mqueue-isdn/mqueue-isdn.mk Added Paths: ----------- trunk/package/asterisk/asterisk-configure.patch trunk/package/asterisk/backport-app_stack.patch trunk/package/asterisk/backport-func_odbc.patch Removed Paths: ------------- trunk/package/appconference/ trunk/package/asterisk/asterisk-format264.patch trunk/package/asterisk/asterisk-nok6opt.patch trunk/package/asterisk/asterisk-uclibc-compat.patch trunk/package/asterisk/asterisk_no_res_ninit.patch trunk/package/asterisk/asterisk_uclibc.patch trunk/package/asterisk/chan_pika.patch trunk/package/asterisk/chanbluetooth.patch trunk/package/asterisk/metermaid.patch trunk/package/asterisk/spandsp.patch trunk/package/asterisknativesounds/ trunk/package/chansccp/ Modified: trunk/package/Config.in =================================================================== --- trunk/package/Config.in 2008-01-08 16:58:50 UTC (rev 1492) +++ trunk/package/Config.in 2008-01-08 20:37:20 UTC (rev 1493) @@ -29,10 +29,8 @@ source "package/alsa-utils/Config.in" source "package/arno-fw/Config.in" source "package/asterisk/Config.in" -source "package/asterisknativesounds/Config.in" source "package/app_bundle/Config.in" source "package/mqueue-isdn/Config.in" -source "package/appconference/Config.in" source "package/digiumg729/Config.in" source "package/chan_misdn/Config.in" source "package/chan_pika/Config.in" Modified: trunk/package/asterisk/Config.in =================================================================== --- trunk/package/asterisk/Config.in 2008-01-08 16:58:50 UTC (rev 1492) +++ trunk/package/asterisk/Config.in 2008-01-08 20:37:20 UTC (rev 1493) @@ -5,9 +5,28 @@ select BR2_PACKAGE_ZLIB select BR2_PACKAGE_OPENSSL select BR2_PACKAGE_LIBELF + select BR2_PACKAGE_LIBTOOL help Asterisk - the Open Source PBX +config BR2_PACKAGE_ASTERISK-GUI + bool "asterisk-gui" + default n + depends BR2_PACKAGE_ASTERISK + help + The GUI for Asterisk from Digium. + + http://www.asterisk.org/ + +config BR2_PACKAGE_ASTERISK_BACKPORTS + bool "asterisk-backports" + default n + depends BR2_PACKAGE_ASTERISK + help + Various backports from trunk into 1.4: + - app_stack + - func_odbc + config BR2_PACKAGE_LIBPRI bool "Asterisk PRI Support" default n @@ -24,40 +43,17 @@ help Compile Asterisk with custom PostgreSQL support -config BR2_PACKAGE_ASTERISK_CHANSCCP - bool "Asterisk chan_sccp Support" - default n - depends BR2_PACKAGE_ASTERISK - help - Compile Asterisk with chan_sccp from the chan_sccp project on berlios - -config BR2_PACKAGE_ASTERISK_CHANBLUETOOTH - bool "Asterisk chan_bluetooth support" - default n +config BR2_PACKAGE_ASTERISK_CHANMISDN + bool "Asterisk chan_misdn Support" + default n depends BR2_PACKAGE_ASTERISK - select BR2_PACKAGE_BLUEZ - help - chan_bluetooth - AG and HF bluetooth audio modes + select BR2_PACKAGE_MISDN + help + Compile Asterisk with chan_misdn Support - http://crazygreek.co.uk/content/chan_bluetooth - -config BR2_PACKAGE_ASTERISK_RESCONV - bool "Asterisk res_conv Support" - default n - depends BR2_PACKAGE_ASTERISK - help - Compile Asterisk with res_conv, the audio conversion module for Asterisk - -config BR2_PACKAGE_ASTERISK_LOWMEMORY - bool "Asterisk low memory" - default n - depends BR2_PACKAGE_ASTERISK - help - Define LOW_MEMORY for compiling Asterisk on systems that don't have much - -config BR2_PACKAGE_ASTERISK_METERMAID - bool "Asterisk metermaid support" +config BR2_PACKAGE_ASTERISK_MENUSELECT + bool "Asterisk custom configure" default n depends BR2_PACKAGE_ASTERISK help - http://www.asterisk.org/node/97 + Run interactive menuselect to select custom Asterisk options Added: trunk/package/asterisk/asterisk-configure.patch =================================================================== --- trunk/package/asterisk/asterisk-configure.patch (rev 0) +++ trunk/package/asterisk/asterisk-configure.patch 2008-01-08 20:37:20 UTC (rev 1493) @@ -0,0 +1,11 @@ +diff -urN asterisk-1.4.1.orig/configure asterisk-1.4.1/configure +--- asterisk-1.4.1.orig/configure 2007-03-02 23:03:01.000000000 +0000 ++++ asterisk-1.4.1/configure 2007-03-14 20:42:07.000000000 +0000 +@@ -27470,7 +27470,6 @@ + PWLIBDIR=`$PTLIB_CONFIG --prefix` + else + echo "Cannot find ptlib-config - please install and try again" +- exit + fi + fi + Deleted: trunk/package/asterisk/asterisk-format264.patch =================================================================== --- trunk/package/asterisk/asterisk-format264.patch 2008-01-08 16:58:50 UTC (rev 1492) +++ trunk/package/asterisk/asterisk-format264.patch 2008-01-08 20:37:20 UTC (rev 1493) @@ -1,597 +0,0 @@ -diff -urN asterisk-1.2.20.orig/channel.c asterisk-1.2.20/channel.c ---- asterisk-1.2.20.orig/channel.c 2007-06-27 16:23:24.000000000 -0400 -+++ asterisk-1.2.20/channel.c 2007-06-29 15:19:08.000000000 -0400 -@@ -2393,6 +2393,9 @@ - int native; - int res; - -+ /* Make sure we only consider audio */ -+ fmt &= AST_FORMAT_AUDIO_MASK; -+ - native = chan->nativeformats; - /* Find a translation path from the native format to one of the desired formats */ - if (!direction) -diff -urN asterisk-1.2.20.orig/channels/chan_sip.c asterisk-1.2.20/channels/chan_sip.c ---- asterisk-1.2.20.orig/channels/chan_sip.c 2007-06-24 21:02:49.000000000 -0400 -+++ asterisk-1.2.20/channels/chan_sip.c 2007-06-29 15:19:08.000000000 -0400 -@@ -2783,6 +2783,7 @@ - struct ast_channel *tmp; - struct ast_variable *v = NULL; - int fmt; -+ int what; - #ifdef OSP_SUPPORT - char iabuf[INET_ADDRSTRLEN]; - char peer[MAXHOSTNAMELEN]; -@@ -2799,12 +2800,15 @@ - tmp->tech = &sip_tech; - /* Select our native format based on codec preference until we receive - something from another device to the contrary. */ -- if (i->jointcapability) -- tmp->nativeformats = ast_codec_choose(&i->prefs, i->jointcapability, 1); -- else if (i->capability) -- tmp->nativeformats = ast_codec_choose(&i->prefs, i->capability, 1); -- else -- tmp->nativeformats = ast_codec_choose(&i->prefs, global_capability, 1); -+ if (i->jointcapability) /* The joint capabilities of us and peer */ -+ what = i->jointcapability; -+ else if (i->capability) /* Our configured capability for this peer */ -+ what = i->capability; -+ else -+ what = global_capability; /* Global codec support */ -+ -+ /* Set the native formats for audio and merge in video */ -+ tmp->nativeformats = ast_codec_choose(&i->prefs, what, 1) | (i->jointcapability & AST_FORMAT_VIDEO_MASK); - fmt = ast_best_codec(tmp->nativeformats); - - if (title) -@@ -3044,14 +3048,14 @@ - if (p->owner) { - /* We already hold the channel lock */ - if (f && f->frametype == AST_FRAME_VOICE) { -- if (f->subclass != p->owner->nativeformats) { -+ if (f->subclass != (p->owner->nativeformats & AST_FORMAT_AUDIO_MASK)) { - if (!(f->subclass & p->jointcapability)) { - ast_log(LOG_DEBUG, "Bogus frame of format '%s' received from '%s'!\n", - ast_getformatname(f->subclass), p->owner->name); - return &null_frame; - } - ast_log(LOG_DEBUG, "Oooh, format changed to %d\n", f->subclass); -- p->owner->nativeformats = f->subclass; -+ p->owner->nativeformats = (p->owner->nativeformats & AST_FORMAT_VIDEO_MASK) | f->subclass; - ast_set_read_format(p->owner, p->owner->readformat); - ast_set_write_format(p->owner, p->owner->writeformat); - } -@@ -3777,13 +3781,13 @@ - if (!p->owner) /* There's no open channel owning us */ - return 0; - -- if (!(p->owner->nativeformats & p->jointcapability)) { -+ if (!(p->owner->nativeformats & p->jointcapability & AST_FORMAT_AUDIO_MASK)) { - const unsigned slen=512; - char s1[slen], s2[slen]; - ast_log(LOG_DEBUG, "Oooh, we need to change our formats since our peer supports only %s and not %s\n", - ast_getformatname_multiple(s1, slen, p->jointcapability), - ast_getformatname_multiple(s2, slen, p->owner->nativeformats)); -- p->owner->nativeformats = ast_codec_choose(&p->prefs, p->jointcapability, 1); -+ p->owner->nativeformats = ast_codec_choose(&p->prefs, p->jointcapability, 1) | (p->capability & vpeercapability); - ast_set_read_format(p->owner, p->owner->readformat); - ast_set_write_format(p->owner, p->owner->writeformat); - } -diff -urN asterisk-1.2.20.orig/cli.c asterisk-1.2.20/cli.c ---- asterisk-1.2.20.orig/cli.c 2006-09-29 09:44:12.000000000 -0400 -+++ asterisk-1.2.20/cli.c 2007-06-29 15:19:08.000000000 -0400 -@@ -729,6 +729,7 @@ - struct timeval now; - char buf[2048]; - char cdrtime[256]; -+ char nf[256], wf[256], rf[256]; - long elapsed_seconds=0; - int hour=0, min=0, sec=0; - -@@ -758,9 +759,9 @@ - " DNID Digits: %s\n" - " State: %s (%d)\n" - " Rings: %d\n" -- " NativeFormat: %d\n" -- " WriteFormat: %d\n" -- " ReadFormat: %d\n" -+ " NativeFormats: %s\n" -+ " WriteFormat: %s\n" -+ " ReadFormat: %s\n" - "1st File Descriptor: %d\n" - " Frames in: %d%s\n" - " Frames out: %d%s\n" -@@ -780,7 +781,10 @@ - c->name, c->type, c->uniqueid, - (c->cid.cid_num ? c->cid.cid_num : "(N/A)"), - (c->cid.cid_name ? c->cid.cid_name : "(N/A)"), -- (c->cid.cid_dnid ? c->cid.cid_dnid : "(N/A)" ), ast_state2str(c->_state), c->_state, c->rings, c->nativeformats, c->writeformat, c->readformat, -+ (c->cid.cid_dnid ? c->cid.cid_dnid : "(N/A)" ), ast_state2str(c->_state), c->_state, c->rings, -+ ast_getformatname_multiple(nf, sizeof(nf), c->nativeformats), -+ ast_getformatname_multiple(wf, sizeof(wf), c->writeformat), -+ ast_getformatname_multiple(rf, sizeof(rf), c->readformat), - c->fds[0], c->fin & 0x7fffffff, (c->fin & 0x80000000) ? " (DEBUGGED)" : "", - c->fout & 0x7fffffff, (c->fout & 0x80000000) ? " (DEBUGGED)" : "", (long)c->whentohangup, - cdrtime, c->_bridge ? c->_bridge->name : "<none>", ast_bridged_channel(c) ? ast_bridged_channel(c)->name : "<none>", -diff -urN asterisk-1.2.20.orig/file.c asterisk-1.2.20/file.c ---- asterisk-1.2.20.orig/file.c 2007-06-22 10:52:18.000000000 -0400 -+++ asterisk-1.2.20/file.c 2007-06-29 15:19:08.000000000 -0400 -@@ -184,10 +184,12 @@ - int ast_stopstream(struct ast_channel *tmp) - { - /* Stop a running stream if there is one */ -+/* - if (tmp->vstream) { - ast_closestream(tmp->vstream); - tmp->vstream = NULL; - } -+*/ - if (tmp->stream) { - ast_closestream(tmp->stream); - tmp->stream = NULL; -@@ -206,8 +208,7 @@ - if (fs->fmt->format < AST_FORMAT_MAX_AUDIO) { - /* This is the audio portion. Call the video one... */ - if (!fs->vfs && fs->filename) { -- /* XXX Support other video formats XXX */ -- const char *type = "h263"; -+ const char *type = ast_getformatname(f->subclass & ~0x1); - fs->vfs = ast_writefile(fs->filename, type, NULL, fs->flags, 0, fs->mode); - ast_log(LOG_DEBUG, "Opened video output file\n"); - } -@@ -508,10 +509,14 @@ - } else - snprintf(filename2, sizeof(filename2), "%s/%s", preflang, filename); - fmts = ast_fileexists(filename2, NULL, NULL); -+ if (fmts > 0) -+ fmts &= AST_FORMAT_AUDIO_MASK; - } - if (fmts < 1) { - ast_copy_string(filename2, filename, sizeof(filename2)); - fmts = ast_fileexists(filename2, NULL, NULL); -+ if (fmts > 0) -+ fmts &= AST_FORMAT_AUDIO_MASK; - } - if (fmts < 1) { - ast_log(LOG_WARNING, "File %s does not exist in any format\n", filename); -@@ -543,30 +548,35 @@ - */ - int fd = -1; - int fmts = -1; -+ unsigned int format; - char filename2[256]; - char lang2[MAX_LANGUAGE]; -- /* XXX H.263 only XXX */ -- char *fmt = "h263"; -- if (!ast_strlen_zero(preflang)) { -- snprintf(filename2, sizeof(filename2), "%s/%s", preflang, filename); -- fmts = ast_fileexists(filename2, fmt, NULL); -+ const char *fmt; -+ for (format = AST_FORMAT_MAX_AUDIO << 1; format <= AST_FORMAT_MAX_VIDEO; format = format << 1) { -+ if (!(chan->nativeformats & format)) -+ continue; -+ fmt = ast_getformatname(format); -+ if (!ast_strlen_zero(preflang)) { -+ snprintf(filename2, sizeof(filename2), "%s/%s", preflang, filename); -+ fmts = ast_fileexists(filename2, fmt, NULL); -+ if (fmts < 1) { -+ ast_copy_string(lang2, preflang, sizeof(lang2)); -+ snprintf(filename2, sizeof(filename2), "%s/%s", lang2, filename); -+ fmts = ast_fileexists(filename2, fmt, NULL); -+ } -+ } - if (fmts < 1) { -- ast_copy_string(lang2, preflang, sizeof(lang2)); -- snprintf(filename2, sizeof(filename2), "%s/%s", lang2, filename); -+ ast_copy_string(filename2, filename, sizeof(filename2)); - fmts = ast_fileexists(filename2, fmt, NULL); - } -+ if (fmts < 1) { -+ continue; -+ } -+ fd = ast_filehelper(filename2, (char *)chan, fmt, ACTION_OPEN); -+ if (fd >= 0) -+ return chan->vstream; -+ ast_log(LOG_WARNING, "File %s has video but couldn't be opened\n", filename); - } -- if (fmts < 1) { -- ast_copy_string(filename2, filename, sizeof(filename2)); -- fmts = ast_fileexists(filename2, fmt, NULL); -- } -- if (fmts < 1) { -- return NULL; -- } -- fd = ast_filehelper(filename2, (char *)chan, fmt, ACTION_OPEN); -- if (fd >= 0) -- return chan->vstream; -- ast_log(LOG_WARNING, "File %s has video but couldn't be opened\n", filename); - return NULL; - } - -@@ -805,12 +815,14 @@ - int ast_streamfile(struct ast_channel *chan, const char *filename, const char *preflang) - { - struct ast_filestream *fs; -- struct ast_filestream *vfs; -+ struct ast_filestream *vfs=NULL; -+ char fmt[256]; - - fs = ast_openstream(chan, filename, preflang); -- vfs = ast_openvstream(chan, filename, preflang); -+ if (fs) -+ vfs = ast_openvstream(chan, filename, preflang); - if (vfs) -- ast_log(LOG_DEBUG, "Ooh, found a video stream, too\n"); -+ ast_log(LOG_DEBUG, "Ooh, found a video stream, too, format %s\n", ast_getformatname(vfs->fmt->format)); - if (fs){ - if (ast_applystream(chan, fs)) - return -1; -@@ -825,7 +837,7 @@ - #endif - return 0; - } -- ast_log(LOG_WARNING, "Unable to open %s (format %s): %s\n", filename, ast_getformatname(chan->nativeformats), strerror(errno)); -+ ast_log(LOG_WARNING, "Unable to open %s (format %s): %s\n", filename, ast_getformatname_multiple(fmt, sizeof(fmt), chan->nativeformats), strerror(errno)); - return -1; - } - -diff -urN asterisk-1.2.20.orig/formats/format_h264.c asterisk-1.2.20/formats/format_h264.c ---- asterisk-1.2.20.orig/formats/format_h264.c 1969-12-31 19:00:00.000000000 -0500 -+++ asterisk-1.2.20/formats/format_h264.c 2007-06-29 15:19:08.000000000 -0400 -@@ -0,0 +1,281 @@ -+/* -+ * Asterisk -- An open source telephony toolkit. -+ * -+ * Copyright (C) 1999 - 2005, Digium, Inc. -+ * -+ * Mark Spencer <mar...@di...> -+ * -+ * See http://www.asterisk.org for more information about -+ * the Asterisk project. Please do not directly contact -+ * any of the maintainers of this project for assistance; -+ * the project provides a web site, mailing lists and IRC -+ * channels for your use. -+ * -+ * This program is free software, distributed under the terms of -+ * the GNU General Public License Version 2. See the LICENSE file -+ * at the top of the source tree. -+ */ -+ -+/*! \file -+ * -+ * \brief Save to raw, headerless h264 data. -+ * \arg File name extension: h264 -+ * \ingroup formats -+ */ -+ -+#include <unistd.h> -+#include <netinet/in.h> -+#include <arpa/inet.h> -+#include <stdlib.h> -+#include <sys/time.h> -+#include <stdio.h> -+#include <errno.h> -+#include <string.h> -+ -+#include "asterisk.h" -+ -+ASTERISK_FILE_VERSION(__FILE__, "$Revision$") -+ -+#include "asterisk/lock.h" -+#include "asterisk/channel.h" -+#include "asterisk/file.h" -+#include "asterisk/logger.h" -+#include "asterisk/sched.h" -+#include "asterisk/module.h" -+#include "asterisk/endian.h" -+ -+/* Some Ideas for this code came from makeh264e.c by Jeffrey Chilton */ -+ -+/* Portions of the conversion code are by gu...@si... */ -+ -+struct ast_filestream { -+ void *reserved[AST_RESERVED_POINTERS]; -+ /* Believe it or not, we must decode/recode to account for the -+ weird MS format */ -+ /* This is what a filestream means to us */ -+ FILE *f; /* Descriptor */ -+ unsigned int lastts; -+ struct ast_frame fr; /* Frame information */ -+ char waste[AST_FRIENDLY_OFFSET]; /* Buffer for sending frames, etc */ -+ char empty; /* Empty character */ -+ unsigned char h264[4096]; /* Two Real h264 Frames */ -+}; -+ -+ -+AST_MUTEX_DEFINE_STATIC(h264_lock); -+static int glistcnt = 0; -+ -+static char *name = "h264"; -+static char *desc = "Raw h264 data"; -+static char *exts = "h264"; -+ -+static struct ast_filestream *h264_open(FILE *f) -+{ -+ /* We don't have any header to read or anything really, but -+ if we did, it would go here. We also might want to check -+ and be sure it's a valid file. */ -+ struct ast_filestream *tmp; -+ unsigned int ts; -+ int res; -+ if ((res = fread(&ts, 1, sizeof(ts), f)) < sizeof(ts)) { -+ ast_log(LOG_WARNING, "Empty file!\n"); -+ return NULL; -+ } -+ -+ if ((tmp = malloc(sizeof(struct ast_filestream)))) { -+ memset(tmp, 0, sizeof(struct ast_filestream)); -+ if (ast_mutex_lock(&h264_lock)) { -+ ast_log(LOG_WARNING, "Unable to lock h264 list\n"); -+ free(tmp); -+ return NULL; -+ } -+ tmp->f = f; -+ tmp->fr.data = tmp->h264; -+ tmp->fr.frametype = AST_FRAME_VIDEO; -+ tmp->fr.subclass = AST_FORMAT_H264; -+ /* datalen will vary for each frame */ -+ tmp->fr.src = name; -+ tmp->fr.mallocd = 0; -+ glistcnt++; -+ ast_mutex_unlock(&h264_lock); -+ ast_update_use_count(); -+ } -+ return tmp; -+} -+ -+static struct ast_filestream *h264_rewrite(FILE *f, const char *comment) -+{ -+ /* We don't have any header to read or anything really, but -+ if we did, it would go here. We also might want to check -+ and be sure it's a valid file. */ -+ struct ast_filestream *tmp; -+ if ((tmp = malloc(sizeof(struct ast_filestream)))) { -+ memset(tmp, 0, sizeof(struct ast_filestream)); -+ if (ast_mutex_lock(&h264_lock)) { -+ ast_log(LOG_WARNING, "Unable to lock h264 list\n"); -+ free(tmp); -+ return NULL; -+ } -+ tmp->f = f; -+ glistcnt++; -+ ast_mutex_unlock(&h264_lock); -+ ast_update_use_count(); -+ } else -+ ast_log(LOG_WARNING, "Out of memory\n"); -+ return tmp; -+} -+ -+static void h264_close(struct ast_filestream *s) -+{ -+ if (ast_mutex_lock(&h264_lock)) { -+ ast_log(LOG_WARNING, "Unable to lock h264 list\n"); -+ return; -+ } -+ glistcnt--; -+ ast_mutex_unlock(&h264_lock); -+ ast_update_use_count(); -+ fclose(s->f); -+ free(s); -+ s = NULL; -+} -+ -+static struct ast_frame *h264_read(struct ast_filestream *s, int *whennext) -+{ -+ int res; -+ int mark=0; -+ unsigned short len; -+ unsigned int ts; -+ /* Send a frame from the file to the appropriate channel */ -+ s->fr.frametype = AST_FRAME_VIDEO; -+ s->fr.subclass = AST_FORMAT_H264; -+ s->fr.offset = AST_FRIENDLY_OFFSET; -+ s->fr.mallocd = 0; -+ s->fr.data = s->h264; -+ if ((res = fread(&len, 1, sizeof(len), s->f)) < 1) { -+ return NULL; -+ } -+ len = ntohs(len); -+ if (len & 0x8000) { -+ mark = 1; -+ } -+ len &= 0x7fff; -+ if (len > sizeof(s->h264)) { -+ ast_log(LOG_WARNING, "Length %d is too long\n", len); -+ } -+ if ((res = fread(s->h264, 1, len, s->f)) != len) { -+ if (res) -+ ast_log(LOG_WARNING, "Short read (%d of %d) (%s)!\n", res, len, strerror(errno)); -+ return NULL; -+ } -+ s->fr.samples = s->lastts; -+ s->fr.datalen = len; -+ s->fr.subclass |= mark; -+ s->fr.delivery.tv_sec = 0; -+ s->fr.delivery.tv_usec = 0; -+ if ((res = fread(&ts, 1, sizeof(ts), s->f)) == sizeof(ts)) { -+ s->lastts = ntohl(ts); -+ *whennext = s->lastts * 4/45; -+ } else -+ *whennext = 0; -+ return &s->fr; -+} -+ -+static int h264_write(struct ast_filestream *fs, struct ast_frame *f) -+{ -+ int res; -+ unsigned int ts; -+ unsigned short len; -+ int subclass; -+ int mark=0; -+ if (f->frametype != AST_FRAME_VIDEO) { -+ ast_log(LOG_WARNING, "Asked to write non-video frame!\n"); -+ return -1; -+ } -+ subclass = f->subclass; -+ if (subclass & 0x1) -+ mark=0x8000; -+ subclass &= ~0x1; -+ if (subclass != AST_FORMAT_H264) { -+ ast_log(LOG_WARNING, "Asked to write non-h264 frame (%d)!\n", f->subclass); -+ return -1; -+ } -+ ts = htonl(f->samples); -+ if ((res = fwrite(&ts, 1, sizeof(ts), fs->f)) != sizeof(ts)) { -+ ast_log(LOG_WARNING, "Bad write (%d/4): %s\n", res, strerror(errno)); -+ return -1; -+ } -+ len = htons(f->datalen | mark); -+ if ((res = fwrite(&len, 1, sizeof(len), fs->f)) != sizeof(len)) { -+ ast_log(LOG_WARNING, "Bad write (%d/2): %s\n", res, strerror(errno)); -+ return -1; -+ } -+ if ((res = fwrite(f->data, 1, f->datalen, fs->f)) != f->datalen) { -+ ast_log(LOG_WARNING, "Bad write (%d/%d): %s\n", res, f->datalen, strerror(errno)); -+ return -1; -+ } -+ return 0; -+} -+ -+static char *h264_getcomment(struct ast_filestream *s) -+{ -+ return NULL; -+} -+ -+static int h264_seek(struct ast_filestream *fs, off_t sample_offset, int whence) -+{ -+ /* No way Jose */ -+ return -1; -+} -+ -+static int h264_trunc(struct ast_filestream *fs) -+{ -+ /* Truncate file to current length */ -+ if (ftruncate(fileno(fs->f), ftell(fs->f)) < 0) -+ return -1; -+ return 0; -+} -+ -+static off_t h264_tell(struct ast_filestream *fs) -+{ -+ /* XXX This is totally bogus XXX */ -+ off_t offset; -+ offset = ftell(fs->f); -+ return (offset/20)*160; -+} -+ -+int load_module() -+{ -+ return ast_format_register(name, exts, AST_FORMAT_H264, -+ h264_open, -+ h264_rewrite, -+ h264_write, -+ h264_seek, -+ h264_trunc, -+ h264_tell, -+ h264_read, -+ h264_close, -+ h264_getcomment); -+ -+ -+} -+ -+int unload_module() -+{ -+ return ast_format_unregister(name); -+} -+ -+int usecount() -+{ -+ return glistcnt; -+} -+ -+char *description() -+{ -+ return desc; -+} -+ -+ -+char *key() -+{ -+ return ASTERISK_GPL_KEY; -+} -diff -urN asterisk-1.2.20.orig/formats/Makefile asterisk-1.2.20/formats/Makefile ---- asterisk-1.2.20.orig/formats/Makefile 2005-11-29 13:24:39.000000000 -0500 -+++ asterisk-1.2.20/formats/Makefile 2007-06-29 15:19:08.000000000 -0400 -@@ -13,7 +13,7 @@ - - FORMAT_LIBS=format_gsm.so format_wav.so \ - format_wav_gsm.so format_vox.so format_pcm.so format_g729.so \ -- format_pcm_alaw.so format_h263.so format_g726.so format_ilbc.so \ -+ format_pcm_alaw.so format_h263.so format_h264.so format_g726.so format_ilbc.so \ - format_sln.so format_au.so - FORMAT_LIBS+=format_jpeg.so - -diff -urN asterisk-1.2.20.orig/frame.c asterisk-1.2.20/frame.c ---- asterisk-1.2.20.orig/frame.c 2006-11-20 14:50:21.000000000 -0500 -+++ asterisk-1.2.20/frame.c 2007-06-29 15:19:08.000000000 -0400 -@@ -100,7 +100,7 @@ - { 1, AST_FORMAT_H261, "h261", "H.261 Video" }, /*!< Passthrough */ - { 1, AST_FORMAT_H263, "h263", "H.263 Video" }, /*!< Passthrough support, see format_h263.c */ - { 1, AST_FORMAT_H263_PLUS, "h263p", "H.263+ Video" }, /*!< See format_h263.c */ -- { 0, 0, "nothing", "undefined" }, -+ { 1, AST_FORMAT_H264, "h264", "H.264 Video" }, /*!< Passthrough support, see format_h263.c */ - { 0, 0, "nothing", "undefined" }, - { 0, 0, "nothing", "undefined" }, - { 0, 0, "nothing", "undefined" }, -diff -urN asterisk-1.2.20.orig/include/asterisk/frame.h asterisk-1.2.20/include/asterisk/frame.h ---- asterisk-1.2.20.orig/include/asterisk/frame.h 2005-11-29 13:24:39.000000000 -0500 -+++ asterisk-1.2.20/include/asterisk/frame.h 2007-06-29 15:19:08.000000000 -0400 -@@ -193,6 +193,8 @@ - #define AST_FORMAT_ILBC (1 << 10) - /*! Maximum audio format */ - #define AST_FORMAT_MAX_AUDIO (1 << 15) -+/*! Maximum audio mask */ -+#define AST_FORMAT_AUDIO_MASK ((1 << 16)-1) - /*! JPEG Images */ - #define AST_FORMAT_JPEG (1 << 16) - /*! PNG Images */ -@@ -203,8 +205,11 @@ - #define AST_FORMAT_H263 (1 << 19) - /*! H.263+ Video */ - #define AST_FORMAT_H263_PLUS (1 << 20) -+/*! H.264 Video */ -+#define AST_FORMAT_H264 (1 << 21) - /*! Maximum video format */ - #define AST_FORMAT_MAX_VIDEO (1 << 24) -+#define AST_FORMAT_VIDEO_MASK (((1 << 25)-1) & ~(AST_FORMAT_AUDIO_MASK)) - - /* Control frame types */ - /*! Other end has hungup */ -diff -urN asterisk-1.2.20.orig/rtp.c asterisk-1.2.20/rtp.c ---- asterisk-1.2.20.orig/rtp.c 2007-06-19 13:00:58.000000000 -0400 -+++ asterisk-1.2.20/rtp.c 2007-06-29 15:19:08.000000000 -0400 -@@ -682,6 +682,7 @@ - {{1, AST_FORMAT_H261}, "video", "H261"}, - {{1, AST_FORMAT_H263}, "video", "H263"}, - {{1, AST_FORMAT_H263_PLUS}, "video", "h263-1998"}, -+ {{1, AST_FORMAT_H264}, "video", "H264"}, - }; - - /* Static (i.e., well-known) RTP payload types for our "AST_FORMAT..."s: -@@ -710,6 +711,7 @@ - [34] = {1, AST_FORMAT_H263}, - [103] = {1, AST_FORMAT_H263_PLUS}, - [97] = {1, AST_FORMAT_ILBC}, -+ [99] = {1, AST_FORMAT_H264}, - [101] = {0, AST_RTP_DTMF}, - [110] = {1, AST_FORMAT_SPEEX}, - [111] = {1, AST_FORMAT_G726}, -@@ -1464,6 +1466,7 @@ - case AST_FORMAT_H261: - case AST_FORMAT_H263: - case AST_FORMAT_H263_PLUS: -+ case AST_FORMAT_H264: - case AST_FORMAT_G723_1: - case AST_FORMAT_LPC10: - case AST_FORMAT_SPEEX: Deleted: trunk/package/asterisk/asterisk-nok6opt.patch =================================================================== --- trunk/package/asterisk/asterisk-nok6opt.patch 2008-01-08 16:58:50 UTC (rev 1492) +++ trunk/package/asterisk/asterisk-nok6opt.patch 2008-01-08 20:37:20 UTC (rev 1493) @@ -1,21 +0,0 @@ -diff -ur asterisk-1.2.11.orig/codecs/gsm/Makefile asterisk-1.2.11/codecs/gsm/Makefile ---- asterisk-1.2.11.orig/codecs/gsm/Makefile 2006-07-24 13:05:56.000000000 -0400 -+++ asterisk-1.2.11/codecs/gsm/Makefile 2006-08-24 10:08:23.000000000 -0400 -@@ -243,7 +243,7 @@ - ifneq (${PROC},arm) - ifneq ($(shell uname -m), parisc) - ifneq ($(shell uname -m),s390) --GSM_SOURCES+= $(SRC)/k6opt.s -+#GSM_SOURCES+= $(SRC)/k6opt.s - endif - endif - endif -@@ -310,7 +310,7 @@ - ifneq ($(shell uname -m), armv4l) - ifneq ($(shell uname -m), parisc) - ifneq ($(shell uname -m),s390) --GSM_OBJECTS+= $(SRC)/k6opt.o -+#GSM_OBJECTS+= $(SRC)/k6opt.o - endif - endif - endif Deleted: trunk/package/asterisk/asterisk-uclibc-compat.patch =================================================================== --- trunk/package/asterisk/asterisk-uclibc-compat.patch 2008-01-08 16:58:50 UTC (rev 1492) +++ trunk/package/asterisk/asterisk-uclibc-compat.patch 2008-01-08 20:37:20 UTC (rev 1493) @@ -1,19 +0,0 @@ ---- asterisk-1.2.4/Makefile.orig 2006-02-24 09:31:16.000000000 -0800 -+++ asterisk-1.2.4/Makefile 2006-02-24 09:31:32.000000000 -0800 -@@ -345,16 +345,6 @@ - netsock.o slinfactory.o ast_expr2.o ast_expr2f.o \ - cryptostub.o - --ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/sys/poll.h),) -- OBJS+= poll.o -- ASTCFLAGS+=-DPOLLCOMPAT --endif -- --ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/dlfcn.h),) -- OBJS+= dlfcn.o -- ASTCFLAGS+=-DDLFCNCOMPAT --endif -- - ifeq ($(OSARCH),Linux) - LIBS+=-ldl -lpthread -lncurses -lm -lresolv #-lnjamd - else Modified: trunk/package/asterisk/asterisk.init =================================================================== --- trunk/package/asterisk/asterisk.init 2008-01-08 16:58:50 UTC (rev 1492) +++ trunk/package/asterisk/asterisk.init 2008-01-08 20:37:20 UTC (rev 1493) @@ -85,12 +85,6 @@ logfile = /dev/null" > /tmp/etc/astmanproxy.conf fi -if [ -r /usr/lib/asterisk/modules/chan_pika.so ] -then -mknod /dev/pikainline0 c 242 0 -modprobe pikainline -fi - if `which pikacf > /dev/null 2> /dev/null` then if [ -r /usr/share/pika/montecarlo/conf/pikaconfig.xml ] @@ -98,7 +92,7 @@ echo "PikaInline already configured..." else if `cat /proc/cmdline | grep -q asturw` -then +then echo "Running initial configuration for PikaInline..." pikacf -a /dev/null 1>/dev/null & else @@ -107,8 +101,8 @@ pikacf -a /dev/null 1>/dev/null & mount -o ro,remount / fi +fi fi -fi } start () { @@ -146,78 +140,29 @@ sleep 2 fi -if [ -r /etc/asterisk/extensions.conf ] +if `grep -A1 "[admin]" /etc/asterisk/manager.conf | grep -q astlinux` then -# Work around uclibc bug -ulimit -s unlimited -asterisk -p -fi +echo " +WARNING WARNING WARNING -if [ "$ASTVERBOSE" ] -then -asterisk -rx "set verbose $ASTVERBOSE" > /dev/null -fi +YOU STILL HAVE NOT CHANGED YOUR ASTERISK MANAGER PASSWORD +ANYONE THAT KNOWS YOU ARE USING ASTLINUX CAN DESTROY YOUR +SYSTEM. PLEASE CHANGE THIS IN /etc/asterisk/manager.conf +IMMEDIATELY! -if [ "$ASTG729" ] -then -G729MODULE=$ASTG729 - -if [ "$ASTG729" = "auto" ] -then -# Pentium 1 has tsc -if `grep -q tsc /proc/cpuinfo` -then -G729MODULE="codec_g729a-p1.so" +WARNING WARNING WARNING +" fi -# Pentium 2 has cmov -if `grep -q cmov /proc/cpuinfo` +if [ -r /etc/asterisk/extensions.conf ] then -G729MODULE="codec_g729a-p2.so" +# Work around uclibc bug +ulimit -s unlimited +asterisk -p -I fi -# Pentium 3 has sse -if `grep -q sse /proc/cpuinfo` +if [ -r /tmp/etc/astmanproxy.conf ] then -G729MODULE="codec_g729a-p3.so" -fi - -# Pentium 4 has sse2 -if `grep -q sse2 /proc/cpuinfo` -then -G729MODULE="codec_g729a-p4.so" -fi - -# Some P4s have sse3 -if `grep -q sse3 /proc/cpuinfo` -then -G729MODULE="codec_g729a-p4-sse3.so" -fi - -# SSE3 has many names - pni is another one -if `grep -q pni /proc/cpuinfo` -then -G729MODULE="codec_g729a-p4-sse3.so" -fi - -fi - -if [ -r /usr/lib/asterisk/modules/g729/$G729MODULE ] -then - -if [ -r /usr/lib/asterisk/modules/codec_g729a.so ] -then -/usr/sbin/asterisk -rx "unload codec_g729a.so" 2> /dev/null > /dev/null -fi -/usr/sbin/asterisk -rx "load g729/$G729MODULE" -else -echo "Error: Asterisk G729 module $G729MODULE not found" -fi - -fi - -if [ -r /tmp/etc/astmanproxy.conf -a -r /etc/asterisk/astmanproxy.users ] -then echo "Starting astmanproxy..." /usr/sbin/astmanproxy fi Modified: trunk/package/asterisk/asterisk.mk =================================================================== --- trunk/package/asterisk/asterisk.mk 2008-01-08 16:58:50 UTC (rev 1492) +++ trunk/package/asterisk/asterisk.mk 2008-01-08 20:37:20 UTC (rev 1493) @@ -3,11 +3,11 @@ # asterisk # ############################################################## -ASTERISK_VERSION := 1.2.26 +ASTERISK_VERSION := 1.4.17 ASTERISK_SOURCE := asterisk-$(ASTERISK_VERSION).tar.gz -ASTERISK_SITE := http://downloads.digium.com/pub/asterisk/old-releases +ASTERISK_SITE := http://downloads.digium.com/pub/asterisk/releases ASTERISK_DIR := $(BUILD_DIR)/asterisk-$(ASTERISK_VERSION) -ASTERISK_BINARY := asterisk +ASTERISK_BINARY := main/asterisk ASTERISK_TARGET_BINARY := usr/sbin/asterisk ifeq ($(strip $(BR2_PACKAGE_LIBPRI)),y) @@ -25,9 +25,16 @@ ASTERISK_EXTRAS+=libpq endif -ifeq ($(strip $(BR2_PACKAGE_ASTERISK_CHANBLUETOOTH)),y) +#ifeq ($(strip $(BR2_PACKAGE_NETSNMP)),y) +#ASTERISK_EXTRAS :=$(ASTERISK_EXTRAS) +#ASTERISK_EXTRAS+=netsnmp +#ASTERISK_CONFIGURE_SNMP :="--with-netsnmp=$(STAGING_DIR)/usr" +#endif + +ifeq ($(strip $(BR2_PACKAGE_UNIXODBC)),y) ASTERISK_EXTRAS :=$(ASTERISK_EXTRAS) -ASTERISK_EXTRAS+=bluez-utils +ASTERISK_EXTRAS+=unixodbc +ASTERISK_CONFIGURE_ODBC :="--with-odbc=$(STAGING_DIR)/usr" endif ifeq ($(strip $(BR2_PACKAGE_ALSA_LIB)),y) @@ -35,30 +42,28 @@ ASTERISK_EXTRAS+=alsa-lib endif -ifeq ($(strip $(BR2_PACKAGE_ASTERISK_LOWMEMORY)),y) -ASTERISK_OPTIONS :=$(ASTERISK_OPTIONS) -ASTERISK_OPTIONS+="-DLOW_MEMORY" -endif - ifeq ($(strip $(BR2_PACKAGE_SPANDSP)),y) ASTERISK_EXTRAS :=$(ASTERISK_EXTRAS) ASTERISK_EXTRAS+=spandsp endif +ifeq ($(strip $(BR2_PACKAGE_ASTERISK_CHANMISDN)),y) +ASTERISK_EXTRAS :=$(ASTERISK_EXTRAS) +ASTERISK_EXTRAS+=mqueue_misdn +ASTERISK_CONFIGURE_MISDN :="--with-misdn=$(STAGING_DIR)/usr" +ASTERISK_CONFIGURE_ISDNNET :="--with-isdnnet=$(STAGING_DIR)/usr" +ASTERISK_CONFIGURE_SUPPSERV :="--with-suppserv=$(STAGING_DIR)/usr" +endif + $(DL_DIR)/$(ASTERISK_SOURCE): $(WGET) -P $(DL_DIR) $(ASTERISK_SITE)/$(ASTERISK_SOURCE) -ifeq ($(strip $(BR2_PACKAGE_ASTERISK_CHANBLUETOOTH)),y) - $(WGET) -P $(DL_DIR) http://www.thetechguide.com/howto/asterisk/bluetoothfiles.tar.gz -endif $(ASTERISK_DIR)/.source: $(DL_DIR)/$(ASTERISK_SOURCE) zcat $(DL_DIR)/$(ASTERISK_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) - -ifeq ($(strip $(BR2_PACKAGE_ASTERISK_CHANBLUETOOTH)),y) - zcat $(DL_DIR)/bluetoothfiles.tar.gz | tar -C $(BUILD_DIR) $(TAR_OPTIONS) - -endif toolchain/patch-kernel.sh $(ASTERISK_DIR) package/asterisk/ asterisk\*.patch -ifeq ($(strip $(BR2_PACKAGE_ASTERISK_METERMAID)),y) - toolchain/patch-kernel.sh $(ASTERISK_DIR) package/asterisk/ metermaid.patch + +ifeq ($(strip $(BR2_PACKAGE_ASTERISK_BACKPORTS)),y) + toolchain/patch-kernel.sh $(ASTERISK_DIR) package/asterisk/ backport\*.patch endif ifeq ($(strip $(BR2_PACKAGE_CHANPIKA)),y) @@ -78,22 +83,44 @@ cp package/asterisk/custom/*.c $(ASTERISK_DIR)/apps/ toolchain/patch-kernel.sh package/asterisk/custom/\*.patch endif -ifeq ($(strip $(BR2_PACKAGE_ASTERISK_CHANBLUETOOTH)),y) - toolchain/patch-kernel.sh $(ASTERISK_DIR) package/asterisk/ chanbluetooth.patch - echo "include $(BUILD_DIR)/usr/src/asterisk-test/bluetooth/chan_bluetooth/Makefile" >> $(ASTERISK_DIR)/channels/Makefile + + (cd $(ASTERISK_DIR); rm -rf config.cache; \ + $(TARGET_CONFIGURE_OPTS) CC_FOR_BUILD=$(HOSTCC) \ + CFLAGS="$(TARGET_CFLAGS)" \ + HAS_PWLIB=0 \ + ./configure \ + --target=$(GNU_TARGET_NAME) \ + --host=$(GNU_TARGET_NAME) \ + --build=$(GNU_HOST_NAME) \ + --prefix=/usr \ + --exec-prefix=/usr \ + --datadir=/usr/share \ + --sysconfdir=/etc \ + --with-pri=$(STAGING_DIR)/usr \ + --with-zaptel=$(STAGING_DIR)/usr \ + --with-tonezone=$(STAGING_DIR)/usr \ + --with-pwlib=no \ + --with-ltdl=$(STAGING_DIR)/usr \ + $(ASTERISK_CONFIGURE_SNMP) \ + $(ASTERISK_CONFIGURE_ODBC) \ + $(ASTERISK_CONFIGURE_MISDN) \ + $(ASTERISK_CONFIGURE_ISDNNET) \ + $(ASTERISK_CONFIGURE_SUPPSERV) \ + ); + $(MAKE) -C $(ASTERISK_DIR)/menuselect menuselect +ifeq ($(strip $(BR2_PACKAGE_ASTERISK_MENUSELECT)),y) + $(MAKE) -C $(ASTERISK_DIR) menuselect endif touch $(ASTERISK_DIR)/.configured $(ASTERISK_DIR)/$(ASTERISK_BINARY): $(ASTERISK_DIR)/.configured cp $(STAGING_DIR)/include/dlfcn.h $(STAGING_DIR)/usr/include/dlfcn.h # Can I do this? - $(MAKE1) -C $(ASTERISK_DIR) CROSS_ARCH=Linux CROSS_COMPILE=$(TARGET_CROSS) CROSS_COMPILE_BIN=$(STAGING_DIR)/bin/ \ - CROSS_COMPILE_TARGET=$(STAGING_DIR) CROSS_PROC=$(OPTIMIZE_FOR_CPU) OPTIMIZE="$(TARGET_OPTIMIZATION)" \ - OPTIONS="$(ASTERISK_OPTIONS)" DEBUG= ASTVARRUNDIR=/var/run/asterisk $(TARGET_CONFIGURE_OPTS) + ASTCFLAGS="-I$(STAGING_DIR)/usr/include" $(MAKE) -C $(ASTERISK_DIR) $(TARGET_CONFIGURE_OPTS) ASTVARRUNDIR=/var/run/asterisk HOSTCC=gcc $(TARGET_DIR)/$(ASTERISK_TARGET_BINARY): $(ASTERISK_DIR)/$(ASTERISK_BINARY) - $(MAKE1) -C $(ASTERISK_DIR) CROSS_ARCH=Linux CROSS_COMPILE=$(TARGET_CROSS) CROSS_COMPILE_BIN=$(TARGET_CC) \ - CROSS_COMPILE_TARGET=$(STAGING_DIR) CROSS_PROC=$(OPTIMIZE_FOR_CPU) OPTIMIZE="$(TARGET_OPTIMIZATION)" \ - OPTIONS="$(ASTERISK_OPTIONS)" DEBUG= $(TARGET_CONFIGURE_OPTS) ASTVARRUNDIR=/var/run/asterisk DESTDIR=$(TARGET_DIR) install samples + # mkdir -p $(TARGET_DIR)/usr/lib/asterisk/modules + $(MAKE1) -C $(ASTERISK_DIR) $(TARGET_CONFIGURE_OPTS) DESTDIR=$(TARGET_DIR) \ + ASTVARRUNDIR=/var/run/asterisk HOSTCC=gcc install samples $(STRIP) $(TARGET_DIR)/usr/sbin/asterisk $(STRIP) $(TARGET_DIR)/usr/sbin/stereorize $(STRIP) $(TARGET_DIR)/usr/sbin/streamplayer @@ -118,39 +145,40 @@ mv $(TARGET_DIR)/etc/asterisk $(TARGET_DIR)/stat/etc/ endif $(INSTALL) -D -m 0755 package/asterisk/logger.conf $(TARGET_DIR)/stat/etc/asterisk/logger.conf -ifeq ($(strip $(BR2_PACKAGE_ASTERISK_CHANBLUETOOTH)),y) - $(INSTALL) -D -m 0755 $(BUILD_DIR)/usr/src/asterisk-test/bluetooth/chan_bluetooth/conf/bluetooth.conf \ - $(TARGET_DIR)/stat/etc/asterisk/bluetooth.conf -endif + chmod -R 750 $(TARGET_DIR)/stat/etc/asterisk rm -rf $(TARGET_DIR)/etc/asterisk ln -sf /tmp/etc/asterisk $(TARGET_DIR)/etc/asterisk - ln -sf $(ASTERISK_DIR) $(BUILD_DIR)/asterisk ln -sf /mnt/kd/custom-sounds $(TARGET_DIR)/stat/var/lib/asterisk/sounds/custom-sounds ifeq ($(strip $(BR2_PACKAGE_ASTERISK_LIBPQ_CUSTOM)),y) cp -f package/asterisk/custom/*.conf $(TARGET_DIR)/stat/etc/asterisk/ endif - -asterisk: uclibc libelf ncurses zlib openssl $(ASTERISK_EXTRAS) $(TARGET_DIR)/$(ASTERISK_TARGET_BINARY) +asterisk: uclibc libelf ncurses zlib openssl libtool $(ASTERISK_EXTRAS) $(TARGET_DIR)/$(ASTERISK_TARGET_BINARY) + asterisk-source: $(DL_DIR)/$(ASTERISK_SOURCE) asterisk-unpack: $(ASTERISK_DIR)/.configured asterisk-clean: rm -Rf $(STAGING_DIR)/usr/include/asterisk + rm -Rf $(TARGET_DIR)/stat/etc/asterisk rm -Rf $(TARGET_DIR)/etc/asterisk rm -Rf $(TARGET_DIR)/usr/lib/asterisk + rm -Rf $(TARGET_DIR)/stat/var/lib/asterisk + rm -Rf $(TARGET_DIR)/stat/var/spool/asterisk rm -Rf $(TARGET_DIR)/var/lib/asterisk rm -Rf $(TARGET_DIR)/var/spool/asterisk rm -f $(TARGET_DIR)/etc/init.d/asterisk rm -f $(TARGET_DIR)/usr/sbin/stereorize rm -f $(TARGET_DIR)/usr/sbin/streamplayer + rm -rf $(STAGING_DIR)/usr/include/asterisk rm -Rf $(TARGET_DIR)/stat/var/lib/asterisk rm -Rf $(TARGET_DIR)/stat/var/spool/asterisk rm -Rf $(TARGET_DIR)/stat/etc/asterisk -$(MAKE) -C $(ASTERISK_DIR) clean - -rm $(BUILD_DIR)/asterisk + -rm -rf $(BUILD_DIR)/asterisk + -rm -rf $(BUILD_DIR)/asterisk-$(ASTERISK_VERSION) asterisk-sounds-clean: -rm -rf $(TARGET_DIR)/stat/var/lib/asterisk/sounds @@ -161,7 +189,6 @@ asterisk-dirclean: rm -rf $(ASTERISK_DIR) - -rm $(BUILD_DIR)/asterisk ############################################################# # Deleted: trunk/package/asterisk/asterisk_no_res_ninit.patch =================================================================== --- trunk/package/asterisk/asterisk_no_res_ninit.patch 2008-01-08 16:58:50 UTC (rev 1492) +++ trunk/package/asterisk/asterisk_no_res_ninit.patch 2008-01-08 20:37:20 UTC (rev 1493) @@ -1,12 +0,0 @@ -diff -ur /tmp/asterisk-1.2.0-beta1/dns.c asterisk-1.2.0-beta1/dns.c ---- /tmp/asterisk-1.2.0-beta1/dns.c 2005-08-14 04:23:33.000000000 +0200 -+++ asterisk-1.2.0-beta1/dns.c 2005-08-31 09:42:36.000000000 +0200 -@@ -157,7 +157,7 @@ - return 0; - } - --#if defined(res_ninit) -+#if (defined(res_ninit) && !defined(__UCLIBC__)) - #define HAS_RES_NINIT - #else - AST_MUTEX_DEFINE_STATIC(res_lock); Deleted: trunk/package/asterisk/asterisk_uclibc.patch =================================================================== --- trunk/package/asterisk/asterisk_uclibc.patch 2008-01-08 16:58:50 UTC (rev 1492) +++ trunk/package/asterisk/asterisk_uclibc.patch 2008-01-08 20:37:20 UTC (rev 1493) @@ -1,11 +0,0 @@ ---- asterisk-1.2.1/include/asterisk/compat.h.orig 2005-12-20 23:04:56 +0000 -+++ asterisk-1.2.1/include/asterisk/compat.h 2005-12-20 23:05:19 +0000 -@@ -74,7 +74,7 @@ - #define HAVE_VASPRINTF - #define HAVE_STRTOQ - --#ifdef _BSD_SOURCE -+#if defined(_BSD_SOURCE) && !defined(__UCLIBC__) - #define HAVE_GETLOADAVG - #endif - Added: trunk/package/asterisk/backport-app_stack.patch =================================================================== --- trunk/package/asterisk/backport-app_stack.patch (rev 0) +++ trunk/package/asterisk/backport-app_stack.patch 2008-01-08 20:37:20 UTC (rev 1493) @@ -0,0 +1,225 @@ +diff -ur asterisk-1.4.11.orig/apps/app_stack.c asterisk-1.4.11/apps/app_stack.c +--- asterisk-1.4.11.orig/apps/app_stack.c 2007-03-20 13:48:17.000000000 -0400 ++++ asterisk-1.4.11/apps/app_stack.c 2007-09-17 15:13:31.000000000 -0400 +@@ -1,7 +1,7 @@ + /* + * Asterisk -- An open source telephony toolkit. + * +- * Copyright (c) 2004-2006 Tilghman Lesher <app...@th...>. ++ * Copyright (c) 2004-2006 Tilghman Lesher <app...@th...>. + * + * This code is released by the author with no restrictions on usage. + * +@@ -20,14 +20,14 @@ + * + * \brief Stack applications Gosub, Return, etc. + * +- * \author Tilghman Lesher <app...@th...> ++ * \author Tilghman Lesher <app...@th...> + * + * \ingroup applications + */ + + #include "asterisk.h" + +-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 59070 $") ++ASTERISK_FILE_VERSION(__FILE__, "$Revision: 44252 $") + + #include <stdio.h> + #include <stdlib.h> +@@ -41,6 +41,7 @@ + #include "asterisk/pbx.h" + #include "asterisk/module.h" + #include "asterisk/config.h" ++#include "asterisk/app.h" + + #define STACKVAR "~GOSUB~STACK~" + +@@ -56,16 +57,17 @@ + static const char *pop_synopsis = "Remove one address from gosub stack"; + + static const char *gosub_descrip = +-"Gosub([[context|]exten|]priority)\n" ++"Gosub([[context|]exten|]priority[(arg1[|...][|argN])])\n" + " Jumps to the label specified, saving the return address.\n"; + static const char *gosubif_descrip = +-"GosubIf(condition?labeliftrue[:labeliffalse])\n" ++"GosubIf(condition?labeliftrue[(arg1[|...])][:labeliffalse[(arg1[|...])]])\n" + " If the condition is true, then jump to labeliftrue. If false, jumps to\n" + "labeliffalse, if specified. In either case, a jump saves the return point\n" + "in the dialplan, to be returned to with a Return.\n"; + static const char *return_descrip = +-"Return()\n" +-" Jumps to the last label on the stack, removing it.\n"; ++"Return([return-value])\n" ++" Jumps to the last label on the stack, removing it. The return value, if\n" ++"any, is saved in the channel variable GOSUB_RETVAL.\n"; + static const char *pop_descrip = + "StackPop()\n" + " Removes last label on the stack, discarding it.\n"; +@@ -73,6 +75,20 @@ + + static int pop_exec(struct ast_channel *chan, void *data) + { ++ const char *frame = pbx_builtin_getvar_helper(chan, STACKVAR); ++ int numargs = 0, i; ++ char argname[15]; ++ ++ /* Pop any arguments for this stack frame off the variable stack */ ++ if (frame) { ++ numargs = atoi(frame); ++ for (i = 1; i <= numargs; i++) { ++ snprintf(argname, sizeof(argname), "ARG%d", i); ++ pbx_builtin_setvar_helper(chan, argname, NULL); ++ } ++ } ++ ++ /* Remove the last frame from the Gosub stack */ + pbx_builtin_setvar_helper(chan, STACKVAR, NULL); + + return 0; +@@ -81,38 +97,86 @@ + static int return_exec(struct ast_channel *chan, void *data) + { + const char *label = pbx_builtin_getvar_helper(chan, STACKVAR); ++ char argname[15], *retval = data; ++ int numargs, i; + + if (ast_strlen_zero(label)) { + ast_log(LOG_ERROR, "Return without Gosub: stack is empty\n"); + return -1; +- } else if (ast_parseable_goto(chan, label)) { ++ } ++ ++ /* Pop any arguments for this stack frame off the variable stack */ ++ numargs = atoi(label); ++ for (i = 1; i <= numargs; i++) { ++ snprintf(argname, sizeof(argname), "ARG%d", i); ++ pbx_builtin_setvar_helper(chan, argname, NULL); ++ } ++ ++ /* If the label exists, it will always have a ':' */ ++ label = strchr(label, ':') + 1; ++ ++ if (ast_parseable_goto(chan, label)) { + ast_log(LOG_WARNING, "No next statement after Gosub?\n"); + return -1; + } + ++ /* Remove the current frame from the Gosub stack */ + pbx_builtin_setvar_helper(chan, STACKVAR, NULL); ++ ++ /* Set a return value, if any */ ++ pbx_builtin_setvar_helper(chan, "GOSUB_RETVAL", S_OR(retval, "")); + return 0; + } + + static int gosub_exec(struct ast_channel *chan, void *data) + { +- char newlabel[AST_MAX_EXTENSION * 2 + 3 + 11]; ++ char newlabel[AST_MAX_EXTENSION + AST_MAX_CONTEXT + 11 + 11 + 4]; ++ char argname[15], *tmp = ast_strdupa(data), *label, *endparen; ++ int i; + struct ast_module_user *u; ++ AST_DECLARE_APP_ARGS(args2, ++ AST_APP_ARG(argval)[100]; ++ ); + + if (ast_strlen_zero(data)) { +- ast_log(LOG_ERROR, "%s requires an argument: %s([[context|]exten|]priority)\n", app_gosub, app_gosub); ++ ast_log(LOG_ERROR, "%s requires an argument: %s([[context|]exten|]priority[(arg1[|...][|argN])])\n", app_gosub, app_gosub); + return -1; + } + + u = ast_module_user_add(chan); +- snprintf(newlabel, sizeof(newlabel), "%s|%s|%d", chan->context, chan->exten, chan->priority + 1); + +- if (ast_parseable_goto(chan, data)) { ++ /* Separate the arguments from the label */ ++ /* NOTE: you cannot use ast_app_separate_args for this, because '(' cannot be used as a delimiter. */ ++ label = strsep(&tmp, "("); ++ if (tmp) { ++ endparen = strrchr(tmp, ')'); ++ if (endparen) ++ *endparen = '\0'; ++ else ++ ast_log(LOG_WARNING, "Ouch. No closing paren: '%s'?\n", (char *)data); ++ AST_STANDARD_APP_ARGS(args2, tmp); ++ } else ++ args2.argc = 0; ++ ++ /* Create the return address, but don't save it until we know that the Gosub destination exists */ ++ snprintf(newlabel, sizeof(newlabel), "%d:%s|%s|%d", args2.argc, chan->context, chan->exten, chan->priority + 1); ++ ++ if (ast_parseable_goto(chan, label)) { ++ ast_log(LOG_ERROR, "Gosub address is invalid: '%s'\n", (char *)data); + ast_module_user_remove(u); + return -1; + } + ++ /* Now that we know for certain that we're going to a new location, set our arguments */ ++ for (i = 0; i < args2.argc; i++) { ++ snprintf(argname, sizeof(argname), "ARG%d", i + 1); ++ pbx_builtin_pushvar_helper(chan, argname, args2.argval[i]); ++ ast_log(LOG_DEBUG, "Setting '%s' to '%s'\n", argname, args2.argval[i]); ++ } ++ ++ /* And finally, save our return address */ + pbx_builtin_pushvar_helper(chan, STACKVAR, newlabel); ++ ast_log(LOG_DEBUG, "Setting gosub return address to '%s'\n", newlabel); + ast_module_user_remove(u); + + return 0; +@@ -121,28 +185,39 @@ + static int gosubif_exec(struct ast_channel *chan, void *data) + { + struct ast_module_user *u; +- char *condition="", *label1, *label2, *args; ++ char *args; + int res=0; ++ AST_DECLARE_APP_ARGS(cond, ++ AST_APP_ARG(ition); ++ AST_APP_ARG(labels); ++ ); ++ AST_DECLARE_APP_ARGS(label, ++ AST_APP_ARG(iftrue); ++ AST_APP_ARG(iffalse); ++ ); + + if (ast_strlen_zero(data)) { +- ast_log(LOG_WARNING, "GosubIf requires an argument\n"); ++ ast_log(LOG_WARNING, "GosubIf requires an argument: GosubIf(cond?label1(args):label2(args)\n"); + return 0; + } + ++ u = ast_module_user_add(chan); ++ + args = ast_strdupa(data); ++ AST_NONSTANDARD_APP_ARGS(cond, args, '?'); ++ if (cond.argc != 2) { ++ ast_log(LOG_WARNING, "GosubIf requires an argument: GosubIf(cond?label1(args):label2(args)\n"); ++ ast_module_user_remove(u); ++ return 0; ++ } + +- u = ast_module_user_add(chan); ++ AST_NONSTANDARD_APP_ARGS(label, cond.labels, ':'); + +- condition = strsep(&args, "?"); +- label1 = strsep(&args, ":"); +- label2 = args; +- +- if (pbx_checkcondition(condition)) { +- if (label1) { +- res = gosub_exec(chan, label1); +- } +- } else if (label2) { +- res = gosub_exec(chan, label2); ++ if (pbx_checkcondition(cond.ition)) { ++ if (!ast_strlen_zero(label.iftrue)) ++ res = gosub_exec(chan, label.iftrue); ++ } else if (!ast_strlen_zero(label.iffalse)) { ++ res = gosub_exec(chan, label.iffalse); + } + + ast_module_user_remove(u); Added: trunk/package/asterisk/backport-func_odbc.patch =================================================================== --- trunk/package/asterisk/backport-func_odbc.patch (rev 0) +++ trunk/package/asterisk/backport-func_odbc.patch 2008-01-08 20:37:20 UTC (rev 1493) @@ -0,0 +1,962 @@ +diff -ur asterisk-1.4.11.orig/configs/func_odbc.conf.sample asterisk-1.4.11/configs/func_odbc.conf.sample +--- asterisk-1.4.11.orig/configs/func_odbc.conf.sample 2006-09-18 10:53:54.000000000 -0400 ++++ asterisk-1.4.11/configs/func_odbc.conf.sample 2007-09-17 13:07:39.000000000 -0400 +@@ -21,21 +21,31 @@ + + ; ODBC_SQL - Allow an SQL statement to be built entirely in the dialplan + [SQL] +-dsn=mysql1 +-read=${ARG1} ++readhandle=mysql1 ++readsql=${ARG1} + + ; ODBC_ANTIGF - A blacklist. + [ANTIGF] +-dsn=mysql1 +-read=SELECT COUNT(*) FROM exgirlfriends WHERE callerid='${SQL_ESC(${ARG1})}' ++readhandle=mysql1 ++readsql=SELECT COUNT(*) FROM exgirlfriends WHERE callerid='${SQL_ESC(${ARG1})}' + + ; ODBC_PRESENCE - Retrieve and update presence + [PRESENCE] +-dsn=mysql1 +-read=SELECT location FROM presence WHERE id='${SQL_ESC(${ARG1})}' +-write=UPDATE presence SET location='${SQL_ESC(${VAL1})}' WHERE id='${SQL_ESC(${ARG1})}' +-;prefix=OFFICE ; Changes this function from ODBC_PRESENCE to OFFICE_PRESENCE +-;escapecommas=no ; Normally, commas within a field are escaped such that each +- ; field may be separated into individual variables with ARRAY. +- ; This option turns that behavior off [default=yes]. ++readhandle=mysql1 ++writehandle=mysql1 ++readsql=SELECT location FROM presence WHERE id='${SQL_ESC(${ARG1})}' ++writesql=UPDATE presence SET location='${SQL_ESC(${VAL1})}' WHERE id='${SQL_ESC(${ARG1})}' ++; ++;prefix=OFFICE ; Changes this function from ODBC_PRESENCE to OFFICE_PRESENCE ++;escapecommas=no ; Normally, commas within a field are escaped such that each ++ ; field may be separated into individual variables with ARRAY or HASH. ++ ; This option turns that behavior off [default=yes]. ++;mode=multirow ; Enable multirow fetching. Instead of returning results directly, ++ ; mode=multirow queries will return a result-id, which can be passed ++ ; multiple times to ODBC_FETCH, and that function will return each ++ ; row, in order. You can add to this the following parameter: ++;rowlimit=5 ; rowlimit will limit the number of rows retrieved and stored from ++ ; the database. If not specified, all rows, up to available memory, ++ ; will be retrieved and stored. ++ + +diff -ur asterisk-1.4.11.orig/funcs/func_odbc.c asterisk-1.4.11/funcs/func_odbc.c +--- asterisk-1.4.11.orig/funcs/func_odbc.c 2007-06-18 12:35:02.000000000 -0400 ++++ asterisk-1.4.11/funcs/func_odbc.c 2007-09-17 13:07:17.000000000 -0400 +@@ -32,13 +32,14 @@ + + #include "asterisk.h" + +-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 69702 $") ++ASTERISK_FILE_VERSION(__FILE__, "$Revision: 40 $") + + #include <sys/types.h> + #include <stdio.h> + #include <stdlib.h> + #include <unistd.h> + #include <string.h> ++#include <errno.h> + + #include "asterisk/module.h" + #include "asterisk/file.h" +@@ -53,21 +54,269 @@ + + static char *config = "func_odbc.conf"; + ++#define HASH_PREFIX "~HASH~%s~" ++#define HASH_FORMAT HASH_PREFIX "%s~" ++ + enum { + OPT_ESCAPECOMMAS = (1 << 0), ++ OPT_MULTIROW = (1 << 1), + } odbc_option_flags; + + struct acf_odbc_query { + AST_LIST_ENTRY(acf_odbc_query) list; +- char dsn[30]; ++ char readhandle[5][30]; ++ char writehandle[5][30]; + char sql_read[2048]; + char sql_write[2048]; + unsigned int flags; ++ int rowlimit; + struct ast_custom_function *acf; + }; + ++static void odbc_datastore_free(void *data); ++ ++struct ast_datastore_info odbc_info = { ++ .type = "FUNC_ODBC", ++ .destroy = odbc_datastore_free, ++}; ++ ++/* For storing each result row */ ++struct odbc_datastore_row { ++ AST_LIST_ENTRY(odbc_datastore_row) list; ++ char data[0]; ++}; ++ ++/* For storing each result set */ ++struct odbc_datastore { ++ AST_LIST_HEAD(, odbc_datastore_row); ++ char names[0]; ++}; ++ + AST_LIST_HEAD_STATIC(queries, acf_odbc_query); + ++static int resultcount = 0; ++AST_MUTEX_DEFINE_STATIC(resultlock); ++ ++static void odbc_datastore_free(void *data) ++{ ++ struct odbc_datastore *result = data; ++ struct odbc_datastore_row *row; ++ AST_LIST_LOCK(result); ++ while ((row = AST_LIST_REMOVE_HEAD(result, list))) { ++ ast_free(row); ++ } ++ AST_LIST_UNLOCK(result); ++ AST_LIST_HEAD_DESTROY(result); ++ ast_free(result); ++} ++ ++static char *app_clearhash = "ClearHash"; ++static char *syn_clearhash = "Clear the keys from a specified hashname"; ++static char *desc_clearhash = ++"ClearHash(<hashname>)\n" ++" Clears all keys out of the specified hashname\n"; ++ ++/* This function probably should migrate to main/pbx.c, as pbx_builtin_clearvar_prefix() */ ++static void clearvar_prefix(struct ast_channel *chan, const char *prefix) ++{ ++ struct ast_var_t *newvar; ++ int len = strlen(prefix); ++ AST_LIST_TRAVERSE_SAFE_BEGIN(&chan->varshead, newvar, entries) { ++ if (strncasecmp(prefix, ast_var_name(newvar), len) == 0) { ++ AST_LIST_REMOVE_CURRENT(&chan->varshead, entries); ++ free(newvar); ++ } ++ } ++ AST_LIST_TRAVERSE_SAFE_END ++} ++ ++static int exec_clearhash(struct ast_channel *chan, void *data) ++{ ++ char prefix[80]; ++ snprintf(prefix, sizeof(prefix), HASH_PREFIX, data ? (char *)data : "null"); ++ clearvar_prefix(chan, prefix); ++ return 0; ++} ++ ++static int array(struct ast_channel *chan, char *cmd, char *var, const char *value) ++{ ++ AST_DECLARE_APP_ARGS(arg1, ++ AST_APP_ARG(var)[100]; ++ ); ++ AST_DECLARE_APP_ARGS(arg2, ++ AST_APP_ARG(val)[100]; ++ ); ++ char *origvar = "", *value2, varname[256]; ++ int i, ishash = 0; ++ ++ value2 = ast_strdupa(value); ++ if (!var || !value2) ++ return -1; ++ ++ if (!strcmp(cmd, "HASH")) { ++ const char *var2 = pbx_builtin_getvar_helper(chan, "~ODBCFIELDS~"); ++ origvar = var; ++ if (var2) ++ var = ast_strdupa(var2); ++ else ++ return -1; ++ ishash = 1; ++ } ++ ++ /* The functions this will generally be used with are SORT and ODBC_*, which ++ * both return comma-delimited lists. However, if somebody uses literal lists, ++ * their commas will be translated to vertical bars by the load, and I don't ++ * want them to be surprised by the result. Hence, we prefer commas as the ++ * delimiter, but we'll fall back to vertical bars if commas aren't found. ++ */ ++ ast_log(LOG_DEBUG, "array (%s=%s)\n", var, value2); ++ if (strchr(var, ',')) ++ AST_NONSTANDARD_APP_ARGS(arg1, var, ','); ++ else ++ AST_STANDARD_APP_ARGS(arg1, var); ++ ++ if (strchr(value2, ',')) ++ AST_NONSTANDARD_APP_ARGS(arg2, value2, ','); ++ else ++ AST_STANDARD_APP_ARGS(arg2, value2); ++ ++ for (i = 0; i < arg1.argc; i++) { ++ ast_log(LOG_DEBUG, "array set value (%s=%s)\n", arg1.var[i], ++ arg2.val[i]); ++ if (i < arg2.argc) { ++ if (ishash) { ++ snprintf(varname, sizeof(varname), HASH_FORMAT, origvar, arg1.var[i]); ++ pbx_builtin_setvar_helper(chan, varname, arg2.val[i]); ++ } else { ++ pbx_builtin_setvar_helper(chan, arg1.var[i], arg2.val[i]); ++ } ++ } else { ++ /* We could unset the variable, by passing a NULL, but due to ++ * pushvar semantics, that could create some undesired behavior. */ ++ if (ishash) { ++ snprintf(varname, sizeof(varname), HASH_FORMAT, origvar, arg1.var[i]); ++ pbx_builtin_setvar_helper(chan, varname, ""); ++ } else { ++ pbx_builtin_setvar_helper(chan, arg1.var[i], ""); ++ } ++ } ++ } ++ ++ return 0; ++} ++ ++static int hashkeys_read(struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len) ++{ ++ struct ast_var_t *newvar; ++ int plen; ++ char prefix[80]; ++ snprintf(prefix, sizeof(prefix), HASH_PREFIX, data); ++ plen = strlen(prefix); ++ ++ memset(buf, 0, len); ++ AST_LIST_TRAVERSE(&chan->varshead, newvar, entries) { ++ if (strncasecmp(prefix, ast_var_name(newvar), plen) == 0) { ++ /* Copy everything after the prefix */ ++ strncat(buf, ast_var_name(newvar) + plen, len); ++ /* Trim the trailing ~ */ ++ buf[strlen(buf) - 1] = ','; ++ } ++ } ++ /* Trim the trailing comma */ ++ buf[strlen(buf) - 1] = '\0'; ++ return 0; ++} ++ ++static int hash_write(struct ast_channel *chan, char *cmd, char *var, const char *value) ++{ ++ char varname[256]; ++ AST_DECLARE_APP_ARGS(arg, ++ AST_APP_ARG(hashname); ++ AST_APP_ARG(hashkey); ++ ); ++ ++ if (!strchr(var, '|')) { ++ /* Single argument version */ ++ return array(chan, "HASH", var, value); ++ } ++ ++ AST_STANDARD_APP_ARGS(arg, var); ++ snprintf(varname, sizeof(varname), HASH_FORMAT, arg.hashname, arg.hashkey); ++ pbx_builtin_setvar_helper(chan, varname, value); ++ ++ return 0; ++} ++ ++static int hash_read(struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len) ++{ ++ char varname[256]; ++ const char *varvalue; ++ AST_DECLARE_APP_ARGS(arg, ++ AST_APP_ARG(hashname); ++ AST_APP_ARG(hashkey); ++ ); ++ ++ AST_STANDARD_APP_ARGS(arg, data); ++ if (arg.argc == 2) { ++ snprintf(varname, sizeof(varname), HASH_FORMAT, arg.hashname, arg.hashkey); ++ varvalue = pbx_builtin_getvar_helper(chan, varname); ++ if (varvalue) ++ ast_copy_string(buf, varvalue, len); ++ else ++ *buf = '\0'; ++ } else if (arg.argc == 1) { ++ char colnames[4096]; ++ int i; ++ AST_DECLARE_APP_ARGS(arg2, ++ AST_APP_ARG(col)[100]; ++ ); ++ ++ /* Get column names, in no particular order */ ++ hashkeys_read(chan, "HASHKEYS", arg.hashname, colnames, sizeof(colnames)); ++ pbx_builtin_setvar_helper(chan, "~ODBCFIELDS~", colnames); ++ ++ AST_NONSTANDARD_APP_ARGS(arg2, colnames, ','); ++ *buf = '\0'; ++ ++ /* Now get the corresponding column values, in exactly the same order */ ++ for (i = 0; i < arg2.argc; i++) { ++ snprintf(varname, sizeof(varname), HASH_FORMAT, arg.hashname, arg2.col[i]); ++ varvalue = pbx_builtin_getvar_helper(chan, varname); ++ strncat(buf, varvalue, len); ++ strncat(buf, ",", len); ++ } ++ ++ /* Strip trailing comma */ ++ buf[strlen(buf) - 1] = '\0'; ++ } ++ ++ return 0; ++} ++ ++static struct ast_custom_function hash_function = { ++ .name = "HASH", ++ .synopsis = "Implementation of a dialplan associative array", ++ .syntax = "HASH(hashname[|hashkey])", ++ .write = hash_write, ++ .read = hash_read, ++ .desc = ++ "In two argument mode, gets and sets values to corresponding keys within a named\n" ++ "associative array. The single-argument mode will only work when assigned to from\n" ++ "a function defined by func_odbc.so.\n", ++}; ++ ++static struct ast_custom_function hashkeys_function = { ++ .name = "HASHKEYS", ++ .synopsis = "Retrieve the keys of a HASH()", ++ .syntax = "HASHKEYS(<hashname>)", ++ .read = hashkeys_read, ++ .desc = ++ "Returns a comma-delimited list of the current keys of an associative array\n" ++ "defined by the HASH() function. Note that if you iterate over the keys of\n" ++ "the result, adding keys during iteration will cause the result of the HASHKEYS\n" ++ "function to change.\n", ++}; ++ + static SQLHSTMT generic_prepare(struct odbc_obj *obj, void *data) + { + int res; +@@ -99,15 +348,15 @@ + struct odbc_obj *obj; + struct acf_odbc_query *query; + char *t, buf[2048]="", varname[15]; +- int i; ++ int i, dsn; + AST_DECLARE_APP_ARGS(values, + AST_APP_ARG(field)[100]; + ); + AST_DECLARE_APP_ARGS(args, + AST_APP_ARG(field)[100]; + ); +- SQLHSTMT stmt; +- SQLLEN rows=0; ++ SQLHSTMT stmt = NULL; ++ SQLINTEGER rows=-1; + + AST_LIST_LOCK(&queries); + AST_LIST_TRAVERSE(&queries, query, list) { +@@ -122,14 +371,6 @@ + return -1; + } + +- obj = ast_odbc_request_obj(query->dsn, 0); +- +- if (!obj) { +- ast_log(LOG_ERROR, "No database handle available with the name of '%s' (check res_odbc.conf)\n", query->dsn); +- AST_LIST_UNLOCK(&queries); +- return -1; +- } +- + /* Parse our arguments */ + t = value ? ast_strdupa(value) : ""; + +@@ -172,7 +413,15 @@ + + AST_LIST_UNLOCK(&queries); + +- stmt = ast_odbc_prepare_and_execute(obj, generic_prepare, buf); ++ for (dsn = 0; dsn < 5; dsn++) { ++ if (!ast_strlen_zero(query->writehandle[dsn])) { ++ obj = ast_odbc_request_obj(query->writehandle[dsn], 0); ++ if (obj) ++ stmt = ast_odbc_prepare_and_execute(obj, generic_prepare, buf); ++ } ++ if (stmt) ++ break; ++ } + + if (stmt) { + /* Rows affected */ +@@ -198,16 +447,20 @@ + + static int acf_odbc_read(struct ast_channel *chan, char *cmd, char *s, char *buf, size_t len) + { +- struct odbc_obj *obj; ++ struct odbc_obj *obj = NULL; + struct acf_odbc_query *query; +- char sql[2048] = "", varname[15]; +- int res, x, buflen = 0, escapecommas; ++ char sql[2048] = "", varname[15], colnames[2048] = "", rowcount[12] = "-1"; ++ int res, x, y, buflen = 0, escapecommas, rowlimit = 1, dsn; + AST_DECLARE_APP_ARGS(args, + AST_APP_ARG(field)[100]; + ); + SQLHSTMT stmt; +- SQLSMALLINT colcount=0; +- SQLLEN indicator; ++ SQLSMALLINT colcount=0, diagbytes=0; ++ SQLINTEGER indicator, nativeerror=0, numfields=0; ++ SQLSMALLINT collength; ++ unsigned char state[10], diagnostic... [truncated message content] |
From: <kr...@us...> - 2008-01-14 16:36:36
|
Revision: 1517 http://astlinux.svn.sourceforge.net/astlinux/?rev=1517&view=rev Author: krisk84 Date: 2008-01-14 08:36:08 -0800 (Mon, 14 Jan 2008) Log Message: ----------- initial check-in of nprobe - still needs some work Modified Paths: -------------- trunk/package/Config.in Added Paths: ----------- trunk/package/nprobe/ trunk/package/nprobe/Config.in trunk/package/nprobe/nprobe-disablemysql.patch trunk/package/nprobe/nprobe-ipv6disable.patch trunk/package/nprobe/nprobe-nospinlock.patch trunk/package/nprobe/nprobe.mk Modified: trunk/package/Config.in =================================================================== --- trunk/package/Config.in 2008-01-13 05:39:11 UTC (rev 1516) +++ trunk/package/Config.in 2008-01-14 16:36:08 UTC (rev 1517) @@ -127,6 +127,7 @@ source "package/newt/Config.in" source "package/nistnet/Config.in" source "package/nocatsplash/Config.in" +source "package/nprobe/Config.in" source "package/ntp/Config.in" source "package/openntpd/Config.in" source "package/openser/Config.in" Added: trunk/package/nprobe/Config.in =================================================================== --- trunk/package/nprobe/Config.in (rev 0) +++ trunk/package/nprobe/Config.in 2008-01-14 16:36:08 UTC (rev 1517) @@ -0,0 +1,18 @@ +config BR2_PACKAGE_NPROBE + bool "nprobe" + default n + help + Super-sweet netflow collector from the folks at ntop.org. + NProbe is distributed under the terms of the GPL but they + require a small donation to get access to the source. We + will NOT give it to you - DO NOT ASK. Pay for it - it's + worth it and you support open source. + + http://www.ntop.org/nProbe.html + +config BR2_PACKAGE_NPROBE_SITE + string "nprobe-site" + default "http://www.something.com" + depends on BR2_PACKAGE_NPROBE + help + Where is the NProbe source code? Added: trunk/package/nprobe/nprobe-disablemysql.patch =================================================================== --- trunk/package/nprobe/nprobe-disablemysql.patch (rev 0) +++ trunk/package/nprobe/nprobe-disablemysql.patch 2008-01-14 16:36:08 UTC (rev 1517) @@ -0,0 +1,24 @@ +diff -ur nProbe.orig/configure.in nProbe/configure.in +--- nProbe.orig/configure.in 2007-09-17 18:39:04.000000000 -0400 ++++ nProbe/configure.in 2008-01-14 00:08:05.000000000 -0500 +@@ -170,20 +170,6 @@ + dnl> checks for system header files + dnl> + +-AC_CHECK_TOOL(MYSQL, mysql_config) +-if test "x$ac_cv_prog_ac_ct_MYSQL" = "xmysql_config"; then +- MYSQLLIBS="`mysql_config --libs_r`|grep Usage" +- if test ".$MYSQLLIBS" != "."; then +- LIBS="${LIBS} `mysql_config --libs`" +- else +- LIBS="${LIBS} `mysql_config --libs_r`" +- fi +- INCS="${INCS} `mysql_config --cflags`" +- AC_DEFINE_UNQUOTED(HAVE_MYSQL, 1, [use mysql]) +-dnl> LIBS="${LIBS} -lwrap" +-else +- echo "MySQL not found. Database support disabled"; +-fi + + + AC_CHECK_LIB([sqlite3], [sqlite3_open], AC_DEFINE_UNQUOTED(HAVE_SQLITE, 1, [use sqlite])) Added: trunk/package/nprobe/nprobe-ipv6disable.patch =================================================================== --- trunk/package/nprobe/nprobe-ipv6disable.patch (rev 0) +++ trunk/package/nprobe/nprobe-ipv6disable.patch 2008-01-14 16:36:08 UTC (rev 1517) @@ -0,0 +1,29 @@ +--- nProbe.orig/nprobe.c 2007-09-17 18:39:04.000000000 -0400 ++++ nProbe/nprobe.c 2008-01-14 00:28:53.000000000 -0500 +@@ -313,8 +313,10 @@ + u_short eth_type, off=0, numPkts = 1; + u_int8_t flags = 0, proto = 0; + struct ip ip; ++#ifndef IPV4_ONLY + struct ip6_hdr ipv6; + struct ip6_ext ipv6ext; ++#endif + struct tcphdr tp; + struct udphdr up; + struct icmp icmpPkt; +@@ -455,6 +457,7 @@ + isFragment = (ntohs(ip.ip_off) & 0x3fff) ? 1 : 0; + + off = ntohs(ip.ip_off); ++#ifndef IPV4_ONLY + } else if(eth_type == ETHERTYPE_IPV6) { + memcpy(&ipv6, p+ehshift, sizeof(struct ip6_hdr)); + if(((ipv6.ip6_vfc >> 4) & 0x0f) != 6) return; /* IP v6 only */ +@@ -487,6 +490,7 @@ + proto = ipv6ext.ip6e_nxt; + } + } else ++#endif + return; /* Anything else that's not IPv4/v6 */ + + plen = length-ehshift; Added: trunk/package/nprobe/nprobe-nospinlock.patch =================================================================== --- trunk/package/nprobe/nprobe-nospinlock.patch (rev 0) +++ trunk/package/nprobe/nprobe-nospinlock.patch 2008-01-14 16:36:08 UTC (rev 1517) @@ -0,0 +1,24 @@ +diff -ur nProbe.orig/configure.in nProbe/configure.in +--- nProbe.orig/configure.in 2007-09-17 18:39:04.000000000 -0400 ++++ nProbe/configure.in 2008-01-14 00:03:46.000000000 -0500 +@@ -217,20 +217,6 @@ + AC_CHECK_HEADERS(sched.h sys/sched.h semaphore.h pthread.h) + AC_CHECK_LIB(pthread, pthread_create) + +-AC_MSG_CHECKING([if spin locks are supported]) +-AC_TRY_RUN([ +-#include <pthread.h> +- +-int main() +-{ +- pthread_spinlock_t t; +- return 0; +-} +- +-] +-, [ AC_MSG_RESULT(yes) AC_DEFINE_UNQUOTED(HAVE_SPIN_LOCK, 1, [pthread has spin locks]) ], [AC_MSG_RESULT(no)] +-) +-dnl> AC_CHECK_LIB([pthread], [pthread_spin_init], AC_DEFINE_UNQUOTED(HAVE_SPIN_LOCK, 1, [pthread has spin locks])) + AC_CHECK_LIB(dl, dlopen) + + Added: trunk/package/nprobe/nprobe.mk =================================================================== --- trunk/package/nprobe/nprobe.mk (rev 0) +++ trunk/package/nprobe/nprobe.mk 2008-01-14 16:36:08 UTC (rev 1517) @@ -0,0 +1,65 @@ +############################################################# +# +# nprobe +# +############################################################# +NPROBE_VER:=4.9.4 +NPROBE_DIR:=$(BUILD_DIR)/nProbe +NPROBE_SITE:=$(BR2_PACKAGE_NPROBE_SITE) +NPROBE_SOURCE:=nProbe-$(NPROBE_VER).tar.gz +NPROBE_CAT:=zcat +NPROBE_BINARY:=less +NPROBE_TARGET_BINARY:=usr/sbin/nprobe + +$(DL_DIR)/$(NPROBE_SOURCE): + $(WGET) -P $(DL_DIR) $(NPROBE_SITE)/$(NPROBE_SOURCE) + +nprobe-source: $(DL_DIR)/$(NPROBE_SOURCE) + +$(NPROBE_DIR)/.unpacked: $(DL_DIR)/$(NPROBE_SOURCE) + $(NPROBE_CAT) $(DL_DIR)/$(NPROBE_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) - + toolchain/patch-kernel.sh $(NPROBE_DIR) package/nprobe/ nprobe*.patch + touch $(NPROBE_DIR)/.unpacked + +$(NPROBE_DIR)/.configured: $(NPROBE_DIR)/.unpacked + ( \ + cd $(NPROBE_DIR) ; \ + BUILD_CC=$(TARGET_CC) HOSTCC="$(HOSTCC)" \ + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS)" \ + ./autogen.sh \ + --target=$(GNU_TARGET_NAME) \ + --host=$(GNU_TARGET_NAME) \ + --build=$(GNU_HOST_NAME) \ + --prefix=$(STAGING_DIR)/usr \ + --with-only-ipv4 \ + ) + touch $(NPROBE_DIR)/.configured + +$(NPROBE_DIR)/$(NPROBE_BINARY): $(NPROBE_DIR)/.configured + $(MAKE1) -C $(NPROBE_DIR) + +$(TARGET_DIR)/$(NPROBE_TARGET_BINARY): $(NPROBE_DIR)/$(NPROBE_BINARY) + $(MAKE) \ + -C $(NPROBE_DIR) \ + prefix=$(STAGING_DIR) \ + exec_prefix=$(STAGING_DIR) \ + bindir=$(STAGING_DIR)/bin \ + datadir=$(STAGING_DIR)/share \ + fudge + +nprobe: uclibc libpcap zlib $(TARGET_DIR)/$(NPROBE_TARGET_BINARY) + +nprobe-clean: + -$(MAKE) -C $(NPROBE_DIR) clean + +nprobe-dirclean: + rm -rf $(NPROBE_DIR) +############################################################# +# +# Toplevel Makefile options +# +############################################################# +ifeq ($(strip $(BR2_PACKAGE_NPROBE)),y) +TARGETS+=nprobe +endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |