banner

[Rule] Rules  [Home] Main Forum  [Portal] Portal  
[Members] Member Listing  [Statistics] Statistics  [Search] Search  [Reading Room] Reading Room 
[Register] Register  
[Login] Loginhttp  | https  ]
 
Forum Index Thảo luận hệ điều hành *nix Ai giúp mình cài tool này với  XML
  [Question]   Ai giúp mình cài tool này với 09/08/2006 23:51:30 (+0700) | #1 | 13575
vietwow
Member

[Minus]    0    [Plus]
Joined: 28/06/2006 13:15:47
Messages: 90
Offline
[Profile] [PM]
Mình đang thử build & install tcpdstat từ source (vì apt-get install ko có smilie ). Mình down gói source ở đây :

http://staff.washington.edu/dittrich/talks/core02/tools/tcpdstat-uw.tar

sau khi tar zxvf nó ra, gõ lệnh make thì nó báo lỗi sau :

vsec@vsec18-nix:~/Desktop/tcpdstat-uw$ sudo make
cc -I. -I../libpcap-0.7.1 -DLINUX -D__FAVOR_BSD -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 -L../libpcap-0.7.1 -c net_read.c
net_read.c:86:18: error: pcap.h: No such file or directory
net_read.c:117: warning: ‘struct pcap_pkthdr’ declared inside parameter list
net_read.c:117: warning: its scope is only this definition or declaration, which is probably not what you want
net_read.c:119: warning: ‘struct pcap_pkthdr’ declared inside parameter list
net_read.c:121: warning: ‘struct pcap_pkthdr’ declared inside parameter list
net_read.c:123: warning: ‘struct pcap_pkthdr’ declared inside parameter list
net_read.c:125: warning: ‘struct pcap_pkthdr’ declared inside parameter list
net_read.c:127: warning: ‘struct pcap_pkthdr’ declared inside parameter list
net_read.c:143: error: ‘PCAP_ERRBUF_SIZE’ undeclared here (not in a function)
net_read.c:146: error: syntax error before ‘*’ token
net_read.c:146: warning: data definition has no type or storage class
net_read.c:149: error: static declaration of ‘packet_length’ follows non-static declaration
tcpdstat.h:415: error: previous declaration of ‘packet_length’ was here
net_read.c:157: warning: ‘struct pcap_pkthdr’ declared inside parameter list
net_read.c:171: error: syntax error before ‘pcap_handler’
net_read.c:171: warning: no semicolon at end of struct or union
net_read.c:173: error: syntax error before ‘}’ token
net_read.c:175: error: array type has incomplete element type
net_read.c:176: error: ‘DLT_EN10MB’ undeclared here (not in a function)
net_read.c:177: error: ‘DLT_FDDI’ undeclared here (not in a function)
net_read.c:181: error: ‘DLT_PPP’ undeclared here (not in a function)
net_read.c:182: error: ‘DLT_NULL’ undeclared here (not in a function)
net_read.c:187: error: syntax error before ‘lookup_printer’
net_read.c: In function ‘lookup_printer’:
net_read.c:191: error: dereferencing pointer to incomplete type
net_read.c:191: error: increment of pointer to unknown structure
net_read.c:191: error: arithmetic on pointer to an incomplete type
net_read.c:192: error: dereferencing pointer to incomplete type
net_read.c:193: error: dereferencing pointer to incomplete type
net_read.c:197: warning: return makes integer from pointer without a cast
net_read.c: In function ‘open_dump’:
net_read.c:209: warning: assignment makes pointer from integer without a cast
net_read.c:213: warning: assignment makes pointer from integer without a cast
net_read.c:215: warning: passing argument 1 of ‘fileno’ makes pointer from integer without a cast
net_read.c: At top level:
net_read.c:235: warning: ‘struct pcap_pkthdr’ declared inside parameter list
net_read.c:236: error: conflicting types for ‘dump_reader’
net_read.c:117: error: previous declaration of ‘dump_reader’ was here
net_read.c: In function ‘dump_reader’:
net_read.c:243: error: dereferencing pointer to incomplete type
net_read.c:244: error: dereferencing pointer to incomplete type
net_read.c:246: error: dereferencing pointer to incomplete type
net_read.c:248: error: dereferencing pointer to incomplete type
net_read.c:249: error: dereferencing pointer to incomplete type
net_read.c:250: error: dereferencing pointer to incomplete type
net_read.c:252: error: dereferencing pointer to incomplete type
net_read.c:259: error: dereferencing pointer to incomplete type
net_read.c:260: error: dereferencing pointer to incomplete type
net_read.c:265: error: dereferencing pointer to incomplete type
net_read.c:266: error: dereferencing pointer to incomplete type
net_read.c:277: error: dereferencing pointer to incomplete type
net_read.c:282: warning: passing argument 2 of ‘net_reader’ from incompatible pointer type
net_read.c: At top level:
net_read.c:287: warning: ‘struct pcap_pkthdr’ declared inside parameter list
net_read.c:288: error: conflicting types for ‘ether_if_read’
net_read.c:119: error: previous declaration of ‘ether_if_read’ was here
net_read.c: In function ‘ether_if_read’:
net_read.c:289: error: dereferencing pointer to incomplete type
net_read.c:290: error: dereferencing pointer to incomplete type
net_read.c: At top level:
net_read.c:337: warning: ‘struct pcap_pkthdr’ declared inside parameter list
net_read.c:338: error: conflicting types for ‘fddi_if_read’
net_read.c:121: error: previous declaration of ‘fddi_if_read’ was here
net_read.c: In function ‘fddi_if_read’:
net_read.c:339: error: dereferencing pointer to incomplete type
net_read.c:340: error: dereferencing pointer to incomplete type
net_read.c: At top level:
net_read.c:420: warning: ‘struct pcap_pkthdr’ declared inside parameter list
net_read.c:421: error: conflicting types for ‘atm_if_read’
net_read.c:123: error: previous declaration of ‘atm_if_read’ was here
net_read.c: In function ‘atm_if_read’:
net_read.c:422: error: dereferencing pointer to incomplete type
net_read.c:423: error: dereferencing pointer to incomplete type
net_read.c: At top level:
net_read.c:457: warning: ‘struct pcap_pkthdr’ declared inside parameter list
net_read.c:458: error: conflicting types for ‘ppp_if_read’
net_read.c:125: error: previous declaration of ‘ppp_if_read’ was here
net_read.c: In function ‘ppp_if_read’:
net_read.c:459: error: dereferencing pointer to incomplete type
net_read.c:460: error: dereferencing pointer to incomplete type
net_read.c: At top level:
net_read.c:472: warning: ‘struct pcap_pkthdr’ declared inside parameter list
net_read.c:473: error: conflicting types for ‘null_if_read’
net_read.c:127: error: previous declaration of ‘null_if_read’ was here
net_read.c: In function ‘null_if_read’:
net_read.c:474: error: dereferencing pointer to incomplete type
net_read.c:475: error: dereferencing pointer to incomplete type
make: *** [net_read.o] Error 1

