Cómo compilar y ejecutar "protoident"

Cómo compilar y ejecutar "protoident"

Estoy intentando compilar y ejecutar una herramienta DPI de código abierto llamadaprotoidente. Así que descarguésu código fuente de Githuby busqué dentro de los directorios manuales de compilación/compilación, pero no encontré nada. Finalmente comencé ejecutando makecomando y Makefilecomando dentro de su directorio, pero me encontré con los siguientes errores:

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

¿Por qué enfrenté esos errores y cómo puedo compilar y utilizar esta herramienta?

Respuesta1

Makefilees un archivo de configuración para make, no un comando separado. el canónicoprocedimiento de construcción e instalaciónes:

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

La mayoría de los proyectos describen su proceso de instalación en detalle en archivos de texto READMEo INSTALLsimilares.

Sin embargo, este no tiene ningún configurescript y en su lugar tiene uno listo Makefile. No contiene INSTALLsección, por lo que el tercer comando tampoco es aplicable.

Entonces solo tienes que ejecutar:

make

Está documentado en el READMEarchivo del srcdirectorio. Lo curioso es que está escrito en checo (que por cierto es mi lengua materna).

Corrección de undefined referenceerrores

Hay un problema en el Makefile proporcionado que se puede solucionar usando el siguiente parche (basado en unComentario de desbordamiento de pila):

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

Respuesta2

Eché un vistazo a su enlace para obtener instrucciones. Se pueden encontrar pero están escritos en checo. Por ejemplo:

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

Se traduce al inglés como:

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

Al observar varios archivos fuente, verá "No probado" en la descripción.

Este autor llama al proyecto un experimento y no se ha actualizado en 2 años.

Propongo que el proyecto no funciona y es posible que no haya ningún problema con su compilador y sus funciones de creación. Para confirmar que su sistema está funcionando, descargue una calculadora simple de github para escritorio gnome que tiene 200 colaboradores y 243 versiones:calculadora-gnomo. Compile esto en lugar de su elección actual, que no ha tenido actividad durante dos años y que el autor llama experimento.

información relacionada