perl-net.patch 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. Index: Net-Packet-2.04/Makefile.PL
  2. --- Net-Packet-2.04/Makefile.PL.orig 2005-05-22 21:08:20 +0200
  3. +++ Net-Packet-2.04/Makefile.PL 2005-11-02 11:37:05 +0100
  4. @@ -1,33 +1,5 @@
  5. use ExtUtils::MakeMaker;
  6. -die("*** Microsoft Windows not supported\n")
  7. - if $^O =~ /windows|win32/i;
  8. -die("*** Big endian architectures not supported yet\n")
  9. - if unpack("h*", pack("s", 1)) =~ /01/;
  10. -
  11. -require DynaLoader;
  12. -
  13. -my $file = DynaLoader::dl_findfile('-lpcap')
  14. - or die("*** Cannot find libpcap, try setting LD_LIBRARY_PATH\n");
  15. -
  16. -my ($lib) = $file =~ /^(.*)\//;
  17. -(my $inc = $lib) =~ s/lib/include/;
  18. -
  19. -sub _getPcapHPath { (-d "$inc/pcap") ? "[$inc/pcap]" : "[$inc]" }
  20. -
  21. -unless (-f "$inc/pcap-int.h" || -f "$inc/pcap/pcap-int.h") {
  22. - die("*** Cannot find pcap-int.h . Get it from your installed libpcap ".
  23. - "source distribution and copy it to: ". _getPcapHPath().
  24. - " (near pcap.h)\n");
  25. -}
  26. -
  27. -$inc = "-I$inc -I$inc/pcap";
  28. -$lib = "-L$lib";
  29. -
  30. -print "Found libpcap: [$file]\n";
  31. -print "Will use lib: [$lib]\n";
  32. -print "Will use include: [$inc]\n";
  33. -
  34. WriteMakefile(
  35. NAME => 'Net::Packet',
  36. VERSION_FROM => 'Packet.pm',
  37. @@ -36,7 +8,6 @@
  38. IO::Interface => 0,
  39. Net::Pcap => '0.04',
  40. Net::IPv6Addr => 0,
  41. - Socket6 => 0,
  42. Class::Gomor::Hash => '0.20',
  43. },
  44. ABSTRACT_FROM => 'Packet.pm',
  45. Index: Net-Patricia-1.010/libpatricia/patricia.c
  46. --- Net-Patricia-1.010/libpatricia/patricia.c.orig 2000-10-04 22:41:35 +0200
  47. +++ Net-Patricia-1.010/libpatricia/patricia.c 2005-11-02 11:37:05 +0100
  48. @@ -35,24 +35,24 @@
  49. /* prefix_tochar
  50. * convert prefix information to bytes
  51. */
  52. -u_char *
  53. +unsigned char *
  54. prefix_tochar (prefix_t * prefix)
  55. {
  56. if (prefix == NULL)
  57. return (NULL);
  58. - return ((u_char *) & prefix->add.sin);
  59. + return ((unsigned char *) & prefix->add.sin);
  60. }
  61. int
  62. -comp_with_mask (void *addr, void *dest, u_int mask)
  63. +comp_with_mask (void *addr, void *dest, unsigned int mask)
  64. {
  65. if ( /* mask/8 == 0 || */ memcmp (addr, dest, mask / 8) == 0) {
  66. int n = mask / 8;
  67. int m = ((-1) << (8 - (mask % 8)));
  68. - if (mask % 8 == 0 || (((u_char *)addr)[n] & m) == (((u_char *)dest)[n] & m))
  69. + if (mask % 8 == 0 || (((unsigned char *)addr)[n] & m) == (((unsigned char *)dest)[n] & m))
  70. return (1);
  71. }
  72. return (0);
  73. @@ -67,7 +67,7 @@
  74. int
  75. inet_pton (int af, const char *src, void *dst)
  76. {
  77. - u_long result;
  78. + unsigned long result;
  79. if (af == AF_INET) {
  80. result = inet_addr(src);
  81. @@ -101,7 +101,7 @@
  82. {
  83. if (af == AF_INET) {
  84. int i, c, val;
  85. - u_char xp[4] = {0, 0, 0, 0};
  86. + unsigned char xp[4] = {0, 0, 0, 0};
  87. for (i = 0; ; i++) {
  88. c = *src++;
  89. @@ -150,7 +150,7 @@
  90. struct buffer {
  91. char buffs[16][48+5];
  92. - u_int i;
  93. + unsigned int i;
  94. } *buffp;
  95. # if 0
  96. @@ -169,7 +169,7 @@
  97. buff = buffp->buffs[buffp->i++%16];
  98. }
  99. if (prefix->family == AF_INET) {
  100. - u_char *a;
  101. + unsigned char *a;
  102. assert (prefix->bitlen <= 32);
  103. a = prefix_touchar (prefix);
  104. if (with_len) {
  105. @@ -269,7 +269,7 @@
  106. prefix_t *
  107. ascii2prefix (int family, char *string)
  108. {
  109. - u_long bitlen, maxbitlen = 0;
  110. + unsigned long bitlen, maxbitlen = 0;
  111. char *cp;
  112. struct in_addr sin;
  113. #ifdef HAVE_IPV6
  114. @@ -466,8 +466,8 @@
  115. patricia_search_exact (patricia_tree_t *patricia, prefix_t *prefix)
  116. {
  117. patricia_node_t *node;
  118. - u_char *addr;
  119. - u_int bitlen;
  120. + unsigned char *addr;
  121. + unsigned int bitlen;
  122. assert (patricia);
  123. assert (prefix);
  124. @@ -538,8 +538,8 @@
  125. {
  126. patricia_node_t *node;
  127. patricia_node_t *stack[PATRICIA_MAXBITS + 1];
  128. - u_char *addr;
  129. - u_int bitlen;
  130. + unsigned char *addr;
  131. + unsigned int bitlen;
  132. int cnt = 0;
  133. assert (patricia);
  134. @@ -637,8 +637,8 @@
  135. patricia_lookup (patricia_tree_t *patricia, prefix_t *prefix)
  136. {
  137. patricia_node_t *node, *new_node, *parent, *glue;
  138. - u_char *addr, *test_addr;
  139. - u_int bitlen, check_bit, differ_bit;
  140. + unsigned char *addr, *test_addr;
  141. + unsigned int bitlen, check_bit, differ_bit;
  142. int i, j, r;
  143. assert (patricia);
  144. Index: Net-Patricia-1.010/libpatricia/patricia.h
  145. --- Net-Patricia-1.010/libpatricia/patricia.h.orig 2000-09-29 21:28:26 +0200
  146. +++ Net-Patricia-1.010/libpatricia/patricia.h 2005-11-02 11:37:05 +0100
  147. @@ -15,10 +15,10 @@
  148. #ifndef _PATRICIA_H
  149. #define _PATRICIA_H
  150. -/* typedef unsigned int u_int; */
  151. +/* typedef unsigned int unsigned int; */
  152. typedef void (*void_fn_t)();
  153. /* { from defs.h */
  154. -#define prefix_touchar(prefix) ((u_char *)&(prefix)->add.sin)
  155. +#define prefix_touchar(prefix) ((unsigned char *)&(prefix)->add.sin)
  156. #define MAXLINE 1024
  157. #define BIT_TEST(f, b) ((f) & (b))
  158. /* } */
  159. @@ -32,15 +32,15 @@
  160. /* { from mrt.h */
  161. typedef struct _prefix4_t {
  162. - u_short family; /* AF_INET | AF_INET6 */
  163. - u_short bitlen; /* same as mask? */
  164. + unsigned short family; /* AF_INET | AF_INET6 */
  165. + unsigned short bitlen; /* same as mask? */
  166. int ref_count; /* reference count */
  167. struct in_addr sin;
  168. } prefix4_t;
  169. typedef struct _prefix_t {
  170. - u_short family; /* AF_INET | AF_INET6 */
  171. - u_short bitlen; /* same as mask? */
  172. + unsigned short family; /* AF_INET | AF_INET6 */
  173. + unsigned short bitlen; /* same as mask? */
  174. int ref_count; /* reference count */
  175. union {
  176. struct in_addr sin;
  177. @@ -53,7 +53,7 @@
  178. /* } */
  179. typedef struct _patricia_node_t {
  180. - u_int bit; /* flag if this node used */
  181. + unsigned int bit; /* flag if this node used */
  182. prefix_t *prefix; /* who we are in patricia tree */
  183. struct _patricia_node_t *l, *r; /* left and right children */
  184. struct _patricia_node_t *parent;/* may be used */
  185. @@ -63,7 +63,7 @@
  186. typedef struct _patricia_tree_t {
  187. patricia_node_t *head;
  188. - u_int maxbits; /* for IP, 32 bit addresses */
  189. + unsigned int maxbits; /* for IP, 32 bit addresses */
  190. int num_active_node; /* for debug purpose */
  191. } patricia_tree_t;
  192. Index: Net-Pcap-0.10/Makefile.PL
  193. --- Net-Pcap-0.10/Makefile.PL.orig 2005-10-30 23:43:52 +0100
  194. +++ Net-Pcap-0.10/Makefile.PL 2005-11-02 11:37:35 +0100
  195. @@ -15,7 +15,8 @@
  196. } else {
  197. $options{CCFLAGS} = '-Wall' if $] >= 5.006;
  198. - $options{LIBS} = '-lpcap';
  199. + $options{INC} = '-I@l_prefix@/include';
  200. + $options{LIBS} = '-L@l_prefix@/lib -lpcap';
  201. }
  202. for my $arg (@ARGV) {
  203. Index: Net-Pcap-0.10/Pcap.xs
  204. --- Net-Pcap-0.10/Pcap.xs.orig 2005-10-30 12:20:35 +0100
  205. +++ Net-Pcap-0.10/Pcap.xs 2005-11-02 11:37:05 +0100
  206. @@ -31,7 +31,7 @@
  207. #define NEED_sv_2pv_nolen 1
  208. #include "ppport.h"
  209. -#include <pcap.h>
  210. +#include "pcap.h"
  211. #ifdef _WINPCAP
  212. #include <Win32-Extensions.h>