perl-net.patch 5.6 KB

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