diff --git a/Makefile b/Makefile index 0bde8c5c..d366ef32 100644 --- a/Makefile +++ b/Makefile @@ -1,20 +1,24 @@ +SRCS= dna.c server.c client.c peers.c ciphers.c responses.c packetformats.c dataformats.c \ + hlrdata.c srandomdev.c simulate.c batman.c overlay.c export.c gateway.c + OBJS= dna.o server.o client.o peers.o ciphers.o responses.o packetformats.o dataformats.o \ hlrdata.o srandomdev.o simulate.o batman.o overlay.o export.o gateway.o HDRS= Makefile mphlr.h LDFLAGS= -CFLAGS= -Os -g -Wall 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 -DEFS+= -DHAVE_BZERO -ASTERISK_APP_OBJS= asterisk_app.o $(OBJS) - -all: dna +all: serval.c dna %.o: %.c $(HDRS) - $(CC) $(DEFS) $(CFLAGS) -c $< + $(CC) $(DEFS) -Os -g -Wall -c $< dna: $(OBJS) - $(CC) $(CFLAGS) -o dna $(OBJS) $(LDFLAGS) + $(CC) -Os -g -Wall -o dna $(OBJS) $(LDFLAGS) + +serval.c: $(SRCS) $(HDRS) + cat mphlr.h > serval.c + echo '#include ' >>serval.c + cat $(SRCS) | grep -v "#include" | sed -e 's/inet_ntoa/ast_inet_ntoa/g' >>serval.c testserver: dna clear @@ -39,6 +43,3 @@ testset: dna testget testbigset: testget clear ./dna -vvv -s `cat testget | cut -f2 -d: | tail -1` -i 0 -W note=@411.txt - -app_serval.so: $(ASTERISK_APP_OBJS) - $(CC) $(CFLAGS) -shared -o app_serval.so $(DEFS) -DDNA_NO_MAIN $(ASTERISK_APP_OBJS) $(LDFLAGS) diff --git a/Makefile.in b/Makefile.in old mode 100755 new mode 100644 index 52ac811b..050f3dc0 --- a/Makefile.in +++ b/Makefile.in @@ -1,10 +1,13 @@ +SRCS= dna.c server.c client.c peers.c ciphers.c responses.c packetformats.c dataformats.c \ + hlrdata.c srandomdev.c simulate.c batman.c overlay.c export.c gateway.c + OBJS= dna.o server.o client.o peers.o ciphers.o responses.o packetformats.o dataformats.o \ hlrdata.o srandomdev.o simulate.o batman.o overlay.o export.o gateway.o HDRS= Makefile mphlr.h LDFLAGS= @LDFLAGS@ DEFS= @DEFS@ -all: dna +all: serval.c dna %.o: %.c $(HDRS) $(CC) $(DEFS) -Os -g -Wall -c $< @@ -12,6 +15,11 @@ all: dna dna: $(OBJS) $(CC) -Os -g -Wall -o dna $(OBJS) $(LDFLAGS) +serval.c: $(SRCS) $(HDRS) + cat mphlr.h > serval.c + echo '#include ' >>serval.c + cat $(SRCS) | grep -v "#include" | sed -e 's/inet_ntoa/ast_inet_ntoa/g' >>serval.c + testserver: dna clear rm hlr.dat diff --git a/TODO b/TODO old mode 100755 new mode 100644 diff --git a/asterisk_app.c b/asterisk_app.c index 0ebf7ea5..d110d695 100644 --- a/asterisk_app.c +++ b/asterisk_app.c @@ -41,7 +41,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision: Serval $") #include "asterisk/cdr.h" #include "asterisk/options.h" -#include "mphlr.h" +#include "serval.c" #undef inet_ntoa #define inet_ntoa ast_inet_ntoa @@ -52,8 +52,6 @@ static char *sdnalookup_descrip = static char *sdnalookup_app = "SDNALookup"; static char *sdnalookup_synopsis = "Resolve DID into SIP address via Serval DNA"; -char *gatewayuri=NULL; - static char *handle_cli_sdnalookup(int fd, int argc, char *argv[]) { char *did=NULL; diff --git a/batman.c b/batman.c old mode 100755 new mode 100644 diff --git a/ciphers.c b/ciphers.c old mode 100755 new mode 100644 diff --git a/client.c b/client.c old mode 100755 new mode 100644 diff --git a/configure.in b/configure.in old mode 100755 new mode 100644 diff --git a/dataformats.c b/dataformats.c old mode 100755 new mode 100644 diff --git a/hlrdata.c b/hlrdata.c old mode 100755 new mode 100644 diff --git a/meshpotato_build b/meshpotato_build old mode 100755 new mode 100644 diff --git a/openwrt-makefile b/openwrt-makefile old mode 100755 new mode 100644 diff --git a/packetformats.c b/packetformats.c old mode 100755 new mode 100644 diff --git a/peers.c b/peers.c old mode 100755 new mode 100644 diff --git a/responses.c b/responses.c old mode 100755 new mode 100644 diff --git a/simulate.c b/simulate.c old mode 100755 new mode 100644 diff --git a/srandomdev.c b/srandomdev.c old mode 100755 new mode 100644 diff --git a/testdna b/testdna old mode 100755 new mode 100644