perl-net.patch 5.8 KB

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