Ai bít lỗi này là lỗi gì và fix thế nào thì giúp mình nhé. Thanx smilie)
[Up] [Print Copy]
  [Question]   Re: Ai giúp mình cài tool này với 10/08/2006 00:00:02 (+0700) | #2 | 13577
[Avatar]
conmale
Administrator

Joined: 07/05/2004 23:43:15
Messages: 9353
Location: down under
Offline
[Profile] [PM]
Vào tcpdump.org download thư viện pcap xuống, compile nó rồi mới compile chương trình trên. Nó đòi pcap.h đó smilie)
What bringing us together is stronger than what pulling us apart.
[Up] [Print Copy]
  [Question]   Re: Ai giúp mình cài tool này với 10/08/2006 00:05:25 (+0700) | #3 | 13578
vietwow
Member

[Minus]    0    [Plus]
Joined: 28/06/2006 13:15:47
Messages: 90
Offline
[Profile] [PM]
Hix, sao kỳ vậy anh, em apt-get install libpcap0.8 mới nhất rồi mà, vì máy em đã cài ethereal, tcpdump và fragroute rồi, ko thế thiếu được smilie(
[Up] [Print Copy]
  [Question]   Re: Ai giúp mình cài tool này với 10/08/2006 00:22:35 (+0700) | #4 | 13588
vietwow
Member

[Minus]    0    [Plus]
Joined: 28/06/2006 13:15:47
Messages: 90
Offline
[Profile] [PM]
Em nghe lời anh, down bàn libpcap http://www.tcpdump.org/release/libpcap-0.9.4.tar.gz về build, lúc ./configure thì ok nhưng lúc make nó lại bị lỗi tiếp smilie( :

vsec@vsec18-nix:~/Desktop/libpcap-0.9.4$ sudo make
Password:
gcc -O2 -I. -DHAVE_CONFIG_H -D_U_="__attribute__((unused))" -c ./pcap-linux.c
gcc -O2 -I. -DHAVE_CONFIG_H -D_U_="__attribute__((unused))" -c ./fad-getad.c
sed -e 's/.*/static const char pcap_version_string[] = "libpcap version &";/' ./VERSION > version.h
gcc -O2 -I. -DHAVE_CONFIG_H -D_U_="__attribute__((unused))" -c ./pcap.c
gcc -O2 -I. -DHAVE_CONFIG_H -D_U_="__attribute__((unused))" -c ./inet.c
gcc -O2 -I. -DHAVE_CONFIG_H -D_U_="__attribute__((unused))" -c ./gencode.c
gcc -O2 -I. -DHAVE_CONFIG_H -D_U_="__attribute__((unused))" -c ./optimize.c
gcc -O2 -I. -DHAVE_CONFIG_H -D_U_="__attribute__((unused))" -c ./nametoaddr.c
gcc -O2 -I. -DHAVE_CONFIG_H -D_U_="__attribute__((unused))" -c ./etherent.c
gcc -O2 -I. -DHAVE_CONFIG_H -D_U_="__attribute__((unused))" -c ./savefile.c
rm -f bpf_filter.c
ln -s ./bpf/net/bpf_filter.c bpf_filter.c
gcc -O2 -I. -DHAVE_CONFIG_H -D_U_="__attribute__((unused))" -c bpf_filter.c
gcc -O2 -I. -DHAVE_CONFIG_H -D_U_="__attribute__((unused))" -c ./bpf_image.c
gcc -O2 -I. -DHAVE_CONFIG_H -D_U_="__attribute__((unused))" -c ./bpf_dump.c
lex -t scanner.l > $$.scanner.c; mv $$.scanner.c scanner.c
yacc -d grammar.y
make: yacc: Command not found
make: *** [grammar.c] Error 127

Xin anh xem giúp
thanx
[Up] [Print Copy]
  [Question]   Re: Ai giúp mình cài tool này với 10/08/2006 00:33:13 (+0700) | #5 | 13591
[Avatar]
conmale
Administrator

Joined: 07/05/2004 23:43:15
Messages: 9353
Location: down under
Offline
[Profile] [PM]

vietwow wrote:
Em nghe lời anh, down bàn libpcap http://www.tcpdump.org/release/libpcap-0.9.4.tar.gz về build, lúc ./configure thì ok nhưng lúc make nó lại bị lỗi tiếp smilie( :

vsec@vsec18-nix:~/Desktop/libpcap-0.9.4$ sudo make
Password:
gcc -O2 -I. -DHAVE_CONFIG_H -D_U_="__attribute__((unused))" -c ./pcap-linux.c
gcc -O2 -I. -DHAVE_CONFIG_H -D_U_="__attribute__((unused))" -c ./fad-getad.c
sed -e 's/.*/static const char pcap_version_string[] = "libpcap version &";/' ./VERSION > version.h
gcc -O2 -I. -DHAVE_CONFIG_H -D_U_="__attribute__((unused))" -c ./pcap.c
gcc -O2 -I. -DHAVE_CONFIG_H -D_U_="__attribute__((unused))" -c ./inet.c
gcc -O2 -I. -DHAVE_CONFIG_H -D_U_="__attribute__((unused))" -c ./gencode.c
gcc -O2 -I. -DHAVE_CONFIG_H -D_U_="__attribute__((unused))" -c ./optimize.c
gcc -O2 -I. -DHAVE_CONFIG_H -D_U_="__attribute__((unused))" -c ./nametoaddr.c
gcc -O2 -I. -DHAVE_CONFIG_H -D_U_="__attribute__((unused))" -c ./etherent.c
gcc -O2 -I. -DHAVE_CONFIG_H -D_U_="__attribute__((unused))" -c ./savefile.c
rm -f bpf_filter.c
ln -s ./bpf/net/bpf_filter.c bpf_filter.c
gcc -O2 -I. -DHAVE_CONFIG_H -D_U_="__attribute__((unused))" -c bpf_filter.c
gcc -O2 -I. -DHAVE_CONFIG_H -D_U_="__attribute__((unused))" -c ./bpf_image.c
gcc -O2 -I. -DHAVE_CONFIG_H -D_U_="__attribute__((unused))" -c ./bpf_dump.c
lex -t scanner.l > $$.scanner.c; mv $$.scanner.c scanner.c
yacc -d grammar.y
make: yacc: Command not found
make: *** [grammar.c] Error 127

Xin anh xem giúp
thanx
 


Xem màu đỏ ở trên.

Cài thêm yacc
What bringing us together is stronger than what pulling us apart.
[Up] [Print Copy]
  [Question]   Re: Ai giúp mình cài tool này với 10/08/2006 02:26:48 (+0700) | #6 | 13627
vietwow
Member

[Minus]    0    [Plus]
Joined: 28/06/2006 13:15:47
Messages: 90
Offline
[Profile] [PM]
Dạ vâng, em đã gói gói yacc và cài thành công libpcap 0.94 mới nhất, quay lại cái tcpdstat, make lại thì lúc này nó báo lỗi khác :

vsec@vsec18-nix:~/Desktop/tcpdstat-uw$ make
cc -I. -I../libpcap-0.7.1 -DLINUX -D__FAVOR_BSD -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 -L../libpcap-0.7.1 -c net_read.c
net_read.c:149: error: static declaration of ‘packet_length’ follows non-static declaration
tcpdstat.h:415: error: previous declaration of ‘packet_length’ was here
make: *** [net_read.o] Error 1

Hình như lỗi này vẫn liên quan đến libpcap thì phải ? :?smilie

Em mới xài linux khoảng 1 tháng nay, ko rành nên đôi khi có những thắc mắc hơi ngớ ngẩn, hy vọng các bác bỏ qua smilie(
[Up] [Print Copy]
  [Question]   Re: Ai giúp mình cài tool này với 10/08/2006 03:47:54 (+0700) | #7 | 13636
[Avatar]
conmale
Administrator

Joined: 07/05/2004 23:43:15
Messages: 9353
Location: down under
Offline
[Profile] [PM]

vietwow wrote:
Dạ vâng, em đã gói gói yacc và cài thành công libpcap 0.94 mới nhất, quay lại cái tcpdstat, make lại thì lúc này nó báo lỗi khác :

vsec@vsec18-nix:~/Desktop/tcpdstat-uw$ make
cc -I. -I../libpcap-0.7.1 -DLINUX -D__FAVOR_BSD -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 -L../libpcap-0.7.1 -c net_read.c
net_read.c:149: error: static declaration of ‘packet_length’ follows non-static declaration
tcpdstat.h:415: error: previous declaration of ‘packet_length’ was here
make: *** [net_read.o] Error 1

Hình như lỗi này vẫn liên quan đến libpcap thì phải ? :?smilie

Em mới xài linux khoảng 1 tháng nay, ko rành nên đôi khi có những thắc mắc hơi ngớ ngẩn, hy vọng các bác bỏ qua smilie(  


Cái này xem như phiên bản của libcap không tương thích rồi.

Thử download bản libcap 0.7.1 ngay nơi bồ download tcpdstat-uw rồi compile lại pcap (chồng lên bản có phiên bản mới)
http://staff.washington.edu/dittrich/talks/core02/tools/libpcap-0.7.1.tar.gz

Sau đó mới compile lại chương trình tcpdstat-uw.
What bringing us together is stronger than what pulling us apart.
[Up] [Print Copy]
  [Question]   Re: Ai giúp mình cài tool này với 10/08/2006 05:21:15 (+0700) | #8 | 13668
vietwow
Member

[Minus]    0    [Plus]
Joined: 28/06/2006 13:15:47
Messages: 90
Offline
[Profile] [PM]
Hix, Vẫn bị y chang vậy à anh, em sang máy khác thử lại lun rồi, ko khác gì hết, hix, chắc đành phải search gói deb vậy smilie(
[Up] [Print Copy]
  [Question]   Re: Ai giúp mình cài tool này với 10/08/2006 05:47:28 (+0700) | #9 | 13674
subnetwork
Member

[Minus]    0    [Plus]
Joined: 05/09/2004 06:08:09
Messages: 1666
Offline
[Profile] [PM] [WWW] [Yahoo!]
Lại lạ tiếp , khi cài đặt tcpdump thì cần cài đặt libpcap trước là xong .

Ở lỗi này
Code:
make: yacc: Command not found


Thì cài đặt thêm yacc cho nó nằm ở thư mục sau /usr/local/bin/yacc

Bạn thử cài đặt thêm gtk package và thử làm lại lần nữa xem .
wxGTK-2.6.3
Code:
http://prdownloads.sourceforge.net/wxwindows/wxGTK-2.6.3.tar.gz


tar xfvz wxGTK-2.6.3.tar.gz
cd wxGTK-2.6.3
./configure
make
make install 


Hy vọng giải quyết được vấn đề này cho bnạn .
Thân
Quản lý máy chủ, cài đặt, tư vấn, thiết kế, bảo mật hệ thống máy chủ dùng *nix
http://chamsocmaychu.com
[Up] [Print Copy]
[digg] [delicious] [google] [yahoo] [technorati] [reddit] [stumbleupon]
Go to: 
 Users currently in here 
1 Anonymous

Powered by JForum - Extended by HVAOnline
 hvaonline.net  |  hvaforum.net  |  hvazone.net  |  hvanews.net  |  vnhacker.org
1999 - 2013 © v2012|0504|218|