From cac9e26bcf4f40dcb6b58080ae8748a9eaffe67a Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 30 Jun 2010 08:14:56 +0000 Subject: [PATCH] vpn build integration --- TODO | 6 - configure.ac | 3 +- src/Makefile.am | 3 +- src/vpn/Makefile | 660 ++++++++++++++++++++++++++++++++++++++++- src/vpn/packet.h | 14 +- src/vpn/pretty-print.c | 6 +- 6 files changed, 661 insertions(+), 31 deletions(-) diff --git a/TODO b/TODO index 08fb96b78..4cc7d3572 100644 --- a/TODO +++ b/TODO @@ -111,13 +111,7 @@ * DATASTORE: - GNUNET_DATASTORE_cancel method not tested * TESTING: [Nate] - - modify configuration to allow controlling connections for non-local starts - - testbed creation with topology (needs working F2F topology) - - testbed with churn - - implement testcases for distributed testing - test basic peer re-configure - - test topology creation - - test churn generation - consider changing API for peer-group termination to call continuation when done * NAT/UPNP: [MW] diff --git a/configure.ac b/configure.ac index 0abacd253..0f1a7c91d 100644 --- a/configure.ac +++ b/configure.ac @@ -662,6 +662,7 @@ src/hello/Makefile src/include/Makefile src/include/gnunet_directories.h src/hostlist/Makefile +src/monkey/Makefile src/nat/Makefile src/nat/libnatpmp/Makefile src/nat/miniupnp/Makefile @@ -673,7 +674,7 @@ src/testing/Makefile src/topology/Makefile src/transport/Makefile src/util/Makefile -src/monkey/Makefile +src/vpn/Makefile ]) AC_OUTPUT diff --git a/src/Makefile.am b/src/Makefile.am index cdab96621..aa68c8537 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -30,4 +30,5 @@ SUBDIRS = \ hostlist \ topology \ $(NAT_DIR) \ - fs + fs \ + vpn diff --git a/src/vpn/Makefile b/src/vpn/Makefile index d2d4342bb..6f34b70d8 100644 --- a/src/vpn/Makefile +++ b/src/vpn/Makefile @@ -1,22 +1,654 @@ -CFLAGS=-Wall -pedantic --std=c99 -g -CXXFLAGS = ${CFLAGS} +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# src/vpn/Makefile. Generated from Makefile.in by configure. -LDFLAGS = +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -.PHONY: .dependencies +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. -all: default -default: .dependencies test -test: test.o tun.o packet.o debug.o pretty-print.o tcp.o -.dependencies: - echo > .dependencies - gcc -M *.c >> .dependencies +pkgdatadir = $(datadir)/gnunet +pkgincludedir = $(includedir)/gnunet +pkglibdir = $(libdir)/gnunet +pkglibexecdir = $(libexecdir)/gnunet +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = x86_64-unknown-linux-gnu +host_triplet = x86_64-unknown-linux-gnu +bin_PROGRAMS = gnunet-daemon-vpn$(EXEEXT) $(am__EXEEXT_1) +subdir = src/vpn +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/align.m4 \ + $(top_srcdir)/m4/argz.m4 $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libcurl.m4 $(top_srcdir)/m4/libgcrypt.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltdl.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/gnunet_config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__EXEEXT_1 = gnunet-vpn-helper$(EXEEXT) +am__installdirs = "$(DESTDIR)$(bindir)" +PROGRAMS = $(bin_PROGRAMS) +am_gnunet_daemon_vpn_OBJECTS = gnunet-daemon-vpn.$(OBJEXT) +gnunet_daemon_vpn_OBJECTS = $(am_gnunet_daemon_vpn_OBJECTS) +am__DEPENDENCIES_1 = +gnunet_daemon_vpn_DEPENDENCIES = \ + $(top_builddir)/src/core/libgnunetcore.la \ + $(top_builddir)/src/statistics/libgnunetstatistics.la \ + $(top_builddir)/src/util/libgnunetutil.la \ + $(am__DEPENDENCIES_1) +am_gnunet_vpn_helper_OBJECTS = debug.$(OBJEXT) packet.$(OBJEXT) \ + pretty-print.$(OBJEXT) tcp.$(OBJEXT) test.$(OBJEXT) \ + tun.$(OBJEXT) +gnunet_vpn_helper_OBJECTS = $(am_gnunet_vpn_helper_OBJECTS) +gnunet_vpn_helper_LDADD = $(LDADD) +DEFAULT_INCLUDES = -I. -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(gnunet_daemon_vpn_SOURCES) $(gnunet_vpn_helper_SOURCES) +DIST_SOURCES = $(gnunet_daemon_vpn_SOURCES) \ + $(gnunet_vpn_helper_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = ${SHELL} /home/grothoff/svn/gnunet/missing --run aclocal-1.11 +AMTAR = ${SHELL} /home/grothoff/svn/gnunet/missing --run tar +AR = ar +ARGZ_H = +AS = as +AUTOCONF = ${SHELL} /home/grothoff/svn/gnunet/missing --run autoconf +AUTOHEADER = ${SHELL} /home/grothoff/svn/gnunet/missing --run autoheader +AUTOMAKE = ${SHELL} /home/grothoff/svn/gnunet/missing --run automake-1.11 +AWK = gawk +CC = gcc +CCDEPMODE = depmode=gcc3 +CFLAGS = -fno-strict-aliasing -Wall -g -O0 -Wall -Werror +CPP = gcc -E +CPPFLAGS = -I/home/grothoff/gn9//include +CXX = g++ +CXXCPP = g++ -E +CXXDEPMODE = depmode=gcc3 +CXXFLAGS = -g -O0 -Wall -Werror +CYGPATH_W = echo +DEFAULT_INTERFACE = "eth0" +DEFS = -DHAVE_CONFIG_H +DEPDIR = .deps +DLLDIR = lib +DLLTOOL = dlltool +DSYMUTIL = +DUMPBIN = +ECHO_C = +ECHO_N = -n +ECHO_T = +EGREP = /bin/grep -E +EXEEXT = +EXT_LIBS = +EXT_LIB_PATH = -L/home/grothoff/gn9//lib +FGREP = /bin/grep -F +GMSGFMT = /usr/bin/msgfmt +GMSGFMT_015 = /usr/bin/msgfmt +GN_DAEMON_CONFIG_DIR = /etc +GN_DAEMON_HOME_DIR = /var/lib/gnunet +GN_INTLINCL = +GN_LIBINTL = +GN_LIB_LDFLAGS = -export-dynamic -no-undefined +GN_PLUGIN_LDFLAGS = -export-dynamic -avoid-version -module -no-undefined +GN_USER_HOME_DIR = ~/.gnunet +GREP = /bin/grep +INCLTDL = +INSTALL = /usr/bin/install -c +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_PROGRAM = ${INSTALL} +INSTALL_SCRIPT = ${INSTALL} +INSTALL_STRIP_PROGRAM = $(install_sh) -c -s +INTLLIBS = +INTL_MACOSX_LIBS = +LD = /usr/bin/ld -m elf_x86_64 +LDFLAGS = -L/home/grothoff/gn9//lib +LIBADD_DL = -ldl +LIBADD_DLD_LINK = +LIBADD_DLOPEN = -ldl +LIBADD_SHL_LOAD = +LIBCURL = -lcurl +LIBCURL_CPPFLAGS = +LIBGCRYPT_CFLAGS = +LIBGCRYPT_CONFIG = /usr/bin/libgcrypt-config +LIBGCRYPT_LIBS = -lgcrypt +LIBICONV = +LIBINTL = +LIBLTDL = -lltdl +LIBOBJS = +LIBPREFIX = +LIBS = -ldl +LIBTOOL = $(SHELL) $(top_builddir)/libtool +LIPO = +LN_S = ln -s +LTDLDEPS = +LTDLINCL = +LTDLOPEN = libltdl +LTLIBICONV = +LTLIBINTL = +LTLIBOBJS = +LT_CONFIG_H = gnunet_config.h +LT_DLLOADERS = libltdl/dlopen.la +LT_DLPREOPEN = -dlpreopen libltdl/dlopen.la +MAKEINFO = ${SHELL} /home/grothoff/svn/gnunet/missing --run makeinfo +MKDIR_P = /bin/mkdir -p +MSGFMT = /usr/bin/msgfmt +MSGFMT_015 = /usr/bin/msgfmt +MSGMERGE = /usr/bin/msgmerge +MYSQL_CPPFLAGS = +MYSQL_LDFLAGS = +NM = /usr/bin/nm -B +NMEDIT = +OBJC = gcc +OBJCDEPMODE = depmode=gcc3 +OBJCFLAGS = +OBJDUMP = objdump +OBJEXT = o +OTOOL = +OTOOL64 = +PACKAGE = gnunet +PACKAGE_BUGREPORT = bug-gnunet@gnu.org +PACKAGE_NAME = gnunet +PACKAGE_STRING = gnunet 0.9.0pre0 +PACKAGE_TARNAME = gnunet +PACKAGE_URL = +PACKAGE_VERSION = 0.9.0pre0 +PATH_SEPARATOR = : +POSTGRES_CPPFLAGS = +POSTGRES_LDFLAGS = +POSUB = po +PYTHON = /usr/bin/python +PYTHON_EXEC_PREFIX = ${exec_prefix} +PYTHON_PLATFORM = linux2 +PYTHON_PREFIX = ${prefix} +PYTHON_VERSION = 2.5 +RANLIB = ranlib +SED = /bin/sed +SET_MAKE = +SHELL = /bin/bash +SQLITE_CPPFLAGS = +SQLITE_LDFLAGS = +STRIP = strip +USE_NLS = yes +VERSION = 0.9.0pre0 +XGETTEXT = /usr/bin/xgettext +XGETTEXT_015 = /usr/bin/xgettext +XMKMF = +X_CFLAGS = +X_EXTRA_LIBS = +X_LIBS = +X_PRE_LIBS = -lSM -lICE +_libcurl_config = +abs_builddir = /home/grothoff/svn/gnunet/src/vpn +abs_srcdir = /home/grothoff/svn/gnunet/src/vpn +abs_top_builddir = /home/grothoff/svn/gnunet +abs_top_srcdir = /home/grothoff/svn/gnunet +ac_ct_CC = gcc +ac_ct_CXX = g++ +ac_ct_DUMPBIN = +ac_ct_OBJC = gcc +am__include = include +am__leading_dot = . +am__quote = +am__tar = ${AMTAR} chof - "$$tardir" +am__untar = ${AMTAR} xf - +bindir = ${exec_prefix}/bin +build = x86_64-unknown-linux-gnu +build_alias = +build_cpu = x86_64 +build_os = linux-gnu +build_target = linux +build_vendor = unknown +builddir = . +datadir = ${datarootdir} +datarootdir = ${prefix}/share +docdir = ${datarootdir}/doc/${PACKAGE_TARNAME} +dvidir = ${docdir} +exec_prefix = ${prefix} +host = x86_64-unknown-linux-gnu +host_alias = +host_cpu = x86_64 +host_os = linux-gnu +host_vendor = unknown +htmldir = ${docdir} +includedir = ${prefix}/include +infodir = ${datarootdir}/info +install_sh = ${SHELL} /home/grothoff/svn/gnunet/install-sh +libdir = ${exec_prefix}/lib +libexecdir = ${exec_prefix}/libexec +localedir = ${datarootdir}/locale +localstatedir = ${prefix}/var +lt_ECHO = echo +ltdl_LIBOBJS = lt__strl.o +ltdl_LTLIBOBJS = lt__strl.lo +mandir = ${datarootdir}/man +mkdir_p = /bin/mkdir -p +oldincludedir = /usr/include +pdfdir = ${docdir} +pkgpyexecdir = ${pyexecdir}/gnunet +pkgpythondir = ${pythondir}/gnunet +prefix = /home/grothoff/gn9 +program_transform_name = s,x,x, +psdir = ${docdir} +pyexecdir = ${exec_prefix}/lib/python2.5/site-packages +pythondir = ${prefix}/lib/python2.5/site-packages +sbindir = ${exec_prefix}/sbin +sharedstatedir = ${prefix}/com +srcdir = . +subdirs = libltdl +sys_symbol_underscore = no +sysconfdir = ${prefix}/etc +target_alias = +top_build_prefix = ../../ +top_builddir = ../.. +top_srcdir = ../.. +INCLUDES = -I$(top_srcdir)/src/include +#WINFLAGS = -Wl,--no-undefined -Wl,--export-all-symbols +#AM_CFLAGS = --coverage -O0 +VPNBIN = gnunet-vpn-helper +gnunet_vpn_helper_SOURCES = \ + debug.c debug.h \ + packet.h packet.c \ + pretty-print.c pretty-print.h \ + tcp.c tcp.h \ + test.c \ + tun.c tun.h --include .dependencies +gnunet_daemon_vpn_SOURCES = \ + gnunet-daemon-vpn.c -clean: - rm -f *.o - rm -f test +gnunet_daemon_vpn_LDADD = \ + $(top_builddir)/src/core/libgnunetcore.la \ + $(top_builddir)/src/statistics/libgnunetstatistics.la \ + $(top_builddir)/src/util/libgnunetutil.la \ + $(GN_LIBINTL) + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/vpn/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/vpn/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p || test -f $$p1; \ + then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +gnunet-daemon-vpn$(EXEEXT): $(gnunet_daemon_vpn_OBJECTS) $(gnunet_daemon_vpn_DEPENDENCIES) + @rm -f gnunet-daemon-vpn$(EXEEXT) + $(LINK) $(gnunet_daemon_vpn_OBJECTS) $(gnunet_daemon_vpn_LDADD) $(LIBS) +gnunet-vpn-helper$(EXEEXT): $(gnunet_vpn_helper_OBJECTS) $(gnunet_vpn_helper_DEPENDENCIES) + @rm -f gnunet-vpn-helper$(EXEEXT) + $(LINK) $(gnunet_vpn_helper_OBJECTS) $(gnunet_vpn_helper_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +include ./$(DEPDIR)/debug.Po +include ./$(DEPDIR)/gnunet-daemon-vpn.Po +include ./$(DEPDIR)/packet.Po +include ./$(DEPDIR)/pretty-print.Po +include ./$(DEPDIR)/tcp.Po +include ./$(DEPDIR)/test.Po +include ./$(DEPDIR)/tun.Po + +.c.o: + $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< + $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +# source='$<' object='$@' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(COMPILE) -c $< + +.c.obj: + $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` + $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +# source='$<' object='$@' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: + $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< + $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +# source='$<' object='$@' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-binPROGRAMS + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-exec-hook +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS + +.MAKE: install-am install-exec-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ + clean-generic clean-libtool ctags distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-binPROGRAMS install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-exec-hook \ + install-html install-html-am install-info install-info-am \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-binPROGRAMS + +install-exec-hook: + chown root $(bindir)/gnunet-vpn-helper || true + chmod u+s $(bindir)/gnunet-vpn-helper || true +#install-exec-hook: + +#check_PROGRAMS = \ +# test_XXX + +#TESTS = \ +# test_transport_api_tcp + +#test_transport_api_tcp_SOURCES = \ +# test_transport_api.c +#test_transport_api_tcp_LDADD = \ +# $(top_builddir)/src/transport/libgnunettransport.la \ +# $(top_builddir)/src/util/libgnunetutil.la + +#EXTRA_DIST = test_transport_api_data.conf + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/vpn/packet.h b/src/vpn/packet.h index ac7cfcf51..ccf3cb7fc 100644 --- a/src/vpn/packet.h +++ b/src/vpn/packet.h @@ -79,14 +79,14 @@ struct ip6_udp { struct udp_pkt data; }; -extern void send_pkt(int fd, struct ip6_pkt* pkt); -extern int recv_ipv6pkt(int fd, struct pkt_tun** pkt); -extern int recv_pkt(int fd, struct pkt_tun** pkt); -extern struct ip6_pkt* parse_ip6(struct pkt_tun* pkt); +void send_pkt(int fd, struct ip6_pkt* pkt); +int recv_ipv6pkt(int fd, struct pkt_tun** pkt); +int recv_pkt(int fd, struct pkt_tun** pkt); +struct ip6_pkt* parse_ip6(struct pkt_tun* pkt); -extern struct ip6_tcp* parse_ip6_tcp(struct ip6_pkt*); -extern struct ip6_udp* parse_ip6_udp(struct ip6_pkt*); +struct ip6_tcp* parse_ip6_tcp(struct ip6_pkt*); +struct ip6_udp* parse_ip6_udp(struct ip6_pkt*); -extern short payload(struct ip6_hdr* pkt); +short payload(struct ip6_hdr* pkt); #endif diff --git a/src/vpn/pretty-print.c b/src/vpn/pretty-print.c index e8f15cad6..0a80beecd 100644 --- a/src/vpn/pretty-print.c +++ b/src/vpn/pretty-print.c @@ -75,11 +75,12 @@ static void pp_ip6adr(unsigned char* adr, char* dest) {{{ }}} void pp_hexdump(unsigned char* data, char* dest, int max) {{{ + int i; char tmp[3]; char tmp2[2]; int off = 0; int to = max > 16 ? 16 : max; - for (int i = 0; i < to; i++) { + for (i = 0; i < to; i++) { if (i == 8) off = 1; sprintf(tmp, "%02x", data[i]); memcpy(dest+(3*i)+off, tmp, 2); @@ -138,7 +139,8 @@ void pkt_printf(struct ip6_pkt* pkt) {{{ memcpy(buf+323, tmp, 3); int size = payload(&pkt->hdr); - for(int i = 0; i < 8; i++) { + int i; + for(i = 0; i < 8; i++) { if (16*i > size) break; pp_hexdump(pkt->data + (16*i), buf + 420 + (i*70), size - 16*i); } -- 2.25.1