+#error "byte order has not been specified, you'll need to #define either LIBNET_LIL_ENDIAN or LIBNET_BIG_ENDIAN. See the documentation regarding the libnet-config script."
#endif
#endif /* __LIBNET_H */
--- libnids-1.16/src/checksum.c.orig Tue Jun 20 23:06:32 2000
+++ libnids-1.16/src/checksum.c Mon Jun 9 14:42:03 2003
@@ -4,193 +4,6 @@
#include <netinet/tcp.h>
#include <netinet/udp.h>
-#if ( __i386 )
-// all asm procedures are copied from Linux 2.0.36 and 2.2.10 kernels
-
-/*
- computes the checksum of a memory block at buff, length len, and
- adds in "sum" (32-bit)
-
- returns a 32-bit number suitable for feeding into itself or
- csum_tcpudp_magic
-
- this function must be called with even lengths, except for the last
- fragment, which may be odd
-
- it's best to have buff aligned on a 32-bit boundary
-*/
-u_int
-csum_partial(const u_char * buff, int len, u_int sum)
-{
- __asm__ (
-/* "pushl %esi
- pushl %ebx
- movl 20(%esp),%eax # Function arg: u_int sum
- 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: "
- : "=a"(sum)
- : "0"(sum), "c"(len), "S"(buff)
- : "bx", "dx");
-
- return (sum);
-}
-
-/*
- This is a version of ip_compute_csum() optimized for IP headers,
- which always checksum on 4 octet boundaries.
-
- By Jorge Cwik <jorge@laser.satlink.net>, adapted for linux by Arnt