aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-06-30 08:14:56 +0000
committerChristian Grothoff <christian@grothoff.org>2010-06-30 08:14:56 +0000
commitcac9e26bcf4f40dcb6b58080ae8748a9eaffe67a (patch)
tree1b8a675ff189dd1191f5baecb7bb061b844a381a
parenta9a97c270e91acd99fe681dd91d35d69663d37ec (diff)
downloadgnunet-cac9e26bcf4f40dcb6b58080ae8748a9eaffe67a.tar.gz
gnunet-cac9e26bcf4f40dcb6b58080ae8748a9eaffe67a.zip
vpn build integration
-rw-r--r--TODO6
-rw-r--r--configure.ac3
-rw-r--r--src/Makefile.am3
-rw-r--r--src/vpn/Makefile660
-rw-r--r--src/vpn/packet.h14
-rw-r--r--src/vpn/pretty-print.c6
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 @@
111* DATASTORE: 111* DATASTORE:
112 - GNUNET_DATASTORE_cancel method not tested 112 - GNUNET_DATASTORE_cancel method not tested
113* TESTING: [Nate] 113* TESTING: [Nate]
114 - modify configuration to allow controlling connections for non-local starts
115 - testbed creation with topology (needs working F2F topology)
116 - testbed with churn
117 - implement testcases for distributed testing
118 - test basic peer re-configure 114 - test basic peer re-configure
119 - test topology creation
120 - test churn generation
121 - consider changing API for peer-group termination to 115 - consider changing API for peer-group termination to
122 call continuation when done 116 call continuation when done
123* NAT/UPNP: [MW] 117* 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
662src/include/Makefile 662src/include/Makefile
663src/include/gnunet_directories.h 663src/include/gnunet_directories.h
664src/hostlist/Makefile 664src/hostlist/Makefile
665src/monkey/Makefile
665src/nat/Makefile 666src/nat/Makefile
666src/nat/libnatpmp/Makefile 667src/nat/libnatpmp/Makefile
667src/nat/miniupnp/Makefile 668src/nat/miniupnp/Makefile
@@ -673,7 +674,7 @@ src/testing/Makefile
673src/topology/Makefile 674src/topology/Makefile
674src/transport/Makefile 675src/transport/Makefile
675src/util/Makefile 676src/util/Makefile
676src/monkey/Makefile 677src/vpn/Makefile
677]) 678])
678AC_OUTPUT 679AC_OUTPUT
679 680
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 = \
30 hostlist \ 30 hostlist \
31 topology \ 31 topology \
32 $(NAT_DIR) \ 32 $(NAT_DIR) \
33 fs 33 fs \
34 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 @@
1CFLAGS=-Wall -pedantic --std=c99 -g 1# Makefile.in generated by automake 1.11.1 from Makefile.am.
2CXXFLAGS = ${CFLAGS} 2# src/vpn/Makefile. Generated from Makefile.in by configure.
3 3
4LDFLAGS = 4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
6# Inc.
7# This Makefile.in is free software; the Free Software Foundation
8# gives unlimited permission to copy and/or distribute it,
9# with or without modifications, as long as this notice is preserved.
5 10
6.PHONY: .dependencies 11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
13# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14# PARTICULAR PURPOSE.
7 15
8all: default
9 16
10default: .dependencies test
11 17
12test: test.o tun.o packet.o debug.o pretty-print.o tcp.o
13 18
14.dependencies: 19pkgdatadir = $(datadir)/gnunet
15 echo > .dependencies 20pkgincludedir = $(includedir)/gnunet
16 gcc -M *.c >> .dependencies 21pkglibdir = $(libdir)/gnunet
22pkglibexecdir = $(libexecdir)/gnunet
23am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
24install_sh_DATA = $(install_sh) -c -m 644
25install_sh_PROGRAM = $(install_sh) -c
26install_sh_SCRIPT = $(install_sh) -c
27INSTALL_HEADER = $(INSTALL_DATA)
28transform = $(program_transform_name)
29NORMAL_INSTALL = :
30PRE_INSTALL = :
31POST_INSTALL = :
32NORMAL_UNINSTALL = :
33PRE_UNINSTALL = :
34POST_UNINSTALL = :
35build_triplet = x86_64-unknown-linux-gnu
36host_triplet = x86_64-unknown-linux-gnu
37bin_PROGRAMS = gnunet-daemon-vpn$(EXEEXT) $(am__EXEEXT_1)
38subdir = src/vpn
39DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
40ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
41am__aclocal_m4_deps = $(top_srcdir)/m4/align.m4 \
42 $(top_srcdir)/m4/argz.m4 $(top_srcdir)/m4/gettext.m4 \
43 $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
44 $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
45 $(top_srcdir)/m4/libcurl.m4 $(top_srcdir)/m4/libgcrypt.m4 \
46 $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltdl.m4 \
47 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
48 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
49 $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
50 $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \
51 $(top_srcdir)/configure.ac
52am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
53 $(ACLOCAL_M4)
54mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
55CONFIG_HEADER = $(top_builddir)/gnunet_config.h
56CONFIG_CLEAN_FILES =
57CONFIG_CLEAN_VPATH_FILES =
58am__EXEEXT_1 = gnunet-vpn-helper$(EXEEXT)
59am__installdirs = "$(DESTDIR)$(bindir)"
60PROGRAMS = $(bin_PROGRAMS)
61am_gnunet_daemon_vpn_OBJECTS = gnunet-daemon-vpn.$(OBJEXT)
62gnunet_daemon_vpn_OBJECTS = $(am_gnunet_daemon_vpn_OBJECTS)
63am__DEPENDENCIES_1 =
64gnunet_daemon_vpn_DEPENDENCIES = \
65 $(top_builddir)/src/core/libgnunetcore.la \
66 $(top_builddir)/src/statistics/libgnunetstatistics.la \
67 $(top_builddir)/src/util/libgnunetutil.la \
68 $(am__DEPENDENCIES_1)
69am_gnunet_vpn_helper_OBJECTS = debug.$(OBJEXT) packet.$(OBJEXT) \
70 pretty-print.$(OBJEXT) tcp.$(OBJEXT) test.$(OBJEXT) \
71 tun.$(OBJEXT)
72gnunet_vpn_helper_OBJECTS = $(am_gnunet_vpn_helper_OBJECTS)
73gnunet_vpn_helper_LDADD = $(LDADD)
74DEFAULT_INCLUDES = -I. -I$(top_builddir)
75depcomp = $(SHELL) $(top_srcdir)/depcomp
76am__depfiles_maybe = depfiles
77am__mv = mv -f
78COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
79 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
80LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
81 --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
82 $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
83CCLD = $(CC)
84LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
85 --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
86 $(LDFLAGS) -o $@
87SOURCES = $(gnunet_daemon_vpn_SOURCES) $(gnunet_vpn_helper_SOURCES)
88DIST_SOURCES = $(gnunet_daemon_vpn_SOURCES) \
89 $(gnunet_vpn_helper_SOURCES)
90ETAGS = etags
91CTAGS = ctags
92DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
93ACLOCAL = ${SHELL} /home/grothoff/svn/gnunet/missing --run aclocal-1.11
94AMTAR = ${SHELL} /home/grothoff/svn/gnunet/missing --run tar
95AR = ar
96ARGZ_H =
97AS = as
98AUTOCONF = ${SHELL} /home/grothoff/svn/gnunet/missing --run autoconf
99AUTOHEADER = ${SHELL} /home/grothoff/svn/gnunet/missing --run autoheader
100AUTOMAKE = ${SHELL} /home/grothoff/svn/gnunet/missing --run automake-1.11
101AWK = gawk
102CC = gcc
103CCDEPMODE = depmode=gcc3
104CFLAGS = -fno-strict-aliasing -Wall -g -O0 -Wall -Werror
105CPP = gcc -E
106CPPFLAGS = -I/home/grothoff/gn9//include
107CXX = g++
108CXXCPP = g++ -E
109CXXDEPMODE = depmode=gcc3
110CXXFLAGS = -g -O0 -Wall -Werror
111CYGPATH_W = echo
112DEFAULT_INTERFACE = "eth0"
113DEFS = -DHAVE_CONFIG_H
114DEPDIR = .deps
115DLLDIR = lib
116DLLTOOL = dlltool
117DSYMUTIL =
118DUMPBIN =
119ECHO_C =
120ECHO_N = -n
121ECHO_T =
122EGREP = /bin/grep -E
123EXEEXT =
124EXT_LIBS =
125EXT_LIB_PATH = -L/home/grothoff/gn9//lib
126FGREP = /bin/grep -F
127GMSGFMT = /usr/bin/msgfmt
128GMSGFMT_015 = /usr/bin/msgfmt
129GN_DAEMON_CONFIG_DIR = /etc
130GN_DAEMON_HOME_DIR = /var/lib/gnunet
131GN_INTLINCL =
132GN_LIBINTL =
133GN_LIB_LDFLAGS = -export-dynamic -no-undefined
134GN_PLUGIN_LDFLAGS = -export-dynamic -avoid-version -module -no-undefined
135GN_USER_HOME_DIR = ~/.gnunet
136GREP = /bin/grep
137INCLTDL =
138INSTALL = /usr/bin/install -c
139INSTALL_DATA = ${INSTALL} -m 644
140INSTALL_PROGRAM = ${INSTALL}
141INSTALL_SCRIPT = ${INSTALL}
142INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
143INTLLIBS =
144INTL_MACOSX_LIBS =
145LD = /usr/bin/ld -m elf_x86_64
146LDFLAGS = -L/home/grothoff/gn9//lib
147LIBADD_DL = -ldl
148LIBADD_DLD_LINK =
149LIBADD_DLOPEN = -ldl
150LIBADD_SHL_LOAD =
151LIBCURL = -lcurl
152LIBCURL_CPPFLAGS =
153LIBGCRYPT_CFLAGS =
154LIBGCRYPT_CONFIG = /usr/bin/libgcrypt-config
155LIBGCRYPT_LIBS = -lgcrypt
156LIBICONV =
157LIBINTL =
158LIBLTDL = -lltdl
159LIBOBJS =
160LIBPREFIX =
161LIBS = -ldl
162LIBTOOL = $(SHELL) $(top_builddir)/libtool
163LIPO =
164LN_S = ln -s
165LTDLDEPS =
166LTDLINCL =
167LTDLOPEN = libltdl
168LTLIBICONV =
169LTLIBINTL =
170LTLIBOBJS =
171LT_CONFIG_H = gnunet_config.h
172LT_DLLOADERS = libltdl/dlopen.la
173LT_DLPREOPEN = -dlpreopen libltdl/dlopen.la
174MAKEINFO = ${SHELL} /home/grothoff/svn/gnunet/missing --run makeinfo
175MKDIR_P = /bin/mkdir -p
176MSGFMT = /usr/bin/msgfmt
177MSGFMT_015 = /usr/bin/msgfmt
178MSGMERGE = /usr/bin/msgmerge
179MYSQL_CPPFLAGS =
180MYSQL_LDFLAGS =
181NM = /usr/bin/nm -B
182NMEDIT =
183OBJC = gcc
184OBJCDEPMODE = depmode=gcc3
185OBJCFLAGS =
186OBJDUMP = objdump
187OBJEXT = o
188OTOOL =
189OTOOL64 =
190PACKAGE = gnunet
191PACKAGE_BUGREPORT = bug-gnunet@gnu.org
192PACKAGE_NAME = gnunet
193PACKAGE_STRING = gnunet 0.9.0pre0
194PACKAGE_TARNAME = gnunet
195PACKAGE_URL =
196PACKAGE_VERSION = 0.9.0pre0
197PATH_SEPARATOR = :
198POSTGRES_CPPFLAGS =
199POSTGRES_LDFLAGS =
200POSUB = po
201PYTHON = /usr/bin/python
202PYTHON_EXEC_PREFIX = ${exec_prefix}
203PYTHON_PLATFORM = linux2
204PYTHON_PREFIX = ${prefix}
205PYTHON_VERSION = 2.5
206RANLIB = ranlib
207SED = /bin/sed
208SET_MAKE =
209SHELL = /bin/bash
210SQLITE_CPPFLAGS =
211SQLITE_LDFLAGS =
212STRIP = strip
213USE_NLS = yes
214VERSION = 0.9.0pre0
215XGETTEXT = /usr/bin/xgettext
216XGETTEXT_015 = /usr/bin/xgettext
217XMKMF =
218X_CFLAGS =
219X_EXTRA_LIBS =
220X_LIBS =
221X_PRE_LIBS = -lSM -lICE
222_libcurl_config =
223abs_builddir = /home/grothoff/svn/gnunet/src/vpn
224abs_srcdir = /home/grothoff/svn/gnunet/src/vpn
225abs_top_builddir = /home/grothoff/svn/gnunet
226abs_top_srcdir = /home/grothoff/svn/gnunet
227ac_ct_CC = gcc
228ac_ct_CXX = g++
229ac_ct_DUMPBIN =
230ac_ct_OBJC = gcc
231am__include = include
232am__leading_dot = .
233am__quote =
234am__tar = ${AMTAR} chof - "$$tardir"
235am__untar = ${AMTAR} xf -
236bindir = ${exec_prefix}/bin
237build = x86_64-unknown-linux-gnu
238build_alias =
239build_cpu = x86_64
240build_os = linux-gnu
241build_target = linux
242build_vendor = unknown
243builddir = .
244datadir = ${datarootdir}
245datarootdir = ${prefix}/share
246docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}
247dvidir = ${docdir}
248exec_prefix = ${prefix}
249host = x86_64-unknown-linux-gnu
250host_alias =
251host_cpu = x86_64
252host_os = linux-gnu
253host_vendor = unknown
254htmldir = ${docdir}
255includedir = ${prefix}/include
256infodir = ${datarootdir}/info
257install_sh = ${SHELL} /home/grothoff/svn/gnunet/install-sh
258libdir = ${exec_prefix}/lib
259libexecdir = ${exec_prefix}/libexec
260localedir = ${datarootdir}/locale
261localstatedir = ${prefix}/var
262lt_ECHO = echo
263ltdl_LIBOBJS = lt__strl.o
264ltdl_LTLIBOBJS = lt__strl.lo
265mandir = ${datarootdir}/man
266mkdir_p = /bin/mkdir -p
267oldincludedir = /usr/include
268pdfdir = ${docdir}
269pkgpyexecdir = ${pyexecdir}/gnunet
270pkgpythondir = ${pythondir}/gnunet
271prefix = /home/grothoff/gn9
272program_transform_name = s,x,x,
273psdir = ${docdir}
274pyexecdir = ${exec_prefix}/lib/python2.5/site-packages
275pythondir = ${prefix}/lib/python2.5/site-packages
276sbindir = ${exec_prefix}/sbin
277sharedstatedir = ${prefix}/com
278srcdir = .
279subdirs = libltdl
280sys_symbol_underscore = no
281sysconfdir = ${prefix}/etc
282target_alias =
283top_build_prefix = ../../
284top_builddir = ../..
285top_srcdir = ../..
286INCLUDES = -I$(top_srcdir)/src/include
287#WINFLAGS = -Wl,--no-undefined -Wl,--export-all-symbols
288#AM_CFLAGS = --coverage -O0
289VPNBIN = gnunet-vpn-helper
290gnunet_vpn_helper_SOURCES = \
291 debug.c debug.h \
292 packet.h packet.c \
293 pretty-print.c pretty-print.h \
294 tcp.c tcp.h \
295 test.c \
296 tun.c tun.h
17 297
18-include .dependencies 298gnunet_daemon_vpn_SOURCES = \
299 gnunet-daemon-vpn.c
19 300
20clean: 301gnunet_daemon_vpn_LDADD = \
21 rm -f *.o 302 $(top_builddir)/src/core/libgnunetcore.la \
22 rm -f test 303 $(top_builddir)/src/statistics/libgnunetstatistics.la \
304 $(top_builddir)/src/util/libgnunetutil.la \
305 $(GN_LIBINTL)
306
307all: all-am
308
309.SUFFIXES:
310.SUFFIXES: .c .lo .o .obj
311$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
312 @for dep in $?; do \
313 case '$(am__configure_deps)' in \
314 *$$dep*) \
315 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
316 && { if test -f $@; then exit 0; else break; fi; }; \
317 exit 1;; \
318 esac; \
319 done; \
320 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/vpn/Makefile'; \
321 $(am__cd) $(top_srcdir) && \
322 $(AUTOMAKE) --gnu src/vpn/Makefile
323.PRECIOUS: Makefile
324Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
325 @case '$?' in \
326 *config.status*) \
327 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
328 *) \
329 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
330 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
331 esac;
332
333$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
334 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
335
336$(top_srcdir)/configure: $(am__configure_deps)
337 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
338$(ACLOCAL_M4): $(am__aclocal_m4_deps)
339 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
340$(am__aclocal_m4_deps):
341install-binPROGRAMS: $(bin_PROGRAMS)
342 @$(NORMAL_INSTALL)
343 test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
344 @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
345 for p in $$list; do echo "$$p $$p"; done | \
346 sed 's/$(EXEEXT)$$//' | \
347 while read p p1; do if test -f $$p || test -f $$p1; \
348 then echo "$$p"; echo "$$p"; else :; fi; \
349 done | \
350 sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
351 -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
352 sed 'N;N;N;s,\n, ,g' | \
353 $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
354 { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
355 if ($$2 == $$4) files[d] = files[d] " " $$1; \
356 else { print "f", $$3 "/" $$4, $$1; } } \
357 END { for (d in files) print "f", d, files[d] }' | \
358 while read type dir files; do \
359 if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
360 test -z "$$files" || { \
361 echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
362 $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
363 } \
364 ; done
365
366uninstall-binPROGRAMS:
367 @$(NORMAL_UNINSTALL)
368 @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
369 files=`for p in $$list; do echo "$$p"; done | \
370 sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
371 -e 's/$$/$(EXEEXT)/' `; \
372 test -n "$$list" || exit 0; \
373 echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
374 cd "$(DESTDIR)$(bindir)" && rm -f $$files
375
376clean-binPROGRAMS:
377 @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
378 echo " rm -f" $$list; \
379 rm -f $$list || exit $$?; \
380 test -n "$(EXEEXT)" || exit 0; \
381 list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
382 echo " rm -f" $$list; \
383 rm -f $$list
384gnunet-daemon-vpn$(EXEEXT): $(gnunet_daemon_vpn_OBJECTS) $(gnunet_daemon_vpn_DEPENDENCIES)
385 @rm -f gnunet-daemon-vpn$(EXEEXT)
386 $(LINK) $(gnunet_daemon_vpn_OBJECTS) $(gnunet_daemon_vpn_LDADD) $(LIBS)
387gnunet-vpn-helper$(EXEEXT): $(gnunet_vpn_helper_OBJECTS) $(gnunet_vpn_helper_DEPENDENCIES)
388 @rm -f gnunet-vpn-helper$(EXEEXT)
389 $(LINK) $(gnunet_vpn_helper_OBJECTS) $(gnunet_vpn_helper_LDADD) $(LIBS)
390
391mostlyclean-compile:
392 -rm -f *.$(OBJEXT)
393
394distclean-compile:
395 -rm -f *.tab.c
396
397include ./$(DEPDIR)/debug.Po
398include ./$(DEPDIR)/gnunet-daemon-vpn.Po
399include ./$(DEPDIR)/packet.Po
400include ./$(DEPDIR)/pretty-print.Po
401include ./$(DEPDIR)/tcp.Po
402include ./$(DEPDIR)/test.Po
403include ./$(DEPDIR)/tun.Po
404
405.c.o:
406 $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
407 $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
408# source='$<' object='$@' libtool=no \
409# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
410# $(COMPILE) -c $<
411
412.c.obj:
413 $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
414 $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
415# source='$<' object='$@' libtool=no \
416# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
417# $(COMPILE) -c `$(CYGPATH_W) '$<'`
418
419.c.lo:
420 $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
421 $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
422# source='$<' object='$@' libtool=yes \
423# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
424# $(LTCOMPILE) -c -o $@ $<
425
426mostlyclean-libtool:
427 -rm -f *.lo
428
429clean-libtool:
430 -rm -rf .libs _libs
431
432ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
433 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
434 unique=`for i in $$list; do \
435 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
436 done | \
437 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
438 END { if (nonempty) { for (i in files) print i; }; }'`; \
439 mkid -fID $$unique
440tags: TAGS
441
442TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
443 $(TAGS_FILES) $(LISP)
444 set x; \
445 here=`pwd`; \
446 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
447 unique=`for i in $$list; do \
448 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
449 done | \
450 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
451 END { if (nonempty) { for (i in files) print i; }; }'`; \
452 shift; \
453 if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
454 test -n "$$unique" || unique=$$empty_fix; \
455 if test $$# -gt 0; then \
456 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
457 "$$@" $$unique; \
458 else \
459 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
460 $$unique; \
461 fi; \
462 fi
463ctags: CTAGS
464CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
465 $(TAGS_FILES) $(LISP)
466 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
467 unique=`for i in $$list; do \
468 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
469 done | \
470 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
471 END { if (nonempty) { for (i in files) print i; }; }'`; \
472 test -z "$(CTAGS_ARGS)$$unique" \
473 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
474 $$unique
475
476GTAGS:
477 here=`$(am__cd) $(top_builddir) && pwd` \
478 && $(am__cd) $(top_srcdir) \
479 && gtags -i $(GTAGS_ARGS) "$$here"
480
481distclean-tags:
482 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
483
484distdir: $(DISTFILES)
485 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
486 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
487 list='$(DISTFILES)'; \
488 dist_files=`for file in $$list; do echo $$file; done | \
489 sed -e "s|^$$srcdirstrip/||;t" \
490 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
491 case $$dist_files in \
492 */*) $(MKDIR_P) `echo "$$dist_files" | \
493 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
494 sort -u` ;; \
495 esac; \
496 for file in $$dist_files; do \
497 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
498 if test -d $$d/$$file; then \
499 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
500 if test -d "$(distdir)/$$file"; then \
501 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
502 fi; \
503 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
504 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
505 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
506 fi; \
507 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
508 else \
509 test -f "$(distdir)/$$file" \
510 || cp -p $$d/$$file "$(distdir)/$$file" \
511 || exit 1; \
512 fi; \
513 done
514check-am: all-am
515check: check-am
516all-am: Makefile $(PROGRAMS)
517installdirs:
518 for dir in "$(DESTDIR)$(bindir)"; do \
519 test -z "$$dir" || $(MKDIR_P) "$$dir"; \
520 done
521install: install-am
522install-exec: install-exec-am
523install-data: install-data-am
524uninstall: uninstall-am
525
526install-am: all-am
527 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
528
529installcheck: installcheck-am
530install-strip:
531 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
532 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
533 `test -z '$(STRIP)' || \
534 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
535mostlyclean-generic:
536
537clean-generic:
538
539distclean-generic:
540 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
541 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
542
543maintainer-clean-generic:
544 @echo "This command is intended for maintainers to use"
545 @echo "it deletes files that may require special tools to rebuild."
546clean: clean-am
547
548clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
549
550distclean: distclean-am
551 -rm -rf ./$(DEPDIR)
552 -rm -f Makefile
553distclean-am: clean-am distclean-compile distclean-generic \
554 distclean-tags
555
556dvi: dvi-am
557
558dvi-am:
559
560html: html-am
561
562html-am:
563
564info: info-am
565
566info-am:
567
568install-data-am:
569
570install-dvi: install-dvi-am
571
572install-dvi-am:
573
574install-exec-am: install-binPROGRAMS
575 @$(NORMAL_INSTALL)
576 $(MAKE) $(AM_MAKEFLAGS) install-exec-hook
577install-html: install-html-am
578
579install-html-am:
580
581install-info: install-info-am
582
583install-info-am:
584
585install-man:
586
587install-pdf: install-pdf-am
588
589install-pdf-am:
590
591install-ps: install-ps-am
592
593install-ps-am:
594
595installcheck-am:
596
597maintainer-clean: maintainer-clean-am
598 -rm -rf ./$(DEPDIR)
599 -rm -f Makefile
600maintainer-clean-am: distclean-am maintainer-clean-generic
601
602mostlyclean: mostlyclean-am
603
604mostlyclean-am: mostlyclean-compile mostlyclean-generic \
605 mostlyclean-libtool
606
607pdf: pdf-am
608
609pdf-am:
610
611ps: ps-am
612
613ps-am:
614
615uninstall-am: uninstall-binPROGRAMS
616
617.MAKE: install-am install-exec-am install-strip
618
619.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
620 clean-generic clean-libtool ctags distclean distclean-compile \
621 distclean-generic distclean-libtool distclean-tags distdir dvi \
622 dvi-am html html-am info info-am install install-am \
623 install-binPROGRAMS install-data install-data-am install-dvi \
624 install-dvi-am install-exec install-exec-am install-exec-hook \
625 install-html install-html-am install-info install-info-am \
626 install-man install-pdf install-pdf-am install-ps \
627 install-ps-am install-strip installcheck installcheck-am \
628 installdirs maintainer-clean maintainer-clean-generic \
629 mostlyclean mostlyclean-compile mostlyclean-generic \
630 mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
631 uninstall-am uninstall-binPROGRAMS
632
633install-exec-hook:
634 chown root $(bindir)/gnunet-vpn-helper || true
635 chmod u+s $(bindir)/gnunet-vpn-helper || true
636#install-exec-hook:
637
638#check_PROGRAMS = \
639# test_XXX
640
641#TESTS = \
642# test_transport_api_tcp
643
644#test_transport_api_tcp_SOURCES = \
645# test_transport_api.c
646#test_transport_api_tcp_LDADD = \
647# $(top_builddir)/src/transport/libgnunettransport.la \
648# $(top_builddir)/src/util/libgnunetutil.la
649
650#EXTRA_DIST = test_transport_api_data.conf
651
652# Tell versions [3.59,3.63) of GNU make to not export all variables.
653# Otherwise a system limit (for SysV at least) may be exceeded.
654.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 {
79 struct udp_pkt data; 79 struct udp_pkt data;
80}; 80};
81 81
82extern void send_pkt(int fd, struct ip6_pkt* pkt); 82void send_pkt(int fd, struct ip6_pkt* pkt);
83extern int recv_ipv6pkt(int fd, struct pkt_tun** pkt); 83int recv_ipv6pkt(int fd, struct pkt_tun** pkt);
84extern int recv_pkt(int fd, struct pkt_tun** pkt); 84int recv_pkt(int fd, struct pkt_tun** pkt);
85extern struct ip6_pkt* parse_ip6(struct pkt_tun* pkt); 85struct ip6_pkt* parse_ip6(struct pkt_tun* pkt);
86 86
87extern struct ip6_tcp* parse_ip6_tcp(struct ip6_pkt*); 87struct ip6_tcp* parse_ip6_tcp(struct ip6_pkt*);
88extern struct ip6_udp* parse_ip6_udp(struct ip6_pkt*); 88struct ip6_udp* parse_ip6_udp(struct ip6_pkt*);
89 89
90extern short payload(struct ip6_hdr* pkt); 90short payload(struct ip6_hdr* pkt);
91 91
92#endif 92#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) {{{
75}}} 75}}}
76 76
77void pp_hexdump(unsigned char* data, char* dest, int max) {{{ 77void pp_hexdump(unsigned char* data, char* dest, int max) {{{
78 int i;
78 char tmp[3]; 79 char tmp[3];
79 char tmp2[2]; 80 char tmp2[2];
80 int off = 0; 81 int off = 0;
81 int to = max > 16 ? 16 : max; 82 int to = max > 16 ? 16 : max;
82 for (int i = 0; i < to; i++) { 83 for (i = 0; i < to; i++) {
83 if (i == 8) off = 1; 84 if (i == 8) off = 1;
84 sprintf(tmp, "%02x", data[i]); 85 sprintf(tmp, "%02x", data[i]);
85 memcpy(dest+(3*i)+off, tmp, 2); 86 memcpy(dest+(3*i)+off, tmp, 2);
@@ -138,7 +139,8 @@ void pkt_printf(struct ip6_pkt* pkt) {{{
138 memcpy(buf+323, tmp, 3); 139 memcpy(buf+323, tmp, 3);
139 140
140 int size = payload(&pkt->hdr); 141 int size = payload(&pkt->hdr);
141 for(int i = 0; i < 8; i++) { 142 int i;
143 for(i = 0; i < 8; i++) {
142 if (16*i > size) break; 144 if (16*i > size) break;
143 pp_hexdump(pkt->data + (16*i), buf + 420 + (i*70), size - 16*i); 145 pp_hexdump(pkt->data + (16*i), buf + 420 + (i*70), size - 16*i);
144 } 146 }