|
|
|
|
Index: Net-Packet-3.26/Makefile.PL
|
|
|
|
|
--- Net-Packet-3.26/Makefile.PL.orig 2006-12-16 16:26:26 +0100
|
|
|
|
|
+++ Net-Packet-3.26/Makefile.PL 2008-01-01 22:05:18 +0100
|
|
|
|
|
@@ -14,7 +14,6 @@
|
|
|
|
|
Net::Libdnet => 0,
|
|
|
|
|
Time::HiRes => 0,
|
|
|
|
|
Net::IPv6Addr => 0,
|
|
|
|
|
- Socket6 => 0,
|
|
|
|
|
Bit::Vector => 0,
|
|
|
|
|
},
|
|
|
|
|
ABSTRACT_FROM => 'lib/Net/Packet.pm',
|
|
|
|
|
Index: Net-Patricia-1.15/libpatricia/patricia.c
|
|
|
|
|
--- Net-Patricia-1.15/libpatricia/patricia.c.orig 2005-12-07 21:55:39 +0100
|
|
|
|
|
+++ Net-Patricia-1.15/libpatricia/patricia.c 2008-01-01 22:05:18 +0100
|
|
|
|
|
@@ -38,24 +38,24 @@
|
|
|
|
|
/* prefix_tochar
|
|
|
|
|
* convert prefix information to bytes
|
|
|
|
|
*/
|
|
|
|
|
-u_char *
|
|
|
|
|
+unsigned char *
|
|
|
|
|
prefix_tochar (prefix_t * prefix)
|
|
|
|
|
{
|
|
|
|
|
if (prefix == NULL)
|
|
|
|
|
return (NULL);
|
|
|
|
|
|
|
|
|
|
- return ((u_char *) & prefix->add.sin);
|
|
|
|
|
+ return ((unsigned char *) & prefix->add.sin);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
-comp_with_mask (void *addr, void *dest, u_int mask)
|
|
|
|
|
+comp_with_mask (void *addr, void *dest, unsigned int mask)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
if ( /* mask/8 == 0 || */ memcmp (addr, dest, mask / 8) == 0) {
|
|
|
|
|
int n = mask / 8;
|
|
|
|
|
int m = ((-1) << (8 - (mask % 8)));
|
|
|
|
|
|
|
|
|
|
- if (mask % 8 == 0 || (((u_char *)addr)[n] & m) == (((u_char *)dest)[n] & m))
|
|
|
|
|
+ if (mask % 8 == 0 || (((unsigned char *)addr)[n] & m) == (((unsigned char *)dest)[n] & m))
|
|
|
|
|
return (1);
|
|
|
|
|
}
|
|
|
|
|
return (0);
|
|
|
|
|
@@ -70,7 +70,7 @@
|
|
|
|
|
int
|
|
|
|
|
inet_pton (int af, const char *src, void *dst)
|
|
|
|
|
{
|
|
|
|
|
- u_long result;
|
|
|
|
|
+ unsigned long result;
|
|
|
|
|
|
|
|
|
|
if (af == AF_INET) {
|
|
|
|
|
result = inet_addr(src);
|
|
|
|
|
@@ -104,7 +104,7 @@
|
|
|
|
|
{
|
|
|
|
|
if (af == AF_INET) {
|
|
|
|
|
int i, c, val;
|
|
|
|
|
- u_char xp[4] = {0, 0, 0, 0};
|
|
|
|
|
+ unsigned char xp[4] = {0, 0, 0, 0};
|
|
|
|
|
|
|
|
|
|
for (i = 0; ; i++) {
|
|
|
|
|
c = *src++;
|
|
|
|
|
@@ -153,7 +153,7 @@
|
|
|
|
|
|
|
|
|
|
struct buffer {
|
|
|
|
|
char buffs[16][48+5];
|
|
|
|
|
- u_int i;
|
|
|
|
|
+ unsigned int i;
|
|
|
|
|
} *buffp;
|
|
|
|
|
|
|
|
|
|
# if 0
|
|
|
|
|
@@ -172,7 +172,7 @@
|
|
|
|
|
buff = buffp->buffs[buffp->i++%16];
|
|
|
|
|
}
|
|
|
|
|
if (prefix->family == AF_INET) {
|
|
|
|
|
- u_char *a;
|
|
|
|
|
+ unsigned char *a;
|
|
|
|
|
assert (prefix->bitlen <= 32);
|
|
|
|
|
a = prefix_touchar (prefix);
|
|
|
|
|
if (with_len) {
|
|
|
|
|
@@ -272,7 +272,7 @@
|
|
|
|
|
prefix_t *
|
|
|
|
|
ascii2prefix (int family, char *string)
|
|
|
|
|
{
|
|
|
|
|
- u_long bitlen, maxbitlen = 0;
|
|
|
|
|
+ unsigned long bitlen, maxbitlen = 0;
|
|
|
|
|
char *cp;
|
|
|
|
|
struct in_addr sin;
|
|
|
|
|
#ifdef HAVE_IPV6
|
|
|
|
|
@@ -491,8 +491,8 @@
|
|
|
|
|
patricia_search_exact (patricia_tree_t *patricia, prefix_t *prefix)
|
|
|
|
|
{
|
|
|
|
|
patricia_node_t *node;
|
|
|
|
|
- u_char *addr;
|
|
|
|
|
- u_int bitlen;
|
|
|
|
|
+ unsigned char *addr;
|
|
|
|
|
+ unsigned int bitlen;
|
|
|
|
|
|
|
|
|
|
assert (patricia);
|
|
|
|
|
assert (prefix);
|
|
|
|
|
@@ -563,8 +563,8 @@
|
|
|
|
|
{
|
|
|
|
|
patricia_node_t *node;
|
|
|
|
|
patricia_node_t *stack[PATRICIA_MAXBITS + 1];
|
|
|
|
|
- u_char *addr;
|
|
|
|
|
- u_int bitlen;
|
|
|
|
|
+ unsigned char *addr;
|
|
|
|
|
+ unsigned int bitlen;
|
|
|
|
|
int cnt = 0;
|
|
|
|
|
|
|
|
|
|
assert (patricia);
|
|
|
|
|
@@ -662,8 +662,8 @@
|
|
|
|
|
patricia_lookup (patricia_tree_t *patricia, prefix_t *prefix)
|
|
|
|
|
{
|
|
|
|
|
patricia_node_t *node, *new_node, *parent, *glue;
|
|
|
|
|
- u_char *addr, *test_addr;
|
|
|
|
|
- u_int bitlen, check_bit, differ_bit;
|
|
|
|
|
+ unsigned char *addr, *test_addr;
|
|
|
|
|
+ unsigned int bitlen, check_bit, differ_bit;
|
|
|
|
|
int i, j, r;
|
|
|
|
|
|
|
|
|
|
assert (patricia);
|
|
|
|
|
Index: Net-Patricia-1.15/libpatricia/patricia.h
|
|
|
|
|
--- Net-Patricia-1.15/libpatricia/patricia.h.orig 2005-12-07 21:54:52 +0100
|
|
|
|
|
+++ Net-Patricia-1.15/libpatricia/patricia.h 2008-01-01 22:05:18 +0100
|
|
|
|
|
@@ -15,10 +15,10 @@
|
|
|
|
|
#ifndef _PATRICIA_H
|
|
|
|
|
#define _PATRICIA_H
|
|
|
|
|
|
|
|
|
|
-/* typedef unsigned int u_int; */
|
|
|
|
|
+/* typedef unsigned int unsigned int; */
|
|
|
|
|
typedef void (*void_fn_t)();
|
|
|
|
|
/* { from defs.h */
|
|
|
|
|
-#define prefix_touchar(prefix) ((u_char *)&(prefix)->add.sin)
|
|
|
|
|
+#define prefix_touchar(prefix) ((unsigned char *)&(prefix)->add.sin)
|
|
|
|
|
#define MAXLINE 1024
|
|
|
|
|
#define BIT_TEST(f, b) ((f) & (b))
|
|
|
|
|
/* } */
|
|
|
|
|
@@ -40,15 +40,15 @@
|
|
|
|
|
/* { from mrt.h */
|
|
|
|
|
|
|
|
|
|
typedef struct _prefix4_t {
|
|
|
|
|
- u_short family; /* AF_INET | AF_INET6 */
|
|
|
|
|
- u_short bitlen; /* same as mask? */
|
|
|
|
|
+ unsigned short family; /* AF_INET | AF_INET6 */
|
|
|
|
|
+ unsigned short bitlen; /* same as mask? */
|
|
|
|
|
int ref_count; /* reference count */
|
|
|
|
|
struct in_addr sin;
|
|
|
|
|
} prefix4_t;
|
|
|
|
|
|
|
|
|
|
typedef struct _prefix_t {
|
|
|
|
|
- u_short family; /* AF_INET | AF_INET6 */
|
|
|
|
|
- u_short bitlen; /* same as mask? */
|
|
|
|
|
+ unsigned short family; /* AF_INET | AF_INET6 */
|
|
|
|
|
+ unsigned short bitlen; /* same as mask? */
|
|
|
|
|
int ref_count; /* reference count */
|
|
|
|
|
union {
|
|
|
|
|
struct in_addr sin;
|
|
|
|
|
@@ -61,7 +61,7 @@
|
|
|
|
|
/* } */
|
|
|
|
|
|
|
|
|
|
typedef struct _patricia_node_t {
|
|
|
|
|
- u_int bit; /* flag if this node used */
|
|
|
|
|
+ unsigned int bit; /* flag if this node used */
|
|
|
|
|
prefix_t *prefix; /* who we are in patricia tree */
|
|
|
|
|
struct _patricia_node_t *l, *r; /* left and right children */
|
|
|
|
|
struct _patricia_node_t *parent;/* may be used */
|
|
|
|
|
@@ -71,7 +71,7 @@
|
|
|
|
|
|
|
|
|
|
typedef struct _patricia_tree_t {
|
|
|
|
|
patricia_node_t *head;
|
|
|
|
|
- u_int maxbits; /* for IP, 32 bit addresses */
|
|
|
|
|
+ unsigned int maxbits; /* for IP, 32 bit addresses */
|
|
|
|
|
int num_active_node; /* for debug purpose */
|
|
|
|
|
} patricia_tree_t;
|
|
|
|
|
|
|
|
|
|
Index: Net-Pcap-0.16/Makefile.PL
|
|
|
|
|
--- Net-Pcap-0.16/Makefile.PL.orig 2007-12-24 00:06:15 +0100
|
|
|
|
|
+++ Net-Pcap-0.16/Makefile.PL 2008-01-01 22:08:20 +0100
|
|
|
|
|
@@ -23,7 +23,8 @@
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$options{CCFLAGS} = '-Wall -Wwrite-strings' if $Config{ccname} eq 'gcc' and $] >= 5.006;
|
|
|
|
|
- $options{LIBS} = '-lpcap';
|
|
|
|
|
+ $options{INC} = '-I@l_prefix@/include';
|
|
|
|
|
+ $options{LIBS} = '-L@l_prefix@/lib -lpcap';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for my $arg (@ARGV) {
|
|
|
|
|
Index: Net-Pcap-0.16/Pcap.xs
|
|
|
|
|
--- Net-Pcap-0.16/Pcap.xs.orig 2008-01-01 05:22:22 +0100
|
|
|
|
|
+++ Net-Pcap-0.16/Pcap.xs 2008-01-01 22:05:18 +0100
|
|
|
|
|
@@ -33,7 +33,7 @@
|
|
|
|
|
#define NEED_sv_2pv_nolen 1
|
|
|
|
|
#include "ppport.h"
|
|
|
|
|
|
|
|
|
|
-#include <pcap.h>
|
|
|
|
|
+#include "pcap.h"
|
|
|
|
|
|
|
|
|
|
#ifdef _CYGWIN
|
|
|
|
|
#include <Win32-Extensions.h>
|