"protoident"를 컴파일하고 실행하는 방법

"protoident"를 컴파일하고 실행하는 방법

다음과 같은 오픈 소스 DPI 도구를 컴파일하고 실행하려고 합니다.프로토이던트. 그래서 다운받았어요Github의 소스 코드컴파일/빌드 매뉴얼을 찾기 위해 디렉토리 내부를 검색했지만 아무것도 찾지 못했습니다. 마지막으로 디렉터리 내에서 make명령과 명령을 실행하여 시작했지만 다음과 같은 오류가 발생했습니다.Makefile

me@me-MS-7693:~/Desktop/protoident-master/src$ ./Makefile 
./Makefile: line 9: TARGET: command not found
./Makefile: line 10: PROTOCOLS: command not found
./Makefile: line 11: PROTOCOLS: command not found
./Makefile: line 11: SOURCES: command not found
./Makefile: line 12: SOURCES:.c=.h: command not found
./Makefile: line 12: HEADERS: command not found
./Makefile: line 13: SOURCES:.c=.o: command not found
./Makefile: line 13: OBJECTS: command not found
./Makefile: line 14: OTHER_FILES: command not found
./Makefile: line 18: CC: command not found
./Makefile: line 19: CFLAGS: command not found
./Makefile: line 21: OFLAG: command not found
./Makefile: line 22: CFLAG: command not found
./Makefile: line 24: CC: command not found
./Makefile: line 24: LINK: command not found
./Makefile: line 25: LINKFLAGS: command not found
./Makefile: line 26: LIBS: command not found
./Makefile: line 31: .SUFFIXES:: command not found
./Makefile: line 32: .c.o:: command not found
./Makefile: line 33: CC: command not found
./Makefile: line 33: CFLAGS: command not found
./Makefile: line 33: CFLAG: command not found
./Makefile: line 33: OFLAG: command not found
./Makefile: line 33: $<: command not found
./Makefile: line 38: SOURCES: command not found
./Makefile: line 38: TARGET: command not found
./Makefile: line 38: all:: command not found
./Makefile: line 40: profile:: command not found
./Makefile: line 41: profile_compile:: command not found
./Makefile: line 42: profile_compile:: command not found
./Makefile: line 43: profile_compile:: command not found
./Makefile: line 46: TARGET: command not found
./Makefile: line 46: OBJECTS: command not found
./Makefile: line 47: LINK: command not found
./Makefile: line 47: LINKFLAGS: command not found
./Makefile: line 47: LIBS: command not found
./Makefile: line 47: OFLAG: command not found
./Makefile: line 47: TARGET: command not found
./Makefile: line 47: OBJECTS: command not found
./Makefile: line 52: archive:: command not found
./Makefile: line 53: TARGET: command not found
./Makefile: line 53: SOURCES: command not found
./Makefile: line 53: HEADERS: command not found
./Makefile: line 53: OTHER_FILES: command not found
tar: Cowardly refusing to create an empty archive
Try 'tar --help' or 'tar --usage' for more information.
./Makefile: line 55: clean:: command not found
./Makefile: line 56: OBJECTS: command not found
./Makefile: line 58: distclean:: command not found
./Makefile: line 59: TARGET: command not found


me@me-MS-7693:~/Desktop/protoident-master/src$ make
gcc  -lpcap -o protoident main.o hashtable.o ip_reassembling.o flow.o global_func.o dns.o http.o sip.o smtp.o
main.o: In function `main':
/home/ghasemi/Desktop/protoident-master/src/main.c:85: undefined reference to `pcap_open_offline'
/home/ghasemi/Desktop/protoident-master/src/main.c:97: undefined reference to `pcap_compile'
/home/ghasemi/Desktop/protoident-master/src/main.c:100: undefined reference to `pcap_geterr'
/home/ghasemi/Desktop/protoident-master/src/main.c:103: undefined reference to `pcap_setfilter'
/home/ghasemi/Desktop/protoident-master/src/main.c:105: undefined reference to `pcap_geterr'
/home/ghasemi/Desktop/protoident-master/src/main.c:118: undefined reference to `pcap_datalink'
/home/ghasemi/Desktop/protoident-master/src/main.c:125: undefined reference to `pcap_loop'
/home/ghasemi/Desktop/protoident-master/src/main.c:134: undefined reference to `pcap_freecode'
/home/ghasemi/Desktop/protoident-master/src/main.c:136: undefined reference to `pcap_close'
collect2: error: ld returned 1 exit status
Makefile:47: recipe for target 'protoident' failed
make: *** [protoident] Error 1

이러한 오류가 발생한 이유는 무엇이며 이 도구를 어떻게 컴파일하고 사용할 수 있습니까?

답변1

Makefilemake은 별도의 명령이 아닌 에 대한 구성 파일입니다 . 정식빌드 및 설치 절차이다:

./configure
make
make install   # usually: sudo make install

README대부분의 프로젝트는 설치 과정을 텍스트 파일 이나 이와 유사한 형식 으로 자세히 설명합니다 INSTALL.

그러나 이 스크립트에는 스크립트가 없고 대신 configure준비가 되어 있습니다 Makefile. 섹션이 포함되어 있지 않으므로 INSTALL세 번째 명령도 적용할 수 없습니다.

따라서 다음만 실행하면 됩니다.

make

이는 디렉토리 README의 파일 에 문서화되어 있습니다 src. 재미있는 점은 이 책이 체코어로 쓰여 있다는 것입니다(그런데 내 모국어는 체코어입니다).

undefined reference오류 수정

제공된 Makefile에 다음 패치를 사용하여 수정할 수 있는 문제가 있습니다.스택 오버플로 댓글):

diff --git a/src/Makefile b/src/Makefile
index 367dcc4..dda5fb3 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -44,7 +44,7 @@ profile_compile: all


 $(TARGET): $(OBJECTS)
-       $(LINK) $(LINKFLAGS) $(LIBS) $(OFLAG) $(TARGET) $(OBJECTS)
+       $(LINK) $(LINKFLAGS) $(OFLAG) $(TARGET) $(OBJECTS) $(LIBS)

 #####################################
 #other rules

답변2

지침은 귀하의 링크를 살펴 보았습니다. 찾을 수 있지만 체코어로 작성되었습니다. 예를 들어:

Zdrojová a cílová síťová adresa, zdrojový a cílový port není třeba dále
vysvětlovat.

다음과 같이 영어로 번역됩니다.

Source and destination network address, source and destination port does not need to be further explain.

다양한 소스 파일을 보면 설명에 "테스트되지 않음"이 표시됩니다.

저자는 이 프로젝트를 실험이라고 부르며 2년 동안 업데이트되지 않았습니다.

나는 프로젝트가 망가졌고 컴파일러와 make 함수에 아무런 문제가 없을 수 있다고 제안합니다. 시스템이 작동하는지 확인하려면 200명의 기여자와 243개의 릴리스가 있는 gnome 데스크탑용 github에서 간단한 계산기를 다운로드하세요.그놈 계산기. 2년간 활동이 없는 현재 선택지 대신 이를 컴파일해 저자는 실험이라고 부른다.

관련 정보