perl-net/perl-net.patch

changeset 99
161326b4f1f9
child 372
442a711da911
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/perl-net/perl-net.patch	Fri Jan 16 20:57:37 2009 +0100
     1.3 @@ -0,0 +1,200 @@
     1.4 +Index: Net-Packet-3.26/Makefile.PL
     1.5 +--- Net-Packet-3.26/Makefile.PL.orig	2006-12-16 16:26:26 +0100
     1.6 ++++ Net-Packet-3.26/Makefile.PL	2008-01-01 22:05:18 +0100
     1.7 +@@ -14,7 +14,6 @@
     1.8 +       Net::Libdnet  => 0,
     1.9 +       Time::HiRes   => 0,
    1.10 +       Net::IPv6Addr => 0,
    1.11 +-      Socket6       => 0,
    1.12 +       Bit::Vector   => 0,
    1.13 +    },
    1.14 +    ABSTRACT_FROM => 'lib/Net/Packet.pm',
    1.15 +Index: Net-Patricia-1.014/libpatricia/patricia.c
    1.16 +--- Net-Patricia-1.014/libpatricia/patricia.c.orig	2005-12-07 21:55:39 +0100
    1.17 ++++ Net-Patricia-1.014/libpatricia/patricia.c	2008-01-01 22:05:18 +0100
    1.18 +@@ -38,24 +38,24 @@
    1.19 + /* prefix_tochar
    1.20 +  * convert prefix information to bytes
    1.21 +  */
    1.22 +-u_char *
    1.23 ++unsigned char *
    1.24 + prefix_tochar (prefix_t * prefix)
    1.25 + {
    1.26 +     if (prefix == NULL)
    1.27 + 	return (NULL);
    1.28 + 
    1.29 +-    return ((u_char *) & prefix->add.sin);
    1.30 ++    return ((unsigned char *) & prefix->add.sin);
    1.31 + }
    1.32 + 
    1.33 + int 
    1.34 +-comp_with_mask (void *addr, void *dest, u_int mask)
    1.35 ++comp_with_mask (void *addr, void *dest, unsigned int mask)
    1.36 + {
    1.37 + 
    1.38 +     if ( /* mask/8 == 0 || */ memcmp (addr, dest, mask / 8) == 0) {
    1.39 + 	int n = mask / 8;
    1.40 + 	int m = ((-1) << (8 - (mask % 8)));
    1.41 + 
    1.42 +-	if (mask % 8 == 0 || (((u_char *)addr)[n] & m) == (((u_char *)dest)[n] & m))
    1.43 ++	if (mask % 8 == 0 || (((unsigned char *)addr)[n] & m) == (((unsigned char *)dest)[n] & m))
    1.44 + 	    return (1);
    1.45 +     }
    1.46 +     return (0);
    1.47 +@@ -70,7 +70,7 @@
    1.48 + int
    1.49 + inet_pton (int af, const char *src, void *dst)
    1.50 + {
    1.51 +-    u_long result;  
    1.52 ++    unsigned long result;  
    1.53 + 
    1.54 +     if (af == AF_INET) {
    1.55 + 	result = inet_addr(src);
    1.56 +@@ -104,7 +104,7 @@
    1.57 + {
    1.58 +     if (af == AF_INET) {
    1.59 +         int i, c, val;
    1.60 +-        u_char xp[4] = {0, 0, 0, 0};
    1.61 ++        unsigned char xp[4] = {0, 0, 0, 0};
    1.62 + 
    1.63 +         for (i = 0; ; i++) {
    1.64 + 	    c = *src++;
    1.65 +@@ -153,7 +153,7 @@
    1.66 + 
    1.67 +         struct buffer {
    1.68 +             char buffs[16][48+5];
    1.69 +-            u_int i;
    1.70 ++            unsigned int i;
    1.71 +         } *buffp;
    1.72 + 
    1.73 + #    if 0
    1.74 +@@ -172,7 +172,7 @@
    1.75 + 	buff = buffp->buffs[buffp->i++%16];
    1.76 +     }
    1.77 +     if (prefix->family == AF_INET) {
    1.78 +-	u_char *a;
    1.79 ++	unsigned char *a;
    1.80 + 	assert (prefix->bitlen <= 32);
    1.81 + 	a = prefix_touchar (prefix);
    1.82 + 	if (with_len) {
    1.83 +@@ -272,7 +272,7 @@
    1.84 + prefix_t *
    1.85 + ascii2prefix (int family, char *string)
    1.86 + {
    1.87 +-    u_long bitlen, maxbitlen = 0;
    1.88 ++    unsigned long bitlen, maxbitlen = 0;
    1.89 +     char *cp;
    1.90 +     struct in_addr sin;
    1.91 + #ifdef HAVE_IPV6
    1.92 +@@ -491,8 +491,8 @@
    1.93 + patricia_search_exact (patricia_tree_t *patricia, prefix_t *prefix)
    1.94 + {
    1.95 +     patricia_node_t *node;
    1.96 +-    u_char *addr;
    1.97 +-    u_int bitlen;
    1.98 ++    unsigned char *addr;
    1.99 ++    unsigned int bitlen;
   1.100 + 
   1.101 +     assert (patricia);
   1.102 +     assert (prefix);
   1.103 +@@ -563,8 +563,8 @@
   1.104 + {
   1.105 +     patricia_node_t *node;
   1.106 +     patricia_node_t *stack[PATRICIA_MAXBITS + 1];
   1.107 +-    u_char *addr;
   1.108 +-    u_int bitlen;
   1.109 ++    unsigned char *addr;
   1.110 ++    unsigned int bitlen;
   1.111 +     int cnt = 0;
   1.112 + 
   1.113 +     assert (patricia);
   1.114 +@@ -662,8 +662,8 @@
   1.115 + patricia_lookup (patricia_tree_t *patricia, prefix_t *prefix)
   1.116 + {
   1.117 +     patricia_node_t *node, *new_node, *parent, *glue;
   1.118 +-    u_char *addr, *test_addr;
   1.119 +-    u_int bitlen, check_bit, differ_bit;
   1.120 ++    unsigned char *addr, *test_addr;
   1.121 ++    unsigned int bitlen, check_bit, differ_bit;
   1.122 +     int i, j, r;
   1.123 + 
   1.124 +     assert (patricia);
   1.125 +Index: Net-Patricia-1.014/libpatricia/patricia.h
   1.126 +--- Net-Patricia-1.014/libpatricia/patricia.h.orig	2005-12-07 21:54:52 +0100
   1.127 ++++ Net-Patricia-1.014/libpatricia/patricia.h	2008-01-01 22:05:18 +0100
   1.128 +@@ -15,10 +15,10 @@
   1.129 + #ifndef _PATRICIA_H
   1.130 + #define _PATRICIA_H
   1.131 + 
   1.132 +-/* typedef unsigned int u_int; */
   1.133 ++/* typedef unsigned int unsigned int; */
   1.134 + typedef void (*void_fn_t)();
   1.135 + /* { from defs.h */
   1.136 +-#define prefix_touchar(prefix) ((u_char *)&(prefix)->add.sin)
   1.137 ++#define prefix_touchar(prefix) ((unsigned char *)&(prefix)->add.sin)
   1.138 + #define MAXLINE 1024
   1.139 + #define BIT_TEST(f, b)  ((f) & (b))
   1.140 + /* } */
   1.141 +@@ -40,15 +40,15 @@
   1.142 + /* { from mrt.h */
   1.143 + 
   1.144 + typedef struct _prefix4_t {
   1.145 +-    u_short family;		/* AF_INET | AF_INET6 */
   1.146 +-    u_short bitlen;		/* same as mask? */
   1.147 ++    unsigned short family;		/* AF_INET | AF_INET6 */
   1.148 ++    unsigned short bitlen;		/* same as mask? */
   1.149 +     int ref_count;		/* reference count */
   1.150 +     struct in_addr sin;
   1.151 + } prefix4_t;
   1.152 + 
   1.153 + typedef struct _prefix_t {
   1.154 +-    u_short family;		/* AF_INET | AF_INET6 */
   1.155 +-    u_short bitlen;		/* same as mask? */
   1.156 ++    unsigned short family;		/* AF_INET | AF_INET6 */
   1.157 ++    unsigned short bitlen;		/* same as mask? */
   1.158 +     int ref_count;		/* reference count */
   1.159 +     union {
   1.160 + 		struct in_addr sin;
   1.161 +@@ -61,7 +61,7 @@
   1.162 + /* } */
   1.163 + 
   1.164 + typedef struct _patricia_node_t {
   1.165 +-   u_int bit;			/* flag if this node used */
   1.166 ++   unsigned int bit;			/* flag if this node used */
   1.167 +    prefix_t *prefix;		/* who we are in patricia tree */
   1.168 +    struct _patricia_node_t *l, *r;	/* left and right children */
   1.169 +    struct _patricia_node_t *parent;/* may be used */
   1.170 +@@ -71,7 +71,7 @@
   1.171 + 
   1.172 + typedef struct _patricia_tree_t {
   1.173 +    patricia_node_t 	*head;
   1.174 +-   u_int		maxbits;	/* for IP, 32 bit addresses */
   1.175 ++   unsigned int		maxbits;	/* for IP, 32 bit addresses */
   1.176 +    int num_active_node;		/* for debug purpose */
   1.177 + } patricia_tree_t;
   1.178 + 
   1.179 +Index: Net-Pcap-0.16/Makefile.PL
   1.180 +--- Net-Pcap-0.16/Makefile.PL.orig	2007-12-24 00:06:15 +0100
   1.181 ++++ Net-Pcap-0.16/Makefile.PL	2008-01-01 22:08:20 +0100
   1.182 +@@ -23,7 +23,8 @@
   1.183 + }
   1.184 + else {
   1.185 +     $options{CCFLAGS} = '-Wall -Wwrite-strings' if $Config{ccname} eq 'gcc' and $] >= 5.006;
   1.186 +-    $options{LIBS}    = '-lpcap';
   1.187 ++    $options{INC}     = '-I@l_prefix@/include';
   1.188 ++    $options{LIBS}    = '-L@l_prefix@/lib -lpcap';
   1.189 + }
   1.190 + 
   1.191 + for my $arg (@ARGV) {
   1.192 +Index: Net-Pcap-0.16/Pcap.xs
   1.193 +--- Net-Pcap-0.16/Pcap.xs.orig	2008-01-01 05:22:22 +0100
   1.194 ++++ Net-Pcap-0.16/Pcap.xs	2008-01-01 22:05:18 +0100
   1.195 +@@ -33,7 +33,7 @@
   1.196 + #define NEED_sv_2pv_nolen 1
   1.197 + #include "ppport.h"
   1.198 + 
   1.199 +-#include <pcap.h>
   1.200 ++#include "pcap.h"
   1.201 + 
   1.202 + #ifdef _CYGWIN
   1.203 + #include <Win32-Extensions.h>

mercurial