diff --git a/infrastructure-centred/owlps-listener/Makefile_atheros b/infrastructure-centred/owlps-listener/Makefile_atheros index 4e499e0..0c710f7 100644 --- a/infrastructure-centred/owlps-listener/Makefile_atheros +++ b/infrastructure-centred/owlps-listener/Makefile_atheros @@ -27,25 +27,30 @@ CFLAGS=-O2 -W -Wall -Wstrict-prototypes -O -I. DEPFLAGS=-MMD XCFLAGS=$(CFLAGS) $(DEPFLAGS) $(WARN) $(HEADERS) PICFLAG=-fPIC -LIBS=-lm -lpcap -liw ../../libowlps/libowlps.so.1.0 -LATHEROS=-L$(TOOLCHAIN_USR)/lib/ -I$(TOOLCHAIN_USR_2)/lib/ -IATHEROS=-I$(TOOLCHAIN_USR)/include/ -I$(TOOLCHAIN_USR_2)/include/ +LIBS = -lm -lpcap -liw +LOWLPS = -L../../libowlps -lowlps +LOWLPSA = ../../libowlps/libowlps.a +LATHEROS = -L$(TOOLCHAIN_USR)/lib -L$(TOOLCHAIN_USR_2)/lib +IATHEROS = -I$(TOOLCHAIN_USR)/include -I$(TOOLCHAIN_USR_2)/include ## Cibles de compilation standard ## -.PHONY : all install uninstall clean purge help +.PHONY : all static semistatic install uninstall clean purge help all : $(TARGET) +static : $(TARGET).static +semistatic : $(TARGET).semistatic % : %.o - $(CC) $(LDFLAGS) $(STRIPFLAGS) $(XCFLAGS) -o $@ $^ $(LIBS) $(IATHEROS) $(LATHEROS) + $(CC) $(LDFLAGS) $(STRIPFLAGS) $(XCFLAGS) -o $@ $^ $(LIBS) $(LOWLPS) $(IATHEROS) $(LATHEROS) +%.static : %.o + $(CC) $(LDFLAGS) $(STRIPFLAGS) $(XCFLAGS) -o $@ $^ $(LIBS) $(LOWLPS) $(IATHEROS) $(LATHEROS) -static +%.semistatic : %.o + $(CC) $(LDFLAGS) $(STRIPFLAGS) $(XCFLAGS) -o $@ $^ $(LIBS) $(LOWLPSA) $(IATHEROS) $(LATHEROS) %.o : %.c $(HEADER) $(CC) $(XCFLAGS) $(IATHEROS) -c $< -# Compilation du programme -$(TARGET) : $(TARGET).o $(HEADER) - ## Installation / désinstallation ## @@ -63,7 +68,7 @@ clean : @$(RM) -fv *~ *.o *.d purge : clean - @$(RM) -fv $(TARGET) + @$(RM) -fv $(TARGET) $(TARGET).static $(TARGET).semistatic ## Aide ## diff --git a/infrastructure-centred/owlps-listener/owlps-listener.h b/infrastructure-centred/owlps-listener/owlps-listener.h index d4e2a85..76d6735 100644 --- a/infrastructure-centred/owlps-listener/owlps-listener.h +++ b/infrastructure-centred/owlps-listener/owlps-listener.h @@ -8,7 +8,6 @@ // Compilation-time options (comment-out to unactivate) #define USE_CONFIG_FILE // Use libconfuse to read a config file #define USE_PTHREAD // POSIX threads available? -//#define PLATFORM_ATHEROS // Will we compile to an Atheros platform? #define DEBUG @@ -17,14 +16,26 @@ #include #ifdef USE_CONFIG_FILE -#include +# include #endif // USE_CONFIG_FILE #ifdef USE_PTHREAD -#include +# include #endif // USE_PTHREAD #include +/* defines le32toh only in glibc >= 2.9. If we use an older + * version of glibc, or another libc (e.g. uClibc), we must define it + * manually. + */ +#ifndef le32toh +# if __BYTE_ORDER == __LITTLE_ENDIAN +# define le32toh(x) (x) +# else // __BYTE_ORDER == __LITTLE_ENDIAN +# include +# define le32toh(x) bswap_32(x) +# endif // __BYTE_ORDER == __LITTLE_ENDIAN +#endif // le32toh // Pour la fonction get_mac_addr() : #include diff --git a/infrastructure-centred/owlps-listener/owlps-listenerd.c b/infrastructure-centred/owlps-listener/owlps-listenerd.c index d294edb..1461750 100644 --- a/infrastructure-centred/owlps-listener/owlps-listenerd.c +++ b/infrastructure-centred/owlps-listener/owlps-listenerd.c @@ -454,7 +454,7 @@ void read_packet(u_char *args, const struct pcap_pkthdr *header, const u_char *p check[i] = FALSE ; rtap_position = 8 ; // Début des champs déterminés par le present flag - for(i=0 ; i < 15 ; i++) // on teste les 15 premiers bits du champ flag afin de valider la présence et de les copier + for (i=0 ; i < 15 ; i++) // on teste les 15 premiers bits du champ flag afin de valider la présence et de les copier { if ((rtap_presentflags % 2) == 1) {