1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
|
diff -ru traceproto-1.1.2beta1~/configure.ac traceproto-1.1.2beta1/configure.ac
--- traceproto-1.1.2beta1~/configure.ac 2006-12-17 16:36:48.000000000 +0100
+++ traceproto-1.1.2beta1/configure.ac 2006-12-17 17:08:01.000000000 +0100
@@ -167,11 +167,20 @@
AC_ARG_ENABLE([dmalloc],
[[ --enable-dmalloc Use the dmalloc library for debugging]],
[
- dmalloc_test=yes
- AC_MSG_RESULT([requested])
+ dmalloc_test=$enableval
],
[
- AC_MSG_RESULT([not requested])
+ dmalloc_test=no
+ ]
+)
+AC_MSG_CHECKING(for ncurses)
+AC_ARG_ENABLE([ncurses],
+ [[ --enable-ncurses Use the ncurses library]],
+ [
+ ncurses_test=$enableval
+ ],
+ [
+ ncurses_test=no
]
)
@@ -182,8 +191,10 @@
AC_CHECK_LIB(pcap, pcap_open_live, , AC_MSG_ERROR([ERROR - pcap check failed]))
AC_CHECK_LIB(net, libnet_init, , AC_MSG_ERROR([ERROR - libnet check failed]))
AC_CHECK_LIB(cap, cap_init, , AC_MSG_WARN([libcap check failed]))
-AC_CHECK_LIB(ncurses, initscr, , AC_MSG_WARN([ncurses check failed]))
-AC_CHECK_LIB(curses, initscr, , AC_MSG_WARN([curses check failed]))
+if test "x$ncurses_test" = "xyes"; then
+ AC_CHECK_LIB(ncurses, initscr, , AC_MSG_WARN([ncurses check failed]))
+ AC_CHECK_LIB(curses, initscr, , AC_MSG_WARN([curses check failed]))
+fi
AC_CHECK_LIB(termcap, tgetent)
if test "x$dmalloc_test" = "xyes"; then
AC_CHECK_LIB(dmalloc, malloc, ,AC_MSG_RESULT([dmalloc unavailable]))
@@ -191,8 +202,10 @@
# Checks for header files.
AC_HEADER_STDC
-AC_CHECK_HEADERS([arpa/inet.h netdb.h netinet/in.h stdlib.h string.h sys/time.h unistd.h ncurses.h])
-AC_CHECK_HEADERS([ncurses.h ncurses/ncurses.h curses.h])
+AC_CHECK_HEADERS([arpa/inet.h netdb.h netinet/in.h stdlib.h string.h sys/time.h unistd.h])
+if test "x$ncurses_test" = "xyes"; then
+ AC_CHECK_HEADERS([ncurses.h ncurses/ncurses.h curses.h])
+fi
if test "x$dmalloc_test" = "xyes"; then
AC_CHECK_HEADERS([dmalloc.h])
fi
diff -ru traceproto-1.1.2beta1~/tp_packet.c traceproto-1.1.2beta1/tp_packet.c
--- traceproto-1.1.2beta1~/tp_packet.c 2006-12-17 16:36:48.000000000 +0100
+++ traceproto-1.1.2beta1/tp_packet.c 2006-12-17 16:39:50.000000000 +0100
@@ -104,7 +104,7 @@
state.low_ttl = YES;
/* tcp_hdr = ( struct libnet_tcp_hdr * ) & raw_packet[ 0 ]; */
- tcp_hdr = ( struct libnet_tcp_hdr * ) tp_align ( raw_packet,
+ tcp_hdr = ( struct libnet_tcp_hdr * ) tp_align ( (char *)raw_packet,
0,
sizeof ( struct libnet_tcp_hdr ) );
@@ -171,7 +171,7 @@
state.low_ttl = YES;
/* udp_hdr = ( struct libnet_udp_hdr * ) & raw_packet[ 0 ]; */
- udp_hdr = ( struct libnet_udp_hdr * ) tp_align ( raw_packet,
+ udp_hdr = ( struct libnet_udp_hdr * ) tp_align ( (char *)raw_packet,
0,
sizeof ( struct libnet_udp_hdr ) );
@@ -289,12 +289,12 @@
* off of the packet
*/
/* eth_hdr = ( struct libnet_802_3_hdr * ) raw_packet; */
- eth_hdr = ( struct libnet_802_3_hdr * ) tp_align ( raw_packet,
+ eth_hdr = ( struct libnet_802_3_hdr * ) tp_align ( (char *)raw_packet,
0,
sizeof ( struct libnet_802_3_hdr ) );
/* state.ip_hdr = ( struct libnet_ipv4_hdr * ) & raw_packet[ eth_offset ]; */
- state.ip_hdr = ( struct libnet_ipv4_hdr * ) tp_align ( raw_packet,
+ state.ip_hdr = ( struct libnet_ipv4_hdr * ) tp_align ( (char *)raw_packet,
eth_offset,
sizeof ( struct libnet_ipv4_hdr ) );
@@ -315,19 +315,19 @@
{
case IPPROTO_ICMP:
/* return parse_icmp_packet ( ( const u_char * ) & raw_packet [ ipv4_offset ] ); */
- return parse_icmp_packet ( ( const u_char * ) tp_align ( raw_packet,
+ return parse_icmp_packet ( ( const u_char * ) tp_align ( (char *)raw_packet,
ipv4_offset,
sizeof ( struct libnet_icmpv4_hdr ) ) );
break;
case IPPROTO_TCP:
/* return parse_tcp_packet ( ( const u_char * ) & raw_packet [ ipv4_offset ] ); */
- return parse_tcp_packet ( ( const u_char * ) tp_align ( raw_packet,
+ return parse_tcp_packet ( ( const u_char * ) tp_align ( (char *)raw_packet,
ipv4_offset,
sizeof ( struct libnet_tcp_hdr ) ) );
break;
case IPPROTO_UDP:
/* return parse_udp_packet ( ( const u_char * ) & raw_packet [ ipv4_offset ] ); */
- return parse_udp_packet ( ( const u_char * ) tp_align ( raw_packet,
+ return parse_udp_packet ( ( const u_char * ) tp_align ( (char *)raw_packet,
ipv4_offset,
sizeof ( struct libnet_udp_hdr ) ) );
break;
|