Import Debian changes 1.1~pre8-1
tinc (1.1~pre8-1) experimental; urgency=low * New upstream release. - Handles whitespace between command line flags and optional arguments. Closes: #710267 * Bump Standards-Version. * Source /lib/lsb/init-functions in the init.d script. * Don't use texi2html anymore, use automake's install-html target which uses makeinfo.
This commit is contained in:
commit
b0db4c75f6
157 changed files with 11380 additions and 4438 deletions
71
ChangeLog
71
ChangeLog
|
@ -1,3 +1,74 @@
|
|||
Version 1.1pre8 August 13 2013
|
||||
------------------------------------------------------------------------
|
||||
|
||||
Guus Sliepen (56):
|
||||
Don't try to create tinc.conf when using set or add commands.
|
||||
Modernize the configure script a bit.
|
||||
Use conditional compilation for device.c.
|
||||
Use conditional compilation for cryptographic functions.
|
||||
Rename xmalloc_and_zero() to xzalloc().
|
||||
Add generic crypto headers.
|
||||
Add more __attribute__((malloc)) where appropriate.
|
||||
Add __attribute__((warn_unused_result)) to crypto functions.
|
||||
Fix warnings for functions marked __attribute((warn_unused_result)).
|
||||
Add a few more checks and warnings in the crypto functions.
|
||||
Enable the SPTPS protocol by default.
|
||||
Fix check for presence of ECDSA public key for outgoing connections.
|
||||
Use read_host_config() where appropriate.
|
||||
Don't free ephemeral ECDH keys twice.
|
||||
Fix potential NULL pointer dereferences.
|
||||
Don't try to handle incoming data if sptps_start() has not been called yet.
|
||||
Enable and fix warnings from automake.
|
||||
Send a new key when we receive packets from a node we don't have a valid key for.
|
||||
Annotate the xalloc functions.
|
||||
Improve base64 encoding/decoding, add URL-safe variant.
|
||||
Add a newline when logging to stderr in the tinc binary.
|
||||
Fix port number in pidfile.
|
||||
Add an invitation protocol.
|
||||
Better optional argument handling.
|
||||
Allow the log output to be stopped with control-C in tinc's shell.
|
||||
Use strerror() instead of gai_strerror() when err == EAI_SYSTEM.
|
||||
Add the LocalDiscoveryAddress option.
|
||||
Set $NAME when calling host-up/down and subnet-up/down scripts.
|
||||
Add connection rate limiting.
|
||||
Fix warning "Both netname and configuration directory given" on Windows.
|
||||
Add missing definitions on Windows.
|
||||
Don't search in local directories for include files.
|
||||
Don't use vasprintf() anymore on Windows.
|
||||
Attribution for Etienne Dechamps.
|
||||
Forbid protocol version rollback.
|
||||
Allow extra options to be passed to "tinc restart" again.
|
||||
Honour umask, let temporary key files inherit original's permissions.
|
||||
Fix compression when using the SPTPS protocol.
|
||||
Warn when incorrect use of add or set causes variables to be removed.
|
||||
Allow control-C to stop tincd without stopping the tinc shell.
|
||||
Don't forget the Port variable when creating an invitation URL.
|
||||
Choose a different Port when 655 isn't available when doing "tinc init".
|
||||
Choose a different Port when 655 isn't available when doing "tinc join".
|
||||
Make absolutely sure we can write config files before accepting an invitation.
|
||||
Defer handling netname conflicts when accepting an invitation.
|
||||
Use umask() to set file and UNIX socket permissions without race conditions.
|
||||
Clean up the SIGINT handler.
|
||||
Really retry outgoing connections immediately if requested.
|
||||
Non-zero exit code when reloading config file fails after SIGHUP.
|
||||
Fix a typo.
|
||||
Don't echo broadcast packets back when Broadcast = direct.
|
||||
Move .h files from noinst_HEADERS to tincd_SOURCES.
|
||||
Build .tar.gz instead of .tar.xz.
|
||||
Update copyright notices.
|
||||
Don't typedef the same struct in two header files.
|
||||
Releasing 1.1pre8.
|
||||
|
||||
Etienne Dechamps (5):
|
||||
Fix combination of Mode = router and DeviceType = tap on Linux.
|
||||
Fix hash_function().
|
||||
Disable PMTU discovery when TCPOnly is set.
|
||||
Introduce lightweight PMTU probe replies.
|
||||
Further improve bandwidth estimation for type 2 MTU probe replies.
|
||||
|
||||
Sven-Haegar Koch (1):
|
||||
Modified some error messages in src/sptps.c.
|
||||
|
||||
Version 1.1pre7 April 22 2013
|
||||
------------------------------------------------------------------------
|
||||
|
||||
|
|
8
INSTALL
8
INSTALL
|
@ -1,7 +1,7 @@
|
|||
Installation Instructions
|
||||
*************************
|
||||
|
||||
Copyright (C) 1994-1996, 1999-2002, 2004-2011 Free Software Foundation,
|
||||
Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation,
|
||||
Inc.
|
||||
|
||||
Copying and distribution of this file, with or without modification,
|
||||
|
@ -309,9 +309,10 @@ causes the specified `gcc' to be used as the C compiler (unless it is
|
|||
overridden in the site shell script).
|
||||
|
||||
Unfortunately, this technique does not work for `CONFIG_SHELL' due to
|
||||
an Autoconf bug. Until the bug is fixed you can use this workaround:
|
||||
an Autoconf limitation. Until the limitation is lifted, you can use
|
||||
this workaround:
|
||||
|
||||
CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
|
||||
CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash
|
||||
|
||||
`configure' Invocation
|
||||
======================
|
||||
|
@ -367,4 +368,3 @@ operates.
|
|||
|
||||
`configure' also accepts some other, not widely useful, options. Run
|
||||
`configure --help' for more details.
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ SUBDIRS = m4 src doc gui
|
|||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
EXTRA_DIST = have.h system.h COPYING.README README.android
|
||||
EXTRA_DIST = COPYING.README README.android
|
||||
|
||||
ChangeLog:
|
||||
git log > ChangeLog
|
||||
|
|
328
Makefile.in
328
Makefile.in
|
@ -1,9 +1,8 @@
|
|||
# Makefile.in generated by automake 1.11.6 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.13.3 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
|
||||
# Foundation, Inc.
|
||||
# Copyright (C) 1994-2013 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.
|
||||
|
@ -15,23 +14,51 @@
|
|||
|
||||
@SET_MAKE@
|
||||
VPATH = @srcdir@
|
||||
am__make_dryrun = \
|
||||
{ \
|
||||
am__dry=no; \
|
||||
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
|
||||
am__make_running_with_option = \
|
||||
case $${target_option-} in \
|
||||
?) ;; \
|
||||
*) echo "am__make_running_with_option: internal error: invalid" \
|
||||
"target option '$${target_option-}' specified" >&2; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
has_opt=no; \
|
||||
sane_makeflags=$$MAKEFLAGS; \
|
||||
if $(am__is_gnu_make); then \
|
||||
sane_makeflags=$$MFLAGS; \
|
||||
else \
|
||||
case $$MAKEFLAGS in \
|
||||
*\\[\ \ ]*) \
|
||||
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
|
||||
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
|
||||
*) \
|
||||
for am__flg in $$MAKEFLAGS; do \
|
||||
case $$am__flg in \
|
||||
*=*|--*) ;; \
|
||||
*n*) am__dry=yes; break;; \
|
||||
esac; \
|
||||
done;; \
|
||||
bs=\\; \
|
||||
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
|
||||
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
|
||||
esac; \
|
||||
test $$am__dry = yes; \
|
||||
}
|
||||
fi; \
|
||||
skip_next=no; \
|
||||
strip_trailopt () \
|
||||
{ \
|
||||
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
|
||||
}; \
|
||||
for flg in $$sane_makeflags; do \
|
||||
test $$skip_next = yes && { skip_next=no; continue; }; \
|
||||
case $$flg in \
|
||||
*=*|--*) continue;; \
|
||||
-*I) strip_trailopt 'I'; skip_next=yes;; \
|
||||
-*I?*) strip_trailopt 'I';; \
|
||||
-*O) strip_trailopt 'O'; skip_next=yes;; \
|
||||
-*O?*) strip_trailopt 'O';; \
|
||||
-*l) strip_trailopt 'l'; skip_next=yes;; \
|
||||
-*l?*) strip_trailopt 'l';; \
|
||||
-[dEDm]) skip_next=yes;; \
|
||||
-[JT]) skip_next=yes;; \
|
||||
esac; \
|
||||
case $$flg in \
|
||||
*$$target_option*) has_opt=yes; break;; \
|
||||
esac; \
|
||||
done; \
|
||||
test $$has_opt = yes
|
||||
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
|
||||
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
|
@ -51,15 +78,16 @@ POST_UNINSTALL = :
|
|||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
subdir = .
|
||||
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
|
||||
$(srcdir)/Makefile.in $(srcdir)/config.h.in \
|
||||
$(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \
|
||||
THANKS config.guess config.sub depcomp install-sh missing
|
||||
DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \
|
||||
$(srcdir)/Makefile.in $(srcdir)/Makefile.am \
|
||||
$(top_srcdir)/configure $(am__configure_deps) \
|
||||
$(srcdir)/config.h.in COPYING THANKS compile config.guess \
|
||||
config.sub depcomp install-sh missing
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/attribute.m4 \
|
||||
$(top_srcdir)/m4/curses.m4 $(top_srcdir)/m4/lzo.m4 \
|
||||
$(top_srcdir)/m4/openssl.m4 $(top_srcdir)/m4/readline.m4 \
|
||||
$(top_srcdir)/m4/zlib.m4 $(top_srcdir)/configure.in
|
||||
$(top_srcdir)/m4/zlib.m4 $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
|
||||
|
@ -68,15 +96,28 @@ mkinstalldirs = $(install_sh) -d
|
|||
CONFIG_HEADER = config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
AM_V_P = $(am__v_P_@AM_V@)
|
||||
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
|
||||
am__v_P_0 = false
|
||||
am__v_P_1 = :
|
||||
AM_V_GEN = $(am__v_GEN_@AM_V@)
|
||||
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
|
||||
am__v_GEN_0 = @echo " GEN " $@;
|
||||
am__v_GEN_1 =
|
||||
AM_V_at = $(am__v_at_@AM_V@)
|
||||
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
||||
am__v_at_0 = @
|
||||
am__v_at_1 =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
|
||||
html-recursive info-recursive install-data-recursive \
|
||||
install-dvi-recursive install-exec-recursive \
|
||||
install-html-recursive install-info-recursive \
|
||||
install-pdf-recursive install-ps-recursive install-recursive \
|
||||
installcheck-recursive installdirs-recursive pdf-recursive \
|
||||
ps-recursive uninstall-recursive
|
||||
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
|
||||
ctags-recursive dvi-recursive html-recursive info-recursive \
|
||||
install-data-recursive install-dvi-recursive \
|
||||
install-exec-recursive install-html-recursive \
|
||||
install-info-recursive install-pdf-recursive \
|
||||
install-ps-recursive install-recursive installcheck-recursive \
|
||||
installdirs-recursive pdf-recursive ps-recursive \
|
||||
tags-recursive uninstall-recursive
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
n|no|NO) false;; \
|
||||
|
@ -84,11 +125,33 @@ am__can_run_installinfo = \
|
|||
esac
|
||||
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
|
||||
distclean-recursive maintainer-clean-recursive
|
||||
AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
|
||||
$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
|
||||
distdir dist dist-all distcheck
|
||||
am__recursive_targets = \
|
||||
$(RECURSIVE_TARGETS) \
|
||||
$(RECURSIVE_CLEAN_TARGETS) \
|
||||
$(am__extra_recursive_targets)
|
||||
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
|
||||
cscope distdir dist dist-all distcheck
|
||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
|
||||
$(LISP)config.h.in
|
||||
# Read a list of newline-separated strings from the standard input,
|
||||
# and print each of them once, without duplicates. Input order is
|
||||
# *not* preserved.
|
||||
am__uniquify_input = $(AWK) '\
|
||||
BEGIN { nonempty = 0; } \
|
||||
{ items[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in items) print i; }; } \
|
||||
'
|
||||
# Make sure the list of sources is unique. This is necessary because,
|
||||
# e.g., the same source file might be shared among _SOURCES variables
|
||||
# for different programs/libraries.
|
||||
am__define_uniq_tagged_files = \
|
||||
list='$(am__tagged_files)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | $(am__uniquify_input)`
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
CSCOPE = cscope
|
||||
DIST_SUBDIRS = $(SUBDIRS)
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
distdir = $(PACKAGE)-$(VERSION)
|
||||
|
@ -99,6 +162,7 @@ am__remove_distdir = \
|
|||
&& rm -rf "$(distdir)" \
|
||||
|| { sleep 5 && rm -rf "$(distdir)"; }; \
|
||||
else :; fi
|
||||
am__post_remove_distdir = $(am__remove_distdir)
|
||||
am__relativize = \
|
||||
dir0=`pwd`; \
|
||||
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
|
||||
|
@ -126,12 +190,14 @@ am__relativize = \
|
|||
reldir="$$dir2"
|
||||
DIST_ARCHIVES = $(distdir).tar.gz
|
||||
GZIP_ENV = --best
|
||||
DIST_TARGETS = dist-gzip
|
||||
distuninstallcheck_listfiles = find . -type f -print
|
||||
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
|
||||
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
|
||||
distcleancheck_listfiles = find . -type f -print
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
|
@ -151,7 +217,6 @@ ECHO_T = @ECHO_T@
|
|||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
GREP = @GREP@
|
||||
INCLUDES = @INCLUDES@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
|
@ -165,7 +230,6 @@ LIBOBJS = @LIBOBJS@
|
|||
LIBS = @LIBS@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
OBJEXT = @OBJEXT@
|
||||
|
@ -236,14 +300,14 @@ top_srcdir = @top_srcdir@
|
|||
AUTOMAKE_OPTIONS = gnu
|
||||
SUBDIRS = m4 src doc gui
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
EXTRA_DIST = have.h system.h COPYING.README README.android
|
||||
EXTRA_DIST = COPYING.README README.android
|
||||
all: config.h
|
||||
$(MAKE) $(AM_MAKEFLAGS) all-recursive
|
||||
|
||||
.SUFFIXES:
|
||||
am--refresh: Makefile
|
||||
@:
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
|
@ -270,9 +334,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
|||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
$(SHELL) ./config.status --recheck
|
||||
|
||||
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
$(am__cd) $(srcdir) && $(AUTOCONF)
|
||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
|
||||
$(am__aclocal_m4_deps):
|
||||
|
||||
|
@ -283,7 +347,7 @@ config.h: stamp-h1
|
|||
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
|
||||
@rm -f stamp-h1
|
||||
cd $(top_builddir) && $(SHELL) ./config.status config.h
|
||||
$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
$(srcdir)/config.h.in: $(am__configure_deps)
|
||||
($(am__cd) $(top_srcdir) && $(AUTOHEADER))
|
||||
rm -f stamp-h1
|
||||
touch $@
|
||||
|
@ -292,22 +356,25 @@ distclean-hdr:
|
|||
-rm -f config.h stamp-h1
|
||||
|
||||
# This directory's subdirectories are mostly independent; you can cd
|
||||
# into them and run `make' without going through this Makefile.
|
||||
# To change the values of `make' variables: instead of editing Makefiles,
|
||||
# (1) if the variable is set in `config.status', edit `config.status'
|
||||
# (which will cause the Makefiles to be regenerated when you run `make');
|
||||
# (2) otherwise, pass the desired values on the `make' command line.
|
||||
$(RECURSIVE_TARGETS):
|
||||
@fail= failcom='exit 1'; \
|
||||
for f in x $$MAKEFLAGS; do \
|
||||
case $$f in \
|
||||
*=* | --[!k]*);; \
|
||||
*k*) failcom='fail=yes';; \
|
||||
esac; \
|
||||
done; \
|
||||
# into them and run 'make' without going through this Makefile.
|
||||
# To change the values of 'make' variables: instead of editing Makefiles,
|
||||
# (1) if the variable is set in 'config.status', edit 'config.status'
|
||||
# (which will cause the Makefiles to be regenerated when you run 'make');
|
||||
# (2) otherwise, pass the desired values on the 'make' command line.
|
||||
$(am__recursive_targets):
|
||||
@fail=; \
|
||||
if $(am__make_keepgoing); then \
|
||||
failcom='fail=yes'; \
|
||||
else \
|
||||
failcom='exit 1'; \
|
||||
fi; \
|
||||
dot_seen=no; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
case "$@" in \
|
||||
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
||||
*) list='$(SUBDIRS)' ;; \
|
||||
esac; \
|
||||
for subdir in $$list; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
dot_seen=yes; \
|
||||
|
@ -322,57 +389,12 @@ $(RECURSIVE_TARGETS):
|
|||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
||||
fi; test -z "$$fail"
|
||||
|
||||
$(RECURSIVE_CLEAN_TARGETS):
|
||||
@fail= failcom='exit 1'; \
|
||||
for f in x $$MAKEFLAGS; do \
|
||||
case $$f in \
|
||||
*=* | --[!k]*);; \
|
||||
*k*) failcom='fail=yes';; \
|
||||
esac; \
|
||||
done; \
|
||||
dot_seen=no; \
|
||||
case "$@" in \
|
||||
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
||||
*) list='$(SUBDIRS)' ;; \
|
||||
esac; \
|
||||
rev=''; for subdir in $$list; do \
|
||||
if test "$$subdir" = "."; then :; else \
|
||||
rev="$$subdir $$rev"; \
|
||||
fi; \
|
||||
done; \
|
||||
rev="$$rev ."; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
for subdir in $$rev; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| eval $$failcom; \
|
||||
done && test -z "$$fail"
|
||||
tags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
|
||||
done
|
||||
ctags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
|
||||
done
|
||||
ID: $(am__tagged_files)
|
||||
$(am__define_uniq_tagged_files); mkid -fID $$unique
|
||||
tags: tags-recursive
|
||||
TAGS: tags
|
||||
|
||||
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: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||
set x; \
|
||||
here=`pwd`; \
|
||||
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
|
||||
|
@ -388,12 +410,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
|
|||
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
|
||||
fi; \
|
||||
done; \
|
||||
list='$(SOURCES) $(HEADERS) config.h.in $(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; }; }'`; \
|
||||
$(am__define_uniq_tagged_files); \
|
||||
shift; \
|
||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
|
@ -405,15 +422,11 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
|
|||
$$unique; \
|
||||
fi; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS) config.h.in $(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; }; }'`; \
|
||||
ctags: ctags-recursive
|
||||
|
||||
CTAGS: ctags
|
||||
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||
$(am__define_uniq_tagged_files); \
|
||||
test -z "$(CTAGS_ARGS)$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$unique
|
||||
|
@ -422,11 +435,39 @@ GTAGS:
|
|||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& $(am__cd) $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
||||
cscope: cscope.files
|
||||
test ! -s cscope.files \
|
||||
|| $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
|
||||
clean-cscope:
|
||||
-rm -f cscope.files
|
||||
cscope.files: clean-cscope cscopelist
|
||||
cscopelist: cscopelist-recursive
|
||||
|
||||
cscopelist-am: $(am__tagged_files)
|
||||
list='$(am__tagged_files)'; \
|
||||
case "$(srcdir)" in \
|
||||
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
|
||||
*) sdir=$(subdir)/$(srcdir) ;; \
|
||||
esac; \
|
||||
for i in $$list; do \
|
||||
if test -f "$$i"; then \
|
||||
echo "$(subdir)/$$i"; \
|
||||
else \
|
||||
echo "$$sdir/$$i"; \
|
||||
fi; \
|
||||
done >> $(top_builddir)/cscope.files
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@case `sed 15q $(srcdir)/NEWS` in \
|
||||
*"$(VERSION)"*) : ;; \
|
||||
*) \
|
||||
echo "NEWS not updated; not releasing" 1>&2; \
|
||||
exit 1;; \
|
||||
esac
|
||||
$(am__remove_distdir)
|
||||
test -d "$(distdir)" || mkdir "$(distdir)"
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
|
@ -492,40 +533,36 @@ distdir: $(DISTFILES)
|
|||
|| chmod -R a+r "$(distdir)"
|
||||
dist-gzip: distdir
|
||||
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||
$(am__remove_distdir)
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
dist-bzip2: distdir
|
||||
tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
|
||||
$(am__remove_distdir)
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
dist-lzip: distdir
|
||||
tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-lzma: distdir
|
||||
tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
|
||||
$(am__remove_distdir)
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
dist-xz: distdir
|
||||
tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
|
||||
$(am__remove_distdir)
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
dist-tarZ: distdir
|
||||
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
|
||||
$(am__remove_distdir)
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
dist-shar: distdir
|
||||
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
|
||||
$(am__remove_distdir)
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
dist-zip: distdir
|
||||
-rm -f $(distdir).zip
|
||||
zip -rq $(distdir).zip $(distdir)
|
||||
$(am__remove_distdir)
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
dist dist-all: distdir
|
||||
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||
$(am__remove_distdir)
|
||||
dist dist-all:
|
||||
$(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
# This target untars the dist file and tries a VPATH configuration. Then
|
||||
# it guarantees that the distribution is self-contained by making another
|
||||
|
@ -536,8 +573,6 @@ distcheck: dist
|
|||
GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
|
||||
*.tar.bz2*) \
|
||||
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
|
||||
*.tar.lzma*) \
|
||||
lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
|
||||
*.tar.lz*) \
|
||||
lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
|
||||
*.tar.xz*) \
|
||||
|
@ -549,9 +584,9 @@ distcheck: dist
|
|||
*.zip*) \
|
||||
unzip $(distdir).zip ;;\
|
||||
esac
|
||||
chmod -R a-w $(distdir); chmod u+w $(distdir)
|
||||
mkdir $(distdir)/_build
|
||||
mkdir $(distdir)/_inst
|
||||
chmod -R a-w $(distdir)
|
||||
chmod u+w $(distdir)
|
||||
mkdir $(distdir)/_build $(distdir)/_inst
|
||||
chmod a-w $(distdir)
|
||||
test -d $(distdir)/_build || exit 0; \
|
||||
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
|
||||
|
@ -583,7 +618,7 @@ distcheck: dist
|
|||
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
|
||||
&& cd "$$am__cwd" \
|
||||
|| exit 1
|
||||
$(am__remove_distdir)
|
||||
$(am__post_remove_distdir)
|
||||
@(echo "$(distdir) archives ready for distribution: "; \
|
||||
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
|
||||
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
|
||||
|
@ -717,13 +752,12 @@ ps-am:
|
|||
|
||||
uninstall-am:
|
||||
|
||||
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \
|
||||
ctags-recursive install-am install-strip tags-recursive
|
||||
.MAKE: $(am__recursive_targets) all install-am install-strip
|
||||
|
||||
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
|
||||
all all-am am--refresh check check-am clean clean-generic \
|
||||
ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \
|
||||
dist-lzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \
|
||||
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
|
||||
am--refresh check check-am clean clean-cscope clean-generic \
|
||||
cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \
|
||||
dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \
|
||||
distcheck distclean distclean-generic distclean-hdr \
|
||||
distclean-tags distcleancheck distdir distuninstallcheck dvi \
|
||||
dvi-am html html-am info info-am install install-am \
|
||||
|
@ -733,8 +767,8 @@ uninstall-am:
|
|||
install-pdf-am install-ps install-ps-am install-strip \
|
||||
installcheck installcheck-am installdirs installdirs-am \
|
||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
||||
mostlyclean-generic pdf pdf-am ps ps-am tags tags-recursive \
|
||||
uninstall uninstall-am
|
||||
mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \
|
||||
uninstall-am
|
||||
|
||||
|
||||
ChangeLog:
|
||||
|
|
56
NEWS
56
NEWS
|
@ -1,3 +1,19 @@
|
|||
Version 1.1pre8 August 13 2013
|
||||
|
||||
* ExperimentalProtocol is now enabled by default.
|
||||
|
||||
* Added an invitation protocol that makes it easy to invite new nodes.
|
||||
|
||||
* Added the LocalDiscoveryAddress option to change the broadcast address used
|
||||
to find local nodes.
|
||||
|
||||
* Limit the rate of incoming meta-connections.
|
||||
|
||||
* Many small bug fixes and code cleanups.
|
||||
|
||||
Thanks to Etienne Dechamps and Sven-Haegar Koch for their contributions to this
|
||||
version of tinc.
|
||||
|
||||
Version 1.1pre7 April 22 2013
|
||||
|
||||
* Fixed large latencies on Windows.
|
||||
|
@ -105,6 +121,46 @@ Version 1.1pre1 June 25 2011
|
|||
Thanks to Scott Lamb and Sven-Haegar Koch for their contributions to this
|
||||
version of tinc.
|
||||
|
||||
Version 1.0.22 August 13 2013
|
||||
|
||||
* Fixed the combination of Mode = router and DeviceType = tap.
|
||||
|
||||
* The $NAME variable is now set in subnet-up/down scripts.
|
||||
|
||||
* Tinc now gives an error when unknown options are given on the command line.
|
||||
|
||||
* Tinc now correctly handles a space between a short command line option and
|
||||
an optional argument.
|
||||
|
||||
Thanks to Etienne Dechamps for his contribution to this version of tinc.
|
||||
|
||||
Version 1.0.21 April 22 2013
|
||||
|
||||
* Drop packets forwarded via TCP if they are too big (CVE-2013-1428).
|
||||
|
||||
Thanks to Martin Schobert for auditing tinc and reporting this vulnerability.
|
||||
|
||||
Version 1.0.20 March 03 2013
|
||||
|
||||
* Use /dev/tap0 by default on FreeBSD and NetBSD when using switch mode.
|
||||
|
||||
* Minor improvements and clarifications in the documentation.
|
||||
|
||||
* Allow tinc to be cross-compiled with Android's NDK.
|
||||
|
||||
* The discovered PMTU is now also applied to VLAN tagged traffic.
|
||||
|
||||
* The LocalDiscovery option now makes use of all addresses tinc is bound to.
|
||||
|
||||
* Fixed support for tunemu on iOS devices.
|
||||
|
||||
* The PriorityInheritance option now also works with switch mode.
|
||||
|
||||
* Fixed tinc crashing when using a SOCKS5 proxy.
|
||||
|
||||
Thanks to Mesar Hameed, Vilbrekin and Martin Schürrer for their contributions
|
||||
to this version of tinc.
|
||||
|
||||
Version 1.0.19 June 25 2012
|
||||
|
||||
* Allow :: notation in IPv6 Subnets.
|
||||
|
|
12
README
12
README
|
@ -1,4 +1,4 @@
|
|||
This is the README file for tinc version 1.1pre7. Installation
|
||||
This is the README file for tinc version 1.1pre8. Installation
|
||||
instructions may be found in the INSTALL file.
|
||||
|
||||
tinc is Copyright (C) 1998-2013 by:
|
||||
|
@ -36,11 +36,12 @@ at your own risk.
|
|||
Compatibility
|
||||
-------------
|
||||
|
||||
Version 1.1pre7 is compatible with 1.0pre8, 1.0 and later, but not with older
|
||||
Version 1.1pre8 is compatible with 1.0pre8, 1.0 and later, but not with older
|
||||
versions of tinc.
|
||||
|
||||
When the ExperimentalProtocol option is used, tinc is still compatible with
|
||||
1.0.X and 1.1pre7 itself, but not with any other 1.1preX version.
|
||||
When the ExperimentalProtocol option is used, which is the default since
|
||||
1.1pre8, tinc is still compatible with 1.0.X and 1.1pre8 itself, but not with
|
||||
any other 1.1preX version.
|
||||
|
||||
|
||||
Requirements
|
||||
|
@ -49,7 +50,8 @@ Requirements
|
|||
In order to compile tinc, you will need a GNU C compiler environment. Please
|
||||
ensure you have the latest stable versions of all the required libraries:
|
||||
|
||||
- OpenSSL (http://www.openssl.org/) version 1.0.0 or later.
|
||||
- OpenSSL (http://www.openssl.org/) version 1.0.0 or later, with support for
|
||||
elliptic curve cryptography (ECC) enabeld.
|
||||
|
||||
The following libraries are used by default, but can be disabled if necessary:
|
||||
|
||||
|
|
1
THANKS
1
THANKS
|
@ -13,6 +13,7 @@ We would like to thank the following people for their contributions to tinc:
|
|||
* dnk
|
||||
* Enrique Zanardi
|
||||
* Erik Tews
|
||||
* Etienne Dechamps
|
||||
* Flynn Marquardt
|
||||
* Grzegorz Dymarek
|
||||
* Hans Bayle
|
||||
|
|
640
aclocal.m4
vendored
640
aclocal.m4
vendored
File diff suppressed because it is too large
Load diff
347
compile
Executable file
347
compile
Executable file
|
@ -0,0 +1,347 @@
|
|||
#! /bin/sh
|
||||
# Wrapper for compilers which do not understand '-c -o'.
|
||||
|
||||
scriptversion=2012-10-14.11; # UTC
|
||||
|
||||
# Copyright (C) 1999-2013 Free Software Foundation, Inc.
|
||||
# Written by Tom Tromey <tromey@cygnus.com>.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# This file is maintained in Automake, please report
|
||||
# bugs to <bug-automake@gnu.org> or send patches to
|
||||
# <automake-patches@gnu.org>.
|
||||
|
||||
nl='
|
||||
'
|
||||
|
||||
# We need space, tab and new line, in precisely that order. Quoting is
|
||||
# there to prevent tools from complaining about whitespace usage.
|
||||
IFS=" "" $nl"
|
||||
|
||||
file_conv=
|
||||
|
||||
# func_file_conv build_file lazy
|
||||
# Convert a $build file to $host form and store it in $file
|
||||
# Currently only supports Windows hosts. If the determined conversion
|
||||
# type is listed in (the comma separated) LAZY, no conversion will
|
||||
# take place.
|
||||
func_file_conv ()
|
||||
{
|
||||
file=$1
|
||||
case $file in
|
||||
/ | /[!/]*) # absolute file, and not a UNC file
|
||||
if test -z "$file_conv"; then
|
||||
# lazily determine how to convert abs files
|
||||
case `uname -s` in
|
||||
MINGW*)
|
||||
file_conv=mingw
|
||||
;;
|
||||
CYGWIN*)
|
||||
file_conv=cygwin
|
||||
;;
|
||||
*)
|
||||
file_conv=wine
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
case $file_conv/,$2, in
|
||||
*,$file_conv,*)
|
||||
;;
|
||||
mingw/*)
|
||||
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
|
||||
;;
|
||||
cygwin/*)
|
||||
file=`cygpath -m "$file" || echo "$file"`
|
||||
;;
|
||||
wine/*)
|
||||
file=`winepath -w "$file" || echo "$file"`
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# func_cl_dashL linkdir
|
||||
# Make cl look for libraries in LINKDIR
|
||||
func_cl_dashL ()
|
||||
{
|
||||
func_file_conv "$1"
|
||||
if test -z "$lib_path"; then
|
||||
lib_path=$file
|
||||
else
|
||||
lib_path="$lib_path;$file"
|
||||
fi
|
||||
linker_opts="$linker_opts -LIBPATH:$file"
|
||||
}
|
||||
|
||||
# func_cl_dashl library
|
||||
# Do a library search-path lookup for cl
|
||||
func_cl_dashl ()
|
||||
{
|
||||
lib=$1
|
||||
found=no
|
||||
save_IFS=$IFS
|
||||
IFS=';'
|
||||
for dir in $lib_path $LIB
|
||||
do
|
||||
IFS=$save_IFS
|
||||
if $shared && test -f "$dir/$lib.dll.lib"; then
|
||||
found=yes
|
||||
lib=$dir/$lib.dll.lib
|
||||
break
|
||||
fi
|
||||
if test -f "$dir/$lib.lib"; then
|
||||
found=yes
|
||||
lib=$dir/$lib.lib
|
||||
break
|
||||
fi
|
||||
if test -f "$dir/lib$lib.a"; then
|
||||
found=yes
|
||||
lib=$dir/lib$lib.a
|
||||
break
|
||||
fi
|
||||
done
|
||||
IFS=$save_IFS
|
||||
|
||||
if test "$found" != yes; then
|
||||
lib=$lib.lib
|
||||
fi
|
||||
}
|
||||
|
||||
# func_cl_wrapper cl arg...
|
||||
# Adjust compile command to suit cl
|
||||
func_cl_wrapper ()
|
||||
{
|
||||
# Assume a capable shell
|
||||
lib_path=
|
||||
shared=:
|
||||
linker_opts=
|
||||
for arg
|
||||
do
|
||||
if test -n "$eat"; then
|
||||
eat=
|
||||
else
|
||||
case $1 in
|
||||
-o)
|
||||
# configure might choose to run compile as 'compile cc -o foo foo.c'.
|
||||
eat=1
|
||||
case $2 in
|
||||
*.o | *.[oO][bB][jJ])
|
||||
func_file_conv "$2"
|
||||
set x "$@" -Fo"$file"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
func_file_conv "$2"
|
||||
set x "$@" -Fe"$file"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
-I)
|
||||
eat=1
|
||||
func_file_conv "$2" mingw
|
||||
set x "$@" -I"$file"
|
||||
shift
|
||||
;;
|
||||
-I*)
|
||||
func_file_conv "${1#-I}" mingw
|
||||
set x "$@" -I"$file"
|
||||
shift
|
||||
;;
|
||||
-l)
|
||||
eat=1
|
||||
func_cl_dashl "$2"
|
||||
set x "$@" "$lib"
|
||||
shift
|
||||
;;
|
||||
-l*)
|
||||
func_cl_dashl "${1#-l}"
|
||||
set x "$@" "$lib"
|
||||
shift
|
||||
;;
|
||||
-L)
|
||||
eat=1
|
||||
func_cl_dashL "$2"
|
||||
;;
|
||||
-L*)
|
||||
func_cl_dashL "${1#-L}"
|
||||
;;
|
||||
-static)
|
||||
shared=false
|
||||
;;
|
||||
-Wl,*)
|
||||
arg=${1#-Wl,}
|
||||
save_ifs="$IFS"; IFS=','
|
||||
for flag in $arg; do
|
||||
IFS="$save_ifs"
|
||||
linker_opts="$linker_opts $flag"
|
||||
done
|
||||
IFS="$save_ifs"
|
||||
;;
|
||||
-Xlinker)
|
||||
eat=1
|
||||
linker_opts="$linker_opts $2"
|
||||
;;
|
||||
-*)
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
|
||||
func_file_conv "$1"
|
||||
set x "$@" -Tp"$file"
|
||||
shift
|
||||
;;
|
||||
*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
|
||||
func_file_conv "$1" mingw
|
||||
set x "$@" "$file"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
shift
|
||||
done
|
||||
if test -n "$linker_opts"; then
|
||||
linker_opts="-link$linker_opts"
|
||||
fi
|
||||
exec "$@" $linker_opts
|
||||
exit 1
|
||||
}
|
||||
|
||||
eat=
|
||||
|
||||
case $1 in
|
||||
'')
|
||||
echo "$0: No command. Try '$0 --help' for more information." 1>&2
|
||||
exit 1;
|
||||
;;
|
||||
-h | --h*)
|
||||
cat <<\EOF
|
||||
Usage: compile [--help] [--version] PROGRAM [ARGS]
|
||||
|
||||
Wrapper for compilers which do not understand '-c -o'.
|
||||
Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
|
||||
arguments, and rename the output as expected.
|
||||
|
||||
If you are trying to build a whole package this is not the
|
||||
right script to run: please start by reading the file 'INSTALL'.
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>.
|
||||
EOF
|
||||
exit $?
|
||||
;;
|
||||
-v | --v*)
|
||||
echo "compile $scriptversion"
|
||||
exit $?
|
||||
;;
|
||||
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
|
||||
func_cl_wrapper "$@" # Doesn't return...
|
||||
;;
|
||||
esac
|
||||
|
||||
ofile=
|
||||
cfile=
|
||||
|
||||
for arg
|
||||
do
|
||||
if test -n "$eat"; then
|
||||
eat=
|
||||
else
|
||||
case $1 in
|
||||
-o)
|
||||
# configure might choose to run compile as 'compile cc -o foo foo.c'.
|
||||
# So we strip '-o arg' only if arg is an object.
|
||||
eat=1
|
||||
case $2 in
|
||||
*.o | *.obj)
|
||||
ofile=$2
|
||||
;;
|
||||
*)
|
||||
set x "$@" -o "$2"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*.c)
|
||||
cfile=$1
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
shift
|
||||
done
|
||||
|
||||
if test -z "$ofile" || test -z "$cfile"; then
|
||||
# If no '-o' option was seen then we might have been invoked from a
|
||||
# pattern rule where we don't need one. That is ok -- this is a
|
||||
# normal compilation that the losing compiler can handle. If no
|
||||
# '.c' file was seen then we are probably linking. That is also
|
||||
# ok.
|
||||
exec "$@"
|
||||
fi
|
||||
|
||||
# Name of file we expect compiler to create.
|
||||
cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
|
||||
|
||||
# Create the lock directory.
|
||||
# Note: use '[/\\:.-]' here to ensure that we don't use the same name
|
||||
# that we are using for the .o file. Also, base the name on the expected
|
||||
# object file name, since that is what matters with a parallel build.
|
||||
lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
|
||||
while true; do
|
||||
if mkdir "$lockdir" >/dev/null 2>&1; then
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
# FIXME: race condition here if user kills between mkdir and trap.
|
||||
trap "rmdir '$lockdir'; exit 1" 1 2 15
|
||||
|
||||
# Run the compile.
|
||||
"$@"
|
||||
ret=$?
|
||||
|
||||
if test -f "$cofile"; then
|
||||
test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
|
||||
elif test -f "${cofile}bj"; then
|
||||
test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
|
||||
fi
|
||||
|
||||
rmdir "$lockdir"
|
||||
exit $ret
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
184
config.guess
vendored
184
config.guess
vendored
|
@ -1,14 +1,12 @@
|
|||
#! /bin/sh
|
||||
# Attempt to guess a canonical system name.
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
|
||||
# 2011, 2012 Free Software Foundation, Inc.
|
||||
# Copyright 1992-2013 Free Software Foundation, Inc.
|
||||
|
||||
timestamp='2012-02-10'
|
||||
timestamp='2013-06-10'
|
||||
|
||||
# This file is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
|
@ -22,19 +20,17 @@ timestamp='2012-02-10'
|
|||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
|
||||
# Originally written by Per Bothner. Please send patches (context
|
||||
# diff format) to <config-patches@gnu.org> and include a ChangeLog
|
||||
# entry.
|
||||
# the same distribution terms that you use for the rest of that
|
||||
# program. This Exception is an additional permission under section 7
|
||||
# of the GNU General Public License, version 3 ("GPLv3").
|
||||
#
|
||||
# This script attempts to guess a canonical system name similar to
|
||||
# config.sub. If it succeeds, it prints the system name on stdout, and
|
||||
# exits with 0. Otherwise, it exits with 1.
|
||||
# Originally written by Per Bothner.
|
||||
#
|
||||
# You can get the latest version of this script from:
|
||||
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
|
||||
#
|
||||
# Please send patches with a ChangeLog entry to config-patches@gnu.org.
|
||||
|
||||
|
||||
me=`echo "$0" | sed -e 's,.*/,,'`
|
||||
|
||||
|
@ -54,9 +50,7 @@ version="\
|
|||
GNU config.guess ($timestamp)
|
||||
|
||||
Originally written by Per Bothner.
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
|
||||
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
|
||||
Free Software Foundation, Inc.
|
||||
Copyright 1992-2013 Free Software Foundation, Inc.
|
||||
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
||||
|
@ -138,6 +132,27 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
|
|||
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
|
||||
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
|
||||
|
||||
case "${UNAME_SYSTEM}" in
|
||||
Linux|GNU|GNU/*)
|
||||
# If the system lacks a compiler, then just pick glibc.
|
||||
# We could probably try harder.
|
||||
LIBC=gnu
|
||||
|
||||
eval $set_cc_for_build
|
||||
cat <<-EOF > $dummy.c
|
||||
#include <features.h>
|
||||
#if defined(__UCLIBC__)
|
||||
LIBC=uclibc
|
||||
#elif defined(__dietlibc__)
|
||||
LIBC=dietlibc
|
||||
#else
|
||||
LIBC=gnu
|
||||
#endif
|
||||
EOF
|
||||
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
|
||||
;;
|
||||
esac
|
||||
|
||||
# Note: order is significant - the case branches are not exclusive.
|
||||
|
||||
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
|
@ -200,6 +215,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
|||
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
|
||||
echo "${machine}-${os}${release}"
|
||||
exit ;;
|
||||
*:Bitrig:*:*)
|
||||
UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
|
||||
echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
|
||||
exit ;;
|
||||
*:OpenBSD:*:*)
|
||||
UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
|
||||
echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
|
||||
|
@ -302,7 +321,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
|||
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
|
||||
echo arm-acorn-riscix${UNAME_RELEASE}
|
||||
exit ;;
|
||||
arm:riscos:*:*|arm:RISCOS:*:*)
|
||||
arm*:riscos:*:*|arm*:RISCOS:*:*)
|
||||
echo arm-unknown-riscos
|
||||
exit ;;
|
||||
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
|
||||
|
@ -801,6 +820,9 @@ EOF
|
|||
i*:CYGWIN*:*)
|
||||
echo ${UNAME_MACHINE}-pc-cygwin
|
||||
exit ;;
|
||||
*:MINGW64*:*)
|
||||
echo ${UNAME_MACHINE}-pc-mingw64
|
||||
exit ;;
|
||||
*:MINGW*:*)
|
||||
echo ${UNAME_MACHINE}-pc-mingw32
|
||||
exit ;;
|
||||
|
@ -852,21 +874,21 @@ EOF
|
|||
exit ;;
|
||||
*:GNU:*:*)
|
||||
# the GNU system
|
||||
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
|
||||
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
|
||||
exit ;;
|
||||
*:GNU/*:*:*)
|
||||
# other systems with GNU libc and userland
|
||||
echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
|
||||
exit ;;
|
||||
i*86:Minix:*:*)
|
||||
echo ${UNAME_MACHINE}-pc-minix
|
||||
exit ;;
|
||||
aarch64:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
aarch64_be:Linux:*:*)
|
||||
UNAME_MACHINE=aarch64_be
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
alpha:Linux:*:*)
|
||||
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
|
||||
|
@ -879,59 +901,54 @@ EOF
|
|||
EV68*) UNAME_MACHINE=alphaev68 ;;
|
||||
esac
|
||||
objdump --private-headers /bin/sh | grep -q ld.so.1
|
||||
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
|
||||
if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
arc:Linux:*:* | arceb:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
arm*:Linux:*:*)
|
||||
eval $set_cc_for_build
|
||||
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
|
||||
| grep -q __ARM_EABI__
|
||||
then
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
else
|
||||
if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
|
||||
| grep -q __ARM_PCS_VFP
|
||||
then
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnueabi
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
|
||||
else
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
|
||||
fi
|
||||
fi
|
||||
exit ;;
|
||||
avr32*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
cris:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-axis-linux-gnu
|
||||
echo ${UNAME_MACHINE}-axis-linux-${LIBC}
|
||||
exit ;;
|
||||
crisv32:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-axis-linux-gnu
|
||||
echo ${UNAME_MACHINE}-axis-linux-${LIBC}
|
||||
exit ;;
|
||||
frv:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
hexagon:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
i*86:Linux:*:*)
|
||||
LIBC=gnu
|
||||
eval $set_cc_for_build
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
#ifdef __dietlibc__
|
||||
LIBC=dietlibc
|
||||
#endif
|
||||
EOF
|
||||
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
|
||||
echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
|
||||
echo ${UNAME_MACHINE}-pc-linux-${LIBC}
|
||||
exit ;;
|
||||
ia64:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
m32r*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
m68*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
mips:Linux:*:* | mips64:Linux:*:*)
|
||||
eval $set_cc_for_build
|
||||
|
@ -950,54 +967,63 @@ EOF
|
|||
#endif
|
||||
EOF
|
||||
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
|
||||
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
|
||||
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
|
||||
;;
|
||||
or1k:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
or32:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
padre:Linux:*:*)
|
||||
echo sparc-unknown-linux-gnu
|
||||
echo sparc-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
parisc64:Linux:*:* | hppa64:Linux:*:*)
|
||||
echo hppa64-unknown-linux-gnu
|
||||
echo hppa64-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
parisc:Linux:*:* | hppa:Linux:*:*)
|
||||
# Look for CPU level
|
||||
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
|
||||
PA7*) echo hppa1.1-unknown-linux-gnu ;;
|
||||
PA8*) echo hppa2.0-unknown-linux-gnu ;;
|
||||
*) echo hppa-unknown-linux-gnu ;;
|
||||
PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
|
||||
PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
|
||||
*) echo hppa-unknown-linux-${LIBC} ;;
|
||||
esac
|
||||
exit ;;
|
||||
ppc64:Linux:*:*)
|
||||
echo powerpc64-unknown-linux-gnu
|
||||
echo powerpc64-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
ppc:Linux:*:*)
|
||||
echo powerpc-unknown-linux-gnu
|
||||
echo powerpc-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
ppc64le:Linux:*:*)
|
||||
echo powerpc64le-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
ppcle:Linux:*:*)
|
||||
echo powerpcle-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
s390:Linux:*:* | s390x:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-ibm-linux
|
||||
echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
|
||||
exit ;;
|
||||
sh64*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
sh*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
sparc:Linux:*:* | sparc64:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
tile*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
vax:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-dec-linux-gnu
|
||||
echo ${UNAME_MACHINE}-dec-linux-${LIBC}
|
||||
exit ;;
|
||||
x86_64:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
xtensa*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
i*86:DYNIX/ptx:4*:*)
|
||||
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
|
||||
|
@ -1201,6 +1227,9 @@ EOF
|
|||
BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
|
||||
echo i586-pc-haiku
|
||||
exit ;;
|
||||
x86_64:Haiku:*:*)
|
||||
echo x86_64-unknown-haiku
|
||||
exit ;;
|
||||
SX-4:SUPER-UX:*:*)
|
||||
echo sx4-nec-superux${UNAME_RELEASE}
|
||||
exit ;;
|
||||
|
@ -1227,19 +1256,21 @@ EOF
|
|||
exit ;;
|
||||
*:Darwin:*:*)
|
||||
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
|
||||
case $UNAME_PROCESSOR in
|
||||
i386)
|
||||
eval $set_cc_for_build
|
||||
if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
|
||||
if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
|
||||
(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
|
||||
grep IS_64BIT_ARCH >/dev/null
|
||||
then
|
||||
UNAME_PROCESSOR="x86_64"
|
||||
fi
|
||||
fi ;;
|
||||
unknown) UNAME_PROCESSOR=powerpc ;;
|
||||
esac
|
||||
eval $set_cc_for_build
|
||||
if test "$UNAME_PROCESSOR" = unknown ; then
|
||||
UNAME_PROCESSOR=powerpc
|
||||
fi
|
||||
if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
|
||||
if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
|
||||
(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
|
||||
grep IS_64BIT_ARCH >/dev/null
|
||||
then
|
||||
case $UNAME_PROCESSOR in
|
||||
i386) UNAME_PROCESSOR=x86_64 ;;
|
||||
powerpc) UNAME_PROCESSOR=powerpc64 ;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
|
||||
exit ;;
|
||||
*:procnto*:*:* | *:QNX:[0123456789]*:*)
|
||||
|
@ -1256,7 +1287,7 @@ EOF
|
|||
NEO-?:NONSTOP_KERNEL:*:*)
|
||||
echo neo-tandem-nsk${UNAME_RELEASE}
|
||||
exit ;;
|
||||
NSE-?:NONSTOP_KERNEL:*:*)
|
||||
NSE-*:NONSTOP_KERNEL:*:*)
|
||||
echo nse-tandem-nsk${UNAME_RELEASE}
|
||||
exit ;;
|
||||
NSR-?:NONSTOP_KERNEL:*:*)
|
||||
|
@ -1330,9 +1361,6 @@ EOF
|
|||
exit ;;
|
||||
esac
|
||||
|
||||
#echo '(No uname command or uname output not recognized.)' 1>&2
|
||||
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
|
||||
|
||||
eval $set_cc_for_build
|
||||
cat >$dummy.c <<EOF
|
||||
#ifdef _SEQUENT_
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* config.h.in. Generated from configure.in by autoheader. */
|
||||
/* config.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
/* Support for jumbograms (packets up to 9000 bytes) */
|
||||
#undef ENABLE_JUMBOGRAMS
|
||||
|
@ -382,6 +382,9 @@
|
|||
/* Location of lzo1x.h */
|
||||
#undef LZO1X_H
|
||||
|
||||
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
|
||||
#undef NO_MINUS_C_MINUS_O
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
|
@ -459,6 +462,9 @@
|
|||
/* Defined if the __malloc__ attribute is not supported. */
|
||||
#undef __malloc__
|
||||
|
||||
/* Defined if the __warn_unused_result__ attribute is not supported. */
|
||||
#undef __warn_unused_result__
|
||||
|
||||
/* Define to empty if `const' does not conform to ANSI C. */
|
||||
#undef const
|
||||
|
||||
|
|
97
config.sub
vendored
97
config.sub
vendored
|
@ -1,24 +1,18 @@
|
|||
#! /bin/sh
|
||||
# Configuration validation subroutine script.
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
|
||||
# 2011, 2012 Free Software Foundation, Inc.
|
||||
# Copyright 1992-2013 Free Software Foundation, Inc.
|
||||
|
||||
timestamp='2012-04-18'
|
||||
timestamp='2013-08-10'
|
||||
|
||||
# This file is (in principle) common to ALL GNU software.
|
||||
# The presence of a machine in this file suggests that SOME GNU software
|
||||
# can handle that machine. It does not imply ALL GNU software can.
|
||||
#
|
||||
# This file is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# This file is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
|
@ -26,11 +20,12 @@ timestamp='2012-04-18'
|
|||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
# the same distribution terms that you use for the rest of that
|
||||
# program. This Exception is an additional permission under section 7
|
||||
# of the GNU General Public License, version 3 ("GPLv3").
|
||||
|
||||
|
||||
# Please send patches to <config-patches@gnu.org>. Submit a context
|
||||
# diff and a properly formatted GNU ChangeLog entry.
|
||||
# Please send patches with a ChangeLog entry to config-patches@gnu.org.
|
||||
#
|
||||
# Configuration subroutine to validate and canonicalize a configuration type.
|
||||
# Supply the specified configuration type as an argument.
|
||||
|
@ -73,9 +68,7 @@ Report bugs and patches to <config-patches@gnu.org>."
|
|||
version="\
|
||||
GNU config.sub ($timestamp)
|
||||
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
|
||||
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
|
||||
Free Software Foundation, Inc.
|
||||
Copyright 1992-2013 Free Software Foundation, Inc.
|
||||
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
||||
|
@ -123,7 +116,7 @@ esac
|
|||
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
|
||||
case $maybe_os in
|
||||
nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
|
||||
linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
|
||||
linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
|
||||
knetbsd*-gnu* | netbsd*-gnu* | \
|
||||
kopensolaris*-gnu* | \
|
||||
storm-chaos* | os2-emx* | rtmk-nova*)
|
||||
|
@ -156,7 +149,7 @@ case $os in
|
|||
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
|
||||
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
|
||||
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
|
||||
-apple | -axis | -knuth | -cray | -microblaze)
|
||||
-apple | -axis | -knuth | -cray | -microblaze*)
|
||||
os=
|
||||
basic_machine=$1
|
||||
;;
|
||||
|
@ -259,10 +252,12 @@ case $basic_machine in
|
|||
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
|
||||
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
|
||||
| am33_2.0 \
|
||||
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
|
||||
| be32 | be64 \
|
||||
| arc | arceb \
|
||||
| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
|
||||
| avr | avr32 \
|
||||
| be32 | be64 \
|
||||
| bfin \
|
||||
| c4x | clipper \
|
||||
| c4x | c8051 | clipper \
|
||||
| d10v | d30v | dlx | dsp16xx \
|
||||
| epiphany \
|
||||
| fido | fr30 | frv \
|
||||
|
@ -273,7 +268,7 @@ case $basic_machine in
|
|||
| le32 | le64 \
|
||||
| lm32 \
|
||||
| m32c | m32r | m32rle | m68000 | m68k | m88k \
|
||||
| maxq | mb | microblaze | mcore | mep | metag \
|
||||
| maxq | mb | microblaze | microblazeel | mcore | mep | metag \
|
||||
| mips | mipsbe | mipseb | mipsel | mipsle \
|
||||
| mips16 \
|
||||
| mips64 | mips64el \
|
||||
|
@ -291,16 +286,17 @@ case $basic_machine in
|
|||
| mipsisa64r2 | mipsisa64r2el \
|
||||
| mipsisa64sb1 | mipsisa64sb1el \
|
||||
| mipsisa64sr71k | mipsisa64sr71kel \
|
||||
| mipsr5900 | mipsr5900el \
|
||||
| mipstx39 | mipstx39el \
|
||||
| mn10200 | mn10300 \
|
||||
| moxie \
|
||||
| mt \
|
||||
| msp430 \
|
||||
| nds32 | nds32le | nds32be \
|
||||
| nios | nios2 \
|
||||
| nios | nios2 | nios2eb | nios2el \
|
||||
| ns16k | ns32k \
|
||||
| open8 \
|
||||
| or32 \
|
||||
| or1k | or32 \
|
||||
| pdp10 | pdp11 | pj | pjl \
|
||||
| powerpc | powerpc64 | powerpc64le | powerpcle \
|
||||
| pyramid \
|
||||
|
@ -370,13 +366,13 @@ case $basic_machine in
|
|||
| aarch64-* | aarch64_be-* \
|
||||
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
|
||||
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
|
||||
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
|
||||
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
|
||||
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
|
||||
| avr-* | avr32-* \
|
||||
| be32-* | be64-* \
|
||||
| bfin-* | bs2000-* \
|
||||
| c[123]* | c30-* | [cjt]90-* | c4x-* \
|
||||
| clipper-* | craynv-* | cydra-* \
|
||||
| c8051-* | clipper-* | craynv-* | cydra-* \
|
||||
| d10v-* | d30v-* | dlx-* \
|
||||
| elxsi-* \
|
||||
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
|
||||
|
@ -389,7 +385,8 @@ case $basic_machine in
|
|||
| lm32-* \
|
||||
| m32c-* | m32r-* | m32rle-* \
|
||||
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
|
||||
| m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
|
||||
| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
|
||||
| microblaze-* | microblazeel-* \
|
||||
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
|
||||
| mips16-* \
|
||||
| mips64-* | mips64el-* \
|
||||
|
@ -407,12 +404,13 @@ case $basic_machine in
|
|||
| mipsisa64r2-* | mipsisa64r2el-* \
|
||||
| mipsisa64sb1-* | mipsisa64sb1el-* \
|
||||
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
|
||||
| mipsr5900-* | mipsr5900el-* \
|
||||
| mipstx39-* | mipstx39el-* \
|
||||
| mmix-* \
|
||||
| mt-* \
|
||||
| msp430-* \
|
||||
| nds32-* | nds32le-* | nds32be-* \
|
||||
| nios-* | nios2-* \
|
||||
| nios-* | nios2-* | nios2eb-* | nios2el-* \
|
||||
| none-* | np1-* | ns16k-* | ns32k-* \
|
||||
| open8-* \
|
||||
| orion-* \
|
||||
|
@ -788,11 +786,15 @@ case $basic_machine in
|
|||
basic_machine=ns32k-utek
|
||||
os=-sysv
|
||||
;;
|
||||
microblaze)
|
||||
microblaze*)
|
||||
basic_machine=microblaze-xilinx
|
||||
;;
|
||||
mingw64)
|
||||
basic_machine=x86_64-pc
|
||||
os=-mingw64
|
||||
;;
|
||||
mingw32)
|
||||
basic_machine=i386-pc
|
||||
basic_machine=i686-pc
|
||||
os=-mingw32
|
||||
;;
|
||||
mingw32ce)
|
||||
|
@ -828,7 +830,7 @@ case $basic_machine in
|
|||
basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
|
||||
;;
|
||||
msys)
|
||||
basic_machine=i386-pc
|
||||
basic_machine=i686-pc
|
||||
os=-msys
|
||||
;;
|
||||
mvs)
|
||||
|
@ -1019,7 +1021,11 @@ case $basic_machine in
|
|||
basic_machine=i586-unknown
|
||||
os=-pw32
|
||||
;;
|
||||
rdos)
|
||||
rdos | rdos64)
|
||||
basic_machine=x86_64-pc
|
||||
os=-rdos
|
||||
;;
|
||||
rdos32)
|
||||
basic_machine=i386-pc
|
||||
os=-rdos
|
||||
;;
|
||||
|
@ -1346,21 +1352,21 @@ case $os in
|
|||
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
|
||||
| -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
|
||||
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
|
||||
| -sym* | -kopensolaris* \
|
||||
| -sym* | -kopensolaris* | -plan9* \
|
||||
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
|
||||
| -aos* | -aros* \
|
||||
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
|
||||
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
|
||||
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
|
||||
| -openbsd* | -solidbsd* \
|
||||
| -bitrig* | -openbsd* | -solidbsd* \
|
||||
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
|
||||
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
|
||||
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
|
||||
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
|
||||
| -chorusos* | -chorusrdb* | -cegcc* \
|
||||
| -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
|
||||
| -mingw32* | -linux-gnu* | -linux-android* \
|
||||
| -linux-newlib* | -linux-uclibc* \
|
||||
| -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
|
||||
| -linux-newlib* | -linux-musl* | -linux-uclibc* \
|
||||
| -uxpv* | -beos* | -mpeix* | -udk* \
|
||||
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
|
||||
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
|
||||
|
@ -1492,9 +1498,6 @@ case $os in
|
|||
-aros*)
|
||||
os=-aros
|
||||
;;
|
||||
-kaos*)
|
||||
os=-kaos
|
||||
;;
|
||||
-zvmoe)
|
||||
os=-zvmoe
|
||||
;;
|
||||
|
@ -1543,6 +1546,9 @@ case $basic_machine in
|
|||
c4x-* | tic4x-*)
|
||||
os=-coff
|
||||
;;
|
||||
c8051-*)
|
||||
os=-elf
|
||||
;;
|
||||
hexagon-*)
|
||||
os=-elf
|
||||
;;
|
||||
|
@ -1586,6 +1592,9 @@ case $basic_machine in
|
|||
mips*-*)
|
||||
os=-elf
|
||||
;;
|
||||
or1k-*)
|
||||
os=-elf
|
||||
;;
|
||||
or32-*)
|
||||
os=-coff
|
||||
;;
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
dnl Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_PREREQ(2.61)
|
||||
AC_INIT
|
||||
AC_INIT([tinc], [1.1pre8])
|
||||
AC_CONFIG_SRCDIR([src/tincd.c])
|
||||
AC_GNU_SOURCE
|
||||
AM_INIT_AUTOMAKE(tinc, 1.1pre7)
|
||||
AM_INIT_AUTOMAKE([check-news std-options subdir-objects -Wall])
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
# Enable GNU extensions.
|
||||
# Define this here, not in acconfig's @TOP@ section, since definitions
|
||||
|
@ -21,51 +20,53 @@ AC_PROG_INSTALL
|
|||
AC_PROG_LN_S
|
||||
AC_PROG_RANLIB
|
||||
|
||||
AM_PROG_CC_C_O
|
||||
|
||||
dnl Check and set OS
|
||||
|
||||
AC_CANONICAL_HOST
|
||||
|
||||
case $host_os in
|
||||
*linux*)
|
||||
linux=true
|
||||
AC_DEFINE(HAVE_LINUX, 1, [Linux])
|
||||
[ rm -f src/device.c; ln -sf linux/device.c src/device.c ]
|
||||
;;
|
||||
*freebsd*)
|
||||
bsd=true
|
||||
AC_DEFINE(HAVE_FREEBSD, 1, [FreeBSD])
|
||||
[ rm -f src/device.c; ln -sf bsd/device.c src/device.c ]
|
||||
;;
|
||||
*darwin*)
|
||||
bsd=true
|
||||
AC_DEFINE(HAVE_DARWIN, 1, [Darwin (MacOS/X)])
|
||||
[ rm -f src/device.c; ln -sf bsd/device.c src/device.c ]
|
||||
;;
|
||||
*solaris*)
|
||||
solaris=true
|
||||
AC_DEFINE(HAVE_SOLARIS, 1, [Solaris/SunOS])
|
||||
[ rm -f src/device.c; ln -sf solaris/device.c src/device.c ]
|
||||
;;
|
||||
*openbsd*)
|
||||
bsd=true
|
||||
AC_DEFINE(HAVE_OPENBSD, 1, [OpenBSD])
|
||||
[ rm -f src/device.c; ln -sf bsd/device.c src/device.c ]
|
||||
;;
|
||||
*netbsd*)
|
||||
bsd=true
|
||||
AC_DEFINE(HAVE_NETBSD, 1, [NetBSD])
|
||||
[ rm -f src/device.c; ln -sf bsd/device.c src/device.c ]
|
||||
;;
|
||||
*dragonfly*)
|
||||
bsd=true
|
||||
AC_DEFINE(HAVE_DRAGONFLY, 1, [DragonFly])
|
||||
[ rm -f src/device.c; ln -sf bsd/device.c src/device.c ]
|
||||
;;
|
||||
*bsd*)
|
||||
bsd=true
|
||||
AC_MSG_WARN("Unknown BSD variant, tinc might not compile or work!")
|
||||
AC_DEFINE(HAVE_BSD, 1, [Unknown BSD variant])
|
||||
[ rm -f src/device.c; ln -sf bsd/device.c src/device.c ]
|
||||
;;
|
||||
*cygwin*)
|
||||
cygwin=true
|
||||
AC_DEFINE(HAVE_CYGWIN, 1, [Cygwin])
|
||||
[ rm -f src/device.c; ln -sf cygwin/device.c src/device.c ]
|
||||
;;
|
||||
*mingw*)
|
||||
mingw=true
|
||||
AC_DEFINE(HAVE_MINGW, 1, [MinGW])
|
||||
[ rm -f src/device.c; cp -f src/mingw/device.c src/device.c ]
|
||||
LIBS="$LIBS -lws2_32 -lgdi32 -lcrypt32"
|
||||
;;
|
||||
*)
|
||||
|
@ -114,6 +115,11 @@ AC_ARG_WITH(windows2000,
|
|||
]
|
||||
)
|
||||
|
||||
AM_CONDITIONAL(LINUX, test "$linux" = true)
|
||||
AM_CONDITIONAL(BSD, test "$bsd" = true)
|
||||
AM_CONDITIONAL(SOLARIS, test "$solaris" = true)
|
||||
AM_CONDITIONAL(MINGW, test "$mingw" = true)
|
||||
AM_CONDITIONAL(CYGWIN, test "$cygwin" = true)
|
||||
AM_CONDITIONAL(UML, test "$uml" = true)
|
||||
AM_CONDITIONAL(VDE, test "$vde" = true)
|
||||
AM_CONDITIONAL(TUNEMU, test "$tunemu" = true)
|
||||
|
@ -133,13 +139,13 @@ dnl We do this in multiple stages, because unlike Linux all the other operating
|
|||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS([stdbool.h syslog.h sys/file.h sys/ioctl.h sys/mman.h sys/param.h sys/resource.h sys/socket.h sys/time.h sys/uio.h sys/un.h sys/wait.h netdb.h arpa/inet.h dirent.h])
|
||||
AC_CHECK_HEADERS([net/if.h net/if_types.h linux/if_tun.h net/if_tun.h net/tun/if_tun.h net/if_tap.h net/tap/if_tap.h net/ethernet.h net/if_arp.h netinet/in_systm.h netinet/in.h netinet/in6.h time.h netpacket/packet.h],
|
||||
[], [], [#include "have.h"]
|
||||
[], [], [#include "src/have.h"]
|
||||
)
|
||||
AC_CHECK_HEADERS([netinet/if_ether.h netinet/ip.h netinet/ip6.h],
|
||||
[], [], [#include "have.h"]
|
||||
[], [], [#include "src/have.h"]
|
||||
)
|
||||
AC_CHECK_HEADERS([netinet/tcp.h netinet/ip_icmp.h netinet/icmp6.h],
|
||||
[], [], [#include "have.h"]
|
||||
[], [], [#include "src/have.h"]
|
||||
)
|
||||
|
||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||
|
@ -151,15 +157,16 @@ AC_HEADER_TIME
|
|||
AC_STRUCT_TM
|
||||
|
||||
tinc_ATTRIBUTE(__malloc__)
|
||||
tinc_ATTRIBUTE(__warn_unused_result__)
|
||||
|
||||
AC_CHECK_TYPES([socklen_t, struct ether_header, struct arphdr, struct ether_arp, struct in_addr, struct addrinfo, struct ip, struct icmp, struct in6_addr, struct sockaddr_in6, struct ip6_hdr, struct icmp6_hdr, struct nd_neighbor_solicit, struct nd_opt_hdr], , ,
|
||||
[#include "have.h"]
|
||||
[#include "src/have.h"]
|
||||
)
|
||||
|
||||
dnl Checks for library functions.
|
||||
AC_TYPE_SIGNAL
|
||||
AC_CHECK_FUNCS([asprintf daemon fchmod flock ftime fork get_current_dir_name gettimeofday mlockall putenv random select strdup strerror strsignal strtol system time usleep unsetenv vsyslog writev],
|
||||
[], [], [#include "have.h"]
|
||||
[], [], [#include "src/have.h"]
|
||||
)
|
||||
|
||||
dnl Support for SunOS
|
||||
|
@ -172,7 +179,7 @@ AC_CHECK_FUNC(gethostbyname, [], [
|
|||
])
|
||||
|
||||
AC_CHECK_DECLS([freeaddrinfo, gai_strerror, getaddrinfo, getnameinfo],
|
||||
[], [], [#include "have.h"]
|
||||
[], [], [#include "src/have.h"]
|
||||
)
|
||||
|
||||
AC_CACHE_SAVE
|
||||
|
@ -187,13 +194,15 @@ tinc_ZLIB
|
|||
tinc_LZO
|
||||
|
||||
if test "$with_libgcrypt" = yes; then
|
||||
gcrypt=true
|
||||
AM_PATH_LIBGCRYPT([1.4.0], [], [])
|
||||
ln -sf gcrypt/cipher.c gcrypt/cipher.h gcrypt/crypto.c gcrypt/crypto.h gcrypt/digest.c gcrypt/digest.h gcrypt/ecdh.c gcrypt/ecdh.h gcrypt/ecdsa.c gcrypt/ecdsa.h gcrypt/ecdsagen.c gcrypt/ecdsagen.h gcrypt/prf.c gcrypt/prf.h gcrypt/rsa.c gcrypt/rsa.h gcrypt/rsagen.c gcrypt/rsagen.h src/
|
||||
else
|
||||
openssl=true
|
||||
tinc_OPENSSL
|
||||
ln -sf openssl/cipher.c openssl/cipher.h openssl/crypto.c openssl/crypto.h openssl/digest.c openssl/digest.h openssl/ecdh.c openssl/ecdh.h openssl/ecdsa.c openssl/ecdsa.h openssl/ecdsagen.c openssl/ecdsagen.h openssl/prf.c openssl/prf.h openssl/rsa.c openssl/rsa.h openssl/rsagen.c openssl/rsagen.h src/
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(OPENSSL, test "$openssl" = true)
|
||||
AM_CONDITIONAL(GCRYPT, test "$grypt" = true)
|
||||
|
||||
dnl Check if support for jumbograms is requested
|
||||
AC_ARG_ENABLE(jumbograms,
|
||||
|
@ -203,8 +212,6 @@ AC_ARG_ENABLE(jumbograms,
|
|||
]
|
||||
)
|
||||
|
||||
AC_SUBST(INCLUDES)
|
||||
|
||||
AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile m4/Makefile gui/Makefile])
|
||||
|
||||
AC_OUTPUT
|
12
debian/changelog
vendored
12
debian/changelog
vendored
|
@ -1,3 +1,15 @@
|
|||
tinc (1.1~pre8-1) experimental; urgency=low
|
||||
|
||||
* New upstream release.
|
||||
- Handles whitespace between command line flags and optional arguments.
|
||||
Closes: #710267
|
||||
* Bump Standards-Version.
|
||||
* Source /lib/lsb/init-functions in the init.d script.
|
||||
* Don't use texi2html anymore, use automake's install-html target which uses
|
||||
makeinfo.
|
||||
|
||||
-- Guus Sliepen <guus@debian.org> Wed, 14 Aug 2013 15:34:41 +0200
|
||||
|
||||
tinc (1.1~pre7-2) experimental; urgency=low
|
||||
|
||||
[ Gian Piero Carrubba ]
|
||||
|
|
4
debian/control
vendored
4
debian/control
vendored
|
@ -2,8 +2,8 @@ Source: tinc
|
|||
Section: net
|
||||
Priority: optional
|
||||
Maintainer: Guus Sliepen <guus@debian.org>
|
||||
Standards-Version: 3.9.3
|
||||
Build-Depends: libssl-dev (>>1.0.0), debhelper (>= 9), texi2html, texinfo, zlib1g-dev, liblzo2-dev, libncurses5-dev, libreadline-dev, libvdeplug-dev
|
||||
Standards-Version: 3.9.4
|
||||
Build-Depends: libssl-dev (>>1.0.0), debhelper (>= 9), texinfo, zlib1g-dev, liblzo2-dev, libncurses5-dev, libreadline-dev, libvdeplug-dev
|
||||
Homepage: http://www.tinc-vpn.org/
|
||||
|
||||
Package: tinc
|
||||
|
|
4
debian/doc-base.tinc
vendored
4
debian/doc-base.tinc
vendored
|
@ -6,5 +6,5 @@ Abstract: This manual describes how to set up a Virtual Private
|
|||
Section: System/Security
|
||||
|
||||
Format: HTML
|
||||
Files: /usr/share/doc/tinc/tinc*.html
|
||||
Index: /usr/share/doc/tinc/tinc_toc.html
|
||||
Files: /usr/share/doc/tinc/tinc.html/*
|
||||
Index: /usr/share/doc/tinc/tinc.html/index.html
|
||||
|
|
15
debian/rules
vendored
15
debian/rules
vendored
|
@ -17,23 +17,10 @@
|
|||
override_dh_auto_configure:
|
||||
dh_auto_configure -- --enable-uml --enable-vde
|
||||
|
||||
override_dh_auto_build:
|
||||
dh_auto_build
|
||||
cd doc && $(MAKE) texi2html
|
||||
|
||||
override_dh_auto_install:
|
||||
dh_auto_install
|
||||
# Guess where texi2html installed its output today...
|
||||
[ -f doc/tinc/tinc.html ] \
|
||||
&& mv doc/tinc/*.html debian/tinc/usr/share/doc/tinc/ \
|
||||
|| mv doc/*.html debian/tinc/usr/share/doc/tinc/
|
||||
dh_auto_install -- install-html
|
||||
# Remove info dir file
|
||||
rm -f debian/tinc/usr/share/info/dir
|
||||
|
||||
override_dh_installinit:
|
||||
dh_installinit -R
|
||||
|
||||
override_dh_clean:
|
||||
dh_clean
|
||||
rm -f src/device.c
|
||||
rm -f src/rsa.[ch] src/rsagen.[ch] src/prf.[ch] src/ecdh.[ch] src/ecdsa.[ch] src/ecdsagen.[ch] src/digest.[ch] src/crypto.[ch] src/cipher.[ch]
|
||||
|
|
2
debian/tinc.init
vendored
2
debian/tinc.init
vendored
|
@ -18,6 +18,8 @@
|
|||
#
|
||||
# Based on Lubomir Bulej's Redhat init script.
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
DAEMON="/usr/sbin/tincd"
|
||||
CONTROL="/usr/sbin/tinc"
|
||||
NAME="tinc"
|
||||
|
|
1
debian/tinc.install
vendored
1
debian/tinc.install
vendored
|
@ -1,5 +1,6 @@
|
|||
usr/sbin/tincd
|
||||
usr/sbin/tinc
|
||||
usr/share/doc/tinc/tinc.html
|
||||
usr/share/man/man5
|
||||
usr/share/man/man8/tincd.*
|
||||
usr/share/man/man8/tinc.*
|
||||
|
|
457
depcomp
457
depcomp
|
@ -1,10 +1,9 @@
|
|||
#! /bin/sh
|
||||
# depcomp - compile a program generating dependencies as side-effects
|
||||
|
||||
scriptversion=2012-03-27.16; # UTC
|
||||
scriptversion=2013-05-30.07; # UTC
|
||||
|
||||
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010,
|
||||
# 2011, 2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1999-2013 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
@ -28,9 +27,9 @@ scriptversion=2012-03-27.16; # UTC
|
|||
|
||||
case $1 in
|
||||
'')
|
||||
echo "$0: No command. Try '$0 --help' for more information." 1>&2
|
||||
exit 1;
|
||||
;;
|
||||
echo "$0: No command. Try '$0 --help' for more information." 1>&2
|
||||
exit 1;
|
||||
;;
|
||||
-h | --h*)
|
||||
cat <<\EOF
|
||||
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
|
||||
|
@ -57,11 +56,65 @@ EOF
|
|||
;;
|
||||
esac
|
||||
|
||||
# Get the directory component of the given path, and save it in the
|
||||
# global variables '$dir'. Note that this directory component will
|
||||
# be either empty or ending with a '/' character. This is deliberate.
|
||||
set_dir_from ()
|
||||
{
|
||||
case $1 in
|
||||
*/*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
|
||||
*) dir=;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Get the suffix-stripped basename of the given path, and save it the
|
||||
# global variable '$base'.
|
||||
set_base_from ()
|
||||
{
|
||||
base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
|
||||
}
|
||||
|
||||
# If no dependency file was actually created by the compiler invocation,
|
||||
# we still have to create a dummy depfile, to avoid errors with the
|
||||
# Makefile "include basename.Plo" scheme.
|
||||
make_dummy_depfile ()
|
||||
{
|
||||
echo "#dummy" > "$depfile"
|
||||
}
|
||||
|
||||
# Factor out some common post-processing of the generated depfile.
|
||||
# Requires the auxiliary global variable '$tmpdepfile' to be set.
|
||||
aix_post_process_depfile ()
|
||||
{
|
||||
# If the compiler actually managed to produce a dependency file,
|
||||
# post-process it.
|
||||
if test -f "$tmpdepfile"; then
|
||||
# Each line is of the form 'foo.o: dependency.h'.
|
||||
# Do two passes, one to just change these to
|
||||
# $object: dependency.h
|
||||
# and one to simply output
|
||||
# dependency.h:
|
||||
# which is needed to avoid the deleted-header problem.
|
||||
{ sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
|
||||
sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
|
||||
} > "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
else
|
||||
make_dummy_depfile
|
||||
fi
|
||||
}
|
||||
|
||||
# A tabulation character.
|
||||
tab=' '
|
||||
# A newline character.
|
||||
nl='
|
||||
'
|
||||
# Character ranges might be problematic outside the C locale.
|
||||
# These definitions help.
|
||||
upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
|
||||
lower=abcdefghijklmnopqrstuvwxyz
|
||||
digits=0123456789
|
||||
alpha=${upper}${lower}
|
||||
|
||||
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
|
||||
echo "depcomp: Variables source, object and depmode must be set" 1>&2
|
||||
|
@ -75,6 +128,9 @@ tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
|
|||
|
||||
rm -f "$tmpdepfile"
|
||||
|
||||
# Avoid interferences from the environment.
|
||||
gccflag= dashmflag=
|
||||
|
||||
# Some modes work just like other modes, but use different flags. We
|
||||
# parameterize here, but still list the modes in the big case below,
|
||||
# to make depend.m4 easier to write. Note that we *cannot* use a case
|
||||
|
@ -86,32 +142,32 @@ if test "$depmode" = hp; then
|
|||
fi
|
||||
|
||||
if test "$depmode" = dashXmstdout; then
|
||||
# This is just like dashmstdout with a different argument.
|
||||
dashmflag=-xM
|
||||
depmode=dashmstdout
|
||||
# This is just like dashmstdout with a different argument.
|
||||
dashmflag=-xM
|
||||
depmode=dashmstdout
|
||||
fi
|
||||
|
||||
cygpath_u="cygpath -u -f -"
|
||||
if test "$depmode" = msvcmsys; then
|
||||
# This is just like msvisualcpp but w/o cygpath translation.
|
||||
# Just convert the backslash-escaped backslashes to single forward
|
||||
# slashes to satisfy depend.m4
|
||||
cygpath_u='sed s,\\\\,/,g'
|
||||
depmode=msvisualcpp
|
||||
# This is just like msvisualcpp but w/o cygpath translation.
|
||||
# Just convert the backslash-escaped backslashes to single forward
|
||||
# slashes to satisfy depend.m4
|
||||
cygpath_u='sed s,\\\\,/,g'
|
||||
depmode=msvisualcpp
|
||||
fi
|
||||
|
||||
if test "$depmode" = msvc7msys; then
|
||||
# This is just like msvc7 but w/o cygpath translation.
|
||||
# Just convert the backslash-escaped backslashes to single forward
|
||||
# slashes to satisfy depend.m4
|
||||
cygpath_u='sed s,\\\\,/,g'
|
||||
depmode=msvc7
|
||||
# This is just like msvc7 but w/o cygpath translation.
|
||||
# Just convert the backslash-escaped backslashes to single forward
|
||||
# slashes to satisfy depend.m4
|
||||
cygpath_u='sed s,\\\\,/,g'
|
||||
depmode=msvc7
|
||||
fi
|
||||
|
||||
if test "$depmode" = xlc; then
|
||||
# IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations.
|
||||
gccflag=-qmakedep=gcc,-MF
|
||||
depmode=gcc
|
||||
# IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
|
||||
gccflag=-qmakedep=gcc,-MF
|
||||
depmode=gcc
|
||||
fi
|
||||
|
||||
case "$depmode" in
|
||||
|
@ -134,8 +190,7 @@ gcc3)
|
|||
done
|
||||
"$@"
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
|
@ -143,13 +198,17 @@ gcc3)
|
|||
;;
|
||||
|
||||
gcc)
|
||||
## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
|
||||
## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
|
||||
## (see the conditional assignment to $gccflag above).
|
||||
## There are various ways to get dependency output from gcc. Here's
|
||||
## why we pick this rather obscure method:
|
||||
## - Don't want to use -MD because we'd like the dependencies to end
|
||||
## up in a subdir. Having to rename by hand is ugly.
|
||||
## (We might end up doing this anyway to support other compilers.)
|
||||
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
|
||||
## -MM, not -M (despite what the docs say).
|
||||
## -MM, not -M (despite what the docs say). Also, it might not be
|
||||
## supported by the other compilers which use the 'gcc' depmode.
|
||||
## - Using -M directly means running the compiler twice (even worse
|
||||
## than renaming).
|
||||
if test -z "$gccflag"; then
|
||||
|
@ -157,15 +216,14 @@ gcc)
|
|||
fi
|
||||
"$@" -Wp,"$gccflag$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
|
||||
## The second -e expression handles DOS-style file names with drive letters.
|
||||
# The second -e expression handles DOS-style file names with drive
|
||||
# letters.
|
||||
sed -e 's/^[^:]*: / /' \
|
||||
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
|
||||
## This next piece of magic avoids the "deleted header file" problem.
|
||||
|
@ -174,15 +232,15 @@ gcc)
|
|||
## typically no way to rebuild the header). We avoid this by adding
|
||||
## dummy dependencies for each header file. Too bad gcc doesn't do
|
||||
## this for us directly.
|
||||
tr ' ' "$nl" < "$tmpdepfile" |
|
||||
## Some versions of gcc put a space before the ':'. On the theory
|
||||
## that the space means something, we add a space to the output as
|
||||
## well. hp depmode also adds that space, but also prefixes the VPATH
|
||||
## to the object. Take care to not repeat it in the output.
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
|
||||
| sed -e 's/$/ :/' >> "$depfile"
|
||||
tr ' ' "$nl" < "$tmpdepfile" \
|
||||
| sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
|
||||
| sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
|
@ -200,8 +258,7 @@ sgi)
|
|||
"$@" -MDupdate "$tmpdepfile"
|
||||
fi
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
|
@ -209,7 +266,6 @@ sgi)
|
|||
|
||||
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
|
||||
echo "$object : \\" > "$depfile"
|
||||
|
||||
# Clip off the initial element (the dependent). Don't try to be
|
||||
# clever and replace this with sed code, as IRIX sed won't handle
|
||||
# lines with more than a fixed number of characters (4096 in
|
||||
|
@ -217,19 +273,15 @@ sgi)
|
|||
# the IRIX cc adds comments like '#:fec' to the end of the
|
||||
# dependency line.
|
||||
tr ' ' "$nl" < "$tmpdepfile" \
|
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
|
||||
tr "$nl" ' ' >> "$depfile"
|
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
|
||||
| tr "$nl" ' ' >> "$depfile"
|
||||
echo >> "$depfile"
|
||||
|
||||
# The second pass generates a dummy entry for each header file.
|
||||
tr ' ' "$nl" < "$tmpdepfile" \
|
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
|
||||
>> "$depfile"
|
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
|
||||
>> "$depfile"
|
||||
else
|
||||
# The sourcefile does not contain any dependencies, so just
|
||||
# store a dummy comment line, to avoid errors with the Makefile
|
||||
# "include basename.Plo" scheme.
|
||||
echo "#dummy" > "$depfile"
|
||||
make_dummy_depfile
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
@ -247,9 +299,8 @@ aix)
|
|||
# current directory. Also, the AIX compiler puts '$object:' at the
|
||||
# start of each line; $object doesn't have directory information.
|
||||
# Version 6 uses the directory in both cases.
|
||||
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
|
||||
test "x$dir" = "x$object" && dir=
|
||||
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
|
||||
set_dir_from "$object"
|
||||
set_base_from "$object"
|
||||
if test "$libtool" = yes; then
|
||||
tmpdepfile1=$dir$base.u
|
||||
tmpdepfile2=$base.u
|
||||
|
@ -262,9 +313,7 @@ aix)
|
|||
"$@" -M
|
||||
fi
|
||||
stat=$?
|
||||
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
||||
exit $stat
|
||||
fi
|
||||
|
@ -273,65 +322,113 @@ aix)
|
|||
do
|
||||
test -f "$tmpdepfile" && break
|
||||
done
|
||||
if test -f "$tmpdepfile"; then
|
||||
# Each line is of the form 'foo.o: dependent.h'.
|
||||
# Do two passes, one to just change these to
|
||||
# '$object: dependent.h' and one to simply 'dependent.h:'.
|
||||
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
|
||||
sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
# The sourcefile does not contain any dependencies, so just
|
||||
# store a dummy comment line, to avoid errors with the Makefile
|
||||
# "include basename.Plo" scheme.
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
aix_post_process_depfile
|
||||
;;
|
||||
|
||||
icc)
|
||||
# Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'.
|
||||
# However on
|
||||
# $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c
|
||||
# ICC 7.0 will fill foo.d with something like
|
||||
# foo.o: sub/foo.c
|
||||
# foo.o: sub/foo.h
|
||||
# which is wrong. We want
|
||||
# sub/foo.o: sub/foo.c
|
||||
# sub/foo.o: sub/foo.h
|
||||
# sub/foo.c:
|
||||
# sub/foo.h:
|
||||
# ICC 7.1 will output
|
||||
# foo.o: sub/foo.c sub/foo.h
|
||||
# and will wrap long lines using '\':
|
||||
# foo.o: sub/foo.c ... \
|
||||
# sub/foo.h ... \
|
||||
# ...
|
||||
# tcc 0.9.26 (FIXME still under development at the moment of writing)
|
||||
# will emit a similar output, but also prepend the continuation lines
|
||||
# with horizontal tabulation characters.
|
||||
tcc)
|
||||
# tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
|
||||
# FIXME: That version still under development at the moment of writing.
|
||||
# Make that this statement remains true also for stable, released
|
||||
# versions.
|
||||
# It will wrap lines (doesn't matter whether long or short) with a
|
||||
# trailing '\', as in:
|
||||
#
|
||||
# foo.o : \
|
||||
# foo.c \
|
||||
# foo.h \
|
||||
#
|
||||
# It will put a trailing '\' even on the last line, and will use leading
|
||||
# spaces rather than leading tabs (at least since its commit 0394caf7
|
||||
# "Emit spaces for -MD").
|
||||
"$@" -MD -MF "$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
# Each line is of the form 'foo.o: dependent.h',
|
||||
# or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'.
|
||||
# Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
|
||||
# We have to change lines of the first kind to '$object: \'.
|
||||
sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
|
||||
# And for each line of the second kind, we have to emit a 'dep.h:'
|
||||
# dummy dependency, to avoid the deleted-header problem.
|
||||
sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
## The order of this option in the case statement is important, since the
|
||||
## shell code in configure will try each of these formats in the order
|
||||
## listed in this file. A plain '-MD' option would be understood by many
|
||||
## compilers, so we must ensure this comes after the gcc and icc options.
|
||||
pgcc)
|
||||
# Portland's C compiler understands '-MD'.
|
||||
# Will always output deps to 'file.d' where file is the root name of the
|
||||
# source file under compilation, even if file resides in a subdirectory.
|
||||
# The object file name does not affect the name of the '.d' file.
|
||||
# pgcc 10.2 will output
|
||||
# foo.o: sub/foo.c sub/foo.h
|
||||
# and will wrap long lines using '\' :
|
||||
# foo.o: sub/foo.c ... \
|
||||
# sub/foo.h ... \
|
||||
# ...
|
||||
set_dir_from "$object"
|
||||
# Use the source, not the object, to determine the base name, since
|
||||
# that's sadly what pgcc will do too.
|
||||
set_base_from "$source"
|
||||
tmpdepfile=$base.d
|
||||
|
||||
# For projects that build the same source file twice into different object
|
||||
# files, the pgcc approach of using the *source* file root name can cause
|
||||
# problems in parallel builds. Use a locking strategy to avoid stomping on
|
||||
# the same $tmpdepfile.
|
||||
lockdir=$base.d-lock
|
||||
trap "
|
||||
echo '$0: caught signal, cleaning up...' >&2
|
||||
rmdir '$lockdir'
|
||||
exit 1
|
||||
" 1 2 13 15
|
||||
numtries=100
|
||||
i=$numtries
|
||||
while test $i -gt 0; do
|
||||
# mkdir is a portable test-and-set.
|
||||
if mkdir "$lockdir" 2>/dev/null; then
|
||||
# This process acquired the lock.
|
||||
"$@" -MD
|
||||
stat=$?
|
||||
# Release the lock.
|
||||
rmdir "$lockdir"
|
||||
break
|
||||
else
|
||||
# If the lock is being held by a different process, wait
|
||||
# until the winning process is done or we timeout.
|
||||
while test -d "$lockdir" && test $i -gt 0; do
|
||||
sleep 1
|
||||
i=`expr $i - 1`
|
||||
done
|
||||
fi
|
||||
i=`expr $i - 1`
|
||||
done
|
||||
trap - 1 2 13 15
|
||||
if test $i -le 0; then
|
||||
echo "$0: failed to acquire lock after $numtries attempts" >&2
|
||||
echo "$0: check lockdir '$lockdir'" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
# Each line is of the form `foo.o: dependent.h',
|
||||
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
|
||||
# Do two passes, one to just change these to
|
||||
# '$object: dependent.h' and one to simply 'dependent.h:'.
|
||||
sed -e "s/^[ $tab][ $tab]*/ /" -e "s,^[^:]*:,$object :," \
|
||||
< "$tmpdepfile" > "$depfile"
|
||||
sed '
|
||||
s/[ '"$tab"'][ '"$tab"']*/ /g
|
||||
s/^ *//
|
||||
s/ *\\*$//
|
||||
s/^[^:]*: *//
|
||||
/^$/d
|
||||
/:$/d
|
||||
s/$/ :/
|
||||
' < "$tmpdepfile" >> "$depfile"
|
||||
# `$object: dependent.h' and one to simply `dependent.h:'.
|
||||
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
|
||||
# Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
# correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
|
||||
| sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
|
@ -342,9 +439,8 @@ hp2)
|
|||
# 'foo.d', which lands next to the object file, wherever that
|
||||
# happens to be.
|
||||
# Much of this is similar to the tru64 case; see comments there.
|
||||
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
|
||||
test "x$dir" = "x$object" && dir=
|
||||
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
|
||||
set_dir_from "$object"
|
||||
set_base_from "$object"
|
||||
if test "$libtool" = yes; then
|
||||
tmpdepfile1=$dir$base.d
|
||||
tmpdepfile2=$dir.libs/$base.d
|
||||
|
@ -355,8 +451,7 @@ hp2)
|
|||
"$@" +Maked
|
||||
fi
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile1" "$tmpdepfile2"
|
||||
exit $stat
|
||||
fi
|
||||
|
@ -366,76 +461,61 @@ hp2)
|
|||
test -f "$tmpdepfile" && break
|
||||
done
|
||||
if test -f "$tmpdepfile"; then
|
||||
sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
|
||||
sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
|
||||
# Add 'dependent.h:' lines.
|
||||
sed -ne '2,${
|
||||
s/^ *//
|
||||
s/ \\*$//
|
||||
s/$/:/
|
||||
p
|
||||
}' "$tmpdepfile" >> "$depfile"
|
||||
s/^ *//
|
||||
s/ \\*$//
|
||||
s/$/:/
|
||||
p
|
||||
}' "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
echo "#dummy" > "$depfile"
|
||||
make_dummy_depfile
|
||||
fi
|
||||
rm -f "$tmpdepfile" "$tmpdepfile2"
|
||||
;;
|
||||
|
||||
tru64)
|
||||
# The Tru64 compiler uses -MD to generate dependencies as a side
|
||||
# effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
|
||||
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
|
||||
# dependencies in 'foo.d' instead, so we check for that too.
|
||||
# Subdirectories are respected.
|
||||
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
|
||||
test "x$dir" = "x$object" && dir=
|
||||
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
|
||||
# The Tru64 compiler uses -MD to generate dependencies as a side
|
||||
# effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
|
||||
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
|
||||
# dependencies in 'foo.d' instead, so we check for that too.
|
||||
# Subdirectories are respected.
|
||||
set_dir_from "$object"
|
||||
set_base_from "$object"
|
||||
|
||||
if test "$libtool" = yes; then
|
||||
# With Tru64 cc, shared objects can also be used to make a
|
||||
# static library. This mechanism is used in libtool 1.4 series to
|
||||
# handle both shared and static libraries in a single compilation.
|
||||
# With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
|
||||
#
|
||||
# With libtool 1.5 this exception was removed, and libtool now
|
||||
# generates 2 separate objects for the 2 libraries. These two
|
||||
# compilations output dependencies in $dir.libs/$base.o.d and
|
||||
# in $dir$base.o.d. We have to check for both files, because
|
||||
# one of the two compilations can be disabled. We should prefer
|
||||
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
|
||||
# automatically cleaned when .libs/ is deleted, while ignoring
|
||||
# the former would cause a distcleancheck panic.
|
||||
tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
|
||||
tmpdepfile2=$dir$base.o.d # libtool 1.5
|
||||
tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
|
||||
tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
|
||||
"$@" -Wc,-MD
|
||||
else
|
||||
tmpdepfile1=$dir$base.o.d
|
||||
tmpdepfile2=$dir$base.d
|
||||
tmpdepfile3=$dir$base.d
|
||||
tmpdepfile4=$dir$base.d
|
||||
"$@" -MD
|
||||
fi
|
||||
if test "$libtool" = yes; then
|
||||
# Libtool generates 2 separate objects for the 2 libraries. These
|
||||
# two compilations output dependencies in $dir.libs/$base.o.d and
|
||||
# in $dir$base.o.d. We have to check for both files, because
|
||||
# one of the two compilations can be disabled. We should prefer
|
||||
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
|
||||
# automatically cleaned when .libs/ is deleted, while ignoring
|
||||
# the former would cause a distcleancheck panic.
|
||||
tmpdepfile1=$dir$base.o.d # libtool 1.5
|
||||
tmpdepfile2=$dir.libs/$base.o.d # Likewise.
|
||||
tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504
|
||||
"$@" -Wc,-MD
|
||||
else
|
||||
tmpdepfile1=$dir$base.d
|
||||
tmpdepfile2=$dir$base.d
|
||||
tmpdepfile3=$dir$base.d
|
||||
"$@" -MD
|
||||
fi
|
||||
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
|
||||
exit $stat
|
||||
fi
|
||||
stat=$?
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
|
||||
do
|
||||
test -f "$tmpdepfile" && break
|
||||
done
|
||||
if test -f "$tmpdepfile"; then
|
||||
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
|
||||
sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
||||
do
|
||||
test -f "$tmpdepfile" && break
|
||||
done
|
||||
# Same post-processing that is required for AIX mode.
|
||||
aix_post_process_depfile
|
||||
;;
|
||||
|
||||
msvc7)
|
||||
if test "$libtool" = yes; then
|
||||
|
@ -446,8 +526,7 @@ msvc7)
|
|||
"$@" $showIncludes > "$tmpdepfile"
|
||||
stat=$?
|
||||
grep -v '^Note: including file: ' "$tmpdepfile"
|
||||
if test "$stat" = 0; then :
|
||||
else
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
|
@ -473,6 +552,7 @@ $ {
|
|||
G
|
||||
p
|
||||
}' >> "$depfile"
|
||||
echo >> "$depfile" # make sure the fragment doesn't end with a backslash
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
|
@ -524,13 +604,14 @@ dashmstdout)
|
|||
# in the target name. This is to cope with DOS-style filenames:
|
||||
# a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
|
||||
"$@" $dashmflag |
|
||||
sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile"
|
||||
sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
cat < "$tmpdepfile" > "$depfile"
|
||||
tr ' ' "$nl" < "$tmpdepfile" | \
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||
# Some versions of the HPUX 10.20 sed can't process this sed invocation
|
||||
# correctly. Breaking it into two sed invocations is a workaround.
|
||||
tr ' ' "$nl" < "$tmpdepfile" \
|
||||
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
|
||||
| sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
|
@ -583,10 +664,12 @@ makedepend)
|
|||
# makedepend may prepend the VPATH from the source file name to the object.
|
||||
# No need to regex-escape $object, excess matching of '.' is harmless.
|
||||
sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
|
||||
sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||
# Some versions of the HPUX 10.20 sed can't process the last invocation
|
||||
# correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed '1,2d' "$tmpdepfile" \
|
||||
| tr ' ' "$nl" \
|
||||
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
|
||||
| sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile" "$tmpdepfile".bak
|
||||
;;
|
||||
|
||||
|
@ -622,10 +705,10 @@ cpp)
|
|||
esac
|
||||
done
|
||||
|
||||
"$@" -E |
|
||||
sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
|
||||
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
|
||||
sed '$ s: \\$::' > "$tmpdepfile"
|
||||
"$@" -E \
|
||||
| sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
|
||||
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
|
||||
| sed '$ s: \\$::' > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
cat < "$tmpdepfile" >> "$depfile"
|
||||
|
@ -657,15 +740,15 @@ msvisualcpp)
|
|||
shift
|
||||
;;
|
||||
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
|
||||
set fnord "$@"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
set fnord "$@"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
set fnord "$@" "$arg"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
done
|
||||
"$@" -E 2>/dev/null |
|
||||
|
|
188
doc/Makefile.in
188
doc/Makefile.in
|
@ -1,9 +1,8 @@
|
|||
# Makefile.in generated by automake 1.11.6 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.13.3 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
|
||||
# Foundation, Inc.
|
||||
# Copyright (C) 1994-2013 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.
|
||||
|
@ -15,23 +14,51 @@
|
|||
|
||||
@SET_MAKE@
|
||||
VPATH = @srcdir@
|
||||
am__make_dryrun = \
|
||||
{ \
|
||||
am__dry=no; \
|
||||
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
|
||||
am__make_running_with_option = \
|
||||
case $${target_option-} in \
|
||||
?) ;; \
|
||||
*) echo "am__make_running_with_option: internal error: invalid" \
|
||||
"target option '$${target_option-}' specified" >&2; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
has_opt=no; \
|
||||
sane_makeflags=$$MAKEFLAGS; \
|
||||
if $(am__is_gnu_make); then \
|
||||
sane_makeflags=$$MFLAGS; \
|
||||
else \
|
||||
case $$MAKEFLAGS in \
|
||||
*\\[\ \ ]*) \
|
||||
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
|
||||
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
|
||||
*) \
|
||||
for am__flg in $$MAKEFLAGS; do \
|
||||
case $$am__flg in \
|
||||
*=*|--*) ;; \
|
||||
*n*) am__dry=yes; break;; \
|
||||
esac; \
|
||||
done;; \
|
||||
bs=\\; \
|
||||
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
|
||||
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
|
||||
esac; \
|
||||
test $$am__dry = yes; \
|
||||
}
|
||||
fi; \
|
||||
skip_next=no; \
|
||||
strip_trailopt () \
|
||||
{ \
|
||||
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
|
||||
}; \
|
||||
for flg in $$sane_makeflags; do \
|
||||
test $$skip_next = yes && { skip_next=no; continue; }; \
|
||||
case $$flg in \
|
||||
*=*|--*) continue;; \
|
||||
-*I) strip_trailopt 'I'; skip_next=yes;; \
|
||||
-*I?*) strip_trailopt 'I';; \
|
||||
-*O) strip_trailopt 'O'; skip_next=yes;; \
|
||||
-*O?*) strip_trailopt 'O';; \
|
||||
-*l) strip_trailopt 'l'; skip_next=yes;; \
|
||||
-*l?*) strip_trailopt 'l';; \
|
||||
-[dEDm]) skip_next=yes;; \
|
||||
-[JT]) skip_next=yes;; \
|
||||
esac; \
|
||||
case $$flg in \
|
||||
*$$target_option*) has_opt=yes; break;; \
|
||||
esac; \
|
||||
done; \
|
||||
test $$has_opt = yes
|
||||
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
|
||||
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
|
@ -50,20 +77,60 @@ POST_UNINSTALL = :
|
|||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
subdir = doc
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in texinfo.tex
|
||||
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am texinfo.tex
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/attribute.m4 \
|
||||
$(top_srcdir)/m4/curses.m4 $(top_srcdir)/m4/lzo.m4 \
|
||||
$(top_srcdir)/m4/openssl.m4 $(top_srcdir)/m4/readline.m4 \
|
||||
$(top_srcdir)/m4/zlib.m4 $(top_srcdir)/configure.in
|
||||
$(top_srcdir)/m4/zlib.m4 $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
AM_V_P = $(am__v_P_@AM_V@)
|
||||
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
|
||||
am__v_P_0 = false
|
||||
am__v_P_1 = :
|
||||
AM_V_GEN = $(am__v_GEN_@AM_V@)
|
||||
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
|
||||
am__v_GEN_0 = @echo " GEN " $@;
|
||||
am__v_GEN_1 =
|
||||
AM_V_at = $(am__v_at_@AM_V@)
|
||||
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
||||
am__v_at_0 = @
|
||||
am__v_at_1 =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
AM_V_DVIPS = $(am__v_DVIPS_@AM_V@)
|
||||
am__v_DVIPS_ = $(am__v_DVIPS_@AM_DEFAULT_V@)
|
||||
am__v_DVIPS_0 = @echo " DVIPS " $@;
|
||||
am__v_DVIPS_1 =
|
||||
AM_V_MAKEINFO = $(am__v_MAKEINFO_@AM_V@)
|
||||
am__v_MAKEINFO_ = $(am__v_MAKEINFO_@AM_DEFAULT_V@)
|
||||
am__v_MAKEINFO_0 = @echo " MAKEINFO" $@;
|
||||
am__v_MAKEINFO_1 =
|
||||
AM_V_INFOHTML = $(am__v_INFOHTML_@AM_V@)
|
||||
am__v_INFOHTML_ = $(am__v_INFOHTML_@AM_DEFAULT_V@)
|
||||
am__v_INFOHTML_0 = @echo " INFOHTML" $@;
|
||||
am__v_INFOHTML_1 =
|
||||
AM_V_TEXI2DVI = $(am__v_TEXI2DVI_@AM_V@)
|
||||
am__v_TEXI2DVI_ = $(am__v_TEXI2DVI_@AM_DEFAULT_V@)
|
||||
am__v_TEXI2DVI_0 = @echo " TEXI2DVI" $@;
|
||||
am__v_TEXI2DVI_1 =
|
||||
AM_V_TEXI2PDF = $(am__v_TEXI2PDF_@AM_V@)
|
||||
am__v_TEXI2PDF_ = $(am__v_TEXI2PDF_@AM_DEFAULT_V@)
|
||||
am__v_TEXI2PDF_0 = @echo " TEXI2PDF" $@;
|
||||
am__v_TEXI2PDF_1 =
|
||||
AM_V_texinfo = $(am__v_texinfo_@AM_V@)
|
||||
am__v_texinfo_ = $(am__v_texinfo_@AM_DEFAULT_V@)
|
||||
am__v_texinfo_0 = -q
|
||||
am__v_texinfo_1 =
|
||||
AM_V_texidevnull = $(am__v_texidevnull_@AM_V@)
|
||||
am__v_texidevnull_ = $(am__v_texidevnull_@AM_DEFAULT_V@)
|
||||
am__v_texidevnull_0 = > /dev/null
|
||||
am__v_texidevnull_1 =
|
||||
INFO_DEPS = tinc.info
|
||||
am__TEXINFO_TEX_DIR = $(srcdir)
|
||||
DVIS = tinc.dvi
|
||||
|
@ -114,6 +181,7 @@ man5dir = $(mandir)/man5
|
|||
man8dir = $(mandir)/man8
|
||||
NROFF = nroff
|
||||
MANS = $(man_MANS)
|
||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
# Use `ginstall' in the definition of man_MANS to avoid
|
||||
|
@ -122,6 +190,7 @@ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
|||
transform = s/ginstall/install/; @program_transform_name@
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
|
@ -141,7 +210,6 @@ ECHO_T = @ECHO_T@
|
|||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
GREP = @GREP@
|
||||
INCLUDES = @INCLUDES@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
|
@ -155,7 +223,6 @@ LIBOBJS = @LIBOBJS@
|
|||
LIBS = @LIBS@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
OBJEXT = @OBJEXT@
|
||||
|
@ -237,7 +304,7 @@ all: all-am
|
|||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .dvi .ps
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
|
@ -262,14 +329,14 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
|||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
|
||||
tinc.info: tinc.texi
|
||||
restore=: && backupdir="$(am__leading_dot)am$$$$" && \
|
||||
$(AM_V_MAKEINFO)restore=: && backupdir="$(am__leading_dot)am$$$$" && \
|
||||
rm -rf $$backupdir && mkdir $$backupdir && \
|
||||
if ($(MAKEINFO) --version) >/dev/null 2>&1; then \
|
||||
for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \
|
||||
|
@ -287,18 +354,20 @@ tinc.info: tinc.texi
|
|||
rm -rf $$backupdir; exit $$rc
|
||||
|
||||
tinc.dvi: tinc.texi
|
||||
TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
|
||||
$(AM_V_TEXI2DVI)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
|
||||
MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
|
||||
$(TEXI2DVI) -o $@ `test -f 'tinc.texi' || echo '$(srcdir)/'`tinc.texi
|
||||
$(TEXI2DVI) $(AM_V_texinfo) --build-dir=$(@:.dvi=.t2d) -o $@ $(AM_V_texidevnull) \
|
||||
`test -f 'tinc.texi' || echo '$(srcdir)/'`tinc.texi
|
||||
|
||||
tinc.pdf: tinc.texi
|
||||
TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
|
||||
$(AM_V_TEXI2PDF)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
|
||||
MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
|
||||
$(TEXI2PDF) -o $@ `test -f 'tinc.texi' || echo '$(srcdir)/'`tinc.texi
|
||||
$(TEXI2PDF) $(AM_V_texinfo) --build-dir=$(@:.pdf=.t2p) -o $@ $(AM_V_texidevnull) \
|
||||
`test -f 'tinc.texi' || echo '$(srcdir)/'`tinc.texi
|
||||
|
||||
tinc.html: tinc.texi
|
||||
rm -rf $(@:.html=.htp)
|
||||
if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
|
||||
$(AM_V_MAKEINFO)rm -rf $(@:.html=.htp)
|
||||
$(AM_V_at)if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
|
||||
-o $(@:.html=.htp) `test -f 'tinc.texi' || echo '$(srcdir)/'`tinc.texi; \
|
||||
then \
|
||||
rm -rf $@; \
|
||||
|
@ -310,8 +379,8 @@ tinc.html: tinc.texi
|
|||
exit 1; \
|
||||
fi
|
||||
.dvi.ps:
|
||||
TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
|
||||
$(DVIPS) -o $@ $<
|
||||
$(AM_V_DVIPS)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
|
||||
$(DVIPS) $(AM_V_texinfo) -o $@ $<
|
||||
|
||||
uninstall-dvi-am:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
|
@ -390,9 +459,7 @@ dist-info: $(INFO_DEPS)
|
|||
done
|
||||
|
||||
mostlyclean-aminfo:
|
||||
-rm -rf tinc.aux tinc.cp tinc.cps tinc.fn tinc.fns tinc.ky tinc.kys \
|
||||
tinc.log tinc.pg tinc.pgs tinc.tmp tinc.toc tinc.tp tinc.tps \
|
||||
tinc.vr tinc.vrs
|
||||
-rm -rf tinc.t2d tinc.t2p
|
||||
|
||||
clean-aminfo:
|
||||
-test -z "tinc.dvi tinc.pdf tinc.ps tinc.html" \
|
||||
|
@ -490,27 +557,14 @@ uninstall-man8:
|
|||
} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
|
||||
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
|
||||
dir='$(DESTDIR)$(man8dir)'; $(am__uninstall_files_from_dir)
|
||||
tags: TAGS
|
||||
TAGS:
|
||||
tags TAGS:
|
||||
|
||||
ctags: CTAGS
|
||||
CTAGS:
|
||||
ctags CTAGS:
|
||||
|
||||
cscope cscopelist:
|
||||
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@list='$(MANS)'; if test -n "$$list"; then \
|
||||
list=`for p in $$list; do \
|
||||
if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
|
||||
if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
|
||||
if test -n "$$list" && \
|
||||
grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
|
||||
echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
|
||||
grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \
|
||||
echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \
|
||||
echo " typically \`make maintainer-clean' will remove them" >&2; \
|
||||
exit 1; \
|
||||
else :; fi; \
|
||||
else :; fi
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
|
@ -745,19 +799,19 @@ uninstall-man: uninstall-man5 uninstall-man8
|
|||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: all all-am check check-am clean clean-aminfo clean-generic \
|
||||
dist-info distclean distclean-generic distdir dvi dvi-am html \
|
||||
html-am info info-am install install-am install-data \
|
||||
install-data-am install-dvi install-dvi-am install-exec \
|
||||
install-exec-am install-html install-html-am install-info \
|
||||
install-info-am install-man install-man5 install-man8 \
|
||||
install-pdf install-pdf-am install-ps install-ps-am \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
maintainer-clean maintainer-clean-aminfo \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-aminfo \
|
||||
mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am \
|
||||
uninstall-dvi-am uninstall-html-am uninstall-info-am \
|
||||
uninstall-man uninstall-man5 uninstall-man8 uninstall-pdf-am \
|
||||
uninstall-ps-am
|
||||
cscopelist-am ctags-am dist-info distclean distclean-generic \
|
||||
distdir dvi dvi-am html html-am info info-am install \
|
||||
install-am install-data install-data-am install-dvi \
|
||||
install-dvi-am install-exec install-exec-am install-html \
|
||||
install-html-am install-info install-info-am install-man \
|
||||
install-man5 install-man8 install-pdf install-pdf-am \
|
||||
install-ps install-ps-am install-strip installcheck \
|
||||
installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-aminfo maintainer-clean-generic mostlyclean \
|
||||
mostlyclean-aminfo mostlyclean-generic pdf pdf-am ps ps-am \
|
||||
tags-am uninstall uninstall-am uninstall-dvi-am \
|
||||
uninstall-html-am uninstall-info-am uninstall-man \
|
||||
uninstall-man5 uninstall-man8 uninstall-pdf-am uninstall-ps-am
|
||||
|
||||
|
||||
# For additional rules usually of interest only to the maintainer,
|
||||
|
|
Binary file not shown.
414
doc/texinfo.tex
414
doc/texinfo.tex
|
@ -3,11 +3,11 @@
|
|||
% Load plain if necessary, i.e., if running under initex.
|
||||
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
|
||||
%
|
||||
\def\texinfoversion{2012-03-11.15}
|
||||
\def\texinfoversion{2013-02-01.11}
|
||||
%
|
||||
% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
|
||||
% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
|
||||
% 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
|
||||
% 2007, 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
|
||||
%
|
||||
% This texinfo.tex file is free software: you can redistribute it and/or
|
||||
% modify it under the terms of the GNU General Public License as
|
||||
|
@ -24,13 +24,14 @@
|
|||
%
|
||||
% As a special exception, when this file is read by TeX when processing
|
||||
% a Texinfo source document, you may use the result without
|
||||
% restriction. (This has been our intent since Texinfo was invented.)
|
||||
% restriction. This Exception is an additional permission under section 7
|
||||
% of the GNU General Public License, version 3 ("GPLv3").
|
||||
%
|
||||
% Please try the latest version of texinfo.tex before submitting bug
|
||||
% reports; you can get the latest version from:
|
||||
% http://www.gnu.org/software/texinfo/ (the Texinfo home page), or
|
||||
% ftp://tug.org/tex/texinfo.tex
|
||||
% (and all CTAN mirrors, see http://www.ctan.org).
|
||||
% http://ftp.gnu.org/gnu/texinfo/ (the Texinfo release area), or
|
||||
% http://ftpmirror.gnu.org/texinfo/ (same, via a mirror), or
|
||||
% http://www.gnu.org/software/texinfo/ (the Texinfo home page)
|
||||
% The texinfo.tex in any given distribution could well be out
|
||||
% of date, so if that's what you're using, please check.
|
||||
%
|
||||
|
@ -594,7 +595,7 @@
|
|||
\def\:{\spacefactor=1000 }
|
||||
|
||||
% @* forces a line break.
|
||||
\def\*{\hfil\break\hbox{}\ignorespaces}
|
||||
\def\*{\unskip\hfil\break\hbox{}\ignorespaces}
|
||||
|
||||
% @/ allows a line break.
|
||||
\let\/=\allowbreak
|
||||
|
@ -1117,7 +1118,7 @@ where each line of input produces a line of output.}
|
|||
% #1 is a control sequence in which to do the replacements,
|
||||
% which we \xdef.
|
||||
\def\txiescapepdf#1{%
|
||||
\ifx\pdfescapestring\relax
|
||||
\ifx\pdfescapestring\thisisundefined
|
||||
% No primitive available; should we give a warning or log?
|
||||
% Many times it won't matter.
|
||||
\else
|
||||
|
@ -1367,9 +1368,8 @@ output) for that.)}
|
|||
\def\skipspaces#1{\def\PP{#1}\def\D{|}%
|
||||
\ifx\PP\D\let\nextsp\relax
|
||||
\else\let\nextsp\skipspaces
|
||||
\ifx\p\space\else\addtokens{\filename}{\PP}%
|
||||
\advance\filenamelength by 1
|
||||
\fi
|
||||
\addtokens{\filename}{\PP}%
|
||||
\advance\filenamelength by 1
|
||||
\fi
|
||||
\nextsp}
|
||||
\def\getfilename#1{%
|
||||
|
@ -1475,9 +1475,6 @@ output) for that.)}
|
|||
\def\ttsl{\setfontstyle{ttsl}}
|
||||
|
||||
|
||||
% Default leading.
|
||||
\newdimen\textleading \textleading = 13.2pt
|
||||
|
||||
% Set the baselineskip to #1, and the lineskip and strut size
|
||||
% correspondingly. There is no deep meaning behind these magic numbers
|
||||
% used as factors; they just match (closely enough) what Knuth defined.
|
||||
|
@ -1489,6 +1486,7 @@ output) for that.)}
|
|||
% can get a sort of poor man's double spacing by redefining this.
|
||||
\def\baselinefactor{1}
|
||||
%
|
||||
\newdimen\textleading
|
||||
\def\setleading#1{%
|
||||
\dimen0 = #1\relax
|
||||
\normalbaselineskip = \baselinefactor\dimen0
|
||||
|
@ -1761,18 +1759,24 @@ end
|
|||
\fi\fi
|
||||
|
||||
|
||||
% Set the font macro #1 to the font named #2, adding on the
|
||||
% specified font prefix (normally `cm').
|
||||
% Set the font macro #1 to the font named \fontprefix#2.
|
||||
% #3 is the font's design size, #4 is a scale factor, #5 is the CMap
|
||||
% encoding (currently only OT1, OT1IT and OT1TT are allowed, pass
|
||||
% empty to omit).
|
||||
% encoding (only OT1, OT1IT and OT1TT are allowed, or empty to omit).
|
||||
% Example:
|
||||
% #1 = \textrm
|
||||
% #2 = \rmshape
|
||||
% #3 = 10
|
||||
% #4 = \mainmagstep
|
||||
% #5 = OT1
|
||||
%
|
||||
\def\setfont#1#2#3#4#5{%
|
||||
\font#1=\fontprefix#2#3 scaled #4
|
||||
\csname cmap#5\endcsname#1%
|
||||
}
|
||||
% This is what gets called when #5 of \setfont is empty.
|
||||
\let\cmap\gobble
|
||||
% emacs-page end of cmaps
|
||||
%
|
||||
% (end of cmaps)
|
||||
|
||||
% Use cm as the default font prefix.
|
||||
% To specify the font prefix, you must define \fontprefix
|
||||
|
@ -1782,7 +1786,7 @@ end
|
|||
\fi
|
||||
% Support font families that don't use the same naming scheme as CM.
|
||||
\def\rmshape{r}
|
||||
\def\rmbshape{bx} %where the normal face is bold
|
||||
\def\rmbshape{bx} % where the normal face is bold
|
||||
\def\bfshape{b}
|
||||
\def\bxshape{bx}
|
||||
\def\ttshape{tt}
|
||||
|
@ -1797,8 +1801,7 @@ end
|
|||
\def\scshape{csc}
|
||||
\def\scbshape{csc}
|
||||
|
||||
% Definitions for a main text size of 11pt. This is the default in
|
||||
% Texinfo.
|
||||
% Definitions for a main text size of 11pt. (The default in Texinfo.)
|
||||
%
|
||||
\def\definetextfontsizexi{%
|
||||
% Text fonts (11.2pt, magstep1).
|
||||
|
@ -1923,7 +1926,7 @@ end
|
|||
\textleading = 13.2pt % line spacing for 11pt CM
|
||||
\textfonts % reset the current fonts
|
||||
\rm
|
||||
} % end of 11pt text font size definitions
|
||||
} % end of 11pt text font size definitions, \definetextfontsizexi
|
||||
|
||||
|
||||
% Definitions to make the main text be 10pt Computer Modern, with
|
||||
|
@ -2055,7 +2058,7 @@ end
|
|||
\textleading = 12pt % line spacing for 10pt CM
|
||||
\textfonts % reset the current fonts
|
||||
\rm
|
||||
} % end of 10pt text font size definitions
|
||||
} % end of 10pt text font size definitions, \definetextfontsizex
|
||||
|
||||
|
||||
% We provide the user-level command
|
||||
|
@ -2270,8 +2273,6 @@ end
|
|||
|
||||
\gdef\markupsetcodequoteleft{\let`\codequoteleft}
|
||||
\gdef\markupsetcodequoteright{\let'\codequoteright}
|
||||
|
||||
\gdef\markupsetnoligaturesquoteleft{\let`\noligaturesquoteleft}
|
||||
}
|
||||
|
||||
\let\markupsetuplqcode \markupsetcodequoteleft
|
||||
|
@ -2280,6 +2281,9 @@ end
|
|||
\let\markupsetuplqexample \markupsetcodequoteleft
|
||||
\let\markupsetuprqexample \markupsetcodequoteright
|
||||
%
|
||||
\let\markupsetuplqkbd \markupsetcodequoteleft
|
||||
\let\markupsetuprqkbd \markupsetcodequoteright
|
||||
%
|
||||
\let\markupsetuplqsamp \markupsetcodequoteleft
|
||||
\let\markupsetuprqsamp \markupsetcodequoteright
|
||||
%
|
||||
|
@ -2289,8 +2293,6 @@ end
|
|||
\let\markupsetuplqverbatim \markupsetcodequoteleft
|
||||
\let\markupsetuprqverbatim \markupsetcodequoteright
|
||||
|
||||
\let\markupsetuplqkbd \markupsetnoligaturesquoteleft
|
||||
|
||||
% Allow an option to not use regular directed right quote/apostrophe
|
||||
% (char 0x27), but instead the undirected quote from cmtt (char 0x0d).
|
||||
% The undirected quote is ugly, so don't make it the default, but it
|
||||
|
@ -2380,8 +2382,7 @@ end
|
|||
\aftersmartic
|
||||
}
|
||||
|
||||
% like \smartslanted except unconditionally uses \ttsl, and no ic.
|
||||
% @var is set to this for defun arguments.
|
||||
% Unconditional use \ttsl, and no ic. @var is set to this for defuns.
|
||||
\def\ttslanted#1{{\ttsl #1}}
|
||||
|
||||
% @cite is like \smartslanted except unconditionally use \sl. We never want
|
||||
|
@ -2446,34 +2447,12 @@ end
|
|||
% @samp.
|
||||
\def\samp#1{{\setupmarkupstyle{samp}\lq\tclose{#1}\rq\null}}
|
||||
|
||||
% definition of @key that produces a lozenge. Doesn't adjust to text size.
|
||||
%\setfont\keyrm\rmshape{8}{1000}{OT1}
|
||||
%\font\keysy=cmsy9
|
||||
%\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
|
||||
% \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
|
||||
% \vbox{\hrule\kern-0.4pt
|
||||
% \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
|
||||
% \kern-0.4pt\hrule}%
|
||||
% \kern-.06em\raise0.4pt\hbox{\angleright}}}}
|
||||
% @indicateurl is \samp, that is, with quotes.
|
||||
\let\indicateurl=\samp
|
||||
|
||||
% definition of @key with no lozenge. If the current font is already
|
||||
% monospace, don't change it; that way, we respect @kbdinputstyle. But
|
||||
% if it isn't monospace, then use \tt.
|
||||
%
|
||||
\def\key#1{{\setupmarkupstyle{key}%
|
||||
\nohyphenation
|
||||
\ifmonospace\else\tt\fi
|
||||
#1}\null}
|
||||
|
||||
% ctrl is no longer a Texinfo command.
|
||||
\def\ctrl #1{{\tt \rawbackslash \hat}#1}
|
||||
|
||||
% @file, @option are the same as @samp.
|
||||
\let\file=\samp
|
||||
\let\option=\samp
|
||||
|
||||
% @code is a modification of @t,
|
||||
% which makes spaces the same size as normal in the surrounding text.
|
||||
% @code (and similar) prints in typewriter, but with spaces the same
|
||||
% size as normal in the surrounding text, without hyphenation, etc.
|
||||
% This is a subroutine for that.
|
||||
\def\tclose#1{%
|
||||
{%
|
||||
% Change normal interword space to be same as for the current font.
|
||||
|
@ -2498,7 +2477,7 @@ end
|
|||
% We *must* turn on hyphenation at `-' and `_' in @code.
|
||||
% Otherwise, it is too hard to avoid overfull hboxes
|
||||
% in the Emacs manual, the Library manual, etc.
|
||||
|
||||
%
|
||||
% Unfortunately, TeX uses one parameter (\hyphenchar) to control
|
||||
% both hyphenation at - and hyphenation within words.
|
||||
% We must therefore turn them both off (\tclose does that)
|
||||
|
@ -2517,7 +2496,7 @@ end
|
|||
\let-\codedash
|
||||
\let_\codeunder
|
||||
\else
|
||||
\let-\realdash
|
||||
\let-\normaldash
|
||||
\let_\realunder
|
||||
\fi
|
||||
\codex
|
||||
|
@ -2526,7 +2505,7 @@ end
|
|||
|
||||
\def\codex #1{\tclose{#1}\endgroup}
|
||||
|
||||
\def\realdash{-}
|
||||
\def\normaldash{-}
|
||||
\def\codedash{-\discretionary{}{}{}}
|
||||
\def\codeunder{%
|
||||
% this is all so @math{@code{var_name}+1} can work. In math mode, _
|
||||
|
@ -2541,9 +2520,9 @@ end
|
|||
}
|
||||
|
||||
% An additional complication: the above will allow breaks after, e.g.,
|
||||
% each of the four underscores in __typeof__. This is undesirable in
|
||||
% some manuals, especially if they don't have long identifiers in
|
||||
% general. @allowcodebreaks provides a way to control this.
|
||||
% each of the four underscores in __typeof__. This is bad.
|
||||
% @allowcodebreaks provides a document-level way to turn breaking at -
|
||||
% and _ on and off.
|
||||
%
|
||||
\newif\ifallowcodebreaks \allowcodebreakstrue
|
||||
|
||||
|
@ -2562,6 +2541,13 @@ end
|
|||
\fi\fi
|
||||
}
|
||||
|
||||
% For @command, @env, @file, @option quotes seem unnecessary,
|
||||
% so use \code rather than \samp.
|
||||
\let\command=\code
|
||||
\let\env=\code
|
||||
\let\file=\code
|
||||
\let\option=\code
|
||||
|
||||
% @uref (abbreviation for `urlref') takes an optional (comma-separated)
|
||||
% second argument specifying the text to display and an optional third
|
||||
% arg as text to display instead of (rather than in addition to) the url
|
||||
|
@ -2708,10 +2694,6 @@ end
|
|||
\let\email=\uref
|
||||
\fi
|
||||
|
||||
% @kbd is like @code, except that if the argument is just one @key command,
|
||||
% then @kbd has no effect.
|
||||
\def\kbd#1{{\setupmarkupstyle{kbd}\def\look{#1}\expandafter\kbdfoo\look??\par}}
|
||||
|
||||
% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
|
||||
% `example' (@kbd uses ttsl only inside of @example and friends),
|
||||
% or `code' (@kbd uses normal tty font always).
|
||||
|
@ -2735,16 +2717,36 @@ end
|
|||
% Default is `distinct'.
|
||||
\kbdinputstyle distinct
|
||||
|
||||
\def\xkey{\key}
|
||||
\def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
|
||||
\ifx\one\xkey\ifx\threex\three \key{#2}%
|
||||
\else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
|
||||
\else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi}
|
||||
% @kbd is like @code, except that if the argument is just one @key command,
|
||||
% then @kbd has no effect.
|
||||
\def\kbd#1{{\def\look{#1}\expandafter\kbdsub\look??\par}}
|
||||
|
||||
% For @indicateurl, @env, @command quotes seem unnecessary, so use \code.
|
||||
\let\indicateurl=\code
|
||||
\let\env=\code
|
||||
\let\command=\code
|
||||
\def\xkey{\key}
|
||||
\def\kbdsub#1#2#3\par{%
|
||||
\def\one{#1}\def\three{#3}\def\threex{??}%
|
||||
\ifx\one\xkey\ifx\threex\three \key{#2}%
|
||||
\else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
|
||||
\else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
|
||||
}
|
||||
|
||||
% definition of @key that produces a lozenge. Doesn't adjust to text size.
|
||||
%\setfont\keyrm\rmshape{8}{1000}{OT1}
|
||||
%\font\keysy=cmsy9
|
||||
%\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
|
||||
% \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
|
||||
% \vbox{\hrule\kern-0.4pt
|
||||
% \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
|
||||
% \kern-0.4pt\hrule}%
|
||||
% \kern-.06em\raise0.4pt\hbox{\angleright}}}}
|
||||
|
||||
% definition of @key with no lozenge. If the current font is already
|
||||
% monospace, don't change it; that way, we respect @kbdinputstyle. But
|
||||
% if it isn't monospace, then use \tt.
|
||||
%
|
||||
\def\key#1{{\setupmarkupstyle{key}%
|
||||
\nohyphenation
|
||||
\ifmonospace\else\tt\fi
|
||||
#1}\null}
|
||||
|
||||
% @clicksequence{File @click{} Open ...}
|
||||
\def\clicksequence#1{\begingroup #1\endgroup}
|
||||
|
@ -2852,6 +2854,9 @@ end
|
|||
}
|
||||
}
|
||||
|
||||
% ctrl is no longer a Texinfo command, but leave this definition for fun.
|
||||
\def\ctrl #1{{\tt \rawbackslash \hat}#1}
|
||||
|
||||
% @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}.
|
||||
% Ignore unless FMTNAME == tex; then it is like @iftex and @tex,
|
||||
% except specified as a normal braced arg, so no newlines to worry about.
|
||||
|
@ -3142,12 +3147,17 @@ end
|
|||
% hopefully nobody will notice/care.
|
||||
\edef\ecsize{\csname\curfontsize ecsize\endcsname}%
|
||||
\edef\nominalsize{\csname\curfontsize nominalsize\endcsname}%
|
||||
\ifx\curfontstyle\bfstylename
|
||||
% bold:
|
||||
\font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize
|
||||
\ifmonospace
|
||||
% typewriter:
|
||||
\font\thisecfont = ectt\ecsize \space at \nominalsize
|
||||
\else
|
||||
% regular:
|
||||
\font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize
|
||||
\ifx\curfontstyle\bfstylename
|
||||
% bold:
|
||||
\font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize
|
||||
\else
|
||||
% regular:
|
||||
\font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize
|
||||
\fi
|
||||
\fi
|
||||
\thisecfont
|
||||
}
|
||||
|
@ -3260,6 +3270,20 @@ end
|
|||
\finishedtitlepagetrue
|
||||
}
|
||||
|
||||
% Settings used for typesetting titles: no hyphenation, no indentation,
|
||||
% don't worry much about spacing, ragged right. This should be used
|
||||
% inside a \vbox, and fonts need to be set appropriately first. Because
|
||||
% it is always used for titles, nothing else, we call \rmisbold. \par
|
||||
% should be specified before the end of the \vbox, since a vbox is a group.
|
||||
%
|
||||
\def\raggedtitlesettings{%
|
||||
\rmisbold
|
||||
\hyphenpenalty=10000
|
||||
\parindent=0pt
|
||||
\tolerance=5000
|
||||
\ptexraggedright
|
||||
}
|
||||
|
||||
% Macros to be used within @titlepage:
|
||||
|
||||
\let\subtitlerm=\tenrm
|
||||
|
@ -3267,7 +3291,7 @@ end
|
|||
|
||||
\parseargdef\title{%
|
||||
\checkenv\titlepage
|
||||
\leftline{\titlefonts\rmisbold #1}
|
||||
\vbox{\titlefonts \raggedtitlesettings #1\par}%
|
||||
% print a rule at the page bottom also.
|
||||
\finishedtitlepagefalse
|
||||
\vskip4pt \hrule height 4pt width \hsize \vskip4pt
|
||||
|
@ -4164,7 +4188,7 @@ end
|
|||
% ..., but we might end up with active ones in the argument if
|
||||
% we're called from @code, as @code{@value{foo-bar_}}, though.
|
||||
% So \let them to their normal equivalents.
|
||||
\let-\realdash \let_\normalunderscore
|
||||
\let-\normaldash \let_\normalunderscore
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4204,7 +4228,7 @@ end
|
|||
}
|
||||
\def\ifsetfail{\doignore{ifset}}
|
||||
|
||||
% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
|
||||
% @ifclear VAR ... @end executes the `...' iff VAR has never been
|
||||
% defined with @set, or has been undefined with @clear.
|
||||
%
|
||||
% The `\else' inside the `\doifset' parameter is a trick to reuse the
|
||||
|
@ -4215,6 +4239,35 @@ end
|
|||
\def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}}
|
||||
\def\ifclearfail{\doignore{ifclear}}
|
||||
|
||||
% @ifcommandisdefined CMD ... @end executes the `...' if CMD (written
|
||||
% without the @) is in fact defined. We can only feasibly check at the
|
||||
% TeX level, so something like `mathcode' is going to considered
|
||||
% defined even though it is not a Texinfo command.
|
||||
%
|
||||
\makecond{ifcommanddefined}
|
||||
\def\ifcommanddefined{\parsearg{\doifcmddefined{\let\next=\ifcmddefinedfail}}}
|
||||
%
|
||||
\def\doifcmddefined#1#2{{%
|
||||
\makevalueexpandable
|
||||
\let\next=\empty
|
||||
\expandafter\ifx\csname #2\endcsname\relax
|
||||
#1% If not defined, \let\next as above.
|
||||
\fi
|
||||
\expandafter
|
||||
}\next
|
||||
}
|
||||
\def\ifcmddefinedfail{\doignore{ifcommanddefined}}
|
||||
|
||||
% @ifcommandnotdefined CMD ... handled similar to @ifclear above.
|
||||
\makecond{ifcommandnotdefined}
|
||||
\def\ifcommandnotdefined{%
|
||||
\parsearg{\doifcmddefined{\else \let\next=\ifcmdnotdefinedfail}}}
|
||||
\def\ifcmdnotdefinedfail{\doignore{ifcommandnotdefined}}
|
||||
|
||||
% Set the `txicommandconditionals' variable, so documents have a way to
|
||||
% test if the @ifcommand...defined conditionals are available.
|
||||
\set txicommandconditionals
|
||||
|
||||
% @dircategory CATEGORY -- specify a category of the dir file
|
||||
% which this file should belong to. Ignore this in TeX.
|
||||
\let\dircategory=\comment
|
||||
|
@ -4451,6 +4504,7 @@ end
|
|||
\definedummyword\guillemetright
|
||||
\definedummyword\guilsinglleft
|
||||
\definedummyword\guilsinglright
|
||||
\definedummyword\lbracechar
|
||||
\definedummyword\leq
|
||||
\definedummyword\minus
|
||||
\definedummyword\ogonek
|
||||
|
@ -4463,6 +4517,7 @@ end
|
|||
\definedummyword\quoteleft
|
||||
\definedummyword\quoteright
|
||||
\definedummyword\quotesinglbase
|
||||
\definedummyword\rbracechar
|
||||
\definedummyword\result
|
||||
\definedummyword\textdegree
|
||||
%
|
||||
|
@ -4514,6 +4569,7 @@ end
|
|||
\definedummyword\t
|
||||
%
|
||||
% Commands that take arguments.
|
||||
\definedummyword\abbr
|
||||
\definedummyword\acronym
|
||||
\definedummyword\anchor
|
||||
\definedummyword\cite
|
||||
|
@ -4525,7 +4581,9 @@ end
|
|||
\definedummyword\emph
|
||||
\definedummyword\env
|
||||
\definedummyword\file
|
||||
\definedummyword\image
|
||||
\definedummyword\indicateurl
|
||||
\definedummyword\inforef
|
||||
\definedummyword\kbd
|
||||
\definedummyword\key
|
||||
\definedummyword\math
|
||||
|
@ -4572,7 +4630,10 @@ end
|
|||
% content at all. So for index sorting, we map @{ and @} to strings
|
||||
% starting with |, since that ASCII character is between ASCII { and }.
|
||||
\def\{{|a}%
|
||||
\def\lbracechar{|a}%
|
||||
%
|
||||
\def\}{|b}%
|
||||
\def\rbracechar{|b}%
|
||||
%
|
||||
% Non-English letters.
|
||||
\def\AA{AA}%
|
||||
|
@ -5533,14 +5594,6 @@ end
|
|||
|
||||
% Define @majorheading, @heading and @subheading
|
||||
|
||||
% NOTE on use of \vbox for chapter headings, section headings, and such:
|
||||
% 1) We use \vbox rather than the earlier \line to permit
|
||||
% overlong headings to fold.
|
||||
% 2) \hyphenpenalty is set to 10000 because hyphenation in a
|
||||
% heading is obnoxious; this forbids it.
|
||||
% 3) Likewise, headings look best if no \parindent is used, and
|
||||
% if justification is not attempted. Hence \raggedright.
|
||||
|
||||
\def\majorheading{%
|
||||
{\advance\chapheadingskip by 10pt \chapbreak }%
|
||||
\parsearg\chapheadingzzz
|
||||
|
@ -5548,10 +5601,8 @@ end
|
|||
|
||||
\def\chapheading{\chapbreak \parsearg\chapheadingzzz}
|
||||
\def\chapheadingzzz#1{%
|
||||
{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
|
||||
\parindent=0pt\ptexraggedright
|
||||
\rmisbold #1\hfill}}%
|
||||
\bigskip \par\penalty 200\relax
|
||||
\vbox{\chapfonts \raggedtitlesettings #1\par}%
|
||||
\nobreak\bigskip \nobreak
|
||||
\suppressfirstparagraphindent
|
||||
}
|
||||
|
||||
|
@ -5710,8 +5761,7 @@ end
|
|||
%
|
||||
% Typeset the actual heading.
|
||||
\nobreak % Avoid page breaks at the interline glue.
|
||||
\vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright
|
||||
\hangindent=\wd0 \centerparametersmaybe
|
||||
\vbox{\raggedtitlesettings \hangindent=\wd0 \centerparametersmaybe
|
||||
\unhbox0 #1\par}%
|
||||
}%
|
||||
\nobreak\bigskip % no page break after a chapter title
|
||||
|
@ -5733,18 +5783,18 @@ end
|
|||
\def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
|
||||
%
|
||||
\def\unnchfopen #1{%
|
||||
\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
|
||||
\parindent=0pt\ptexraggedright
|
||||
\rmisbold #1\hfill}}\bigskip \par\nobreak
|
||||
\chapoddpage
|
||||
\vbox{\chapfonts \raggedtitlesettings #1\par}%
|
||||
\nobreak\bigskip\nobreak
|
||||
}
|
||||
\def\chfopen #1#2{\chapoddpage {\chapfonts
|
||||
\vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
|
||||
\par\penalty 5000 %
|
||||
}
|
||||
\def\centerchfopen #1{%
|
||||
\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
|
||||
\parindent=0pt
|
||||
\hfill {\rmisbold #1}\hfill}}\bigskip \par\nobreak
|
||||
\chapoddpage
|
||||
\vbox{\chapfonts \raggedtitlesettings \hfill #1\hfill}%
|
||||
\nobreak\bigskip \nobreak
|
||||
}
|
||||
\def\CHAPFopen{%
|
||||
\global\let\chapmacro=\chfopen
|
||||
|
@ -6510,16 +6560,9 @@ end
|
|||
\makedispenvdef{quotation}{\quotationstart}
|
||||
%
|
||||
\def\quotationstart{%
|
||||
{\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
|
||||
\parindent=0pt
|
||||
%
|
||||
% @cartouche defines \nonarrowing to inhibit narrowing at next level down.
|
||||
\indentedblockstart % same as \indentedblock, but increase right margin too.
|
||||
\ifx\nonarrowing\relax
|
||||
\advance\leftskip by \lispnarrowing
|
||||
\advance\rightskip by \lispnarrowing
|
||||
\exdentamount = \lispnarrowing
|
||||
\else
|
||||
\let\nonarrowing = \relax
|
||||
\fi
|
||||
\parsearg\quotationlabel
|
||||
}
|
||||
|
@ -6545,6 +6588,32 @@ end
|
|||
\fi
|
||||
}
|
||||
|
||||
% @indentedblock is like @quotation, but indents only on the left and
|
||||
% has no optional argument.
|
||||
%
|
||||
\makedispenvdef{indentedblock}{\indentedblockstart}
|
||||
%
|
||||
\def\indentedblockstart{%
|
||||
{\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
|
||||
\parindent=0pt
|
||||
%
|
||||
% @cartouche defines \nonarrowing to inhibit narrowing at next level down.
|
||||
\ifx\nonarrowing\relax
|
||||
\advance\leftskip by \lispnarrowing
|
||||
\exdentamount = \lispnarrowing
|
||||
\else
|
||||
\let\nonarrowing = \relax
|
||||
\fi
|
||||
}
|
||||
|
||||
% Keep a nonzero parskip for the environment, since we're doing normal filling.
|
||||
%
|
||||
\def\Eindentedblock{%
|
||||
\par
|
||||
{\parskip=0pt \afterenvbreak}%
|
||||
}
|
||||
\def\Esmallindentedblock{\Eindentedblock}
|
||||
|
||||
|
||||
% LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>}
|
||||
% If we want to allow any <char> as delimiter,
|
||||
|
@ -7023,7 +7092,10 @@ end
|
|||
\df \sl \hyphenchar\font=0
|
||||
%
|
||||
% On the other hand, if an argument has two dashes (for instance), we
|
||||
% want a way to get ttsl. Let's try @var for that.
|
||||
% want a way to get ttsl. We used to recommend @var for that, so
|
||||
% leave the code in, but it's strange for @var to lead to typewriter.
|
||||
% Nowadays we recommend @code, since the difference between a ttsl hyphen
|
||||
% and a tt hyphen is pretty tiny. @code also disables ?` !`.
|
||||
\def\var##1{{\setupmarkupstyle{var}\ttslanted{##1}}}%
|
||||
#1%
|
||||
\sl\hyphenchar\font=45
|
||||
|
@ -7807,7 +7879,7 @@ end
|
|||
\fi\fi
|
||||
}
|
||||
|
||||
|
||||
%
|
||||
% @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is
|
||||
% the node name, #2 the name of the Info cross-reference, #3 the printed
|
||||
% node name, #4 the name of the Info file, #5 the name of the printed
|
||||
|
@ -7817,16 +7889,21 @@ end
|
|||
\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]}
|
||||
\def\ref#1{\xrefX[#1,,,,,,,]}
|
||||
%
|
||||
\newbox\topbox
|
||||
\newbox\toprefbox
|
||||
\newbox\printedrefnamebox
|
||||
\newbox\infofilenamebox
|
||||
\newbox\printedmanualbox
|
||||
%
|
||||
\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
|
||||
\unsepspaces
|
||||
%
|
||||
% Get args without leading/trailing spaces.
|
||||
\def\printedrefname{\ignorespaces #3}%
|
||||
\setbox\printedrefnamebox = \hbox{\printedrefname\unskip}%
|
||||
%
|
||||
\def\infofilename{\ignorespaces #4}%
|
||||
\setbox\infofilenamebox = \hbox{\infofilename\unskip}%
|
||||
%
|
||||
\def\printedmanual{\ignorespaces #5}%
|
||||
\setbox\printedmanualbox = \hbox{\printedmanual\unskip}%
|
||||
%
|
||||
|
@ -7861,11 +7938,18 @@ end
|
|||
\turnoffactive
|
||||
\makevalueexpandable
|
||||
% This expands tokens, so do it after making catcode changes, so _
|
||||
% etc. don't get their TeX definitions.
|
||||
% etc. don't get their TeX definitions. This ignores all spaces in
|
||||
% #4, including (wrongly) those in the middle of the filename.
|
||||
\getfilename{#4}%
|
||||
%
|
||||
% This (wrongly) does not take account of leading or trailing
|
||||
% spaces in #1, which should be ignored.
|
||||
\edef\pdfxrefdest{#1}%
|
||||
\txiescapepdf\pdfxrefdest
|
||||
\ifx\pdfxrefdest\empty
|
||||
\def\pdfxrefdest{Top}% no empty targets
|
||||
\else
|
||||
\txiescapepdf\pdfxrefdest % escape PDF special chars
|
||||
\fi
|
||||
%
|
||||
\leavevmode
|
||||
\startlink attr{/Border [0 0 0]}%
|
||||
|
@ -7898,7 +7982,7 @@ end
|
|||
\printedrefname
|
||||
\fi
|
||||
%
|
||||
% if the user also gave the printed manual name (fifth arg), append
|
||||
% If the user also gave the printed manual name (fifth arg), append
|
||||
% "in MANUALNAME".
|
||||
\ifdim \wd\printedmanualbox > 0pt
|
||||
\space \putwordin{} \cite{\printedmanual}%
|
||||
|
@ -7913,32 +7997,20 @@ end
|
|||
% this is a loss. Therefore, we give the text of the node name
|
||||
% again, so it is as if TeX is seeing it for the first time.
|
||||
%
|
||||
% Cross-manual reference. Only include the "Section ``foo'' in" if
|
||||
% the foo is neither missing or Top. Thus, @xref{,,,foo,The Foo Manual}
|
||||
% outputs simply "see The Foo Manual".
|
||||
\ifdim \wd\printedmanualbox > 0pt
|
||||
% What is the 7sp about? The idea is that we also want to omit
|
||||
% the Section part if we would be printing "Top", since they are
|
||||
% clearly trying to refer to the whole manual. But, this being
|
||||
% TeX, we can't easily compare strings while ignoring the possible
|
||||
% spaces before and after in the input. By adding the arbitrary
|
||||
% 7sp, we make it much less likely that a real node name would
|
||||
% happen to have the same width as "Top" (e.g., in a monospaced font).
|
||||
% I hope it will never happen in practice.
|
||||
% Cross-manual reference with a printed manual name.
|
||||
%
|
||||
% For the same basic reason, we retypeset the "Top" at every
|
||||
% reference, since the current font is indeterminate.
|
||||
\crossmanualxref{\cite{\printedmanual\unskip}}%
|
||||
%
|
||||
\else\ifdim \wd\infofilenamebox > 0pt
|
||||
% Cross-manual reference with only an info filename (arg 4), no
|
||||
% printed manual name (arg 5). This is essentially the same as
|
||||
% the case above; we output the filename, since we have nothing else.
|
||||
%
|
||||
\setbox\topbox = \hbox{Top\kern7sp}%
|
||||
\setbox2 = \hbox{\ignorespaces \printedrefname \unskip \kern7sp}%
|
||||
\ifdim \wd2 > 7sp
|
||||
\ifdim \wd2 = \wd\topbox \else
|
||||
\putwordSection{} ``\printedrefname'' \putwordin{}\space
|
||||
\fi
|
||||
\fi
|
||||
\cite{\printedmanual}%
|
||||
\crossmanualxref{\code{\infofilename\unskip}}%
|
||||
%
|
||||
\else
|
||||
% Reference in this manual.
|
||||
% Reference within this manual.
|
||||
%
|
||||
% _ (for example) has to be the character _ for the purposes of the
|
||||
% control sequence corresponding to the node, but it has to expand
|
||||
|
@ -7959,11 +8031,37 @@ end
|
|||
%
|
||||
% output the `page 3'.
|
||||
\turnoffactive \putwordpage\tie\refx{#1-pg}{}%
|
||||
\fi
|
||||
\fi\fi
|
||||
\fi
|
||||
\endlink
|
||||
\endgroup}
|
||||
|
||||
% Output a cross-manual xref to #1. Used just above (twice).
|
||||
%
|
||||
% Only include the text "Section ``foo'' in" if the foo is neither
|
||||
% missing or Top. Thus, @xref{,,,foo,The Foo Manual} outputs simply
|
||||
% "see The Foo Manual", the idea being to refer to the whole manual.
|
||||
%
|
||||
% But, this being TeX, we can't easily compare our node name against the
|
||||
% string "Top" while ignoring the possible spaces before and after in
|
||||
% the input. By adding the arbitrary 7sp below, we make it much less
|
||||
% likely that a real node name would have the same width as "Top" (e.g.,
|
||||
% in a monospaced font). Hopefully it will never happen in practice.
|
||||
%
|
||||
% For the same basic reason, we retypeset the "Top" at every
|
||||
% reference, since the current font is indeterminate.
|
||||
%
|
||||
\def\crossmanualxref#1{%
|
||||
\setbox\toprefbox = \hbox{Top\kern7sp}%
|
||||
\setbox2 = \hbox{\ignorespaces \printedrefname \unskip \kern7sp}%
|
||||
\ifdim \wd2 > 7sp % nonempty?
|
||||
\ifdim \wd2 = \wd\toprefbox \else % same as Top?
|
||||
\putwordSection{} ``\printedrefname'' \putwordin{}\space
|
||||
\fi
|
||||
\fi
|
||||
#1%
|
||||
}
|
||||
|
||||
% This macro is called from \xrefX for the `[nodename]' part of xref
|
||||
% output. It's a separate macro only so it can be changed more easily,
|
||||
% since square brackets don't work well in some documents. Particularly
|
||||
|
@ -9895,22 +9993,26 @@ directory should work if nowhere else does.}
|
|||
@gdef@otherbackslash{@let\=@realbackslash}
|
||||
|
||||
% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
|
||||
% the literal character `\'.
|
||||
% the literal character `\'. Also revert - to its normal character, in
|
||||
% case the active - from code has slipped in.
|
||||
%
|
||||
@def@normalturnoffactive{%
|
||||
@let"=@normaldoublequote
|
||||
@let$=@normaldollar %$ font-lock fix
|
||||
@let+=@normalplus
|
||||
@let<=@normalless
|
||||
@let>=@normalgreater
|
||||
@let\=@normalbackslash
|
||||
@let^=@normalcaret
|
||||
@let_=@normalunderscore
|
||||
@let|=@normalverticalbar
|
||||
@let~=@normaltilde
|
||||
@markupsetuplqdefault
|
||||
@markupsetuprqdefault
|
||||
@unsepspaces
|
||||
{@catcode`- = @active
|
||||
@gdef@normalturnoffactive{%
|
||||
@let-=@normaldash
|
||||
@let"=@normaldoublequote
|
||||
@let$=@normaldollar %$ font-lock fix
|
||||
@let+=@normalplus
|
||||
@let<=@normalless
|
||||
@let>=@normalgreater
|
||||
@let\=@normalbackslash
|
||||
@let^=@normalcaret
|
||||
@let_=@normalunderscore
|
||||
@let|=@normalverticalbar
|
||||
@let~=@normaltilde
|
||||
@markupsetuplqdefault
|
||||
@markupsetuprqdefault
|
||||
@unsepspaces
|
||||
}
|
||||
}
|
||||
|
||||
% Make _ and + \other characters, temporarily.
|
||||
|
|
|
@ -90,6 +90,15 @@ is used.
|
|||
The same as export followed by import.
|
||||
.It exchange-all Op Fl -force
|
||||
The same as export-all followed by import.
|
||||
.It invite Ar name
|
||||
Prepares an invitation for a new node with the given
|
||||
.Ar name ,
|
||||
and prints a short invitation URL that can be used with the join command.
|
||||
.It join Op Ar URL
|
||||
Join an existing VPN using an invitation URL created using the invite command.
|
||||
If no
|
||||
.Ar URL
|
||||
is given, it will be read from standard input.
|
||||
.It start Op tincd options
|
||||
Start
|
||||
.Xr tincd 8 ,
|
||||
|
@ -97,9 +106,10 @@ optionally with the given extra options.
|
|||
.It stop
|
||||
Stop
|
||||
.Xr tincd 8 .
|
||||
.It restart
|
||||
.It restart Op tincd options
|
||||
Restart
|
||||
.Xr tincd 8 .
|
||||
.Xr tincd 8 ,
|
||||
optionally with the given extra options.
|
||||
.It reload
|
||||
Partially rereads configuration files. Connections to hosts whose host
|
||||
config files are removed are closed. New outgoing connections specified
|
||||
|
|
|
@ -274,14 +274,12 @@ The file in which the private ECDSA key of this tinc daemon resides.
|
|||
This is only used if
|
||||
.Va ExperimentalProtocol
|
||||
is enabled.
|
||||
.It Va ExperimentalProtocol Li = yes | no Po no Pc Bq experimental
|
||||
When this option is enabled, experimental protocol enhancements will be used.
|
||||
.It Va ExperimentalProtocol Li = yes | no Pq yes
|
||||
When this option is enabled, the SPTPS protocol will be used when connecting to nodes that also support it.
|
||||
Ephemeral ECDH will be used for key exchanges,
|
||||
and ECDSA will be used instead of RSA for authentication.
|
||||
When enabled, an ECDSA key must have been generated before with
|
||||
.Nm tinc generate-ecdsa-keys .
|
||||
The experimental protocol may change at any time,
|
||||
and there is no guarantee that tinc will run stable when it is used.
|
||||
.It Va Forwarding Li = off | internal | kernel Po internal Pc Bq experimental
|
||||
This option selects the way indirect packets are forwarded.
|
||||
.Bl -tag -width indent
|
||||
|
@ -328,12 +326,20 @@ which normally would prevent the peers from learning each other's LAN address.
|
|||
.Pp
|
||||
Currently, local discovery is implemented by sending broadcast packets to the LAN during path MTU discovery.
|
||||
This feature may not work in all possible situations.
|
||||
.It Va LocalDiscoveryAddress Li = Ar address
|
||||
If this variable is specified, local discovery packets are sent to the given
|
||||
.Ar address .
|
||||
.It Va MACExpire Li = Ar seconds Pq 600
|
||||
This option controls the amount of time MAC addresses are kept before they are removed.
|
||||
This only has effect when
|
||||
.Va Mode
|
||||
is set to
|
||||
.Qq switch .
|
||||
.It Va MaxConnectionBurst Li = Ar count Pq 100
|
||||
This option controls how many connections tinc accepts in quick succession.
|
||||
If there are more connections than the given number in a short time interval,
|
||||
tinc will reduce the number of accepted connections to only one per second,
|
||||
until the burst has passed.
|
||||
.It Va MaxTimeout Li = Ar seconds Pq 900
|
||||
This is the maximum delay before trying to reconnect to other tinc daemons.
|
||||
.It Va Mode Li = router | switch | hub Pq router
|
||||
|
|
1665
doc/tinc.info
1665
doc/tinc.info
File diff suppressed because it is too large
Load diff
|
@ -1002,14 +1002,12 @@ The file in which the private ECDSA key of this tinc daemon resides.
|
|||
This is only used if ExperimentalProtocol is enabled.
|
||||
|
||||
@cindex ExperimentalProtocol
|
||||
@item ExperimentalProtocol = <yes|no> (no) [experimental]
|
||||
When this option is enabled, experimental protocol enhancements will be used.
|
||||
@item ExperimentalProtocol = <yes|no> (yes)
|
||||
When this option is enabled, the SPTPS protocol will be used when connecting to nodes that also support it.
|
||||
Ephemeral ECDH will be used for key exchanges,
|
||||
and ECDSA will be used instead of RSA for authentication.
|
||||
When enabled, an ECDSA key must have been generated before with
|
||||
@samp{tinc generate-ecdsa-keys}.
|
||||
The experimental protocol may change at any time,
|
||||
and there is no guarantee that tinc will run stable when it is used.
|
||||
|
||||
@cindex Forwarding
|
||||
@item Forwarding = <off|internal|kernel> (internal) [experimental]
|
||||
|
@ -1058,6 +1056,10 @@ which normally would prevent the peers from learning each other's LAN address.
|
|||
Currently, local discovery is implemented by sending broadcast packets to the LAN during path MTU discovery.
|
||||
This feature may not work in all possible situations.
|
||||
|
||||
@cindex LocalDiscoveryAddress
|
||||
@item LocalDiscoveryAddress <@var{address}>
|
||||
If this variable is specified, local discovery packets are sent to the given @var{address}.
|
||||
|
||||
@cindex Mode
|
||||
@item Mode = <router|switch|hub> (router)
|
||||
This option selects the way packets are routed to other daemons.
|
||||
|
@ -1099,6 +1101,13 @@ impossible to crack a single key.
|
|||
This option controls the amount of time MAC addresses are kept before they are removed.
|
||||
This only has effect when Mode is set to "switch".
|
||||
|
||||
@cindex MaxConnectionBurst
|
||||
@item MaxConnectionBurst = <@var{count}> (100)
|
||||
This option controls how many connections tinc accepts in quick succession.
|
||||
If there are more connections than the given number in a short time interval,
|
||||
tinc will reduce the number of accepted connections to only one per second,
|
||||
until the burst has passed.
|
||||
|
||||
@cindex Name
|
||||
@item Name = <@var{name}> [required]
|
||||
This is a symbolic name for this connection.
|
||||
|
@ -1180,7 +1189,6 @@ reordering. Setting this to zero will disable replay tracking completely and
|
|||
pass all traffic, but leaves tinc vulnerable to replay-based attacks on your
|
||||
traffic.
|
||||
|
||||
|
||||
@cindex StrictSubnets
|
||||
@item StrictSubnets <yes|no> (no) [experimental]
|
||||
When this option is enabled tinc will only use Subnet statements which are
|
||||
|
@ -2216,14 +2224,22 @@ The same as export followed by import.
|
|||
@item exchange-all [--force]
|
||||
The same as export-all followed by import.
|
||||
|
||||
@item invite @var{name}
|
||||
Prepares an invitation for a new node with the given @var{name},
|
||||
and prints a short invitation URL that can be used with the join command.
|
||||
|
||||
@item join [@var{URL}]
|
||||
Join an existing VPN using an invitation URL created using the invite command.
|
||||
If no @var{URL} is given, it will be read from standard input.
|
||||
|
||||
@item start [tincd options]
|
||||
Start @samp{tincd}, optionally with the given extra options.
|
||||
|
||||
@item stop
|
||||
Stop @samp{tincd}.
|
||||
|
||||
@item restart
|
||||
Restart @samp{tincd}.
|
||||
@item restart [tincd options]
|
||||
Restart @samp{tincd}, optionally with the given extra options.
|
||||
|
||||
@item reload
|
||||
Partially rereads configuration files. Connections to hosts whose host
|
||||
|
@ -2234,10 +2250,17 @@ in @file{tinc.conf} will be made.
|
|||
Shows the PID of the currently running @samp{tincd}.
|
||||
|
||||
@item generate-keys [@var{bits}]
|
||||
Generate public/private keypair of @var{bits} length. If @var{bits} is not specified,
|
||||
1024 is the default. tinc will ask where you want to store the files,
|
||||
but will default to the configuration directory (you can use the -c or -n
|
||||
option).
|
||||
Generate both RSA and ECDSA keypairs (see below) and exit.
|
||||
tinc will ask where you want to store the files, but will default to the
|
||||
configuration directory (you can use the -c or -n option).
|
||||
|
||||
@item generate-ecdsa-keys
|
||||
Generate public/private ECDSA keypair and exit.
|
||||
|
||||
@item generate-rsa-keys [@var{bits}]
|
||||
Generate public/private RSA keypair and exit. If @var{bits} is omitted, the
|
||||
default length will be 2048 bits. When saving keys to existing files, tinc
|
||||
will not delete the old keys; you have to remove them manually.
|
||||
|
||||
@item dump [reachable] nodes
|
||||
Dump a list of all known nodes in the VPN.
|
||||
|
|
135
gui/Makefile.in
135
gui/Makefile.in
|
@ -1,9 +1,8 @@
|
|||
# Makefile.in generated by automake 1.11.6 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.13.3 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
|
||||
# Foundation, Inc.
|
||||
# Copyright (C) 1994-2013 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.
|
||||
|
@ -16,23 +15,51 @@
|
|||
@SET_MAKE@
|
||||
|
||||
VPATH = @srcdir@
|
||||
am__make_dryrun = \
|
||||
{ \
|
||||
am__dry=no; \
|
||||
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
|
||||
am__make_running_with_option = \
|
||||
case $${target_option-} in \
|
||||
?) ;; \
|
||||
*) echo "am__make_running_with_option: internal error: invalid" \
|
||||
"target option '$${target_option-}' specified" >&2; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
has_opt=no; \
|
||||
sane_makeflags=$$MAKEFLAGS; \
|
||||
if $(am__is_gnu_make); then \
|
||||
sane_makeflags=$$MFLAGS; \
|
||||
else \
|
||||
case $$MAKEFLAGS in \
|
||||
*\\[\ \ ]*) \
|
||||
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
|
||||
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
|
||||
*) \
|
||||
for am__flg in $$MAKEFLAGS; do \
|
||||
case $$am__flg in \
|
||||
*=*|--*) ;; \
|
||||
*n*) am__dry=yes; break;; \
|
||||
esac; \
|
||||
done;; \
|
||||
bs=\\; \
|
||||
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
|
||||
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
|
||||
esac; \
|
||||
test $$am__dry = yes; \
|
||||
}
|
||||
fi; \
|
||||
skip_next=no; \
|
||||
strip_trailopt () \
|
||||
{ \
|
||||
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
|
||||
}; \
|
||||
for flg in $$sane_makeflags; do \
|
||||
test $$skip_next = yes && { skip_next=no; continue; }; \
|
||||
case $$flg in \
|
||||
*=*|--*) continue;; \
|
||||
-*I) strip_trailopt 'I'; skip_next=yes;; \
|
||||
-*I?*) strip_trailopt 'I';; \
|
||||
-*O) strip_trailopt 'O'; skip_next=yes;; \
|
||||
-*O?*) strip_trailopt 'O';; \
|
||||
-*l) strip_trailopt 'l'; skip_next=yes;; \
|
||||
-*l?*) strip_trailopt 'l';; \
|
||||
-[dEDm]) skip_next=yes;; \
|
||||
-[JT]) skip_next=yes;; \
|
||||
esac; \
|
||||
case $$flg in \
|
||||
*$$target_option*) has_opt=yes; break;; \
|
||||
esac; \
|
||||
done; \
|
||||
test $$has_opt = yes
|
||||
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
|
||||
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
|
@ -52,13 +79,13 @@ POST_UNINSTALL = :
|
|||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
subdir = gui
|
||||
DIST_COMMON = $(dist_bin_SCRIPTS) $(srcdir)/Makefile.am \
|
||||
$(srcdir)/Makefile.in
|
||||
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
|
||||
$(dist_bin_SCRIPTS)
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/attribute.m4 \
|
||||
$(top_srcdir)/m4/curses.m4 $(top_srcdir)/m4/lzo.m4 \
|
||||
$(top_srcdir)/m4/openssl.m4 $(top_srcdir)/m4/readline.m4 \
|
||||
$(top_srcdir)/m4/zlib.m4 $(top_srcdir)/configure.in
|
||||
$(top_srcdir)/m4/zlib.m4 $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
|
@ -94,6 +121,18 @@ am__uninstall_files_from_dir = { \
|
|||
}
|
||||
am__installdirs = "$(DESTDIR)$(bindir)"
|
||||
SCRIPTS = $(dist_bin_SCRIPTS)
|
||||
AM_V_P = $(am__v_P_@AM_V@)
|
||||
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
|
||||
am__v_P_0 = false
|
||||
am__v_P_1 = :
|
||||
AM_V_GEN = $(am__v_GEN_@AM_V@)
|
||||
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
|
||||
am__v_GEN_0 = @echo " GEN " $@;
|
||||
am__v_GEN_1 =
|
||||
AM_V_at = $(am__v_at_@AM_V@)
|
||||
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
||||
am__v_at_0 = @
|
||||
am__v_at_1 =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
am__can_run_installinfo = \
|
||||
|
@ -101,9 +140,11 @@ am__can_run_installinfo = \
|
|||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
|
@ -123,7 +164,6 @@ ECHO_T = @ECHO_T@
|
|||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
GREP = @GREP@
|
||||
INCLUDES = @INCLUDES@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
|
@ -137,7 +177,6 @@ LIBOBJS = @LIBOBJS@
|
|||
LIBS = @LIBS@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
OBJEXT = @OBJEXT@
|
||||
|
@ -210,7 +249,7 @@ extra_DIST = README.gui
|
|||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
|
@ -235,9 +274,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
|||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
install-dist_binSCRIPTS: $(dist_bin_SCRIPTS)
|
||||
|
@ -275,11 +314,26 @@ uninstall-dist_binSCRIPTS:
|
|||
files=`for p in $$list; do echo "$$p"; done | \
|
||||
sed -e 's,.*/,,;$(transform)'`; \
|
||||
dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir)
|
||||
tags: TAGS
|
||||
TAGS:
|
||||
|
||||
ctags: CTAGS
|
||||
CTAGS:
|
||||
installcheck-dist_binSCRIPTS: $(dist_bin_SCRIPTS)
|
||||
bad=0; pid=$$$$; list="$(dist_bin_SCRIPTS)"; for p in $$list; do \
|
||||
case ' $(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT) ' in \
|
||||
*" $$p "* | *" $(srcdir)/$$p "*) continue;; \
|
||||
esac; \
|
||||
f=`echo "$$p" | sed 's,^.*/,,;$(transform)'`; \
|
||||
for opt in --help --version; do \
|
||||
if "$(DESTDIR)$(bindir)/$$f" $$opt >c$${pid}_.out \
|
||||
2>c$${pid}_.err </dev/null \
|
||||
&& test -n "`cat c$${pid}_.out`" \
|
||||
&& test -z "`cat c$${pid}_.err`"; then :; \
|
||||
else echo "$$f does not support $$opt" 1>&2; bad=1; fi; \
|
||||
done; \
|
||||
done; rm -f c$${pid}_.???; exit $$bad
|
||||
tags TAGS:
|
||||
|
||||
ctags CTAGS:
|
||||
|
||||
cscope cscopelist:
|
||||
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
|
@ -395,7 +449,7 @@ install-ps: install-ps-am
|
|||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am:
|
||||
installcheck-am: installcheck-dist_binSCRIPTS
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -f Makefile
|
||||
|
@ -417,16 +471,17 @@ uninstall-am: uninstall-dist_binSCRIPTS
|
|||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: all all-am check check-am clean clean-generic distclean \
|
||||
distclean-generic distdir dvi dvi-am html html-am info info-am \
|
||||
install install-am install-data install-data-am \
|
||||
install-dist_binSCRIPTS install-dvi install-dvi-am \
|
||||
install-exec install-exec-am 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 \
|
||||
.PHONY: all all-am check check-am clean clean-generic cscopelist-am \
|
||||
ctags-am distclean distclean-generic distdir dvi dvi-am html \
|
||||
html-am info info-am install install-am install-data \
|
||||
install-data-am install-dist_binSCRIPTS install-dvi \
|
||||
install-dvi-am install-exec install-exec-am 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 \
|
||||
installcheck-dist_binSCRIPTS installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
|
||||
pdf-am ps ps-am uninstall uninstall-am \
|
||||
pdf-am ps ps-am tags-am uninstall uninstall-am \
|
||||
uninstall-dist_binSCRIPTS
|
||||
|
||||
|
||||
|
|
14
install-sh
14
install-sh
|
@ -1,7 +1,7 @@
|
|||
#!/bin/sh
|
||||
# install - install a program, script, or datafile
|
||||
|
||||
scriptversion=2011-01-19.21; # UTC
|
||||
scriptversion=2011-11-20.07; # UTC
|
||||
|
||||
# This originates from X11R5 (mit/util/scripts/install.sh), which was
|
||||
# later released in X11R6 (xc/config/util/install.sh) with the
|
||||
|
@ -35,7 +35,7 @@ scriptversion=2011-01-19.21; # UTC
|
|||
# FSF changes to this file are in the public domain.
|
||||
#
|
||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||
# `make' implicit rules from creating a file called install from it
|
||||
# 'make' implicit rules from creating a file called install from it
|
||||
# when there is no Makefile.
|
||||
#
|
||||
# This script is compatible with the BSD install script, but was written
|
||||
|
@ -156,7 +156,7 @@ while test $# -ne 0; do
|
|||
-s) stripcmd=$stripprog;;
|
||||
|
||||
-t) dst_arg=$2
|
||||
# Protect names problematic for `test' and other utilities.
|
||||
# Protect names problematic for 'test' and other utilities.
|
||||
case $dst_arg in
|
||||
-* | [=\(\)!]) dst_arg=./$dst_arg;;
|
||||
esac
|
||||
|
@ -190,7 +190,7 @@ if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
|
|||
fi
|
||||
shift # arg
|
||||
dst_arg=$arg
|
||||
# Protect names problematic for `test' and other utilities.
|
||||
# Protect names problematic for 'test' and other utilities.
|
||||
case $dst_arg in
|
||||
-* | [=\(\)!]) dst_arg=./$dst_arg;;
|
||||
esac
|
||||
|
@ -202,7 +202,7 @@ if test $# -eq 0; then
|
|||
echo "$0: no input file specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
# It's OK to call `install-sh -d' without argument.
|
||||
# It's OK to call 'install-sh -d' without argument.
|
||||
# This can happen when creating conditional directories.
|
||||
exit 0
|
||||
fi
|
||||
|
@ -240,7 +240,7 @@ fi
|
|||
|
||||
for src
|
||||
do
|
||||
# Protect names problematic for `test' and other utilities.
|
||||
# Protect names problematic for 'test' and other utilities.
|
||||
case $src in
|
||||
-* | [=\(\)!]) src=./$src;;
|
||||
esac
|
||||
|
@ -354,7 +354,7 @@ do
|
|||
if test -z "$dir_arg" || {
|
||||
# Check for POSIX incompatibilities with -m.
|
||||
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
|
||||
# other-writeable bit of parent directory when it shouldn't.
|
||||
# other-writable bit of parent directory when it shouldn't.
|
||||
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
|
||||
ls_ld_tmpdir=`ls -ld "$tmpdir"`
|
||||
case $ls_ld_tmpdir in
|
||||
|
|
116
m4/Makefile.in
116
m4/Makefile.in
|
@ -1,9 +1,8 @@
|
|||
# Makefile.in generated by automake 1.11.6 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.13.3 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
|
||||
# Foundation, Inc.
|
||||
# Copyright (C) 1994-2013 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.
|
||||
|
@ -15,23 +14,51 @@
|
|||
|
||||
@SET_MAKE@
|
||||
VPATH = @srcdir@
|
||||
am__make_dryrun = \
|
||||
{ \
|
||||
am__dry=no; \
|
||||
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
|
||||
am__make_running_with_option = \
|
||||
case $${target_option-} in \
|
||||
?) ;; \
|
||||
*) echo "am__make_running_with_option: internal error: invalid" \
|
||||
"target option '$${target_option-}' specified" >&2; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
has_opt=no; \
|
||||
sane_makeflags=$$MAKEFLAGS; \
|
||||
if $(am__is_gnu_make); then \
|
||||
sane_makeflags=$$MFLAGS; \
|
||||
else \
|
||||
case $$MAKEFLAGS in \
|
||||
*\\[\ \ ]*) \
|
||||
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
|
||||
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
|
||||
*) \
|
||||
for am__flg in $$MAKEFLAGS; do \
|
||||
case $$am__flg in \
|
||||
*=*|--*) ;; \
|
||||
*n*) am__dry=yes; break;; \
|
||||
esac; \
|
||||
done;; \
|
||||
bs=\\; \
|
||||
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
|
||||
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
|
||||
esac; \
|
||||
test $$am__dry = yes; \
|
||||
}
|
||||
fi; \
|
||||
skip_next=no; \
|
||||
strip_trailopt () \
|
||||
{ \
|
||||
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
|
||||
}; \
|
||||
for flg in $$sane_makeflags; do \
|
||||
test $$skip_next = yes && { skip_next=no; continue; }; \
|
||||
case $$flg in \
|
||||
*=*|--*) continue;; \
|
||||
-*I) strip_trailopt 'I'; skip_next=yes;; \
|
||||
-*I?*) strip_trailopt 'I';; \
|
||||
-*O) strip_trailopt 'O'; skip_next=yes;; \
|
||||
-*O?*) strip_trailopt 'O';; \
|
||||
-*l) strip_trailopt 'l'; skip_next=yes;; \
|
||||
-*l?*) strip_trailopt 'l';; \
|
||||
-[dEDm]) skip_next=yes;; \
|
||||
-[JT]) skip_next=yes;; \
|
||||
esac; \
|
||||
case $$flg in \
|
||||
*$$target_option*) has_opt=yes; break;; \
|
||||
esac; \
|
||||
done; \
|
||||
test $$has_opt = yes
|
||||
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
|
||||
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
|
@ -51,18 +78,30 @@ POST_UNINSTALL = :
|
|||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
subdir = m4
|
||||
DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
|
||||
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am README
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/attribute.m4 \
|
||||
$(top_srcdir)/m4/curses.m4 $(top_srcdir)/m4/lzo.m4 \
|
||||
$(top_srcdir)/m4/openssl.m4 $(top_srcdir)/m4/readline.m4 \
|
||||
$(top_srcdir)/m4/zlib.m4 $(top_srcdir)/configure.in
|
||||
$(top_srcdir)/m4/zlib.m4 $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
AM_V_P = $(am__v_P_@AM_V@)
|
||||
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
|
||||
am__v_P_0 = false
|
||||
am__v_P_1 = :
|
||||
AM_V_GEN = $(am__v_GEN_@AM_V@)
|
||||
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
|
||||
am__v_GEN_0 = @echo " GEN " $@;
|
||||
am__v_GEN_1 =
|
||||
AM_V_at = $(am__v_at_@AM_V@)
|
||||
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
||||
am__v_at_0 = @
|
||||
am__v_at_1 =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
am__can_run_installinfo = \
|
||||
|
@ -70,9 +109,11 @@ am__can_run_installinfo = \
|
|||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
|
@ -92,7 +133,6 @@ ECHO_T = @ECHO_T@
|
|||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
GREP = @GREP@
|
||||
INCLUDES = @INCLUDES@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
|
@ -106,7 +146,6 @@ LIBOBJS = @LIBOBJS@
|
|||
LIBS = @LIBS@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
OBJEXT = @OBJEXT@
|
||||
|
@ -178,7 +217,7 @@ EXTRA_DIST = README *.m4
|
|||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
|
@ -203,16 +242,16 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
|||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
tags: TAGS
|
||||
TAGS:
|
||||
tags TAGS:
|
||||
|
||||
ctags: CTAGS
|
||||
CTAGS:
|
||||
ctags CTAGS:
|
||||
|
||||
cscope cscopelist:
|
||||
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
|
@ -347,15 +386,16 @@ uninstall-am:
|
|||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: all all-am check check-am clean clean-generic distclean \
|
||||
distclean-generic distdir dvi dvi-am html html-am info info-am \
|
||||
install install-am install-data install-data-am install-dvi \
|
||||
install-dvi-am install-exec install-exec-am 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-generic pdf pdf-am ps ps-am uninstall uninstall-am
|
||||
.PHONY: all all-am check check-am clean clean-generic cscopelist-am \
|
||||
ctags-am distclean distclean-generic distdir dvi dvi-am html \
|
||||
html-am info info-am install install-am install-data \
|
||||
install-data-am install-dvi install-dvi-am install-exec \
|
||||
install-exec-am 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-generic pdf \
|
||||
pdf-am ps ps-am tags-am uninstall uninstall-am
|
||||
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
|
|
412
missing
412
missing
|
@ -1,11 +1,10 @@
|
|||
#! /bin/sh
|
||||
# Common stub for a few missing GNU programs while installing.
|
||||
# Common wrapper for a few potentially missing GNU programs.
|
||||
|
||||
scriptversion=2012-01-06.13; # UTC
|
||||
scriptversion=2012-06-26.16; # UTC
|
||||
|
||||
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
|
||||
# 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
|
||||
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
|
||||
# Copyright (C) 1996-2013 Free Software Foundation, Inc.
|
||||
# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
@ -26,68 +25,40 @@ scriptversion=2012-01-06.13; # UTC
|
|||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
if test $# -eq 0; then
|
||||
echo 1>&2 "Try \`$0 --help' for more information"
|
||||
echo 1>&2 "Try '$0 --help' for more information"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
run=:
|
||||
sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
|
||||
sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
|
||||
|
||||
# In the cases where this matters, `missing' is being run in the
|
||||
# srcdir already.
|
||||
if test -f configure.ac; then
|
||||
configure_ac=configure.ac
|
||||
else
|
||||
configure_ac=configure.in
|
||||
fi
|
||||
|
||||
msg="missing on your system"
|
||||
|
||||
case $1 in
|
||||
--run)
|
||||
# Try to run requested program, and just exit if it succeeds.
|
||||
run=
|
||||
shift
|
||||
"$@" && exit 0
|
||||
# Exit code 63 means version mismatch. This often happens
|
||||
# when the user try to use an ancient version of a tool on
|
||||
# a file that requires a minimum version. In this case we
|
||||
# we should proceed has if the program had been absent, or
|
||||
# if --run hadn't been passed.
|
||||
if test $? = 63; then
|
||||
run=:
|
||||
msg="probably too old"
|
||||
fi
|
||||
;;
|
||||
|
||||
--is-lightweight)
|
||||
# Used by our autoconf macros to check whether the available missing
|
||||
# script is modern enough.
|
||||
exit 0
|
||||
;;
|
||||
|
||||
--run)
|
||||
# Back-compat with the calling convention used by older automake.
|
||||
shift
|
||||
;;
|
||||
|
||||
-h|--h|--he|--hel|--help)
|
||||
echo "\
|
||||
$0 [OPTION]... PROGRAM [ARGUMENT]...
|
||||
|
||||
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
|
||||
error status if there is no known handling for PROGRAM.
|
||||
Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
|
||||
to PROGRAM being missing or too old.
|
||||
|
||||
Options:
|
||||
-h, --help display this help and exit
|
||||
-v, --version output version information and exit
|
||||
--run try to run the given command, and emulate it if it fails
|
||||
|
||||
Supported PROGRAM values:
|
||||
aclocal touch file \`aclocal.m4'
|
||||
autoconf touch file \`configure'
|
||||
autoheader touch file \`config.h.in'
|
||||
autom4te touch the output file, or create a stub one
|
||||
automake touch all \`Makefile.in' files
|
||||
bison create \`y.tab.[ch]', if possible, from existing .[ch]
|
||||
flex create \`lex.yy.c', if possible, from existing .c
|
||||
help2man touch the output file
|
||||
lex create \`lex.yy.c', if possible, from existing .c
|
||||
makeinfo touch the output file
|
||||
yacc create \`y.tab.[ch]', if possible, from existing .[ch]
|
||||
aclocal autoconf autoheader autom4te automake makeinfo
|
||||
bison yacc flex lex help2man
|
||||
|
||||
Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
|
||||
\`g' are ignored when checking the name.
|
||||
Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
|
||||
'g' are ignored when checking the name.
|
||||
|
||||
Send bug reports to <bug-automake@gnu.org>."
|
||||
exit $?
|
||||
|
@ -99,228 +70,141 @@ Send bug reports to <bug-automake@gnu.org>."
|
|||
;;
|
||||
|
||||
-*)
|
||||
echo 1>&2 "$0: Unknown \`$1' option"
|
||||
echo 1>&2 "Try \`$0 --help' for more information"
|
||||
echo 1>&2 "$0: unknown '$1' option"
|
||||
echo 1>&2 "Try '$0 --help' for more information"
|
||||
exit 1
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
# normalize program name to check for.
|
||||
program=`echo "$1" | sed '
|
||||
s/^gnu-//; t
|
||||
s/^gnu//; t
|
||||
s/^g//; t'`
|
||||
# Run the given program, remember its exit status.
|
||||
"$@"; st=$?
|
||||
|
||||
# Now exit if we have it, but it failed. Also exit now if we
|
||||
# don't have it and --version was passed (most likely to detect
|
||||
# the program). This is about non-GNU programs, so use $1 not
|
||||
# $program.
|
||||
case $1 in
|
||||
lex*|yacc*)
|
||||
# Not GNU programs, they don't have --version.
|
||||
# If it succeeded, we are done.
|
||||
test $st -eq 0 && exit 0
|
||||
|
||||
# Also exit now if we it failed (or wasn't found), and '--version' was
|
||||
# passed; such an option is passed most likely to detect whether the
|
||||
# program is present and works.
|
||||
case $2 in --version|--help) exit $st;; esac
|
||||
|
||||
# Exit code 63 means version mismatch. This often happens when the user
|
||||
# tries to use an ancient version of a tool on a file that requires a
|
||||
# minimum version.
|
||||
if test $st -eq 63; then
|
||||
msg="probably too old"
|
||||
elif test $st -eq 127; then
|
||||
# Program was missing.
|
||||
msg="missing on your system"
|
||||
else
|
||||
# Program was found and executed, but failed. Give up.
|
||||
exit $st
|
||||
fi
|
||||
|
||||
perl_URL=http://www.perl.org/
|
||||
flex_URL=http://flex.sourceforge.net/
|
||||
gnu_software_URL=http://www.gnu.org/software
|
||||
|
||||
program_details ()
|
||||
{
|
||||
case $1 in
|
||||
aclocal|automake)
|
||||
echo "The '$1' program is part of the GNU Automake package:"
|
||||
echo "<$gnu_software_URL/automake>"
|
||||
echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
|
||||
echo "<$gnu_software_URL/autoconf>"
|
||||
echo "<$gnu_software_URL/m4/>"
|
||||
echo "<$perl_URL>"
|
||||
;;
|
||||
autoconf|autom4te|autoheader)
|
||||
echo "The '$1' program is part of the GNU Autoconf package:"
|
||||
echo "<$gnu_software_URL/autoconf/>"
|
||||
echo "It also requires GNU m4 and Perl in order to run:"
|
||||
echo "<$gnu_software_URL/m4/>"
|
||||
echo "<$perl_URL>"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
give_advice ()
|
||||
{
|
||||
# Normalize program name to check for.
|
||||
normalized_program=`echo "$1" | sed '
|
||||
s/^gnu-//; t
|
||||
s/^gnu//; t
|
||||
s/^g//; t'`
|
||||
|
||||
printf '%s\n' "'$1' is $msg."
|
||||
|
||||
configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
|
||||
case $normalized_program in
|
||||
autoconf*)
|
||||
echo "You should only need it if you modified 'configure.ac',"
|
||||
echo "or m4 files included by it."
|
||||
program_details 'autoconf'
|
||||
;;
|
||||
autoheader*)
|
||||
echo "You should only need it if you modified 'acconfig.h' or"
|
||||
echo "$configure_deps."
|
||||
program_details 'autoheader'
|
||||
;;
|
||||
automake*)
|
||||
echo "You should only need it if you modified 'Makefile.am' or"
|
||||
echo "$configure_deps."
|
||||
program_details 'automake'
|
||||
;;
|
||||
aclocal*)
|
||||
echo "You should only need it if you modified 'acinclude.m4' or"
|
||||
echo "$configure_deps."
|
||||
program_details 'aclocal'
|
||||
;;
|
||||
autom4te*)
|
||||
echo "You might have modified some maintainer files that require"
|
||||
echo "the 'automa4te' program to be rebuilt."
|
||||
program_details 'autom4te'
|
||||
;;
|
||||
bison*|yacc*)
|
||||
echo "You should only need it if you modified a '.y' file."
|
||||
echo "You may want to install the GNU Bison package:"
|
||||
echo "<$gnu_software_URL/bison/>"
|
||||
;;
|
||||
lex*|flex*)
|
||||
echo "You should only need it if you modified a '.l' file."
|
||||
echo "You may want to install the Fast Lexical Analyzer package:"
|
||||
echo "<$flex_URL>"
|
||||
;;
|
||||
help2man*)
|
||||
echo "You should only need it if you modified a dependency" \
|
||||
"of a man page."
|
||||
echo "You may want to install the GNU Help2man package:"
|
||||
echo "<$gnu_software_URL/help2man/>"
|
||||
;;
|
||||
makeinfo*)
|
||||
echo "You should only need it if you modified a '.texi' file, or"
|
||||
echo "any other file indirectly affecting the aspect of the manual."
|
||||
echo "You might want to install the Texinfo package:"
|
||||
echo "<$gnu_software_URL/texinfo/>"
|
||||
echo "The spurious makeinfo call might also be the consequence of"
|
||||
echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
|
||||
echo "want to install GNU make:"
|
||||
echo "<$gnu_software_URL/make/>"
|
||||
;;
|
||||
*)
|
||||
echo "You might have modified some files without having the proper"
|
||||
echo "tools for further handling them. Check the 'README' file, it"
|
||||
echo "often tells you about the needed prerequisites for installing"
|
||||
echo "this package. You may also peek at any GNU archive site, in"
|
||||
echo "case some other package contains this missing '$1' program."
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
*)
|
||||
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
|
||||
# We have it, but it failed.
|
||||
exit 1
|
||||
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
|
||||
# Could not run --version or --help. This is probably someone
|
||||
# running `$TOOL --version' or `$TOOL --help' to check whether
|
||||
# $TOOL exists and not knowing $TOOL uses missing.
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
give_advice "$1" | sed -e '1s/^/WARNING: /' \
|
||||
-e '2,$s/^/ /' >&2
|
||||
|
||||
# If it does not exist, or fails to run (possibly an outdated version),
|
||||
# try to emulate it.
|
||||
case $program in
|
||||
aclocal*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
|
||||
to install the \`Automake' and \`Perl' packages. Grab them from
|
||||
any GNU archive site."
|
||||
touch aclocal.m4
|
||||
;;
|
||||
|
||||
autoconf*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`${configure_ac}'. You might want to install the
|
||||
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
|
||||
archive site."
|
||||
touch configure
|
||||
;;
|
||||
|
||||
autoheader*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`acconfig.h' or \`${configure_ac}'. You might want
|
||||
to install the \`Autoconf' and \`GNU m4' packages. Grab them
|
||||
from any GNU archive site."
|
||||
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
|
||||
test -z "$files" && files="config.h"
|
||||
touch_files=
|
||||
for f in $files; do
|
||||
case $f in
|
||||
*:*) touch_files="$touch_files "`echo "$f" |
|
||||
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
|
||||
*) touch_files="$touch_files $f.in";;
|
||||
esac
|
||||
done
|
||||
touch $touch_files
|
||||
;;
|
||||
|
||||
automake*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
|
||||
You might want to install the \`Automake' and \`Perl' packages.
|
||||
Grab them from any GNU archive site."
|
||||
find . -type f -name Makefile.am -print |
|
||||
sed 's/\.am$/.in/' |
|
||||
while read f; do touch "$f"; done
|
||||
;;
|
||||
|
||||
autom4te*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is needed, but is $msg.
|
||||
You might have modified some files without having the
|
||||
proper tools for further handling them.
|
||||
You can get \`$1' as part of \`Autoconf' from any GNU
|
||||
archive site."
|
||||
|
||||
file=`echo "$*" | sed -n "$sed_output"`
|
||||
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
|
||||
if test -f "$file"; then
|
||||
touch $file
|
||||
else
|
||||
test -z "$file" || exec >$file
|
||||
echo "#! /bin/sh"
|
||||
echo "# Created by GNU Automake missing as a replacement of"
|
||||
echo "# $ $@"
|
||||
echo "exit 0"
|
||||
chmod +x $file
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
bison*|yacc*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' $msg. You should only need it if
|
||||
you modified a \`.y' file. You may need the \`Bison' package
|
||||
in order for those modifications to take effect. You can get
|
||||
\`Bison' from any GNU archive site."
|
||||
rm -f y.tab.c y.tab.h
|
||||
if test $# -ne 1; then
|
||||
eval LASTARG=\${$#}
|
||||
case $LASTARG in
|
||||
*.y)
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
|
||||
if test -f "$SRCFILE"; then
|
||||
cp "$SRCFILE" y.tab.c
|
||||
fi
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
|
||||
if test -f "$SRCFILE"; then
|
||||
cp "$SRCFILE" y.tab.h
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if test ! -f y.tab.h; then
|
||||
echo >y.tab.h
|
||||
fi
|
||||
if test ! -f y.tab.c; then
|
||||
echo 'main() { return 0; }' >y.tab.c
|
||||
fi
|
||||
;;
|
||||
|
||||
lex*|flex*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified a \`.l' file. You may need the \`Flex' package
|
||||
in order for those modifications to take effect. You can get
|
||||
\`Flex' from any GNU archive site."
|
||||
rm -f lex.yy.c
|
||||
if test $# -ne 1; then
|
||||
eval LASTARG=\${$#}
|
||||
case $LASTARG in
|
||||
*.l)
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
|
||||
if test -f "$SRCFILE"; then
|
||||
cp "$SRCFILE" lex.yy.c
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if test ! -f lex.yy.c; then
|
||||
echo 'main() { return 0; }' >lex.yy.c
|
||||
fi
|
||||
;;
|
||||
|
||||
help2man*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified a dependency of a manual page. You may need the
|
||||
\`Help2man' package in order for those modifications to take
|
||||
effect. You can get \`Help2man' from any GNU archive site."
|
||||
|
||||
file=`echo "$*" | sed -n "$sed_output"`
|
||||
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
|
||||
if test -f "$file"; then
|
||||
touch $file
|
||||
else
|
||||
test -z "$file" || exec >$file
|
||||
echo ".ab help2man is required to generate this page"
|
||||
exit $?
|
||||
fi
|
||||
;;
|
||||
|
||||
makeinfo*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified a \`.texi' or \`.texinfo' file, or any other file
|
||||
indirectly affecting the aspect of the manual. The spurious
|
||||
call might also be the consequence of using a buggy \`make' (AIX,
|
||||
DU, IRIX). You might want to install the \`Texinfo' package or
|
||||
the \`GNU make' package. Grab either from any GNU archive site."
|
||||
# The file to touch is that specified with -o ...
|
||||
file=`echo "$*" | sed -n "$sed_output"`
|
||||
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
|
||||
if test -z "$file"; then
|
||||
# ... or it is the one specified with @setfilename ...
|
||||
infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
|
||||
file=`sed -n '
|
||||
/^@setfilename/{
|
||||
s/.* \([^ ]*\) *$/\1/
|
||||
p
|
||||
q
|
||||
}' $infile`
|
||||
# ... or it is derived from the source name (dir/f.texi becomes f.info)
|
||||
test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
|
||||
fi
|
||||
# If the file does not exist, the user really needs makeinfo;
|
||||
# let's fail without touching anything.
|
||||
test -f $file || exit 1
|
||||
touch $file
|
||||
;;
|
||||
|
||||
*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is needed, and is $msg.
|
||||
You might have modified some files without having the
|
||||
proper tools for further handling them. Check the \`README' file,
|
||||
it often tells you about the needed prerequisites for installing
|
||||
this package. You may also peek at any GNU archive site, in case
|
||||
some other package would contain this missing \`$1' program."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
# Propagate the correct exit status (expected to be 127 for a program
|
||||
# not found, 63 for a program that failed due to version mismatch).
|
||||
exit $st
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
|
|
191
src/Makefile.am
191
src/Makefile.am
|
@ -4,13 +4,114 @@ sbin_PROGRAMS = tincd tinc sptps_test
|
|||
|
||||
EXTRA_DIST = linux bsd solaris cygwin mingw openssl gcrypt
|
||||
|
||||
DEFAULT_INCLUDES =
|
||||
|
||||
tincd_SOURCES = \
|
||||
utils.c getopt.c getopt1.c list.c splay_tree.c dropin.c fake-getaddrinfo.c fake-getnameinfo.c hash.c \
|
||||
buffer.c conf.c connection.c control.c edge.c graph.c logger.c meta.c net.c net_packet.c net_setup.c \
|
||||
net_socket.c netutl.c node.c process.c protocol.c protocol_auth.c protocol_edge.c protocol_misc.c \
|
||||
protocol_key.c protocol_subnet.c route.c sptps.c subnet.c subnet_parse.c event.c tincd.c \
|
||||
dummy_device.c raw_socket_device.c multicast_device.c names.c
|
||||
buffer.c buffer.h \
|
||||
cipher.h \
|
||||
conf.c conf.h \
|
||||
connection.c connection.h \
|
||||
control.c control.h \
|
||||
control_common.h \
|
||||
crypto.h \
|
||||
device.h \
|
||||
digest.h \
|
||||
dropin.c dropin.h \
|
||||
dummy_device.c \
|
||||
ecdh.h \
|
||||
ecdsa.h \
|
||||
ecdsagen.h \
|
||||
edge.c edge.h \
|
||||
ethernet.h \
|
||||
event.c event.h \
|
||||
fake-gai-errnos.h \
|
||||
fake-getaddrinfo.c fake-getaddrinfo.h \
|
||||
fake-getnameinfo.c fake-getnameinfo.h \
|
||||
getopt.c getopt.h \
|
||||
getopt1.c \
|
||||
graph.c graph.h \
|
||||
hash.c hash.h \
|
||||
have.h \
|
||||
ipv4.h \
|
||||
ipv6.h \
|
||||
list.c list.h \
|
||||
logger.c logger.h \
|
||||
meta.c meta.h \
|
||||
multicast_device.c \
|
||||
names.c names.h \
|
||||
net.c net.h \
|
||||
net_packet.c \
|
||||
net_setup.c \
|
||||
net_socket.c \
|
||||
netutl.c netutl.h \
|
||||
node.c node.h \
|
||||
prf.h \
|
||||
process.c process.h \
|
||||
protocol.c protocol.h \
|
||||
protocol_auth.c \
|
||||
protocol_edge.c \
|
||||
protocol_key.c \
|
||||
protocol_misc.c \
|
||||
protocol_subnet.c \
|
||||
raw_socket_device.c \
|
||||
route.c route.h \
|
||||
rsa.h \
|
||||
rsagen.h \
|
||||
splay_tree.c splay_tree.h \
|
||||
sptps.c sptps.h \
|
||||
subnet.c subnet.h \
|
||||
subnet_parse.c \
|
||||
system.h \
|
||||
tincd.c \
|
||||
utils.c utils.h \
|
||||
xalloc.h
|
||||
|
||||
tinc_SOURCES = \
|
||||
dropin.c dropin.h \
|
||||
getopt.c getopt.h \
|
||||
getopt1.c \
|
||||
info.c info.h \
|
||||
invitation.c invitation.h \
|
||||
list.c list.h \
|
||||
names.c names.h \
|
||||
netutl.c netutl.h \
|
||||
sptps.c sptps.h \
|
||||
subnet_parse.c subnet.h \
|
||||
tincctl.c tincctl.h \
|
||||
top.c top.h \
|
||||
utils.c utils.h
|
||||
|
||||
sptps_test_SOURCES = \
|
||||
logger.c logger.h \
|
||||
sptps.c sptps.h \
|
||||
sptps_test.c \
|
||||
utils.c utils.h
|
||||
|
||||
## Conditionally compile device drivers
|
||||
|
||||
if LINUX
|
||||
tincd_SOURCES += linux/device.c
|
||||
endif
|
||||
|
||||
if BSD
|
||||
tincd_SOURCES += bsd/device.c
|
||||
if TUNEMU
|
||||
tincd_SOURCES += bsd/tunemu.c
|
||||
endif
|
||||
endif
|
||||
|
||||
if SOLARIS
|
||||
tincd_SOURCES += solaris/device.c
|
||||
endif
|
||||
|
||||
if MINGW
|
||||
tincd_SOURCES += mingw/device.c
|
||||
endif
|
||||
|
||||
if CYGWIN
|
||||
tincd_SOURCES += cygwin/device.c
|
||||
endif
|
||||
|
||||
if UML
|
||||
tincd_SOURCES += uml_device.c
|
||||
endif
|
||||
|
@ -19,38 +120,64 @@ if VDE
|
|||
tincd_SOURCES += vde_device.c
|
||||
endif
|
||||
|
||||
nodist_tincd_SOURCES = \
|
||||
device.c cipher.c crypto.c ecdh.c ecdsa.c digest.c prf.c rsa.c
|
||||
if OPENSSL
|
||||
tincd_SOURCES += \
|
||||
openssl/cipher.c \
|
||||
openssl/crypto.c \
|
||||
openssl/digest.c \
|
||||
openssl/ecdh.c \
|
||||
openssl/ecdsa.c \
|
||||
openssl/prf.c \
|
||||
openssl/rsa.c
|
||||
tinc_SOURCES += \
|
||||
openssl/cipher.c \
|
||||
openssl/crypto.c \
|
||||
openssl/digest.c \
|
||||
openssl/ecdh.c \
|
||||
openssl/ecdsa.c \
|
||||
openssl/ecdsagen.c \
|
||||
openssl/prf.c \
|
||||
openssl/rsa.c \
|
||||
openssl/rsagen.c
|
||||
sptps_test_SOURCES += \
|
||||
openssl/cipher.c \
|
||||
openssl/crypto.c \
|
||||
openssl/digest.c \
|
||||
openssl/ecdh.c \
|
||||
openssl/ecdsa.c \
|
||||
openssl/prf.c
|
||||
endif
|
||||
|
||||
tinc_SOURCES = \
|
||||
utils.c getopt.c getopt1.c dropin.c \
|
||||
info.c list.c subnet_parse.c tincctl.c top.c names.c
|
||||
|
||||
nodist_tinc_SOURCES = \
|
||||
ecdsagen.c rsagen.c
|
||||
|
||||
sptps_test_SOURCES = \
|
||||
logger.c cipher.c crypto.c ecdh.c ecdsa.c digest.c prf.c \
|
||||
sptps.c sptps_test.c utils.c
|
||||
|
||||
if TUNEMU
|
||||
tincd_SOURCES += bsd/tunemu.c
|
||||
if GCRYPT
|
||||
tincd_SOURCES += \
|
||||
gcrypt/cipher.c \
|
||||
gcrypt/crypto.c \
|
||||
gcrypt/digest.c \
|
||||
gcrypt/ecdh.c \
|
||||
gcrypt/ecdsa.c \
|
||||
gcrypt/prf.c \
|
||||
gcrypt/rsa.c
|
||||
tinc_SOURCES += \
|
||||
gcrypt/cipher.c \
|
||||
gcrypt/crypto.c \
|
||||
gcrypt/digest.c \
|
||||
gcrypt/ecdh.c \
|
||||
gcrypt/ecdsa.c \
|
||||
gcrypt/ecdsagen.c \
|
||||
gcrypt/prf.c \
|
||||
gcrypt/rsa.c \
|
||||
gcrypt/rsagen.c
|
||||
sptps_test_SOURCES += \
|
||||
gcrypt/cipher.c \
|
||||
gcrypt/crypto.c \
|
||||
gcrypt/digest.c \
|
||||
gcrypt/ecdh.c \
|
||||
gcrypt/ecdsa.c \
|
||||
gcrypt/prf.c
|
||||
endif
|
||||
|
||||
tinc_LDADD = $(READLINE_LIBS) $(CURSES_LIBS)
|
||||
|
||||
DEFAULT_INCLUDES =
|
||||
|
||||
INCLUDES = @INCLUDES@ -I$(top_builddir)
|
||||
|
||||
noinst_HEADERS = \
|
||||
xalloc.h utils.h getopt.h list.h splay_tree.h dropin.h fake-getaddrinfo.h fake-getnameinfo.h fake-gai-errnos.h ipv6.h ipv4.h ethernet.h \
|
||||
buffer.h conf.h connection.h control.h control_common.h device.h edge.h graph.h info.h logger.h meta.h net.h netutl.h node.h process.h \
|
||||
protocol.h route.h subnet.h sptps.h tincctl.h top.h bsd/tunemu.h hash.h event.h names.h
|
||||
|
||||
nodist_noinst_HEADERS = \
|
||||
cipher.h crypto.h ecdh.h ecdsa.h digest.h prf.h rsa.h ecdsagen.h rsagen.h
|
||||
|
||||
LIBS = @LIBS@ @LIBGCRYPT_LIBS@
|
||||
|
||||
if TUNEMU
|
||||
|
|
685
src/Makefile.in
685
src/Makefile.in
|
@ -1,9 +1,8 @@
|
|||
# Makefile.in generated by automake 1.11.6 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.13.3 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
|
||||
# Foundation, Inc.
|
||||
# Copyright (C) 1994-2013 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.
|
||||
|
@ -15,25 +14,52 @@
|
|||
|
||||
@SET_MAKE@
|
||||
|
||||
|
||||
VPATH = @srcdir@
|
||||
am__make_dryrun = \
|
||||
{ \
|
||||
am__dry=no; \
|
||||
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
|
||||
am__make_running_with_option = \
|
||||
case $${target_option-} in \
|
||||
?) ;; \
|
||||
*) echo "am__make_running_with_option: internal error: invalid" \
|
||||
"target option '$${target_option-}' specified" >&2; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
has_opt=no; \
|
||||
sane_makeflags=$$MAKEFLAGS; \
|
||||
if $(am__is_gnu_make); then \
|
||||
sane_makeflags=$$MFLAGS; \
|
||||
else \
|
||||
case $$MAKEFLAGS in \
|
||||
*\\[\ \ ]*) \
|
||||
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
|
||||
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
|
||||
*) \
|
||||
for am__flg in $$MAKEFLAGS; do \
|
||||
case $$am__flg in \
|
||||
*=*|--*) ;; \
|
||||
*n*) am__dry=yes; break;; \
|
||||
esac; \
|
||||
done;; \
|
||||
bs=\\; \
|
||||
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
|
||||
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
|
||||
esac; \
|
||||
test $$am__dry = yes; \
|
||||
}
|
||||
fi; \
|
||||
skip_next=no; \
|
||||
strip_trailopt () \
|
||||
{ \
|
||||
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
|
||||
}; \
|
||||
for flg in $$sane_makeflags; do \
|
||||
test $$skip_next = yes && { skip_next=no; continue; }; \
|
||||
case $$flg in \
|
||||
*=*|--*) continue;; \
|
||||
-*I) strip_trailopt 'I'; skip_next=yes;; \
|
||||
-*I?*) strip_trailopt 'I';; \
|
||||
-*O) strip_trailopt 'O'; skip_next=yes;; \
|
||||
-*O?*) strip_trailopt 'O';; \
|
||||
-*l) strip_trailopt 'l'; skip_next=yes;; \
|
||||
-*l?*) strip_trailopt 'l';; \
|
||||
-[dEDm]) skip_next=yes;; \
|
||||
-[JT]) skip_next=yes;; \
|
||||
esac; \
|
||||
case $$flg in \
|
||||
*$$target_option*) has_opt=yes; break;; \
|
||||
esac; \
|
||||
done; \
|
||||
test $$has_opt = yes
|
||||
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
|
||||
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
|
@ -53,18 +79,79 @@ POST_UNINSTALL = :
|
|||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
sbin_PROGRAMS = tincd$(EXEEXT) tinc$(EXEEXT) sptps_test$(EXEEXT)
|
||||
@UML_TRUE@am__append_1 = uml_device.c
|
||||
@VDE_TRUE@am__append_2 = vde_device.c
|
||||
@TUNEMU_TRUE@am__append_3 = bsd/tunemu.c
|
||||
@TUNEMU_TRUE@am__append_4 = -lpcap
|
||||
@LINUX_TRUE@am__append_1 = linux/device.c
|
||||
@BSD_TRUE@am__append_2 = bsd/device.c
|
||||
@BSD_TRUE@@TUNEMU_TRUE@am__append_3 = bsd/tunemu.c
|
||||
@SOLARIS_TRUE@am__append_4 = solaris/device.c
|
||||
@MINGW_TRUE@am__append_5 = mingw/device.c
|
||||
@CYGWIN_TRUE@am__append_6 = cygwin/device.c
|
||||
@UML_TRUE@am__append_7 = uml_device.c
|
||||
@VDE_TRUE@am__append_8 = vde_device.c
|
||||
@OPENSSL_TRUE@am__append_9 = \
|
||||
@OPENSSL_TRUE@ openssl/cipher.c \
|
||||
@OPENSSL_TRUE@ openssl/crypto.c \
|
||||
@OPENSSL_TRUE@ openssl/digest.c \
|
||||
@OPENSSL_TRUE@ openssl/ecdh.c \
|
||||
@OPENSSL_TRUE@ openssl/ecdsa.c \
|
||||
@OPENSSL_TRUE@ openssl/prf.c \
|
||||
@OPENSSL_TRUE@ openssl/rsa.c
|
||||
|
||||
@OPENSSL_TRUE@am__append_10 = \
|
||||
@OPENSSL_TRUE@ openssl/cipher.c \
|
||||
@OPENSSL_TRUE@ openssl/crypto.c \
|
||||
@OPENSSL_TRUE@ openssl/digest.c \
|
||||
@OPENSSL_TRUE@ openssl/ecdh.c \
|
||||
@OPENSSL_TRUE@ openssl/ecdsa.c \
|
||||
@OPENSSL_TRUE@ openssl/ecdsagen.c \
|
||||
@OPENSSL_TRUE@ openssl/prf.c \
|
||||
@OPENSSL_TRUE@ openssl/rsa.c \
|
||||
@OPENSSL_TRUE@ openssl/rsagen.c
|
||||
|
||||
@OPENSSL_TRUE@am__append_11 = \
|
||||
@OPENSSL_TRUE@ openssl/cipher.c \
|
||||
@OPENSSL_TRUE@ openssl/crypto.c \
|
||||
@OPENSSL_TRUE@ openssl/digest.c \
|
||||
@OPENSSL_TRUE@ openssl/ecdh.c \
|
||||
@OPENSSL_TRUE@ openssl/ecdsa.c \
|
||||
@OPENSSL_TRUE@ openssl/prf.c
|
||||
|
||||
@GCRYPT_TRUE@am__append_12 = \
|
||||
@GCRYPT_TRUE@ gcrypt/cipher.c \
|
||||
@GCRYPT_TRUE@ gcrypt/crypto.c \
|
||||
@GCRYPT_TRUE@ gcrypt/digest.c \
|
||||
@GCRYPT_TRUE@ gcrypt/ecdh.c \
|
||||
@GCRYPT_TRUE@ gcrypt/ecdsa.c \
|
||||
@GCRYPT_TRUE@ gcrypt/prf.c \
|
||||
@GCRYPT_TRUE@ gcrypt/rsa.c
|
||||
|
||||
@GCRYPT_TRUE@am__append_13 = \
|
||||
@GCRYPT_TRUE@ gcrypt/cipher.c \
|
||||
@GCRYPT_TRUE@ gcrypt/crypto.c \
|
||||
@GCRYPT_TRUE@ gcrypt/digest.c \
|
||||
@GCRYPT_TRUE@ gcrypt/ecdh.c \
|
||||
@GCRYPT_TRUE@ gcrypt/ecdsa.c \
|
||||
@GCRYPT_TRUE@ gcrypt/ecdsagen.c \
|
||||
@GCRYPT_TRUE@ gcrypt/prf.c \
|
||||
@GCRYPT_TRUE@ gcrypt/rsa.c \
|
||||
@GCRYPT_TRUE@ gcrypt/rsagen.c
|
||||
|
||||
@GCRYPT_TRUE@am__append_14 = \
|
||||
@GCRYPT_TRUE@ gcrypt/cipher.c \
|
||||
@GCRYPT_TRUE@ gcrypt/crypto.c \
|
||||
@GCRYPT_TRUE@ gcrypt/digest.c \
|
||||
@GCRYPT_TRUE@ gcrypt/ecdh.c \
|
||||
@GCRYPT_TRUE@ gcrypt/ecdsa.c \
|
||||
@GCRYPT_TRUE@ gcrypt/prf.c
|
||||
|
||||
@TUNEMU_TRUE@am__append_15 = -lpcap
|
||||
subdir = src
|
||||
DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
|
||||
$(srcdir)/Makefile.in
|
||||
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
|
||||
$(top_srcdir)/depcomp
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/attribute.m4 \
|
||||
$(top_srcdir)/m4/curses.m4 $(top_srcdir)/m4/lzo.m4 \
|
||||
$(top_srcdir)/m4/openssl.m4 $(top_srcdir)/m4/readline.m4 \
|
||||
$(top_srcdir)/m4/zlib.m4 $(top_srcdir)/configure.in
|
||||
$(top_srcdir)/m4/zlib.m4 $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
|
@ -73,76 +160,170 @@ CONFIG_CLEAN_FILES =
|
|||
CONFIG_CLEAN_VPATH_FILES =
|
||||
am__installdirs = "$(DESTDIR)$(sbindir)"
|
||||
PROGRAMS = $(sbin_PROGRAMS)
|
||||
am_sptps_test_OBJECTS = logger.$(OBJEXT) cipher.$(OBJEXT) \
|
||||
crypto.$(OBJEXT) ecdh.$(OBJEXT) ecdsa.$(OBJEXT) \
|
||||
digest.$(OBJEXT) prf.$(OBJEXT) sptps.$(OBJEXT) \
|
||||
sptps_test.$(OBJEXT) utils.$(OBJEXT)
|
||||
am__sptps_test_SOURCES_DIST = logger.c logger.h sptps.c sptps.h \
|
||||
sptps_test.c utils.c utils.h openssl/cipher.c openssl/crypto.c \
|
||||
openssl/digest.c openssl/ecdh.c openssl/ecdsa.c openssl/prf.c \
|
||||
gcrypt/cipher.c gcrypt/crypto.c gcrypt/digest.c gcrypt/ecdh.c \
|
||||
gcrypt/ecdsa.c gcrypt/prf.c
|
||||
am__dirstamp = $(am__leading_dot)dirstamp
|
||||
@OPENSSL_TRUE@am__objects_1 = openssl/cipher.$(OBJEXT) \
|
||||
@OPENSSL_TRUE@ openssl/crypto.$(OBJEXT) \
|
||||
@OPENSSL_TRUE@ openssl/digest.$(OBJEXT) openssl/ecdh.$(OBJEXT) \
|
||||
@OPENSSL_TRUE@ openssl/ecdsa.$(OBJEXT) openssl/prf.$(OBJEXT)
|
||||
@GCRYPT_TRUE@am__objects_2 = gcrypt/cipher.$(OBJEXT) \
|
||||
@GCRYPT_TRUE@ gcrypt/crypto.$(OBJEXT) gcrypt/digest.$(OBJEXT) \
|
||||
@GCRYPT_TRUE@ gcrypt/ecdh.$(OBJEXT) gcrypt/ecdsa.$(OBJEXT) \
|
||||
@GCRYPT_TRUE@ gcrypt/prf.$(OBJEXT)
|
||||
am_sptps_test_OBJECTS = logger.$(OBJEXT) sptps.$(OBJEXT) \
|
||||
sptps_test.$(OBJEXT) utils.$(OBJEXT) $(am__objects_1) \
|
||||
$(am__objects_2)
|
||||
sptps_test_OBJECTS = $(am_sptps_test_OBJECTS)
|
||||
sptps_test_LDADD = $(LDADD)
|
||||
am_tinc_OBJECTS = utils.$(OBJEXT) getopt.$(OBJEXT) getopt1.$(OBJEXT) \
|
||||
dropin.$(OBJEXT) info.$(OBJEXT) list.$(OBJEXT) \
|
||||
am__tinc_SOURCES_DIST = dropin.c dropin.h getopt.c getopt.h getopt1.c \
|
||||
info.c info.h invitation.c invitation.h list.c list.h names.c \
|
||||
names.h netutl.c netutl.h sptps.c sptps.h subnet_parse.c \
|
||||
subnet.h tincctl.c tincctl.h top.c top.h utils.c utils.h \
|
||||
openssl/cipher.c openssl/crypto.c openssl/digest.c \
|
||||
openssl/ecdh.c openssl/ecdsa.c openssl/ecdsagen.c \
|
||||
openssl/prf.c openssl/rsa.c openssl/rsagen.c gcrypt/cipher.c \
|
||||
gcrypt/crypto.c gcrypt/digest.c gcrypt/ecdh.c gcrypt/ecdsa.c \
|
||||
gcrypt/ecdsagen.c gcrypt/prf.c gcrypt/rsa.c gcrypt/rsagen.c
|
||||
@OPENSSL_TRUE@am__objects_3 = openssl/cipher.$(OBJEXT) \
|
||||
@OPENSSL_TRUE@ openssl/crypto.$(OBJEXT) \
|
||||
@OPENSSL_TRUE@ openssl/digest.$(OBJEXT) openssl/ecdh.$(OBJEXT) \
|
||||
@OPENSSL_TRUE@ openssl/ecdsa.$(OBJEXT) \
|
||||
@OPENSSL_TRUE@ openssl/ecdsagen.$(OBJEXT) openssl/prf.$(OBJEXT) \
|
||||
@OPENSSL_TRUE@ openssl/rsa.$(OBJEXT) openssl/rsagen.$(OBJEXT)
|
||||
@GCRYPT_TRUE@am__objects_4 = gcrypt/cipher.$(OBJEXT) \
|
||||
@GCRYPT_TRUE@ gcrypt/crypto.$(OBJEXT) gcrypt/digest.$(OBJEXT) \
|
||||
@GCRYPT_TRUE@ gcrypt/ecdh.$(OBJEXT) gcrypt/ecdsa.$(OBJEXT) \
|
||||
@GCRYPT_TRUE@ gcrypt/ecdsagen.$(OBJEXT) gcrypt/prf.$(OBJEXT) \
|
||||
@GCRYPT_TRUE@ gcrypt/rsa.$(OBJEXT) gcrypt/rsagen.$(OBJEXT)
|
||||
am_tinc_OBJECTS = dropin.$(OBJEXT) getopt.$(OBJEXT) getopt1.$(OBJEXT) \
|
||||
info.$(OBJEXT) invitation.$(OBJEXT) list.$(OBJEXT) \
|
||||
names.$(OBJEXT) netutl.$(OBJEXT) sptps.$(OBJEXT) \
|
||||
subnet_parse.$(OBJEXT) tincctl.$(OBJEXT) top.$(OBJEXT) \
|
||||
names.$(OBJEXT)
|
||||
nodist_tinc_OBJECTS = ecdsagen.$(OBJEXT) rsagen.$(OBJEXT)
|
||||
tinc_OBJECTS = $(am_tinc_OBJECTS) $(nodist_tinc_OBJECTS)
|
||||
utils.$(OBJEXT) $(am__objects_3) $(am__objects_4)
|
||||
tinc_OBJECTS = $(am_tinc_OBJECTS)
|
||||
am__DEPENDENCIES_1 =
|
||||
tinc_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
|
||||
am__tincd_SOURCES_DIST = utils.c getopt.c getopt1.c list.c \
|
||||
splay_tree.c dropin.c fake-getaddrinfo.c fake-getnameinfo.c \
|
||||
hash.c buffer.c conf.c connection.c control.c edge.c graph.c \
|
||||
logger.c meta.c net.c net_packet.c net_setup.c net_socket.c \
|
||||
netutl.c node.c process.c protocol.c protocol_auth.c \
|
||||
protocol_edge.c protocol_misc.c protocol_key.c \
|
||||
protocol_subnet.c route.c sptps.c subnet.c subnet_parse.c \
|
||||
event.c tincd.c dummy_device.c raw_socket_device.c \
|
||||
multicast_device.c names.c uml_device.c vde_device.c \
|
||||
bsd/tunemu.c
|
||||
@UML_TRUE@am__objects_1 = uml_device.$(OBJEXT)
|
||||
@VDE_TRUE@am__objects_2 = vde_device.$(OBJEXT)
|
||||
@TUNEMU_TRUE@am__objects_3 = tunemu.$(OBJEXT)
|
||||
am_tincd_OBJECTS = utils.$(OBJEXT) getopt.$(OBJEXT) getopt1.$(OBJEXT) \
|
||||
list.$(OBJEXT) splay_tree.$(OBJEXT) dropin.$(OBJEXT) \
|
||||
am__tincd_SOURCES_DIST = buffer.c buffer.h cipher.h conf.c conf.h \
|
||||
connection.c connection.h control.c control.h control_common.h \
|
||||
crypto.h device.h digest.h dropin.c dropin.h dummy_device.c \
|
||||
ecdh.h ecdsa.h ecdsagen.h edge.c edge.h ethernet.h event.c \
|
||||
event.h fake-gai-errnos.h fake-getaddrinfo.c \
|
||||
fake-getaddrinfo.h fake-getnameinfo.c fake-getnameinfo.h \
|
||||
getopt.c getopt.h getopt1.c graph.c graph.h hash.c hash.h \
|
||||
have.h ipv4.h ipv6.h list.c list.h logger.c logger.h meta.c \
|
||||
meta.h multicast_device.c names.c names.h net.c net.h \
|
||||
net_packet.c net_setup.c net_socket.c netutl.c netutl.h node.c \
|
||||
node.h prf.h process.c process.h protocol.c protocol.h \
|
||||
protocol_auth.c protocol_edge.c protocol_key.c protocol_misc.c \
|
||||
protocol_subnet.c raw_socket_device.c route.c route.h rsa.h \
|
||||
rsagen.h splay_tree.c splay_tree.h sptps.c sptps.h subnet.c \
|
||||
subnet.h subnet_parse.c system.h tincd.c utils.c utils.h \
|
||||
xalloc.h linux/device.c bsd/device.c bsd/tunemu.c \
|
||||
solaris/device.c mingw/device.c cygwin/device.c uml_device.c \
|
||||
vde_device.c openssl/cipher.c openssl/crypto.c \
|
||||
openssl/digest.c openssl/ecdh.c openssl/ecdsa.c openssl/prf.c \
|
||||
openssl/rsa.c gcrypt/cipher.c gcrypt/crypto.c gcrypt/digest.c \
|
||||
gcrypt/ecdh.c gcrypt/ecdsa.c gcrypt/prf.c gcrypt/rsa.c
|
||||
@LINUX_TRUE@am__objects_5 = linux/device.$(OBJEXT)
|
||||
@BSD_TRUE@am__objects_6 = bsd/device.$(OBJEXT)
|
||||
@BSD_TRUE@@TUNEMU_TRUE@am__objects_7 = bsd/tunemu.$(OBJEXT)
|
||||
@SOLARIS_TRUE@am__objects_8 = solaris/device.$(OBJEXT)
|
||||
@MINGW_TRUE@am__objects_9 = mingw/device.$(OBJEXT)
|
||||
@CYGWIN_TRUE@am__objects_10 = cygwin/device.$(OBJEXT)
|
||||
@UML_TRUE@am__objects_11 = uml_device.$(OBJEXT)
|
||||
@VDE_TRUE@am__objects_12 = vde_device.$(OBJEXT)
|
||||
@OPENSSL_TRUE@am__objects_13 = openssl/cipher.$(OBJEXT) \
|
||||
@OPENSSL_TRUE@ openssl/crypto.$(OBJEXT) \
|
||||
@OPENSSL_TRUE@ openssl/digest.$(OBJEXT) openssl/ecdh.$(OBJEXT) \
|
||||
@OPENSSL_TRUE@ openssl/ecdsa.$(OBJEXT) openssl/prf.$(OBJEXT) \
|
||||
@OPENSSL_TRUE@ openssl/rsa.$(OBJEXT)
|
||||
@GCRYPT_TRUE@am__objects_14 = gcrypt/cipher.$(OBJEXT) \
|
||||
@GCRYPT_TRUE@ gcrypt/crypto.$(OBJEXT) gcrypt/digest.$(OBJEXT) \
|
||||
@GCRYPT_TRUE@ gcrypt/ecdh.$(OBJEXT) gcrypt/ecdsa.$(OBJEXT) \
|
||||
@GCRYPT_TRUE@ gcrypt/prf.$(OBJEXT) gcrypt/rsa.$(OBJEXT)
|
||||
am_tincd_OBJECTS = buffer.$(OBJEXT) conf.$(OBJEXT) \
|
||||
connection.$(OBJEXT) control.$(OBJEXT) dropin.$(OBJEXT) \
|
||||
dummy_device.$(OBJEXT) edge.$(OBJEXT) event.$(OBJEXT) \
|
||||
fake-getaddrinfo.$(OBJEXT) fake-getnameinfo.$(OBJEXT) \
|
||||
hash.$(OBJEXT) buffer.$(OBJEXT) conf.$(OBJEXT) \
|
||||
connection.$(OBJEXT) control.$(OBJEXT) edge.$(OBJEXT) \
|
||||
graph.$(OBJEXT) logger.$(OBJEXT) meta.$(OBJEXT) net.$(OBJEXT) \
|
||||
getopt.$(OBJEXT) getopt1.$(OBJEXT) graph.$(OBJEXT) \
|
||||
hash.$(OBJEXT) list.$(OBJEXT) logger.$(OBJEXT) meta.$(OBJEXT) \
|
||||
multicast_device.$(OBJEXT) names.$(OBJEXT) net.$(OBJEXT) \
|
||||
net_packet.$(OBJEXT) net_setup.$(OBJEXT) net_socket.$(OBJEXT) \
|
||||
netutl.$(OBJEXT) node.$(OBJEXT) process.$(OBJEXT) \
|
||||
protocol.$(OBJEXT) protocol_auth.$(OBJEXT) \
|
||||
protocol_edge.$(OBJEXT) protocol_misc.$(OBJEXT) \
|
||||
protocol_key.$(OBJEXT) protocol_subnet.$(OBJEXT) \
|
||||
route.$(OBJEXT) sptps.$(OBJEXT) subnet.$(OBJEXT) \
|
||||
subnet_parse.$(OBJEXT) event.$(OBJEXT) tincd.$(OBJEXT) \
|
||||
dummy_device.$(OBJEXT) raw_socket_device.$(OBJEXT) \
|
||||
multicast_device.$(OBJEXT) names.$(OBJEXT) $(am__objects_1) \
|
||||
$(am__objects_2) $(am__objects_3)
|
||||
nodist_tincd_OBJECTS = device.$(OBJEXT) cipher.$(OBJEXT) \
|
||||
crypto.$(OBJEXT) ecdh.$(OBJEXT) ecdsa.$(OBJEXT) \
|
||||
digest.$(OBJEXT) prf.$(OBJEXT) rsa.$(OBJEXT)
|
||||
tincd_OBJECTS = $(am_tincd_OBJECTS) $(nodist_tincd_OBJECTS)
|
||||
protocol_edge.$(OBJEXT) protocol_key.$(OBJEXT) \
|
||||
protocol_misc.$(OBJEXT) protocol_subnet.$(OBJEXT) \
|
||||
raw_socket_device.$(OBJEXT) route.$(OBJEXT) \
|
||||
splay_tree.$(OBJEXT) sptps.$(OBJEXT) subnet.$(OBJEXT) \
|
||||
subnet_parse.$(OBJEXT) tincd.$(OBJEXT) utils.$(OBJEXT) \
|
||||
$(am__objects_5) $(am__objects_6) $(am__objects_7) \
|
||||
$(am__objects_8) $(am__objects_9) $(am__objects_10) \
|
||||
$(am__objects_11) $(am__objects_12) $(am__objects_13) \
|
||||
$(am__objects_14)
|
||||
tincd_OBJECTS = $(am_tincd_OBJECTS)
|
||||
tincd_LDADD = $(LDADD)
|
||||
AM_V_P = $(am__v_P_@AM_V@)
|
||||
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
|
||||
am__v_P_0 = false
|
||||
am__v_P_1 = :
|
||||
AM_V_GEN = $(am__v_GEN_@AM_V@)
|
||||
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
|
||||
am__v_GEN_0 = @echo " GEN " $@;
|
||||
am__v_GEN_1 =
|
||||
AM_V_at = $(am__v_at_@AM_V@)
|
||||
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
||||
am__v_at_0 = @
|
||||
am__v_at_1 =
|
||||
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)
|
||||
AM_V_CC = $(am__v_CC_@AM_V@)
|
||||
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
|
||||
am__v_CC_0 = @echo " CC " $@;
|
||||
am__v_CC_1 =
|
||||
CCLD = $(CC)
|
||||
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
SOURCES = $(sptps_test_SOURCES) $(tinc_SOURCES) $(nodist_tinc_SOURCES) \
|
||||
$(tincd_SOURCES) $(nodist_tincd_SOURCES)
|
||||
DIST_SOURCES = $(sptps_test_SOURCES) $(tinc_SOURCES) \
|
||||
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
|
||||
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
|
||||
am__v_CCLD_0 = @echo " CCLD " $@;
|
||||
am__v_CCLD_1 =
|
||||
SOURCES = $(sptps_test_SOURCES) $(tinc_SOURCES) $(tincd_SOURCES)
|
||||
DIST_SOURCES = $(am__sptps_test_SOURCES_DIST) $(am__tinc_SOURCES_DIST) \
|
||||
$(am__tincd_SOURCES_DIST)
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
HEADERS = $(nodist_noinst_HEADERS) $(noinst_HEADERS)
|
||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
|
||||
# Read a list of newline-separated strings from the standard input,
|
||||
# and print each of them once, without duplicates. Input order is
|
||||
# *not* preserved.
|
||||
am__uniquify_input = $(AWK) '\
|
||||
BEGIN { nonempty = 0; } \
|
||||
{ items[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in items) print i; }; } \
|
||||
'
|
||||
# Make sure the list of sources is unique. This is necessary because,
|
||||
# e.g., the same source file might be shared among _SOURCES variables
|
||||
# for different programs/libraries.
|
||||
am__define_uniq_tagged_files = \
|
||||
list='$(am__tagged_files)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | $(am__uniquify_input)`
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
|
@ -162,7 +343,6 @@ ECHO_T = @ECHO_T@
|
|||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
GREP = @GREP@
|
||||
INCLUDES = @INCLUDES@ -I$(top_builddir)
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
|
@ -173,10 +353,9 @@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@
|
|||
LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@
|
||||
LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@ @LIBGCRYPT_LIBS@ $(am__append_4)
|
||||
LIBS = @LIBS@ @LIBGCRYPT_LIBS@ $(am__append_15)
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
OBJEXT = @OBJEXT@
|
||||
|
@ -245,45 +424,40 @@ top_build_prefix = @top_build_prefix@
|
|||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
EXTRA_DIST = linux bsd solaris cygwin mingw openssl gcrypt
|
||||
tincd_SOURCES = utils.c getopt.c getopt1.c list.c splay_tree.c \
|
||||
dropin.c fake-getaddrinfo.c fake-getnameinfo.c hash.c buffer.c \
|
||||
conf.c connection.c control.c edge.c graph.c logger.c meta.c \
|
||||
net.c net_packet.c net_setup.c net_socket.c netutl.c node.c \
|
||||
process.c protocol.c protocol_auth.c protocol_edge.c \
|
||||
protocol_misc.c protocol_key.c protocol_subnet.c route.c \
|
||||
sptps.c subnet.c subnet_parse.c event.c tincd.c dummy_device.c \
|
||||
raw_socket_device.c multicast_device.c names.c $(am__append_1) \
|
||||
$(am__append_2) $(am__append_3)
|
||||
nodist_tincd_SOURCES = \
|
||||
device.c cipher.c crypto.c ecdh.c ecdsa.c digest.c prf.c rsa.c
|
||||
|
||||
tinc_SOURCES = \
|
||||
utils.c getopt.c getopt1.c dropin.c \
|
||||
info.c list.c subnet_parse.c tincctl.c top.c names.c
|
||||
|
||||
nodist_tinc_SOURCES = \
|
||||
ecdsagen.c rsagen.c
|
||||
|
||||
sptps_test_SOURCES = \
|
||||
logger.c cipher.c crypto.c ecdh.c ecdsa.c digest.c prf.c \
|
||||
sptps.c sptps_test.c utils.c
|
||||
|
||||
tinc_LDADD = $(READLINE_LIBS) $(CURSES_LIBS)
|
||||
DEFAULT_INCLUDES =
|
||||
noinst_HEADERS = \
|
||||
xalloc.h utils.h getopt.h list.h splay_tree.h dropin.h fake-getaddrinfo.h fake-getnameinfo.h fake-gai-errnos.h ipv6.h ipv4.h ethernet.h \
|
||||
buffer.h conf.h connection.h control.h control_common.h device.h edge.h graph.h info.h logger.h meta.h net.h netutl.h node.h process.h \
|
||||
protocol.h route.h subnet.h sptps.h tincctl.h top.h bsd/tunemu.h hash.h event.h names.h
|
||||
|
||||
nodist_noinst_HEADERS = \
|
||||
cipher.h crypto.h ecdh.h ecdsa.h digest.h prf.h rsa.h ecdsagen.h rsagen.h
|
||||
|
||||
tincd_SOURCES = buffer.c buffer.h cipher.h conf.c conf.h connection.c \
|
||||
connection.h control.c control.h control_common.h crypto.h \
|
||||
device.h digest.h dropin.c dropin.h dummy_device.c ecdh.h \
|
||||
ecdsa.h ecdsagen.h edge.c edge.h ethernet.h event.c event.h \
|
||||
fake-gai-errnos.h fake-getaddrinfo.c fake-getaddrinfo.h \
|
||||
fake-getnameinfo.c fake-getnameinfo.h getopt.c getopt.h \
|
||||
getopt1.c graph.c graph.h hash.c hash.h have.h ipv4.h ipv6.h \
|
||||
list.c list.h logger.c logger.h meta.c meta.h \
|
||||
multicast_device.c names.c names.h net.c net.h net_packet.c \
|
||||
net_setup.c net_socket.c netutl.c netutl.h node.c node.h prf.h \
|
||||
process.c process.h protocol.c protocol.h protocol_auth.c \
|
||||
protocol_edge.c protocol_key.c protocol_misc.c \
|
||||
protocol_subnet.c raw_socket_device.c route.c route.h rsa.h \
|
||||
rsagen.h splay_tree.c splay_tree.h sptps.c sptps.h subnet.c \
|
||||
subnet.h subnet_parse.c system.h tincd.c utils.c utils.h \
|
||||
xalloc.h $(am__append_1) $(am__append_2) $(am__append_3) \
|
||||
$(am__append_4) $(am__append_5) $(am__append_6) \
|
||||
$(am__append_7) $(am__append_8) $(am__append_9) \
|
||||
$(am__append_12)
|
||||
tinc_SOURCES = dropin.c dropin.h getopt.c getopt.h getopt1.c info.c \
|
||||
info.h invitation.c invitation.h list.c list.h names.c names.h \
|
||||
netutl.c netutl.h sptps.c sptps.h subnet_parse.c subnet.h \
|
||||
tincctl.c tincctl.h top.c top.h utils.c utils.h \
|
||||
$(am__append_10) $(am__append_13)
|
||||
sptps_test_SOURCES = logger.c logger.h sptps.c sptps.h sptps_test.c \
|
||||
utils.c utils.h $(am__append_11) $(am__append_14)
|
||||
tinc_LDADD = $(READLINE_LIBS) $(CURSES_LIBS)
|
||||
AM_CFLAGS = -DCONFDIR=\"$(sysconfdir)\" -DLOCALSTATEDIR=\"$(localstatedir)\" -DSBINDIR=\"$(sbindir)\"
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .o .obj
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
|
@ -308,9 +482,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
|||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
install-sbinPROGRAMS: $(sbin_PROGRAMS)
|
||||
|
@ -322,10 +496,11 @@ install-sbinPROGRAMS: $(sbin_PROGRAMS)
|
|||
fi; \
|
||||
for p in $$list; do echo "$$p $$p"; done | \
|
||||
sed 's/$(EXEEXT)$$//' | \
|
||||
while read p p1; do if test -f $$p; \
|
||||
then echo "$$p"; echo "$$p"; else :; fi; \
|
||||
while read p p1; do if test -f $$p \
|
||||
; then echo "$$p"; echo "$$p"; else :; fi; \
|
||||
done | \
|
||||
sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
|
||||
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 } \
|
||||
|
@ -346,42 +521,152 @@ uninstall-sbinPROGRAMS:
|
|||
@list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
|
||||
files=`for p in $$list; do echo "$$p"; done | \
|
||||
sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
|
||||
-e 's/$$/$(EXEEXT)/' `; \
|
||||
-e 's/$$/$(EXEEXT)/' \
|
||||
`; \
|
||||
test -n "$$list" || exit 0; \
|
||||
echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \
|
||||
cd "$(DESTDIR)$(sbindir)" && rm -f $$files
|
||||
|
||||
clean-sbinPROGRAMS:
|
||||
-test -z "$(sbin_PROGRAMS)" || rm -f $(sbin_PROGRAMS)
|
||||
|
||||
installcheck-sbinPROGRAMS: $(sbin_PROGRAMS)
|
||||
bad=0; pid=$$$$; list="$(sbin_PROGRAMS)"; for p in $$list; do \
|
||||
case ' $(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT) ' in \
|
||||
*" $$p "* | *" $(srcdir)/$$p "*) continue;; \
|
||||
esac; \
|
||||
f=`echo "$$p" | \
|
||||
sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
|
||||
for opt in --help --version; do \
|
||||
if "$(DESTDIR)$(sbindir)/$$f" $$opt >c$${pid}_.out \
|
||||
2>c$${pid}_.err </dev/null \
|
||||
&& test -n "`cat c$${pid}_.out`" \
|
||||
&& test -z "`cat c$${pid}_.err`"; then :; \
|
||||
else echo "$$f does not support $$opt" 1>&2; bad=1; fi; \
|
||||
done; \
|
||||
done; rm -f c$${pid}_.???; exit $$bad
|
||||
openssl/$(am__dirstamp):
|
||||
@$(MKDIR_P) openssl
|
||||
@: > openssl/$(am__dirstamp)
|
||||
openssl/$(DEPDIR)/$(am__dirstamp):
|
||||
@$(MKDIR_P) openssl/$(DEPDIR)
|
||||
@: > openssl/$(DEPDIR)/$(am__dirstamp)
|
||||
openssl/cipher.$(OBJEXT): openssl/$(am__dirstamp) \
|
||||
openssl/$(DEPDIR)/$(am__dirstamp)
|
||||
openssl/crypto.$(OBJEXT): openssl/$(am__dirstamp) \
|
||||
openssl/$(DEPDIR)/$(am__dirstamp)
|
||||
openssl/digest.$(OBJEXT): openssl/$(am__dirstamp) \
|
||||
openssl/$(DEPDIR)/$(am__dirstamp)
|
||||
openssl/ecdh.$(OBJEXT): openssl/$(am__dirstamp) \
|
||||
openssl/$(DEPDIR)/$(am__dirstamp)
|
||||
openssl/ecdsa.$(OBJEXT): openssl/$(am__dirstamp) \
|
||||
openssl/$(DEPDIR)/$(am__dirstamp)
|
||||
openssl/prf.$(OBJEXT): openssl/$(am__dirstamp) \
|
||||
openssl/$(DEPDIR)/$(am__dirstamp)
|
||||
gcrypt/$(am__dirstamp):
|
||||
@$(MKDIR_P) gcrypt
|
||||
@: > gcrypt/$(am__dirstamp)
|
||||
gcrypt/$(DEPDIR)/$(am__dirstamp):
|
||||
@$(MKDIR_P) gcrypt/$(DEPDIR)
|
||||
@: > gcrypt/$(DEPDIR)/$(am__dirstamp)
|
||||
gcrypt/cipher.$(OBJEXT): gcrypt/$(am__dirstamp) \
|
||||
gcrypt/$(DEPDIR)/$(am__dirstamp)
|
||||
gcrypt/crypto.$(OBJEXT): gcrypt/$(am__dirstamp) \
|
||||
gcrypt/$(DEPDIR)/$(am__dirstamp)
|
||||
gcrypt/digest.$(OBJEXT): gcrypt/$(am__dirstamp) \
|
||||
gcrypt/$(DEPDIR)/$(am__dirstamp)
|
||||
gcrypt/ecdh.$(OBJEXT): gcrypt/$(am__dirstamp) \
|
||||
gcrypt/$(DEPDIR)/$(am__dirstamp)
|
||||
gcrypt/ecdsa.$(OBJEXT): gcrypt/$(am__dirstamp) \
|
||||
gcrypt/$(DEPDIR)/$(am__dirstamp)
|
||||
gcrypt/prf.$(OBJEXT): gcrypt/$(am__dirstamp) \
|
||||
gcrypt/$(DEPDIR)/$(am__dirstamp)
|
||||
|
||||
sptps_test$(EXEEXT): $(sptps_test_OBJECTS) $(sptps_test_DEPENDENCIES) $(EXTRA_sptps_test_DEPENDENCIES)
|
||||
@rm -f sptps_test$(EXEEXT)
|
||||
$(LINK) $(sptps_test_OBJECTS) $(sptps_test_LDADD) $(LIBS)
|
||||
$(AM_V_CCLD)$(LINK) $(sptps_test_OBJECTS) $(sptps_test_LDADD) $(LIBS)
|
||||
openssl/ecdsagen.$(OBJEXT): openssl/$(am__dirstamp) \
|
||||
openssl/$(DEPDIR)/$(am__dirstamp)
|
||||
openssl/rsa.$(OBJEXT): openssl/$(am__dirstamp) \
|
||||
openssl/$(DEPDIR)/$(am__dirstamp)
|
||||
openssl/rsagen.$(OBJEXT): openssl/$(am__dirstamp) \
|
||||
openssl/$(DEPDIR)/$(am__dirstamp)
|
||||
gcrypt/ecdsagen.$(OBJEXT): gcrypt/$(am__dirstamp) \
|
||||
gcrypt/$(DEPDIR)/$(am__dirstamp)
|
||||
gcrypt/rsa.$(OBJEXT): gcrypt/$(am__dirstamp) \
|
||||
gcrypt/$(DEPDIR)/$(am__dirstamp)
|
||||
gcrypt/rsagen.$(OBJEXT): gcrypt/$(am__dirstamp) \
|
||||
gcrypt/$(DEPDIR)/$(am__dirstamp)
|
||||
|
||||
tinc$(EXEEXT): $(tinc_OBJECTS) $(tinc_DEPENDENCIES) $(EXTRA_tinc_DEPENDENCIES)
|
||||
@rm -f tinc$(EXEEXT)
|
||||
$(LINK) $(tinc_OBJECTS) $(tinc_LDADD) $(LIBS)
|
||||
$(AM_V_CCLD)$(LINK) $(tinc_OBJECTS) $(tinc_LDADD) $(LIBS)
|
||||
linux/$(am__dirstamp):
|
||||
@$(MKDIR_P) linux
|
||||
@: > linux/$(am__dirstamp)
|
||||
linux/$(DEPDIR)/$(am__dirstamp):
|
||||
@$(MKDIR_P) linux/$(DEPDIR)
|
||||
@: > linux/$(DEPDIR)/$(am__dirstamp)
|
||||
linux/device.$(OBJEXT): linux/$(am__dirstamp) \
|
||||
linux/$(DEPDIR)/$(am__dirstamp)
|
||||
bsd/$(am__dirstamp):
|
||||
@$(MKDIR_P) bsd
|
||||
@: > bsd/$(am__dirstamp)
|
||||
bsd/$(DEPDIR)/$(am__dirstamp):
|
||||
@$(MKDIR_P) bsd/$(DEPDIR)
|
||||
@: > bsd/$(DEPDIR)/$(am__dirstamp)
|
||||
bsd/device.$(OBJEXT): bsd/$(am__dirstamp) \
|
||||
bsd/$(DEPDIR)/$(am__dirstamp)
|
||||
bsd/tunemu.$(OBJEXT): bsd/$(am__dirstamp) \
|
||||
bsd/$(DEPDIR)/$(am__dirstamp)
|
||||
solaris/$(am__dirstamp):
|
||||
@$(MKDIR_P) solaris
|
||||
@: > solaris/$(am__dirstamp)
|
||||
solaris/$(DEPDIR)/$(am__dirstamp):
|
||||
@$(MKDIR_P) solaris/$(DEPDIR)
|
||||
@: > solaris/$(DEPDIR)/$(am__dirstamp)
|
||||
solaris/device.$(OBJEXT): solaris/$(am__dirstamp) \
|
||||
solaris/$(DEPDIR)/$(am__dirstamp)
|
||||
mingw/$(am__dirstamp):
|
||||
@$(MKDIR_P) mingw
|
||||
@: > mingw/$(am__dirstamp)
|
||||
mingw/$(DEPDIR)/$(am__dirstamp):
|
||||
@$(MKDIR_P) mingw/$(DEPDIR)
|
||||
@: > mingw/$(DEPDIR)/$(am__dirstamp)
|
||||
mingw/device.$(OBJEXT): mingw/$(am__dirstamp) \
|
||||
mingw/$(DEPDIR)/$(am__dirstamp)
|
||||
cygwin/$(am__dirstamp):
|
||||
@$(MKDIR_P) cygwin
|
||||
@: > cygwin/$(am__dirstamp)
|
||||
cygwin/$(DEPDIR)/$(am__dirstamp):
|
||||
@$(MKDIR_P) cygwin/$(DEPDIR)
|
||||
@: > cygwin/$(DEPDIR)/$(am__dirstamp)
|
||||
cygwin/device.$(OBJEXT): cygwin/$(am__dirstamp) \
|
||||
cygwin/$(DEPDIR)/$(am__dirstamp)
|
||||
|
||||
tincd$(EXEEXT): $(tincd_OBJECTS) $(tincd_DEPENDENCIES) $(EXTRA_tincd_DEPENDENCIES)
|
||||
@rm -f tincd$(EXEEXT)
|
||||
$(LINK) $(tincd_OBJECTS) $(tincd_LDADD) $(LIBS)
|
||||
$(AM_V_CCLD)$(LINK) $(tincd_OBJECTS) $(tincd_LDADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
-rm -f bsd/*.$(OBJEXT)
|
||||
-rm -f cygwin/*.$(OBJEXT)
|
||||
-rm -f gcrypt/*.$(OBJEXT)
|
||||
-rm -f linux/*.$(OBJEXT)
|
||||
-rm -f mingw/*.$(OBJEXT)
|
||||
-rm -f openssl/*.$(OBJEXT)
|
||||
-rm -f solaris/*.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buffer.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cipher.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conf.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connection.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/control.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crypto.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/device.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/digest.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dropin.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dummy_device.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecdh.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecdsa.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecdsagen.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/edge.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/event.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fake-getaddrinfo.Po@am__quote@
|
||||
|
@ -391,6 +676,7 @@ distclean-compile:
|
|||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/graph.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/info.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/invitation.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/logger.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/meta.Po@am__quote@
|
||||
|
@ -402,7 +688,6 @@ distclean-compile:
|
|||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net_socket.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netutl.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/node.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prf.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/process.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol_auth.Po@am__quote@
|
||||
|
@ -412,8 +697,6 @@ distclean-compile:
|
|||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol_subnet.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raw_socket_device.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/route.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rsa.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rsagen.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/splay_tree.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sptps.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sptps_test.Po@am__quote@
|
||||
|
@ -422,59 +705,59 @@ distclean-compile:
|
|||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tincctl.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tincd.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/top.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tunemu.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uml_device.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utils.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vde_device.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@bsd/$(DEPDIR)/device.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@bsd/$(DEPDIR)/tunemu.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@cygwin/$(DEPDIR)/device.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@gcrypt/$(DEPDIR)/cipher.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@gcrypt/$(DEPDIR)/crypto.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@gcrypt/$(DEPDIR)/digest.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@gcrypt/$(DEPDIR)/ecdh.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@gcrypt/$(DEPDIR)/ecdsa.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@gcrypt/$(DEPDIR)/ecdsagen.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@gcrypt/$(DEPDIR)/prf.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@gcrypt/$(DEPDIR)/rsa.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@gcrypt/$(DEPDIR)/rsagen.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@linux/$(DEPDIR)/device.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@mingw/$(DEPDIR)/device.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@openssl/$(DEPDIR)/cipher.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@openssl/$(DEPDIR)/crypto.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@openssl/$(DEPDIR)/digest.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@openssl/$(DEPDIR)/ecdh.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@openssl/$(DEPDIR)/ecdsa.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@openssl/$(DEPDIR)/ecdsagen.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@openssl/$(DEPDIR)/prf.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@openssl/$(DEPDIR)/rsa.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@openssl/$(DEPDIR)/rsagen.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@solaris/$(DEPDIR)/device.Po@am__quote@
|
||||
|
||||
.c.o:
|
||||
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
|
||||
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
|
||||
|
||||
.c.obj:
|
||||
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
|
||||
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
|
||||
tunemu.o: bsd/tunemu.c
|
||||
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tunemu.o -MD -MP -MF $(DEPDIR)/tunemu.Tpo -c -o tunemu.o `test -f 'bsd/tunemu.c' || echo '$(srcdir)/'`bsd/tunemu.c
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tunemu.Tpo $(DEPDIR)/tunemu.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='bsd/tunemu.c' object='tunemu.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tunemu.o `test -f 'bsd/tunemu.c' || echo '$(srcdir)/'`bsd/tunemu.c
|
||||
ID: $(am__tagged_files)
|
||||
$(am__define_uniq_tagged_files); mkid -fID $$unique
|
||||
tags: tags-am
|
||||
TAGS: tags
|
||||
|
||||
tunemu.obj: bsd/tunemu.c
|
||||
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tunemu.obj -MD -MP -MF $(DEPDIR)/tunemu.Tpo -c -o tunemu.obj `if test -f 'bsd/tunemu.c'; then $(CYGPATH_W) 'bsd/tunemu.c'; else $(CYGPATH_W) '$(srcdir)/bsd/tunemu.c'; fi`
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tunemu.Tpo $(DEPDIR)/tunemu.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='bsd/tunemu.c' object='tunemu.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tunemu.obj `if test -f 'bsd/tunemu.c'; then $(CYGPATH_W) 'bsd/tunemu.c'; else $(CYGPATH_W) '$(srcdir)/bsd/tunemu.c'; fi`
|
||||
|
||||
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)
|
||||
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||
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; }; }'`; \
|
||||
$(am__define_uniq_tagged_files); \
|
||||
shift; \
|
||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
|
@ -486,15 +769,11 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
|||
$$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; }; }'`; \
|
||||
ctags: ctags-am
|
||||
|
||||
CTAGS: ctags
|
||||
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||
$(am__define_uniq_tagged_files); \
|
||||
test -z "$(CTAGS_ARGS)$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$unique
|
||||
|
@ -503,6 +782,21 @@ GTAGS:
|
|||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& $(am__cd) $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
||||
cscopelist: cscopelist-am
|
||||
|
||||
cscopelist-am: $(am__tagged_files)
|
||||
list='$(am__tagged_files)'; \
|
||||
case "$(srcdir)" in \
|
||||
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
|
||||
*) sdir=$(subdir)/$(srcdir) ;; \
|
||||
esac; \
|
||||
for i in $$list; do \
|
||||
if test -f "$$i"; then \
|
||||
echo "$(subdir)/$$i"; \
|
||||
else \
|
||||
echo "$$sdir/$$i"; \
|
||||
fi; \
|
||||
done >> $(top_builddir)/cscope.files
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
@ -542,7 +836,7 @@ distdir: $(DISTFILES)
|
|||
dist-hook
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(PROGRAMS) $(HEADERS)
|
||||
all-am: Makefile $(PROGRAMS)
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(sbindir)"; do \
|
||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||
|
@ -573,6 +867,20 @@ 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)
|
||||
-rm -f bsd/$(DEPDIR)/$(am__dirstamp)
|
||||
-rm -f bsd/$(am__dirstamp)
|
||||
-rm -f cygwin/$(DEPDIR)/$(am__dirstamp)
|
||||
-rm -f cygwin/$(am__dirstamp)
|
||||
-rm -f gcrypt/$(DEPDIR)/$(am__dirstamp)
|
||||
-rm -f gcrypt/$(am__dirstamp)
|
||||
-rm -f linux/$(DEPDIR)/$(am__dirstamp)
|
||||
-rm -f linux/$(am__dirstamp)
|
||||
-rm -f mingw/$(DEPDIR)/$(am__dirstamp)
|
||||
-rm -f mingw/$(am__dirstamp)
|
||||
-rm -f openssl/$(DEPDIR)/$(am__dirstamp)
|
||||
-rm -f openssl/$(am__dirstamp)
|
||||
-rm -f solaris/$(DEPDIR)/$(am__dirstamp)
|
||||
-rm -f solaris/$(am__dirstamp)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
|
@ -582,7 +890,7 @@ clean: clean-am
|
|||
clean-am: clean-generic clean-sbinPROGRAMS mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -rf ./$(DEPDIR) bsd/$(DEPDIR) cygwin/$(DEPDIR) gcrypt/$(DEPDIR) linux/$(DEPDIR) mingw/$(DEPDIR) openssl/$(DEPDIR) solaris/$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-tags
|
||||
|
@ -625,10 +933,10 @@ install-ps: install-ps-am
|
|||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am:
|
||||
installcheck-am: installcheck-sbinPROGRAMS
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -rf ./$(DEPDIR) bsd/$(DEPDIR) cygwin/$(DEPDIR) gcrypt/$(DEPDIR) linux/$(DEPDIR) mingw/$(DEPDIR) openssl/$(DEPDIR) solaris/$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
|
@ -648,18 +956,19 @@ uninstall-am: uninstall-sbinPROGRAMS
|
|||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
|
||||
clean-sbinPROGRAMS ctags dist-hook distclean distclean-compile \
|
||||
distclean-generic distclean-tags distdir dvi dvi-am html \
|
||||
html-am info info-am install install-am install-data \
|
||||
install-data-am install-dvi install-dvi-am install-exec \
|
||||
install-exec-am install-html install-html-am install-info \
|
||||
install-info-am install-man install-pdf install-pdf-am \
|
||||
install-ps install-ps-am install-sbinPROGRAMS install-strip \
|
||||
installcheck installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
||||
mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
|
||||
uninstall-am uninstall-sbinPROGRAMS
|
||||
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
|
||||
clean-sbinPROGRAMS cscopelist-am ctags ctags-am dist-hook \
|
||||
distclean distclean-compile distclean-generic distclean-tags \
|
||||
distdir dvi dvi-am html html-am info info-am install \
|
||||
install-am install-data install-data-am install-dvi \
|
||||
install-dvi-am install-exec install-exec-am install-html \
|
||||
install-html-am install-info install-info-am install-man \
|
||||
install-pdf install-pdf-am install-ps install-ps-am \
|
||||
install-sbinPROGRAMS install-strip installcheck \
|
||||
installcheck-am installcheck-sbinPROGRAMS installdirs \
|
||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
||||
mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
|
||||
tags tags-am uninstall uninstall-am uninstall-sbinPROGRAMS
|
||||
|
||||
|
||||
dist-hook:
|
||||
|
|
1
src/bsd/.deps/device.Po
Normal file
1
src/bsd/.deps/device.Po
Normal file
|
@ -0,0 +1 @@
|
|||
# dummy
|
1
src/bsd/.deps/tunemu.Po
Normal file
1
src/bsd/.deps/tunemu.Po
Normal file
|
@ -0,0 +1 @@
|
|||
# dummy
|
|
@ -19,16 +19,16 @@
|
|||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#include "system.h"
|
||||
#include "../system.h"
|
||||
|
||||
#include "conf.h"
|
||||
#include "device.h"
|
||||
#include "logger.h"
|
||||
#include "names.h"
|
||||
#include "net.h"
|
||||
#include "route.h"
|
||||
#include "utils.h"
|
||||
#include "xalloc.h"
|
||||
#include "../conf.h"
|
||||
#include "../device.h"
|
||||
#include "../logger.h"
|
||||
#include "../names.h"
|
||||
#include "../net.h"
|
||||
#include "../route.h"
|
||||
#include "../utils.h"
|
||||
#include "../xalloc.h"
|
||||
|
||||
#ifdef ENABLE_TUNEMU
|
||||
#include "bsd/tunemu.h"
|
||||
|
|
|
@ -1,386 +0,0 @@
|
|||
/*
|
||||
device.c -- Interaction BSD tun/tap device
|
||||
Copyright (C) 2001-2005 Ivo Timmermans,
|
||||
2001-2012 Guus Sliepen <guus@tinc-vpn.org>
|
||||
2009 Grzegorz Dymarek <gregd72002@googlemail.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#include "system.h"
|
||||
|
||||
#include "conf.h"
|
||||
#include "device.h"
|
||||
#include "logger.h"
|
||||
#include "net.h"
|
||||
#include "route.h"
|
||||
#include "utils.h"
|
||||
#include "xalloc.h"
|
||||
|
||||
#ifdef ENABLE_TUNEMU
|
||||
#include "bsd/tunemu.h"
|
||||
#endif
|
||||
|
||||
#define DEFAULT_TUN_DEVICE "/dev/tun0"
|
||||
#if defined(HAVE_FREEBSD) || defined(HAVE_NETBSD)
|
||||
#define DEFAULT_TAP_DEVICE "/dev/tap0"
|
||||
#else
|
||||
#define DEFAULT_TAP_DEVICE "/dev/tun0"
|
||||
#endif
|
||||
|
||||
typedef enum device_type {
|
||||
DEVICE_TYPE_TUN,
|
||||
DEVICE_TYPE_TUNIFHEAD,
|
||||
DEVICE_TYPE_TAP,
|
||||
#ifdef ENABLE_TUNEMU
|
||||
DEVICE_TYPE_TUNEMU,
|
||||
#endif
|
||||
} device_type_t;
|
||||
|
||||
int device_fd = -1;
|
||||
char *device = NULL;
|
||||
char *iface = NULL;
|
||||
static char *device_info = NULL;
|
||||
static uint64_t device_total_in = 0;
|
||||
static uint64_t device_total_out = 0;
|
||||
#if defined(ENABLE_TUNEMU)
|
||||
static device_type_t device_type = DEVICE_TYPE_TUNEMU;
|
||||
#elif defined(HAVE_OPENBSD) || defined(HAVE_FREEBSD) || defined(HAVE_DRAGONFLY)
|
||||
static device_type_t device_type = DEVICE_TYPE_TUNIFHEAD;
|
||||
#else
|
||||
static device_type_t device_type = DEVICE_TYPE_TUN;
|
||||
#endif
|
||||
|
||||
static bool setup_device(void) {
|
||||
char *type;
|
||||
|
||||
if(!get_config_string(lookup_config(config_tree, "Device"), &device)) {
|
||||
if(routing_mode == RMODE_ROUTER)
|
||||
device = xstrdup(DEFAULT_TUN_DEVICE);
|
||||
else
|
||||
device = xstrdup(DEFAULT_TAP_DEVICE);
|
||||
}
|
||||
|
||||
if(!get_config_string(lookup_config(config_tree, "Interface"), &iface))
|
||||
iface = xstrdup(strrchr(device, '/') ? strrchr(device, '/') + 1 : device);
|
||||
|
||||
if(get_config_string(lookup_config(config_tree, "DeviceType"), &type)) {
|
||||
if(!strcasecmp(type, "tun"))
|
||||
<<<<<<< HEAD
|
||||
/* use default */;
|
||||
#ifdef HAVE_TUNEMU
|
||||
=======
|
||||
/* use default */;
|
||||
#ifdef ENABLE_TUNEMU
|
||||
>>>>>>> 2a3e343... Fix support for tunemu on iOS devices.
|
||||
else if(!strcasecmp(type, "tunemu"))
|
||||
device_type = DEVICE_TYPE_TUNEMU;
|
||||
#endif
|
||||
else if(!strcasecmp(type, "tunnohead"))
|
||||
device_type = DEVICE_TYPE_TUN;
|
||||
else if(!strcasecmp(type, "tunifhead"))
|
||||
device_type = DEVICE_TYPE_TUNIFHEAD;
|
||||
else if(!strcasecmp(type, "tap"))
|
||||
device_type = DEVICE_TYPE_TAP;
|
||||
else {
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "Unknown device type %s!", type);
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if(strstr(device, "tap") || routing_mode != RMODE_ROUTER)
|
||||
device_type = DEVICE_TYPE_TAP;
|
||||
}
|
||||
|
||||
switch(device_type) {
|
||||
#ifdef ENABLE_TUNEMU
|
||||
case DEVICE_TYPE_TUNEMU: {
|
||||
char dynamic_name[256] = "";
|
||||
device_fd = tunemu_open(dynamic_name);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
device_fd = open(device, O_RDWR | O_NONBLOCK);
|
||||
}
|
||||
|
||||
if(device_fd < 0) {
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "Could not open %s: %s", device, strerror(errno));
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef FD_CLOEXEC
|
||||
fcntl(device_fd, F_SETFD, FD_CLOEXEC);
|
||||
#endif
|
||||
|
||||
switch(device_type) {
|
||||
default:
|
||||
device_type = DEVICE_TYPE_TUN;
|
||||
case DEVICE_TYPE_TUN:
|
||||
#ifdef TUNSIFHEAD
|
||||
{
|
||||
const int zero = 0;
|
||||
if(ioctl(device_fd, TUNSIFHEAD, &zero, sizeof zero) == -1) {
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "System call `%s' failed: %s", "ioctl", strerror(errno));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#if defined(TUNSIFMODE) && defined(IFF_BROADCAST) && defined(IFF_MULTICAST)
|
||||
{
|
||||
const int mode = IFF_BROADCAST | IFF_MULTICAST;
|
||||
ioctl(device_fd, TUNSIFMODE, &mode, sizeof mode);
|
||||
}
|
||||
#endif
|
||||
|
||||
device_info = "Generic BSD tun device";
|
||||
break;
|
||||
case DEVICE_TYPE_TUNIFHEAD:
|
||||
#ifdef TUNSIFHEAD
|
||||
{
|
||||
const int one = 1;
|
||||
if(ioctl(device_fd, TUNSIFHEAD, &one, sizeof one) == -1) {
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "System call `%s' failed: %s", "ioctl", strerror(errno));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#if defined(TUNSIFMODE) && defined(IFF_BROADCAST) && defined(IFF_MULTICAST)
|
||||
{
|
||||
const int mode = IFF_BROADCAST | IFF_MULTICAST;
|
||||
ioctl(device_fd, TUNSIFMODE, &mode, sizeof mode);
|
||||
}
|
||||
#endif
|
||||
|
||||
device_info = "Generic BSD tun device";
|
||||
break;
|
||||
case DEVICE_TYPE_TAP:
|
||||
if(routing_mode == RMODE_ROUTER)
|
||||
overwrite_mac = true;
|
||||
device_info = "Generic BSD tap device";
|
||||
#ifdef TAPGIFNAME
|
||||
{
|
||||
struct ifreq ifr;
|
||||
if(ioctl(device_fd, TAPGIFNAME, (void*)&ifr) == 0) {
|
||||
if(iface)
|
||||
free(iface);
|
||||
iface = xstrdup(ifr.ifr_name);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
break;
|
||||
#ifdef ENABLE_TUNEMU
|
||||
case DEVICE_TYPE_TUNEMU:
|
||||
device_info = "BSD tunemu device";
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
||||
logger(DEBUG_ALWAYS, LOG_INFO, "%s is a %s", device, device_info);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void close_device(void) {
|
||||
switch(device_type) {
|
||||
#ifdef ENABLE_TUNEMU
|
||||
case DEVICE_TYPE_TUNEMU:
|
||||
tunemu_close(device_fd);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
close(device_fd);
|
||||
}
|
||||
|
||||
free(device);
|
||||
free(iface);
|
||||
}
|
||||
|
||||
static bool read_packet(vpn_packet_t *packet) {
|
||||
int inlen;
|
||||
|
||||
switch(device_type) {
|
||||
case DEVICE_TYPE_TUN:
|
||||
#ifdef ENABLE_TUNEMU
|
||||
case DEVICE_TYPE_TUNEMU:
|
||||
if(device_type == DEVICE_TYPE_TUNEMU)
|
||||
inlen = tunemu_read(device_fd, packet->data + 14, MTU - 14);
|
||||
else
|
||||
#endif
|
||||
inlen = read(device_fd, packet->data + 14, MTU - 14);
|
||||
|
||||
if(inlen <= 0) {
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "Error while reading from %s %s: %s", device_info,
|
||||
device, strerror(errno));
|
||||
return false;
|
||||
}
|
||||
|
||||
switch(packet->data[14] >> 4) {
|
||||
case 4:
|
||||
packet->data[12] = 0x08;
|
||||
packet->data[13] = 0x00;
|
||||
break;
|
||||
case 6:
|
||||
packet->data[12] = 0x86;
|
||||
packet->data[13] = 0xDD;
|
||||
break;
|
||||
default:
|
||||
logger(DEBUG_TRAFFIC, LOG_ERR,
|
||||
"Unknown IP version %d while reading packet from %s %s",
|
||||
packet->data[14] >> 4, device_info, device);
|
||||
return false;
|
||||
}
|
||||
|
||||
memset(packet->data, 0, 12);
|
||||
packet->len = inlen + 14;
|
||||
break;
|
||||
|
||||
case DEVICE_TYPE_TUNIFHEAD: {
|
||||
u_int32_t type;
|
||||
struct iovec vector[2] = {{&type, sizeof type}, {packet->data + 14, MTU - 14}};
|
||||
|
||||
if((inlen = readv(device_fd, vector, 2)) <= 0) {
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "Error while reading from %s %s: %s", device_info,
|
||||
device, strerror(errno));
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (ntohl(type)) {
|
||||
case AF_INET:
|
||||
packet->data[12] = 0x08;
|
||||
packet->data[13] = 0x00;
|
||||
break;
|
||||
|
||||
case AF_INET6:
|
||||
packet->data[12] = 0x86;
|
||||
packet->data[13] = 0xDD;
|
||||
break;
|
||||
|
||||
default:
|
||||
logger(DEBUG_TRAFFIC, LOG_ERR,
|
||||
"Unknown address family %x while reading packet from %s %s",
|
||||
ntohl(type), device_info, device);
|
||||
return false;
|
||||
}
|
||||
|
||||
memset(packet->data, 0, 12);
|
||||
packet->len = inlen + 10;
|
||||
break;
|
||||
}
|
||||
|
||||
case DEVICE_TYPE_TAP:
|
||||
if((inlen = read(device_fd, packet->data, MTU)) <= 0) {
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "Error while reading from %s %s: %s", device_info,
|
||||
device, strerror(errno));
|
||||
return false;
|
||||
}
|
||||
|
||||
packet->len = inlen;
|
||||
break;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
device_total_in += packet->len;
|
||||
|
||||
logger(DEBUG_TRAFFIC, LOG_DEBUG, "Read packet of %d bytes from %s",
|
||||
packet->len, device_info);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool write_packet(vpn_packet_t *packet) {
|
||||
logger(DEBUG_TRAFFIC, LOG_DEBUG, "Writing packet of %d bytes to %s",
|
||||
packet->len, device_info);
|
||||
|
||||
switch(device_type) {
|
||||
case DEVICE_TYPE_TUN:
|
||||
if(write(device_fd, packet->data + 14, packet->len - 14) < 0) {
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "Error while writing to %s %s: %s", device_info,
|
||||
device, strerror(errno));
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
case DEVICE_TYPE_TUNIFHEAD: {
|
||||
u_int32_t type;
|
||||
struct iovec vector[2] = {{&type, sizeof type}, {packet->data + 14, packet->len - 14}};
|
||||
int af;
|
||||
|
||||
af = (packet->data[12] << 8) + packet->data[13];
|
||||
|
||||
switch (af) {
|
||||
case 0x0800:
|
||||
type = htonl(AF_INET);
|
||||
break;
|
||||
case 0x86DD:
|
||||
type = htonl(AF_INET6);
|
||||
break;
|
||||
default:
|
||||
logger(DEBUG_TRAFFIC, LOG_ERR,
|
||||
"Unknown address family %x while writing packet to %s %s",
|
||||
af, device_info, device);
|
||||
return false;
|
||||
}
|
||||
|
||||
if(writev(device_fd, vector, 2) < 0) {
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "Can't write to %s %s: %s", device_info, device,
|
||||
strerror(errno));
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case DEVICE_TYPE_TAP:
|
||||
if(write(device_fd, packet->data, packet->len) < 0) {
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "Error while writing to %s %s: %s", device_info,
|
||||
device, strerror(errno));
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
#ifdef ENABLE_TUNEMU
|
||||
case DEVICE_TYPE_TUNEMU:
|
||||
if(tunemu_write(device_fd, packet->data + 14, packet->len - 14) < 0) {
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "Error while writing to %s %s: %s", device_info,
|
||||
device, strerror(errno));
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
device_total_out += packet->len;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void dump_device_stats(void) {
|
||||
logger(DEBUG_ALWAYS, LOG_DEBUG, "Statistics for %s %s:", device_info, device);
|
||||
logger(DEBUG_ALWAYS, LOG_DEBUG, " total bytes in: %10"PRIu64, device_total_in);
|
||||
logger(DEBUG_ALWAYS, LOG_DEBUG, " total bytes out: %10"PRIu64, device_total_out);
|
||||
}
|
||||
|
||||
const devops_t os_devops = {
|
||||
.setup = setup_device,
|
||||
.close = close_device,
|
||||
.read = read_packet,
|
||||
.write = write_packet,
|
||||
.dump_stats = dump_device_stats,
|
||||
};
|
218
src/cipher.c
218
src/cipher.c
|
@ -1,218 +0,0 @@
|
|||
/*
|
||||
cipher.c -- Symmetric block cipher handling
|
||||
Copyright (C) 2007-2012 Guus Sliepen <guus@tinc-vpn.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#include "system.h"
|
||||
|
||||
#include <openssl/rand.h>
|
||||
#include <openssl/err.h>
|
||||
|
||||
#include "cipher.h"
|
||||
#include "logger.h"
|
||||
#include "xalloc.h"
|
||||
|
||||
typedef struct cipher_counter {
|
||||
unsigned char counter[EVP_MAX_IV_LENGTH];
|
||||
unsigned char block[EVP_MAX_IV_LENGTH];
|
||||
int n;
|
||||
} cipher_counter_t;
|
||||
|
||||
static bool cipher_open(cipher_t *cipher) {
|
||||
EVP_CIPHER_CTX_init(&cipher->ctx);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool cipher_open_by_name(cipher_t *cipher, const char *name) {
|
||||
cipher->cipher = EVP_get_cipherbyname(name);
|
||||
|
||||
if(cipher->cipher)
|
||||
return cipher_open(cipher);
|
||||
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "Unknown cipher name '%s'!", name);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool cipher_open_by_nid(cipher_t *cipher, int nid) {
|
||||
cipher->cipher = EVP_get_cipherbynid(nid);
|
||||
|
||||
if(cipher->cipher)
|
||||
return cipher_open(cipher);
|
||||
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "Unknown cipher nid %d!", nid);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool cipher_open_blowfish_ofb(cipher_t *cipher) {
|
||||
cipher->cipher = EVP_bf_ofb();
|
||||
return cipher_open(cipher);
|
||||
}
|
||||
|
||||
void cipher_close(cipher_t *cipher) {
|
||||
EVP_CIPHER_CTX_cleanup(&cipher->ctx);
|
||||
free(cipher->counter);
|
||||
cipher->counter = NULL;
|
||||
}
|
||||
|
||||
size_t cipher_keylength(const cipher_t *cipher) {
|
||||
return cipher->cipher->key_len + cipher->cipher->block_size;
|
||||
}
|
||||
|
||||
bool cipher_set_key(cipher_t *cipher, void *key, bool encrypt) {
|
||||
bool result;
|
||||
|
||||
if(encrypt)
|
||||
result = EVP_EncryptInit_ex(&cipher->ctx, cipher->cipher, NULL, (unsigned char *)key, (unsigned char *)key + cipher->cipher->key_len);
|
||||
else
|
||||
result = EVP_DecryptInit_ex(&cipher->ctx, cipher->cipher, NULL, (unsigned char *)key, (unsigned char *)key + cipher->cipher->key_len);
|
||||
|
||||
if(result)
|
||||
return true;
|
||||
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "Error while setting key: %s", ERR_error_string(ERR_get_error(), NULL));
|
||||
return false;
|
||||
}
|
||||
|
||||
bool cipher_set_key_from_rsa(cipher_t *cipher, void *key, size_t len, bool encrypt) {
|
||||
bool result;
|
||||
|
||||
if(encrypt)
|
||||
result = EVP_EncryptInit_ex(&cipher->ctx, cipher->cipher, NULL, (unsigned char *)key + len - cipher->cipher->key_len, (unsigned char *)key + len - cipher->cipher->iv_len - cipher->cipher->key_len);
|
||||
else
|
||||
result = EVP_DecryptInit_ex(&cipher->ctx, cipher->cipher, NULL, (unsigned char *)key + len - cipher->cipher->key_len, (unsigned char *)key + len - cipher->cipher->iv_len - cipher->cipher->key_len);
|
||||
|
||||
if(result)
|
||||
return true;
|
||||
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "Error while setting key: %s", ERR_error_string(ERR_get_error(), NULL));
|
||||
return false;
|
||||
}
|
||||
|
||||
bool cipher_set_counter(cipher_t *cipher, const void *counter, size_t len) {
|
||||
if(len > cipher->cipher->block_size - 4) {
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "Counter too long");
|
||||
abort();
|
||||
}
|
||||
|
||||
memcpy(cipher->counter->counter + cipher->cipher->block_size - len, counter, len);
|
||||
memset(cipher->counter->counter, 0, 4);
|
||||
cipher->counter->n = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool cipher_set_counter_key(cipher_t *cipher, void *key) {
|
||||
int result = EVP_EncryptInit_ex(&cipher->ctx, cipher->cipher, NULL, (unsigned char *)key, NULL);
|
||||
if(!result) {
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "Error while setting key: %s", ERR_error_string(ERR_get_error(), NULL));
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!cipher->counter)
|
||||
cipher->counter = xmalloc_and_zero(sizeof *cipher->counter);
|
||||
else
|
||||
cipher->counter->n = 0;
|
||||
|
||||
memcpy(cipher->counter->counter, (unsigned char *)key + cipher->cipher->key_len, cipher->cipher->block_size);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool cipher_counter_xor(cipher_t *cipher, const void *indata, size_t inlen, void *outdata) {
|
||||
if(!cipher->counter) {
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "Counter not initialized");
|
||||
return false;
|
||||
}
|
||||
|
||||
const unsigned char *in = indata;
|
||||
unsigned char *out = outdata;
|
||||
|
||||
while(inlen--) {
|
||||
// Encrypt the new counter value if we need it
|
||||
if(!cipher->counter->n) {
|
||||
int len;
|
||||
if(!EVP_EncryptUpdate(&cipher->ctx, cipher->counter->block, &len, cipher->counter->counter, cipher->cipher->block_size)) {
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "Error while encrypting: %s", ERR_error_string(ERR_get_error(), NULL));
|
||||
return false;
|
||||
}
|
||||
|
||||
// Increase the counter value
|
||||
for(int i = 0; i < cipher->cipher->block_size; i++)
|
||||
if(++cipher->counter->counter[i])
|
||||
break;
|
||||
}
|
||||
|
||||
*out++ = *in++ ^ cipher->counter->counter[cipher->counter->n++];
|
||||
|
||||
if(cipher->counter->n >= cipher->cipher->block_size)
|
||||
cipher->counter->n = 0;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool cipher_encrypt(cipher_t *cipher, const void *indata, size_t inlen, void *outdata, size_t *outlen, bool oneshot) {
|
||||
if(oneshot) {
|
||||
int len, pad;
|
||||
if(EVP_EncryptInit_ex(&cipher->ctx, NULL, NULL, NULL, NULL)
|
||||
&& EVP_EncryptUpdate(&cipher->ctx, (unsigned char *)outdata, &len, indata, inlen)
|
||||
&& EVP_EncryptFinal(&cipher->ctx, (unsigned char *)outdata + len, &pad)) {
|
||||
if(outlen) *outlen = len + pad;
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
int len;
|
||||
if(EVP_EncryptUpdate(&cipher->ctx, outdata, &len, indata, inlen)) {
|
||||
if(outlen) *outlen = len;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "Error while encrypting: %s", ERR_error_string(ERR_get_error(), NULL));
|
||||
return false;
|
||||
}
|
||||
|
||||
bool cipher_decrypt(cipher_t *cipher, const void *indata, size_t inlen, void *outdata, size_t *outlen, bool oneshot) {
|
||||
if(oneshot) {
|
||||
int len, pad;
|
||||
if(EVP_DecryptInit_ex(&cipher->ctx, NULL, NULL, NULL, NULL)
|
||||
&& EVP_DecryptUpdate(&cipher->ctx, (unsigned char *)outdata, &len, indata, inlen)
|
||||
&& EVP_DecryptFinal(&cipher->ctx, (unsigned char *)outdata + len, &pad)) {
|
||||
if(outlen) *outlen = len + pad;
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
int len;
|
||||
if(EVP_EncryptUpdate(&cipher->ctx, outdata, &len, indata, inlen)) {
|
||||
if(outlen) *outlen = len;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "Error while decrypting: %s", ERR_error_string(ERR_get_error(), NULL));
|
||||
return false;
|
||||
}
|
||||
|
||||
int cipher_get_nid(const cipher_t *cipher) {
|
||||
return cipher->cipher ? cipher->cipher->nid : 0;
|
||||
}
|
||||
|
||||
bool cipher_active(const cipher_t *cipher) {
|
||||
return cipher->cipher && cipher->cipher->nid != 0;
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
cipher.h -- header file cipher.c
|
||||
Copyright (C) 2007-2012 Guus Sliepen <guus@tinc-vpn.org>
|
||||
Copyright (C) 2007-2013 Guus Sliepen <guus@tinc-vpn.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -20,30 +20,25 @@
|
|||
#ifndef __TINC_CIPHER_H__
|
||||
#define __TINC_CIPHER_H__
|
||||
|
||||
#include <openssl/evp.h>
|
||||
#define CIPHER_MAX_BLOCK_SIZE 32
|
||||
#define CIPHER_MAX_IV_SIZE 16
|
||||
#define CIPHER_MAX_KEY_SIZE 32
|
||||
|
||||
#define CIPHER_MAX_BLOCK_SIZE EVP_MAX_BLOCK_LENGTH
|
||||
#define CIPHER_MAX_KEY_SIZE EVP_MAX_KEY_LENGTH
|
||||
#define CIPHER_MAX_IV_SIZE EVP_MAX_IV_LENGTH
|
||||
typedef struct cipher cipher_t;
|
||||
|
||||
typedef struct cipher {
|
||||
EVP_CIPHER_CTX ctx;
|
||||
const EVP_CIPHER *cipher;
|
||||
struct cipher_counter *counter;
|
||||
} cipher_t;
|
||||
|
||||
extern bool cipher_open_by_name(cipher_t *, const char *);
|
||||
extern bool cipher_open_by_nid(cipher_t *, int);
|
||||
extern bool cipher_open_blowfish_ofb(cipher_t *);
|
||||
extern cipher_t *cipher_open_by_name(const char *) __attribute__ ((__malloc__));
|
||||
extern cipher_t *cipher_open_by_nid(int) __attribute__ ((__malloc__));
|
||||
extern cipher_t *cipher_open_blowfish_ofb(void) __attribute__ ((__malloc__));
|
||||
extern void cipher_close(cipher_t *);
|
||||
extern size_t cipher_keylength(const cipher_t *);
|
||||
extern bool cipher_set_key(cipher_t *, void *, bool);
|
||||
extern bool cipher_set_key_from_rsa(cipher_t *, void *, size_t, bool);
|
||||
extern bool cipher_set_counter(cipher_t *, const void *, size_t);
|
||||
extern bool cipher_set_counter_key(cipher_t *, void *);
|
||||
extern bool cipher_encrypt(cipher_t *, const void *indata, size_t inlen, void *outdata, size_t *outlen, bool);
|
||||
extern bool cipher_decrypt(cipher_t *, const void *indata, size_t inlen, void *outdata, size_t *outlen, bool);
|
||||
extern bool cipher_counter_xor(cipher_t *, const void *indata, size_t inlen, void *outdata);
|
||||
extern void cipher_get_key(const cipher_t *, void *);
|
||||
extern bool cipher_set_key(cipher_t *, void *, bool) __attribute__ ((__warn_unused_result__));
|
||||
extern bool cipher_set_key_from_rsa(cipher_t *, void *, size_t, bool) __attribute__ ((__warn_unused_result__));
|
||||
extern bool cipher_set_counter(cipher_t *, const void *, size_t) __attribute__ ((__warn_unused_result__));
|
||||
extern bool cipher_set_counter_key(cipher_t *, void *) __attribute__ ((__warn_unused_result__));
|
||||
extern bool cipher_encrypt(cipher_t *, const void *indata, size_t inlen, void *outdata, size_t *outlen, bool oneshot) __attribute__ ((__warn_unused_result__));
|
||||
extern bool cipher_decrypt(cipher_t *, const void *indata, size_t inlen, void *outdata, size_t *outlen, bool oneshot) __attribute__ ((__warn_unused_result__));
|
||||
extern bool cipher_counter_xor(cipher_t *, const void *indata, size_t inlen, void *outdata) __attribute__ ((__warn_unused_result__));
|
||||
extern int cipher_get_nid(const cipher_t *);
|
||||
extern bool cipher_active(const cipher_t *);
|
||||
|
|
@ -71,7 +71,7 @@ void exit_configuration(splay_tree_t ** config_tree) {
|
|||
}
|
||||
|
||||
config_t *new_config(void) {
|
||||
return xmalloc_and_zero(sizeof(config_t));
|
||||
return xzalloc(sizeof(config_t));
|
||||
}
|
||||
|
||||
void free_config(config_t *cfg) {
|
||||
|
@ -373,9 +373,10 @@ bool read_server_config(void) {
|
|||
read_config_options(config_tree, NULL);
|
||||
|
||||
xasprintf(&fname, "%s" SLASH "tinc.conf", confbase);
|
||||
errno = 0;
|
||||
x = read_config_file(config_tree, fname);
|
||||
|
||||
if(!x)
|
||||
if(!x && errno)
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "Failed to read `%s': %s", fname, strerror(errno));
|
||||
|
||||
free(fname);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
connection.c -- connection list management
|
||||
Copyright (C) 2000-2012 Guus Sliepen <guus@tinc-vpn.org>,
|
||||
Copyright (C) 2000-2013 Guus Sliepen <guus@tinc-vpn.org>,
|
||||
2000-2005 Ivo Timmermans
|
||||
2008 Max Rijevski <maksuf@gmail.com>
|
||||
|
||||
|
@ -27,6 +27,7 @@
|
|||
#include "control_common.h"
|
||||
#include "list.h"
|
||||
#include "logger.h"
|
||||
#include "rsa.h"
|
||||
#include "subnet.h"
|
||||
#include "utils.h"
|
||||
#include "xalloc.h"
|
||||
|
@ -47,21 +48,21 @@ void exit_connections(void) {
|
|||
}
|
||||
|
||||
connection_t *new_connection(void) {
|
||||
return xmalloc_and_zero(sizeof(connection_t));
|
||||
return xzalloc(sizeof(connection_t));
|
||||
}
|
||||
|
||||
void free_connection(connection_t *c) {
|
||||
if(!c)
|
||||
return;
|
||||
|
||||
cipher_close(&c->incipher);
|
||||
digest_close(&c->indigest);
|
||||
cipher_close(&c->outcipher);
|
||||
digest_close(&c->outdigest);
|
||||
cipher_close(c->incipher);
|
||||
digest_close(c->indigest);
|
||||
cipher_close(c->outcipher);
|
||||
digest_close(c->outdigest);
|
||||
|
||||
sptps_stop(&c->sptps);
|
||||
ecdsa_free(&c->ecdsa);
|
||||
rsa_free(&c->rsa);
|
||||
ecdsa_free(c->ecdsa);
|
||||
rsa_free(c->rsa);
|
||||
|
||||
free(c->hischallenge);
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
connection.h -- header for connection.c
|
||||
Copyright (C) 2000-2012 Guus Sliepen <guus@tinc-vpn.org>,
|
||||
Copyright (C) 2000-2013 Guus Sliepen <guus@tinc-vpn.org>,
|
||||
2000-2005 Ivo Timmermans
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
|
@ -47,7 +47,9 @@ typedef struct connection_status_t {
|
|||
unsigned int control:1; /* 1 if this is a control connection */
|
||||
unsigned int pcap:1; /* 1 if this is a control connection requesting packet capture */
|
||||
unsigned int log:1; /* 1 if this is a control connection requesting log dump */
|
||||
unsigned int unused:20;
|
||||
unsigned int invitation:1; /* 1 if this is an invitation */
|
||||
unsigned int invitation_used:1; /* 1 if the invitation has been consumed */
|
||||
unsigned int unused:19;
|
||||
} connection_status_t;
|
||||
|
||||
#include "ecdsa.h"
|
||||
|
@ -73,12 +75,12 @@ typedef struct connection_t {
|
|||
struct node_t *node; /* node associated with the other end */
|
||||
struct edge_t *edge; /* edge associated with this connection */
|
||||
|
||||
rsa_t rsa; /* his public RSA key */
|
||||
ecdsa_t ecdsa; /* his public ECDSA key */
|
||||
cipher_t incipher; /* Cipher he will use to send data to us */
|
||||
cipher_t outcipher; /* Cipher we will use to send data to him */
|
||||
digest_t indigest;
|
||||
digest_t outdigest;
|
||||
rsa_t *rsa; /* his public RSA key */
|
||||
ecdsa_t *ecdsa; /* his public ECDSA key */
|
||||
cipher_t *incipher; /* Cipher he will use to send data to us */
|
||||
cipher_t *outcipher; /* Cipher we will use to send data to him */
|
||||
digest_t *indigest;
|
||||
digest_t *outdigest;
|
||||
sptps_t sptps;
|
||||
|
||||
int inmaclength;
|
||||
|
|
|
@ -137,17 +137,16 @@ bool init_control(void) {
|
|||
randomize(controlcookie, sizeof controlcookie / 2);
|
||||
bin2hex(controlcookie, controlcookie, sizeof controlcookie / 2);
|
||||
|
||||
mode_t mask = umask(0);
|
||||
umask(mask | 077);
|
||||
FILE *f = fopen(pidfilename, "w");
|
||||
umask(mask);
|
||||
|
||||
if(!f) {
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "Cannot write control socket cookie file %s: %s", pidfilename, strerror(errno));
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef HAVE_FCHMOD
|
||||
fchmod(fileno(f), 0600);
|
||||
#else
|
||||
chmod(pidfilename, 0600);
|
||||
#endif
|
||||
// Get the address and port of the first listening socket
|
||||
|
||||
char *localhost = NULL;
|
||||
|
@ -157,7 +156,7 @@ bool init_control(void) {
|
|||
// Make sure we have a valid address, and map 0.0.0.0 and :: to 127.0.0.1 and ::1.
|
||||
|
||||
if(getsockname(listen_socket[0].tcp.fd, (struct sockaddr *)&sa, &len)) {
|
||||
xasprintf(&localhost, "127.0.0.1 port %d", myport);
|
||||
xasprintf(&localhost, "127.0.0.1 port %s", myport);
|
||||
} else {
|
||||
if(sa.sa.sa_family == AF_INET) {
|
||||
if(sa.in.sin_addr.s_addr == 0)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
crypto.h -- header for crypto.c
|
||||
Copyright (C) 2007 Guus Sliepen <guus@tinc-vpn.org>
|
||||
Copyright (C) 2007-2013 Guus Sliepen <guus@tinc-vpn.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
1
src/cygwin/.deps/device.Po
Normal file
1
src/cygwin/.deps/device.Po
Normal file
|
@ -0,0 +1 @@
|
|||
# dummy
|
|
@ -18,21 +18,21 @@
|
|||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#include "system.h"
|
||||
#include "../system.h"
|
||||
|
||||
#include <w32api/windows.h>
|
||||
#include <w32api/winioctl.h>
|
||||
|
||||
#include "conf.h"
|
||||
#include "device.h"
|
||||
#include "logger.h"
|
||||
#include "names.h"
|
||||
#include "net.h"
|
||||
#include "route.h"
|
||||
#include "utils.h"
|
||||
#include "xalloc.h"
|
||||
#include "../conf.h"
|
||||
#include "../device.h"
|
||||
#include "../logger.h"
|
||||
#include "../names.h"
|
||||
#include "../net.h"
|
||||
#include "../route.h"
|
||||
#include "../utils.h"
|
||||
#include "../xalloc.h"
|
||||
|
||||
#include "mingw/common.h"
|
||||
#include "../mingw/common.h"
|
||||
|
||||
int device_fd = -1;
|
||||
static HANDLE device_handle = INVALID_HANDLE_VALUE;
|
||||
|
|
127
src/digest.c
127
src/digest.c
|
@ -1,127 +0,0 @@
|
|||
/*
|
||||
digest.c -- Digest handling
|
||||
Copyright (C) 2007-2012 Guus Sliepen <guus@tinc-vpn.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#include "system.h"
|
||||
#include "utils.h"
|
||||
#include "xalloc.h"
|
||||
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/hmac.h>
|
||||
|
||||
#include "digest.h"
|
||||
#include "logger.h"
|
||||
|
||||
static void set_maclength(digest_t *digest, int maclength) {
|
||||
int digestlen = EVP_MD_size(digest->digest);
|
||||
|
||||
if(maclength > digestlen || maclength < 0)
|
||||
digest->maclength = digestlen;
|
||||
else
|
||||
digest->maclength = maclength;
|
||||
}
|
||||
|
||||
bool digest_open_by_name(digest_t *digest, const char *name, int maclength) {
|
||||
digest->digest = EVP_get_digestbyname(name);
|
||||
digest->key = NULL;
|
||||
|
||||
if(!digest->digest) {
|
||||
logger(DEBUG_ALWAYS, LOG_DEBUG, "Unknown digest name '%s'!", name);
|
||||
return false;
|
||||
}
|
||||
|
||||
set_maclength(digest, maclength);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool digest_open_by_nid(digest_t *digest, int nid, int maclength) {
|
||||
digest->digest = EVP_get_digestbynid(nid);
|
||||
digest->key = NULL;
|
||||
|
||||
if(!digest->digest) {
|
||||
logger(DEBUG_ALWAYS, LOG_DEBUG, "Unknown digest nid %d!", nid);
|
||||
return false;
|
||||
}
|
||||
|
||||
set_maclength(digest, maclength);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool digest_open_sha1(digest_t *digest, int maclength) {
|
||||
digest->digest = EVP_sha1();
|
||||
digest->key = NULL;
|
||||
|
||||
set_maclength(digest, maclength);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool digest_set_key(digest_t *digest, const void *key, size_t len) {
|
||||
digest->key = xrealloc(digest->key, len);
|
||||
memcpy(digest->key, key, len);
|
||||
digest->keylength = len;
|
||||
return true;
|
||||
}
|
||||
|
||||
void digest_close(digest_t *digest) {
|
||||
free(digest->key);
|
||||
digest->key = NULL;
|
||||
}
|
||||
|
||||
bool digest_create(digest_t *digest, const void *indata, size_t inlen, void *outdata) {
|
||||
size_t len = EVP_MD_size(digest->digest);
|
||||
unsigned char tmpdata[len];
|
||||
|
||||
if(digest->key) {
|
||||
HMAC(digest->digest, digest->key, digest->keylength, indata, inlen, tmpdata, NULL);
|
||||
} else {
|
||||
EVP_MD_CTX ctx;
|
||||
|
||||
if(!EVP_DigestInit(&ctx, digest->digest)
|
||||
|| !EVP_DigestUpdate(&ctx, indata, inlen)
|
||||
|| !EVP_DigestFinal(&ctx, tmpdata, NULL)) {
|
||||
logger(DEBUG_ALWAYS, LOG_DEBUG, "Error creating digest: %s", ERR_error_string(ERR_get_error(), NULL));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
memcpy(outdata, tmpdata, digest->maclength);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool digest_verify(digest_t *digest, const void *indata, size_t inlen, const void *cmpdata) {
|
||||
size_t len = digest->maclength;
|
||||
unsigned char outdata[len];
|
||||
|
||||
return digest_create(digest, indata, inlen, outdata) && !memcmp(cmpdata, outdata, digest->maclength);
|
||||
}
|
||||
|
||||
int digest_get_nid(const digest_t *digest) {
|
||||
return digest->digest ? digest->digest->type : 0;
|
||||
}
|
||||
|
||||
size_t digest_keylength(const digest_t *digest) {
|
||||
return digest->digest->md_size;
|
||||
}
|
||||
|
||||
size_t digest_length(const digest_t *digest) {
|
||||
return digest->maclength;
|
||||
}
|
||||
|
||||
bool digest_active(const digest_t *digest) {
|
||||
return digest->digest && digest->digest->type != 0;
|
||||
}
|
39
src/digest.h
Normal file
39
src/digest.h
Normal file
|
@ -0,0 +1,39 @@
|
|||
/*
|
||||
digest.h -- header file digest.c
|
||||
Copyright (C) 2007-2013 Guus Sliepen <guus@tinc-vpn.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#ifndef __TINC_DIGEST_H__
|
||||
#define __TINC_DIGEST_H__
|
||||
|
||||
#define DIGEST_MAX_SIZE 64
|
||||
|
||||
typedef struct digest digest_t;
|
||||
|
||||
extern digest_t *digest_open_by_name(const char *name, int maclength) __attribute__ ((__malloc__));
|
||||
extern digest_t *digest_open_by_nid(int nid, int maclength) __attribute__ ((__malloc__));
|
||||
extern digest_t *digest_open_sha1(int maclength) __attribute__ ((__malloc__));
|
||||
extern void digest_close(digest_t *);
|
||||
extern bool digest_create(digest_t *, const void *indata, size_t inlen, void *outdata) __attribute__ ((__warn_unused_result__));
|
||||
extern bool digest_verify(digest_t *, const void *indata, size_t inlen, const void *digestdata) __attribute__ ((__warn_unused_result__));
|
||||
extern bool digest_set_key(digest_t *, const void *key, size_t len) __attribute__ ((__warn_unused_result__));
|
||||
extern int digest_get_nid(const digest_t *);
|
||||
extern size_t digest_keylength(const digest_t *);
|
||||
extern size_t digest_length(const digest_t *);
|
||||
extern bool digest_active(const digest_t *);
|
||||
|
||||
#endif
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
dropin.c -- a set of drop-in replacements for libc functions
|
||||
Copyright (C) 2000-2005 Ivo Timmermans,
|
||||
2000-2011 Guus Sliepen <guus@tinc-vpn.org>
|
||||
2000-2013 Guus Sliepen <guus@tinc-vpn.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
dropin.h -- header file for dropin.c
|
||||
Copyright (C) 2000-2005 Ivo Timmermans,
|
||||
2000-2011 Guus Sliepen <guus@tinc-vpn.org>
|
||||
2000-2013 Guus Sliepen <guus@tinc-vpn.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -63,4 +63,11 @@ extern int usleep(long long usec);
|
|||
} while (0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MINGW
|
||||
#define mkdir(a, b) mkdir(a)
|
||||
#ifndef SHUT_RDWR
|
||||
#define SHUT_RDWR SD_BOTH
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* __DROPIN_H__ */
|
||||
|
|
96
src/ecdh.c
96
src/ecdh.c
|
@ -1,96 +0,0 @@
|
|||
/*
|
||||
ecdh.c -- Diffie-Hellman key exchange handling
|
||||
Copyright (C) 2011-2012 Guus Sliepen <guus@tinc-vpn.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#include "system.h"
|
||||
#include "utils.h"
|
||||
#include "xalloc.h"
|
||||
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/ec.h>
|
||||
#include <openssl/obj_mac.h>
|
||||
|
||||
#include "ecdh.h"
|
||||
#include "logger.h"
|
||||
|
||||
bool ecdh_generate_public(ecdh_t *ecdh, void *pubkey) {
|
||||
*ecdh = EC_KEY_new_by_curve_name(NID_secp521r1);
|
||||
if(!*ecdh) {
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "Generating EC key_by_curve_name failed: %s", ERR_error_string(ERR_get_error(), NULL));
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!EC_KEY_generate_key(*ecdh)) {
|
||||
EC_KEY_free(*ecdh);
|
||||
*ecdh = NULL;
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "Generating EC key failed: %s", ERR_error_string(ERR_get_error(), NULL));
|
||||
return false;
|
||||
}
|
||||
|
||||
const EC_POINT *point = EC_KEY_get0_public_key(*ecdh);
|
||||
if(!point) {
|
||||
EC_KEY_free(*ecdh);
|
||||
*ecdh = NULL;
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "Getting public key failed: %s", ERR_error_string(ERR_get_error(), NULL));
|
||||
return false;
|
||||
}
|
||||
|
||||
size_t result = EC_POINT_point2oct(EC_KEY_get0_group(*ecdh), point, POINT_CONVERSION_COMPRESSED, pubkey, ECDH_SIZE, NULL);
|
||||
if(!result) {
|
||||
EC_KEY_free(*ecdh);
|
||||
*ecdh = NULL;
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "Converting EC_POINT to binary failed: %s", ERR_error_string(ERR_get_error(), NULL));
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ecdh_compute_shared(ecdh_t *ecdh, const void *pubkey, void *shared) {
|
||||
EC_POINT *point = EC_POINT_new(EC_KEY_get0_group(*ecdh));
|
||||
if(!point) {
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "EC_POINT_new() failed: %s", ERR_error_string(ERR_get_error(), NULL));
|
||||
return false;
|
||||
}
|
||||
|
||||
int result = EC_POINT_oct2point(EC_KEY_get0_group(*ecdh), point, pubkey, ECDH_SIZE, NULL);
|
||||
if(!result) {
|
||||
EC_POINT_free(point);
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "Converting binary to EC_POINT failed: %s", ERR_error_string(ERR_get_error(), NULL));
|
||||
return false;
|
||||
}
|
||||
|
||||
result = ECDH_compute_key(shared, ECDH_SIZE, point, *ecdh, NULL);
|
||||
EC_POINT_free(point);
|
||||
EC_KEY_free(*ecdh);
|
||||
*ecdh = NULL;
|
||||
|
||||
if(!result) {
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "Computing Elliptic Curve Diffie-Hellman shared key failed: %s", ERR_error_string(ERR_get_error(), NULL));
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void ecdh_free(ecdh_t *ecdh) {
|
||||
if(*ecdh) {
|
||||
EC_KEY_free(*ecdh);
|
||||
*ecdh = NULL;
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
ecdh.h -- header file for ecdh.c
|
||||
Copyright (C) 2011 Guus Sliepen <guus@tinc-vpn.org>
|
||||
Copyright (C) 2011-2013 Guus Sliepen <guus@tinc-vpn.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -20,15 +20,15 @@
|
|||
#ifndef __TINC_ECDH_H__
|
||||
#define __TINC_ECDH_H__
|
||||
|
||||
#include <openssl/ecdh.h>
|
||||
|
||||
#define ECDH_SIZE 67
|
||||
#define ECDH_SHARED_SIZE 66
|
||||
|
||||
typedef EC_KEY *ecdh_t;
|
||||
#ifndef __TINC_ECDH_INTERNAL__
|
||||
typedef struct ecdh ecdh_t;
|
||||
#endif
|
||||
|
||||
extern bool ecdh_generate_public(ecdh_t *ecdh, void *pubkey);
|
||||
extern bool ecdh_compute_shared(ecdh_t *ecdh, const void *pubkey, void *shared);
|
||||
extern ecdh_t *ecdh_generate_public(void *pubkey) __attribute__ ((__malloc__));
|
||||
extern bool ecdh_compute_shared(ecdh_t *ecdh, const void *pubkey, void *shared) __attribute__ ((__warn_unused_result__));
|
||||
extern void ecdh_free(ecdh_t *ecdh);
|
||||
|
||||
#endif
|
130
src/ecdsa.c
130
src/ecdsa.c
|
@ -1,130 +0,0 @@
|
|||
/*
|
||||
ecdsa.c -- ECDSA key handling
|
||||
Copyright (C) 2011-2012 Guus Sliepen <guus@tinc-vpn.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#include "system.h"
|
||||
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/err.h>
|
||||
|
||||
#include "logger.h"
|
||||
#include "ecdsa.h"
|
||||
#include "utils.h"
|
||||
|
||||
// Get and set ECDSA keys
|
||||
//
|
||||
bool ecdsa_set_base64_public_key(ecdsa_t *ecdsa, const char *p) {
|
||||
*ecdsa = EC_KEY_new_by_curve_name(NID_secp521r1);
|
||||
if(!*ecdsa) {
|
||||
logger(DEBUG_ALWAYS, LOG_DEBUG, "EC_KEY_new_by_curve_name failed: %s", ERR_error_string(ERR_get_error(), NULL));
|
||||
return false;
|
||||
}
|
||||
|
||||
int len = strlen(p);
|
||||
unsigned char pubkey[len / 4 * 3 + 3];
|
||||
const unsigned char *ppubkey = pubkey;
|
||||
len = b64decode(p, (char *)pubkey, len);
|
||||
|
||||
if(!o2i_ECPublicKey(ecdsa, &ppubkey, len)) {
|
||||
logger(DEBUG_ALWAYS, LOG_DEBUG, "o2i_ECPublicKey failed: %s", ERR_error_string(ERR_get_error(), NULL));
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
char *ecdsa_get_base64_public_key(ecdsa_t *ecdsa) {
|
||||
unsigned char *pubkey = NULL;
|
||||
int len = i2o_ECPublicKey(*ecdsa, &pubkey);
|
||||
|
||||
char *base64 = malloc(len * 4 / 3 + 5);
|
||||
b64encode((char *)pubkey, base64, len);
|
||||
|
||||
free(pubkey);
|
||||
|
||||
return base64;
|
||||
}
|
||||
|
||||
// Read PEM ECDSA keys
|
||||
|
||||
bool ecdsa_read_pem_public_key(ecdsa_t *ecdsa, FILE *fp) {
|
||||
*ecdsa = PEM_read_EC_PUBKEY(fp, ecdsa, NULL, NULL);
|
||||
|
||||
if(*ecdsa)
|
||||
return true;
|
||||
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "Unable to read ECDSA public key: %s", ERR_error_string(ERR_get_error(), NULL));
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ecdsa_read_pem_private_key(ecdsa_t *ecdsa, FILE *fp) {
|
||||
*ecdsa = PEM_read_ECPrivateKey(fp, NULL, NULL, NULL);
|
||||
|
||||
if(*ecdsa)
|
||||
return true;
|
||||
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "Unable to read ECDSA private key: %s", ERR_error_string(ERR_get_error(), NULL));
|
||||
return false;
|
||||
}
|
||||
|
||||
size_t ecdsa_size(ecdsa_t *ecdsa) {
|
||||
return ECDSA_size(*ecdsa);
|
||||
}
|
||||
|
||||
// TODO: standardise output format?
|
||||
|
||||
bool ecdsa_sign(ecdsa_t *ecdsa, const void *in, size_t len, void *sig) {
|
||||
unsigned int siglen = ECDSA_size(*ecdsa);
|
||||
|
||||
unsigned char hash[SHA512_DIGEST_LENGTH];
|
||||
SHA512(in, len, hash);
|
||||
|
||||
memset(sig, 0, siglen);
|
||||
|
||||
if(!ECDSA_sign(0, hash, sizeof hash, sig, &siglen, *ecdsa)) {
|
||||
logger(DEBUG_ALWAYS, LOG_DEBUG, "ECDSA_sign() failed: %s", ERR_error_string(ERR_get_error(), NULL));
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ecdsa_verify(ecdsa_t *ecdsa, const void *in, size_t len, const void *sig) {
|
||||
unsigned int siglen = ECDSA_size(*ecdsa);
|
||||
|
||||
unsigned char hash[SHA512_DIGEST_LENGTH];
|
||||
SHA512(in, len, hash);
|
||||
|
||||
if(!ECDSA_verify(0, hash, sizeof hash, sig, siglen, *ecdsa)) {
|
||||
logger(DEBUG_ALWAYS, LOG_DEBUG, "ECDSA_verify() failed: %s", ERR_error_string(ERR_get_error(), NULL));
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ecdsa_active(ecdsa_t *ecdsa) {
|
||||
return *ecdsa;
|
||||
}
|
||||
|
||||
void ecdsa_free(ecdsa_t *ecdsa) {
|
||||
if(*ecdsa) {
|
||||
EC_KEY_free(*ecdsa);
|
||||
*ecdsa = NULL;
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
ecdsa.h -- ECDSA key handling
|
||||
Copyright (C) 2011 Guus Sliepen <guus@tinc-vpn.org>
|
||||
Copyright (C) 2011-2013 Guus Sliepen <guus@tinc-vpn.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -20,17 +20,17 @@
|
|||
#ifndef __TINC_ECDSA_H__
|
||||
#define __TINC_ECDSA_H__
|
||||
|
||||
#include <openssl/ec.h>
|
||||
#ifndef __TINC_ECDSA_INTERNAL__
|
||||
typedef struct ecdsa ecdsa_t;
|
||||
#endif
|
||||
|
||||
typedef EC_KEY *ecdsa_t;
|
||||
|
||||
extern bool ecdsa_set_base64_public_key(ecdsa_t *ecdsa, const char *p);
|
||||
extern ecdsa_t *ecdsa_set_base64_public_key(const char *p) __attribute__ ((__malloc__));
|
||||
extern char *ecdsa_get_base64_public_key(ecdsa_t *ecdsa);
|
||||
extern bool ecdsa_read_pem_public_key(ecdsa_t *ecdsa, FILE *fp);
|
||||
extern bool ecdsa_read_pem_private_key(ecdsa_t *ecdsa, FILE *fp);
|
||||
extern ecdsa_t *ecdsa_read_pem_public_key(FILE *fp) __attribute__ ((__malloc__));
|
||||
extern ecdsa_t *ecdsa_read_pem_private_key(FILE *fp) __attribute__ ((__malloc__));
|
||||
extern size_t ecdsa_size(ecdsa_t *ecdsa);
|
||||
extern bool ecdsa_sign(ecdsa_t *ecdsa, const void *in, size_t inlen, void *out);
|
||||
extern bool ecdsa_verify(ecdsa_t *ecdsa, const void *in, size_t inlen, const void *out);
|
||||
extern bool ecdsa_sign(ecdsa_t *ecdsa, const void *in, size_t inlen, void *out) __attribute__ ((__warn_unused_result__));
|
||||
extern bool ecdsa_verify(ecdsa_t *ecdsa, const void *in, size_t inlen, const void *out) __attribute__ ((__warn_unused_result__));
|
||||
extern bool ecdsa_active(ecdsa_t *ecdsa);
|
||||
extern void ecdsa_free(ecdsa_t *ecdsa);
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
ecdsagen.h -- ECDSA key generation and export
|
||||
Copyright (C) 2011 Guus Sliepen <guus@tinc-vpn.org>
|
||||
Copyright (C) 2011-2013 Guus Sliepen <guus@tinc-vpn.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -22,9 +22,8 @@
|
|||
|
||||
#include "ecdsa.h"
|
||||
|
||||
extern bool ecdsa_generate(ecdsa_t *ecdsa);
|
||||
extern bool ecdsa_write_pem_public_key(ecdsa_t *ecdsa, FILE *fp);
|
||||
extern bool ecdsa_write_pem_private_key(ecdsa_t *ecdsa, FILE *fp);
|
||||
extern char *ecdsa_get_base64_public_key(ecdsa_t *ecdsa);
|
||||
extern ecdsa_t *ecdsa_generate(void) __attribute__ ((__malloc__));
|
||||
extern bool ecdsa_write_pem_public_key(ecdsa_t *ecdsa, FILE *fp) __attribute__ ((__warn_unused_result__));
|
||||
extern bool ecdsa_write_pem_private_key(ecdsa_t *ecdsa, FILE *fp) __attribute__ ((__warn_unused_result__));
|
||||
|
||||
#endif
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
edge.c -- edge tree management
|
||||
Copyright (C) 2000-2012 Guus Sliepen <guus@tinc-vpn.org>,
|
||||
Copyright (C) 2000-2013 Guus Sliepen <guus@tinc-vpn.org>,
|
||||
2000-2005 Ivo Timmermans
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
|
@ -70,7 +70,7 @@ void exit_edges(void) {
|
|||
/* Creation and deletion of connection elements */
|
||||
|
||||
edge_t *new_edge(void) {
|
||||
return xmalloc_and_zero(sizeof(edge_t));
|
||||
return xzalloc(sizeof(edge_t));
|
||||
}
|
||||
|
||||
void free_edge(edge_t *e) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
event.c -- I/O, timeout and signal event handling
|
||||
Copyright (C) 2012 Guus Sliepen <guus@tinc-vpn.org>
|
||||
Copyright (C) 2012-2013 Guus Sliepen <guus@tinc-vpn.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
event.h -- I/O, timeout and signal event handling
|
||||
Copyright (C) 2012 Guus Sliepen <guus@tinc-vpn.org>
|
||||
Copyright (C) 2012-2013 Guus Sliepen <guus@tinc-vpn.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -17,3 +17,7 @@
|
|||
#ifndef EAI_FAMILY
|
||||
#define EAI_FAMILY 3
|
||||
#endif
|
||||
|
||||
#ifndef EAI_SYSTEM
|
||||
#define EAI_SYSTEM 4
|
||||
#endif
|
||||
|
|
|
@ -48,7 +48,7 @@ void freeaddrinfo(struct addrinfo *ai) {
|
|||
static struct addrinfo *malloc_ai(uint16_t port, uint32_t addr) {
|
||||
struct addrinfo *ai;
|
||||
|
||||
ai = xmalloc_and_zero(sizeof(struct addrinfo) + sizeof(struct sockaddr_in));
|
||||
ai = xzalloc(sizeof(struct addrinfo) + sizeof(struct sockaddr_in));
|
||||
|
||||
ai->ai_addr = (struct sockaddr *)(ai + 1);
|
||||
ai->ai_addrlen = sizeof(struct sockaddr_in);
|
||||
|
|
1
src/gcrypt/.deps/cipher.Po
Normal file
1
src/gcrypt/.deps/cipher.Po
Normal file
|
@ -0,0 +1 @@
|
|||
# dummy
|
1
src/gcrypt/.deps/crypto.Po
Normal file
1
src/gcrypt/.deps/crypto.Po
Normal file
|
@ -0,0 +1 @@
|
|||
# dummy
|
1
src/gcrypt/.deps/digest.Po
Normal file
1
src/gcrypt/.deps/digest.Po
Normal file
|
@ -0,0 +1 @@
|
|||
# dummy
|
1
src/gcrypt/.deps/ecdh.Po
Normal file
1
src/gcrypt/.deps/ecdh.Po
Normal file
|
@ -0,0 +1 @@
|
|||
# dummy
|
1
src/gcrypt/.deps/ecdsa.Po
Normal file
1
src/gcrypt/.deps/ecdsa.Po
Normal file
|
@ -0,0 +1 @@
|
|||
# dummy
|
1
src/gcrypt/.deps/ecdsagen.Po
Normal file
1
src/gcrypt/.deps/ecdsagen.Po
Normal file
|
@ -0,0 +1 @@
|
|||
# dummy
|
1
src/gcrypt/.deps/prf.Po
Normal file
1
src/gcrypt/.deps/prf.Po
Normal file
|
@ -0,0 +1 @@
|
|||
# dummy
|
1
src/gcrypt/.deps/rsa.Po
Normal file
1
src/gcrypt/.deps/rsa.Po
Normal file
|
@ -0,0 +1 @@
|
|||
# dummy
|
1
src/gcrypt/.deps/rsagen.Po
Normal file
1
src/gcrypt/.deps/rsagen.Po
Normal file
|
@ -0,0 +1 @@
|
|||
# dummy
|
37
src/gcrypt/ecdh.c
Normal file
37
src/gcrypt/ecdh.c
Normal file
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
ecdh.c -- Diffie-Hellman key exchange handling
|
||||
Copyright (C) 2011-2013 Guus Sliepen <guus@tinc-vpn.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#include "../system.h"
|
||||
|
||||
#include "../ecdh.h"
|
||||
#include "../logger.h"
|
||||
#include "../utils.h"
|
||||
#include "../xalloc.h"
|
||||
|
||||
ecdh_t *ecdh_generate_public(void *pubkey) {
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "EC support using libgcrypt not implemented");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool ecdh_compute_shared(ecdh_t *ecdh, const void *pubkey, void *shared) {
|
||||
return false
|
||||
}
|
||||
|
||||
void ecdh_free(ecdh_t *ecdh) {
|
||||
}
|
67
src/gcrypt/ecdsa.c
Normal file
67
src/gcrypt/ecdsa.c
Normal file
|
@ -0,0 +1,67 @@
|
|||
/*
|
||||
ecdsa.c -- ECDSA key handling
|
||||
Copyright (C) 2011-2013 Guus Sliepen <guus@tinc-vpn.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#include "../system.h"
|
||||
|
||||
#include "../logger.h"
|
||||
#include "../ecdsa.h"
|
||||
#include "../utils.h"
|
||||
#include "../xalloc.h"
|
||||
|
||||
// Get and set ECDSA keys
|
||||
//
|
||||
ecdsa_t *ecdsa_set_base64_public_key(const char *p) {
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "EC support using libgcrypt not implemented");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char *ecdsa_get_base64_public_key(ecdsa_t *ecdsa) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Read PEM ECDSA keys
|
||||
|
||||
ecdsa_t *ecdsa_read_pem_public_key(FILE *fp) {
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "EC support using libgcrypt not implemented");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ecdsa_t *ecdsa_read_pem_private_key(FILE *fp) {
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "EC support using libgcrypt not implemented");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
size_t ecdsa_size(ecdsa_t *ecdsa) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool ecdsa_sign(ecdsa_t *ecdsa, const void *in, size_t len, void *sig) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ecdsa_verify(ecdsa_t *ecdsa, const void *in, size_t len, const void *sig) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ecdsa_active(ecdsa_t *ecdsa) {
|
||||
return false;
|
||||
}
|
||||
|
||||
void ecdsa_free(ecdsa_t *ecdsa) {
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
crypto.c -- Cryptographic miscellaneous functions and initialisation
|
||||
Copyright (C) 2007 Guus Sliepen <guus@tinc-vpn.org>
|
||||
ecdsagen.c -- ECDSA key generation and export
|
||||
Copyright (C) 2011-2013 Guus Sliepen <guus@tinc-vpn.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -17,27 +17,25 @@
|
|||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#include "system.h"
|
||||
#include "../system.h"
|
||||
|
||||
#include <openssl/rand.h>
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/engine.h>
|
||||
#include "../ecdsagen.h"
|
||||
#include "../utils.h"
|
||||
#include "../xalloc.h"
|
||||
|
||||
#include "crypto.h"
|
||||
// Generate ECDSA key
|
||||
|
||||
void crypto_init(void) {
|
||||
RAND_load_file("/dev/urandom", 1024);
|
||||
|
||||
ENGINE_load_builtin_engines();
|
||||
ENGINE_register_all_complete();
|
||||
|
||||
OpenSSL_add_all_algorithms();
|
||||
ecdsa_t *ecdsa_generate(void) {
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "EC support using libgcrypt not implemented");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void crypto_exit(void) {
|
||||
EVP_cleanup();
|
||||
// Write PEM ECDSA keys
|
||||
|
||||
bool ecdsa_write_pem_public_key(ecdsa_t *ecdsa, FILE *fp) {
|
||||
return false;
|
||||
}
|
||||
|
||||
void randomize(void *out, size_t outlen) {
|
||||
RAND_pseudo_bytes(out, outlen);
|
||||
bool ecdsa_write_pem_private_key(ecdsa_t *ecdsa, FILE *fp) {
|
||||
return false;
|
||||
}
|
29
src/gcrypt/prf.c
Normal file
29
src/gcrypt/prf.c
Normal file
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
prf.c -- Pseudo-Random Function for key material generation
|
||||
Copyright (C) 2011-2013 Guus Sliepen <guus@tinc-vpn.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#include "../system.h"
|
||||
|
||||
#include "digest.h"
|
||||
#include "../digest.h"
|
||||
#include "../prf.h"
|
||||
|
||||
bool prf(const char *secret, size_t secretlen, char *seed, size_t seedlen, char *out, size_t outlen) {
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "PRF support using libgcrypt not implemented");
|
||||
return false;
|
||||
}
|
|
@ -31,7 +31,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
#endif
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#include "../config.h"
|
||||
#endif
|
||||
|
||||
#if !defined (__STDC__) || !__STDC__
|
||||
|
|
|
@ -20,7 +20,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#include "../config.h"
|
||||
#endif
|
||||
|
||||
#include "getopt.h"
|
||||
|
|
|
@ -44,7 +44,6 @@
|
|||
|
||||
#include "system.h"
|
||||
|
||||
#include "config.h"
|
||||
#include "connection.h"
|
||||
#include "device.h"
|
||||
#include "edge.h"
|
||||
|
@ -236,7 +235,7 @@ static void check_reachability(void) {
|
|||
char *name;
|
||||
char *address;
|
||||
char *port;
|
||||
char *envp[7];
|
||||
char *envp[8] = {NULL};
|
||||
|
||||
xasprintf(&envp[0], "NETNAME=%s", netname ? : "");
|
||||
xasprintf(&envp[1], "DEVICE=%s", device ? : "");
|
||||
|
@ -245,7 +244,7 @@ static void check_reachability(void) {
|
|||
sockaddr2str(&n->address, &address, &port);
|
||||
xasprintf(&envp[4], "REMOTEADDRESS=%s", address);
|
||||
xasprintf(&envp[5], "REMOTEPORT=%s", port);
|
||||
envp[6] = NULL;
|
||||
xasprintf(&envp[6], "NAME=%s", myself->name);
|
||||
|
||||
execute_script(n->status.reachable ? "host-up" : "host-down", envp);
|
||||
|
||||
|
@ -256,7 +255,7 @@ static void check_reachability(void) {
|
|||
free(address);
|
||||
free(port);
|
||||
|
||||
for(int i = 0; i < 6; i++)
|
||||
for(int i = 0; i < 7; i++)
|
||||
free(envp[i]);
|
||||
|
||||
subnet_update(n, NULL, n->status.reachable);
|
||||
|
|
10
src/hash.c
10
src/hash.c
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
hash.c -- hash table management
|
||||
Copyright (C) 2012 Guus Sliepen <guus@tinc-vpn.org>
|
||||
Copyright (C) 2012-2013 Guus Sliepen <guus@tinc-vpn.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -29,7 +29,7 @@ static uint32_t hash_function(const void *p, size_t len) {
|
|||
uint32_t hash = 0;
|
||||
while(true) {
|
||||
for(int i = len > 4 ? 4 : len; --i;)
|
||||
hash += q[i] << (8 * i);
|
||||
hash += q[len - i] << (8 * i);
|
||||
hash *= 0x9e370001UL; // Golden ratio prime.
|
||||
if(len <= 4)
|
||||
break;
|
||||
|
@ -52,11 +52,11 @@ static uint32_t modulo(uint32_t hash, size_t n) {
|
|||
/* (De)allocation */
|
||||
|
||||
hash_t *hash_alloc(size_t n, size_t size) {
|
||||
hash_t *hash = xmalloc_and_zero(sizeof *hash);
|
||||
hash_t *hash = xzalloc(sizeof *hash);
|
||||
hash->n = n;
|
||||
hash->size = size;
|
||||
hash->keys = xmalloc_and_zero(hash->n * hash->size);
|
||||
hash->values = xmalloc_and_zero(hash->n * sizeof *hash->values);
|
||||
hash->keys = xzalloc(hash->n * hash->size);
|
||||
hash->values = xzalloc(hash->n * sizeof *hash->values);
|
||||
return hash;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
have.h -- include headers which are known to exist
|
||||
Copyright (C) 1998-2005 Ivo Timmermans
|
||||
2003-2012 Guus Sliepen <guus@tinc-vpn.org>
|
||||
2003-2013 Guus Sliepen <guus@tinc-vpn.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
info.c -- Show information about a node, subnet or address
|
||||
Copyright (C) 2012 Guus Sliepen <guus@tinc-vpn.org>
|
||||
Copyright (C) 2012-2013 Guus Sliepen <guus@tinc-vpn.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -31,6 +31,7 @@ void logger(int level, int priority, const char *format, ...) {
|
|||
va_start(ap, format);
|
||||
vfprintf(stderr, format, ap);
|
||||
va_end(ap);
|
||||
fputc('\n', stderr);
|
||||
}
|
||||
|
||||
char *strip_weight(char *netstr) {
|
||||
|
|
939
src/invitation.c
Normal file
939
src/invitation.c
Normal file
|
@ -0,0 +1,939 @@
|
|||
/*
|
||||
invitation.c -- Create and accept invitations
|
||||
Copyright (C) 2013 Guus Sliepen <guus@tinc-vpn.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#include "system.h"
|
||||
|
||||
#include "control_common.h"
|
||||
#include "crypto.h"
|
||||
#include "ecdsa.h"
|
||||
#include "ecdsagen.h"
|
||||
#include "invitation.h"
|
||||
#include "names.h"
|
||||
#include "netutl.h"
|
||||
#include "rsagen.h"
|
||||
#include "sptps.h"
|
||||
#include "tincctl.h"
|
||||
#include "utils.h"
|
||||
#include "xalloc.h"
|
||||
|
||||
#ifdef HAVE_MINGW
|
||||
#define SCRIPTEXTENSION ".bat"
|
||||
#else
|
||||
#define SCRIPTEXTENSION ""
|
||||
#endif
|
||||
|
||||
int addressfamily = AF_UNSPEC;
|
||||
|
||||
char *get_my_hostname() {
|
||||
char *hostname = NULL;
|
||||
char *port = NULL;
|
||||
char *hostport = NULL;
|
||||
char *name = get_my_name(false);
|
||||
char *filename = NULL;
|
||||
|
||||
// Use first Address statement in own host config file
|
||||
if(check_id(name)) {
|
||||
xasprintf(&filename, "%s" SLASH "hosts" SLASH "%s", confbase, name);
|
||||
FILE *f = fopen(filename, "r");
|
||||
if(f) {
|
||||
while(fgets(line, sizeof line, f)) {
|
||||
if(!rstrip(line))
|
||||
continue;
|
||||
char *p = line, *q;
|
||||
p += strcspn(p, "\t =");
|
||||
if(!*p)
|
||||
continue;
|
||||
q = p + strspn(p, "\t ");
|
||||
if(*q == '=')
|
||||
q += 1 + strspn(q + 1, "\t ");
|
||||
*p = 0;
|
||||
p = q + strcspn(q, "\t ");
|
||||
if(*p)
|
||||
*p++ = 0;
|
||||
p += strspn(p, "\t ");
|
||||
p[strcspn(p, "\t ")] = 0;
|
||||
if(!port && !strcasecmp(line, "Port")) {
|
||||
port = xstrdup(q);
|
||||
continue;
|
||||
}
|
||||
if(strcasecmp(line, "Address"))
|
||||
continue;
|
||||
hostname = xstrdup(q);
|
||||
if(*p) {
|
||||
free(port);
|
||||
port = xstrdup(p);
|
||||
}
|
||||
break;
|
||||
}
|
||||
fclose(f);
|
||||
}
|
||||
}
|
||||
|
||||
if(hostname)
|
||||
goto done;
|
||||
|
||||
// If that doesn't work, guess externally visible hostname
|
||||
fprintf(stderr, "Trying to discover externally visible hostname...\n");
|
||||
struct addrinfo *ai = str2addrinfo("ifconfig.me", "80", SOCK_STREAM);
|
||||
static const char request[] = "GET /host HTTP/1.0\r\n\r\n";
|
||||
if(ai) {
|
||||
int s = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
|
||||
if(s >= 0) {
|
||||
if(connect(s, ai->ai_addr, ai->ai_addrlen)) {
|
||||
closesocket(s);
|
||||
s = -1;
|
||||
}
|
||||
}
|
||||
if(s >= 0) {
|
||||
send(s, request, sizeof request - 1, 0);
|
||||
int len = recv(s, line, sizeof line - 1, MSG_WAITALL);
|
||||
if(len > 0) {
|
||||
line[len] = 0;
|
||||
if(line[len - 1] == '\n')
|
||||
line[--len] = 0;
|
||||
char *p = strrchr(line, '\n');
|
||||
if(p && p[1])
|
||||
hostname = xstrdup(p + 1);
|
||||
}
|
||||
closesocket(s);
|
||||
}
|
||||
freeaddrinfo(ai);
|
||||
}
|
||||
|
||||
// Check that the hostname is reasonable
|
||||
if(hostname) {
|
||||
for(char *p = hostname; *p; p++) {
|
||||
if(isalnum(*p) || *p == '-' || *p == '.')
|
||||
continue;
|
||||
// If not, forget it.
|
||||
free(hostname);
|
||||
hostname = NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
again:
|
||||
printf("Please enter your host's external address or hostname");
|
||||
if(hostname)
|
||||
printf(" [%s]", hostname);
|
||||
printf(": ");
|
||||
fflush(stdout);
|
||||
|
||||
if(!fgets(line, sizeof line, stdin)) {
|
||||
fprintf(stderr, "Error while reading stdin: %s\n", strerror(errno));
|
||||
free(hostname);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if(!rstrip(line)) {
|
||||
if(hostname)
|
||||
goto save;
|
||||
else
|
||||
goto again;
|
||||
}
|
||||
|
||||
for(char *p = line; *p; p++) {
|
||||
if(isalnum(*p) || *p == '-' || *p == '.')
|
||||
continue;
|
||||
fprintf(stderr, "Invalid address or hostname.\n");
|
||||
goto again;
|
||||
}
|
||||
|
||||
free(hostname);
|
||||
hostname = xstrdup(line);
|
||||
|
||||
save:
|
||||
if(filename) {
|
||||
FILE *f = fopen(filename, "a");
|
||||
if(f) {
|
||||
fprintf(f, "\nAddress = %s\n", hostname);
|
||||
fclose(f);
|
||||
} else {
|
||||
fprintf(stderr, "Could not append Address to %s: %s\n", filename, strerror(errno));
|
||||
}
|
||||
}
|
||||
|
||||
done:
|
||||
if(port) {
|
||||
if(strchr(hostname, ':'))
|
||||
xasprintf(&hostport, "[%s]:%s", hostname, port);
|
||||
else
|
||||
xasprintf(&hostport, "%s:%s", hostname, port);
|
||||
} else {
|
||||
hostport = hostname;
|
||||
hostname = NULL;
|
||||
}
|
||||
|
||||
free(hostname);
|
||||
free(port);
|
||||
free(filename);
|
||||
return hostport;
|
||||
}
|
||||
|
||||
static bool fcopy(FILE *out, const char *filename) {
|
||||
FILE *in = fopen(filename, "r");
|
||||
if(!in) {
|
||||
fprintf(stderr, "Could not open %s: %s\n", filename, strerror(errno));
|
||||
return false;
|
||||
}
|
||||
|
||||
char buf[1024];
|
||||
size_t len;
|
||||
while((len = fread(buf, 1, sizeof buf, in)))
|
||||
fwrite(buf, len, 1, out);
|
||||
fclose(in);
|
||||
return true;
|
||||
}
|
||||
|
||||
int cmd_invite(int argc, char *argv[]) {
|
||||
if(argc < 2) {
|
||||
fprintf(stderr, "Not enough arguments!\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Check validity of the new node's name
|
||||
if(!check_id(argv[1])) {
|
||||
fprintf(stderr, "Invalid name for node.\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
char *myname = get_my_name(true);
|
||||
if(!myname)
|
||||
return 1;
|
||||
|
||||
// Ensure no host configuration file with that name exists
|
||||
char *filename = NULL;
|
||||
xasprintf(&filename, "%s" SLASH "hosts" SLASH "%s", confbase, argv[1]);
|
||||
if(!access(filename, F_OK)) {
|
||||
free(filename);
|
||||
fprintf(stderr, "A host config file for %s already exists!\n", argv[1]);
|
||||
return 1;
|
||||
}
|
||||
free(filename);
|
||||
|
||||
// If a daemon is running, ensure no other nodes now about this name
|
||||
bool found = false;
|
||||
if(connect_tincd(false)) {
|
||||
sendline(fd, "%d %d", CONTROL, REQ_DUMP_NODES);
|
||||
|
||||
while(recvline(fd, line, sizeof line)) {
|
||||
char node[4096];
|
||||
int code, req;
|
||||
if(sscanf(line, "%d %d %s", &code, &req, node) != 3)
|
||||
break;
|
||||
if(!strcmp(node, argv[1]))
|
||||
found = true;
|
||||
}
|
||||
|
||||
if(found) {
|
||||
fprintf(stderr, "A node with name %s is already known!\n", argv[1]);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
char hash[25];
|
||||
|
||||
xasprintf(&filename, "%s" SLASH "invitations", confbase);
|
||||
if(mkdir(filename, 0700) && errno != EEXIST) {
|
||||
fprintf(stderr, "Could not create directory %s: %s\n", filename, strerror(errno));
|
||||
free(filename);
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Count the number of valid invitations, clean up old ones
|
||||
DIR *dir = opendir(filename);
|
||||
if(!dir) {
|
||||
fprintf(stderr, "Could not read directory %s: %s\n", filename, strerror(errno));
|
||||
free(filename);
|
||||
return 1;
|
||||
}
|
||||
|
||||
errno = 0;
|
||||
int count = 0;
|
||||
struct dirent *ent;
|
||||
time_t deadline = time(NULL) - 604800; // 1 week in the past
|
||||
|
||||
while((ent = readdir(dir))) {
|
||||
if(strlen(ent->d_name) != 24)
|
||||
continue;
|
||||
char *invname;
|
||||
struct stat st;
|
||||
xasprintf(&invname, "%s" SLASH "%s", filename, ent->d_name);
|
||||
if(!stat(invname, &st)) {
|
||||
if(deadline < st.st_mtime)
|
||||
count++;
|
||||
else
|
||||
unlink(invname);
|
||||
} else {
|
||||
fprintf(stderr, "Could not stat %s: %s\n", invname, strerror(errno));
|
||||
errno = 0;
|
||||
}
|
||||
free(invname);
|
||||
}
|
||||
|
||||
if(errno) {
|
||||
fprintf(stderr, "Error while reading directory %s: %s\n", filename, strerror(errno));
|
||||
closedir(dir);
|
||||
free(filename);
|
||||
return 1;
|
||||
}
|
||||
|
||||
closedir(dir);
|
||||
free(filename);
|
||||
|
||||
ecdsa_t *key;
|
||||
xasprintf(&filename, "%s" SLASH "invitations" SLASH "ecdsa_key.priv", confbase);
|
||||
|
||||
// Remove the key if there are no outstanding invitations.
|
||||
if(!count)
|
||||
unlink(filename);
|
||||
|
||||
// Create a new key if necessary.
|
||||
FILE *f = fopen(filename, "r");
|
||||
if(!f) {
|
||||
if(errno != ENOENT) {
|
||||
fprintf(stderr, "Could not read %s: %s\n", filename, strerror(errno));
|
||||
free(filename);
|
||||
return 1;
|
||||
}
|
||||
|
||||
key = ecdsa_generate();
|
||||
if(!key) {
|
||||
free(filename);
|
||||
return 1;
|
||||
}
|
||||
f = fopen(filename, "w");
|
||||
if(!f) {
|
||||
fprintf(stderr, "Could not write %s: %s\n", filename, strerror(errno));
|
||||
free(filename);
|
||||
return 1;
|
||||
}
|
||||
chmod(filename, 0600);
|
||||
ecdsa_write_pem_private_key(key, f);
|
||||
} else {
|
||||
key = ecdsa_read_pem_private_key(f);
|
||||
if(!key)
|
||||
fprintf(stderr, "Could not read private key from %s\n", filename);
|
||||
}
|
||||
fclose(f);
|
||||
free(filename);
|
||||
if(!key)
|
||||
return 1;
|
||||
|
||||
// Create a hash of the key.
|
||||
char *fingerprint = ecdsa_get_base64_public_key(key);
|
||||
digest_t *digest = digest_open_by_name("sha256", 18);
|
||||
if(!digest)
|
||||
abort();
|
||||
digest_create(digest, fingerprint, strlen(fingerprint), hash);
|
||||
b64encode_urlsafe(hash, hash, 18);
|
||||
|
||||
// Create a random cookie for this invitation.
|
||||
char cookie[25];
|
||||
randomize(cookie, 18);
|
||||
b64encode_urlsafe(cookie, cookie, 18);
|
||||
|
||||
// Create a file containing the details of the invitation.
|
||||
xasprintf(&filename, "%s" SLASH "invitations" SLASH "%s", confbase, cookie);
|
||||
int ifd = open(filename, O_RDWR | O_CREAT | O_EXCL, 0600);
|
||||
if(!ifd) {
|
||||
fprintf(stderr, "Could not create invitation file %s: %s\n", filename, strerror(errno));
|
||||
free(filename);
|
||||
return 1;
|
||||
}
|
||||
free(filename);
|
||||
f = fdopen(ifd, "w");
|
||||
if(!f)
|
||||
abort();
|
||||
|
||||
// Fill in the details.
|
||||
fprintf(f, "Name = %s\n", argv[1]);
|
||||
if(netname)
|
||||
fprintf(f, "NetName = %s\n", netname);
|
||||
fprintf(f, "ConnectTo = %s\n", myname);
|
||||
// TODO: copy Broadcast and Mode
|
||||
fprintf(f, "#---------------------------------------------------------------#\n");
|
||||
fprintf(f, "Name = %s\n", myname);
|
||||
|
||||
xasprintf(&filename, "%s" SLASH "hosts" SLASH "%s", confbase, myname);
|
||||
fcopy(f, filename);
|
||||
fclose(f);
|
||||
|
||||
// Create an URL from the local address, key hash and cookie
|
||||
char *address = get_my_hostname();
|
||||
printf("%s/%s%s\n", address, hash, cookie);
|
||||
free(filename);
|
||||
free(address);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int sock;
|
||||
static char cookie[18];
|
||||
static sptps_t sptps;
|
||||
static char *data;
|
||||
static size_t datalen;
|
||||
static bool success = false;
|
||||
|
||||
static char cookie[18], hash[18];
|
||||
|
||||
static char *get_line(const char **data) {
|
||||
if(!data || !*data)
|
||||
return NULL;
|
||||
|
||||
if(!**data) {
|
||||
*data = NULL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static char line[1024];
|
||||
const char *end = strchr(*data, '\n');
|
||||
size_t len = end ? end - *data : strlen(*data);
|
||||
if(len >= sizeof line) {
|
||||
fprintf(stderr, "Maximum line length exceeded!\n");
|
||||
return NULL;
|
||||
}
|
||||
if(len && !isprint(**data))
|
||||
abort();
|
||||
|
||||
memcpy(line, *data, len);
|
||||
line[len] = 0;
|
||||
|
||||
if(end)
|
||||
*data = end + 1;
|
||||
else
|
||||
*data = NULL;
|
||||
|
||||
return line;
|
||||
}
|
||||
|
||||
static char *get_value(const char *data, const char *var) {
|
||||
char *line = get_line(&data);
|
||||
if(!line)
|
||||
return NULL;
|
||||
|
||||
char *sep = line + strcspn(line, " \t=");
|
||||
char *val = sep + strspn(sep, " \t");
|
||||
if(*val == '=')
|
||||
val += 1 + strspn(val + 1, " \t");
|
||||
*sep = 0;
|
||||
if(strcasecmp(line, var))
|
||||
return NULL;
|
||||
return val;
|
||||
}
|
||||
|
||||
static char *grep(const char *data, const char *var) {
|
||||
static char value[1024];
|
||||
|
||||
const char *p = data;
|
||||
int varlen = strlen(var);
|
||||
|
||||
// Skip all lines not starting with var
|
||||
while(strncasecmp(p, var, varlen) || !strchr(" \t=", p[varlen])) {
|
||||
p = strchr(p, '\n');
|
||||
if(!p)
|
||||
break;
|
||||
else
|
||||
p++;
|
||||
}
|
||||
|
||||
if(!p)
|
||||
return NULL;
|
||||
|
||||
p += varlen;
|
||||
p += strspn(p, " \t");
|
||||
if(*p == '=')
|
||||
p += 1 + strspn(p + 1, " \t");
|
||||
|
||||
const char *e = strchr(p, '\n');
|
||||
if(!e)
|
||||
return xstrdup(p);
|
||||
|
||||
if(e - p >= sizeof value) {
|
||||
fprintf(stderr, "Maximum line length exceeded!\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
memcpy(value, p, e - p);
|
||||
value[e - p] = 0;
|
||||
return value;
|
||||
}
|
||||
|
||||
static bool finalize_join(void) {
|
||||
char *name = xstrdup(get_value(data, "Name"));
|
||||
if(!name) {
|
||||
fprintf(stderr, "No Name found in invitation!\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!check_id(name)) {
|
||||
fprintf(stderr, "Invalid Name found in invitation: %s!\n", name);
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!netname)
|
||||
netname = grep(data, "NetName");
|
||||
|
||||
bool ask_netname = false;
|
||||
char temp_netname[32];
|
||||
|
||||
make_names:
|
||||
if(!confbasegiven) {
|
||||
free(confbase);
|
||||
confbase = NULL;
|
||||
}
|
||||
|
||||
make_names();
|
||||
|
||||
free(tinc_conf);
|
||||
free(hosts_dir);
|
||||
|
||||
xasprintf(&tinc_conf, "%s" SLASH "tinc.conf", confbase);
|
||||
xasprintf(&hosts_dir, "%s" SLASH "hosts", confbase);
|
||||
|
||||
if(!access(tinc_conf, F_OK)) {
|
||||
fprintf(stderr, "Configuration file %s already exists!\n", tinc_conf);
|
||||
if(!tty || confbasegiven)
|
||||
return false;
|
||||
|
||||
// Generate a random netname, ask for a better one later.
|
||||
ask_netname = true;
|
||||
snprintf(temp_netname, sizeof temp_netname, "join_%x", rand());
|
||||
netname = temp_netname;
|
||||
goto make_names;
|
||||
}
|
||||
|
||||
if(mkdir(confbase, 0777) && errno != EEXIST) {
|
||||
fprintf(stderr, "Could not create directory %s: %s\n", confbase, strerror(errno));
|
||||
return false;
|
||||
}
|
||||
|
||||
if(mkdir(hosts_dir, 0777) && errno != EEXIST) {
|
||||
fprintf(stderr, "Could not create directory %s: %s\n", hosts_dir, strerror(errno));
|
||||
return false;
|
||||
}
|
||||
|
||||
FILE *f = fopen(tinc_conf, "w");
|
||||
if(!f) {
|
||||
fprintf(stderr, "Could not create file %s: %s\n", tinc_conf, strerror(errno));
|
||||
return false;
|
||||
}
|
||||
|
||||
fprintf(f, "Name = %s\n", name);
|
||||
|
||||
char *filename;
|
||||
xasprintf(&filename, "%s" SLASH "%s", hosts_dir, name);
|
||||
FILE *fh = fopen(filename, "w");
|
||||
if(!fh) {
|
||||
fprintf(stderr, "Could not create file %s: %s\n", filename, strerror(errno));
|
||||
return false;
|
||||
}
|
||||
|
||||
// Filter first chunk on approved keywords, split between tinc.conf and hosts/Name
|
||||
// Other chunks go unfiltered to their respective host config files
|
||||
const char *p = data;
|
||||
char *l, *value;
|
||||
|
||||
while((l = get_line(&p))) {
|
||||
// Ignore comments
|
||||
if(*l == '#')
|
||||
continue;
|
||||
|
||||
// Split line into variable and value
|
||||
int len = strcspn(l, "\t =");
|
||||
value = l + len;
|
||||
value += strspn(value, "\t ");
|
||||
if(*value == '=') {
|
||||
value++;
|
||||
value += strspn(value, "\t ");
|
||||
}
|
||||
l[len] = 0;
|
||||
|
||||
// Is it a Name?
|
||||
if(!strcasecmp(l, "Name"))
|
||||
if(strcmp(value, name))
|
||||
break;
|
||||
else
|
||||
continue;
|
||||
else if(!strcasecmp(l, "NetName"))
|
||||
continue;
|
||||
|
||||
// Check the list of known variables
|
||||
bool found = false;
|
||||
int i;
|
||||
for(i = 0; variables[i].name; i++) {
|
||||
if(strcasecmp(l, variables[i].name))
|
||||
continue;
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
|
||||
// Ignore unknown and unsafe variables
|
||||
if(!found) {
|
||||
fprintf(stderr, "Ignoring unknown variable '%s' in invitation.\n", l);
|
||||
continue;
|
||||
} else if(!(variables[i].type & VAR_SAFE)) {
|
||||
fprintf(stderr, "Ignoring unsafe variable '%s' in invitation.\n", l);
|
||||
continue;
|
||||
}
|
||||
|
||||
// Copy the safe variable to the right config file
|
||||
fprintf(variables[i].type & VAR_HOST ? fh : f, "%s = %s\n", l, value);
|
||||
}
|
||||
|
||||
fclose(f);
|
||||
free(filename);
|
||||
|
||||
while(l && !strcasecmp(l, "Name")) {
|
||||
if(!check_id(value)) {
|
||||
fprintf(stderr, "Invalid Name found in invitation.\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!strcmp(value, name)) {
|
||||
fprintf(stderr, "Secondary chunk would overwrite our own host config file.\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
xasprintf(&filename, "%s" SLASH "%s", hosts_dir, value);
|
||||
f = fopen(filename, "w");
|
||||
|
||||
if(!f) {
|
||||
fprintf(stderr, "Could not create file %s: %s\n", filename, strerror(errno));
|
||||
return false;
|
||||
}
|
||||
|
||||
while((l = get_line(&p))) {
|
||||
if(!strcmp(l, "#---------------------------------------------------------------#"))
|
||||
continue;
|
||||
int len = strcspn(l, "\t =");
|
||||
if(len == 4 && !strncasecmp(l, "Name", 4)) {
|
||||
value = l + len;
|
||||
value += strspn(value, "\t ");
|
||||
if(*value == '=') {
|
||||
value++;
|
||||
value += strspn(value, "\t ");
|
||||
}
|
||||
l[len] = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
fputs(l, f);
|
||||
fputc('\n', f);
|
||||
}
|
||||
|
||||
fclose(f);
|
||||
free(filename);
|
||||
}
|
||||
|
||||
// Generate our key and send a copy to the server
|
||||
ecdsa_t *key = ecdsa_generate();
|
||||
if(!key)
|
||||
return false;
|
||||
|
||||
char *b64key = ecdsa_get_base64_public_key(key);
|
||||
if(!b64key)
|
||||
return false;
|
||||
|
||||
xasprintf(&filename, "%s" SLASH "ecdsa_key.priv", confbase);
|
||||
f = fopenmask(filename, "w", 0600);
|
||||
|
||||
if(!ecdsa_write_pem_private_key(key, f)) {
|
||||
fprintf(stderr, "Error writing private key!\n");
|
||||
ecdsa_free(key);
|
||||
fclose(f);
|
||||
return false;
|
||||
}
|
||||
|
||||
fclose(f);
|
||||
|
||||
fprintf(fh, "ECDSAPublicKey = %s\n", b64key);
|
||||
|
||||
sptps_send_record(&sptps, 1, b64key, strlen(b64key));
|
||||
free(b64key);
|
||||
|
||||
|
||||
rsa_t *rsa = rsa_generate(2048, 0x1001);
|
||||
xasprintf(&filename, "%s" SLASH "rsa_key.priv", confbase);
|
||||
f = fopenmask(filename, "w", 0600);
|
||||
|
||||
rsa_write_pem_private_key(rsa, f);
|
||||
fclose(f);
|
||||
|
||||
rsa_write_pem_public_key(rsa, fh);
|
||||
fclose(fh);
|
||||
|
||||
ecdsa_free(key);
|
||||
rsa_free(rsa);
|
||||
|
||||
check_port(name);
|
||||
|
||||
fprintf(stderr, "Invitation succesfully accepted.\n");
|
||||
shutdown(sock, SHUT_RDWR);
|
||||
success = true;
|
||||
|
||||
ask_netname:
|
||||
if(ask_netname) {
|
||||
fprintf(stderr, "Enter a new netname: ");
|
||||
if(!fgets(line, sizeof line, stdin)) {
|
||||
fprintf(stderr, "Error while reading stdin: %s\n", strerror(errno));
|
||||
return false;
|
||||
}
|
||||
if(!*line || *line == '\n')
|
||||
goto ask_netname;
|
||||
|
||||
line[strlen(line) - 1] = 0;
|
||||
|
||||
char *newbase;
|
||||
xasprintf(&newbase, CONFDIR SLASH "tinc" SLASH "%s", line);
|
||||
if(rename(confbase, newbase)) {
|
||||
fprintf(stderr, "Error trying to rename %s to %s: %s\n", confbase, newbase, strerror(errno));
|
||||
free(newbase);
|
||||
goto ask_netname;
|
||||
}
|
||||
|
||||
free(newbase);
|
||||
netname = line;
|
||||
make_names();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool invitation_send(void *handle, uint8_t type, const char *data, size_t len) {
|
||||
while(len) {
|
||||
int result = send(sock, data, len, 0);
|
||||
if(result == -1 && errno == EINTR)
|
||||
continue;
|
||||
else if(result <= 0)
|
||||
return false;
|
||||
data += result;
|
||||
len -= result;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool invitation_receive(void *handle, uint8_t type, const char *msg, uint16_t len) {
|
||||
switch(type) {
|
||||
case SPTPS_HANDSHAKE:
|
||||
return sptps_send_record(&sptps, 0, cookie, sizeof cookie);
|
||||
|
||||
case 0:
|
||||
data = xrealloc(data, datalen + len + 1);
|
||||
memcpy(data + datalen, msg, len);
|
||||
datalen += len;
|
||||
data[datalen] = 0;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
return finalize_join();
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
int cmd_join(int argc, char *argv[]) {
|
||||
free(data);
|
||||
data = NULL;
|
||||
datalen = 0;
|
||||
|
||||
if(argc > 2) {
|
||||
fprintf(stderr, "Too many arguments!\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Make sure confbase exists and is accessible.
|
||||
if(strcmp(confdir, confbase) && mkdir(confdir, 0755) && errno != EEXIST) {
|
||||
fprintf(stderr, "Could not create directory %s: %s\n", confdir, strerror(errno));
|
||||
return 1;
|
||||
}
|
||||
|
||||
if(mkdir(confbase, 0777) && errno != EEXIST) {
|
||||
fprintf(stderr, "Could not create directory %s: %s\n", confbase, strerror(errno));
|
||||
return 1;
|
||||
}
|
||||
|
||||
if(access(confbase, R_OK | W_OK | X_OK)) {
|
||||
fprintf(stderr, "No permission to write in directory %s: %s\n", confbase, strerror(errno));
|
||||
return 1;
|
||||
}
|
||||
|
||||
// If a netname or explicit configuration directory is specified, check for an existing tinc.conf.
|
||||
if((netname || confbasegiven) && !access(tinc_conf, F_OK)) {
|
||||
fprintf(stderr, "Configuration file %s already exists!\n", tinc_conf);
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Either read the invitation from the command line or from stdin.
|
||||
char *invitation;
|
||||
|
||||
if(argc > 1) {
|
||||
invitation = argv[1];
|
||||
} else {
|
||||
if(tty) {
|
||||
printf("Enter invitation URL: ");
|
||||
fflush(stdout);
|
||||
}
|
||||
errno = EPIPE;
|
||||
if(!fgets(line, sizeof line, stdin)) {
|
||||
fprintf(stderr, "Error while reading stdin: %s\n", strerror(errno));
|
||||
return false;
|
||||
}
|
||||
invitation = line;
|
||||
}
|
||||
|
||||
// Parse the invitation URL.
|
||||
rstrip(line);
|
||||
|
||||
char *slash = strchr(invitation, '/');
|
||||
if(!slash)
|
||||
goto invalid;
|
||||
|
||||
*slash++ = 0;
|
||||
|
||||
if(strlen(slash) != 48)
|
||||
goto invalid;
|
||||
|
||||
char *address = invitation;
|
||||
char *port = NULL;
|
||||
if(*address == '[') {
|
||||
address++;
|
||||
char *bracket = strchr(address, ']');
|
||||
if(!bracket)
|
||||
goto invalid;
|
||||
*bracket = 0;
|
||||
if(bracket[1] == ':')
|
||||
port = bracket + 2;
|
||||
} else {
|
||||
port = strchr(address, ':');
|
||||
if(port)
|
||||
*port++ = 0;
|
||||
}
|
||||
|
||||
if(!port || !*port)
|
||||
port = "655";
|
||||
|
||||
if(!b64decode(slash, hash, 18) || !b64decode(slash + 24, cookie, 18))
|
||||
goto invalid;
|
||||
|
||||
// Generate a throw-away key for the invitation.
|
||||
ecdsa_t *key = ecdsa_generate();
|
||||
if(!key)
|
||||
return 1;
|
||||
|
||||
char *b64key = ecdsa_get_base64_public_key(key);
|
||||
|
||||
// Connect to the tinc daemon mentioned in the URL.
|
||||
struct addrinfo *ai = str2addrinfo(address, port, SOCK_STREAM);
|
||||
if(!ai)
|
||||
return 1;
|
||||
|
||||
sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
|
||||
if(sock <= 0) {
|
||||
fprintf(stderr, "Could not open socket: %s\n", strerror(errno));
|
||||
return 1;
|
||||
}
|
||||
|
||||
if(connect(sock, ai->ai_addr, ai->ai_addrlen)) {
|
||||
fprintf(stderr, "Could not connect to %s port %s: %s\n", address, port, strerror(errno));
|
||||
closesocket(sock);
|
||||
return 1;
|
||||
}
|
||||
|
||||
fprintf(stderr, "Connected to %s port %s...\n", address, port);
|
||||
|
||||
// Tell him we have an invitation, and give him our throw-away key.
|
||||
int len = snprintf(line, sizeof line, "0 ?%s %d.%d\n", b64key, PROT_MAJOR, PROT_MINOR);
|
||||
if(len <= 0 || len >= sizeof line)
|
||||
abort();
|
||||
|
||||
if(!sendline(sock, "0 ?%s %d.%d", b64key, PROT_MAJOR, 1)) {
|
||||
fprintf(stderr, "Error sending request to %s port %s: %s\n", address, port, strerror(errno));
|
||||
closesocket(sock);
|
||||
return 1;
|
||||
}
|
||||
|
||||
char hisname[4096] = "";
|
||||
int code, hismajor, hisminor = 0;
|
||||
|
||||
if(!recvline(sock, line, sizeof line) || sscanf(line, "%d %s %d.%d", &code, hisname, &hismajor, &hisminor) < 3 || code != 0 || hismajor != PROT_MAJOR || !check_id(hisname) || !recvline(sock, line, sizeof line) || !rstrip(line) || sscanf(line, "%d ", &code) != 1 || code != ACK || strlen(line) < 3) {
|
||||
fprintf(stderr, "Cannot read greeting from peer\n");
|
||||
closesocket(sock);
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Check if the hash of the key he gave us matches the hash in the URL.
|
||||
char *fingerprint = line + 2;
|
||||
digest_t *digest = digest_open_by_name("sha256", 18);
|
||||
if(!digest)
|
||||
abort();
|
||||
char hishash[18];
|
||||
if(!digest_create(digest, fingerprint, strlen(fingerprint), hishash)) {
|
||||
fprintf(stderr, "Could not create digest\n%s\n", line + 2);
|
||||
return 1;
|
||||
}
|
||||
if(memcmp(hishash, hash, 18)) {
|
||||
fprintf(stderr, "Peer has an invalid key!\n%s\n", line + 2);
|
||||
return 1;
|
||||
|
||||
}
|
||||
|
||||
ecdsa_t *hiskey = ecdsa_set_base64_public_key(fingerprint);
|
||||
if(!hiskey)
|
||||
return 1;
|
||||
|
||||
// Start an SPTPS session
|
||||
if(!sptps_start(&sptps, NULL, true, false, key, hiskey, "tinc invitation", 15, invitation_send, invitation_receive))
|
||||
return 1;
|
||||
|
||||
// Feed rest of input buffer to SPTPS
|
||||
if(!sptps_receive_data(&sptps, buffer, blen))
|
||||
return 1;
|
||||
|
||||
while((len = recv(sock, line, sizeof line, 0))) {
|
||||
if(len < 0) {
|
||||
if(errno == EINTR)
|
||||
continue;
|
||||
fprintf(stderr, "Error reading data from %s port %s: %s\n", address, port, strerror(errno));
|
||||
return 1;
|
||||
}
|
||||
|
||||
if(!sptps_receive_data(&sptps, line, len))
|
||||
return 1;
|
||||
}
|
||||
|
||||
sptps_stop(&sptps);
|
||||
ecdsa_free(hiskey);
|
||||
ecdsa_free(key);
|
||||
closesocket(sock);
|
||||
|
||||
if(!success) {
|
||||
fprintf(stderr, "Connection closed by peer, invitation cancelled.\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
invalid:
|
||||
fprintf(stderr, "Invalid invitation URL.\n");
|
||||
return 1;
|
||||
}
|
27
src/invitation.h
Normal file
27
src/invitation.h
Normal file
|
@ -0,0 +1,27 @@
|
|||
/*
|
||||
invitation.h -- header for invitation.c.
|
||||
Copyright (C) 2013 Guus Sliepen <guus@tinc-vpn.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#ifndef __TINC_INVITATION_H__
|
||||
#define __TINC_INVITATION_H__
|
||||
|
||||
bool recvdata(int fd, char *data, size_t len);
|
||||
int cmd_invite(int argc, char *argv[]);
|
||||
int cmd_join(int argc, char *argv[]);
|
||||
|
||||
#endif
|
0
src/linux/.deps/.dirstamp
Normal file
0
src/linux/.deps/.dirstamp
Normal file
467
src/linux/.deps/device.Po
Normal file
467
src/linux/.deps/device.Po
Normal file
|
@ -0,0 +1,467 @@
|
|||
linux/device.o: linux/device.c /usr/include/stdc-predef.h \
|
||||
/usr/include/x86_64-linux-gnu/bits/predefs.h linux/../system.h \
|
||||
linux/../../config.h linux/../have.h /usr/include/stdio.h \
|
||||
/usr/include/features.h /usr/include/x86_64-linux-gnu/sys/cdefs.h \
|
||||
/usr/include/x86_64-linux-gnu/bits/wordsize.h \
|
||||
/usr/include/x86_64-linux-gnu/gnu/stubs.h \
|
||||
/usr/include/x86_64-linux-gnu/gnu/stubs-64.h \
|
||||
/usr/lib/gcc/x86_64-linux-gnu/4.8/include/stddef.h \
|
||||
/usr/include/x86_64-linux-gnu/bits/types.h \
|
||||
/usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/libio.h \
|
||||
/usr/include/_G_config.h /usr/include/wchar.h \
|
||||
/usr/lib/gcc/x86_64-linux-gnu/4.8/include/stdarg.h \
|
||||
/usr/include/x86_64-linux-gnu/bits/stdio_lim.h \
|
||||
/usr/include/x86_64-linux-gnu/bits/sys_errlist.h \
|
||||
/usr/include/x86_64-linux-gnu/bits/stdio.h /usr/include/stdlib.h \
|
||||
/usr/include/x86_64-linux-gnu/bits/waitflags.h \
|
||||
/usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/endian.h \
|
||||
/usr/include/x86_64-linux-gnu/bits/endian.h \
|
||||
/usr/include/x86_64-linux-gnu/bits/byteswap.h \
|
||||
/usr/include/x86_64-linux-gnu/bits/byteswap-16.h /usr/include/xlocale.h \
|
||||
/usr/include/x86_64-linux-gnu/sys/types.h /usr/include/time.h \
|
||||
/usr/include/x86_64-linux-gnu/sys/select.h \
|
||||
/usr/include/x86_64-linux-gnu/bits/select.h \
|
||||
/usr/include/x86_64-linux-gnu/bits/sigset.h \
|
||||
/usr/include/x86_64-linux-gnu/bits/time.h \
|
||||
/usr/include/x86_64-linux-gnu/sys/sysmacros.h \
|
||||
/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h /usr/include/alloca.h \
|
||||
/usr/include/x86_64-linux-gnu/bits/stdlib-float.h /usr/include/string.h \
|
||||
/usr/include/x86_64-linux-gnu/bits/string.h \
|
||||
/usr/include/x86_64-linux-gnu/bits/string2.h /usr/include/ctype.h \
|
||||
/usr/include/signal.h /usr/include/x86_64-linux-gnu/bits/signum.h \
|
||||
/usr/include/x86_64-linux-gnu/bits/siginfo.h \
|
||||
/usr/include/x86_64-linux-gnu/bits/sigaction.h \
|
||||
/usr/include/x86_64-linux-gnu/bits/sigcontext.h \
|
||||
/usr/include/x86_64-linux-gnu/bits/sigstack.h \
|
||||
/usr/include/x86_64-linux-gnu/sys/ucontext.h \
|
||||
/usr/include/x86_64-linux-gnu/bits/sigthread.h /usr/include/errno.h \
|
||||
/usr/include/x86_64-linux-gnu/bits/errno.h /usr/include/linux/errno.h \
|
||||
/usr/include/x86_64-linux-gnu/asm/errno.h \
|
||||
/usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \
|
||||
/usr/include/fcntl.h /usr/include/x86_64-linux-gnu/bits/fcntl.h \
|
||||
/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h \
|
||||
/usr/include/x86_64-linux-gnu/bits/uio.h \
|
||||
/usr/include/x86_64-linux-gnu/bits/stat.h /usr/include/unistd.h \
|
||||
/usr/include/x86_64-linux-gnu/bits/posix_opt.h \
|
||||
/usr/include/x86_64-linux-gnu/bits/environments.h \
|
||||
/usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/getopt.h \
|
||||
/usr/lib/gcc/x86_64-linux-gnu/4.8/include/stdbool.h \
|
||||
/usr/include/inttypes.h \
|
||||
/usr/lib/gcc/x86_64-linux-gnu/4.8/include/stdint.h /usr/include/stdint.h \
|
||||
/usr/include/x86_64-linux-gnu/bits/wchar.h /usr/include/syslog.h \
|
||||
/usr/include/x86_64-linux-gnu/sys/syslog.h \
|
||||
/usr/include/x86_64-linux-gnu/bits/syslog-path.h \
|
||||
/usr/include/x86_64-linux-gnu/sys/time.h \
|
||||
/usr/include/x86_64-linux-gnu/bits/timex.h \
|
||||
/usr/include/x86_64-linux-gnu/sys/stat.h \
|
||||
/usr/include/x86_64-linux-gnu/sys/file.h \
|
||||
/usr/include/x86_64-linux-gnu/sys/wait.h \
|
||||
/usr/include/x86_64-linux-gnu/sys/ioctl.h \
|
||||
/usr/include/x86_64-linux-gnu/bits/ioctls.h \
|
||||
/usr/include/x86_64-linux-gnu/asm/ioctls.h \
|
||||
/usr/include/asm-generic/ioctls.h /usr/include/linux/ioctl.h \
|
||||
/usr/include/x86_64-linux-gnu/asm/ioctl.h \
|
||||
/usr/include/asm-generic/ioctl.h \
|
||||
/usr/include/x86_64-linux-gnu/bits/ioctl-types.h \
|
||||
/usr/include/x86_64-linux-gnu/sys/ttydefaults.h \
|
||||
/usr/include/x86_64-linux-gnu/sys/param.h \
|
||||
/usr/lib/gcc/x86_64-linux-gnu/4.8/include-fixed/limits.h \
|
||||
/usr/lib/gcc/x86_64-linux-gnu/4.8/include-fixed/syslimits.h \
|
||||
/usr/include/limits.h /usr/include/x86_64-linux-gnu/bits/posix1_lim.h \
|
||||
/usr/include/x86_64-linux-gnu/bits/local_lim.h \
|
||||
/usr/include/linux/limits.h \
|
||||
/usr/include/x86_64-linux-gnu/bits/posix2_lim.h \
|
||||
/usr/include/x86_64-linux-gnu/bits/xopen_lim.h \
|
||||
/usr/include/x86_64-linux-gnu/bits/param.h /usr/include/linux/param.h \
|
||||
/usr/include/x86_64-linux-gnu/asm/param.h \
|
||||
/usr/include/asm-generic/param.h \
|
||||
/usr/include/x86_64-linux-gnu/sys/resource.h \
|
||||
/usr/include/x86_64-linux-gnu/bits/resource.h \
|
||||
/usr/include/x86_64-linux-gnu/sys/uio.h \
|
||||
/usr/include/x86_64-linux-gnu/sys/un.h \
|
||||
/usr/include/x86_64-linux-gnu/bits/sockaddr.h /usr/include/dirent.h \
|
||||
/usr/include/x86_64-linux-gnu/bits/dirent.h /usr/include/netdb.h \
|
||||
/usr/include/netinet/in.h /usr/include/x86_64-linux-gnu/sys/socket.h \
|
||||
/usr/include/x86_64-linux-gnu/bits/socket.h \
|
||||
/usr/include/x86_64-linux-gnu/bits/socket_type.h \
|
||||
/usr/include/x86_64-linux-gnu/asm/socket.h \
|
||||
/usr/include/asm-generic/socket.h \
|
||||
/usr/include/x86_64-linux-gnu/asm/sockios.h \
|
||||
/usr/include/asm-generic/sockios.h \
|
||||
/usr/include/x86_64-linux-gnu/bits/in.h /usr/include/rpc/netdb.h \
|
||||
/usr/include/x86_64-linux-gnu/bits/netdb.h /usr/include/net/if.h \
|
||||
/usr/include/netinet/in_systm.h /usr/include/arpa/inet.h \
|
||||
/usr/include/netinet/ip.h /usr/include/netinet/tcp.h \
|
||||
/usr/include/netinet/ip6.h /usr/include/net/ethernet.h \
|
||||
/usr/include/linux/if_ether.h /usr/include/linux/types.h \
|
||||
/usr/include/x86_64-linux-gnu/asm/types.h \
|
||||
/usr/include/asm-generic/types.h /usr/include/asm-generic/int-ll64.h \
|
||||
/usr/include/x86_64-linux-gnu/asm/bitsperlong.h \
|
||||
/usr/include/asm-generic/bitsperlong.h /usr/include/linux/posix_types.h \
|
||||
/usr/include/linux/stddef.h \
|
||||
/usr/include/x86_64-linux-gnu/asm/posix_types.h \
|
||||
/usr/include/x86_64-linux-gnu/asm/posix_types_64.h \
|
||||
/usr/include/asm-generic/posix_types.h /usr/include/net/if_arp.h \
|
||||
/usr/include/netinet/ip_icmp.h /usr/include/netinet/icmp6.h \
|
||||
/usr/include/netinet/if_ether.h linux/../dropin.h \
|
||||
linux/../fake-getaddrinfo.h linux/../fake-gai-errnos.h \
|
||||
linux/../fake-getnameinfo.h /usr/include/linux/if_tun.h \
|
||||
/usr/include/linux/filter.h linux/../conf.h linux/../splay_tree.h \
|
||||
linux/../list.h linux/../subnet.h linux/../net.h linux/../ipv6.h \
|
||||
linux/../cipher.h linux/../digest.h linux/../event.h linux/../conf.h \
|
||||
linux/../connection.h linux/../buffer.h linux/../rsa.h linux/../sptps.h \
|
||||
linux/../system.h linux/../ecdh.h linux/../ecdsa.h linux/../edge.h \
|
||||
linux/../node.h linux/../device.h linux/../logger.h linux/../names.h \
|
||||
linux/../net.h linux/../route.h linux/../utils.h linux/../xalloc.h
|
||||
|
||||
/usr/include/stdc-predef.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/bits/predefs.h:
|
||||
|
||||
linux/../system.h:
|
||||
|
||||
linux/../../config.h:
|
||||
|
||||
linux/../have.h:
|
||||
|
||||
/usr/include/stdio.h:
|
||||
|
||||
/usr/include/features.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/sys/cdefs.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/bits/wordsize.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/gnu/stubs.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/gnu/stubs-64.h:
|
||||
|
||||
/usr/lib/gcc/x86_64-linux-gnu/4.8/include/stddef.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/bits/types.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/bits/typesizes.h:
|
||||
|
||||
/usr/include/libio.h:
|
||||
|
||||
/usr/include/_G_config.h:
|
||||
|
||||
/usr/include/wchar.h:
|
||||
|
||||
/usr/lib/gcc/x86_64-linux-gnu/4.8/include/stdarg.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/bits/stdio_lim.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/bits/sys_errlist.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/bits/stdio.h:
|
||||
|
||||
/usr/include/stdlib.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/bits/waitflags.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/bits/waitstatus.h:
|
||||
|
||||
/usr/include/endian.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/bits/endian.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/bits/byteswap.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/bits/byteswap-16.h:
|
||||
|
||||
/usr/include/xlocale.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/sys/types.h:
|
||||
|
||||
/usr/include/time.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/sys/select.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/bits/select.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/bits/sigset.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/bits/time.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/sys/sysmacros.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:
|
||||
|
||||
/usr/include/alloca.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/bits/stdlib-float.h:
|
||||
|
||||
/usr/include/string.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/bits/string.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/bits/string2.h:
|
||||
|
||||
/usr/include/ctype.h:
|
||||
|
||||
/usr/include/signal.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/bits/signum.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/bits/siginfo.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/bits/sigaction.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/bits/sigcontext.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/bits/sigstack.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/sys/ucontext.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/bits/sigthread.h:
|
||||
|
||||
/usr/include/errno.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/bits/errno.h:
|
||||
|
||||
/usr/include/linux/errno.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/asm/errno.h:
|
||||
|
||||
/usr/include/asm-generic/errno.h:
|
||||
|
||||
/usr/include/asm-generic/errno-base.h:
|
||||
|
||||
/usr/include/fcntl.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/bits/fcntl.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/bits/uio.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/bits/stat.h:
|
||||
|
||||
/usr/include/unistd.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/bits/posix_opt.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/bits/environments.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/bits/confname.h:
|
||||
|
||||
/usr/include/getopt.h:
|
||||
|
||||
/usr/lib/gcc/x86_64-linux-gnu/4.8/include/stdbool.h:
|
||||
|
||||
/usr/include/inttypes.h:
|
||||
|
||||
/usr/lib/gcc/x86_64-linux-gnu/4.8/include/stdint.h:
|
||||
|
||||
/usr/include/stdint.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/bits/wchar.h:
|
||||
|
||||
/usr/include/syslog.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/sys/syslog.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/bits/syslog-path.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/sys/time.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/bits/timex.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/sys/stat.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/sys/file.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/sys/wait.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/sys/ioctl.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/bits/ioctls.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/asm/ioctls.h:
|
||||
|
||||
/usr/include/asm-generic/ioctls.h:
|
||||
|
||||
/usr/include/linux/ioctl.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/asm/ioctl.h:
|
||||
|
||||
/usr/include/asm-generic/ioctl.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/bits/ioctl-types.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/sys/ttydefaults.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/sys/param.h:
|
||||
|
||||
/usr/lib/gcc/x86_64-linux-gnu/4.8/include-fixed/limits.h:
|
||||
|
||||
/usr/lib/gcc/x86_64-linux-gnu/4.8/include-fixed/syslimits.h:
|
||||
|
||||
/usr/include/limits.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/bits/posix1_lim.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/bits/local_lim.h:
|
||||
|
||||
/usr/include/linux/limits.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/bits/posix2_lim.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/bits/xopen_lim.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/bits/param.h:
|
||||
|
||||
/usr/include/linux/param.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/asm/param.h:
|
||||
|
||||
/usr/include/asm-generic/param.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/sys/resource.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/bits/resource.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/sys/uio.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/sys/un.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/bits/sockaddr.h:
|
||||
|
||||
/usr/include/dirent.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/bits/dirent.h:
|
||||
|
||||
/usr/include/netdb.h:
|
||||
|
||||
/usr/include/netinet/in.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/sys/socket.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/bits/socket.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/bits/socket_type.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/asm/socket.h:
|
||||
|
||||
/usr/include/asm-generic/socket.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/asm/sockios.h:
|
||||
|
||||
/usr/include/asm-generic/sockios.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/bits/in.h:
|
||||
|
||||
/usr/include/rpc/netdb.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/bits/netdb.h:
|
||||
|
||||
/usr/include/net/if.h:
|
||||
|
||||
/usr/include/netinet/in_systm.h:
|
||||
|
||||
/usr/include/arpa/inet.h:
|
||||
|
||||
/usr/include/netinet/ip.h:
|
||||
|
||||
/usr/include/netinet/tcp.h:
|
||||
|
||||
/usr/include/netinet/ip6.h:
|
||||
|
||||
/usr/include/net/ethernet.h:
|
||||
|
||||
/usr/include/linux/if_ether.h:
|
||||
|
||||
/usr/include/linux/types.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/asm/types.h:
|
||||
|
||||
/usr/include/asm-generic/types.h:
|
||||
|
||||
/usr/include/asm-generic/int-ll64.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/asm/bitsperlong.h:
|
||||
|
||||
/usr/include/asm-generic/bitsperlong.h:
|
||||
|
||||
/usr/include/linux/posix_types.h:
|
||||
|
||||
/usr/include/linux/stddef.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/asm/posix_types.h:
|
||||
|
||||
/usr/include/x86_64-linux-gnu/asm/posix_types_64.h:
|
||||
|
||||
/usr/include/asm-generic/posix_types.h:
|
||||
|
||||
/usr/include/net/if_arp.h:
|
||||
|
||||
/usr/include/netinet/ip_icmp.h:
|
||||
|
||||
/usr/include/netinet/icmp6.h:
|
||||
|
||||
/usr/include/netinet/if_ether.h:
|
||||
|
||||
linux/../dropin.h:
|
||||
|
||||
linux/../fake-getaddrinfo.h:
|
||||
|
||||
linux/../fake-gai-errnos.h:
|
||||
|
||||
linux/../fake-getnameinfo.h:
|
||||
|
||||
/usr/include/linux/if_tun.h:
|
||||
|
||||
/usr/include/linux/filter.h:
|
||||
|
||||
linux/../conf.h:
|
||||
|
||||
linux/../splay_tree.h:
|
||||
|
||||
linux/../list.h:
|
||||
|
||||
linux/../subnet.h:
|
||||
|
||||
linux/../net.h:
|
||||
|
||||
linux/../ipv6.h:
|
||||
|
||||
linux/../cipher.h:
|
||||
|
||||
linux/../digest.h:
|
||||
|
||||
linux/../event.h:
|
||||
|
||||
linux/../conf.h:
|
||||
|
||||
linux/../connection.h:
|
||||
|
||||
linux/../buffer.h:
|
||||
|
||||
linux/../rsa.h:
|
||||
|
||||
linux/../sptps.h:
|
||||
|
||||
linux/../system.h:
|
||||
|
||||
linux/../ecdh.h:
|
||||
|
||||
linux/../ecdsa.h:
|
||||
|
||||
linux/../edge.h:
|
||||
|
||||
linux/../node.h:
|
||||
|
||||
linux/../device.h:
|
||||
|
||||
linux/../logger.h:
|
||||
|
||||
linux/../names.h:
|
||||
|
||||
linux/../net.h:
|
||||
|
||||
linux/../route.h:
|
||||
|
||||
linux/../utils.h:
|
||||
|
||||
linux/../xalloc.h:
|
0
src/linux/.dirstamp
Normal file
0
src/linux/.dirstamp
Normal file
|
@ -18,20 +18,20 @@
|
|||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#include "system.h"
|
||||
#include "../system.h"
|
||||
|
||||
#include <linux/if_tun.h>
|
||||
#define DEFAULT_DEVICE "/dev/net/tun"
|
||||
|
||||
#include "conf.h"
|
||||
#include "device.h"
|
||||
#include "logger.h"
|
||||
#include "names.h"
|
||||
#include "net.h"
|
||||
#include "route.h"
|
||||
#include "utils.h"
|
||||
#include "xalloc.h"
|
||||
#include "device.h"
|
||||
#include "../conf.h"
|
||||
#include "../device.h"
|
||||
#include "../logger.h"
|
||||
#include "../names.h"
|
||||
#include "../net.h"
|
||||
#include "../route.h"
|
||||
#include "../utils.h"
|
||||
#include "../xalloc.h"
|
||||
#include "../device.h"
|
||||
|
||||
typedef enum device_type_t {
|
||||
DEVICE_TYPE_TUN,
|
||||
|
@ -84,6 +84,8 @@ static bool setup_device(void) {
|
|||
device_type = DEVICE_TYPE_TUN;
|
||||
device_info = "Linux tun/tap device (tun mode)";
|
||||
} else {
|
||||
if (routing_mode == RMODE_ROUTER)
|
||||
overwrite_mac = true;
|
||||
ifr.ifr_flags = IFF_TAP | IFF_NO_PI;
|
||||
device_type = DEVICE_TYPE_TAP;
|
||||
device_info = "Linux tun/tap device (tap mode)";
|
||||
|
|
BIN
src/linux/device.o
Normal file
BIN
src/linux/device.o
Normal file
Binary file not shown.
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
list.c -- functions to deal with double linked lists
|
||||
Copyright (C) 2000-2005 Ivo Timmermans
|
||||
2000-2012 Guus Sliepen <guus@tinc-vpn.org>
|
||||
2000-2013 Guus Sliepen <guus@tinc-vpn.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -26,7 +26,7 @@
|
|||
/* (De)constructors */
|
||||
|
||||
list_t *list_alloc(list_action_t delete) {
|
||||
list_t *list = xmalloc_and_zero(sizeof(list_t));
|
||||
list_t *list = xzalloc(sizeof(list_t));
|
||||
list->delete = delete;
|
||||
|
||||
return list;
|
||||
|
@ -37,7 +37,7 @@ void list_free(list_t *list) {
|
|||
}
|
||||
|
||||
list_node_t *list_alloc_node(void) {
|
||||
return xmalloc_and_zero(sizeof(list_node_t));
|
||||
return xzalloc(sizeof(list_node_t));
|
||||
}
|
||||
|
||||
void list_free_node(list_t *list, list_node_t *node) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
meta.c -- handle the meta communication
|
||||
Copyright (C) 2000-2012 Guus Sliepen <guus@tinc-vpn.org>,
|
||||
Copyright (C) 2000-2013 Guus Sliepen <guus@tinc-vpn.org>,
|
||||
2000-2005 Ivo Timmermans
|
||||
2006 Scott Lamb <slamb@slamb.org>
|
||||
|
||||
|
@ -60,7 +60,7 @@ bool send_meta(connection_t *c, const char *buffer, int length) {
|
|||
if(c->status.encryptout) {
|
||||
size_t outlen = length;
|
||||
|
||||
if(!cipher_encrypt(&c->outcipher, buffer, length, buffer_prepare(&c->outbuf, length), &outlen, false) || outlen != length) {
|
||||
if(!cipher_encrypt(c->outcipher, buffer, length, buffer_prepare(&c->outbuf, length), &outlen, false) || outlen != length) {
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "Error while encrypting metadata to %s (%s)",
|
||||
c->name, c->hostname);
|
||||
return false;
|
||||
|
@ -171,7 +171,7 @@ bool receive_meta(connection_t *c) {
|
|||
} else {
|
||||
size_t outlen = inlen;
|
||||
|
||||
if(!cipher_decrypt(&c->incipher, bufp, inlen, buffer_prepare(&c->inbuf, inlen), &outlen, false) || inlen != outlen) {
|
||||
if(!cipher_decrypt(c->incipher, bufp, inlen, buffer_prepare(&c->inbuf, inlen), &outlen, false) || inlen != outlen) {
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "Error while decrypting metadata from %s (%s)",
|
||||
c->name, c->hostname);
|
||||
return false;
|
||||
|
|
1
src/mingw/.deps/device.Po
Normal file
1
src/mingw/.deps/device.Po
Normal file
|
@ -0,0 +1 @@
|
|||
# dummy
|
|
@ -18,21 +18,21 @@
|
|||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#include "system.h"
|
||||
#include "../system.h"
|
||||
|
||||
#include <windows.h>
|
||||
#include <winioctl.h>
|
||||
|
||||
#include "conf.h"
|
||||
#include "device.h"
|
||||
#include "logger.h"
|
||||
#include "names.h"
|
||||
#include "net.h"
|
||||
#include "route.h"
|
||||
#include "utils.h"
|
||||
#include "xalloc.h"
|
||||
#include "../conf.h"
|
||||
#include "../device.h"
|
||||
#include "../logger.h"
|
||||
#include "../names.h"
|
||||
#include "../net.h"
|
||||
#include "../route.h"
|
||||
#include "../utils.h"
|
||||
#include "../xalloc.h"
|
||||
|
||||
#include "mingw/common.h"
|
||||
#include "common.h"
|
||||
|
||||
int device_fd = -1;
|
||||
static HANDLE device_handle = INVALID_HANDLE_VALUE;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
device.c -- multicast socket
|
||||
Copyright (C) 2002-2005 Ivo Timmermans,
|
||||
2002-2012 Guus Sliepen <guus@tinc-vpn.org>
|
||||
2002-2013 Guus Sliepen <guus@tinc-vpn.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
10
src/names.c
10
src/names.c
|
@ -42,6 +42,9 @@ void make_names(void) {
|
|||
DWORD len = sizeof installdir;
|
||||
#endif
|
||||
|
||||
if(netname && confbase)
|
||||
logger(DEBUG_ALWAYS, LOG_INFO, "Both netname and configuration directory given, using the latter...");
|
||||
|
||||
if(netname)
|
||||
xasprintf(&identname, "tinc.%s", netname);
|
||||
else
|
||||
|
@ -84,13 +87,10 @@ void make_names(void) {
|
|||
strcpy(unixsocketname + len, ".socket");
|
||||
}
|
||||
|
||||
if(netname) {
|
||||
if(!confbase)
|
||||
if(!confbase) {
|
||||
if(netname)
|
||||
xasprintf(&confbase, CONFDIR SLASH "tinc" SLASH "%s", netname);
|
||||
else
|
||||
logger(DEBUG_ALWAYS, LOG_INFO, "Both netname and configuration directory given, using the latter...");
|
||||
} else {
|
||||
if(!confbase)
|
||||
xasprintf(&confbase, CONFDIR SLASH "tinc");
|
||||
}
|
||||
}
|
||||
|
|
42
src/net.c
42
src/net.c
|
@ -41,6 +41,8 @@ int contradicting_add_edge = 0;
|
|||
int contradicting_del_edge = 0;
|
||||
static int sleeptime = 10;
|
||||
time_t last_config_check = 0;
|
||||
static timeout_t pingtimer;
|
||||
static timeout_t periodictimer;
|
||||
|
||||
/* Purge edges and subnets of unreachable nodes. Use carefully. */
|
||||
|
||||
|
@ -224,7 +226,7 @@ static void periodic_handler(void *data) {
|
|||
|
||||
if(!found) {
|
||||
logger(DEBUG_CONNECTIONS, LOG_INFO, "Autoconnecting to %s", n->name);
|
||||
outgoing_t *outgoing = xmalloc_and_zero(sizeof *outgoing);
|
||||
outgoing_t *outgoing = xzalloc(sizeof *outgoing);
|
||||
outgoing->name = xstrdup(n->name);
|
||||
list_insert_tail(outgoing_list, outgoing);
|
||||
setup_outgoing_connection(outgoing);
|
||||
|
@ -296,7 +298,8 @@ static void sigterm_handler(void *data) {
|
|||
static void sighup_handler(void *data) {
|
||||
logger(DEBUG_ALWAYS, LOG_NOTICE, "Got %s signal", strsignal(((signal_t *)data)->signum));
|
||||
reopenlogger();
|
||||
reload_configuration();
|
||||
if(reload_configuration())
|
||||
exit(1);
|
||||
}
|
||||
|
||||
static void sigalrm_handler(void *data) {
|
||||
|
@ -306,7 +309,7 @@ static void sigalrm_handler(void *data) {
|
|||
#endif
|
||||
|
||||
int reload_configuration(void) {
|
||||
char *fname;
|
||||
char *fname = NULL;
|
||||
|
||||
/* Reread our own configuration file */
|
||||
|
||||
|
@ -314,8 +317,7 @@ int reload_configuration(void) {
|
|||
init_configuration(&config_tree);
|
||||
|
||||
if(!read_server_config()) {
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "Unable to reread configuration file, exitting.");
|
||||
event_exit();
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "Unable to reread configuration file.");
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
|
@ -412,24 +414,27 @@ int reload_configuration(void) {
|
|||
}
|
||||
|
||||
void retry(void) {
|
||||
for list_each(connection_t, c, connection_list) {
|
||||
if(c->outgoing && !c->node) {
|
||||
timeout_del(&c->outgoing->ev);
|
||||
if(c->status.connecting)
|
||||
close(c->socket);
|
||||
c->outgoing->timeout = 0;
|
||||
terminate_connection(c, c->status.active);
|
||||
}
|
||||
/* Reset the reconnection timers for all outgoing connections */
|
||||
for list_each(outgoing_t, outgoing, outgoing_list) {
|
||||
outgoing->timeout = 0;
|
||||
if(outgoing->ev.cb)
|
||||
timeout_set(&outgoing->ev, &(struct timeval){0, 0});
|
||||
}
|
||||
|
||||
/* Check for outgoing connections that are in progress, and reset their ping timers */
|
||||
for list_each(connection_t, c, connection_list) {
|
||||
if(c->outgoing && !c->node)
|
||||
c->last_ping_time = 0;
|
||||
}
|
||||
|
||||
/* Kick the ping timeout handler */
|
||||
timeout_set(&pingtimer, &(struct timeval){0, 0});
|
||||
}
|
||||
|
||||
/*
|
||||
this is where it all happens...
|
||||
*/
|
||||
int main_loop(void) {
|
||||
timeout_t pingtimer = {{0}};
|
||||
timeout_t periodictimer = {{0}};
|
||||
|
||||
timeout_add(&pingtimer, timeout_handler, &pingtimer, &(struct timeval){pingtimeout, rand() % 100000});
|
||||
timeout_add(&periodictimer, periodic_handler, &periodictimer, &(struct timeval){pingtimeout, rand() % 100000});
|
||||
|
||||
|
@ -454,9 +459,10 @@ int main_loop(void) {
|
|||
|
||||
#ifndef HAVE_MINGW
|
||||
signal_del(&sighup);
|
||||
signal_del(&sigalrm);
|
||||
signal_del(&sigquit);
|
||||
signal_del(&sigterm);
|
||||
signal_del(&sigquit);
|
||||
signal_del(&sigint);
|
||||
signal_del(&sigalrm);
|
||||
#endif
|
||||
|
||||
timeout_del(&periodictimer);
|
||||
|
|
|
@ -125,6 +125,7 @@ extern int seconds_till_retry;
|
|||
extern int addressfamily;
|
||||
extern unsigned replaywin;
|
||||
extern bool localdiscovery;
|
||||
extern sockaddr_t localdiscovery_address;
|
||||
|
||||
extern listen_socket_t listen_socket[MAXSOCKETS];
|
||||
extern int listen_sockets;
|
||||
|
@ -132,6 +133,7 @@ extern io_t unix_socket;
|
|||
extern int keylifetime;
|
||||
extern int udp_rcvbuf;
|
||||
extern int udp_sndbuf;
|
||||
extern int max_connection_burst;
|
||||
extern bool do_prune;
|
||||
extern char *myport;
|
||||
extern int autoconnect;
|
||||
|
|
131
src/net_packet.c
131
src/net_packet.c
|
@ -56,6 +56,7 @@ static void send_udppacket(node_t *, vpn_packet_t *);
|
|||
|
||||
unsigned replaywin = 16;
|
||||
bool localdiscovery = false;
|
||||
sockaddr_t localdiscovery_address;
|
||||
|
||||
#define MAX_SEQNO 1073741824
|
||||
|
||||
|
@ -178,12 +179,25 @@ void send_mtu_probe(node_t *n) {
|
|||
}
|
||||
|
||||
static void mtu_probe_h(node_t *n, vpn_packet_t *packet, length_t len) {
|
||||
logger(DEBUG_TRAFFIC, LOG_INFO, "Got MTU probe length %d from %s (%s)", packet->len, n->name, n->hostname);
|
||||
|
||||
if(!packet->data[0]) {
|
||||
logger(DEBUG_TRAFFIC, LOG_INFO, "Got MTU probe request %d from %s (%s)", packet->len, n->name, n->hostname);
|
||||
|
||||
/* It's a probe request, send back a reply */
|
||||
|
||||
packet->data[0] = 1;
|
||||
/* Type 2 probe replies were introduced in protocol 17.3 */
|
||||
if ((n->options >> 24) == 3) {
|
||||
uint8_t* data = packet->data;
|
||||
*data++ = 2;
|
||||
uint16_t len16 = htons(len); memcpy(data, &len16, 2); data += 2;
|
||||
struct timeval now;
|
||||
gettimeofday(&now, NULL);
|
||||
uint32_t sec = htonl(now.tv_sec); memcpy(data, &sec, 4); data += 4;
|
||||
uint32_t usec = htonl(now.tv_usec); memcpy(data, &usec, 4); data += 4;
|
||||
packet->len = data - packet->data;
|
||||
} else {
|
||||
/* Legacy protocol: n won't understand type 2 probe replies. */
|
||||
packet->data[0] = 1;
|
||||
}
|
||||
|
||||
/* Temporarily set udp_confirmed, so that the reply is sent
|
||||
back exactly the way it came in. */
|
||||
|
@ -193,6 +207,16 @@ static void mtu_probe_h(node_t *n, vpn_packet_t *packet, length_t len) {
|
|||
send_udppacket(n, packet);
|
||||
n->status.udp_confirmed = udp_confirmed;
|
||||
} else {
|
||||
length_t probelen = len;
|
||||
if (packet->data[0] == 2) {
|
||||
if (len < 3)
|
||||
logger(DEBUG_TRAFFIC, LOG_WARNING, "Received invalid (too short) MTU probe reply from %s (%s)", n->name, n->hostname);
|
||||
else {
|
||||
uint16_t probelen16; memcpy(&probelen16, packet->data + 1, 2); probelen = ntohs(probelen16);
|
||||
}
|
||||
}
|
||||
logger(DEBUG_TRAFFIC, LOG_INFO, "Got type %d MTU probe reply %d from %s (%s)", packet->data[0], probelen, n->name, n->hostname);
|
||||
|
||||
/* It's a valid reply: now we know bidirectional communication
|
||||
is possible using the address and socket that the reply
|
||||
packet used. */
|
||||
|
@ -202,7 +226,7 @@ static void mtu_probe_h(node_t *n, vpn_packet_t *packet, length_t len) {
|
|||
/* If we haven't established the PMTU yet, restart the discovery process. */
|
||||
|
||||
if(n->mtuprobes > 30) {
|
||||
if (len == n->maxmtu + 8) {
|
||||
if (probelen == n->maxmtu + 8) {
|
||||
logger(DEBUG_TRAFFIC, LOG_INFO, "Increase in PMTU to %s (%s) detected, restarting PMTU discovery", n->name, n->hostname);
|
||||
n->maxmtu = MTU;
|
||||
n->mtuprobes = 10;
|
||||
|
@ -217,27 +241,38 @@ static void mtu_probe_h(node_t *n, vpn_packet_t *packet, length_t len) {
|
|||
|
||||
/* If applicable, raise the minimum supported MTU */
|
||||
|
||||
if(len > n->maxmtu)
|
||||
len = n->maxmtu;
|
||||
if(n->minmtu < len)
|
||||
n->minmtu = len;
|
||||
if(probelen > n->maxmtu)
|
||||
probelen = n->maxmtu;
|
||||
if(n->minmtu < probelen)
|
||||
n->minmtu = probelen;
|
||||
|
||||
/* Calculate RTT and bandwidth.
|
||||
The RTT is the time between the MTU probe burst was sent and the first
|
||||
reply is received. The bandwidth is measured using the time between the
|
||||
arrival of the first and third probe reply.
|
||||
arrival of the first and third probe reply (or type 2 probe requests).
|
||||
*/
|
||||
|
||||
struct timeval now, diff;
|
||||
gettimeofday(&now, NULL);
|
||||
timersub(&now, &n->probe_time, &diff);
|
||||
|
||||
struct timeval probe_timestamp = now;
|
||||
if (packet->data[0] == 2 && packet->len >= 11) {
|
||||
uint32_t sec; memcpy(&sec, packet->data + 3, 4);
|
||||
uint32_t usec; memcpy(&usec, packet->data + 7, 4);
|
||||
probe_timestamp.tv_sec = ntohl(sec);
|
||||
probe_timestamp.tv_usec = ntohl(usec);
|
||||
}
|
||||
|
||||
n->probe_counter++;
|
||||
|
||||
if(n->probe_counter == 1) {
|
||||
n->rtt = diff.tv_sec + diff.tv_usec * 1e-6;
|
||||
n->probe_time = now;
|
||||
n->probe_time = probe_timestamp;
|
||||
} else if(n->probe_counter == 3) {
|
||||
n->bandwidth = 2.0 * len / (diff.tv_sec + diff.tv_usec * 1e-6);
|
||||
struct timeval probe_timestamp_diff;
|
||||
timersub(&probe_timestamp, &n->probe_time, &probe_timestamp_diff);
|
||||
n->bandwidth = 2.0 * probelen / (probe_timestamp_diff.tv_sec + probe_timestamp_diff.tv_usec * 1e-6);
|
||||
logger(DEBUG_TRAFFIC, LOG_DEBUG, "%s (%s) RTT %.2f ms, burst bandwidth %.3f Mbit/s, rx packet loss %.2f %%", n->name, n->hostname, n->rtt * 1e3, n->bandwidth * 8e-6, n->packetloss * 1e2);
|
||||
}
|
||||
}
|
||||
|
@ -318,10 +353,10 @@ static bool try_mac(node_t *n, const vpn_packet_t *inpkt) {
|
|||
if(n->status.sptps)
|
||||
return sptps_verify_datagram(&n->sptps, (char *)&inpkt->seqno, inpkt->len);
|
||||
|
||||
if(!digest_active(&n->indigest) || inpkt->len < sizeof inpkt->seqno + digest_length(&n->indigest))
|
||||
if(!digest_active(n->indigest) || inpkt->len < sizeof inpkt->seqno + digest_length(n->indigest))
|
||||
return false;
|
||||
|
||||
return digest_verify(&n->indigest, &inpkt->seqno, inpkt->len - n->indigest.maclength, (const char *)&inpkt->seqno + inpkt->len - n->indigest.maclength);
|
||||
return digest_verify(n->indigest, &inpkt->seqno, inpkt->len - digest_length(n->indigest), (const char *)&inpkt->seqno + inpkt->len - digest_length(n->indigest));
|
||||
}
|
||||
|
||||
static void receive_udppacket(node_t *n, vpn_packet_t *inpkt) {
|
||||
|
@ -332,19 +367,27 @@ static void receive_udppacket(node_t *n, vpn_packet_t *inpkt) {
|
|||
size_t outlen;
|
||||
|
||||
if(n->status.sptps) {
|
||||
if(!n->sptps.state) {
|
||||
if(!n->status.waitingforkey) {
|
||||
logger(DEBUG_TRAFFIC, LOG_DEBUG, "Got packet from %s (%s) but we haven't exchanged keys yet", n->name, n->hostname);
|
||||
send_req_key(n);
|
||||
} else {
|
||||
logger(DEBUG_TRAFFIC, LOG_DEBUG, "Got packet from %s (%s) but he hasn't got our key yet", n->name, n->hostname);
|
||||
}
|
||||
return;
|
||||
}
|
||||
sptps_receive_data(&n->sptps, (char *)&inpkt->seqno, inpkt->len);
|
||||
return;
|
||||
}
|
||||
|
||||
if(!cipher_active(&n->incipher)) {
|
||||
logger(DEBUG_TRAFFIC, LOG_DEBUG, "Got packet from %s (%s) but he hasn't got our key yet",
|
||||
n->name, n->hostname);
|
||||
if(!cipher_active(n->incipher)) {
|
||||
logger(DEBUG_TRAFFIC, LOG_DEBUG, "Got packet from %s (%s) but he hasn't got our key yet", n->name, n->hostname);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Check packet length */
|
||||
|
||||
if(inpkt->len < sizeof inpkt->seqno + digest_length(&n->indigest)) {
|
||||
if(inpkt->len < sizeof inpkt->seqno + digest_length(n->indigest)) {
|
||||
logger(DEBUG_TRAFFIC, LOG_DEBUG, "Got too short packet from %s (%s)",
|
||||
n->name, n->hostname);
|
||||
return;
|
||||
|
@ -352,20 +395,20 @@ static void receive_udppacket(node_t *n, vpn_packet_t *inpkt) {
|
|||
|
||||
/* Check the message authentication code */
|
||||
|
||||
if(digest_active(&n->indigest)) {
|
||||
inpkt->len -= n->indigest.maclength;
|
||||
if(!digest_verify(&n->indigest, &inpkt->seqno, inpkt->len, (const char *)&inpkt->seqno + inpkt->len)) {
|
||||
if(digest_active(n->indigest)) {
|
||||
inpkt->len -= digest_length(n->indigest);
|
||||
if(!digest_verify(n->indigest, &inpkt->seqno, inpkt->len, (const char *)&inpkt->seqno + inpkt->len)) {
|
||||
logger(DEBUG_TRAFFIC, LOG_DEBUG, "Got unauthenticated packet from %s (%s)", n->name, n->hostname);
|
||||
return;
|
||||
}
|
||||
}
|
||||
/* Decrypt the packet */
|
||||
|
||||
if(cipher_active(&n->incipher)) {
|
||||
if(cipher_active(n->incipher)) {
|
||||
outpkt = pkt[nextpkt++];
|
||||
outlen = MAXSIZE;
|
||||
|
||||
if(!cipher_decrypt(&n->incipher, &inpkt->seqno, inpkt->len, &outpkt->seqno, &outlen, true)) {
|
||||
if(!cipher_decrypt(n->incipher, &inpkt->seqno, inpkt->len, &outpkt->seqno, &outlen, true)) {
|
||||
logger(DEBUG_TRAFFIC, LOG_DEBUG, "Error decrypting packet from %s (%s)", n->name, n->hostname);
|
||||
return;
|
||||
}
|
||||
|
@ -572,12 +615,22 @@ static void choose_broadcast_address(const node_t *n, const sockaddr_t **sa, int
|
|||
*sock = rand() % listen_sockets;
|
||||
|
||||
if(listen_socket[*sock].sa.sa.sa_family == AF_INET6) {
|
||||
broadcast_ipv6.in6.sin6_port = n->prevedge->address.in.sin_port;
|
||||
broadcast_ipv6.in6.sin6_scope_id = listen_socket[*sock].sa.in6.sin6_scope_id;
|
||||
*sa = &broadcast_ipv6;
|
||||
if(localdiscovery_address.sa.sa_family == AF_INET6) {
|
||||
localdiscovery_address.in6.sin6_port = n->prevedge->address.in.sin_port;
|
||||
*sa = &localdiscovery_address;
|
||||
} else {
|
||||
broadcast_ipv6.in6.sin6_port = n->prevedge->address.in.sin_port;
|
||||
broadcast_ipv6.in6.sin6_scope_id = listen_socket[*sock].sa.in6.sin6_scope_id;
|
||||
*sa = &broadcast_ipv6;
|
||||
}
|
||||
} else {
|
||||
broadcast_ipv4.in.sin_port = n->prevedge->address.in.sin_port;
|
||||
*sa = &broadcast_ipv4;
|
||||
if(localdiscovery_address.sa.sa_family == AF_INET) {
|
||||
localdiscovery_address.in.sin_port = n->prevedge->address.in.sin_port;
|
||||
*sa = &localdiscovery_address;
|
||||
} else {
|
||||
broadcast_ipv4.in.sin_port = n->prevedge->address.in.sin_port;
|
||||
*sa = &broadcast_ipv4;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -653,11 +706,11 @@ static void send_udppacket(node_t *n, vpn_packet_t *origpkt) {
|
|||
|
||||
/* Encrypt the packet */
|
||||
|
||||
if(cipher_active(&n->outcipher)) {
|
||||
if(cipher_active(n->outcipher)) {
|
||||
outpkt = pkt[nextpkt++];
|
||||
outlen = MAXSIZE;
|
||||
|
||||
if(!cipher_encrypt(&n->outcipher, &inpkt->seqno, inpkt->len, &outpkt->seqno, &outlen, true)) {
|
||||
if(!cipher_encrypt(n->outcipher, &inpkt->seqno, inpkt->len, &outpkt->seqno, &outlen, true)) {
|
||||
logger(DEBUG_TRAFFIC, LOG_ERR, "Error while encrypting packet to %s (%s)", n->name, n->hostname);
|
||||
goto end;
|
||||
}
|
||||
|
@ -668,9 +721,13 @@ static void send_udppacket(node_t *n, vpn_packet_t *origpkt) {
|
|||
|
||||
/* Add the message authentication code */
|
||||
|
||||
if(digest_active(&n->outdigest)) {
|
||||
digest_create(&n->outdigest, &inpkt->seqno, inpkt->len, (char *)&inpkt->seqno + inpkt->len);
|
||||
inpkt->len += digest_length(&n->outdigest);
|
||||
if(digest_active(n->outdigest)) {
|
||||
if(!digest_create(n->outdigest, &inpkt->seqno, inpkt->len, (char *)&inpkt->seqno + inpkt->len)) {
|
||||
logger(DEBUG_TRAFFIC, LOG_ERR, "Error while encrypting packet to %s (%s)", n->name, n->hostname);
|
||||
goto end;
|
||||
}
|
||||
|
||||
inpkt->len += digest_length(n->outdigest);
|
||||
}
|
||||
|
||||
/* Send the packet */
|
||||
|
@ -719,10 +776,12 @@ bool send_sptps_data(void *handle, uint8_t type, const char *data, size_t len) {
|
|||
b64encode(data, buf, len);
|
||||
/* If no valid key is known yet, send the packets using ANS_KEY requests,
|
||||
to ensure we get to learn the reflexive UDP address. */
|
||||
if(!to->status.validkey)
|
||||
return send_request(to->nexthop->connection, "%d %s %s %s -1 -1 -1 %d", ANS_KEY, myself->name, to->name, buf, myself->incompression);
|
||||
else
|
||||
if(!to->status.validkey) {
|
||||
to->incompression = myself->incompression;
|
||||
return send_request(to->nexthop->connection, "%d %s %s %s -1 -1 -1 %d", ANS_KEY, myself->name, to->name, buf, to->incompression);
|
||||
} else {
|
||||
return send_request(to->nexthop->connection, "%d %s %s %d %s", REQ_KEY, myself->name, to->name, REQ_SPTPS, buf);
|
||||
}
|
||||
}
|
||||
|
||||
/* Otherwise, send the packet via UDP */
|
||||
|
@ -902,7 +961,7 @@ void broadcast_packet(const node_t *from, vpn_packet_t *packet) {
|
|||
break;
|
||||
|
||||
for splay_each(node_t, n, node_tree)
|
||||
if(n->status.reachable && ((n->via == myself && n->nexthop == n) || n->via == n))
|
||||
if(n->status.reachable && n != myself && ((n->via == myself && n->nexthop == n) || n->via == n))
|
||||
send_packet(n, packet);
|
||||
break;
|
||||
|
||||
|
|
146
src/net_setup.c
146
src/net_setup.c
|
@ -58,25 +58,22 @@ char *scriptinterpreter;
|
|||
char *scriptextension;
|
||||
|
||||
bool node_read_ecdsa_public_key(node_t *n) {
|
||||
if(ecdsa_active(&n->ecdsa))
|
||||
if(ecdsa_active(n->ecdsa))
|
||||
return true;
|
||||
|
||||
splay_tree_t *config_tree;
|
||||
FILE *fp;
|
||||
char *pubname = NULL, *hcfname = NULL;
|
||||
char *pubname = NULL;
|
||||
char *p;
|
||||
bool result = false;
|
||||
|
||||
xasprintf(&hcfname, "%s" SLASH "hosts" SLASH "%s", confbase, n->name);
|
||||
|
||||
init_configuration(&config_tree);
|
||||
if(!read_config_file(config_tree, hcfname))
|
||||
if(!read_host_config(config_tree, n->name))
|
||||
goto exit;
|
||||
|
||||
/* First, check for simple ECDSAPublicKey statement */
|
||||
|
||||
if(get_config_string(lookup_config(config_tree, "ECDSAPublicKey"), &p)) {
|
||||
result = ecdsa_set_base64_public_key(&n->ecdsa, p);
|
||||
n->ecdsa = ecdsa_set_base64_public_key(p);
|
||||
free(p);
|
||||
goto exit;
|
||||
}
|
||||
|
@ -93,28 +90,35 @@ bool node_read_ecdsa_public_key(node_t *n) {
|
|||
goto exit;
|
||||
}
|
||||
|
||||
result = ecdsa_read_pem_public_key(&n->ecdsa, fp);
|
||||
n->ecdsa = ecdsa_read_pem_public_key(fp);
|
||||
fclose(fp);
|
||||
|
||||
exit:
|
||||
exit_configuration(&config_tree);
|
||||
free(hcfname);
|
||||
free(pubname);
|
||||
return result;
|
||||
return n->ecdsa;
|
||||
}
|
||||
|
||||
bool read_ecdsa_public_key(connection_t *c) {
|
||||
if(ecdsa_active(c->ecdsa))
|
||||
return true;
|
||||
|
||||
FILE *fp;
|
||||
char *fname;
|
||||
char *p;
|
||||
bool result;
|
||||
|
||||
if(!c->config_tree) {
|
||||
init_configuration(&c->config_tree);
|
||||
if(!read_host_config(c->config_tree, c->name))
|
||||
return false;
|
||||
}
|
||||
|
||||
/* First, check for simple ECDSAPublicKey statement */
|
||||
|
||||
if(get_config_string(lookup_config(c->config_tree, "ECDSAPublicKey"), &p)) {
|
||||
result = ecdsa_set_base64_public_key(&c->ecdsa, p);
|
||||
c->ecdsa = ecdsa_set_base64_public_key(p);
|
||||
free(p);
|
||||
return result;
|
||||
return c->ecdsa;
|
||||
}
|
||||
|
||||
/* Else, check for ECDSAPublicKeyFile statement and read it */
|
||||
|
@ -131,27 +135,29 @@ bool read_ecdsa_public_key(connection_t *c) {
|
|||
return false;
|
||||
}
|
||||
|
||||
result = ecdsa_read_pem_public_key(&c->ecdsa, fp);
|
||||
c->ecdsa = ecdsa_read_pem_public_key(fp);
|
||||
fclose(fp);
|
||||
|
||||
if(!result)
|
||||
if(!c->ecdsa)
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "Parsing ECDSA public key file `%s' failed.", fname);
|
||||
free(fname);
|
||||
return result;
|
||||
return c->ecdsa;
|
||||
}
|
||||
|
||||
bool read_rsa_public_key(connection_t *c) {
|
||||
if(ecdsa_active(c->ecdsa))
|
||||
return true;
|
||||
|
||||
FILE *fp;
|
||||
char *fname;
|
||||
char *n;
|
||||
bool result;
|
||||
|
||||
/* First, check for simple PublicKey statement */
|
||||
|
||||
if(get_config_string(lookup_config(c->config_tree, "PublicKey"), &n)) {
|
||||
result = rsa_set_hex_public_key(&c->rsa, n, "FFFF");
|
||||
c->rsa = rsa_set_hex_public_key(n, "FFFF");
|
||||
free(n);
|
||||
return result;
|
||||
return c->rsa;
|
||||
}
|
||||
|
||||
/* Else, check for PublicKeyFile statement and read it */
|
||||
|
@ -167,19 +173,18 @@ bool read_rsa_public_key(connection_t *c) {
|
|||
return false;
|
||||
}
|
||||
|
||||
result = rsa_read_pem_public_key(&c->rsa, fp);
|
||||
c->rsa = rsa_read_pem_public_key(fp);
|
||||
fclose(fp);
|
||||
|
||||
if(!result)
|
||||
if(!c->rsa)
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "Reading RSA public key file `%s' failed: %s", fname, strerror(errno));
|
||||
free(fname);
|
||||
return result;
|
||||
return c->rsa;
|
||||
}
|
||||
|
||||
static bool read_ecdsa_private_key(void) {
|
||||
FILE *fp;
|
||||
char *fname;
|
||||
bool result;
|
||||
|
||||
/* Check for PrivateKeyFile statement and read it */
|
||||
|
||||
|
@ -190,6 +195,8 @@ static bool read_ecdsa_private_key(void) {
|
|||
|
||||
if(!fp) {
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "Error reading ECDSA private key file `%s': %s", fname, strerror(errno));
|
||||
if(errno == ENOENT)
|
||||
logger(DEBUG_ALWAYS, LOG_INFO, "Create an ECDSA keypair with `tinc -n %s generate-ecdsa-keys'.", netname ?: ".");
|
||||
free(fname);
|
||||
return false;
|
||||
}
|
||||
|
@ -207,20 +214,43 @@ static bool read_ecdsa_private_key(void) {
|
|||
logger(DEBUG_ALWAYS, LOG_WARNING, "Warning: insecure file permissions for ECDSA private key file `%s'!", fname);
|
||||
#endif
|
||||
|
||||
result = ecdsa_read_pem_private_key(&myself->connection->ecdsa, fp);
|
||||
myself->connection->ecdsa = ecdsa_read_pem_private_key(fp);
|
||||
fclose(fp);
|
||||
|
||||
if(!result)
|
||||
if(!myself->connection->ecdsa)
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "Reading ECDSA private key file `%s' failed: %s", fname, strerror(errno));
|
||||
free(fname);
|
||||
return result;
|
||||
return myself->connection->ecdsa;
|
||||
}
|
||||
|
||||
static bool read_invitation_key(void) {
|
||||
FILE *fp;
|
||||
char *fname;
|
||||
|
||||
if(invitation_key) {
|
||||
ecdsa_free(invitation_key);
|
||||
invitation_key = NULL;
|
||||
}
|
||||
|
||||
xasprintf(&fname, "%s" SLASH "invitations" SLASH "ecdsa_key.priv", confbase);
|
||||
|
||||
fp = fopen(fname, "r");
|
||||
|
||||
if(fp) {
|
||||
invitation_key = ecdsa_read_pem_private_key(fp);
|
||||
fclose(fp);
|
||||
if(!invitation_key)
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "Reading ECDSA private key file `%s' failed: %s", fname, strerror(errno));
|
||||
}
|
||||
|
||||
free(fname);
|
||||
return invitation_key;
|
||||
}
|
||||
|
||||
static bool read_rsa_private_key(void) {
|
||||
FILE *fp;
|
||||
char *fname;
|
||||
char *n, *d;
|
||||
bool result;
|
||||
|
||||
/* First, check for simple PrivateKey statement */
|
||||
|
||||
|
@ -230,10 +260,10 @@ static bool read_rsa_private_key(void) {
|
|||
free(d);
|
||||
return false;
|
||||
}
|
||||
result = rsa_set_hex_private_key(&myself->connection->rsa, n, "FFFF", d);
|
||||
myself->connection->rsa = rsa_set_hex_private_key(n, "FFFF", d);
|
||||
free(n);
|
||||
free(d);
|
||||
return result;
|
||||
return myself->connection->rsa;
|
||||
}
|
||||
|
||||
/* Else, check for PrivateKeyFile statement and read it */
|
||||
|
@ -263,13 +293,13 @@ static bool read_rsa_private_key(void) {
|
|||
logger(DEBUG_ALWAYS, LOG_WARNING, "Warning: insecure file permissions for RSA private key file `%s'!", fname);
|
||||
#endif
|
||||
|
||||
result = rsa_read_pem_private_key(&myself->connection->rsa, fp);
|
||||
myself->connection->rsa = rsa_read_pem_private_key(fp);
|
||||
fclose(fp);
|
||||
|
||||
if(!result)
|
||||
if(!myself->connection->rsa)
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "Reading RSA private key file `%s' failed: %s", fname, strerror(errno));
|
||||
free(fname);
|
||||
return result;
|
||||
return myself->connection->rsa;
|
||||
}
|
||||
|
||||
static timeout_t keyexpire_timeout;
|
||||
|
@ -310,14 +340,10 @@ void load_all_subnets(void) {
|
|||
// continue;
|
||||
#endif
|
||||
|
||||
char *fname;
|
||||
xasprintf(&fname, "%s" SLASH "hosts" SLASH "%s", confbase, ent->d_name);
|
||||
|
||||
splay_tree_t *config_tree;
|
||||
init_configuration(&config_tree);
|
||||
read_config_options(config_tree, ent->d_name);
|
||||
read_config_file(config_tree, fname);
|
||||
free(fname);
|
||||
read_host_config(config_tree, ent->d_name);
|
||||
|
||||
if(!n) {
|
||||
n = new_node();
|
||||
|
@ -418,6 +444,7 @@ bool setup_myself_reloadable(void) {
|
|||
char *fmode = NULL;
|
||||
char *bmode = NULL;
|
||||
char *afname = NULL;
|
||||
char *address = NULL;
|
||||
char *space;
|
||||
bool choice;
|
||||
|
||||
|
@ -508,6 +535,16 @@ bool setup_myself_reloadable(void) {
|
|||
get_config_bool(lookup_config(config_tree, "DirectOnly"), &directonly);
|
||||
get_config_bool(lookup_config(config_tree, "LocalDiscovery"), &localdiscovery);
|
||||
|
||||
memset(&localdiscovery_address, 0, sizeof localdiscovery_address);
|
||||
if(get_config_string(lookup_config(config_tree, "LocalDiscoveryAddress"), &address)) {
|
||||
struct addrinfo *ai = str2addrinfo(address, myport, SOCK_DGRAM);
|
||||
free(address);
|
||||
if(!ai)
|
||||
return false;
|
||||
memcpy(&localdiscovery_address, ai->ai_addr, ai->ai_addrlen);
|
||||
}
|
||||
|
||||
|
||||
if(get_config_string(lookup_config(config_tree, "Mode"), &rmode)) {
|
||||
if(!strcasecmp(rmode, "router"))
|
||||
routing_mode = RMODE_ROUTER;
|
||||
|
@ -601,6 +638,8 @@ bool setup_myself_reloadable(void) {
|
|||
|
||||
get_config_bool(lookup_config(config_tree, "DisableBuggyPeers"), &disablebuggypeers);
|
||||
|
||||
read_invitation_key();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -609,7 +648,6 @@ bool setup_myself_reloadable(void) {
|
|||
*/
|
||||
static bool setup_myself(void) {
|
||||
char *name, *hostname, *cipher, *digest, *type;
|
||||
char *fname = NULL;
|
||||
char *address = NULL;
|
||||
|
||||
if(!(name = get_name())) {
|
||||
|
@ -621,10 +659,7 @@ static bool setup_myself(void) {
|
|||
myself->connection = new_connection();
|
||||
myself->name = name;
|
||||
myself->connection->name = xstrdup(name);
|
||||
xasprintf(&fname, "%s" SLASH "hosts" SLASH "%s", confbase, name);
|
||||
read_config_options(config_tree, name);
|
||||
read_config_file(config_tree, fname);
|
||||
free(fname);
|
||||
read_host_config(config_tree, name);
|
||||
|
||||
if(!get_config_string(lookup_config(config_tree, "Port"), &myport))
|
||||
myport = xstrdup("655");
|
||||
|
@ -676,7 +711,12 @@ static bool setup_myself(void) {
|
|||
get_config_bool(lookup_config(config_tree, "TunnelServer"), &tunnelserver);
|
||||
strictsubnets |= tunnelserver;
|
||||
|
||||
|
||||
if(get_config_int(lookup_config(config_tree, "MaxConnectionBurst"), &max_connection_burst)) {
|
||||
if(max_connection_burst <= 0) {
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "MaxConnectionBurst cannot be negative!");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if(get_config_int(lookup_config(config_tree, "UDPRcvBuf"), &udp_rcvbuf)) {
|
||||
if(udp_rcvbuf <= 0) {
|
||||
|
@ -707,7 +747,7 @@ static bool setup_myself(void) {
|
|||
if(!get_config_string(lookup_config(config_tree, "Cipher"), &cipher))
|
||||
cipher = xstrdup("blowfish");
|
||||
|
||||
if(!cipher_open_by_name(&myself->incipher, cipher)) {
|
||||
if(!(myself->incipher = cipher_open_by_name(cipher))) {
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "Unrecognized cipher type!");
|
||||
return false;
|
||||
}
|
||||
|
@ -730,7 +770,7 @@ static bool setup_myself(void) {
|
|||
if(!get_config_string(lookup_config(config_tree, "Digest"), &digest))
|
||||
digest = xstrdup("sha1");
|
||||
|
||||
if(!digest_open_by_name(&myself->indigest, digest, maclength)) {
|
||||
if(!(myself->indigest = digest_open_by_name(digest, maclength))) {
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "Unrecognized digest type!");
|
||||
return false;
|
||||
}
|
||||
|
@ -793,12 +833,11 @@ static bool setup_myself(void) {
|
|||
io_add(&device_io, handle_device_data, NULL, device_fd, IO_READ);
|
||||
|
||||
/* Run tinc-up script to further initialize the tap interface */
|
||||
char *envp[5];
|
||||
char *envp[5] = {NULL};
|
||||
xasprintf(&envp[0], "NETNAME=%s", netname ? : "");
|
||||
xasprintf(&envp[1], "DEVICE=%s", device ? : "");
|
||||
xasprintf(&envp[2], "INTERFACE=%s", iface ? : "");
|
||||
xasprintf(&envp[3], "NAME=%s", myself->name);
|
||||
envp[4] = NULL;
|
||||
|
||||
execute_script("tinc-up", envp);
|
||||
|
||||
|
@ -829,7 +868,12 @@ static bool setup_myself(void) {
|
|||
|
||||
unlink(unixsocketname);
|
||||
|
||||
if(bind(unix_fd, (struct sockaddr *)&sa, sizeof sa) < 0) {
|
||||
mode_t mask = umask(0);
|
||||
umask(mask | 077);
|
||||
int result = bind(unix_fd, (struct sockaddr *)&sa, sizeof sa);
|
||||
umask(mask);
|
||||
|
||||
if(result < 0) {
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "Could not bind UNIX socket to %s: %s", unixsocketname, sockstrerror(errno));
|
||||
return false;
|
||||
}
|
||||
|
@ -914,8 +958,7 @@ static bool setup_myself(void) {
|
|||
free(address);
|
||||
|
||||
if(err || !ai) {
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "System call `%s' failed: %s", "getaddrinfo",
|
||||
gai_strerror(err));
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "System call `%s' failed: %s", "getaddrinfo", err == EAI_SYSTEM ? strerror(err) : gai_strerror(err));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1031,12 +1074,11 @@ void close_network_connections(void) {
|
|||
close(unix_socket.fd);
|
||||
#endif
|
||||
|
||||
char *envp[5];
|
||||
char *envp[5] = {NULL};
|
||||
xasprintf(&envp[0], "NETNAME=%s", netname ? : "");
|
||||
xasprintf(&envp[1], "DEVICE=%s", device ? : "");
|
||||
xasprintf(&envp[2], "INTERFACE=%s", iface ? : "");
|
||||
xasprintf(&envp[3], "NAME=%s", myself->name);
|
||||
envp[4] = NULL;
|
||||
|
||||
exit_requests();
|
||||
exit_edges();
|
||||
|
|
|
@ -45,6 +45,7 @@ int maxtimeout = 900;
|
|||
int seconds_till_retry = 5;
|
||||
int udp_rcvbuf = 0;
|
||||
int udp_sndbuf = 0;
|
||||
int max_connection_burst = 100;
|
||||
|
||||
listen_socket_t listen_socket[MAXSOCKETS];
|
||||
int listen_sockets;
|
||||
|
@ -561,6 +562,47 @@ void handle_new_meta_connection(void *data, int flags) {
|
|||
|
||||
sockaddrunmap(&sa);
|
||||
|
||||
// Check if we get many connections from the same host
|
||||
|
||||
static sockaddr_t prev_sa;
|
||||
static time_t prev_time;
|
||||
static int tarpit = -1;
|
||||
|
||||
if(tarpit >= 0) {
|
||||
closesocket(tarpit);
|
||||
tarpit = -1;
|
||||
}
|
||||
|
||||
if(prev_time == now.tv_sec && !sockaddrcmp_noport(&sa, &prev_sa)) {
|
||||
// if so, keep the connection open but ignore it completely.
|
||||
tarpit = fd;
|
||||
return;
|
||||
}
|
||||
|
||||
memcpy(&prev_sa, &sa, sizeof sa);
|
||||
prev_time = now.tv_sec;
|
||||
|
||||
// Check if we get many connections from different hosts
|
||||
|
||||
static int connection_burst;
|
||||
static int connection_burst_time;
|
||||
|
||||
if(now.tv_sec - connection_burst_time > connection_burst)
|
||||
connection_burst = 0;
|
||||
else
|
||||
connection_burst -= now.tv_sec - connection_burst_time;
|
||||
|
||||
connection_burst_time = now.tv_sec;
|
||||
connection_burst++;
|
||||
|
||||
if(connection_burst >= max_connection_burst) {
|
||||
connection_burst = max_connection_burst;
|
||||
tarpit = fd;
|
||||
return;
|
||||
}
|
||||
|
||||
// Accept the new connection
|
||||
|
||||
c = new_connection();
|
||||
c->name = xstrdup("<unknown>");
|
||||
c->outcipher = myself->connection->outcipher;
|
||||
|
@ -674,7 +716,7 @@ void try_outgoing_connections(void) {
|
|||
}
|
||||
|
||||
if(!found) {
|
||||
outgoing_t *outgoing = xmalloc_and_zero(sizeof *outgoing);
|
||||
outgoing_t *outgoing = xzalloc(sizeof *outgoing);
|
||||
outgoing->name = name;
|
||||
list_insert_tail(outgoing_list, outgoing);
|
||||
setup_outgoing_connection(outgoing);
|
||||
|
|
11
src/netutl.c
11
src/netutl.c
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
netutl.c -- some supporting network utility code
|
||||
Copyright (C) 1998-2005 Ivo Timmermans
|
||||
2000-2012 Guus Sliepen <guus@tinc-vpn.org>
|
||||
2000-2013 Guus Sliepen <guus@tinc-vpn.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -42,8 +42,7 @@ struct addrinfo *str2addrinfo(const char *address, const char *service, int sock
|
|||
err = getaddrinfo(address, service, &hint, &ai);
|
||||
|
||||
if(err) {
|
||||
logger(DEBUG_ALWAYS, LOG_WARNING, "Error looking up %s port %s: %s", address,
|
||||
service, gai_strerror(err));
|
||||
logger(DEBUG_ALWAYS, LOG_WARNING, "Error looking up %s port %s: %s", address, service, err == EAI_SYSTEM ? strerror(errno) : gai_strerror(err));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -92,8 +91,7 @@ void sockaddr2str(const sockaddr_t *sa, char **addrstr, char **portstr) {
|
|||
err = getnameinfo(&sa->sa, SALEN(sa->sa), address, sizeof address, port, sizeof port, NI_NUMERICHOST | NI_NUMERICSERV);
|
||||
|
||||
if(err) {
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "Error while translating addresses: %s",
|
||||
gai_strerror(err));
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "Error while translating addresses: %s", err == EAI_SYSTEM ? strerror(errno) : gai_strerror(err));
|
||||
abort();
|
||||
}
|
||||
|
||||
|
@ -122,8 +120,7 @@ char *sockaddr2hostname(const sockaddr_t *sa) {
|
|||
err = getnameinfo(&sa->sa, SALEN(sa->sa), address, sizeof address, port, sizeof port,
|
||||
hostnames ? 0 : (NI_NUMERICHOST | NI_NUMERICSERV));
|
||||
if(err) {
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "Error while looking up hostname: %s",
|
||||
gai_strerror(err));
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "Error while looking up hostname: %s", err == EAI_SYSTEM ? strerror(errno) : gai_strerror(err));
|
||||
}
|
||||
|
||||
xasprintf(&str, "%s port %s", address, port);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
netutl.h -- header file for netutl.c
|
||||
Copyright (C) 1998-2005 Ivo Timmermans
|
||||
2000-2012 Guus Sliepen <guus@tinc-vpn.org>
|
||||
2000-2013 Guus Sliepen <guus@tinc-vpn.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -25,10 +25,10 @@
|
|||
|
||||
extern bool hostnames;
|
||||
|
||||
extern struct addrinfo *str2addrinfo(const char *, const char *, int);
|
||||
extern struct addrinfo *str2addrinfo(const char *, const char *, int) __attribute__ ((__malloc__));
|
||||
extern sockaddr_t str2sockaddr(const char *, const char *);
|
||||
extern void sockaddr2str(const sockaddr_t *, char **, char **);
|
||||
extern char *sockaddr2hostname(const sockaddr_t *);
|
||||
extern char *sockaddr2hostname(const sockaddr_t *) __attribute__ ((__malloc__));
|
||||
extern int sockaddrcmp(const sockaddr_t *, const sockaddr_t *);
|
||||
extern int sockaddrcmp_noport(const sockaddr_t *, const sockaddr_t *);
|
||||
extern void sockaddrunmap(sockaddr_t *);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue