+++ /dev/null
---- libnids-1.17/src/checksum.c.org 2002-08-21 15:11:09.000000000 +0000
-+++ libnids-1.17/src/checksum.c 2003-07-03 14:25:29.000000000 +0000
-@@ -29,62 +29,62 @@
- movl 16(%esp),%ecx # Function arg: int len
- movl 12(%esp),%esi # Function arg: u_char *buff*/
-
-- "testl $2, %%esi
-- jz 2f
-- subl $2, %%ecx
-- jae 1f
-- addl $2, %%ecx
-- jmp 4f
--1: movw (%%esi), %%bx
-- addl $2, %%esi
-- addw %%bx, %%ax
-- adcl $0, %%eax
--2:
-- movl %%ecx, %%edx
-- shrl $5, %%ecx
-- jz 2f
-- testl %%esi, %%esi
--1: movl (%%esi), %%ebx
-- adcl %%ebx, %%eax
-- movl 4(%%esi), %%ebx
-- adcl %%ebx, %%eax
-- movl 8(%%esi), %%ebx
-- adcl %%ebx, %%eax
-- movl 12(%%esi), %%ebx
-- adcl %%ebx, %%eax
-- movl 16(%%esi), %%ebx
-- adcl %%ebx, %%eax
-- movl 20(%%esi), %%ebx
-- adcl %%ebx, %%eax
-- movl 24(%%esi), %%ebx
-- adcl %%ebx, %%eax
-- movl 28(%%esi), %%ebx
-- adcl %%ebx, %%eax
-- lea 32(%%esi), %%esi
-- dec %%ecx
-- jne 1b
-- adcl $0, %%eax
--2: movl %%edx, %%ecx
-- andl $0x1c, %%edx
-- je 4f
-- shrl $2, %%edx
--3: adcl (%%esi), %%eax
-- lea 4(%%esi), %%esi
-- dec %%edx
-- jne 3b
-- adcl $0, %%eax
--4: andl $3, %%ecx
-- jz 7f
-- cmpl $2, %%ecx
-- jb 5f
-- movw (%%esi),%%cx
-- leal 2(%%esi),%%esi
-- je 6f
-- shll $16,%%ecx
--5: movb (%%esi),%%cl
--6: addl %%ecx,%%eax
-- adcl $0, %%eax
--7: "
-+ "testl $2, %%esi\n"
-+ "jz 2f\n"
-+" subl $2, %%ecx\n"
-+" jae 1f\n"
-+" addl $2, %%ecx\n"
-+" jmp 4f\n"
-+"1: movw (%%esi), %%bx\n"
-+" addl $2, %%esi\n"
-+" addw %%bx, %%ax\n"
-+" adcl $0, %%eax\n"
-+"2:\n"
-+" movl %%ecx, %%edx\n"
-+" shrl $5, %%ecx\n"
-+" jz 2f\n"
-+" testl %%esi, %%esi\n"
-+"1: movl (%%esi), %%ebx\n"
-+" adcl %%ebx, %%eax\n"
-+" movl 4(%%esi), %%ebx\n"
-+" adcl %%ebx, %%eax\n"
-+" movl 8(%%esi), %%ebx\n"
-+" adcl %%ebx, %%eax\n"
-+" movl 12(%%esi), %%ebx\n"
-+" adcl %%ebx, %%eax\n"
-+" movl 16(%%esi), %%ebx\n"
-+" adcl %%ebx, %%eax\n"
-+" movl 20(%%esi), %%ebx\n"
-+" adcl %%ebx, %%eax\n"
-+" movl 24(%%esi), %%ebx\n"
-+" adcl %%ebx, %%eax\n"
-+" movl 28(%%esi), %%ebx\n"
-+" adcl %%ebx, %%eax\n"
-+" lea 32(%%esi), %%esi\n"
-+" dec %%ecx\n"
-+" jne 1b\n"
-+" adcl $0, %%eax\n"
-+"2: movl %%edx, %%ecx\n"
-+" andl $0x1c, %%edx\n"
-+" je 4f\n"
-+" shrl $2, %%edx\n"
-+"3: adcl (%%esi), %%eax\n"
-+" lea 4(%%esi), %%esi\n"
-+" dec %%edx\n"
-+" jne 3b\n"
-+" adcl $0, %%eax\n"
-+"4: andl $3, %%ecx\n"
-+" jz 7f\n"
-+" cmpl $2, %%ecx\n"
-+" jb 5f\n"
-+" movw (%%esi),%%cx\n"
-+" leal 2(%%esi),%%esi\n"
-+" je 6f\n"
-+" shll $16,%%ecx\n"
-+"5: movb (%%esi),%%cl\n"
-+"6: addl %%ecx,%%eax\n"
-+" adcl $0, %%eax\n"
-+"7: \n"
- : "=a"(sum)
- : "0"(sum), "c"(len), "S"(buff)
- : "bx", "dx");
-@@ -103,25 +103,24 @@
- {
- u_int sum;
-
-- __asm__ __volatile__("
-- movl (%1), %0
-- subl $4, %2
-- jbe 2f
-- addl 4(%1), %0
-- adcl 8(%1), %0
-- adcl 12(%1), %0
--1: adcl 16(%1), %0
-- lea 4(%1), %1
-- decl %2
-- jne 1b
-- adcl $0, %0
-- movl %0, %2
-- shrl $16, %0
-- addw %w2, %w0
-- adcl $0, %0
-- notl %0
--2:
-- "
-+ __asm__ __volatile__(
-+" movl (%1), %0\n"
-+" subl $4, %2\n"
-+" jbe 2f\n"
-+" addl 4(%1), %0\n"
-+" adcl 8(%1), %0\n"
-+" adcl 12(%1), %0\n"
-+"1: adcl 16(%1), %0\n"
-+" lea 4(%1), %1\n"
-+" decl %2\n"
-+" jne 1b\n"
-+" adcl $0, %0\n"
-+" movl %0, %2\n"
-+" shrl $16, %0\n"
-+" addw %w2, %w0\n"
-+" adcl $0, %0\n"
-+" notl %0\n"
-+"2:\n"
- /*
- Since the input registers which are loaded with iph and ipl
- are modified, we must also specify them as outputs, or gcc
-@@ -137,10 +136,9 @@
- static inline u_int
- csum_fold(u_int sum)
- {
-- __asm__("
-- addl %1, %0
-- adcl $0xffff, %0
-- "
-+ __asm__(
-+" addl %1, %0\n"
-+" adcl $0xffff, %0\n"
- : "=r" (sum)
- : "r" (sum << 16), "0" (sum & 0xffff0000)
- );
-@@ -155,12 +153,11 @@
- csum_tcpudp_magic(u_int saddr, u_int daddr, u_short len,
- u_short proto, u_int sum)
- {
-- __asm__("
-- addl %1, %0
-- adcl %2, %0
-- adcl %3, %0
-- adcl $0, %0
-- "
-+ __asm__(
-+" addl %1, %0\n"
-+" adcl %2, %0\n"
-+" adcl %3, %0\n"
-+" adcl $0, %0\n"
- : "=r" (sum)
- : "g" (daddr), "g"(saddr), "g"((ntohs(len) << 16) + proto * 256), "0"(sum));
- return (csum_fold(sum));
-diff -Nur libnids-1.17.orig/configure.in libnids-1.17/configure.in
---- libnids-1.17.orig/configure.in Fri Aug 30 15:09:35 2002
-+++ libnids-1.17/configure.in Wed Aug 27 23:20:06 2003
-@@ -122,39 +122,39 @@
+--- libnids-1.18/configure.in.orig 2003-10-15 01:40:00.000000000 +0200
++++ libnids-1.18/configure.in 2003-10-27 23:00:07.224952248 +0100
+@@ -127,18 +127,18 @@
;;
*)
AC_MSG_RESULT($withval)
- LNETLIB="-L$withval/src -lnet"
+ LNETLIB="-L$withval/src -lnet1"
else
-- AC_ERROR(libnet.h or libnet.a not found in $withval)
-+ AC_ERROR(libnet1.h or libnet1.a not found in $withval)
+- echo "A working combination of libnet.h, libnet.a and libnet-config not found in $withval; get libnet from www.packetfactory.net/projects/libnet and reinstall"
++ echo "A working combination of libnet1.h, libnet1.a and libnet1-config not found in $withval; get libnet from www.packetfactory.net/projects/libnet and reinstall"
+ AC_ERROR(libnet)
fi
;;
- esac ],
+@@ -146,12 +146,12 @@
[ if test "x"$LIBNET_VER = "x"-1 ; then
AC_MSG_RESULT(skipping libnet)
-- elif test -f ${prefix}/include/libnet.h -a ${prefix}/lib/libnet.a ; then
-- LNET_CFLAGS="-I${prefix}/include `${prefix}/bin/libnet-config --defines 2>/dev/null`"
-- LNETLIB="-L${prefix}/lib -lnet"
-+ elif test -f ${prefix}/include/libnet1.h -a ${prefix}/lib/libnet1.a ; then
-+ LNET_CFLAGS="-I${prefix}/include `${prefix}/bin/libnet1-config --defines 2>/dev/null`"
-+ LNETLIB="-L${prefix}/lib -lnet1"
- AC_MSG_RESULT(yes)
else
-- LNET_CFLAGS="`libnet-config --defines 2>/dev/null`"
-+ LNET_CFLAGS="`libnet1-config --defines 2>/dev/null`"
- TMPC="$CFLAGS"
+- if test -f ${prefix}/include/libnet.h -a ${exec_prefix}/lib/libnet.a ; then
+- LNET_CFLAGS="-I${prefix}/include `${exec_prefix}/bin/libnet-config --defines 2>/dev/null`"
+- LNETLIB="-L${exec_prefix}/lib -lnet"
++ if test -f ${prefix}/include/libnet1.h -a ${exec_prefix}/lib/libnet1.a ; then
++ LNET_CFLAGS="-I${prefix}/include `${exec_prefix}/bin/libnet1-config --defines 2>/dev/null`"
++ LNETLIB="-L${exec_prefix}/lib -lnet1"
+ else
+- LNET_CFLAGS="`libnet-config --defines 2>/dev/null`"
+- LNETLIB="-lnet"
++ LNET_CFLAGS="`libnet1-config --defines 2>/dev/null`"
++ LNETLIB="-lnet1"
+ fi
+ fi ]
+ )
+@@ -161,15 +161,15 @@
TMPL="$LIBS"
CFLAGS="$CFLAGS $LNET_CFLAGS"
-- LIBS="-lnet $LIBS"
+ LIBS="$LNETLIB $LIBS"
- AC_TRY_LINK([#include <libnet.h>], libnet_get_prand(0),
-+ LIBS="-lnet1 $LIBS"
+ AC_TRY_LINK([#include <libnet1.h>], libnet_get_prand(0),
LIBNET_FOUND=1,LIBNET_FOUND=0)
CFLAGS="$TMPC"
+ LNETLIB="-lnet1"
AC_MSG_RESULT(yes)
else
- AC_ERROR(libnet not found)
-@@ -214,7 +214,7 @@
+- echo "Working libnet not found; get it from www.packetfactory.net/projects/libnet and reinstall"
++ echo "Working libnet1 not found; get it from www.packetfactory.net/projects/libnet and reinstall"
+ AC_ERROR(libnet)
+ fi
+ fi
+@@ -227,7 +227,7 @@
TMP=$CFLAGS
CFLAGS="$CFLAGS $LNET_CFLAGS"
AC_MSG_CHECKING(libnet version)
Summary: "libpwrite" Network Routine Library
Summary(pl): Biblioteka czynno¶ci sieciowych
Name: libnids
-Version: 1.17
-Release: 2
+Version: 1.18
+Release: 1
Epoch: 1
License: BSD
Group: Libraries
-Source0: http://www.avet.com.pl/~nergal/libnids/dist/%{name}-%{version}.tar.gz
-# Source0-md5: 0f22335b465cc57829dfe16c1da4433c
-Patch0: %{name}-asmgcc33.patch
-Patch1: %{name}-libnet1.patch
-URL: http://www.avet.com.pl/~nergal/libnids/
+Source0: http://dl.sourceforge.net/libnids/%{name}-%{version}.tar.gz
+# Source0-md5: 9ee6dcdfac97bae6fe611aa27d2594a5
+Patch0: %{name}-libnet1.patch
+URL: http://libnids.sourceforge.net/
BuildRequires: autoconf
BuildRequires: libpcap-devel
BuildRequires: libnet1-devel
%prep
%setup -q
%patch0 -p1
-%patch1 -p1
%build
%{__autoconf}
-%configure --enable-shared
+%configure \
+ --enable-shared
%{__make}