2011-06-15 04:22:30 +00:00
|
|
|
SRCS= dna.c server.c client.c peers.c ciphers.c responses.c packetformats.c dataformats.c \
|
2011-08-08 06:41:05 +00:00
|
|
|
hlrdata.c srandomdev.c simulate.c batman.c export.c gateway.c \
|
2011-08-12 19:05:11 +00:00
|
|
|
overlay.c overlay_buffer.c overlay_interface.c overlay_payload.c overlay_route.c \
|
2011-09-12 18:05:26 +00:00
|
|
|
overlay_packetformats.c overlay_abbreviations.c overlay_advertise.c
|
2011-06-15 04:22:30 +00:00
|
|
|
|
2011-04-27 11:48:09 +00:00
|
|
|
OBJS= dna.o server.o client.o peers.o ciphers.o responses.o packetformats.o dataformats.o \
|
2011-08-08 06:41:05 +00:00
|
|
|
hlrdata.o srandomdev.o simulate.o batman.o export.o gateway.o \
|
2011-08-12 19:05:11 +00:00
|
|
|
overlay.o overlay_buffer.o overlay_interface.o overlay_payload.o overlay_route.o \
|
2011-09-12 18:05:26 +00:00
|
|
|
overlay_packetformats.o overlay_abbreviations.o overlay_advertise.o
|
2011-08-12 19:05:11 +00:00
|
|
|
|
2010-07-13 12:15:46 +00:00
|
|
|
HDRS= Makefile mphlr.h
|
2011-09-07 01:56:26 +00:00
|
|
|
#LDFLAGS= -L/Developer/SDKs/MacOSX10.6.sdk/usr/lib
|
|
|
|
#CFLAGS= -I/Developer/SDKs/MacOSX10.6.sdk/usr/include
|
|
|
|
#LDFLAGS= -L/opt/local/lib -lefence
|
2011-08-12 06:15:26 +00:00
|
|
|
DEFS= -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DHAVE_LIBC=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_STDIO_H=1 -DHAVE_ERRNO_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRINGS_H=1 -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DHAVE_ARPA_INET_H=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_SYS_MMAN_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_POLL_H=1 -DHAVE_NETDB_H=1 -DHAVE_NETINET_IN_H=1 -DHAVE_IFADDRS_H=1
|
2010-07-13 12:15:46 +00:00
|
|
|
|
2011-06-15 04:22:30 +00:00
|
|
|
all: serval.c dna
|
2010-07-13 12:15:46 +00:00
|
|
|
|
|
|
|
%.o: %.c $(HDRS)
|
2011-09-07 01:56:26 +00:00
|
|
|
$(CC) $(CFLAGS) $(DEFS) -g -Wall -c $<
|
2010-07-13 12:15:46 +00:00
|
|
|
|
|
|
|
dna: $(OBJS)
|
2011-09-07 01:56:26 +00:00
|
|
|
$(CC) $(CFLAGS) -g -Wall -o dna $(OBJS) $(LDFLAGS)
|
2011-06-15 04:22:30 +00:00
|
|
|
|
|
|
|
serval.c: $(SRCS) $(HDRS)
|
|
|
|
cat mphlr.h > serval.c
|
|
|
|
echo '#include <sys/mman.h>' >>serval.c
|
|
|
|
cat $(SRCS) | grep -v "#include" | sed -e 's/inet_ntoa/ast_inet_ntoa/g' >>serval.c
|
2010-07-13 12:15:46 +00:00
|
|
|
|
|
|
|
testserver: dna
|
|
|
|
clear
|
|
|
|
rm hlr.dat
|
|
|
|
./dna -vvv -S 1 -f hlr.dat
|
|
|
|
|
|
|
|
testcreate: dna
|
|
|
|
clear
|
|
|
|
./dna -vvv -d 0427679796 -C
|
|
|
|
@touch testcreate
|
|
|
|
|
|
|
|
testget: dna testcreate
|
|
|
|
clear
|
|
|
|
./dna -vvv -d 0427679796 -R dids | tee testget
|
|
|
|
|
|
|
|
testset: dna testget
|
|
|
|
clear
|
|
|
|
# Try writing a value to a variable
|
|
|
|
echo "short value" >shortvalue.txt
|
|
|
|
./dna -vvv -s `cat testget | cut -f2 -d: | tail -1` -i 0 -W note=@shortvalue.txt
|
|
|
|
|
|
|
|
testbigset: testget
|
|
|
|
clear
|
|
|
|
./dna -vvv -s `cat testget | cut -f2 -d: | tail -1` -i 0 -W note=@411.txt
|