Compare commits
No commits in common. "master" and "debian/1.0.19-2" have entirely different histories.
master
...
debian/1.0
158 changed files with 24812 additions and 21047 deletions
2
COPYING
2
COPYING
|
|
@ -1,4 +1,4 @@
|
||||||
Copyright (C) 1998-2019 Ivo Timmermans, Guus Sliepen and others.
|
Copyright (C) 1998-2012 Ivo Timmermans, Guus Sliepen and others.
|
||||||
See the AUTHORS file for a complete list.
|
See the AUTHORS file for a complete list.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it under
|
This program is free software; you can redistribute it and/or modify it under
|
||||||
|
|
|
||||||
320
INSTALL
320
INSTALL
|
|
@ -1,8 +1,8 @@
|
||||||
Installation Instructions
|
Installation Instructions
|
||||||
*************************
|
*************************
|
||||||
|
|
||||||
Copyright (C) 1994-1996, 1999-2002, 2004-2016 Free Software
|
Copyright (C) 1994-1996, 1999-2002, 2004-2011 Free Software Foundation,
|
||||||
Foundation, Inc.
|
Inc.
|
||||||
|
|
||||||
Copying and distribution of this file, with or without modification,
|
Copying and distribution of this file, with or without modification,
|
||||||
are permitted in any medium without royalty provided the copyright
|
are permitted in any medium without royalty provided the copyright
|
||||||
|
|
@ -12,96 +12,97 @@ without warranty of any kind.
|
||||||
Basic Installation
|
Basic Installation
|
||||||
==================
|
==================
|
||||||
|
|
||||||
Briefly, the shell command './configure && make && make install'
|
Briefly, the shell commands `./configure; make; make install' should
|
||||||
should configure, build, and install this package. The following
|
configure, build, and install this package. The following
|
||||||
more-detailed instructions are generic; see the 'README' file for
|
more-detailed instructions are generic; see the `README' file for
|
||||||
instructions specific to this package. Some packages provide this
|
instructions specific to this package. Some packages provide this
|
||||||
'INSTALL' file but do not implement all of the features documented
|
`INSTALL' file but do not implement all of the features documented
|
||||||
below. The lack of an optional feature in a given package is not
|
below. The lack of an optional feature in a given package is not
|
||||||
necessarily a bug. More recommendations for GNU packages can be found
|
necessarily a bug. More recommendations for GNU packages can be found
|
||||||
in *note Makefile Conventions: (standards)Makefile Conventions.
|
in *note Makefile Conventions: (standards)Makefile Conventions.
|
||||||
|
|
||||||
The 'configure' shell script attempts to guess correct values for
|
The `configure' shell script attempts to guess correct values for
|
||||||
various system-dependent variables used during compilation. It uses
|
various system-dependent variables used during compilation. It uses
|
||||||
those values to create a 'Makefile' in each directory of the package.
|
those values to create a `Makefile' in each directory of the package.
|
||||||
It may also create one or more '.h' files containing system-dependent
|
It may also create one or more `.h' files containing system-dependent
|
||||||
definitions. Finally, it creates a shell script 'config.status' that
|
definitions. Finally, it creates a shell script `config.status' that
|
||||||
you can run in the future to recreate the current configuration, and a
|
you can run in the future to recreate the current configuration, and a
|
||||||
file 'config.log' containing compiler output (useful mainly for
|
file `config.log' containing compiler output (useful mainly for
|
||||||
debugging 'configure').
|
debugging `configure').
|
||||||
|
|
||||||
It can also use an optional file (typically called 'config.cache' and
|
It can also use an optional file (typically called `config.cache'
|
||||||
enabled with '--cache-file=config.cache' or simply '-C') that saves the
|
and enabled with `--cache-file=config.cache' or simply `-C') that saves
|
||||||
results of its tests to speed up reconfiguring. Caching is disabled by
|
the results of its tests to speed up reconfiguring. Caching is
|
||||||
default to prevent problems with accidental use of stale cache files.
|
disabled by default to prevent problems with accidental use of stale
|
||||||
|
cache files.
|
||||||
|
|
||||||
If you need to do unusual things to compile the package, please try
|
If you need to do unusual things to compile the package, please try
|
||||||
to figure out how 'configure' could check whether to do them, and mail
|
to figure out how `configure' could check whether to do them, and mail
|
||||||
diffs or instructions to the address given in the 'README' so they can
|
diffs or instructions to the address given in the `README' so they can
|
||||||
be considered for the next release. If you are using the cache, and at
|
be considered for the next release. If you are using the cache, and at
|
||||||
some point 'config.cache' contains results you don't want to keep, you
|
some point `config.cache' contains results you don't want to keep, you
|
||||||
may remove or edit it.
|
may remove or edit it.
|
||||||
|
|
||||||
The file 'configure.ac' (or 'configure.in') is used to create
|
The file `configure.ac' (or `configure.in') is used to create
|
||||||
'configure' by a program called 'autoconf'. You need 'configure.ac' if
|
`configure' by a program called `autoconf'. You need `configure.ac' if
|
||||||
you want to change it or regenerate 'configure' using a newer version of
|
you want to change it or regenerate `configure' using a newer version
|
||||||
'autoconf'.
|
of `autoconf'.
|
||||||
|
|
||||||
The simplest way to compile this package is:
|
The simplest way to compile this package is:
|
||||||
|
|
||||||
1. 'cd' to the directory containing the package's source code and type
|
1. `cd' to the directory containing the package's source code and type
|
||||||
'./configure' to configure the package for your system.
|
`./configure' to configure the package for your system.
|
||||||
|
|
||||||
Running 'configure' might take a while. While running, it prints
|
Running `configure' might take a while. While running, it prints
|
||||||
some messages telling which features it is checking for.
|
some messages telling which features it is checking for.
|
||||||
|
|
||||||
2. Type 'make' to compile the package.
|
2. Type `make' to compile the package.
|
||||||
|
|
||||||
3. Optionally, type 'make check' to run any self-tests that come with
|
3. Optionally, type `make check' to run any self-tests that come with
|
||||||
the package, generally using the just-built uninstalled binaries.
|
the package, generally using the just-built uninstalled binaries.
|
||||||
|
|
||||||
4. Type 'make install' to install the programs and any data files and
|
4. Type `make install' to install the programs and any data files and
|
||||||
documentation. When installing into a prefix owned by root, it is
|
documentation. When installing into a prefix owned by root, it is
|
||||||
recommended that the package be configured and built as a regular
|
recommended that the package be configured and built as a regular
|
||||||
user, and only the 'make install' phase executed with root
|
user, and only the `make install' phase executed with root
|
||||||
privileges.
|
privileges.
|
||||||
|
|
||||||
5. Optionally, type 'make installcheck' to repeat any self-tests, but
|
5. Optionally, type `make installcheck' to repeat any self-tests, but
|
||||||
this time using the binaries in their final installed location.
|
this time using the binaries in their final installed location.
|
||||||
This target does not install anything. Running this target as a
|
This target does not install anything. Running this target as a
|
||||||
regular user, particularly if the prior 'make install' required
|
regular user, particularly if the prior `make install' required
|
||||||
root privileges, verifies that the installation completed
|
root privileges, verifies that the installation completed
|
||||||
correctly.
|
correctly.
|
||||||
|
|
||||||
6. You can remove the program binaries and object files from the
|
6. You can remove the program binaries and object files from the
|
||||||
source code directory by typing 'make clean'. To also remove the
|
source code directory by typing `make clean'. To also remove the
|
||||||
files that 'configure' created (so you can compile the package for
|
files that `configure' created (so you can compile the package for
|
||||||
a different kind of computer), type 'make distclean'. There is
|
a different kind of computer), type `make distclean'. There is
|
||||||
also a 'make maintainer-clean' target, but that is intended mainly
|
also a `make maintainer-clean' target, but that is intended mainly
|
||||||
for the package's developers. If you use it, you may have to get
|
for the package's developers. If you use it, you may have to get
|
||||||
all sorts of other programs in order to regenerate files that came
|
all sorts of other programs in order to regenerate files that came
|
||||||
with the distribution.
|
with the distribution.
|
||||||
|
|
||||||
7. Often, you can also type 'make uninstall' to remove the installed
|
7. Often, you can also type `make uninstall' to remove the installed
|
||||||
files again. In practice, not all packages have tested that
|
files again. In practice, not all packages have tested that
|
||||||
uninstallation works correctly, even though it is required by the
|
uninstallation works correctly, even though it is required by the
|
||||||
GNU Coding Standards.
|
GNU Coding Standards.
|
||||||
|
|
||||||
8. Some packages, particularly those that use Automake, provide 'make
|
8. Some packages, particularly those that use Automake, provide `make
|
||||||
distcheck', which can by used by developers to test that all other
|
distcheck', which can by used by developers to test that all other
|
||||||
targets like 'make install' and 'make uninstall' work correctly.
|
targets like `make install' and `make uninstall' work correctly.
|
||||||
This target is generally not run by end users.
|
This target is generally not run by end users.
|
||||||
|
|
||||||
Compilers and Options
|
Compilers and Options
|
||||||
=====================
|
=====================
|
||||||
|
|
||||||
Some systems require unusual options for compilation or linking that
|
Some systems require unusual options for compilation or linking that
|
||||||
the 'configure' script does not know about. Run './configure --help'
|
the `configure' script does not know about. Run `./configure --help'
|
||||||
for details on some of the pertinent environment variables.
|
for details on some of the pertinent environment variables.
|
||||||
|
|
||||||
You can give 'configure' initial values for configuration parameters
|
You can give `configure' initial values for configuration parameters
|
||||||
by setting variables in the command line or in the environment. Here is
|
by setting variables in the command line or in the environment. Here
|
||||||
an example:
|
is an example:
|
||||||
|
|
||||||
./configure CC=c99 CFLAGS=-g LIBS=-lposix
|
./configure CC=c99 CFLAGS=-g LIBS=-lposix
|
||||||
|
|
||||||
|
|
@ -112,21 +113,21 @@ Compiling For Multiple Architectures
|
||||||
|
|
||||||
You can compile the package for more than one kind of computer at the
|
You can compile the package for more than one kind of computer at the
|
||||||
same time, by placing the object files for each architecture in their
|
same time, by placing the object files for each architecture in their
|
||||||
own directory. To do this, you can use GNU 'make'. 'cd' to the
|
own directory. To do this, you can use GNU `make'. `cd' to the
|
||||||
directory where you want the object files and executables to go and run
|
directory where you want the object files and executables to go and run
|
||||||
the 'configure' script. 'configure' automatically checks for the source
|
the `configure' script. `configure' automatically checks for the
|
||||||
code in the directory that 'configure' is in and in '..'. This is known
|
source code in the directory that `configure' is in and in `..'. This
|
||||||
as a "VPATH" build.
|
is known as a "VPATH" build.
|
||||||
|
|
||||||
With a non-GNU 'make', it is safer to compile the package for one
|
With a non-GNU `make', it is safer to compile the package for one
|
||||||
architecture at a time in the source code directory. After you have
|
architecture at a time in the source code directory. After you have
|
||||||
installed the package for one architecture, use 'make distclean' before
|
installed the package for one architecture, use `make distclean' before
|
||||||
reconfiguring for another architecture.
|
reconfiguring for another architecture.
|
||||||
|
|
||||||
On MacOS X 10.5 and later systems, you can create libraries and
|
On MacOS X 10.5 and later systems, you can create libraries and
|
||||||
executables that work on multiple system types--known as "fat" or
|
executables that work on multiple system types--known as "fat" or
|
||||||
"universal" binaries--by specifying multiple '-arch' options to the
|
"universal" binaries--by specifying multiple `-arch' options to the
|
||||||
compiler but only a single '-arch' option to the preprocessor. Like
|
compiler but only a single `-arch' option to the preprocessor. Like
|
||||||
this:
|
this:
|
||||||
|
|
||||||
./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
|
./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
|
||||||
|
|
@ -135,104 +136,105 @@ this:
|
||||||
|
|
||||||
This is not guaranteed to produce working output in all cases, you
|
This is not guaranteed to produce working output in all cases, you
|
||||||
may have to build one architecture at a time and combine the results
|
may have to build one architecture at a time and combine the results
|
||||||
using the 'lipo' tool if you have problems.
|
using the `lipo' tool if you have problems.
|
||||||
|
|
||||||
Installation Names
|
Installation Names
|
||||||
==================
|
==================
|
||||||
|
|
||||||
By default, 'make install' installs the package's commands under
|
By default, `make install' installs the package's commands under
|
||||||
'/usr/local/bin', include files under '/usr/local/include', etc. You
|
`/usr/local/bin', include files under `/usr/local/include', etc. You
|
||||||
can specify an installation prefix other than '/usr/local' by giving
|
can specify an installation prefix other than `/usr/local' by giving
|
||||||
'configure' the option '--prefix=PREFIX', where PREFIX must be an
|
`configure' the option `--prefix=PREFIX', where PREFIX must be an
|
||||||
absolute file name.
|
absolute file name.
|
||||||
|
|
||||||
You can specify separate installation prefixes for
|
You can specify separate installation prefixes for
|
||||||
architecture-specific files and architecture-independent files. If you
|
architecture-specific files and architecture-independent files. If you
|
||||||
pass the option '--exec-prefix=PREFIX' to 'configure', the package uses
|
pass the option `--exec-prefix=PREFIX' to `configure', the package uses
|
||||||
PREFIX as the prefix for installing programs and libraries.
|
PREFIX as the prefix for installing programs and libraries.
|
||||||
Documentation and other data files still use the regular prefix.
|
Documentation and other data files still use the regular prefix.
|
||||||
|
|
||||||
In addition, if you use an unusual directory layout you can give
|
In addition, if you use an unusual directory layout you can give
|
||||||
options like '--bindir=DIR' to specify different values for particular
|
options like `--bindir=DIR' to specify different values for particular
|
||||||
kinds of files. Run 'configure --help' for a list of the directories
|
kinds of files. Run `configure --help' for a list of the directories
|
||||||
you can set and what kinds of files go in them. In general, the default
|
you can set and what kinds of files go in them. In general, the
|
||||||
for these options is expressed in terms of '${prefix}', so that
|
default for these options is expressed in terms of `${prefix}', so that
|
||||||
specifying just '--prefix' will affect all of the other directory
|
specifying just `--prefix' will affect all of the other directory
|
||||||
specifications that were not explicitly provided.
|
specifications that were not explicitly provided.
|
||||||
|
|
||||||
The most portable way to affect installation locations is to pass the
|
The most portable way to affect installation locations is to pass the
|
||||||
correct locations to 'configure'; however, many packages provide one or
|
correct locations to `configure'; however, many packages provide one or
|
||||||
both of the following shortcuts of passing variable assignments to the
|
both of the following shortcuts of passing variable assignments to the
|
||||||
'make install' command line to change installation locations without
|
`make install' command line to change installation locations without
|
||||||
having to reconfigure or recompile.
|
having to reconfigure or recompile.
|
||||||
|
|
||||||
The first method involves providing an override variable for each
|
The first method involves providing an override variable for each
|
||||||
affected directory. For example, 'make install
|
affected directory. For example, `make install
|
||||||
prefix=/alternate/directory' will choose an alternate location for all
|
prefix=/alternate/directory' will choose an alternate location for all
|
||||||
directory configuration variables that were expressed in terms of
|
directory configuration variables that were expressed in terms of
|
||||||
'${prefix}'. Any directories that were specified during 'configure',
|
`${prefix}'. Any directories that were specified during `configure',
|
||||||
but not in terms of '${prefix}', must each be overridden at install time
|
but not in terms of `${prefix}', must each be overridden at install
|
||||||
for the entire installation to be relocated. The approach of makefile
|
time for the entire installation to be relocated. The approach of
|
||||||
variable overrides for each directory variable is required by the GNU
|
makefile variable overrides for each directory variable is required by
|
||||||
Coding Standards, and ideally causes no recompilation. However, some
|
the GNU Coding Standards, and ideally causes no recompilation.
|
||||||
platforms have known limitations with the semantics of shared libraries
|
However, some platforms have known limitations with the semantics of
|
||||||
that end up requiring recompilation when using this method, particularly
|
shared libraries that end up requiring recompilation when using this
|
||||||
noticeable in packages that use GNU Libtool.
|
method, particularly noticeable in packages that use GNU Libtool.
|
||||||
|
|
||||||
The second method involves providing the 'DESTDIR' variable. For
|
The second method involves providing the `DESTDIR' variable. For
|
||||||
example, 'make install DESTDIR=/alternate/directory' will prepend
|
example, `make install DESTDIR=/alternate/directory' will prepend
|
||||||
'/alternate/directory' before all installation names. The approach of
|
`/alternate/directory' before all installation names. The approach of
|
||||||
'DESTDIR' overrides is not required by the GNU Coding Standards, and
|
`DESTDIR' overrides is not required by the GNU Coding Standards, and
|
||||||
does not work on platforms that have drive letters. On the other hand,
|
does not work on platforms that have drive letters. On the other hand,
|
||||||
it does better at avoiding recompilation issues, and works well even
|
it does better at avoiding recompilation issues, and works well even
|
||||||
when some directory options were not specified in terms of '${prefix}'
|
when some directory options were not specified in terms of `${prefix}'
|
||||||
at 'configure' time.
|
at `configure' time.
|
||||||
|
|
||||||
Optional Features
|
Optional Features
|
||||||
=================
|
=================
|
||||||
|
|
||||||
If the package supports it, you can cause programs to be installed
|
If the package supports it, you can cause programs to be installed
|
||||||
with an extra prefix or suffix on their names by giving 'configure' the
|
with an extra prefix or suffix on their names by giving `configure' the
|
||||||
option '--program-prefix=PREFIX' or '--program-suffix=SUFFIX'.
|
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
|
||||||
|
|
||||||
Some packages pay attention to '--enable-FEATURE' options to
|
Some packages pay attention to `--enable-FEATURE' options to
|
||||||
'configure', where FEATURE indicates an optional part of the package.
|
`configure', where FEATURE indicates an optional part of the package.
|
||||||
They may also pay attention to '--with-PACKAGE' options, where PACKAGE
|
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
|
||||||
is something like 'gnu-as' or 'x' (for the X Window System). The
|
is something like `gnu-as' or `x' (for the X Window System). The
|
||||||
'README' should mention any '--enable-' and '--with-' options that the
|
`README' should mention any `--enable-' and `--with-' options that the
|
||||||
package recognizes.
|
package recognizes.
|
||||||
|
|
||||||
For packages that use the X Window System, 'configure' can usually
|
For packages that use the X Window System, `configure' can usually
|
||||||
find the X include and library files automatically, but if it doesn't,
|
find the X include and library files automatically, but if it doesn't,
|
||||||
you can use the 'configure' options '--x-includes=DIR' and
|
you can use the `configure' options `--x-includes=DIR' and
|
||||||
'--x-libraries=DIR' to specify their locations.
|
`--x-libraries=DIR' to specify their locations.
|
||||||
|
|
||||||
Some packages offer the ability to configure how verbose the
|
Some packages offer the ability to configure how verbose the
|
||||||
execution of 'make' will be. For these packages, running './configure
|
execution of `make' will be. For these packages, running `./configure
|
||||||
--enable-silent-rules' sets the default to minimal output, which can be
|
--enable-silent-rules' sets the default to minimal output, which can be
|
||||||
overridden with 'make V=1'; while running './configure
|
overridden with `make V=1'; while running `./configure
|
||||||
--disable-silent-rules' sets the default to verbose, which can be
|
--disable-silent-rules' sets the default to verbose, which can be
|
||||||
overridden with 'make V=0'.
|
overridden with `make V=0'.
|
||||||
|
|
||||||
Particular systems
|
Particular systems
|
||||||
==================
|
==================
|
||||||
|
|
||||||
On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC
|
On HP-UX, the default C compiler is not ANSI C compatible. If GNU
|
||||||
is not installed, it is recommended to use the following options in
|
CC is not installed, it is recommended to use the following options in
|
||||||
order to use an ANSI C compiler:
|
order to use an ANSI C compiler:
|
||||||
|
|
||||||
./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
|
./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
|
||||||
|
|
||||||
and if that doesn't work, install pre-built binaries of GCC for HP-UX.
|
and if that doesn't work, install pre-built binaries of GCC for HP-UX.
|
||||||
|
|
||||||
HP-UX 'make' updates targets which have the same time stamps as their
|
HP-UX `make' updates targets which have the same time stamps as
|
||||||
prerequisites, which makes it generally unusable when shipped generated
|
their prerequisites, which makes it generally unusable when shipped
|
||||||
files such as 'configure' are involved. Use GNU 'make' instead.
|
generated files such as `configure' are involved. Use GNU `make'
|
||||||
|
instead.
|
||||||
|
|
||||||
On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
|
On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
|
||||||
parse its '<wchar.h>' header file. The option '-nodtk' can be used as a
|
parse its `<wchar.h>' header file. The option `-nodtk' can be used as
|
||||||
workaround. If GNU CC is not installed, it is therefore recommended to
|
a workaround. If GNU CC is not installed, it is therefore recommended
|
||||||
try
|
to try
|
||||||
|
|
||||||
./configure CC="cc"
|
./configure CC="cc"
|
||||||
|
|
||||||
|
|
@ -240,26 +242,26 @@ and if that doesn't work, try
|
||||||
|
|
||||||
./configure CC="cc -nodtk"
|
./configure CC="cc -nodtk"
|
||||||
|
|
||||||
On Solaris, don't put '/usr/ucb' early in your 'PATH'. This
|
On Solaris, don't put `/usr/ucb' early in your `PATH'. This
|
||||||
directory contains several dysfunctional programs; working variants of
|
directory contains several dysfunctional programs; working variants of
|
||||||
these programs are available in '/usr/bin'. So, if you need '/usr/ucb'
|
these programs are available in `/usr/bin'. So, if you need `/usr/ucb'
|
||||||
in your 'PATH', put it _after_ '/usr/bin'.
|
in your `PATH', put it _after_ `/usr/bin'.
|
||||||
|
|
||||||
On Haiku, software installed for all users goes in '/boot/common',
|
On Haiku, software installed for all users goes in `/boot/common',
|
||||||
not '/usr/local'. It is recommended to use the following options:
|
not `/usr/local'. It is recommended to use the following options:
|
||||||
|
|
||||||
./configure --prefix=/boot/common
|
./configure --prefix=/boot/common
|
||||||
|
|
||||||
Specifying the System Type
|
Specifying the System Type
|
||||||
==========================
|
==========================
|
||||||
|
|
||||||
There may be some features 'configure' cannot figure out
|
There may be some features `configure' cannot figure out
|
||||||
automatically, but needs to determine by the type of machine the package
|
automatically, but needs to determine by the type of machine the package
|
||||||
will run on. Usually, assuming the package is built to be run on the
|
will run on. Usually, assuming the package is built to be run on the
|
||||||
_same_ architectures, 'configure' can figure that out, but if it prints
|
_same_ architectures, `configure' can figure that out, but if it prints
|
||||||
a message saying it cannot guess the machine type, give it the
|
a message saying it cannot guess the machine type, give it the
|
||||||
'--build=TYPE' option. TYPE can either be a short name for the system
|
`--build=TYPE' option. TYPE can either be a short name for the system
|
||||||
type, such as 'sun4', or a canonical name which has the form:
|
type, such as `sun4', or a canonical name which has the form:
|
||||||
|
|
||||||
CPU-COMPANY-SYSTEM
|
CPU-COMPANY-SYSTEM
|
||||||
|
|
||||||
|
|
@ -268,101 +270,101 @@ where SYSTEM can have one of these forms:
|
||||||
OS
|
OS
|
||||||
KERNEL-OS
|
KERNEL-OS
|
||||||
|
|
||||||
See the file 'config.sub' for the possible values of each field. If
|
See the file `config.sub' for the possible values of each field. If
|
||||||
'config.sub' isn't included in this package, then this package doesn't
|
`config.sub' isn't included in this package, then this package doesn't
|
||||||
need to know the machine type.
|
need to know the machine type.
|
||||||
|
|
||||||
If you are _building_ compiler tools for cross-compiling, you should
|
If you are _building_ compiler tools for cross-compiling, you should
|
||||||
use the option '--target=TYPE' to select the type of system they will
|
use the option `--target=TYPE' to select the type of system they will
|
||||||
produce code for.
|
produce code for.
|
||||||
|
|
||||||
If you want to _use_ a cross compiler, that generates code for a
|
If you want to _use_ a cross compiler, that generates code for a
|
||||||
platform different from the build platform, you should specify the
|
platform different from the build platform, you should specify the
|
||||||
"host" platform (i.e., that on which the generated programs will
|
"host" platform (i.e., that on which the generated programs will
|
||||||
eventually be run) with '--host=TYPE'.
|
eventually be run) with `--host=TYPE'.
|
||||||
|
|
||||||
Sharing Defaults
|
Sharing Defaults
|
||||||
================
|
================
|
||||||
|
|
||||||
If you want to set default values for 'configure' scripts to share,
|
If you want to set default values for `configure' scripts to share,
|
||||||
you can create a site shell script called 'config.site' that gives
|
you can create a site shell script called `config.site' that gives
|
||||||
default values for variables like 'CC', 'cache_file', and 'prefix'.
|
default values for variables like `CC', `cache_file', and `prefix'.
|
||||||
'configure' looks for 'PREFIX/share/config.site' if it exists, then
|
`configure' looks for `PREFIX/share/config.site' if it exists, then
|
||||||
'PREFIX/etc/config.site' if it exists. Or, you can set the
|
`PREFIX/etc/config.site' if it exists. Or, you can set the
|
||||||
'CONFIG_SITE' environment variable to the location of the site script.
|
`CONFIG_SITE' environment variable to the location of the site script.
|
||||||
A warning: not all 'configure' scripts look for a site script.
|
A warning: not all `configure' scripts look for a site script.
|
||||||
|
|
||||||
Defining Variables
|
Defining Variables
|
||||||
==================
|
==================
|
||||||
|
|
||||||
Variables not defined in a site shell script can be set in the
|
Variables not defined in a site shell script can be set in the
|
||||||
environment passed to 'configure'. However, some packages may run
|
environment passed to `configure'. However, some packages may run
|
||||||
configure again during the build, and the customized values of these
|
configure again during the build, and the customized values of these
|
||||||
variables may be lost. In order to avoid this problem, you should set
|
variables may be lost. In order to avoid this problem, you should set
|
||||||
them in the 'configure' command line, using 'VAR=value'. For example:
|
them in the `configure' command line, using `VAR=value'. For example:
|
||||||
|
|
||||||
./configure CC=/usr/local2/bin/gcc
|
./configure CC=/usr/local2/bin/gcc
|
||||||
|
|
||||||
causes the specified 'gcc' to be used as the C compiler (unless it is
|
causes the specified `gcc' to be used as the C compiler (unless it is
|
||||||
overridden in the site shell script).
|
overridden in the site shell script).
|
||||||
|
|
||||||
Unfortunately, this technique does not work for 'CONFIG_SHELL' due to an
|
Unfortunately, this technique does not work for `CONFIG_SHELL' due to
|
||||||
Autoconf limitation. Until the limitation is lifted, you can use this
|
an Autoconf bug. Until the bug is fixed you can use this workaround:
|
||||||
workaround:
|
|
||||||
|
|
||||||
CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash
|
CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
|
||||||
|
|
||||||
'configure' Invocation
|
`configure' Invocation
|
||||||
======================
|
======================
|
||||||
|
|
||||||
'configure' recognizes the following options to control how it
|
`configure' recognizes the following options to control how it
|
||||||
operates.
|
operates.
|
||||||
|
|
||||||
'--help'
|
`--help'
|
||||||
'-h'
|
`-h'
|
||||||
Print a summary of all of the options to 'configure', and exit.
|
Print a summary of all of the options to `configure', and exit.
|
||||||
|
|
||||||
'--help=short'
|
`--help=short'
|
||||||
'--help=recursive'
|
`--help=recursive'
|
||||||
Print a summary of the options unique to this package's
|
Print a summary of the options unique to this package's
|
||||||
'configure', and exit. The 'short' variant lists options used only
|
`configure', and exit. The `short' variant lists options used
|
||||||
in the top level, while the 'recursive' variant lists options also
|
only in the top level, while the `recursive' variant lists options
|
||||||
present in any nested packages.
|
also present in any nested packages.
|
||||||
|
|
||||||
'--version'
|
`--version'
|
||||||
'-V'
|
`-V'
|
||||||
Print the version of Autoconf used to generate the 'configure'
|
Print the version of Autoconf used to generate the `configure'
|
||||||
script, and exit.
|
script, and exit.
|
||||||
|
|
||||||
'--cache-file=FILE'
|
`--cache-file=FILE'
|
||||||
Enable the cache: use and save the results of the tests in FILE,
|
Enable the cache: use and save the results of the tests in FILE,
|
||||||
traditionally 'config.cache'. FILE defaults to '/dev/null' to
|
traditionally `config.cache'. FILE defaults to `/dev/null' to
|
||||||
disable caching.
|
disable caching.
|
||||||
|
|
||||||
'--config-cache'
|
`--config-cache'
|
||||||
'-C'
|
`-C'
|
||||||
Alias for '--cache-file=config.cache'.
|
Alias for `--cache-file=config.cache'.
|
||||||
|
|
||||||
'--quiet'
|
`--quiet'
|
||||||
'--silent'
|
`--silent'
|
||||||
'-q'
|
`-q'
|
||||||
Do not print messages saying which checks are being made. To
|
Do not print messages saying which checks are being made. To
|
||||||
suppress all normal output, redirect it to '/dev/null' (any error
|
suppress all normal output, redirect it to `/dev/null' (any error
|
||||||
messages will still be shown).
|
messages will still be shown).
|
||||||
|
|
||||||
'--srcdir=DIR'
|
`--srcdir=DIR'
|
||||||
Look for the package's source code in directory DIR. Usually
|
Look for the package's source code in directory DIR. Usually
|
||||||
'configure' can determine that directory automatically.
|
`configure' can determine that directory automatically.
|
||||||
|
|
||||||
'--prefix=DIR'
|
`--prefix=DIR'
|
||||||
Use DIR as the installation prefix. *note Installation Names:: for
|
Use DIR as the installation prefix. *note Installation Names::
|
||||||
more details, including other options available for fine-tuning the
|
for more details, including other options available for fine-tuning
|
||||||
installation locations.
|
the installation locations.
|
||||||
|
|
||||||
'--no-create'
|
`--no-create'
|
||||||
'-n'
|
`-n'
|
||||||
Run the configure checks, but stop before creating any output
|
Run the configure checks, but stop before creating any output
|
||||||
files.
|
files.
|
||||||
|
|
||||||
'configure' also accepts some other, not widely useful, options. Run
|
`configure' also accepts some other, not widely useful, options. Run
|
||||||
'configure --help' for more details.
|
`configure --help' for more details.
|
||||||
|
|
||||||
|
|
|
||||||
20
Makefile.am
20
Makefile.am
|
|
@ -2,14 +2,26 @@
|
||||||
|
|
||||||
AUTOMAKE_OPTIONS = gnu
|
AUTOMAKE_OPTIONS = gnu
|
||||||
|
|
||||||
SUBDIRS = src doc systemd
|
SUBDIRS = m4 lib src doc
|
||||||
|
|
||||||
ACLOCAL_AMFLAGS = -I m4
|
ACLOCAL_AMFLAGS = -I m4
|
||||||
|
|
||||||
EXTRA_DIST = COPYING.README README.android
|
EXTRA_DIST = have.h system.h COPYING.README
|
||||||
|
|
||||||
ChangeLog:
|
ChangeLog:
|
||||||
git log > ChangeLog
|
git log > ChangeLog
|
||||||
|
|
||||||
astyle:
|
deb:
|
||||||
astyle --options=.astylerc -nQ src/*.[ch] src/*/*.[ch]
|
dpkg-buildpackage -rfakeroot
|
||||||
|
|
||||||
|
rpm: dist
|
||||||
|
cp $(distdir).tar.gz /usr/src/redhat/SOURCES/
|
||||||
|
cp redhat/tinc.spec /usr/src/redhat/SOURCES/
|
||||||
|
cd /usr/src/redhat/SOURCES/ && rpm -bb tinc.spec
|
||||||
|
|
||||||
|
release:
|
||||||
|
rm -f ChangeLog
|
||||||
|
$(MAKE) ChangeLog
|
||||||
|
echo "Please edit the NEWS file now..."
|
||||||
|
/usr/bin/editor NEWS
|
||||||
|
$(MAKE) dist
|
||||||
|
|
|
||||||
409
Makefile.in
409
Makefile.in
|
|
@ -1,8 +1,9 @@
|
||||||
# Makefile.in generated by automake 1.16.2 from Makefile.am.
|
# Makefile.in generated by automake 1.11.5 from Makefile.am.
|
||||||
# @configure_input@
|
# @configure_input@
|
||||||
|
|
||||||
# Copyright (C) 1994-2020 Free Software Foundation, Inc.
|
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||||
|
# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
|
||||||
|
# Foundation, Inc.
|
||||||
# This Makefile.in is free software; the Free Software Foundation
|
# This Makefile.in is free software; the Free Software Foundation
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
# with or without modifications, as long as this notice is preserved.
|
# with or without modifications, as long as this notice is preserved.
|
||||||
|
|
@ -14,61 +15,23 @@
|
||||||
|
|
||||||
@SET_MAKE@
|
@SET_MAKE@
|
||||||
VPATH = @srcdir@
|
VPATH = @srcdir@
|
||||||
am__is_gnu_make = { \
|
am__make_dryrun = \
|
||||||
if test -z '$(MAKELEVEL)'; then \
|
{ \
|
||||||
false; \
|
am__dry=no; \
|
||||||
elif test -n '$(MAKE_HOST)'; then \
|
|
||||||
true; \
|
|
||||||
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
|
|
||||||
true; \
|
|
||||||
else \
|
|
||||||
false; \
|
|
||||||
fi; \
|
|
||||||
}
|
|
||||||
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 \
|
case $$MAKEFLAGS in \
|
||||||
*\\[\ \ ]*) \
|
*\\[\ \ ]*) \
|
||||||
bs=\\; \
|
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
|
||||||
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
|
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
|
||||||
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
|
*) \
|
||||||
|
for am__flg in $$MAKEFLAGS; do \
|
||||||
|
case $$am__flg in \
|
||||||
|
*=*|--*) ;; \
|
||||||
|
*n*) am__dry=yes; break;; \
|
||||||
esac; \
|
esac; \
|
||||||
fi; \
|
done;; \
|
||||||
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; \
|
esac; \
|
||||||
case $$flg in \
|
test $$am__dry = yes; \
|
||||||
*$$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@
|
pkgdatadir = $(datadir)/@PACKAGE@
|
||||||
pkgincludedir = $(includedir)/@PACKAGE@
|
pkgincludedir = $(includedir)/@PACKAGE@
|
||||||
pkglibdir = $(libdir)/@PACKAGE@
|
pkglibdir = $(libdir)/@PACKAGE@
|
||||||
|
|
@ -88,47 +51,31 @@ POST_UNINSTALL = :
|
||||||
build_triplet = @build@
|
build_triplet = @build@
|
||||||
host_triplet = @host@
|
host_triplet = @host@
|
||||||
subdir = .
|
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
|
||||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||||
am__aclocal_m4_deps = $(top_srcdir)/m4/attribute.m4 \
|
am__aclocal_m4_deps = $(top_srcdir)/m4/attribute.m4 \
|
||||||
$(top_srcdir)/m4/ax_append_flag.m4 \
|
$(top_srcdir)/m4/lzo.m4 $(top_srcdir)/m4/openssl.m4 \
|
||||||
$(top_srcdir)/m4/ax_cflags_warn_all.m4 \
|
$(top_srcdir)/m4/zlib.m4 $(top_srcdir)/configure.in
|
||||||
$(top_srcdir)/m4/ax_check_compile_flag.m4 \
|
|
||||||
$(top_srcdir)/m4/ax_check_link_flag.m4 \
|
|
||||||
$(top_srcdir)/m4/ax_require_defined.m4 $(top_srcdir)/m4/lzo.m4 \
|
|
||||||
$(top_srcdir)/m4/openssl.m4 $(top_srcdir)/m4/zlib.m4 \
|
|
||||||
$(top_srcdir)/configure.ac
|
|
||||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||||
$(ACLOCAL_M4)
|
$(ACLOCAL_M4)
|
||||||
DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
|
|
||||||
$(am__configure_deps) $(am__DIST_COMMON)
|
|
||||||
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
|
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
|
||||||
configure.lineno config.status.lineno
|
configure.lineno config.status.lineno
|
||||||
mkinstalldirs = $(install_sh) -d
|
mkinstalldirs = $(install_sh) -d
|
||||||
CONFIG_HEADER = config.h
|
CONFIG_HEADER = config.h
|
||||||
CONFIG_CLEAN_FILES =
|
CONFIG_CLEAN_FILES =
|
||||||
CONFIG_CLEAN_VPATH_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 =
|
SOURCES =
|
||||||
DIST_SOURCES =
|
DIST_SOURCES =
|
||||||
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
|
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
|
||||||
ctags-recursive dvi-recursive html-recursive info-recursive \
|
html-recursive info-recursive install-data-recursive \
|
||||||
install-data-recursive install-dvi-recursive \
|
install-dvi-recursive install-exec-recursive \
|
||||||
install-exec-recursive install-html-recursive \
|
install-html-recursive install-info-recursive \
|
||||||
install-info-recursive install-pdf-recursive \
|
install-pdf-recursive install-ps-recursive install-recursive \
|
||||||
install-ps-recursive install-recursive installcheck-recursive \
|
installcheck-recursive installdirs-recursive pdf-recursive \
|
||||||
installdirs-recursive pdf-recursive ps-recursive \
|
ps-recursive uninstall-recursive
|
||||||
tags-recursive uninstall-recursive
|
|
||||||
am__can_run_installinfo = \
|
am__can_run_installinfo = \
|
||||||
case $$AM_UPDATE_INFO_DIR in \
|
case $$AM_UPDATE_INFO_DIR in \
|
||||||
n|no|NO) false;; \
|
n|no|NO) false;; \
|
||||||
|
|
@ -136,37 +83,12 @@ am__can_run_installinfo = \
|
||||||
esac
|
esac
|
||||||
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
|
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
|
||||||
distclean-recursive maintainer-clean-recursive
|
distclean-recursive maintainer-clean-recursive
|
||||||
am__recursive_targets = \
|
AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
|
||||||
$(RECURSIVE_TARGETS) \
|
$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
|
||||||
$(RECURSIVE_CLEAN_TARGETS) \
|
distdir dist dist-all distcheck
|
||||||
$(am__extra_recursive_targets)
|
|
||||||
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
|
|
||||||
cscope distdir distdir-am 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
|
ETAGS = etags
|
||||||
CTAGS = ctags
|
CTAGS = ctags
|
||||||
CSCOPE = cscope
|
|
||||||
DIST_SUBDIRS = $(SUBDIRS)
|
DIST_SUBDIRS = $(SUBDIRS)
|
||||||
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in AUTHORS \
|
|
||||||
COPYING ChangeLog INSTALL NEWS README THANKS compile \
|
|
||||||
config.guess config.sub depcomp install-sh missing
|
|
||||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||||
distdir = $(PACKAGE)-$(VERSION)
|
distdir = $(PACKAGE)-$(VERSION)
|
||||||
top_distdir = $(distdir)
|
top_distdir = $(distdir)
|
||||||
|
|
@ -176,7 +98,6 @@ am__remove_distdir = \
|
||||||
&& rm -rf "$(distdir)" \
|
&& rm -rf "$(distdir)" \
|
||||||
|| { sleep 5 && rm -rf "$(distdir)"; }; \
|
|| { sleep 5 && rm -rf "$(distdir)"; }; \
|
||||||
else :; fi
|
else :; fi
|
||||||
am__post_remove_distdir = $(am__remove_distdir)
|
|
||||||
am__relativize = \
|
am__relativize = \
|
||||||
dir0=`pwd`; \
|
dir0=`pwd`; \
|
||||||
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
|
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
|
||||||
|
|
@ -204,14 +125,13 @@ am__relativize = \
|
||||||
reldir="$$dir2"
|
reldir="$$dir2"
|
||||||
DIST_ARCHIVES = $(distdir).tar.gz
|
DIST_ARCHIVES = $(distdir).tar.gz
|
||||||
GZIP_ENV = --best
|
GZIP_ENV = --best
|
||||||
DIST_TARGETS = dist-gzip
|
|
||||||
distuninstallcheck_listfiles = find . -type f -print
|
distuninstallcheck_listfiles = find . -type f -print
|
||||||
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
|
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
|
||||||
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
|
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
|
||||||
distcleancheck_listfiles = find . -type f -print
|
distcleancheck_listfiles = find . -type f -print
|
||||||
ACLOCAL = @ACLOCAL@
|
ACLOCAL = @ACLOCAL@
|
||||||
|
ALLOCA = @ALLOCA@
|
||||||
AMTAR = @AMTAR@
|
AMTAR = @AMTAR@
|
||||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
|
||||||
AUTOCONF = @AUTOCONF@
|
AUTOCONF = @AUTOCONF@
|
||||||
AUTOHEADER = @AUTOHEADER@
|
AUTOHEADER = @AUTOHEADER@
|
||||||
AUTOMAKE = @AUTOMAKE@
|
AUTOMAKE = @AUTOMAKE@
|
||||||
|
|
@ -230,6 +150,7 @@ ECHO_T = @ECHO_T@
|
||||||
EGREP = @EGREP@
|
EGREP = @EGREP@
|
||||||
EXEEXT = @EXEEXT@
|
EXEEXT = @EXEEXT@
|
||||||
GREP = @GREP@
|
GREP = @GREP@
|
||||||
|
INCLUDES = @INCLUDES@
|
||||||
INSTALL = @INSTALL@
|
INSTALL = @INSTALL@
|
||||||
INSTALL_DATA = @INSTALL_DATA@
|
INSTALL_DATA = @INSTALL_DATA@
|
||||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||||
|
|
@ -238,7 +159,9 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||||
LDFLAGS = @LDFLAGS@
|
LDFLAGS = @LDFLAGS@
|
||||||
LIBOBJS = @LIBOBJS@
|
LIBOBJS = @LIBOBJS@
|
||||||
LIBS = @LIBS@
|
LIBS = @LIBS@
|
||||||
|
LN_S = @LN_S@
|
||||||
LTLIBOBJS = @LTLIBOBJS@
|
LTLIBOBJS = @LTLIBOBJS@
|
||||||
|
MAINT = @MAINT@
|
||||||
MAKEINFO = @MAKEINFO@
|
MAKEINFO = @MAKEINFO@
|
||||||
MKDIR_P = @MKDIR_P@
|
MKDIR_P = @MKDIR_P@
|
||||||
OBJEXT = @OBJEXT@
|
OBJEXT = @OBJEXT@
|
||||||
|
|
@ -250,6 +173,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||||
PACKAGE_URL = @PACKAGE_URL@
|
PACKAGE_URL = @PACKAGE_URL@
|
||||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||||
|
RANLIB = @RANLIB@
|
||||||
SET_MAKE = @SET_MAKE@
|
SET_MAKE = @SET_MAKE@
|
||||||
SHELL = @SHELL@
|
SHELL = @SHELL@
|
||||||
STRIP = @STRIP@
|
STRIP = @STRIP@
|
||||||
|
|
@ -296,27 +220,25 @@ pdfdir = @pdfdir@
|
||||||
prefix = @prefix@
|
prefix = @prefix@
|
||||||
program_transform_name = @program_transform_name@
|
program_transform_name = @program_transform_name@
|
||||||
psdir = @psdir@
|
psdir = @psdir@
|
||||||
runstatedir = @runstatedir@
|
|
||||||
sbindir = @sbindir@
|
sbindir = @sbindir@
|
||||||
sharedstatedir = @sharedstatedir@
|
sharedstatedir = @sharedstatedir@
|
||||||
srcdir = @srcdir@
|
srcdir = @srcdir@
|
||||||
sysconfdir = @sysconfdir@
|
sysconfdir = @sysconfdir@
|
||||||
systemd_path = @systemd_path@
|
|
||||||
target_alias = @target_alias@
|
target_alias = @target_alias@
|
||||||
top_build_prefix = @top_build_prefix@
|
top_build_prefix = @top_build_prefix@
|
||||||
top_builddir = @top_builddir@
|
top_builddir = @top_builddir@
|
||||||
top_srcdir = @top_srcdir@
|
top_srcdir = @top_srcdir@
|
||||||
AUTOMAKE_OPTIONS = gnu
|
AUTOMAKE_OPTIONS = gnu
|
||||||
SUBDIRS = src doc systemd
|
SUBDIRS = m4 lib src doc
|
||||||
ACLOCAL_AMFLAGS = -I m4
|
ACLOCAL_AMFLAGS = -I m4
|
||||||
EXTRA_DIST = COPYING.README README.android
|
EXTRA_DIST = have.h system.h COPYING.README
|
||||||
all: config.h
|
all: config.h
|
||||||
$(MAKE) $(AM_MAKEFLAGS) all-recursive
|
$(MAKE) $(AM_MAKEFLAGS) all-recursive
|
||||||
|
|
||||||
.SUFFIXES:
|
.SUFFIXES:
|
||||||
am--refresh: Makefile
|
am--refresh: Makefile
|
||||||
@:
|
@:
|
||||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
|
||||||
@for dep in $?; do \
|
@for dep in $?; do \
|
||||||
case '$(am__configure_deps)' in \
|
case '$(am__configure_deps)' in \
|
||||||
*$$dep*) \
|
*$$dep*) \
|
||||||
|
|
@ -329,33 +251,34 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
|
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
|
||||||
$(am__cd) $(top_srcdir) && \
|
$(am__cd) $(top_srcdir) && \
|
||||||
$(AUTOMAKE) --gnu Makefile
|
$(AUTOMAKE) --gnu Makefile
|
||||||
|
.PRECIOUS: Makefile
|
||||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||||
@case '$?' in \
|
@case '$?' in \
|
||||||
*config.status*) \
|
*config.status*) \
|
||||||
echo ' $(SHELL) ./config.status'; \
|
echo ' $(SHELL) ./config.status'; \
|
||||||
$(SHELL) ./config.status;; \
|
$(SHELL) ./config.status;; \
|
||||||
*) \
|
*) \
|
||||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \
|
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
|
||||||
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \
|
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
|
||||||
esac;
|
esac;
|
||||||
|
|
||||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||||
$(SHELL) ./config.status --recheck
|
$(SHELL) ./config.status --recheck
|
||||||
|
|
||||||
$(top_srcdir)/configure: $(am__configure_deps)
|
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||||
$(am__cd) $(srcdir) && $(AUTOCONF)
|
$(am__cd) $(srcdir) && $(AUTOCONF)
|
||||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||||
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
|
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
|
||||||
$(am__aclocal_m4_deps):
|
$(am__aclocal_m4_deps):
|
||||||
|
|
||||||
config.h: stamp-h1
|
config.h: stamp-h1
|
||||||
@test -f $@ || rm -f stamp-h1
|
@if test ! -f $@; then rm -f stamp-h1; else :; fi
|
||||||
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
|
@if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi
|
||||||
|
|
||||||
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
|
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
|
||||||
@rm -f stamp-h1
|
@rm -f stamp-h1
|
||||||
cd $(top_builddir) && $(SHELL) ./config.status config.h
|
cd $(top_builddir) && $(SHELL) ./config.status config.h
|
||||||
$(srcdir)/config.h.in: $(am__configure_deps)
|
$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||||
($(am__cd) $(top_srcdir) && $(AUTOHEADER))
|
($(am__cd) $(top_srcdir) && $(AUTOHEADER))
|
||||||
rm -f stamp-h1
|
rm -f stamp-h1
|
||||||
touch $@
|
touch $@
|
||||||
|
|
@ -364,25 +287,22 @@ distclean-hdr:
|
||||||
-rm -f config.h stamp-h1
|
-rm -f config.h stamp-h1
|
||||||
|
|
||||||
# This directory's subdirectories are mostly independent; you can cd
|
# This directory's subdirectories are mostly independent; you can cd
|
||||||
# into them and run 'make' without going through this Makefile.
|
# into them and run `make' without going through this Makefile.
|
||||||
# To change the values of 'make' variables: instead of editing Makefiles,
|
# To change the values of `make' variables: instead of editing Makefiles,
|
||||||
# (1) if the variable is set in 'config.status', edit 'config.status'
|
# (1) if the variable is set in `config.status', edit `config.status'
|
||||||
# (which will cause the Makefiles to be regenerated when you run 'make');
|
# (which will cause the Makefiles to be regenerated when you run `make');
|
||||||
# (2) otherwise, pass the desired values on the 'make' command line.
|
# (2) otherwise, pass the desired values on the `make' command line.
|
||||||
$(am__recursive_targets):
|
$(RECURSIVE_TARGETS):
|
||||||
@fail=; \
|
@fail= failcom='exit 1'; \
|
||||||
if $(am__make_keepgoing); then \
|
for f in x $$MAKEFLAGS; do \
|
||||||
failcom='fail=yes'; \
|
case $$f in \
|
||||||
else \
|
*=* | --[!k]*);; \
|
||||||
failcom='exit 1'; \
|
*k*) failcom='fail=yes';; \
|
||||||
fi; \
|
esac; \
|
||||||
|
done; \
|
||||||
dot_seen=no; \
|
dot_seen=no; \
|
||||||
target=`echo $@ | sed s/-recursive//`; \
|
target=`echo $@ | sed s/-recursive//`; \
|
||||||
case "$@" in \
|
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||||
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
|
||||||
*) list='$(SUBDIRS)' ;; \
|
|
||||||
esac; \
|
|
||||||
for subdir in $$list; do \
|
|
||||||
echo "Making $$target in $$subdir"; \
|
echo "Making $$target in $$subdir"; \
|
||||||
if test "$$subdir" = "."; then \
|
if test "$$subdir" = "."; then \
|
||||||
dot_seen=yes; \
|
dot_seen=yes; \
|
||||||
|
|
@ -397,12 +317,57 @@ $(am__recursive_targets):
|
||||||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
||||||
fi; test -z "$$fail"
|
fi; test -z "$$fail"
|
||||||
|
|
||||||
ID: $(am__tagged_files)
|
$(RECURSIVE_CLEAN_TARGETS):
|
||||||
$(am__define_uniq_tagged_files); mkid -fID $$unique
|
@fail= failcom='exit 1'; \
|
||||||
tags: tags-recursive
|
for f in x $$MAKEFLAGS; do \
|
||||||
TAGS: tags
|
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
|
||||||
|
|
||||||
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
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)
|
||||||
set x; \
|
set x; \
|
||||||
here=`pwd`; \
|
here=`pwd`; \
|
||||||
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
|
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
|
||||||
|
|
@ -418,7 +383,12 @@ tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||||
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
|
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
|
||||||
fi; \
|
fi; \
|
||||||
done; \
|
done; \
|
||||||
$(am__define_uniq_tagged_files); \
|
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; }; }'`; \
|
||||||
shift; \
|
shift; \
|
||||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||||
test -n "$$unique" || unique=$$empty_fix; \
|
test -n "$$unique" || unique=$$empty_fix; \
|
||||||
|
|
@ -430,11 +400,15 @@ tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||||
$$unique; \
|
$$unique; \
|
||||||
fi; \
|
fi; \
|
||||||
fi
|
fi
|
||||||
ctags: ctags-recursive
|
ctags: CTAGS
|
||||||
|
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
|
||||||
CTAGS: ctags
|
$(TAGS_FILES) $(LISP)
|
||||||
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
|
||||||
$(am__define_uniq_tagged_files); \
|
unique=`for i in $$list; do \
|
||||||
|
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||||
|
done | \
|
||||||
|
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||||
|
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||||
test -z "$(CTAGS_ARGS)$$unique" \
|
test -z "$(CTAGS_ARGS)$$unique" \
|
||||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||||
$$unique
|
$$unique
|
||||||
|
|
@ -443,42 +417,11 @@ GTAGS:
|
||||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||||
&& $(am__cd) $(top_srcdir) \
|
&& $(am__cd) $(top_srcdir) \
|
||||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
&& 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:
|
distclean-tags:
|
||||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||||
-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
|
|
||||||
|
|
||||||
distdir: $(BUILT_SOURCES)
|
distdir: $(DISTFILES)
|
||||||
$(MAKE) $(AM_MAKEFLAGS) distdir-am
|
|
||||||
|
|
||||||
distdir-am: $(DISTFILES)
|
|
||||||
@case `sed 15q $(srcdir)/NEWS` in \
|
|
||||||
*"$(VERSION)"*) : ;; \
|
|
||||||
*) \
|
|
||||||
echo "NEWS not updated; not releasing" 1>&2; \
|
|
||||||
exit 1;; \
|
|
||||||
esac
|
|
||||||
$(am__remove_distdir)
|
$(am__remove_distdir)
|
||||||
test -d "$(distdir)" || mkdir "$(distdir)"
|
test -d "$(distdir)" || mkdir "$(distdir)"
|
||||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||||
|
|
@ -543,47 +486,41 @@ distdir-am: $(DISTFILES)
|
||||||
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|
||||||
|| chmod -R a+r "$(distdir)"
|
|| chmod -R a+r "$(distdir)"
|
||||||
dist-gzip: distdir
|
dist-gzip: distdir
|
||||||
tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
|
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||||
$(am__post_remove_distdir)
|
$(am__remove_distdir)
|
||||||
|
|
||||||
dist-bzip2: distdir
|
dist-bzip2: distdir
|
||||||
tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
|
tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
|
||||||
$(am__post_remove_distdir)
|
$(am__remove_distdir)
|
||||||
|
|
||||||
dist-lzip: distdir
|
dist-lzip: distdir
|
||||||
tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
|
tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
|
||||||
$(am__post_remove_distdir)
|
$(am__remove_distdir)
|
||||||
|
|
||||||
|
dist-lzma: distdir
|
||||||
|
tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
|
||||||
|
$(am__remove_distdir)
|
||||||
|
|
||||||
dist-xz: distdir
|
dist-xz: distdir
|
||||||
tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
|
tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
|
||||||
$(am__post_remove_distdir)
|
$(am__remove_distdir)
|
||||||
|
|
||||||
dist-zstd: distdir
|
|
||||||
tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst
|
|
||||||
$(am__post_remove_distdir)
|
|
||||||
|
|
||||||
dist-tarZ: distdir
|
dist-tarZ: distdir
|
||||||
@echo WARNING: "Support for distribution archives compressed with" \
|
|
||||||
"legacy program 'compress' is deprecated." >&2
|
|
||||||
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
|
|
||||||
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
|
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
|
||||||
$(am__post_remove_distdir)
|
$(am__remove_distdir)
|
||||||
|
|
||||||
dist-shar: distdir
|
dist-shar: distdir
|
||||||
@echo WARNING: "Support for shar distribution archives is" \
|
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
|
||||||
"deprecated." >&2
|
$(am__remove_distdir)
|
||||||
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
|
|
||||||
shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
|
|
||||||
$(am__post_remove_distdir)
|
|
||||||
|
|
||||||
dist-zip: distdir
|
dist-zip: distdir
|
||||||
-rm -f $(distdir).zip
|
-rm -f $(distdir).zip
|
||||||
zip -rq $(distdir).zip $(distdir)
|
zip -rq $(distdir).zip $(distdir)
|
||||||
$(am__post_remove_distdir)
|
$(am__remove_distdir)
|
||||||
|
|
||||||
dist dist-all:
|
dist dist-all: distdir
|
||||||
$(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
|
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||||
$(am__post_remove_distdir)
|
$(am__remove_distdir)
|
||||||
|
|
||||||
# This target untars the dist file and tries a VPATH configuration. Then
|
# This target untars the dist file and tries a VPATH configuration. Then
|
||||||
# it guarantees that the distribution is self-contained by making another
|
# it guarantees that the distribution is self-contained by making another
|
||||||
|
|
@ -591,9 +528,11 @@ dist dist-all:
|
||||||
distcheck: dist
|
distcheck: dist
|
||||||
case '$(DIST_ARCHIVES)' in \
|
case '$(DIST_ARCHIVES)' in \
|
||||||
*.tar.gz*) \
|
*.tar.gz*) \
|
||||||
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
|
GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
|
||||||
*.tar.bz2*) \
|
*.tar.bz2*) \
|
||||||
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
|
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
|
||||||
|
*.tar.lzma*) \
|
||||||
|
lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
|
||||||
*.tar.lz*) \
|
*.tar.lz*) \
|
||||||
lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
|
lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
|
||||||
*.tar.xz*) \
|
*.tar.xz*) \
|
||||||
|
|
@ -601,25 +540,22 @@ distcheck: dist
|
||||||
*.tar.Z*) \
|
*.tar.Z*) \
|
||||||
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
|
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
|
||||||
*.shar.gz*) \
|
*.shar.gz*) \
|
||||||
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
|
GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
|
||||||
*.zip*) \
|
*.zip*) \
|
||||||
unzip $(distdir).zip ;;\
|
unzip $(distdir).zip ;;\
|
||||||
*.tar.zst*) \
|
|
||||||
zstd -dc $(distdir).tar.zst | $(am__untar) ;;\
|
|
||||||
esac
|
esac
|
||||||
chmod -R a-w $(distdir)
|
chmod -R a-w $(distdir); chmod a+w $(distdir)
|
||||||
chmod u+w $(distdir)
|
mkdir $(distdir)/_build
|
||||||
mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
|
mkdir $(distdir)/_inst
|
||||||
chmod a-w $(distdir)
|
chmod a-w $(distdir)
|
||||||
test -d $(distdir)/_build || exit 0; \
|
test -d $(distdir)/_build || exit 0; \
|
||||||
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
|
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
|
||||||
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
|
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
|
||||||
&& am__cwd=`pwd` \
|
&& am__cwd=`pwd` \
|
||||||
&& $(am__cd) $(distdir)/_build/sub \
|
&& $(am__cd) $(distdir)/_build \
|
||||||
&& ../../configure \
|
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
|
||||||
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
|
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
|
||||||
$(DISTCHECK_CONFIGURE_FLAGS) \
|
$(DISTCHECK_CONFIGURE_FLAGS) \
|
||||||
--srcdir=../.. --prefix="$$dc_install_base" \
|
|
||||||
&& $(MAKE) $(AM_MAKEFLAGS) \
|
&& $(MAKE) $(AM_MAKEFLAGS) \
|
||||||
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
|
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
|
||||||
&& $(MAKE) $(AM_MAKEFLAGS) check \
|
&& $(MAKE) $(AM_MAKEFLAGS) check \
|
||||||
|
|
@ -642,7 +578,7 @@ distcheck: dist
|
||||||
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
|
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
|
||||||
&& cd "$$am__cwd" \
|
&& cd "$$am__cwd" \
|
||||||
|| exit 1
|
|| exit 1
|
||||||
$(am__post_remove_distdir)
|
$(am__remove_distdir)
|
||||||
@(echo "$(distdir) archives ready for distribution: "; \
|
@(echo "$(distdir) archives ready for distribution: "; \
|
||||||
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
|
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'
|
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
|
||||||
|
|
@ -776,13 +712,14 @@ ps-am:
|
||||||
|
|
||||||
uninstall-am:
|
uninstall-am:
|
||||||
|
|
||||||
.MAKE: $(am__recursive_targets) all install-am install-strip
|
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \
|
||||||
|
ctags-recursive install-am install-strip tags-recursive
|
||||||
|
|
||||||
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
|
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
|
||||||
am--refresh check check-am clean clean-cscope clean-generic \
|
all all-am am--refresh check check-am clean clean-generic \
|
||||||
cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \
|
ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \
|
||||||
dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \
|
dist-lzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \
|
||||||
dist-zstd distcheck distclean distclean-generic distclean-hdr \
|
distcheck distclean distclean-generic distclean-hdr \
|
||||||
distclean-tags distcleancheck distdir distuninstallcheck dvi \
|
distclean-tags distcleancheck distdir distuninstallcheck dvi \
|
||||||
dvi-am html html-am info info-am install install-am \
|
dvi-am html html-am info info-am install install-am \
|
||||||
install-data install-data-am install-dvi install-dvi-am \
|
install-data install-data-am install-dvi install-dvi-am \
|
||||||
|
|
@ -791,17 +728,27 @@ uninstall-am:
|
||||||
install-pdf-am install-ps install-ps-am install-strip \
|
install-pdf-am install-ps install-ps-am install-strip \
|
||||||
installcheck installcheck-am installdirs installdirs-am \
|
installcheck installcheck-am installdirs installdirs-am \
|
||||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
maintainer-clean maintainer-clean-generic mostlyclean \
|
||||||
mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \
|
mostlyclean-generic pdf pdf-am ps ps-am tags tags-recursive \
|
||||||
uninstall-am
|
uninstall uninstall-am
|
||||||
|
|
||||||
.PRECIOUS: Makefile
|
|
||||||
|
|
||||||
|
|
||||||
ChangeLog:
|
ChangeLog:
|
||||||
git log > ChangeLog
|
git log > ChangeLog
|
||||||
|
|
||||||
astyle:
|
deb:
|
||||||
astyle --options=.astylerc -nQ src/*.[ch] src/*/*.[ch]
|
dpkg-buildpackage -rfakeroot
|
||||||
|
|
||||||
|
rpm: dist
|
||||||
|
cp $(distdir).tar.gz /usr/src/redhat/SOURCES/
|
||||||
|
cp redhat/tinc.spec /usr/src/redhat/SOURCES/
|
||||||
|
cd /usr/src/redhat/SOURCES/ && rpm -bb tinc.spec
|
||||||
|
|
||||||
|
release:
|
||||||
|
rm -f ChangeLog
|
||||||
|
$(MAKE) ChangeLog
|
||||||
|
echo "Please edit the NEWS file now..."
|
||||||
|
/usr/bin/editor NEWS
|
||||||
|
$(MAKE) dist
|
||||||
|
|
||||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||||
|
|
|
||||||
208
NEWS
208
NEWS
|
|
@ -1,204 +1,3 @@
|
||||||
Version 1.0.36 August 26 2019
|
|
||||||
|
|
||||||
* Fix compiling tinc with certain versions of the OpenSSL library.
|
|
||||||
* Fix parsing some IPv6 addresses with :: in them.
|
|
||||||
* Fix GraphDumpFile output to handle node names starting with a digit.
|
|
||||||
* Fix a potential segmentation fault when fragmenting packets.
|
|
||||||
|
|
||||||
Thanks to Rosen Penev, Quentin Rameau and Werner Schreiber for their
|
|
||||||
contributions to this version of tinc.
|
|
||||||
|
|
||||||
Version 1.0.35 October 5 2018
|
|
||||||
|
|
||||||
* Prevent oracle attacks (CVE-2018-16737, CVE-2018-16738).
|
|
||||||
* Prevent a MITM from forcing a NULL cipher for UDP (CVE-2018-16758).
|
|
||||||
* Minor fixes in the documentation.
|
|
||||||
|
|
||||||
Thanks to Amine Amri and Rafael Sadowski for their contributions to this
|
|
||||||
version of tinc.
|
|
||||||
|
|
||||||
Version 1.0.34 June 12 2018
|
|
||||||
|
|
||||||
* Fix a potential segmentation fault when connecting to an IPv6 peer via a
|
|
||||||
proxy.
|
|
||||||
* Minor improvements to the build system.
|
|
||||||
* Make the systemd service file identical to the one from the 1.1 branch.
|
|
||||||
* Fix a potential problem causing IPv4 sockets to not work on macOS.
|
|
||||||
|
|
||||||
Thanks to Maximilian Stein and Wang Liu Shuai for their contributions to this
|
|
||||||
version of tinc.
|
|
||||||
|
|
||||||
Version 1.0.33 November 4 2017
|
|
||||||
|
|
||||||
* Allow compilation from a build directory.
|
|
||||||
* Source code cleanups.
|
|
||||||
* Fix some options specified on the command line not surviving a HUP signal.
|
|
||||||
* Handle tun/tap device returning EPERM or EBUSY.
|
|
||||||
* Disable PMTUDiscovery when TCPOnly is used.
|
|
||||||
* Support the --runstatedir option of the autoconf 2.70.
|
|
||||||
|
|
||||||
Thanks to Rafael Sadowski and Pierre-Olivier Mercier for their contributions to
|
|
||||||
this version of tinc.
|
|
||||||
|
|
||||||
Version 1.0.32 September 2 2017
|
|
||||||
|
|
||||||
* Fix segmentation fault when using Cipher = none.
|
|
||||||
* Fix Proxy = exec.
|
|
||||||
* Support PriorityInheritance for IPv6 packets.
|
|
||||||
* Fixes for Solaris tun/tap support.
|
|
||||||
* Bind outgoing TCP sockets when ListenAddress is used.
|
|
||||||
|
|
||||||
Thanks to Vittorio Gambaletta for his contribution to this version of tinc.
|
|
||||||
|
|
||||||
Version 1.0.31 January 15 2017
|
|
||||||
|
|
||||||
* Remove ExecStop in tinc@.service.
|
|
||||||
|
|
||||||
Thanks to Élie Bouttier for his contribution to this version of tinc.
|
|
||||||
|
|
||||||
Version 1.0.30 October 30 2016
|
|
||||||
|
|
||||||
* Fix troubles connecting to some HTTP proxies.
|
|
||||||
|
|
||||||
* Add mitigations for the Sweet32 attack when using a 64-bit block cipher.
|
|
||||||
|
|
||||||
* Use AES256 and SHA256 as the default encryption and digest algorithms.
|
|
||||||
|
|
||||||
Version 1.0.29 October 9 2016
|
|
||||||
|
|
||||||
* Fix UDP communication with peers with link-local IPv6 addresses.
|
|
||||||
|
|
||||||
* Ensure compatibility with OpenSSL 1.1.0.
|
|
||||||
|
|
||||||
* Ensure autoreconf can be run without requiring autoconf-archive.
|
|
||||||
|
|
||||||
* Log warnings about dropped packets only at debug level 5.
|
|
||||||
|
|
||||||
Version 1.0.28 April 10 2016
|
|
||||||
|
|
||||||
* Fix compilation on BSD platforms.
|
|
||||||
|
|
||||||
* Add systemd service files.
|
|
||||||
|
|
||||||
Version 1.0.27 April 10 2016
|
|
||||||
|
|
||||||
* When using Proxy, let the proxy resolve hostnames if tinc can't.
|
|
||||||
|
|
||||||
* Fixes and improvements of the DecrementTTL option.
|
|
||||||
|
|
||||||
* Fixed the $NAME variable in subnet-up/down scripts for the local Subnets.
|
|
||||||
|
|
||||||
* Fixed potentially wrong checksum generation when clamping the MSS.
|
|
||||||
|
|
||||||
* Properly choose between the system's or our own copy of getopt.
|
|
||||||
|
|
||||||
* Fixed compiling tinc for Cygwin with MinGW installed.
|
|
||||||
|
|
||||||
* Added support for OS X utun interfaces.
|
|
||||||
|
|
||||||
* Documentation updates and minor fixes.
|
|
||||||
|
|
||||||
Thanks to Vittorio Gambaletta, LunarShaddow, Florian Weik and Nathan Stratton
|
|
||||||
Treadway for their contributions to this version of tinc.
|
|
||||||
|
|
||||||
Version 1.0.26 July 5 2015
|
|
||||||
|
|
||||||
* Tinc now forces glibc to reload /etc/resolv.conf for every hostname lookup.
|
|
||||||
|
|
||||||
* Fixed --logfile without a filename on Windows.
|
|
||||||
|
|
||||||
* Ensure tinc can be compiled when using musl libc.
|
|
||||||
|
|
||||||
Thanks to Jo-Philipp Wich for his contribution to this version of tinc.
|
|
||||||
|
|
||||||
Version 1.0.25 December 22 2014
|
|
||||||
|
|
||||||
* Documentation updates.
|
|
||||||
|
|
||||||
* Support linking against -lresolv on Mac OS X.
|
|
||||||
|
|
||||||
* Fix scripts on Windows when using the ScriptsInterpreter option.
|
|
||||||
|
|
||||||
* Allow a minimum reconnect timeout to be specified.
|
|
||||||
|
|
||||||
* Support PriorityInheritance on IPv6 sockets.
|
|
||||||
|
|
||||||
Thanks to David Pflug, Baptiste Jonglez, Alexis Hildebrandt, Borg, Jochen Voss,
|
|
||||||
Tomislav Čohar and VittGam for their contributions to this version of tinc.
|
|
||||||
|
|
||||||
Version 1.0.24 May 11 2014
|
|
||||||
|
|
||||||
* Various compiler hardening flags are enabled by default.
|
|
||||||
|
|
||||||
* Updated support for Solaris, allowing switch mode on Solaris 11.
|
|
||||||
|
|
||||||
* Configuration will now also be read from a conf.d directory.
|
|
||||||
|
|
||||||
* Various updates to the documentation.
|
|
||||||
|
|
||||||
* Tinc now forces glibc to reload /etc/resolv.conf after it receives SIGALRM.
|
|
||||||
|
|
||||||
* Fixed a potential routing loop when IndirectData or TCPOnly is used and
|
|
||||||
broadcast packets are being sent.
|
|
||||||
|
|
||||||
* Improved security with constant time memcmp and stricter use of OpenSSL's
|
|
||||||
RNG functions.
|
|
||||||
|
|
||||||
* Fixed all issues found by Coverity.
|
|
||||||
|
|
||||||
Thanks to Florent Clairambault, Vilbrekin, luckyhacky, Armin Fisslthaler, Loïc
|
|
||||||
Dachary and Steffan Karger for their contributions to this version of tinc.
|
|
||||||
|
|
||||||
Version 1.0.23 October 19 2013
|
|
||||||
|
|
||||||
* Start authentication immediately on outgoing connections (useful for sslh).
|
|
||||||
|
|
||||||
* Fixed segfault when Name = $HOST but $HOST is not set.
|
|
||||||
|
|
||||||
* Updated the build system and the documentation.
|
|
||||||
|
|
||||||
* Clean up child processes left over from Proxy = exec.
|
|
||||||
|
|
||||||
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
|
Version 1.0.19 June 25 2012
|
||||||
|
|
||||||
* Allow :: notation in IPv6 Subnets.
|
* Allow :: notation in IPv6 Subnets.
|
||||||
|
|
@ -210,9 +9,6 @@ Version 1.0.19 June 25 2012
|
||||||
* Add basic support for SOCKS proxies, HTTP proxies, and proxying through an
|
* Add basic support for SOCKS proxies, HTTP proxies, and proxying through an
|
||||||
external command.
|
external command.
|
||||||
|
|
||||||
Thanks to Anthony G. Basile and Michael Tokarev for their contributions to
|
|
||||||
this version of tinc.
|
|
||||||
|
|
||||||
Version 1.0.18 March 25 2012
|
Version 1.0.18 March 25 2012
|
||||||
|
|
||||||
* Fixed IPv6 in switch mode by turning off DecrementTTL by default.
|
* Fixed IPv6 in switch mode by turning off DecrementTTL by default.
|
||||||
|
|
@ -239,8 +35,6 @@ Version 1.0.17 March 10 2012
|
||||||
* Disabling old RSA keys when generating new ones now also works properly on
|
* Disabling old RSA keys when generating new ones now also works properly on
|
||||||
Windows.
|
Windows.
|
||||||
|
|
||||||
Thanks to Nick Hibma for his contribution to this version of tinc.
|
|
||||||
|
|
||||||
Version 1.0.16 July 23 2011
|
Version 1.0.16 July 23 2011
|
||||||
|
|
||||||
* Fixed a performance issue with TCP communication under Windows.
|
* Fixed a performance issue with TCP communication under Windows.
|
||||||
|
|
@ -371,7 +165,7 @@ Version 1.0.9 Dec 26 2008
|
||||||
|
|
||||||
* Enable path MTU discovery by default.
|
* Enable path MTU discovery by default.
|
||||||
|
|
||||||
* Fixed a memory leak that occurred when connections were closed.
|
* Fixed a memory leak that occured when connections were closed.
|
||||||
|
|
||||||
Thanks to Max Rijevski for his contributions to this version of tinc.
|
Thanks to Max Rijevski for his contributions to this version of tinc.
|
||||||
|
|
||||||
|
|
|
||||||
66
README
66
README
|
|
@ -1,7 +1,7 @@
|
||||||
This is the README file for tinc version 1.0.36. Installation
|
This is the README file for tinc version 1.0.19. Installation
|
||||||
instructions may be found in the INSTALL file.
|
instructions may be found in the INSTALL file.
|
||||||
|
|
||||||
tinc is Copyright (C) 1998-2019 by:
|
tinc is Copyright (C) 1998-2012 by:
|
||||||
|
|
||||||
Ivo Timmermans,
|
Ivo Timmermans,
|
||||||
Guus Sliepen <guus@tinc-vpn.org>,
|
Guus Sliepen <guus@tinc-vpn.org>,
|
||||||
|
|
@ -36,53 +36,47 @@ writeup describing various security issues in several VPN daemons. He showed
|
||||||
that tinc lacks perfect forward security, the connection authentication could
|
that tinc lacks perfect forward security, the connection authentication could
|
||||||
be done more properly, that the sequence number we use as an IV is not the best
|
be done more properly, that the sequence number we use as an IV is not the best
|
||||||
practice and that the default length of the HMAC for packets is too short in
|
practice and that the default length of the HMAC for packets is too short in
|
||||||
his opinion. We do not know of a way to exploit these weaknesses, but these
|
his opinion. We do not know of a way to exploit these weaknesses, but we will
|
||||||
issues are being addressed in the tinc 1.1 branch.
|
address these issues in tinc 2.0.
|
||||||
|
|
||||||
The Sweet32 attack affects versions of tinc prior to 1.0.30.
|
|
||||||
|
|
||||||
On September 6th, 2018, Michael Yonly contacted us and provided
|
|
||||||
proof-of-concept code that allowed a remote attacker to create an
|
|
||||||
authenticated, one-way connection with a node, and also that there was a
|
|
||||||
possibility for a man-in-the-middle to force UDP packets from a node to be sent
|
|
||||||
in plaintext. The first issue was trivial to exploit on tinc versions prior to
|
|
||||||
1.0.30, but the changes in 1.0.30 to mitigate the Sweet32 attack made this
|
|
||||||
weakness much harder to exploit. These issues have been fixed in tinc 1.0.35.
|
|
||||||
The new protocol in the tinc 1.1 branch is not susceptible to these issues.
|
|
||||||
|
|
||||||
Cryptography is a hard thing to get right. We cannot make any
|
Cryptography is a hard thing to get right. We cannot make any
|
||||||
guarantees. Time, review and feedback are the only things that can
|
guarantees. Time, review and feedback are the only things that can
|
||||||
prove the security of any cryptographic product. If you wish to review
|
prove the security of any cryptographic product. If you wish to review
|
||||||
tinc or give us feedback, you are strongly encouraged to do so.
|
tinc or give us feedback, you are stronly encouraged to do so.
|
||||||
|
|
||||||
|
|
||||||
|
Changes to configuration file format since 1.0pre5
|
||||||
|
--------------------------------------------------
|
||||||
|
|
||||||
|
Some configuration variables have different names now. Most notably "TapDevice"
|
||||||
|
should be changed into "Device", and "Device" should be changed into
|
||||||
|
"BindToDevice".
|
||||||
|
|
||||||
Compatibility
|
Compatibility
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
Version 1.0.35 is compatible with 1.0pre8, 1.0 and later, but not with older
|
Version 1.0.19 is compatible with 1.0pre8, 1.0 and later, but not with older
|
||||||
versions of tinc. Note that since version 1.0.30, tinc requires all nodes in
|
versions of tinc.
|
||||||
the VPN to be compiled with a version of LibreSSL or OpenSSL that supports the
|
|
||||||
AES256 and SHA256 algorithms.
|
|
||||||
|
|
||||||
|
|
||||||
Requirements
|
Requirements
|
||||||
------------
|
------------
|
||||||
|
|
||||||
The OpenSSL library is used for all cryptographic functions. You can find it at
|
Since 1.0pre3, we use OpenSSL for all cryptographic functions. So you
|
||||||
https://www.openssl.org/. You will need version 1.0.1 or later with support for
|
need to install this library first; grab it from
|
||||||
AES256 and SHA256 enabled. If this library is not installed on your system, the
|
http://www.openssl.org/. You will need version 0.9.7 or later. If
|
||||||
configure script will fail. The manual in doc/tinc.texi contains more detailed
|
this library is not installed on you system, configure will fail. The
|
||||||
information on how to install this library. Alternatively, you may also use the
|
manual in doc/tinc.texi contains more detailed information on how to
|
||||||
LibreSSL library.
|
install this library.
|
||||||
|
|
||||||
The zlib library is used for optional compression. You can
|
Since 1.0pre6, the zlib library is used for optional compression. You can
|
||||||
find it at https://zlib.net/. Because of a possible exploit in
|
find it at http://www.gzip.org/zlib/. Because of a possible exploit in
|
||||||
earlier versions we recommend that you download version 1.1.4 or later.
|
earlier versions we recommend that you download version 1.1.4 or later.
|
||||||
|
|
||||||
The LZO library is also used for optional compression. You can
|
Since 1.0, the lzo library is also used for optional compression. You can
|
||||||
find it at https://www.oberhumer.com/opensource/lzo/.
|
find it at http://www.oberhumer.com/opensource/lzo/.
|
||||||
|
|
||||||
In order to compile tinc, you will need a C99 compliant compiler.
|
In order to compile tinc, you will need a GNU C compiler environment.
|
||||||
|
|
||||||
|
|
||||||
Features
|
Features
|
||||||
|
|
@ -112,14 +106,14 @@ Linux, FreeBSD and Windows.
|
||||||
The algorithms used for encryption and generating message authentication codes
|
The algorithms used for encryption and generating message authentication codes
|
||||||
can now be changed in the configuration files. All cipher and digest algorithms
|
can now be changed in the configuration files. All cipher and digest algorithms
|
||||||
supported by OpenSSL can be used. Useful ciphers are "blowfish" (default),
|
supported by OpenSSL can be used. Useful ciphers are "blowfish" (default),
|
||||||
"bf-ofb", "des", "des3", et cetera. Useful digests are "sha1" (default), "md5",
|
"bf-ofb", "des", "des3", etcetera. Useful digests are "sha1" (default), "md5",
|
||||||
et cetera.
|
etcetera.
|
||||||
|
|
||||||
Support for routing IPv6 packets has been added. Just add Subnet lines with
|
Support for routing IPv6 packets has been added. Just add Subnet lines with
|
||||||
IPv6 addresses (without using :: abbreviations) and use ifconfig or ip (from
|
IPv6 addresses (without using :: abbreviations) and use ifconfig or ip (from
|
||||||
the iproute package) to give the virtual network interface corresponding IPv6
|
the iproute package) to give the virtual network interface corresponding IPv6
|
||||||
addresses. tinc does not provide autoconfiguration for IPv6 hosts. Consider
|
addresses. tinc does not provide autoconfiguration for IPv6 hosts, if you need
|
||||||
using radvd or zebra if you need it.
|
it use radvd or zebra.
|
||||||
|
|
||||||
It is also possible to make tunnels to other tinc daemons over IPv6 networks,
|
It is also possible to make tunnels to other tinc daemons over IPv6 networks,
|
||||||
if the operating system supports IPv6. tinc will automatically use both IPv6
|
if the operating system supports IPv6. tinc will automatically use both IPv6
|
||||||
|
|
@ -127,7 +121,7 @@ and IPv4 when available, but this can be changed by adding the option
|
||||||
"AddressFamily = ipv4" or "AddressFamily = ipv6" to the tinc.conf file.
|
"AddressFamily = ipv4" or "AddressFamily = ipv6" to the tinc.conf file.
|
||||||
|
|
||||||
Normally, when started tinc will detach and run in the background. In a native
|
Normally, when started tinc will detach and run in the background. In a native
|
||||||
Windows environment this means tinc will install itself as a service, which will
|
Windows environment this means tinc will intall itself as a service, which will
|
||||||
restart after reboots. To prevent tinc from detaching or running as a service,
|
restart after reboots. To prevent tinc from detaching or running as a service,
|
||||||
use the -D option.
|
use the -D option.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,25 +0,0 @@
|
||||||
Quick how-to cross compile tinc for android (done from $HOME/android/):
|
|
||||||
|
|
||||||
- Download android NDK and setup local ARM toolchain:
|
|
||||||
wget http://dl.google.com/android/ndk/android-ndk-r9d-linux-x86.tar.bz2
|
|
||||||
tar xfj android-ndk-r9d-linux-x86.tar.bz2
|
|
||||||
./android-ndk-r9d/build/tools/make-standalone-toolchain.sh --platform=android-5 --install-dir=/tmp/my-android-toolchain
|
|
||||||
|
|
||||||
- Download and cross-compile openSSL for ARM:
|
|
||||||
wget http://www.openssl.org/source/openssl-1.0.1h.tar.gz
|
|
||||||
tar xfz openssl-1.0.1h.tar.gz
|
|
||||||
cd openssl-1.0.1h
|
|
||||||
./Configure dist
|
|
||||||
make CC=/tmp/my-android-toolchain/bin/arm-linux-androideabi-gcc AR="/tmp/my-android-toolchain/bin/arm-linux-androideabi-ar r" RANLIB=/tmp/my-android-toolchain/bin/arm-linux-androideabi-ranlib
|
|
||||||
cd -
|
|
||||||
|
|
||||||
- Clone and cross-compile tinc:
|
|
||||||
git clone git://tinc-vpn.org/tinc
|
|
||||||
cd tinc
|
|
||||||
autoreconf -fsi
|
|
||||||
CC=/tmp/my-android-toolchain/bin/arm-linux-androideabi-gcc ./configure --host=arm-linux --disable-lzo --with-openssl-lib=$HOME/android/openssl-1.0.1g --with-openssl-include=$HOME/android/openssl-1.0.1g/include/ --disable-hardening
|
|
||||||
make -j5
|
|
||||||
|
|
||||||
- Strip tincd binary to make it smaller
|
|
||||||
/tmp/my-android-toolchain/bin/arm-linux-androideabi-strip src/tincd
|
|
||||||
|
|
||||||
81
THANKS
81
THANKS
|
|
@ -1,126 +1,51 @@
|
||||||
We would like to thank the following people for their contributions to tinc:
|
We would like to thank the following people for their contributions to tinc:
|
||||||
|
|
||||||
* Alexander Reil and Gemeinde Berg
|
* Alexander Reil and Gemeinde Berg
|
||||||
* Alexander Ried
|
|
||||||
* Alexis Hildebrandt
|
|
||||||
* Allesandro Gatti
|
* Allesandro Gatti
|
||||||
* Andreas van Cranenburgh
|
* Andreas van Cranenburgh
|
||||||
* Andrew Hahn
|
|
||||||
* Anthony G. Basile
|
* Anthony G. Basile
|
||||||
* Armijn Hemel
|
* Armijn Hemel
|
||||||
* Armin Fisslthaler
|
|
||||||
* Aron Cowan
|
|
||||||
* Ashish Bajaj
|
|
||||||
* Baptiste Jonglez
|
|
||||||
* Borg
|
|
||||||
* Brandon Black
|
* Brandon Black
|
||||||
* Cheng LI
|
|
||||||
* Cris van Pelt
|
* Cris van Pelt
|
||||||
* Darius Jahandarie
|
|
||||||
* Dato Simó
|
|
||||||
* David Pflug
|
|
||||||
* Delf Eldkraft
|
* Delf Eldkraft
|
||||||
* Dennis Joachimsthaler
|
|
||||||
* dnk
|
* dnk
|
||||||
* Егор Палкин
|
|
||||||
* Élie Bouttier
|
|
||||||
* Enrique Zanardi
|
* Enrique Zanardi
|
||||||
* Erik Tews
|
|
||||||
* Etienne Dechamps
|
|
||||||
* Florent Clairambault
|
|
||||||
* Florian Forster
|
|
||||||
* Florian Klink
|
|
||||||
* Florian Weik
|
|
||||||
* Flynn Marquardt
|
* Flynn Marquardt
|
||||||
* Franz Pletz
|
|
||||||
* Gary Kessler and Claudia Gonzalez
|
|
||||||
* Grzegorz Dymarek
|
* Grzegorz Dymarek
|
||||||
* Gusariev Oleksandr
|
|
||||||
* Hans Bayle
|
* Hans Bayle
|
||||||
* Harvest
|
|
||||||
* Ivo van Dong
|
* Ivo van Dong
|
||||||
* Ivo Smits
|
|
||||||
* James Cook
|
|
||||||
* James MacLean
|
* James MacLean
|
||||||
* Jamie Briggs
|
* Jamie Briggs
|
||||||
* Jan Štembera
|
|
||||||
* Jason Harper
|
* Jason Harper
|
||||||
* Jason Livesay
|
|
||||||
* Jasper Krijgsman
|
|
||||||
* Jelle de Jong
|
|
||||||
* Jeroen Domburg
|
|
||||||
* Jeroen Ubbink
|
* Jeroen Ubbink
|
||||||
* Jerome Etienne
|
* Jerome Etienne
|
||||||
* Jo-Philipp Wich
|
|
||||||
* Jochen Voss
|
|
||||||
* Julien Muchembled
|
* Julien Muchembled
|
||||||
* Lavrans Laading
|
|
||||||
* Loïc Dachary
|
|
||||||
* Loïc Grenié
|
* Loïc Grenié
|
||||||
* Lubomír Bulej
|
* Lubomír Bulej
|
||||||
* luckyhacky
|
|
||||||
* LunarShaddow
|
|
||||||
* Mads Kiilerich
|
* Mads Kiilerich
|
||||||
* Marc A. Lehmann
|
* Marc A. Lehmann
|
||||||
* Mark Glines
|
* Mark Glines
|
||||||
* Mark Petryk
|
|
||||||
* Markus Goetz
|
* Markus Goetz
|
||||||
* Martin Kihlgren
|
* Martin Kihlgren
|
||||||
* Martin Schobert
|
|
||||||
* Martin Schürrer
|
|
||||||
* Martin Weinelt
|
|
||||||
* Matias Carrasco
|
* Matias Carrasco
|
||||||
* Max Rijevski
|
* Max Rijevski
|
||||||
* Menno Smits
|
* Menno Smits
|
||||||
* Mesar Hameed
|
|
||||||
* Michael Taylor
|
|
||||||
* Michael Tokarev
|
* Michael Tokarev
|
||||||
* Michael Yonli
|
|
||||||
* Miles Nordin
|
* Miles Nordin
|
||||||
* Nathan Stratton Treadway
|
|
||||||
* Murat Donmez
|
|
||||||
* Nick Hibma
|
* Nick Hibma
|
||||||
* Nick Patavalis
|
* Nick Patavalis
|
||||||
* Paul Littlefield
|
* Paul Littlefield
|
||||||
* Philipp Babel
|
|
||||||
* Pierre Emeriaud
|
|
||||||
* Pierre-Olivier Mercier
|
|
||||||
* Rafael Wolf
|
|
||||||
* Rafael Sadowski
|
|
||||||
* Rafał Leśniak
|
|
||||||
* Rhosyn Celyn
|
|
||||||
* Robert van der Meulen
|
* Robert van der Meulen
|
||||||
* Robert Waniek
|
|
||||||
* Rumko
|
* Rumko
|
||||||
* Ryan Miller
|
|
||||||
* Sam Bryan
|
|
||||||
* Samuel Thibault
|
|
||||||
* Saverio Proto
|
|
||||||
* Scott Lamb
|
* Scott Lamb
|
||||||
* Steffan Karger
|
|
||||||
* Stig Fagrell
|
|
||||||
* Sven-Haegar Koch
|
* Sven-Haegar Koch
|
||||||
* Teemu Kiviniemi
|
* Teemu Kiviniemi
|
||||||
* Thomas Tsiakalakis
|
|
||||||
* Timothy Redaelli
|
* Timothy Redaelli
|
||||||
* Tomasz Fortuna
|
|
||||||
* Tomislav Čohar
|
|
||||||
* Tommy Arnkværn
|
|
||||||
* Tonnerre Lombard
|
* Tonnerre Lombard
|
||||||
* Ulrich Seifert
|
|
||||||
* Vil Brekin
|
|
||||||
* Vincent Laurent
|
|
||||||
* Vittorio Gambaletta
|
|
||||||
* Wendy Willard
|
|
||||||
* Wessel Dankers
|
* Wessel Dankers
|
||||||
* William A. Kennington III
|
|
||||||
* William McArthur
|
|
||||||
* Wouter van Heyst
|
* Wouter van Heyst
|
||||||
* xentec
|
|
||||||
* 戴 鸣
|
|
||||||
|
|
||||||
And everyone we forgot (if we did, please let us know). Thank you!
|
And everyone we forgot. Thank you!
|
||||||
|
|
||||||
---
|
Ivo Timmermans
|
||||||
Ivo Timmermans,
|
Guus Sliepen
|
||||||
Guus Sliepen.
|
|
||||||
|
|
|
||||||
753
aclocal.m4
vendored
753
aclocal.m4
vendored
File diff suppressed because it is too large
Load diff
348
compile
348
compile
|
|
@ -1,348 +0,0 @@
|
||||||
#! /bin/sh
|
|
||||||
# Wrapper for compilers which do not understand '-c -o'.
|
|
||||||
|
|
||||||
scriptversion=2018-03-07.03; # UTC
|
|
||||||
|
|
||||||
# Copyright (C) 1999-2020 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 <https://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* | MSYS*)
|
|
||||||
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/* | msys/*)
|
|
||||||
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 | \
|
|
||||||
icl | *[/\\]icl | icl.exe | *[/\\]icl.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 'before-save-hook 'time-stamp)
|
|
||||||
# time-stamp-start: "scriptversion="
|
|
||||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
|
||||||
# time-stamp-time-zone: "UTC0"
|
|
||||||
# time-stamp-end: "; # UTC"
|
|
||||||
# End:
|
|
||||||
912
config.guess
vendored
912
config.guess
vendored
File diff suppressed because it is too large
Load diff
128
config.h.in
128
config.h.in
|
|
@ -1,4 +1,12 @@
|
||||||
/* config.h.in. Generated from configure.ac by autoheader. */
|
/* config.h.in. Generated from configure.in by autoheader. */
|
||||||
|
|
||||||
|
/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
|
||||||
|
systems. This function is required for `alloca.c' support on those systems.
|
||||||
|
*/
|
||||||
|
#undef CRAY_STACKSEG_END
|
||||||
|
|
||||||
|
/* Define to 1 if using `alloca.c'. */
|
||||||
|
#undef C_ALLOCA
|
||||||
|
|
||||||
/* Support for jumbograms (packets up to 9000 bytes) */
|
/* Support for jumbograms (packets up to 9000 bytes) */
|
||||||
#undef ENABLE_JUMBOGRAMS
|
#undef ENABLE_JUMBOGRAMS
|
||||||
|
|
@ -12,18 +20,19 @@
|
||||||
/* Support for VDE */
|
/* Support for VDE */
|
||||||
#undef ENABLE_VDE
|
#undef ENABLE_VDE
|
||||||
|
|
||||||
|
/* Define to 1 if you have `alloca', as a function or macro. */
|
||||||
|
#undef HAVE_ALLOCA
|
||||||
|
|
||||||
|
/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
|
||||||
|
*/
|
||||||
|
#undef HAVE_ALLOCA_H
|
||||||
|
|
||||||
/* Define to 1 if you have the <arpa/inet.h> header file. */
|
/* Define to 1 if you have the <arpa/inet.h> header file. */
|
||||||
#undef HAVE_ARPA_INET_H
|
#undef HAVE_ARPA_INET_H
|
||||||
|
|
||||||
/* Define to 1 if you have the <arpa/nameser.h> header file. */
|
|
||||||
#undef HAVE_ARPA_NAMESER_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `asprintf' function. */
|
/* Define to 1 if you have the `asprintf' function. */
|
||||||
#undef HAVE_ASPRINTF
|
#undef HAVE_ASPRINTF
|
||||||
|
|
||||||
/* Define to 1 if you have the `BN_GENCB_new' function. */
|
|
||||||
#undef HAVE_BN_GENCB_NEW
|
|
||||||
|
|
||||||
/* Unknown BSD variant */
|
/* Unknown BSD variant */
|
||||||
#undef HAVE_BSD
|
#undef HAVE_BSD
|
||||||
|
|
||||||
|
|
@ -36,10 +45,6 @@
|
||||||
/* Darwin (MacOS/X) */
|
/* Darwin (MacOS/X) */
|
||||||
#undef HAVE_DARWIN
|
#undef HAVE_DARWIN
|
||||||
|
|
||||||
/* Define to 1 if you have the declaration of `EVP_aes_256_cfb', and to 0 if
|
|
||||||
you don't. */
|
|
||||||
#undef HAVE_DECL_EVP_AES_256_CFB
|
|
||||||
|
|
||||||
/* Define to 1 if you have the declaration of `freeaddrinfo', and to 0 if you
|
/* Define to 1 if you have the declaration of `freeaddrinfo', and to 0 if you
|
||||||
don't. */
|
don't. */
|
||||||
#undef HAVE_DECL_FREEADDRINFO
|
#undef HAVE_DECL_FREEADDRINFO
|
||||||
|
|
@ -56,35 +61,18 @@
|
||||||
don't. */
|
don't. */
|
||||||
#undef HAVE_DECL_GETNAMEINFO
|
#undef HAVE_DECL_GETNAMEINFO
|
||||||
|
|
||||||
/* Define to 1 if you have the declaration of `OpenSSL_add_all_algorithms',
|
|
||||||
and to 0 if you don't. */
|
|
||||||
#undef HAVE_DECL_OPENSSL_ADD_ALL_ALGORITHMS
|
|
||||||
|
|
||||||
/* Define to 1 if you have the declaration of `res_init', and to 0 if you
|
|
||||||
don't. */
|
|
||||||
#undef HAVE_DECL_RES_INIT
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `devname' function. */
|
|
||||||
#undef HAVE_DEVNAME
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <dirent.h> header file. */
|
/* Define to 1 if you have the <dirent.h> header file. */
|
||||||
#undef HAVE_DIRENT_H
|
#undef HAVE_DIRENT_H
|
||||||
|
|
||||||
/* DragonFly */
|
/* DragonFly */
|
||||||
#undef HAVE_DRAGONFLY
|
#undef HAVE_DRAGONFLY
|
||||||
|
|
||||||
/* Define to 1 if you have the `EVP_CIPHER_CTX_new' function. */
|
|
||||||
#undef HAVE_EVP_CIPHER_CTX_NEW
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `EVP_EncryptInit_ex' function. */
|
/* Define to 1 if you have the `EVP_EncryptInit_ex' function. */
|
||||||
#undef HAVE_EVP_ENCRYPTINIT_EX
|
#undef HAVE_EVP_ENCRYPTINIT_EX
|
||||||
|
|
||||||
/* Define to 1 if you have the `fchmod' function. */
|
/* Define to 1 if you have the `fchmod' function. */
|
||||||
#undef HAVE_FCHMOD
|
#undef HAVE_FCHMOD
|
||||||
|
|
||||||
/* Define to 1 if you have the `fdevname' function. */
|
|
||||||
#undef HAVE_FDEVNAME
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `flock' function. */
|
/* Define to 1 if you have the `flock' function. */
|
||||||
#undef HAVE_FLOCK
|
#undef HAVE_FLOCK
|
||||||
|
|
||||||
|
|
@ -94,24 +82,21 @@
|
||||||
/* FreeBSD */
|
/* FreeBSD */
|
||||||
#undef HAVE_FREEBSD
|
#undef HAVE_FREEBSD
|
||||||
|
|
||||||
/* Define to 1 if you have the <getopt.h> header file. */
|
/* Define to 1 if you have the `ftime' function. */
|
||||||
#undef HAVE_GETOPT_H
|
#undef HAVE_FTIME
|
||||||
|
|
||||||
/* getopt_long() */
|
|
||||||
#undef HAVE_GETOPT_LONG
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `gettimeofday' function. */
|
/* Define to 1 if you have the `gettimeofday' function. */
|
||||||
#undef HAVE_GETTIMEOFDAY
|
#undef HAVE_GETTIMEOFDAY
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `get_current_dir_name' function. */
|
||||||
|
#undef HAVE_GET_CURRENT_DIR_NAME
|
||||||
|
|
||||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||||
#undef HAVE_INTTYPES_H
|
#undef HAVE_INTTYPES_H
|
||||||
|
|
||||||
/* Define to 1 if you have the `nsl' library (-lnsl). */
|
/* Define to 1 if you have the `nsl' library (-lnsl). */
|
||||||
#undef HAVE_LIBNSL
|
#undef HAVE_LIBNSL
|
||||||
|
|
||||||
/* Define to 1 if you have the `resolv' library (-lresolv). */
|
|
||||||
#undef HAVE_LIBRESOLV
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `socket' library (-lsocket). */
|
/* Define to 1 if you have the `socket' library (-lsocket). */
|
||||||
#undef HAVE_LIBSOCKET
|
#undef HAVE_LIBSOCKET
|
||||||
|
|
||||||
|
|
@ -136,6 +121,10 @@
|
||||||
/* Define to 1 if you have the <lzo/lzo1x.h> header file. */
|
/* Define to 1 if you have the <lzo/lzo1x.h> header file. */
|
||||||
#undef HAVE_LZO_LZO1X_H
|
#undef HAVE_LZO_LZO1X_H
|
||||||
|
|
||||||
|
/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
|
||||||
|
to 0 otherwise. */
|
||||||
|
#undef HAVE_MALLOC
|
||||||
|
|
||||||
/* Define to 1 if you have the <memory.h> header file. */
|
/* Define to 1 if you have the <memory.h> header file. */
|
||||||
#undef HAVE_MEMORY_H
|
#undef HAVE_MEMORY_H
|
||||||
|
|
||||||
|
|
@ -199,9 +188,6 @@
|
||||||
/* Define to 1 if you have the <net/if_types.h> header file. */
|
/* Define to 1 if you have the <net/if_types.h> header file. */
|
||||||
#undef HAVE_NET_IF_TYPES_H
|
#undef HAVE_NET_IF_TYPES_H
|
||||||
|
|
||||||
/* Define to 1 if you have the <net/if_utun.h> header file. */
|
|
||||||
#undef HAVE_NET_IF_UTUN_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <net/tap/if_tap.h> header file. */
|
/* Define to 1 if you have the <net/tap/if_tap.h> header file. */
|
||||||
#undef HAVE_NET_TAP_IF_TAP_H
|
#undef HAVE_NET_TAP_IF_TAP_H
|
||||||
|
|
||||||
|
|
@ -238,14 +224,18 @@
|
||||||
/* Define to 1 if you have the `putenv' function. */
|
/* Define to 1 if you have the `putenv' function. */
|
||||||
#undef HAVE_PUTENV
|
#undef HAVE_PUTENV
|
||||||
|
|
||||||
/* Define to 1 if you have the `RAND_bytes' function. */
|
/* Define to 1 if you have the `random' function. */
|
||||||
#undef HAVE_RAND_BYTES
|
#undef HAVE_RANDOM
|
||||||
|
|
||||||
/* Define to 1 if you have the <resolv.h> header file. */
|
/* Define to 1 if you have the `RAND_pseudo_bytes' function. */
|
||||||
#undef HAVE_RESOLV_H
|
#undef HAVE_RAND_PSEUDO_BYTES
|
||||||
|
|
||||||
/* Define to 1 if you have the `RSA_set0_key' function. */
|
/* Define to 1 if your system has a GNU libc compatible `realloc' function,
|
||||||
#undef HAVE_RSA_SET0_KEY
|
and to 0 otherwise. */
|
||||||
|
#undef HAVE_REALLOC
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `select' function. */
|
||||||
|
#undef HAVE_SELECT
|
||||||
|
|
||||||
/* Define to 1 if the system has the type `socklen_t'. */
|
/* Define to 1 if the system has the type `socklen_t'. */
|
||||||
#undef HAVE_SOCKLEN_T
|
#undef HAVE_SOCKLEN_T
|
||||||
|
|
@ -253,12 +243,21 @@
|
||||||
/* Solaris/SunOS */
|
/* Solaris/SunOS */
|
||||||
#undef HAVE_SOLARIS
|
#undef HAVE_SOLARIS
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <stdbool.h> header file. */
|
||||||
|
#undef HAVE_STDBOOL_H
|
||||||
|
|
||||||
/* Define to 1 if you have the <stdint.h> header file. */
|
/* Define to 1 if you have the <stdint.h> header file. */
|
||||||
#undef HAVE_STDINT_H
|
#undef HAVE_STDINT_H
|
||||||
|
|
||||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||||
#undef HAVE_STDLIB_H
|
#undef HAVE_STDLIB_H
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `strdup' function. */
|
||||||
|
#undef HAVE_STRDUP
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `strerror' function. */
|
||||||
|
#undef HAVE_STRERROR
|
||||||
|
|
||||||
/* Define to 1 if you have the <strings.h> header file. */
|
/* Define to 1 if you have the <strings.h> header file. */
|
||||||
#undef HAVE_STRINGS_H
|
#undef HAVE_STRINGS_H
|
||||||
|
|
||||||
|
|
@ -268,6 +267,9 @@
|
||||||
/* Define to 1 if you have the `strsignal' function. */
|
/* Define to 1 if you have the `strsignal' function. */
|
||||||
#undef HAVE_STRSIGNAL
|
#undef HAVE_STRSIGNAL
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `strtol' function. */
|
||||||
|
#undef HAVE_STRTOL
|
||||||
|
|
||||||
/* Define to 1 if the system has the type `struct addrinfo'. */
|
/* Define to 1 if the system has the type `struct addrinfo'. */
|
||||||
#undef HAVE_STRUCT_ADDRINFO
|
#undef HAVE_STRUCT_ADDRINFO
|
||||||
|
|
||||||
|
|
@ -346,6 +348,9 @@
|
||||||
/* Define to 1 if you have the <sys/wait.h> header file. */
|
/* Define to 1 if you have the <sys/wait.h> header file. */
|
||||||
#undef HAVE_SYS_WAIT_H
|
#undef HAVE_SYS_WAIT_H
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <time.h> header file. */
|
||||||
|
#undef HAVE_TIME_H
|
||||||
|
|
||||||
/* Define to 1 if you have the <unistd.h> header file. */
|
/* Define to 1 if you have the <unistd.h> header file. */
|
||||||
#undef HAVE_UNISTD_H
|
#undef HAVE_UNISTD_H
|
||||||
|
|
||||||
|
|
@ -358,6 +363,9 @@
|
||||||
/* Define to 1 if you have the `vsyslog' function. */
|
/* Define to 1 if you have the `vsyslog' function. */
|
||||||
#undef HAVE_VSYSLOG
|
#undef HAVE_VSYSLOG
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `writev' function. */
|
||||||
|
#undef HAVE_WRITEV
|
||||||
|
|
||||||
/* have zlib compression support */
|
/* have zlib compression support */
|
||||||
#undef HAVE_ZLIB
|
#undef HAVE_ZLIB
|
||||||
|
|
||||||
|
|
@ -391,9 +399,23 @@
|
||||||
/* Define as the return type of signal handlers (`int' or `void'). */
|
/* Define as the return type of signal handlers (`int' or `void'). */
|
||||||
#undef RETSIGTYPE
|
#undef RETSIGTYPE
|
||||||
|
|
||||||
|
/* If using the C implementation of alloca, define if you know the
|
||||||
|
direction of stack growth for your system; otherwise it will be
|
||||||
|
automatically deduced at runtime.
|
||||||
|
STACK_DIRECTION > 0 => grows toward higher addresses
|
||||||
|
STACK_DIRECTION < 0 => grows toward lower addresses
|
||||||
|
STACK_DIRECTION = 0 => direction of growth unknown */
|
||||||
|
#undef STACK_DIRECTION
|
||||||
|
|
||||||
/* Define to 1 if you have the ANSI C header files. */
|
/* Define to 1 if you have the ANSI C header files. */
|
||||||
#undef STDC_HEADERS
|
#undef STDC_HEADERS
|
||||||
|
|
||||||
|
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
|
||||||
|
#undef TIME_WITH_SYS_TIME
|
||||||
|
|
||||||
|
/* Define to 1 if your <sys/time.h> declares `struct tm'. */
|
||||||
|
#undef TM_IN_SYS_TIME
|
||||||
|
|
||||||
/* Enable extensions on AIX 3, Interix. */
|
/* Enable extensions on AIX 3, Interix. */
|
||||||
#ifndef _ALL_SOURCE
|
#ifndef _ALL_SOURCE
|
||||||
# undef _ALL_SOURCE
|
# undef _ALL_SOURCE
|
||||||
|
|
@ -438,5 +460,21 @@
|
||||||
/* Defined if the __malloc__ attribute is not supported. */
|
/* Defined if the __malloc__ attribute is not supported. */
|
||||||
#undef __malloc__
|
#undef __malloc__
|
||||||
|
|
||||||
|
/* Define to empty if `const' does not conform to ANSI C. */
|
||||||
|
#undef const
|
||||||
|
|
||||||
|
/* Define to rpl_malloc if the replacement function should be used. */
|
||||||
|
#undef malloc
|
||||||
|
|
||||||
/* Define to `int' if <sys/types.h> does not define. */
|
/* Define to `int' if <sys/types.h> does not define. */
|
||||||
#undef pid_t
|
#undef pid_t
|
||||||
|
|
||||||
|
/* Define to rpl_realloc if the replacement function should be used. */
|
||||||
|
#undef realloc
|
||||||
|
|
||||||
|
/* Define to `unsigned int' if <sys/types.h> does not define. */
|
||||||
|
#undef size_t
|
||||||
|
|
||||||
|
/* Define to empty if the keyword `volatile' does not work. Warning: valid
|
||||||
|
code using `volatile' can become incorrect without. Disable with care. */
|
||||||
|
#undef volatile
|
||||||
|
|
|
||||||
407
config.sub
vendored
407
config.sub
vendored
|
|
@ -1,31 +1,36 @@
|
||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# Configuration validation subroutine script.
|
# Configuration validation subroutine script.
|
||||||
# Copyright 1992-2018 Free Software Foundation, Inc.
|
# 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.
|
||||||
|
|
||||||
timestamp='2018-02-22'
|
timestamp='2012-04-18'
|
||||||
|
|
||||||
# This file is free software; you can redistribute it and/or modify it
|
# This file is (in principle) common to ALL GNU software.
|
||||||
# under the terms of the GNU General Public License as published by
|
# The presence of a machine in this file suggests that SOME GNU software
|
||||||
# the Free Software Foundation; either version 3 of the License, or
|
# 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
|
||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful, but
|
# This program is distributed in the hope that it will be useful,
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, see <https://www.gnu.org/licenses/>.
|
# along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
# As a special exception to the GNU General Public License, if you
|
# As a special exception to the GNU General Public License, if you
|
||||||
# distribute this file as part of a program that contains a
|
# distribute this file as part of a program that contains a
|
||||||
# configuration script generated by Autoconf, you may include it under
|
# configuration script generated by Autoconf, you may include it under
|
||||||
# the same distribution terms that you use for the rest of that
|
# the same distribution terms that you use for the rest of that program.
|
||||||
# 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>.
|
# Please send patches to <config-patches@gnu.org>. Submit a context
|
||||||
|
# diff and a properly formatted GNU ChangeLog entry.
|
||||||
#
|
#
|
||||||
# Configuration subroutine to validate and canonicalize a configuration type.
|
# Configuration subroutine to validate and canonicalize a configuration type.
|
||||||
# Supply the specified configuration type as an argument.
|
# Supply the specified configuration type as an argument.
|
||||||
|
|
@ -33,7 +38,7 @@ timestamp='2018-02-22'
|
||||||
# Otherwise, we print the canonical config type on stdout and succeed.
|
# Otherwise, we print the canonical config type on stdout and succeed.
|
||||||
|
|
||||||
# You can get the latest version of this script from:
|
# You can get the latest version of this script from:
|
||||||
# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
|
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
|
||||||
|
|
||||||
# This file is supposed to be the same for all GNU packages
|
# This file is supposed to be the same for all GNU packages
|
||||||
# and recognize all the CPU types, system types and aliases
|
# and recognize all the CPU types, system types and aliases
|
||||||
|
|
@ -53,11 +58,12 @@ timestamp='2018-02-22'
|
||||||
me=`echo "$0" | sed -e 's,.*/,,'`
|
me=`echo "$0" | sed -e 's,.*/,,'`
|
||||||
|
|
||||||
usage="\
|
usage="\
|
||||||
Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
|
Usage: $0 [OPTION] CPU-MFR-OPSYS
|
||||||
|
$0 [OPTION] ALIAS
|
||||||
|
|
||||||
Canonicalize a configuration name.
|
Canonicalize a configuration name.
|
||||||
|
|
||||||
Options:
|
Operation modes:
|
||||||
-h, --help print this help, then exit
|
-h, --help print this help, then exit
|
||||||
-t, --time-stamp print date of last modification, then exit
|
-t, --time-stamp print date of last modification, then exit
|
||||||
-v, --version print version number, then exit
|
-v, --version print version number, then exit
|
||||||
|
|
@ -67,7 +73,9 @@ Report bugs and patches to <config-patches@gnu.org>."
|
||||||
version="\
|
version="\
|
||||||
GNU config.sub ($timestamp)
|
GNU config.sub ($timestamp)
|
||||||
|
|
||||||
Copyright 1992-2018 Free Software Foundation, Inc.
|
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.
|
||||||
|
|
||||||
This is free software; see the source for copying conditions. There is NO
|
This is free software; see the source for copying conditions. There is NO
|
||||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
||||||
|
|
@ -94,7 +102,7 @@ while test $# -gt 0 ; do
|
||||||
|
|
||||||
*local*)
|
*local*)
|
||||||
# First pass through any local machine types.
|
# First pass through any local machine types.
|
||||||
echo "$1"
|
echo $1
|
||||||
exit ;;
|
exit ;;
|
||||||
|
|
||||||
* )
|
* )
|
||||||
|
|
@ -112,24 +120,24 @@ esac
|
||||||
|
|
||||||
# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
|
# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
|
||||||
# Here we must recognize all the valid KERNEL-OS combinations.
|
# Here we must recognize all the valid KERNEL-OS combinations.
|
||||||
maybe_os=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
|
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
|
||||||
case $maybe_os in
|
case $maybe_os in
|
||||||
nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
|
nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
|
||||||
linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
|
linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
|
||||||
knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
|
knetbsd*-gnu* | netbsd*-gnu* | \
|
||||||
kopensolaris*-gnu* | cloudabi*-eabi* | \
|
kopensolaris*-gnu* | \
|
||||||
storm-chaos* | os2-emx* | rtmk-nova*)
|
storm-chaos* | os2-emx* | rtmk-nova*)
|
||||||
os=-$maybe_os
|
os=-$maybe_os
|
||||||
basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
|
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
|
||||||
;;
|
;;
|
||||||
android-linux)
|
android-linux)
|
||||||
os=-linux-android
|
os=-linux-android
|
||||||
basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
|
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
basic_machine=`echo "$1" | sed 's/-[^-]*$//'`
|
basic_machine=`echo $1 | sed 's/-[^-]*$//'`
|
||||||
if [ "$basic_machine" != "$1" ]
|
if [ $basic_machine != $1 ]
|
||||||
then os=`echo "$1" | sed 's/.*-/-/'`
|
then os=`echo $1 | sed 's/.*-/-/'`
|
||||||
else os=; fi
|
else os=; fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
@ -148,7 +156,7 @@ case $os in
|
||||||
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
|
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
|
||||||
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
|
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
|
||||||
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
|
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
|
||||||
-apple | -axis | -knuth | -cray | -microblaze*)
|
-apple | -axis | -knuth | -cray | -microblaze)
|
||||||
os=
|
os=
|
||||||
basic_machine=$1
|
basic_machine=$1
|
||||||
;;
|
;;
|
||||||
|
|
@ -178,44 +186,44 @@ case $os in
|
||||||
;;
|
;;
|
||||||
-sco6)
|
-sco6)
|
||||||
os=-sco5v6
|
os=-sco5v6
|
||||||
basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
|
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||||
;;
|
;;
|
||||||
-sco5)
|
-sco5)
|
||||||
os=-sco3.2v5
|
os=-sco3.2v5
|
||||||
basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
|
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||||
;;
|
;;
|
||||||
-sco4)
|
-sco4)
|
||||||
os=-sco3.2v4
|
os=-sco3.2v4
|
||||||
basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
|
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||||
;;
|
;;
|
||||||
-sco3.2.[4-9]*)
|
-sco3.2.[4-9]*)
|
||||||
os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
|
os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
|
||||||
basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
|
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||||
;;
|
;;
|
||||||
-sco3.2v[4-9]*)
|
-sco3.2v[4-9]*)
|
||||||
# Don't forget version if it is 3.2v4 or newer.
|
# Don't forget version if it is 3.2v4 or newer.
|
||||||
basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
|
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||||
;;
|
;;
|
||||||
-sco5v6*)
|
-sco5v6*)
|
||||||
# Don't forget version if it is 3.2v4 or newer.
|
# Don't forget version if it is 3.2v4 or newer.
|
||||||
basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
|
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||||
;;
|
;;
|
||||||
-sco*)
|
-sco*)
|
||||||
os=-sco3.2v2
|
os=-sco3.2v2
|
||||||
basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
|
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||||
;;
|
;;
|
||||||
-udk*)
|
-udk*)
|
||||||
basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
|
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||||
;;
|
;;
|
||||||
-isc)
|
-isc)
|
||||||
os=-isc2.2
|
os=-isc2.2
|
||||||
basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
|
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||||
;;
|
;;
|
||||||
-clix*)
|
-clix*)
|
||||||
basic_machine=clipper-intergraph
|
basic_machine=clipper-intergraph
|
||||||
;;
|
;;
|
||||||
-isc*)
|
-isc*)
|
||||||
basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
|
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||||
;;
|
;;
|
||||||
-lynx*178)
|
-lynx*178)
|
||||||
os=-lynxos178
|
os=-lynxos178
|
||||||
|
|
@ -227,7 +235,10 @@ case $os in
|
||||||
os=-lynxos
|
os=-lynxos
|
||||||
;;
|
;;
|
||||||
-ptx*)
|
-ptx*)
|
||||||
basic_machine=`echo "$1" | sed -e 's/86-.*/86-sequent/'`
|
basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
|
||||||
|
;;
|
||||||
|
-windowsnt*)
|
||||||
|
os=`echo $os | sed -e 's/windowsnt/winnt/'`
|
||||||
;;
|
;;
|
||||||
-psos*)
|
-psos*)
|
||||||
os=-psos
|
os=-psos
|
||||||
|
|
@ -248,25 +259,21 @@ case $basic_machine in
|
||||||
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
|
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
|
||||||
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
|
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
|
||||||
| am33_2.0 \
|
| am33_2.0 \
|
||||||
| arc | arceb \
|
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
|
||||||
| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
|
|
||||||
| avr | avr32 \
|
|
||||||
| ba \
|
|
||||||
| be32 | be64 \
|
| be32 | be64 \
|
||||||
| bfin \
|
| bfin \
|
||||||
| c4x | c8051 | clipper \
|
| c4x | clipper \
|
||||||
| d10v | d30v | dlx | dsp16xx \
|
| d10v | d30v | dlx | dsp16xx \
|
||||||
| e2k | epiphany \
|
| epiphany \
|
||||||
| fido | fr30 | frv | ft32 \
|
| fido | fr30 | frv \
|
||||||
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
|
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
|
||||||
| hexagon \
|
| hexagon \
|
||||||
| i370 | i860 | i960 | ia16 | ia64 \
|
| i370 | i860 | i960 | ia64 \
|
||||||
| ip2k | iq2000 \
|
| ip2k | iq2000 \
|
||||||
| k1om \
|
|
||||||
| le32 | le64 \
|
| le32 | le64 \
|
||||||
| lm32 \
|
| lm32 \
|
||||||
| m32c | m32r | m32rle | m68000 | m68k | m88k \
|
| m32c | m32r | m32rle | m68000 | m68k | m88k \
|
||||||
| maxq | mb | microblaze | microblazeel | mcore | mep | metag \
|
| maxq | mb | microblaze | mcore | mep | metag \
|
||||||
| mips | mipsbe | mipseb | mipsel | mipsle \
|
| mips | mipsbe | mipseb | mipsel | mipsle \
|
||||||
| mips16 \
|
| mips16 \
|
||||||
| mips64 | mips64el \
|
| mips64 | mips64el \
|
||||||
|
|
@ -280,30 +287,26 @@ case $basic_machine in
|
||||||
| mips64vr5900 | mips64vr5900el \
|
| mips64vr5900 | mips64vr5900el \
|
||||||
| mipsisa32 | mipsisa32el \
|
| mipsisa32 | mipsisa32el \
|
||||||
| mipsisa32r2 | mipsisa32r2el \
|
| mipsisa32r2 | mipsisa32r2el \
|
||||||
| mipsisa32r6 | mipsisa32r6el \
|
|
||||||
| mipsisa64 | mipsisa64el \
|
| mipsisa64 | mipsisa64el \
|
||||||
| mipsisa64r2 | mipsisa64r2el \
|
| mipsisa64r2 | mipsisa64r2el \
|
||||||
| mipsisa64r6 | mipsisa64r6el \
|
|
||||||
| mipsisa64sb1 | mipsisa64sb1el \
|
| mipsisa64sb1 | mipsisa64sb1el \
|
||||||
| mipsisa64sr71k | mipsisa64sr71kel \
|
| mipsisa64sr71k | mipsisa64sr71kel \
|
||||||
| mipsr5900 | mipsr5900el \
|
|
||||||
| mipstx39 | mipstx39el \
|
| mipstx39 | mipstx39el \
|
||||||
| mn10200 | mn10300 \
|
| mn10200 | mn10300 \
|
||||||
| moxie \
|
| moxie \
|
||||||
| mt \
|
| mt \
|
||||||
| msp430 \
|
| msp430 \
|
||||||
| nds32 | nds32le | nds32be \
|
| nds32 | nds32le | nds32be \
|
||||||
| nios | nios2 | nios2eb | nios2el \
|
| nios | nios2 \
|
||||||
| ns16k | ns32k \
|
| ns16k | ns32k \
|
||||||
| open8 | or1k | or1knd | or32 \
|
| open8 \
|
||||||
| pdp10 | pj | pjl \
|
| or32 \
|
||||||
|
| pdp10 | pdp11 | pj | pjl \
|
||||||
| powerpc | powerpc64 | powerpc64le | powerpcle \
|
| powerpc | powerpc64 | powerpc64le | powerpcle \
|
||||||
| pru \
|
|
||||||
| pyramid \
|
| pyramid \
|
||||||
| riscv32 | riscv64 \
|
|
||||||
| rl78 | rx \
|
| rl78 | rx \
|
||||||
| score \
|
| score \
|
||||||
| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
|
| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
|
||||||
| sh64 | sh64le \
|
| sh64 | sh64le \
|
||||||
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
|
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
|
||||||
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
|
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
|
||||||
|
|
@ -311,8 +314,7 @@ case $basic_machine in
|
||||||
| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
|
| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
|
||||||
| ubicom32 \
|
| ubicom32 \
|
||||||
| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
|
| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
|
||||||
| visium \
|
| we32k \
|
||||||
| wasm32 \
|
|
||||||
| x86 | xc16x | xstormy16 | xtensa \
|
| x86 | xc16x | xstormy16 | xtensa \
|
||||||
| z8k | z80)
|
| z8k | z80)
|
||||||
basic_machine=$basic_machine-unknown
|
basic_machine=$basic_machine-unknown
|
||||||
|
|
@ -326,14 +328,11 @@ case $basic_machine in
|
||||||
c6x)
|
c6x)
|
||||||
basic_machine=tic6x-unknown
|
basic_machine=tic6x-unknown
|
||||||
;;
|
;;
|
||||||
leon|leon[3-9])
|
m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
|
||||||
basic_machine=sparc-$basic_machine
|
|
||||||
;;
|
|
||||||
m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
|
|
||||||
basic_machine=$basic_machine-unknown
|
basic_machine=$basic_machine-unknown
|
||||||
os=-none
|
os=-none
|
||||||
;;
|
;;
|
||||||
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65)
|
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
|
||||||
;;
|
;;
|
||||||
ms1)
|
ms1)
|
||||||
basic_machine=mt-unknown
|
basic_machine=mt-unknown
|
||||||
|
|
@ -362,7 +361,7 @@ case $basic_machine in
|
||||||
;;
|
;;
|
||||||
# Object if more than one company name word.
|
# Object if more than one company name word.
|
||||||
*-*-*)
|
*-*-*)
|
||||||
echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2
|
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
# Recognize the basic CPU types with company name.
|
# Recognize the basic CPU types with company name.
|
||||||
|
|
@ -371,29 +370,26 @@ case $basic_machine in
|
||||||
| aarch64-* | aarch64_be-* \
|
| aarch64-* | aarch64_be-* \
|
||||||
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
|
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
|
||||||
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
|
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
|
||||||
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
|
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
|
||||||
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
|
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
|
||||||
| avr-* | avr32-* \
|
| avr-* | avr32-* \
|
||||||
| ba-* \
|
|
||||||
| be32-* | be64-* \
|
| be32-* | be64-* \
|
||||||
| bfin-* | bs2000-* \
|
| bfin-* | bs2000-* \
|
||||||
| c[123]* | c30-* | [cjt]90-* | c4x-* \
|
| c[123]* | c30-* | [cjt]90-* | c4x-* \
|
||||||
| c8051-* | clipper-* | craynv-* | cydra-* \
|
| clipper-* | craynv-* | cydra-* \
|
||||||
| d10v-* | d30v-* | dlx-* \
|
| d10v-* | d30v-* | dlx-* \
|
||||||
| e2k-* | elxsi-* \
|
| elxsi-* \
|
||||||
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
|
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
|
||||||
| h8300-* | h8500-* \
|
| h8300-* | h8500-* \
|
||||||
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
|
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
|
||||||
| hexagon-* \
|
| hexagon-* \
|
||||||
| i*86-* | i860-* | i960-* | ia16-* | ia64-* \
|
| i*86-* | i860-* | i960-* | ia64-* \
|
||||||
| ip2k-* | iq2000-* \
|
| ip2k-* | iq2000-* \
|
||||||
| k1om-* \
|
|
||||||
| le32-* | le64-* \
|
| le32-* | le64-* \
|
||||||
| lm32-* \
|
| lm32-* \
|
||||||
| m32c-* | m32r-* | m32rle-* \
|
| m32c-* | m32r-* | m32rle-* \
|
||||||
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
|
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
|
||||||
| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
|
| m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
|
||||||
| microblaze-* | microblazeel-* \
|
|
||||||
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
|
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
|
||||||
| mips16-* \
|
| mips16-* \
|
||||||
| mips64-* | mips64el-* \
|
| mips64-* | mips64el-* \
|
||||||
|
|
@ -407,34 +403,28 @@ case $basic_machine in
|
||||||
| mips64vr5900-* | mips64vr5900el-* \
|
| mips64vr5900-* | mips64vr5900el-* \
|
||||||
| mipsisa32-* | mipsisa32el-* \
|
| mipsisa32-* | mipsisa32el-* \
|
||||||
| mipsisa32r2-* | mipsisa32r2el-* \
|
| mipsisa32r2-* | mipsisa32r2el-* \
|
||||||
| mipsisa32r6-* | mipsisa32r6el-* \
|
|
||||||
| mipsisa64-* | mipsisa64el-* \
|
| mipsisa64-* | mipsisa64el-* \
|
||||||
| mipsisa64r2-* | mipsisa64r2el-* \
|
| mipsisa64r2-* | mipsisa64r2el-* \
|
||||||
| mipsisa64r6-* | mipsisa64r6el-* \
|
|
||||||
| mipsisa64sb1-* | mipsisa64sb1el-* \
|
| mipsisa64sb1-* | mipsisa64sb1el-* \
|
||||||
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
|
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
|
||||||
| mipsr5900-* | mipsr5900el-* \
|
|
||||||
| mipstx39-* | mipstx39el-* \
|
| mipstx39-* | mipstx39el-* \
|
||||||
| mmix-* \
|
| mmix-* \
|
||||||
| mt-* \
|
| mt-* \
|
||||||
| msp430-* \
|
| msp430-* \
|
||||||
| nds32-* | nds32le-* | nds32be-* \
|
| nds32-* | nds32le-* | nds32be-* \
|
||||||
| nios-* | nios2-* | nios2eb-* | nios2el-* \
|
| nios-* | nios2-* \
|
||||||
| none-* | np1-* | ns16k-* | ns32k-* \
|
| none-* | np1-* | ns16k-* | ns32k-* \
|
||||||
| open8-* \
|
| open8-* \
|
||||||
| or1k*-* \
|
|
||||||
| orion-* \
|
| orion-* \
|
||||||
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
|
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
|
||||||
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
|
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
|
||||||
| pru-* \
|
|
||||||
| pyramid-* \
|
| pyramid-* \
|
||||||
| riscv32-* | riscv64-* \
|
|
||||||
| rl78-* | romp-* | rs6000-* | rx-* \
|
| rl78-* | romp-* | rs6000-* | rx-* \
|
||||||
| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
|
| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
|
||||||
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
|
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
|
||||||
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
|
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
|
||||||
| sparclite-* \
|
| sparclite-* \
|
||||||
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \
|
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
|
||||||
| tahoe-* \
|
| tahoe-* \
|
||||||
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
|
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
|
||||||
| tile*-* \
|
| tile*-* \
|
||||||
|
|
@ -442,8 +432,6 @@ case $basic_machine in
|
||||||
| ubicom32-* \
|
| ubicom32-* \
|
||||||
| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
|
| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
|
||||||
| vax-* \
|
| vax-* \
|
||||||
| visium-* \
|
|
||||||
| wasm32-* \
|
|
||||||
| we32k-* \
|
| we32k-* \
|
||||||
| x86-* | x86_64-* | xc16x-* | xps100-* \
|
| x86-* | x86_64-* | xc16x-* | xps100-* \
|
||||||
| xstormy16-* | xtensa*-* \
|
| xstormy16-* | xtensa*-* \
|
||||||
|
|
@ -457,7 +445,7 @@ case $basic_machine in
|
||||||
# Recognize the various machine names and aliases which stand
|
# Recognize the various machine names and aliases which stand
|
||||||
# for a CPU type and a company and sometimes even an OS.
|
# for a CPU type and a company and sometimes even an OS.
|
||||||
386bsd)
|
386bsd)
|
||||||
basic_machine=i386-pc
|
basic_machine=i386-unknown
|
||||||
os=-bsd
|
os=-bsd
|
||||||
;;
|
;;
|
||||||
3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
|
3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
|
||||||
|
|
@ -491,7 +479,7 @@ case $basic_machine in
|
||||||
basic_machine=x86_64-pc
|
basic_machine=x86_64-pc
|
||||||
;;
|
;;
|
||||||
amd64-*)
|
amd64-*)
|
||||||
basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'`
|
basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||||
;;
|
;;
|
||||||
amdahl)
|
amdahl)
|
||||||
basic_machine=580-amdahl
|
basic_machine=580-amdahl
|
||||||
|
|
@ -520,9 +508,6 @@ case $basic_machine in
|
||||||
basic_machine=i386-pc
|
basic_machine=i386-pc
|
||||||
os=-aros
|
os=-aros
|
||||||
;;
|
;;
|
||||||
asmjs)
|
|
||||||
basic_machine=asmjs-unknown
|
|
||||||
;;
|
|
||||||
aux)
|
aux)
|
||||||
basic_machine=m68k-apple
|
basic_machine=m68k-apple
|
||||||
os=-aux
|
os=-aux
|
||||||
|
|
@ -536,7 +521,7 @@ case $basic_machine in
|
||||||
os=-linux
|
os=-linux
|
||||||
;;
|
;;
|
||||||
blackfin-*)
|
blackfin-*)
|
||||||
basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'`
|
basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||||
os=-linux
|
os=-linux
|
||||||
;;
|
;;
|
||||||
bluegene*)
|
bluegene*)
|
||||||
|
|
@ -544,13 +529,13 @@ case $basic_machine in
|
||||||
os=-cnk
|
os=-cnk
|
||||||
;;
|
;;
|
||||||
c54x-*)
|
c54x-*)
|
||||||
basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
|
basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||||
;;
|
;;
|
||||||
c55x-*)
|
c55x-*)
|
||||||
basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
|
basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||||
;;
|
;;
|
||||||
c6x-*)
|
c6x-*)
|
||||||
basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
|
basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||||
;;
|
;;
|
||||||
c90)
|
c90)
|
||||||
basic_machine=c90-cray
|
basic_machine=c90-cray
|
||||||
|
|
@ -639,18 +624,10 @@ case $basic_machine in
|
||||||
basic_machine=rs6000-bull
|
basic_machine=rs6000-bull
|
||||||
os=-bosx
|
os=-bosx
|
||||||
;;
|
;;
|
||||||
dpx2*)
|
dpx2* | dpx2*-bull)
|
||||||
basic_machine=m68k-bull
|
basic_machine=m68k-bull
|
||||||
os=-sysv3
|
os=-sysv3
|
||||||
;;
|
;;
|
||||||
e500v[12])
|
|
||||||
basic_machine=powerpc-unknown
|
|
||||||
os=$os"spe"
|
|
||||||
;;
|
|
||||||
e500v[12]-*)
|
|
||||||
basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'`
|
|
||||||
os=$os"spe"
|
|
||||||
;;
|
|
||||||
ebmon29k)
|
ebmon29k)
|
||||||
basic_machine=a29k-amd
|
basic_machine=a29k-amd
|
||||||
os=-ebmon
|
os=-ebmon
|
||||||
|
|
@ -740,6 +717,9 @@ case $basic_machine in
|
||||||
hp9k8[0-9][0-9] | hp8[0-9][0-9])
|
hp9k8[0-9][0-9] | hp8[0-9][0-9])
|
||||||
basic_machine=hppa1.0-hp
|
basic_machine=hppa1.0-hp
|
||||||
;;
|
;;
|
||||||
|
hppa-next)
|
||||||
|
os=-nextstep3
|
||||||
|
;;
|
||||||
hppaosf)
|
hppaosf)
|
||||||
basic_machine=hppa1.1-hp
|
basic_machine=hppa1.1-hp
|
||||||
os=-osf
|
os=-osf
|
||||||
|
|
@ -752,26 +732,26 @@ case $basic_machine in
|
||||||
basic_machine=i370-ibm
|
basic_machine=i370-ibm
|
||||||
;;
|
;;
|
||||||
i*86v32)
|
i*86v32)
|
||||||
basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
|
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
|
||||||
os=-sysv32
|
os=-sysv32
|
||||||
;;
|
;;
|
||||||
i*86v4*)
|
i*86v4*)
|
||||||
basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
|
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
|
||||||
os=-sysv4
|
os=-sysv4
|
||||||
;;
|
;;
|
||||||
i*86v)
|
i*86v)
|
||||||
basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
|
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
|
||||||
os=-sysv
|
os=-sysv
|
||||||
;;
|
;;
|
||||||
i*86sol2)
|
i*86sol2)
|
||||||
basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
|
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
|
||||||
os=-solaris2
|
os=-solaris2
|
||||||
;;
|
;;
|
||||||
i386mach)
|
i386mach)
|
||||||
basic_machine=i386-mach
|
basic_machine=i386-mach
|
||||||
os=-mach
|
os=-mach
|
||||||
;;
|
;;
|
||||||
vsta)
|
i386-vsta | vsta)
|
||||||
basic_machine=i386-unknown
|
basic_machine=i386-unknown
|
||||||
os=-vsta
|
os=-vsta
|
||||||
;;
|
;;
|
||||||
|
|
@ -789,17 +769,17 @@ case $basic_machine in
|
||||||
basic_machine=m68k-isi
|
basic_machine=m68k-isi
|
||||||
os=-sysv
|
os=-sysv
|
||||||
;;
|
;;
|
||||||
leon-*|leon[3-9]-*)
|
|
||||||
basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'`
|
|
||||||
;;
|
|
||||||
m68knommu)
|
m68knommu)
|
||||||
basic_machine=m68k-unknown
|
basic_machine=m68k-unknown
|
||||||
os=-linux
|
os=-linux
|
||||||
;;
|
;;
|
||||||
m68knommu-*)
|
m68knommu-*)
|
||||||
basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'`
|
basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||||
os=-linux
|
os=-linux
|
||||||
;;
|
;;
|
||||||
|
m88k-omron*)
|
||||||
|
basic_machine=m88k-omron
|
||||||
|
;;
|
||||||
magnum | m3230)
|
magnum | m3230)
|
||||||
basic_machine=mips-mips
|
basic_machine=mips-mips
|
||||||
os=-sysv
|
os=-sysv
|
||||||
|
|
@ -808,15 +788,11 @@ case $basic_machine in
|
||||||
basic_machine=ns32k-utek
|
basic_machine=ns32k-utek
|
||||||
os=-sysv
|
os=-sysv
|
||||||
;;
|
;;
|
||||||
microblaze*)
|
microblaze)
|
||||||
basic_machine=microblaze-xilinx
|
basic_machine=microblaze-xilinx
|
||||||
;;
|
;;
|
||||||
mingw64)
|
|
||||||
basic_machine=x86_64-pc
|
|
||||||
os=-mingw64
|
|
||||||
;;
|
|
||||||
mingw32)
|
mingw32)
|
||||||
basic_machine=i686-pc
|
basic_machine=i386-pc
|
||||||
os=-mingw32
|
os=-mingw32
|
||||||
;;
|
;;
|
||||||
mingw32ce)
|
mingw32ce)
|
||||||
|
|
@ -831,10 +807,10 @@ case $basic_machine in
|
||||||
os=-mint
|
os=-mint
|
||||||
;;
|
;;
|
||||||
mips3*-*)
|
mips3*-*)
|
||||||
basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`
|
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
|
||||||
;;
|
;;
|
||||||
mips3*)
|
mips3*)
|
||||||
basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown
|
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
|
||||||
;;
|
;;
|
||||||
monitor)
|
monitor)
|
||||||
basic_machine=m68k-rom68k
|
basic_machine=m68k-rom68k
|
||||||
|
|
@ -844,19 +820,15 @@ case $basic_machine in
|
||||||
basic_machine=powerpc-unknown
|
basic_machine=powerpc-unknown
|
||||||
os=-morphos
|
os=-morphos
|
||||||
;;
|
;;
|
||||||
moxiebox)
|
|
||||||
basic_machine=moxie-unknown
|
|
||||||
os=-moxiebox
|
|
||||||
;;
|
|
||||||
msdos)
|
msdos)
|
||||||
basic_machine=i386-pc
|
basic_machine=i386-pc
|
||||||
os=-msdos
|
os=-msdos
|
||||||
;;
|
;;
|
||||||
ms1-*)
|
ms1-*)
|
||||||
basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'`
|
basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
|
||||||
;;
|
;;
|
||||||
msys)
|
msys)
|
||||||
basic_machine=i686-pc
|
basic_machine=i386-pc
|
||||||
os=-msys
|
os=-msys
|
||||||
;;
|
;;
|
||||||
mvs)
|
mvs)
|
||||||
|
|
@ -895,7 +867,7 @@ case $basic_machine in
|
||||||
basic_machine=v70-nec
|
basic_machine=v70-nec
|
||||||
os=-sysv
|
os=-sysv
|
||||||
;;
|
;;
|
||||||
next | m*-next)
|
next | m*-next )
|
||||||
basic_machine=m68k-next
|
basic_machine=m68k-next
|
||||||
case $os in
|
case $os in
|
||||||
-nextstep* )
|
-nextstep* )
|
||||||
|
|
@ -940,12 +912,6 @@ case $basic_machine in
|
||||||
nsr-tandem)
|
nsr-tandem)
|
||||||
basic_machine=nsr-tandem
|
basic_machine=nsr-tandem
|
||||||
;;
|
;;
|
||||||
nsv-tandem)
|
|
||||||
basic_machine=nsv-tandem
|
|
||||||
;;
|
|
||||||
nsx-tandem)
|
|
||||||
basic_machine=nsx-tandem
|
|
||||||
;;
|
|
||||||
op50n-* | op60c-*)
|
op50n-* | op60c-*)
|
||||||
basic_machine=hppa1.1-oki
|
basic_machine=hppa1.1-oki
|
||||||
os=-proelf
|
os=-proelf
|
||||||
|
|
@ -978,7 +944,7 @@ case $basic_machine in
|
||||||
os=-linux
|
os=-linux
|
||||||
;;
|
;;
|
||||||
parisc-*)
|
parisc-*)
|
||||||
basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'`
|
basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||||
os=-linux
|
os=-linux
|
||||||
;;
|
;;
|
||||||
pbd)
|
pbd)
|
||||||
|
|
@ -994,7 +960,7 @@ case $basic_machine in
|
||||||
basic_machine=i386-pc
|
basic_machine=i386-pc
|
||||||
;;
|
;;
|
||||||
pc98-*)
|
pc98-*)
|
||||||
basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'`
|
basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||||
;;
|
;;
|
||||||
pentium | p5 | k5 | k6 | nexgen | viac3)
|
pentium | p5 | k5 | k6 | nexgen | viac3)
|
||||||
basic_machine=i586-pc
|
basic_machine=i586-pc
|
||||||
|
|
@ -1009,16 +975,16 @@ case $basic_machine in
|
||||||
basic_machine=i786-pc
|
basic_machine=i786-pc
|
||||||
;;
|
;;
|
||||||
pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
|
pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
|
||||||
basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'`
|
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||||
;;
|
;;
|
||||||
pentiumpro-* | p6-* | 6x86-* | athlon-*)
|
pentiumpro-* | p6-* | 6x86-* | athlon-*)
|
||||||
basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'`
|
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||||
;;
|
;;
|
||||||
pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
|
pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
|
||||||
basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'`
|
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||||
;;
|
;;
|
||||||
pentium4-*)
|
pentium4-*)
|
||||||
basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'`
|
basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||||
;;
|
;;
|
||||||
pn)
|
pn)
|
||||||
basic_machine=pn-gould
|
basic_machine=pn-gould
|
||||||
|
|
@ -1028,23 +994,23 @@ case $basic_machine in
|
||||||
ppc | ppcbe) basic_machine=powerpc-unknown
|
ppc | ppcbe) basic_machine=powerpc-unknown
|
||||||
;;
|
;;
|
||||||
ppc-* | ppcbe-*)
|
ppc-* | ppcbe-*)
|
||||||
basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'`
|
basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||||
;;
|
;;
|
||||||
ppcle | powerpclittle)
|
ppcle | powerpclittle | ppc-le | powerpc-little)
|
||||||
basic_machine=powerpcle-unknown
|
basic_machine=powerpcle-unknown
|
||||||
;;
|
;;
|
||||||
ppcle-* | powerpclittle-*)
|
ppcle-* | powerpclittle-*)
|
||||||
basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'`
|
basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||||
;;
|
;;
|
||||||
ppc64) basic_machine=powerpc64-unknown
|
ppc64) basic_machine=powerpc64-unknown
|
||||||
;;
|
;;
|
||||||
ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'`
|
ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||||
;;
|
;;
|
||||||
ppc64le | powerpc64little)
|
ppc64le | powerpc64little | ppc64-le | powerpc64-little)
|
||||||
basic_machine=powerpc64le-unknown
|
basic_machine=powerpc64le-unknown
|
||||||
;;
|
;;
|
||||||
ppc64le-* | powerpc64little-*)
|
ppc64le-* | powerpc64little-*)
|
||||||
basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'`
|
basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||||
;;
|
;;
|
||||||
ps2)
|
ps2)
|
||||||
basic_machine=i386-ibm
|
basic_machine=i386-ibm
|
||||||
|
|
@ -1053,11 +1019,7 @@ case $basic_machine in
|
||||||
basic_machine=i586-unknown
|
basic_machine=i586-unknown
|
||||||
os=-pw32
|
os=-pw32
|
||||||
;;
|
;;
|
||||||
rdos | rdos64)
|
rdos)
|
||||||
basic_machine=x86_64-pc
|
|
||||||
os=-rdos
|
|
||||||
;;
|
|
||||||
rdos32)
|
|
||||||
basic_machine=i386-pc
|
basic_machine=i386-pc
|
||||||
os=-rdos
|
os=-rdos
|
||||||
;;
|
;;
|
||||||
|
|
@ -1098,10 +1060,17 @@ case $basic_machine in
|
||||||
sequent)
|
sequent)
|
||||||
basic_machine=i386-sequent
|
basic_machine=i386-sequent
|
||||||
;;
|
;;
|
||||||
|
sh)
|
||||||
|
basic_machine=sh-hitachi
|
||||||
|
os=-hms
|
||||||
|
;;
|
||||||
sh5el)
|
sh5el)
|
||||||
basic_machine=sh5le-unknown
|
basic_machine=sh5le-unknown
|
||||||
;;
|
;;
|
||||||
simso-wrs)
|
sh64)
|
||||||
|
basic_machine=sh64-unknown
|
||||||
|
;;
|
||||||
|
sparclite-wrs | simso-wrs)
|
||||||
basic_machine=sparclite-wrs
|
basic_machine=sparclite-wrs
|
||||||
os=-vxworks
|
os=-vxworks
|
||||||
;;
|
;;
|
||||||
|
|
@ -1120,7 +1089,7 @@ case $basic_machine in
|
||||||
os=-sysv4
|
os=-sysv4
|
||||||
;;
|
;;
|
||||||
strongarm-* | thumb-*)
|
strongarm-* | thumb-*)
|
||||||
basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'`
|
basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||||
;;
|
;;
|
||||||
sun2)
|
sun2)
|
||||||
basic_machine=m68000-sun
|
basic_machine=m68000-sun
|
||||||
|
|
@ -1242,9 +1211,6 @@ case $basic_machine in
|
||||||
basic_machine=hppa1.1-winbond
|
basic_machine=hppa1.1-winbond
|
||||||
os=-proelf
|
os=-proelf
|
||||||
;;
|
;;
|
||||||
x64)
|
|
||||||
basic_machine=x86_64-pc
|
|
||||||
;;
|
|
||||||
xbox)
|
xbox)
|
||||||
basic_machine=i686-pc
|
basic_machine=i686-pc
|
||||||
os=-mingw32
|
os=-mingw32
|
||||||
|
|
@ -1253,12 +1219,20 @@ case $basic_machine in
|
||||||
basic_machine=xps100-honeywell
|
basic_machine=xps100-honeywell
|
||||||
;;
|
;;
|
||||||
xscale-* | xscalee[bl]-*)
|
xscale-* | xscalee[bl]-*)
|
||||||
basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'`
|
basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
|
||||||
;;
|
;;
|
||||||
ymp)
|
ymp)
|
||||||
basic_machine=ymp-cray
|
basic_machine=ymp-cray
|
||||||
os=-unicos
|
os=-unicos
|
||||||
;;
|
;;
|
||||||
|
z8k-*-coff)
|
||||||
|
basic_machine=z8k-unknown
|
||||||
|
os=-sim
|
||||||
|
;;
|
||||||
|
z80-*-coff)
|
||||||
|
basic_machine=z80-unknown
|
||||||
|
os=-sim
|
||||||
|
;;
|
||||||
none)
|
none)
|
||||||
basic_machine=none-none
|
basic_machine=none-none
|
||||||
os=-none
|
os=-none
|
||||||
|
|
@ -1287,6 +1261,10 @@ case $basic_machine in
|
||||||
vax)
|
vax)
|
||||||
basic_machine=vax-dec
|
basic_machine=vax-dec
|
||||||
;;
|
;;
|
||||||
|
pdp10)
|
||||||
|
# there are many clones, so DEC is not a safe bet
|
||||||
|
basic_machine=pdp10-unknown
|
||||||
|
;;
|
||||||
pdp11)
|
pdp11)
|
||||||
basic_machine=pdp11-dec
|
basic_machine=pdp11-dec
|
||||||
;;
|
;;
|
||||||
|
|
@ -1296,6 +1274,9 @@ case $basic_machine in
|
||||||
sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
|
sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
|
||||||
basic_machine=sh-unknown
|
basic_machine=sh-unknown
|
||||||
;;
|
;;
|
||||||
|
sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
|
||||||
|
basic_machine=sparc-sun
|
||||||
|
;;
|
||||||
cydra)
|
cydra)
|
||||||
basic_machine=cydra-cydrome
|
basic_machine=cydra-cydrome
|
||||||
;;
|
;;
|
||||||
|
|
@ -1315,7 +1296,7 @@ case $basic_machine in
|
||||||
# Make sure to match an already-canonicalized machine name.
|
# Make sure to match an already-canonicalized machine name.
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2
|
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
@ -1323,10 +1304,10 @@ esac
|
||||||
# Here we canonicalize certain aliases for manufacturers.
|
# Here we canonicalize certain aliases for manufacturers.
|
||||||
case $basic_machine in
|
case $basic_machine in
|
||||||
*-digital*)
|
*-digital*)
|
||||||
basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'`
|
basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
|
||||||
;;
|
;;
|
||||||
*-commodore*)
|
*-commodore*)
|
||||||
basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'`
|
basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
;;
|
;;
|
||||||
|
|
@ -1337,8 +1318,8 @@ esac
|
||||||
if [ x"$os" != x"" ]
|
if [ x"$os" != x"" ]
|
||||||
then
|
then
|
||||||
case $os in
|
case $os in
|
||||||
# First match some system type aliases that might get confused
|
# First match some system type aliases
|
||||||
# with valid system types.
|
# that might get confused with valid system types.
|
||||||
# -solaris* is a basic system type, with this one exception.
|
# -solaris* is a basic system type, with this one exception.
|
||||||
-auroraux)
|
-auroraux)
|
||||||
os=-auroraux
|
os=-auroraux
|
||||||
|
|
@ -1349,48 +1330,45 @@ case $os in
|
||||||
-solaris)
|
-solaris)
|
||||||
os=-solaris2
|
os=-solaris2
|
||||||
;;
|
;;
|
||||||
|
-svr4*)
|
||||||
|
os=-sysv4
|
||||||
|
;;
|
||||||
-unixware*)
|
-unixware*)
|
||||||
os=-sysv4.2uw
|
os=-sysv4.2uw
|
||||||
;;
|
;;
|
||||||
-gnu/linux*)
|
-gnu/linux*)
|
||||||
os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
|
os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
|
||||||
;;
|
;;
|
||||||
# es1800 is here to avoid being matched by es* (a different OS)
|
# First accept the basic system types.
|
||||||
-es1800*)
|
|
||||||
os=-ose
|
|
||||||
;;
|
|
||||||
# Now accept the basic system types.
|
|
||||||
# The portable systems comes first.
|
# The portable systems comes first.
|
||||||
# Each alternative MUST end in a * to match a version number.
|
# Each alternative MUST END IN A *, to match a version number.
|
||||||
# -sysv* is not here because it comes later, after sysvr4.
|
# -sysv* is not here because it comes later, after sysvr4.
|
||||||
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
|
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
|
||||||
| -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
|
| -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
|
||||||
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
|
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
|
||||||
| -sym* | -kopensolaris* | -plan9* \
|
| -sym* | -kopensolaris* \
|
||||||
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
|
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
|
||||||
| -aos* | -aros* | -cloudabi* | -sortix* \
|
| -aos* | -aros* \
|
||||||
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
|
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
|
||||||
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
|
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
|
||||||
| -hiux* | -knetbsd* | -mirbsd* | -netbsd* \
|
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
|
||||||
| -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \
|
| -openbsd* | -solidbsd* \
|
||||||
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
|
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
|
||||||
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
|
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
|
||||||
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
|
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
|
||||||
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
|
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
|
||||||
| -chorusos* | -chorusrdb* | -cegcc* | -glidix* \
|
| -chorusos* | -chorusrdb* | -cegcc* \
|
||||||
| -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
|
| -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
|
||||||
| -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
|
| -mingw32* | -linux-gnu* | -linux-android* \
|
||||||
| -linux-newlib* | -linux-musl* | -linux-uclibc* \
|
| -linux-newlib* | -linux-uclibc* \
|
||||||
| -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
|
| -uxpv* | -beos* | -mpeix* | -udk* \
|
||||||
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* \
|
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
|
||||||
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
|
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
|
||||||
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
|
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
|
||||||
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
|
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
|
||||||
| -morphos* | -superux* | -rtmk* | -windiss* \
|
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
|
||||||
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
|
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
|
||||||
| -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
|
| -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
|
||||||
| -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \
|
|
||||||
| -midnightbsd*)
|
|
||||||
# Remember, each alternative MUST END IN *, to match a version number.
|
# Remember, each alternative MUST END IN *, to match a version number.
|
||||||
;;
|
;;
|
||||||
-qnx*)
|
-qnx*)
|
||||||
|
|
@ -1407,12 +1385,12 @@ case $os in
|
||||||
-nto*)
|
-nto*)
|
||||||
os=`echo $os | sed -e 's|nto|nto-qnx|'`
|
os=`echo $os | sed -e 's|nto|nto-qnx|'`
|
||||||
;;
|
;;
|
||||||
-sim | -xray | -os68k* | -v88r* \
|
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
|
||||||
| -windows* | -osx | -abug | -netware* | -os9* \
|
| -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
|
||||||
| -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
|
| -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
|
||||||
;;
|
;;
|
||||||
-mac*)
|
-mac*)
|
||||||
os=`echo "$os" | sed -e 's|mac|macos|'`
|
os=`echo $os | sed -e 's|mac|macos|'`
|
||||||
;;
|
;;
|
||||||
-linux-dietlibc)
|
-linux-dietlibc)
|
||||||
os=-linux-dietlibc
|
os=-linux-dietlibc
|
||||||
|
|
@ -1421,10 +1399,10 @@ case $os in
|
||||||
os=`echo $os | sed -e 's|linux|linux-gnu|'`
|
os=`echo $os | sed -e 's|linux|linux-gnu|'`
|
||||||
;;
|
;;
|
||||||
-sunos5*)
|
-sunos5*)
|
||||||
os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
|
os=`echo $os | sed -e 's|sunos5|solaris2|'`
|
||||||
;;
|
;;
|
||||||
-sunos6*)
|
-sunos6*)
|
||||||
os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
|
os=`echo $os | sed -e 's|sunos6|solaris3|'`
|
||||||
;;
|
;;
|
||||||
-opened*)
|
-opened*)
|
||||||
os=-openedition
|
os=-openedition
|
||||||
|
|
@ -1435,6 +1413,12 @@ case $os in
|
||||||
-wince*)
|
-wince*)
|
||||||
os=-wince
|
os=-wince
|
||||||
;;
|
;;
|
||||||
|
-osfrose*)
|
||||||
|
os=-osfrose
|
||||||
|
;;
|
||||||
|
-osf*)
|
||||||
|
os=-osf
|
||||||
|
;;
|
||||||
-utek*)
|
-utek*)
|
||||||
os=-bsd
|
os=-bsd
|
||||||
;;
|
;;
|
||||||
|
|
@ -1459,7 +1443,7 @@ case $os in
|
||||||
-nova*)
|
-nova*)
|
||||||
os=-rtmk-nova
|
os=-rtmk-nova
|
||||||
;;
|
;;
|
||||||
-ns2)
|
-ns2 )
|
||||||
os=-nextstep2
|
os=-nextstep2
|
||||||
;;
|
;;
|
||||||
-nsk*)
|
-nsk*)
|
||||||
|
|
@ -1481,7 +1465,7 @@ case $os in
|
||||||
-oss*)
|
-oss*)
|
||||||
os=-sysv3
|
os=-sysv3
|
||||||
;;
|
;;
|
||||||
-svr4*)
|
-svr4)
|
||||||
os=-sysv4
|
os=-sysv4
|
||||||
;;
|
;;
|
||||||
-svr3)
|
-svr3)
|
||||||
|
|
@ -1496,38 +1480,35 @@ case $os in
|
||||||
-ose*)
|
-ose*)
|
||||||
os=-ose
|
os=-ose
|
||||||
;;
|
;;
|
||||||
|
-es1800*)
|
||||||
|
os=-ose
|
||||||
|
;;
|
||||||
|
-xenix)
|
||||||
|
os=-xenix
|
||||||
|
;;
|
||||||
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
|
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
|
||||||
os=-mint
|
os=-mint
|
||||||
;;
|
;;
|
||||||
|
-aros*)
|
||||||
|
os=-aros
|
||||||
|
;;
|
||||||
|
-kaos*)
|
||||||
|
os=-kaos
|
||||||
|
;;
|
||||||
-zvmoe)
|
-zvmoe)
|
||||||
os=-zvmoe
|
os=-zvmoe
|
||||||
;;
|
;;
|
||||||
-dicos*)
|
-dicos*)
|
||||||
os=-dicos
|
os=-dicos
|
||||||
;;
|
;;
|
||||||
-pikeos*)
|
|
||||||
# Until real need of OS specific support for
|
|
||||||
# particular features comes up, bare metal
|
|
||||||
# configurations are quite functional.
|
|
||||||
case $basic_machine in
|
|
||||||
arm*)
|
|
||||||
os=-eabi
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
os=-elf
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
-nacl*)
|
-nacl*)
|
||||||
;;
|
;;
|
||||||
-ios)
|
|
||||||
;;
|
|
||||||
-none)
|
-none)
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
# Get rid of the `-' at the beginning of $os.
|
# Get rid of the `-' at the beginning of $os.
|
||||||
os=`echo $os | sed 's/[^-]*-//'`
|
os=`echo $os | sed 's/[^-]*-//'`
|
||||||
echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2
|
echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
@ -1562,9 +1543,6 @@ case $basic_machine in
|
||||||
c4x-* | tic4x-*)
|
c4x-* | tic4x-*)
|
||||||
os=-coff
|
os=-coff
|
||||||
;;
|
;;
|
||||||
c8051-*)
|
|
||||||
os=-elf
|
|
||||||
;;
|
|
||||||
hexagon-*)
|
hexagon-*)
|
||||||
os=-elf
|
os=-elf
|
||||||
;;
|
;;
|
||||||
|
|
@ -1617,12 +1595,12 @@ case $basic_machine in
|
||||||
sparc-* | *-sun)
|
sparc-* | *-sun)
|
||||||
os=-sunos4.1.1
|
os=-sunos4.1.1
|
||||||
;;
|
;;
|
||||||
pru-*)
|
|
||||||
os=-elf
|
|
||||||
;;
|
|
||||||
*-be)
|
*-be)
|
||||||
os=-beos
|
os=-beos
|
||||||
;;
|
;;
|
||||||
|
*-haiku)
|
||||||
|
os=-haiku
|
||||||
|
;;
|
||||||
*-ibm)
|
*-ibm)
|
||||||
os=-aix
|
os=-aix
|
||||||
;;
|
;;
|
||||||
|
|
@ -1662,7 +1640,7 @@ case $basic_machine in
|
||||||
m88k-omron*)
|
m88k-omron*)
|
||||||
os=-luna
|
os=-luna
|
||||||
;;
|
;;
|
||||||
*-next)
|
*-next )
|
||||||
os=-nextstep
|
os=-nextstep
|
||||||
;;
|
;;
|
||||||
*-sequent)
|
*-sequent)
|
||||||
|
|
@ -1677,6 +1655,9 @@ case $basic_machine in
|
||||||
i370-*)
|
i370-*)
|
||||||
os=-mvs
|
os=-mvs
|
||||||
;;
|
;;
|
||||||
|
*-next)
|
||||||
|
os=-nextstep3
|
||||||
|
;;
|
||||||
*-gould)
|
*-gould)
|
||||||
os=-sysv
|
os=-sysv
|
||||||
;;
|
;;
|
||||||
|
|
@ -1786,15 +1767,15 @@ case $basic_machine in
|
||||||
vendor=stratus
|
vendor=stratus
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"`
|
basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
echo "$basic_machine$os"
|
echo $basic_machine$os
|
||||||
exit
|
exit
|
||||||
|
|
||||||
# Local variables:
|
# Local variables:
|
||||||
# eval: (add-hook 'write-file-functions 'time-stamp)
|
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||||
# time-stamp-start: "timestamp='"
|
# time-stamp-start: "timestamp='"
|
||||||
# time-stamp-format: "%:y-%02m-%02d"
|
# time-stamp-format: "%:y-%02m-%02d"
|
||||||
# time-stamp-end: "'"
|
# time-stamp-end: "'"
|
||||||
|
|
|
||||||
247
configure.ac
247
configure.ac
|
|
@ -1,247 +0,0 @@
|
||||||
dnl Process this file with autoconf to produce a configure script.
|
|
||||||
|
|
||||||
AC_PREREQ(2.61)
|
|
||||||
AC_INIT([tinc], [1.0.36])
|
|
||||||
AC_CONFIG_SRCDIR([src/tincd.c])
|
|
||||||
AM_INIT_AUTOMAKE([1.11 check-news std-options subdir-objects nostdinc silent-rules -Wall])
|
|
||||||
AC_CONFIG_HEADERS([config.h])
|
|
||||||
AC_CONFIG_MACRO_DIR([m4])
|
|
||||||
AM_SILENT_RULES([yes])
|
|
||||||
|
|
||||||
# Enable GNU extensions.
|
|
||||||
# Define this here, not in acconfig's @TOP@ section, since definitions
|
|
||||||
# in the latter don't make it into the configure-time tests.
|
|
||||||
AC_GNU_SOURCE
|
|
||||||
AC_DEFINE([__USE_BSD], 1, [Enable BSD extensions])
|
|
||||||
|
|
||||||
dnl Checks for programs.
|
|
||||||
AC_PROG_CC_C99
|
|
||||||
AC_PROG_CPP
|
|
||||||
AC_PROG_INSTALL
|
|
||||||
|
|
||||||
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])
|
|
||||||
;;
|
|
||||||
*freebsd*)
|
|
||||||
bsd=true
|
|
||||||
AC_DEFINE(HAVE_FREEBSD, 1, [FreeBSD])
|
|
||||||
;;
|
|
||||||
*darwin*)
|
|
||||||
bsd=true
|
|
||||||
AC_DEFINE(HAVE_DARWIN, 1, [Darwin (MacOS/X)])
|
|
||||||
;;
|
|
||||||
*solaris*)
|
|
||||||
solaris=true
|
|
||||||
AC_DEFINE(HAVE_SOLARIS, 1, [Solaris/SunOS])
|
|
||||||
;;
|
|
||||||
*openbsd*)
|
|
||||||
bsd=true
|
|
||||||
AC_DEFINE(HAVE_OPENBSD, 1, [OpenBSD])
|
|
||||||
;;
|
|
||||||
*netbsd*)
|
|
||||||
bsd=true
|
|
||||||
AC_DEFINE(HAVE_NETBSD, 1, [NetBSD])
|
|
||||||
;;
|
|
||||||
*dragonfly*)
|
|
||||||
bsd=true
|
|
||||||
AC_DEFINE(HAVE_DRAGONFLY, 1, [DragonFly])
|
|
||||||
;;
|
|
||||||
*bsd*)
|
|
||||||
bsd=true
|
|
||||||
AC_MSG_WARN("Unknown BSD variant, tinc might not compile or work!")
|
|
||||||
AC_DEFINE(HAVE_BSD, 1, [Unknown BSD variant])
|
|
||||||
;;
|
|
||||||
*cygwin*)
|
|
||||||
cygwin=true
|
|
||||||
AC_DEFINE(HAVE_CYGWIN, 1, [Cygwin])
|
|
||||||
;;
|
|
||||||
*mingw*)
|
|
||||||
mingw=true
|
|
||||||
AC_DEFINE(HAVE_MINGW, 1, [MinGW])
|
|
||||||
LIBS="$LIBS -lws2_32 -lgdi32 -lcrypt32"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
AC_MSG_ERROR("Unknown operating system.")
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
AC_ARG_ENABLE(uml,
|
|
||||||
AS_HELP_STRING([--enable-uml], [enable support for User Mode Linux]),
|
|
||||||
[ AS_IF([test "x$enable_uml" = "xyes"],
|
|
||||||
[ AC_DEFINE(ENABLE_UML, 1, [Support for UML])
|
|
||||||
uml=true
|
|
||||||
],
|
|
||||||
[uml=false])
|
|
||||||
],
|
|
||||||
[uml=false]
|
|
||||||
)
|
|
||||||
|
|
||||||
AC_ARG_ENABLE(vde,
|
|
||||||
AS_HELP_STRING([--enable-vde], [enable support for Virtual Distributed Ethernet]),
|
|
||||||
[ AS_IF([test "x$enable_vde" = "xyes"],
|
|
||||||
[ AC_CHECK_HEADERS(libvdeplug_dyn.h, [], [AC_MSG_ERROR([VDE plug header files not found.]); break])
|
|
||||||
AC_DEFINE(ENABLE_VDE, 1, [Support for VDE])
|
|
||||||
vde=true
|
|
||||||
],
|
|
||||||
[vde=false])
|
|
||||||
],
|
|
||||||
[vde=false]
|
|
||||||
)
|
|
||||||
|
|
||||||
AC_ARG_ENABLE(tunemu,
|
|
||||||
AS_HELP_STRING([--enable-tunemu], [enable support for the tunemu driver]),
|
|
||||||
[ AS_IF([test "x$enable_tunemu" = "xyes"],
|
|
||||||
[ AC_DEFINE(ENABLE_TUNEMU, 1, [Support for tunemu])
|
|
||||||
tunemu=true
|
|
||||||
],
|
|
||||||
[tunemu=false])
|
|
||||||
],
|
|
||||||
[tunemu=false]
|
|
||||||
)
|
|
||||||
|
|
||||||
AC_ARG_WITH(windows2000,
|
|
||||||
AS_HELP_STRING([--with-windows2000], [compile with support for Windows 2000. This disables support for tunneling over existing IPv6 networks.]),
|
|
||||||
[ AS_IF([test "x$with_windows2000" = "xyes"],
|
|
||||||
[AC_DEFINE(WITH_WINDOWS2000, 1, [Compile with support for Windows 2000])])
|
|
||||||
]
|
|
||||||
)
|
|
||||||
|
|
||||||
AC_ARG_WITH(systemd,
|
|
||||||
AS_HELP_STRING([--with-systemd@<:@=DIR@:>@], [install systemd service files @<:@to DIR if specified@:>@]),
|
|
||||||
[ systemd=true; systemd_path="$with_systemd" ],
|
|
||||||
[ systemd=false ]
|
|
||||||
)
|
|
||||||
|
|
||||||
AS_IF([test "x$with_systemd" = "xyes"], [systemd_path="\${libdir}/systemd/system"],
|
|
||||||
[AS_IF([test "x$with_systemd" = "xno"], [systemd=false])])
|
|
||||||
|
|
||||||
AC_SUBST(systemd_path, $systemd_path)
|
|
||||||
|
|
||||||
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)
|
|
||||||
AM_CONDITIONAL(WITH_SYSTEMD, test "$systemd" = true)
|
|
||||||
|
|
||||||
AC_CACHE_SAVE
|
|
||||||
|
|
||||||
if test -d /sw/include ; then
|
|
||||||
CPPFLAGS="$CPPFLAGS -I/sw/include"
|
|
||||||
fi
|
|
||||||
if test -d /sw/lib ; then
|
|
||||||
LIBS="$LIBS -L/sw/lib"
|
|
||||||
fi
|
|
||||||
|
|
||||||
dnl Compiler hardening flags
|
|
||||||
dnl No -fstack-protector-all because it doesn't work on all platforms or architectures.
|
|
||||||
|
|
||||||
AX_CFLAGS_WARN_ALL(CFLAGS)
|
|
||||||
|
|
||||||
AC_ARG_ENABLE([hardening], AS_HELP_STRING([--disable-hardening], [disable compiler and linker hardening flags]))
|
|
||||||
AS_IF([test "x$enable_hardening" != "xno"],
|
|
||||||
[AX_CHECK_COMPILE_FLAG([-DFORTIFY_SOURCE=2], [CPPFLAGS="$CPPFLAGS -DFORTIFY_SOURCE=2"])
|
|
||||||
AX_CHECK_COMPILE_FLAG([-fwrapv], [CPPFLAGS="$CPPFLAGS -fwrapv"],
|
|
||||||
AX_CHECK_COMPILE_FLAG([-fno-strict-overflow], [CPPFLAGS="$CPPFLAGS -fno-strict-overflow"]))
|
|
||||||
case $host_os in
|
|
||||||
*mingw*)
|
|
||||||
AX_CHECK_LINK_FLAG([-Wl,--dynamicbase], [LDFLAGS="$LDFLAGS -Wl,--dynamicbase"])
|
|
||||||
AX_CHECK_LINK_FLAG([-Wl,--nxcompat], [LDFLAGS="$LDFLAGS -Wl,--nxcompat"])
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
AX_CHECK_COMPILE_FLAG([-fPIE], [CPPFLAGS="$CPPFLAGS -fPIE"])
|
|
||||||
AX_CHECK_LINK_FLAG([-pie], [LDFLAGS="$LDFLAGS -pie"])
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
AX_CHECK_LINK_FLAG([-Wl,-z,relro], [LDFLAGS="$LDFLAGS -Wl,-z,relro"])
|
|
||||||
AX_CHECK_LINK_FLAG([-Wl,-z,now], [LDFLAGS="$LDFLAGS -Wl,-z,now"])
|
|
||||||
]
|
|
||||||
);
|
|
||||||
|
|
||||||
dnl Checks for libraries.
|
|
||||||
|
|
||||||
dnl Checks for header files.
|
|
||||||
dnl We do this in multiple stages, because unlike Linux all the other operating systems really suck and don't include their own dependencies.
|
|
||||||
|
|
||||||
AC_CHECK_HEADERS([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/wait.h netdb.h arpa/inet.h arpa/nameser.h dirent.h getopt.h])
|
|
||||||
AC_CHECK_HEADERS([net/if.h net/if_types.h linux/if_tun.h net/if_tun.h net/if_utun.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 netpacket/packet.h],
|
|
||||||
[], [], [#include "$srcdir/src/have.h"]
|
|
||||||
)
|
|
||||||
AC_CHECK_HEADERS([netinet/if_ether.h netinet/ip.h netinet/ip6.h resolv.h],
|
|
||||||
[], [], [#include "$srcdir/src/have.h"]
|
|
||||||
)
|
|
||||||
AC_CHECK_HEADERS([netinet/tcp.h netinet/ip_icmp.h netinet/icmp6.h],
|
|
||||||
[], [], [#include "$srcdir/src/have.h"]
|
|
||||||
)
|
|
||||||
|
|
||||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
|
||||||
AC_TYPE_PID_T
|
|
||||||
|
|
||||||
tinc_ATTRIBUTE(__malloc__)
|
|
||||||
|
|
||||||
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 "$srcdir/src/have.h"]
|
|
||||||
)
|
|
||||||
|
|
||||||
dnl Checks for library functions.
|
|
||||||
AC_TYPE_SIGNAL
|
|
||||||
AC_CHECK_FUNCS([asprintf daemon fchmod flock fork gettimeofday mlockall pselect putenv strsignal system unsetenv usleep vsyslog devname fdevname],
|
|
||||||
[], [], [#include "$srcdir/src/have.h"]
|
|
||||||
)
|
|
||||||
|
|
||||||
AC_CHECK_FUNC(getopt_long, [getopt=true; AC_DEFINE(HAVE_GETOPT_LONG, 1, [getopt_long()])], [getopt=false])
|
|
||||||
AM_CONDITIONAL(GETOPT, test "$getopt" = true)
|
|
||||||
|
|
||||||
dnl Support for SunOS
|
|
||||||
|
|
||||||
AC_CHECK_FUNC(socket, [], [
|
|
||||||
AC_CHECK_LIB(socket, connect)
|
|
||||||
])
|
|
||||||
AC_CHECK_FUNC(gethostbyname, [], [
|
|
||||||
AC_CHECK_LIB(nsl, gethostbyname)
|
|
||||||
])
|
|
||||||
|
|
||||||
AC_CHECK_DECLS([freeaddrinfo, gai_strerror, getaddrinfo, getnameinfo],
|
|
||||||
[], [], [#include "$srcdir/src/have.h"]
|
|
||||||
)
|
|
||||||
|
|
||||||
AC_CHECK_DECLS([res_init], [AC_CHECK_LIB(resolv, res_init)], [], [
|
|
||||||
#include <netinet/in.h>
|
|
||||||
#include <resolv.h>
|
|
||||||
])
|
|
||||||
|
|
||||||
AC_CACHE_SAVE
|
|
||||||
|
|
||||||
dnl These are defined in files in m4/
|
|
||||||
|
|
||||||
tinc_ZLIB
|
|
||||||
tinc_LZO
|
|
||||||
tinc_OPENSSL
|
|
||||||
|
|
||||||
dnl Check if support for jumbograms is requested
|
|
||||||
AC_ARG_ENABLE(jumbograms,
|
|
||||||
AS_HELP_STRING([--enable-jumbograms], [enable support for jumbograms (packets up to 9000 bytes)]),
|
|
||||||
[ AS_IF([test "x$enable_jumbograms" = "xyes"],
|
|
||||||
[ AC_DEFINE(ENABLE_JUMBOGRAMS, 1, [Support for jumbograms (packets up to 9000 bytes)]) ])
|
|
||||||
]
|
|
||||||
)
|
|
||||||
|
|
||||||
dnl Ensure runstatedir is set if we are using a version of autoconf that does not support it
|
|
||||||
if test "x$runstatedir" = "x"; then
|
|
||||||
AC_SUBST([runstatedir], ['${localstatedir}/run'])
|
|
||||||
fi
|
|
||||||
|
|
||||||
AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile systemd/Makefile])
|
|
||||||
|
|
||||||
AC_OUTPUT
|
|
||||||
203
configure.in
Normal file
203
configure.in
Normal file
|
|
@ -0,0 +1,203 @@
|
||||||
|
dnl Process this file with autoconf to produce a configure script.
|
||||||
|
|
||||||
|
AC_PREREQ(2.61)
|
||||||
|
AC_INIT
|
||||||
|
AC_CONFIG_SRCDIR([src/tincd.c])
|
||||||
|
AM_INIT_AUTOMAKE(tinc, 1.0.19)
|
||||||
|
AC_CONFIG_HEADERS([config.h])
|
||||||
|
AM_MAINTAINER_MODE
|
||||||
|
|
||||||
|
# Enable GNU extensions.
|
||||||
|
# Define this here, not in acconfig's @TOP@ section, since definitions
|
||||||
|
# in the latter don't make it into the configure-time tests.
|
||||||
|
AC_GNU_SOURCE
|
||||||
|
AC_DEFINE([__USE_BSD], 1, [Enable BSD extensions])
|
||||||
|
|
||||||
|
dnl Checks for programs.
|
||||||
|
AC_PROG_CC_C99
|
||||||
|
AC_PROG_CPP
|
||||||
|
AC_PROG_INSTALL
|
||||||
|
AC_PROG_LN_S
|
||||||
|
AC_PROG_RANLIB
|
||||||
|
|
||||||
|
dnl Check and set OS
|
||||||
|
|
||||||
|
AC_CANONICAL_HOST
|
||||||
|
|
||||||
|
case $host_os in
|
||||||
|
*linux*)
|
||||||
|
AC_DEFINE(HAVE_LINUX, 1, [Linux])
|
||||||
|
[ rm -f src/device.c; ln -sf linux/device.c src/device.c ]
|
||||||
|
;;
|
||||||
|
*freebsd*)
|
||||||
|
AC_DEFINE(HAVE_FREEBSD, 1, [FreeBSD])
|
||||||
|
[ rm -f src/device.c; ln -sf bsd/device.c src/device.c ]
|
||||||
|
;;
|
||||||
|
*darwin*)
|
||||||
|
AC_DEFINE(HAVE_DARWIN, 1, [Darwin (MacOS/X)])
|
||||||
|
[ rm -f src/device.c; ln -sf bsd/device.c src/device.c ]
|
||||||
|
;;
|
||||||
|
*solaris*)
|
||||||
|
AC_DEFINE(HAVE_SOLARIS, 1, [Solaris/SunOS])
|
||||||
|
[ rm -f src/device.c; ln -sf solaris/device.c src/device.c ]
|
||||||
|
;;
|
||||||
|
*openbsd*)
|
||||||
|
AC_DEFINE(HAVE_OPENBSD, 1, [OpenBSD])
|
||||||
|
[ rm -f src/device.c; ln -sf bsd/device.c src/device.c ]
|
||||||
|
;;
|
||||||
|
*netbsd*)
|
||||||
|
AC_DEFINE(HAVE_NETBSD, 1, [NetBSD])
|
||||||
|
[ rm -f src/device.c; ln -sf bsd/device.c src/device.c ]
|
||||||
|
;;
|
||||||
|
*dragonfly*)
|
||||||
|
AC_DEFINE(HAVE_DRAGONFLY, 1, [DragonFly])
|
||||||
|
[ rm -f src/device.c; ln -sf bsd/device.c src/device.c ]
|
||||||
|
;;
|
||||||
|
*bsd*)
|
||||||
|
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*)
|
||||||
|
AC_DEFINE(HAVE_CYGWIN, 1, [Cygwin])
|
||||||
|
[ rm -f src/device.c; ln -sf cygwin/device.c src/device.c ]
|
||||||
|
;;
|
||||||
|
*mingw*)
|
||||||
|
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"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
AC_MSG_ERROR("Unknown operating system.")
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
AC_ARG_ENABLE(uml,
|
||||||
|
AS_HELP_STRING([--disable-uml], [enable support for User Mode Linux]),
|
||||||
|
[ AS_IF([test "x$enable_uml" = "xyes"],
|
||||||
|
[ AC_DEFINE(ENABLE_UML, 1, [Support for UML])
|
||||||
|
uml=true
|
||||||
|
],
|
||||||
|
[uml=false])
|
||||||
|
],
|
||||||
|
[uml=false]
|
||||||
|
)
|
||||||
|
|
||||||
|
AC_ARG_ENABLE(vde,
|
||||||
|
AS_HELP_STRING([--disable-vde], [enable support for Virtual Distributed Ethernet]),
|
||||||
|
[ AS_IF([test "x$enable_vde" = "xyes"],
|
||||||
|
[ AC_CHECK_HEADERS(libvdeplug_dyn.h, [], [AC_MSG_ERROR([VDE plug header files not found.]); break])
|
||||||
|
AC_DEFINE(ENABLE_VDE, 1, [Support for VDE])
|
||||||
|
vde=true
|
||||||
|
],
|
||||||
|
[vde=false])
|
||||||
|
],
|
||||||
|
[vde=false]
|
||||||
|
)
|
||||||
|
|
||||||
|
AC_ARG_ENABLE(tunemu,
|
||||||
|
AS_HELP_STRING([--disable-tunemu], [enable support for the tunemu driver]),
|
||||||
|
[ AS_IF([test "x$enable_tunemu" = "xyes"],
|
||||||
|
[ AC_DEFINE(ENABLE_TUNEMU, 1, [Support for tunemu])
|
||||||
|
tunemu=true
|
||||||
|
],
|
||||||
|
[tunemu=false])
|
||||||
|
],
|
||||||
|
[tunemu=false]
|
||||||
|
)
|
||||||
|
|
||||||
|
AC_ARG_WITH(windows2000,
|
||||||
|
AS_HELP_STRING([--without-windows2000], [compile with support for Windows 2000. This disables support for tunneling over existing IPv6 networks.]),
|
||||||
|
[ AS_IF([test "x$with_windows2000" = "xyes"],
|
||||||
|
[AC_DEFINE(WITH_WINDOWS2000, 1, [Compile with support for Windows 2000])])
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
AM_CONDITIONAL(UML, test "$uml" = true)
|
||||||
|
AM_CONDITIONAL(VDE, test "$vde" = true)
|
||||||
|
AM_CONDITIONAL(TUNEMU, test "$tunemu" = true)
|
||||||
|
|
||||||
|
AC_CACHE_SAVE
|
||||||
|
|
||||||
|
if test -d /sw/include ; then
|
||||||
|
CPPFLAGS="$CPPFLAGS -I/sw/include"
|
||||||
|
fi
|
||||||
|
if test -d /sw/lib ; then
|
||||||
|
LIBS="$LIBS -L/sw/lib"
|
||||||
|
fi
|
||||||
|
|
||||||
|
dnl Checks for libraries.
|
||||||
|
|
||||||
|
dnl Checks for header files.
|
||||||
|
dnl We do this in multiple stages, because unlike Linux all the other operating systems really suck and don't include their own dependencies.
|
||||||
|
|
||||||
|
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 time.h sys/uio.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 netpacket/packet.h],
|
||||||
|
[], [], [#include "have.h"]
|
||||||
|
)
|
||||||
|
AC_CHECK_HEADERS([netinet/if_ether.h netinet/ip.h netinet/ip6.h],
|
||||||
|
[], [], [#include "have.h"]
|
||||||
|
)
|
||||||
|
AC_CHECK_HEADERS([netinet/tcp.h netinet/ip_icmp.h netinet/icmp6.h],
|
||||||
|
[], [], [#include "have.h"]
|
||||||
|
)
|
||||||
|
|
||||||
|
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||||
|
AC_C_CONST
|
||||||
|
AC_C_VOLATILE
|
||||||
|
AC_TYPE_PID_T
|
||||||
|
AC_TYPE_SIZE_T
|
||||||
|
AC_HEADER_TIME
|
||||||
|
AC_STRUCT_TM
|
||||||
|
|
||||||
|
tinc_ATTRIBUTE(__malloc__)
|
||||||
|
|
||||||
|
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"]
|
||||||
|
)
|
||||||
|
|
||||||
|
dnl Checks for library functions.
|
||||||
|
AC_FUNC_MEMCMP
|
||||||
|
AC_FUNC_ALLOCA
|
||||||
|
AC_TYPE_SIGNAL
|
||||||
|
AC_CHECK_FUNCS([asprintf daemon fchmod flock ftime fork get_current_dir_name gettimeofday mlockall pselect putenv random select strdup strerror strsignal strtol system unsetenv usleep vsyslog writev],
|
||||||
|
[], [], [#include "have.h"]
|
||||||
|
)
|
||||||
|
AC_FUNC_MALLOC
|
||||||
|
AC_FUNC_REALLOC
|
||||||
|
|
||||||
|
dnl Support for SunOS
|
||||||
|
|
||||||
|
AC_CHECK_FUNC(socket, [], [
|
||||||
|
AC_CHECK_LIB(socket, connect)
|
||||||
|
])
|
||||||
|
AC_CHECK_FUNC(gethostbyname, [], [
|
||||||
|
AC_CHECK_LIB(nsl, gethostbyname)
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_CHECK_DECLS([freeaddrinfo, gai_strerror, getaddrinfo, getnameinfo],
|
||||||
|
[], [], [#include "have.h"]
|
||||||
|
)
|
||||||
|
|
||||||
|
AC_CACHE_SAVE
|
||||||
|
|
||||||
|
dnl These are defined in files in m4/
|
||||||
|
|
||||||
|
tinc_ZLIB
|
||||||
|
tinc_LZO
|
||||||
|
tinc_OPENSSL
|
||||||
|
|
||||||
|
dnl Check if support for jumbograms is requested
|
||||||
|
AC_ARG_ENABLE(jumbograms,
|
||||||
|
AS_HELP_STRING([--disable-jumbograms], [enable support for jumbograms (packets up to 9000 bytes)]),
|
||||||
|
[ AS_IF([test "x$enable_jumbograms" = "xyes"],
|
||||||
|
[ AC_DEFINE(ENABLE_JUMBOGRAMS, 1, [Support for jumbograms (packets up to 9000 bytes)]) ])
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
AC_SUBST(INCLUDES)
|
||||||
|
|
||||||
|
AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile lib/Makefile m4/Makefile])
|
||||||
|
|
||||||
|
AC_OUTPUT
|
||||||
14
debian/NEWS
vendored
14
debian/NEWS
vendored
|
|
@ -1,14 +0,0 @@
|
||||||
tinc (1.0.27-1) unstable; urgency=medium
|
|
||||||
|
|
||||||
This package now provides native systemd service files, allowing multiple
|
|
||||||
instances of tinc to be managed. Existing networks listed in
|
|
||||||
/etc/tinc/nets.boot will be converted to service instances once during this
|
|
||||||
upgrade. Afterwards, you can enable and disable networks using:
|
|
||||||
|
|
||||||
systemctl enable tinc@<netname>
|
|
||||||
systemctl disable tinc@<netname>
|
|
||||||
|
|
||||||
If you do not have systemd installed, the SysV init script will continue to
|
|
||||||
work as usual. For more information, see README.Debian.
|
|
||||||
|
|
||||||
-- Guus Sliepen <guus@debian.org> Sun, 10 Apr 2016 01:33:55 +0200
|
|
||||||
57
debian/README.Debian
vendored
57
debian/README.Debian
vendored
|
|
@ -1,54 +1,17 @@
|
||||||
tinc for Debian
|
tinc for Debian
|
||||||
---------------
|
----------------------
|
||||||
|
|
||||||
The manual for tinc is also available as info pages, type `info tinc'
|
The manual for tinc is also available as info pages, type `info tinc'
|
||||||
to read it.
|
to read it.
|
||||||
|
|
||||||
There are several ways in which tinc may be automatically started at boot:
|
|
||||||
|
|
||||||
Systemd
|
|
||||||
-------
|
|
||||||
|
|
||||||
Since 1.0.27-1, the tinc package comes with native systemd service files.
|
|
||||||
To enable and start a net, call:
|
|
||||||
|
|
||||||
systemctl enable tinc@<netname>
|
|
||||||
systemctl start tinc@<netname>
|
|
||||||
|
|
||||||
This will cause a tincd to be started which uses the configuration from
|
|
||||||
/etc/tinc/<netname>, and also makes sure that it will be started next time your
|
|
||||||
system boots.
|
|
||||||
|
|
||||||
Apart from controlling individual instances, you can also start/stop/reload all
|
|
||||||
enabled instances simultaneously by omitting @<netname>, for example:
|
|
||||||
|
|
||||||
systemctl reload tinc
|
|
||||||
|
|
||||||
Note that when you have systemd installed on your system, the file
|
|
||||||
/etc/tinc/nets.boot will not be used anymore to automatically start tinc
|
|
||||||
daemons. If the variable EXTRA is defined in /etc/default/tinc, it will be
|
|
||||||
passed on to tinc. The variable LIMITS is however not used.
|
|
||||||
|
|
||||||
The service files that come with this package start tinc unconditionally.
|
|
||||||
However, tinc does support socket activation. If you wish to write a socket
|
|
||||||
unit for tinc, use the ListenStream option to specify on which port(s) and
|
|
||||||
address(es) tinc should listen.
|
|
||||||
|
|
||||||
SysVinit
|
|
||||||
--------
|
|
||||||
|
|
||||||
The system startup script for tinc, /etc/init.d/tinc, uses the file
|
The system startup script for tinc, /etc/init.d/tinc, uses the file
|
||||||
/etc/tinc/nets.boot to find out which networks have to be started. Use one
|
/etc/tinc/nets.boot to find out which networks have to be started.
|
||||||
netname per line. Lines starting with a # are ignored.
|
|
||||||
|
|
||||||
/etc/network/interfaces
|
Alternatively, you can create a stanza in /etc/network/interfaces, and add a
|
||||||
-----------------------
|
line with "tinc-net <netname>". This will cause a tincd to be started which
|
||||||
|
uses the configuration from /etc/tinc/<netname>. You can use an inet static
|
||||||
You can create a stanza in /etc/network/interfaces, and add a line with
|
(with address and netmask options) or inet dhcp stanza, in which case the ifup
|
||||||
"tinc-net <netname>". This will cause a tincd to be started which uses the
|
will configure the VPN interface and you do not need to have a tinc-up script.
|
||||||
configuration from /etc/tinc/<netname>. You can use an inet static (with
|
|
||||||
address and netmask options) or inet dhcp stanza, in which case the ifup will
|
|
||||||
configure the VPN interface and you do not need to have a tinc-up script.
|
|
||||||
|
|
||||||
The following options are also recognized and map directly to the corresponding
|
The following options are also recognized and map directly to the corresponding
|
||||||
command line options for tincd:
|
command line options for tincd:
|
||||||
|
|
@ -74,7 +37,7 @@ iface vpn inet static
|
||||||
|
|
||||||
This will start a tinc daemon that reads its configuration from
|
This will start a tinc daemon that reads its configuration from
|
||||||
/etc/tinc/myvpn, logs at debug level 1, locks itself in RAM, runs as user
|
/etc/tinc/myvpn, logs at debug level 1, locks itself in RAM, runs as user
|
||||||
nobody, and creates a network interface called "vpn". Ifup then sets the
|
nobody, writes the PID to /tmp/tinc.pid, and creates a network interface called
|
||||||
address and netmask on that interface.
|
"vpn". Ifup then sets the address and netmask on that interface.
|
||||||
|
|
||||||
-- Guus Sliepen <guus@debian.org>, Sun, 10 April 2016, 01:38:08 +0200
|
-- Guus Sliepen <guus@debian.org>, Fri, 25 June 2012, 20:28:35 +0200
|
||||||
|
|
|
||||||
184
debian/changelog
vendored
184
debian/changelog
vendored
|
|
@ -1,187 +1,3 @@
|
||||||
tinc (1.0.36-2) unstable; urgency=medium
|
|
||||||
|
|
||||||
* Disable support for libvdeplug. Closes: #973233
|
|
||||||
|
|
||||||
-- Guus Sliepen <guus@debian.org> Sun, 22 Nov 2020 10:40:27 +0100
|
|
||||||
|
|
||||||
tinc (1.0.36-1) unstable; urgency=medium
|
|
||||||
|
|
||||||
* New upstream version 1.0.36
|
|
||||||
* Add Vcs tags to debian/control.
|
|
||||||
* Bump Standards-Version.
|
|
||||||
|
|
||||||
-- Guus Sliepen <guus@debian.org> Mon, 26 Aug 2019 14:17:21 +0200
|
|
||||||
|
|
||||||
tinc (1.0.35-2) unstable; urgency=medium
|
|
||||||
|
|
||||||
* Bump Standards-Version and Build-Depend on debhelper-compat (= 12).
|
|
||||||
* Remove calls to dh_installinit and dh_systemd_start from debian/rules,
|
|
||||||
compat level 12 does the right thing by default.
|
|
||||||
* Ensure we clean up doc/tinc.info.
|
|
||||||
|
|
||||||
-- Guus Sliepen <guus@debian.org> Mon, 28 Jan 2019 21:54:45 +0100
|
|
||||||
|
|
||||||
tinc (1.0.35-1) unstable; urgency=medium
|
|
||||||
|
|
||||||
* New upstream release.
|
|
||||||
- Includes fixes for CVE-2018-16737, CVE-2018-16738, CVE-2018-16758.
|
|
||||||
|
|
||||||
-- Guus Sliepen <guus@debian.org> Mon, 08 Oct 2018 16:09:06 +0200
|
|
||||||
|
|
||||||
tinc (1.0.34-1) unstable; urgency=medium
|
|
||||||
|
|
||||||
[ Guus Sliepen ]
|
|
||||||
* New upstream release.
|
|
||||||
- Fixes a potential segmentation fault when connecting to an IPv6
|
|
||||||
peer via a proxy. Closes: #887401
|
|
||||||
* Add support for the $EXTRA variable in /etc/default/tinc when using
|
|
||||||
systemd. Closes: #887116
|
|
||||||
|
|
||||||
[ Benda Xu ]
|
|
||||||
* Prevent possible incorrect IPv6 checksums due to function inlining.
|
|
||||||
Closes: #891400
|
|
||||||
|
|
||||||
-- Guus Sliepen <guus@debian.org> Tue, 12 Jun 2018 23:00:49 +0200
|
|
||||||
|
|
||||||
tinc (1.0.33-1) unstable; urgency=medium
|
|
||||||
|
|
||||||
* New upstream release.
|
|
||||||
* Test for /etc/default/tinc before trying to source it. Closes: #777262
|
|
||||||
* Use --runstatedir=/run.
|
|
||||||
|
|
||||||
-- Guus Sliepen <guus@debian.org> Sat, 04 Nov 2017 16:22:06 +0100
|
|
||||||
|
|
||||||
tinc (1.0.32-1) unstable; urgency=medium
|
|
||||||
|
|
||||||
* New upstream release.
|
|
||||||
* Add a note to new nets.boot files that it is not used with systemd.
|
|
||||||
Closes: #841052
|
|
||||||
* In the post-down script, read the pid file only once. Closes: #832784
|
|
||||||
* Explicitly use /bin/sleep from coreutils. Closes: #772379
|
|
||||||
* Bump Standards-Version.
|
|
||||||
|
|
||||||
-- Guus Sliepen <guus@debian.org> Tue, 05 Sep 2017 20:23:36 +0200
|
|
||||||
|
|
||||||
tinc (1.0.31-1) unstable; urgency=medium
|
|
||||||
|
|
||||||
* New upstream release.
|
|
||||||
* Bump Standards-Version.
|
|
||||||
* Bump debian/compat.
|
|
||||||
* Add missing Depends: lsb-base.
|
|
||||||
|
|
||||||
-- Guus Sliepen <guus@debian.org> Sun, 15 Jan 2017 16:20:40 +0100
|
|
||||||
|
|
||||||
tinc (1.0.29-2) unstable; urgency=medium
|
|
||||||
|
|
||||||
* Rebuild with libssl-dev from unstable.
|
|
||||||
|
|
||||||
-- Guus Sliepen <guus@debian.org> Thu, 27 Oct 2016 13:09:46 +0200
|
|
||||||
|
|
||||||
tinc (1.0.29-1) unstable; urgency=medium
|
|
||||||
|
|
||||||
* New upstream release.
|
|
||||||
* Bump debian/compat.
|
|
||||||
|
|
||||||
-- Guus Sliepen <guus@debian.org> Mon, 10 Oct 2016 22:30:25 +0200
|
|
||||||
|
|
||||||
tinc (1.0.28-1) unstable; urgency=medium
|
|
||||||
|
|
||||||
* New upstream release.
|
|
||||||
- Fixes FTBFS on kfreebsd.
|
|
||||||
* Systemd service files are now provided by upstream.
|
|
||||||
|
|
||||||
-- Guus Sliepen <guus@debian.org> Sun, 10 Apr 2016 15:44:28 +0200
|
|
||||||
|
|
||||||
tinc (1.0.27-2) unstable; urgency=medium
|
|
||||||
|
|
||||||
* Fix tinc@.service.
|
|
||||||
|
|
||||||
-- Guus Sliepen <guus@debian.org> Sun, 10 Apr 2016 12:45:33 +0200
|
|
||||||
|
|
||||||
tinc (1.0.27-1) unstable; urgency=medium
|
|
||||||
|
|
||||||
* New upstream release.
|
|
||||||
* Bump Standards-Version.
|
|
||||||
* Add native systemd unit files.
|
|
||||||
* Automatically convert networks listed in nets.boot to systemd service
|
|
||||||
instances on upgrade.
|
|
||||||
|
|
||||||
-- Guus Sliepen <guus@debian.org> Sun, 10 Apr 2016 01:39:16 +0200
|
|
||||||
|
|
||||||
tinc (1.0.26-1) unstable; urgency=medium
|
|
||||||
|
|
||||||
* New upstream release.
|
|
||||||
* Use the contents, not the presence, of the pidfile to check that tincd is
|
|
||||||
shut down properly. Closes: #774682
|
|
||||||
* Bump Standards-Version.
|
|
||||||
|
|
||||||
-- Guus Sliepen <guus@debian.org> Sun, 05 Jul 2015 17:23:08 +0200
|
|
||||||
|
|
||||||
tinc (1.0.24-2) unstable; urgency=medium
|
|
||||||
|
|
||||||
* Improve the init script: stopping tinc now waits for the process to
|
|
||||||
terminate. If that doesn't happen in 5 seconds, it will send the TERM
|
|
||||||
signal again (which helps if tinc is waiting for a script to finish
|
|
||||||
executing). It now also detects whether the process mentioned in the PID
|
|
||||||
file is actually running, and if not it will exit early and without
|
|
||||||
warnings. Closes: #748107
|
|
||||||
|
|
||||||
-- Guus Sliepen <guus@debian.org> Wed, 14 May 2014 21:44:16 +0200
|
|
||||||
|
|
||||||
tinc (1.0.24-1) unstable; urgency=medium
|
|
||||||
|
|
||||||
[ Guus Sliepen ]
|
|
||||||
* New upstream release
|
|
||||||
* Add a debian/watch file.
|
|
||||||
* Bump Standards-Version.
|
|
||||||
|
|
||||||
[ Gian Piero Carrubba ]
|
|
||||||
* Allow resource limits to be set in /etc/default/tinc.
|
|
||||||
Closes: #690685, #704702
|
|
||||||
|
|
||||||
-- Guus Sliepen <guus@debian.org> Sun, 11 May 2014 21:17:13 +0200
|
|
||||||
|
|
||||||
tinc (1.0.23-2) unstable; urgency=low
|
|
||||||
|
|
||||||
* Use if-statements instead of && in shell scripts. Closes: #731279
|
|
||||||
The && operator does not clear the error status, and if the next statement
|
|
||||||
in a shell script does not change the error status it would cause the
|
|
||||||
script to prematurely exit. Thanks to Peter Reinholdtsen for spotting it.
|
|
||||||
* Use absolute path to tincd in the if-post-down script.
|
|
||||||
|
|
||||||
-- Guus Sliepen <guus@debian.org> Thu, 05 Dec 2013 09:41:13 +0000
|
|
||||||
|
|
||||||
tinc (1.0.23-1) unstable; urgency=low
|
|
||||||
|
|
||||||
* New upstream release.
|
|
||||||
|
|
||||||
-- Guus Sliepen <guus@debian.org> Sat, 19 Oct 2013 21:06:05 +0200
|
|
||||||
|
|
||||||
tinc (1.0.22-1) unstable; 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:29 +0200
|
|
||||||
|
|
||||||
tinc (1.0.21-1) unstable; urgency=low
|
|
||||||
|
|
||||||
* New upstream release.
|
|
||||||
- Includes fix for CVE-2013-1428.
|
|
||||||
|
|
||||||
-- Guus Sliepen <guus@debian.org> Sun, 05 May 2013 10:42:33 +0200
|
|
||||||
|
|
||||||
tinc (1.0.19-3) unstable; urgency=high
|
|
||||||
|
|
||||||
* Drop packets forwarded via TCP if they are too big (CVE-2013-1428).
|
|
||||||
|
|
||||||
-- Guus Sliepen <guus@debian.org> Fri, 12 Apr 2013 22:52:10 +0200
|
|
||||||
|
|
||||||
tinc (1.0.19-2) unstable; urgency=low
|
tinc (1.0.19-2) unstable; urgency=low
|
||||||
|
|
||||||
* Fix behaviour of tinc-pidfile. Closes: #679130
|
* Fix behaviour of tinc-pidfile. Closes: #679130
|
||||||
|
|
|
||||||
1
debian/compat
vendored
Normal file
1
debian/compat
vendored
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
9
|
||||||
10
debian/control
vendored
10
debian/control
vendored
|
|
@ -2,17 +2,13 @@ Source: tinc
|
||||||
Section: net
|
Section: net
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Maintainer: Guus Sliepen <guus@debian.org>
|
Maintainer: Guus Sliepen <guus@debian.org>
|
||||||
Standards-Version: 4.4.0
|
Standards-Version: 3.9.3
|
||||||
Build-Depends: libssl-dev, debhelper-compat (= 12), gettext, texinfo, zlib1g-dev, liblzo2-dev
|
Build-Depends: libssl-dev, debhelper (>= 9), gettext, texi2html, texinfo, zlib1g-dev, liblzo2-dev, libvdeplug-dev
|
||||||
Homepage: http://www.tinc-vpn.org/
|
Homepage: http://www.tinc-vpn.org/
|
||||||
Vcs-Browser: https://salsa.debian.org/guus/tinc
|
|
||||||
Vcs-Git: https://salsa.debian.org/guus/tinc.git
|
|
||||||
Rules-Requires-Root: no
|
|
||||||
|
|
||||||
Package: tinc
|
Package: tinc
|
||||||
Architecture: any
|
Architecture: any
|
||||||
Pre-Depends: ${misc:Pre-Depends}
|
Depends: ${shlibs:Depends}, ${misc:Depends}
|
||||||
Depends: ${shlibs:Depends}, ${misc:Depends}, lsb-base (>= 3.0-6)
|
|
||||||
Description: Virtual Private Network daemon
|
Description: Virtual Private Network daemon
|
||||||
tinc is a daemon with which you can create a virtual private network
|
tinc is a daemon with which you can create a virtual private network
|
||||||
(VPN). One daemon can handle multiple connections, so you can
|
(VPN). One daemon can handle multiple connections, so you can
|
||||||
|
|
|
||||||
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
|
Section: System/Security
|
||||||
|
|
||||||
Format: HTML
|
Format: HTML
|
||||||
Files: /usr/share/doc/tinc/tinc.html/*
|
Files: /usr/share/doc/tinc/tinc*.html
|
||||||
Index: /usr/share/doc/tinc/tinc.html/index.html
|
Index: /usr/share/doc/tinc/tinc_toc.html
|
||||||
|
|
|
||||||
65
debian/patches/fix-incorrect-icmpv6-checksum
vendored
65
debian/patches/fix-incorrect-icmpv6-checksum
vendored
|
|
@ -1,65 +0,0 @@
|
||||||
Package: tinc
|
|
||||||
Version: 1.0.33-1
|
|
||||||
Severity: important
|
|
||||||
|
|
||||||
Dear Guus,
|
|
||||||
|
|
||||||
I have been using tinc since 2009 and it is great!
|
|
||||||
|
|
||||||
When PMTUDiscovery=yes and Mode=switch, and if ipv6 is used inside
|
|
||||||
tinc, the ICMPv6 "Packet Too Big" packets have incorrect checksums.
|
|
||||||
It can be reproduced by `ping6 <host in tinc> -s 1800` and `tcpdump -i
|
|
||||||
<tinc interface>`. Consequently, the host ignores the tinc-generated
|
|
||||||
ICMPv6 packets, PMTUDiscovery does not work and the connections freeze
|
|
||||||
when data flows are big.
|
|
||||||
|
|
||||||
I find the bug is gone if the function "inet_checksum" in route.c is
|
|
||||||
not inlined, either by compiling tinc with "-O2
|
|
||||||
-fno-inline-functions", or apply a patch such as,
|
|
||||||
|
|
||||||
diff --git a/src/route.c b/src/route.c
|
|
||||||
index ff82c06e..cd55383a 100644
|
|
||||||
--- a/src/route.c
|
|
||||||
+++ b/src/route.c
|
|
||||||
@@ -60,7 +60,7 @@ static const size_t opt_size = sizeof(struct nd_opt_hdr);
|
|
||||||
|
|
||||||
/* RFC 1071 */
|
|
||||||
|
|
||||||
-static uint16_t inet_checksum(void *data, int len, uint16_t prevsum) {
|
|
||||||
+__attribute__ ((noinline)) static uint16_t inet_checksum(void *data, int len, uint16_t prevsum) {
|
|
||||||
uint16_t *p = data;
|
|
||||||
uint32_t checksum = prevsum ^ 0xFFFF;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
I have tested with gcc-7.3.0 and gcc-5.4.0. They behaved the same. I
|
|
||||||
am not good at assembly to find out what really happened, but it is
|
|
||||||
for sure that inet_checksum does not work as expected if compiled
|
|
||||||
inline.
|
|
||||||
|
|
||||||
Thanks!
|
|
||||||
|
|
||||||
Yours,
|
|
||||||
Benda
|
|
||||||
|
|
||||||
-- System Information:
|
|
||||||
Debian Release: buster/sid
|
|
||||||
APT prefers unstable
|
|
||||||
APT policy: (500, 'unstable')
|
|
||||||
Architecture: amd64 (x86_64)
|
|
||||||
|
|
||||||
Kernel: Linux 4.9.0-5-amd64 (SMP w/8 CPU cores)
|
|
||||||
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to en_US.UTF-8), LANGUAGE=en_US:en (charmap=UTF-8) (ignored: LC_ALL set to en_US.UTF-8)
|
|
||||||
Shell: /bin/sh linked to /bin/dash
|
|
||||||
Init: sysvinit (via /sbin/init)
|
|
||||||
|
|
||||||
Versions of packages tinc depends on:
|
|
||||||
ii libc6 2.26-2
|
|
||||||
ii liblzo2-2 2.08-1.2+b2
|
|
||||||
ii libssl1.1 1.1.0g-2
|
|
||||||
ii lsb-base 9.20170808
|
|
||||||
ii zlib1g 1:1.2.8.dfsg-5
|
|
||||||
|
|
||||||
tinc recommends no packages.
|
|
||||||
|
|
||||||
tinc suggests no packages.
|
|
||||||
2
debian/patches/series
vendored
2
debian/patches/series
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
fix-incorrect-icmpv6-checksum
|
|
||||||
support-etc-defaults-tinc
|
|
||||||
12
debian/patches/support-etc-defaults-tinc
vendored
12
debian/patches/support-etc-defaults-tinc
vendored
|
|
@ -1,12 +0,0 @@
|
||||||
--- a/systemd/tinc@.service.in
|
|
||||||
+++ b/systemd/tinc@.service.in
|
|
||||||
@@ -9,7 +9,8 @@
|
|
||||||
[Service]
|
|
||||||
Type=simple
|
|
||||||
WorkingDirectory=@sysconfdir@/tinc/%i
|
|
||||||
-ExecStart=@sbindir@/tincd -n %i -D
|
|
||||||
+EnvironmentFile=/etc/default/tinc
|
|
||||||
+ExecStart=@sbindir@/tincd -n %i -D $EXTRA
|
|
||||||
ExecReload=@sbindir@/tincd -n %i -kHUP
|
|
||||||
KillMode=mixed
|
|
||||||
Restart=on-failure
|
|
||||||
7
debian/postinst
vendored
7
debian/postinst
vendored
|
|
@ -7,15 +7,14 @@ set -e
|
||||||
case "$1" in
|
case "$1" in
|
||||||
configure)
|
configure)
|
||||||
if [ ! -e /dev/.devfsd ] ; then if [ ! -e /dev/.devfs ] ; then
|
if [ ! -e /dev/.devfsd ] ; then if [ ! -e /dev/.devfs ] ; then
|
||||||
if [ ! -e /dev/net/tun ] ; then if [ ! -e /dev/tun ] ; then if [ -e /dev/MAKEDEV ]; then
|
if [ ! -e /dev/net/tun ] ; then if [ ! -e /dev/tun ] ; then
|
||||||
echo "Creating tun device..."
|
echo "Creating tun device..."
|
||||||
cd /dev && ./MAKEDEV net/tun 2>/dev/null || ./MAKEDEV tun 2>/dev/null || echo "Failed to create tun device."
|
cd /dev && ./MAKEDEV net/tun 2>/dev/null || ./MAKEDEV tun 2>/dev/null || echo "Failed to create tun device."
|
||||||
fi; fi; fi
|
fi; fi
|
||||||
fi; fi
|
fi; fi
|
||||||
|
|
||||||
if [ ! -e $NETSFILE ] ; then
|
if [ ! -e $NETSFILE ] ; then
|
||||||
echo "## This file contains all names of the networks to be started on system startup when using sysvinit." > $NETSFILE
|
echo "## This file contains all names of the networks to be started on system startup." > $NETSFILE
|
||||||
echo "## If you are using systemd, use systemctl enable tinc@netname to enable individual networks." >> $NETSFILE
|
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|
|
||||||
28
debian/preinst
vendored
28
debian/preinst
vendored
|
|
@ -1,28 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
NETSFILE="/etc/tinc/nets.boot"
|
|
||||||
SYSTEM="/lib/systemd/system"
|
|
||||||
WANTS="/etc/systemd/system/multi-user.target.wants"
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
upgrade)
|
|
||||||
if dpkg --compare-versions "$2" '<<' "1.0.27-1"; then
|
|
||||||
if [ -f "$NETSFILE" ]; then
|
|
||||||
echo -n "Creating systemd service instances from nets.boot:"
|
|
||||||
mkdir -p "$WANTS"
|
|
||||||
egrep '^[ ]*[a-zA-Z0-9_-]+' $NETSFILE | while read net args; do
|
|
||||||
echo -n " $net"
|
|
||||||
ln -s "$SYSTEM/tinc@.service" "$WANTS/tinc@$net.service" 2>/dev/null || true
|
|
||||||
done
|
|
||||||
echo "."
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
#DEBHELPER#
|
|
||||||
40
debian/rules
vendored
40
debian/rules
vendored
|
|
@ -1,16 +1,36 @@
|
||||||
#!/usr/bin/make -f
|
#!/usr/bin/make -f
|
||||||
|
# -*- makefile -*-
|
||||||
|
# Sample debian/rules that uses debhelper.
|
||||||
|
# This file was originally written by Joey Hess and Craig Small.
|
||||||
|
# As a special exception, when this file is copied by dh-make into a
|
||||||
|
# dh-make output file, you may use that output file without restriction.
|
||||||
|
# This special exception was added by Craig Small in version 0.37 of dh-make.
|
||||||
|
|
||||||
|
# Uncomment this to turn on verbose mode.
|
||||||
|
#export DH_VERBOSE=1
|
||||||
|
|
||||||
%:
|
%:
|
||||||
dh $@
|
dh $@ --parallel
|
||||||
|
|
||||||
|
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/
|
||||||
|
# Remove info dir file
|
||||||
|
rm -f debian/tinc/usr/share/info/dir
|
||||||
|
|
||||||
|
override_dh_installinit:
|
||||||
|
dh_installinit -R
|
||||||
|
|
||||||
override_dh_clean:
|
override_dh_clean:
|
||||||
dh_clean
|
dh_clean
|
||||||
rm -f doc/tinc.info
|
rm -f src/device.c
|
||||||
|
|
||||||
override_dh_auto_configure:
|
|
||||||
dh_auto_configure -- --enable-uml --with-systemd=/lib/systemd/system --runstatedir=/run
|
|
||||||
|
|
||||||
override_dh_auto_install:
|
|
||||||
dh_auto_install -- install-html
|
|
||||||
# Remove info dir file
|
|
||||||
rm -f debian/tinc/usr/share/info/dir
|
|
||||||
|
|
|
||||||
5
debian/tinc.default
vendored
5
debian/tinc.default
vendored
|
|
@ -1,7 +1,2 @@
|
||||||
# Extra options to be passed to tincd.
|
# Extra options to be passed to tincd.
|
||||||
# EXTRA="-d"
|
# EXTRA="-d"
|
||||||
|
|
||||||
# Limits to be configured for the tincd process. Please read your shell
|
|
||||||
# (pointed by /bin/sh) documentation for ulimit. You probably want to raise the
|
|
||||||
# max locked memory value if using both --mlock and --user flags.
|
|
||||||
# LIMITS="-l 1024"
|
|
||||||
|
|
|
||||||
40
debian/tinc.if-post-down
vendored
40
debian/tinc.if-post-down
vendored
|
|
@ -2,40 +2,20 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
if [ "$METHOD" = loopback -o -z "$IF_TINC_NET" ]; then
|
if [ "$IF_TINC_NET" ] ; then
|
||||||
exit 0
|
EXTRA=""
|
||||||
fi
|
[ -n "$IF_TINC_PIDFILE" ] && EXTRA="--pidfile=$IF_TINC_PIDFILE" || IF_TINC_PIDFILE=/var/run/tinc.$IF_TINC_NET.pid
|
||||||
|
tincd -n "$IF_TINC_NET" -k $EXTRA
|
||||||
# Determine location of the PID file
|
sleep 0.1
|
||||||
|
i=0;
|
||||||
EXTRA=""
|
while [ -f "$IF_TINC_PIDFILE" ] ; do
|
||||||
if [ -n "$IF_TINC_PIDFILE" ]; then
|
|
||||||
EXTRA="--pidfile=$IF_TINC_PIDFILE"
|
|
||||||
else
|
|
||||||
IF_TINC_PIDFILE=/var/run/tinc.$IF_TINC_NET.pid
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Stop the tinc daemon
|
|
||||||
|
|
||||||
read pid rest < $IF_TINC_PIDFILE 2>/dev/null
|
|
||||||
|
|
||||||
/usr/sbin/tincd -n "$IF_TINC_NET" -k $EXTRA
|
|
||||||
|
|
||||||
# Wait for it to shut down properly
|
|
||||||
|
|
||||||
/bin/sleep 0.1
|
|
||||||
i=0;
|
|
||||||
while [ -f $IF_TINC_PIDFILE ] ; do
|
|
||||||
if [ ! -e "/proc/$pid" ] ; then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ $i = '30' ] ; then
|
if [ $i = '30' ] ; then
|
||||||
echo 'Failed to stop tinc daemon!'
|
echo 'Failed to stop tinc daemon!'
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
/bin/sleep 0.1
|
sleep 0.1
|
||||||
i=$(($i+1))
|
i=$(($i+1))
|
||||||
done
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
|
||||||
41
debian/tinc.if-pre-up
vendored
41
debian/tinc.if-pre-up
vendored
|
|
@ -2,29 +2,11 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
if [ "$METHOD" = loopback -o -z "$IF_TINC_NET" ]; then
|
[ -z "$IF_TINC_NET" ] && exit 0
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Read options from /etc/default
|
# Read options from /etc/default
|
||||||
|
|
||||||
[ -r /etc/default/tinc ] && . /etc/default/tinc
|
. /etc/default/tinc
|
||||||
|
|
||||||
# Set process limits
|
|
||||||
|
|
||||||
setlimits() {
|
|
||||||
while [ $# -gt 0 ]; do
|
|
||||||
parm=$1 ; shift
|
|
||||||
if [ -n "$1" -a "${1#-}" = "$1" ]; then
|
|
||||||
value=$1 ; shift
|
|
||||||
ulimit $parm $value
|
|
||||||
else
|
|
||||||
ulimit $parm
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
test -n "$LIMITS" && setlimits $LIMITS
|
|
||||||
|
|
||||||
# Read options from /etc/network/interfaces
|
# Read options from /etc/network/interfaces
|
||||||
|
|
||||||
|
|
@ -43,27 +25,14 @@ test -n "$LIMITS" && setlimits $LIMITS
|
||||||
|
|
||||||
# Wait for it to come up properly
|
# Wait for it to come up properly
|
||||||
|
|
||||||
/bin/sleep 0.1
|
sleep 0.1
|
||||||
i=0;
|
i=0;
|
||||||
while [ ! -f $IF_TINC_PIDFILE ] ; do
|
while [ ! -f "$IF_TINC_PIDFILE" ] ; do
|
||||||
if [ $i = '30' ] ; then
|
if [ $i = '30' ] ; then
|
||||||
echo 'Failed to start tinc daemon!'
|
echo 'Failed to start tinc daemon!'
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
/bin/sleep 0.1
|
sleep 0.1
|
||||||
i=$(($i+1))
|
|
||||||
done
|
|
||||||
|
|
||||||
while read pid rest < $IF_TINC_PIDFILE ; do
|
|
||||||
if [ -e "/proc/$pid" ] ; then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ $i = '30' ] ; then
|
|
||||||
echo 'Failed to start tinc daemon!'
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
/bin/sleep 0.1
|
|
||||||
i=$(($i+1))
|
i=$(($i+1))
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
|
||||||
5
debian/tinc.if-up
vendored
5
debian/tinc.if-up
vendored
|
|
@ -2,8 +2,7 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
if [ "$METHOD" = loopback -o -n "$IF_TINC_NET" ]; then
|
[ "$METHOD" = loopback ] && exit 0
|
||||||
exit 0
|
[ -n "$IF_TINC_NET" ] && exit 0
|
||||||
fi
|
|
||||||
|
|
||||||
invoke-rc.d tinc alarm || exit 0
|
invoke-rc.d tinc alarm || exit 0
|
||||||
|
|
|
||||||
57
debian/tinc.init
vendored
57
debian/tinc.init
vendored
|
|
@ -18,8 +18,6 @@
|
||||||
#
|
#
|
||||||
# Based on Lubomir Bulej's Redhat init script.
|
# Based on Lubomir Bulej's Redhat init script.
|
||||||
|
|
||||||
. /lib/lsb/init-functions
|
|
||||||
|
|
||||||
DAEMON="/usr/sbin/tincd"
|
DAEMON="/usr/sbin/tincd"
|
||||||
NAME="tinc"
|
NAME="tinc"
|
||||||
DESC="tinc daemons"
|
DESC="tinc daemons"
|
||||||
|
|
@ -56,62 +54,31 @@ signal_running() {
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
setlimits() {
|
|
||||||
while [ $# -gt 0 ]; do
|
|
||||||
parm=$1 ; shift
|
|
||||||
if [ -n "$1" -a "${1#-}" = "$1" ]; then
|
|
||||||
value=$1 ; shift
|
|
||||||
ulimit $parm $value
|
|
||||||
else
|
|
||||||
ulimit $parm
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
test -n "$LIMITS" && setlimits $LIMITS
|
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
$DAEMON $EXTRA -n "$@"
|
$DAEMON $EXTRA -n "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
stop() {
|
stop() {
|
||||||
[ -f /var/run/tinc.$1.pid ] || return
|
$DAEMON -n $1 -k
|
||||||
read pid rest </var/run/tinc.$1.pid || return
|
|
||||||
kill -0 "$pid" 2>/dev/null || return
|
|
||||||
|
|
||||||
$DAEMON -n $1 -k || return
|
|
||||||
|
|
||||||
i=0;
|
|
||||||
/bin/sleep 0.5
|
|
||||||
|
|
||||||
# Wait for the pidfile to disappear
|
|
||||||
while [ -f /var/run/tinc.$1.pid ]; do
|
|
||||||
# And check that there is an actual process running
|
|
||||||
kill -0 "$pid" 2>/dev/null || return
|
|
||||||
|
|
||||||
if [ $i = '10' ] ; then
|
|
||||||
# It's still alive, kill it again and give up
|
|
||||||
$DAEMON -n $1 -k && /bin/sleep 0.5
|
|
||||||
break
|
|
||||||
else
|
|
||||||
echo -n "."
|
|
||||||
i=$(($i+1))
|
|
||||||
fi
|
|
||||||
|
|
||||||
/bin/sleep 0.5
|
|
||||||
done
|
|
||||||
}
|
}
|
||||||
|
|
||||||
reload() {
|
reload() {
|
||||||
$DAEMON -n $1 -kHUP
|
$DAEMON -n $1 -kHUP
|
||||||
}
|
}
|
||||||
|
|
||||||
alarm() {
|
alarm() {
|
||||||
$DAEMON -n $1 -kALRM
|
$DAEMON -n $1 -kALRM
|
||||||
}
|
}
|
||||||
|
|
||||||
restart() {
|
restart() {
|
||||||
stop "$@"
|
stop "$@"
|
||||||
|
sleep 0.5
|
||||||
|
i=0;
|
||||||
|
while [ -f /var/run/tinc.$1.pid ] ; do
|
||||||
|
if [ $i = '10' ] ; then
|
||||||
|
break
|
||||||
|
else
|
||||||
|
echo -n "."
|
||||||
|
sleep 0.5
|
||||||
|
i=$(($i+1))
|
||||||
|
fi
|
||||||
|
done
|
||||||
start "$@"
|
start "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
70
debian/upstream/signing-key.asc
vendored
70
debian/upstream/signing-key.asc
vendored
|
|
@ -1,70 +0,0 @@
|
||||||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
|
||||||
Version: GnuPG v1
|
|
||||||
|
|
||||||
mQINBEVZzTABEADawFv/ibQ48uA1eRhL07vdM36Pcq2HDyuyNA+vYEalNH4jLmha
|
|
||||||
nGPvDALWwX0DXIWDAG8zeTj8s8zliLIjuPS4WRI2YdKIvWeG9fEvpKSXVWa42ica
|
|
||||||
dpzn/H2aBd4Ax6rQaiTXKOvxANAp2Veb+73ssPV5AL00uGTpzhh98xQzfFQCZ9ZL
|
|
||||||
YSVPqbMed5oCt/4jM9FBO2CuBtkfiO0dVVYtW7FAVjcIlE2NaZol/KGvz7wsS+yA
|
|
||||||
dE42W0l5MdQueLmTF4AIUSSTyPFGMQoyqh+MPif73Y589IGcW6GdfKYWnVDo6Trh
|
|
||||||
HOhcEky+uTYKb6NL0vrJgUiYVMzAOXFDdJni1eQGO6EfZRNYtTga3alWq/jVelK7
|
|
||||||
BID5JyNbkrTAqdPnhJGivVyk8gGX3+Hng8rkXTfWhp6yAYau1QfBm0F2tIQmpL1C
|
|
||||||
+7DoLvFErboQf685jXJBjzyvsJxB2ZLH1OOw6mNL0hy2LFkIyGza/bktY2em4apo
|
|
||||||
KWV5AM5LpyW6THH1oDS7706xFNkf4IFhKE0hKPzBiRnMDjRtMI131lkc5+P8Lqf5
|
|
||||||
jLTCFUgbEhU6Dz2YjhHAumVm0NWJETUpFDtVvMrqk+mp5xldUOWRNlYQC5aQOyda
|
|
||||||
eHOlNzB/BFbPhKMWI/zWlEH6f0t6WjHb4iwpWO47511aVNHF59aPzbAHxwARAQAB
|
|
||||||
tC9UaW5jIERldmVsb3BtZW50IFRlYW0gPHRpbmMtZGV2ZWxAdGluYy12cG4ub3Jn
|
|
||||||
PokCNgQTAQIAIAUCRVnNMAIbAwYLCQgHAwIEFQIIAwQWAgMBAh4BAheAAAoJEEpg
|
|
||||||
hLnA1x9KxOAQAMPhO2WTXv9AaGQBQhyyoGseKoSfcRjtI9YEfE0OInQQ2E+SPYF/
|
|
||||||
dkfeLGAUqa4foTYQlMqfw70vBhTdVCb7HLTGn6/ICFUtDwakUQCgUQGlUVQiondA
|
|
||||||
8W6jj+QWrh5BQhHuXy2nCVaKnksu0/xQPsJotghxuYqaot3iJ4qVw9iT/Yeo9irH
|
|
||||||
Ffftqu0OVCdQ5zQuFNI9YCv/C83L59ecH7bOzYz2efTyobvxrhmgQtgOQwCWOE09
|
|
||||||
Kr3veM9KLG33YoXlqv8QN/3CwtsJvSwfhj+R2JowZC7RqHe/yznRzmRMsgbrolxi
|
|
||||||
uiJLonGxcNNkD7WhXi7/zL4A/JaC27XrFf1MPLv8aiTwnOIfrXd5jawpauUOZOXK
|
|
||||||
UjIZHlIqviB0r5s7A+AFeHW38Tp9VzNuQ7aEl5bHbSXV+s7DTAwGb279z0AVaJ3h
|
|
||||||
5hWFxupw7UoGdzROwCBYzeX3sioAL6QvkXua8X6zOH45VEiSwrRX3Hlx/MLo7Z4g
|
|
||||||
PWgFLf6WviHQXCG834To1XIwUk9RgNsL7OzGjtaCuRymADImKMNwierq2zTfoRFQ
|
|
||||||
v9onIadIMF1fsc70hiBG9yAi36MEuk4VxG8Jc3PQQfSFm4RWazv1k3E0AAIob2Ek
|
|
||||||
DLVjvLO62Navo/OQ6D7yyiX0qes5S7/k3F1h8+87eRn3yxZE2kbxPg8KuQENBEVZ
|
|
||||||
zYYBCACoYgExmMKEtABL3pir/IXI4exR/45hkP6txFIrkVQb8DGJ9H39kiDr4gtj
|
|
||||||
F+pvcgMpec35S3m4fJ7WhDNvbDB4ZvONc1NMKs9cqDXfB+TLWPm4W+SkcKUrs+nK
|
|
||||||
i8l7ieggTALJcvRoLTX2EFmUFrD6y870W3rK2SfC/0VJX8Ou5cPbwCeueExjo5x0
|
|
||||||
3gNfu0jWUS0cyA9y+1rVVekrLuJY/+SI4jv3gdzrYbxD0f6dpbpC37QHoJdd0KGF
|
|
||||||
acPtT2azjY+HxW10EA3Aw9oZWFXnb1nFg2RbDpkaGLmLbaXweltLyw154UmCXxym
|
|
||||||
PXPqi9bSfEkj0GiYrapk4mW114u9ABEBAAGJA0QEGAECAA8FAkVZzYcCGwIFCQHh
|
|
||||||
M4ABKQkQSmCEucDXH0rAXSAEGQECAAYFAkVZzYcACgkQ017duBDeLmmu3wf/TFZM
|
|
||||||
tLKxiyQPtGSTE3eULPdWCEMDZXdSPTY0QHM7Zvh+qn1ei+iFpD0549MYnBEAwDIV
|
|
||||||
4o62Nrcg8IPu0CEkZIAn2JiFFGYvMGk91awZGV1GS3umd7Dt349E1oKDPZVzRn+j
|
|
||||||
QIKarXxxabRmx2s/dZZgSs/eguWTboBFmvls9tVfe8x/xPvcHFmqHVUoGKEJy6Tm
|
|
||||||
no+s4yNjpc5wAaRml+GYf1tK9WMFuZn79qKxkYv4WI96dXR0FL59YbFRkkaI+1/b
|
|
||||||
G31MvWTqVjY1nJGslByFPUUB8Ca1djtp1gx6NXnOYr3V5MEDfdbjjPu79No+/y6M
|
|
||||||
tIua5yNtSRlk2nKhIqo3D/sGQ/uHijiMRAtoLhiyqYMc9W9vx/KOoCUHoMJqE39a
|
|
||||||
Eputvgwwo0rwgSmNfB1dzneFojBdJ47WBSHC8NKtkpJj6mzvvlaI9jmEpK54x3nl
|
|
||||||
OmBj3X/xaepoRGAtrmgTBP4A9hSjrTMGu/tUQjlX+Xcr6n3g7GSVe5FpUyIMPXEU
|
|
||||||
+JZDTiEUyn1OdzfNGmnWP+KJX5pQVq4czf5XK6otLZJELDVw/Hbjnjmdz5WOKgEH
|
|
||||||
jSof3WPeMBgPAcd/cMAZeiGtWM1UpJBHqEXTkthmrpmtRftJKDbooNM9d5OwKiT+
|
|
||||||
I3vNBv/plMSr8NDjhTWC+ihrN6RBj1vaqpDgGpucPhoO2hwNqWuI4q5WUKtCyw6J
|
|
||||||
An7ErNaH4c0nVaZq6kJ8Vxdt+LpKYmOsJ8y9xtl6StcrkKNn+6ZfCfee7DEo2bvb
|
|
||||||
scfpqJqqOqb5KOagTpYs8mo6yQ3leRvFtoeBOQHVQzct23EwOMxbDyeunT50a1eH
|
|
||||||
MZTEWuIiuCUudM81QXU46oIcaAtj8tpG0Tmnku9g27EjwxUt+8kVmhlPHMb2TdoF
|
|
||||||
k5d0ce+JuxIG5+i+t8sUCorMc8zfp4g1bxZeMOcPnfyO3bSW11EVcN7ZxHlFC+XE
|
|
||||||
YOByP50CM3P8lItPlQ+WpY9kYWjiwu9kVPaGQ16G47nspngJInU5dhka3KJGtIZe
|
|
||||||
q7kBDQRFWc3GAQgAz/JUs24niKsd0ZtOjUWd4R4y0gjS0kC/vvLL2gbXYkA9tcjG
|
|
||||||
5iEvVWJY34QsudX0v1ULsVnJ89X/gsk8hAhAia1TQm+0Qq+MSxEaQkMSaOO8N70U
|
|
||||||
XzgH1dielvpea20WO4MyWQuRIJ0K2nsGmEPnt6ZP7fK8HVHFNggP/mQ6LMu1reAF
|
|
||||||
gvb8cEtjb9B5QaCUEoLjsbsuo+vLW7AWy4GfIRNESHw2Qt08AUaGrihpu6zi7N2b
|
|
||||||
QkHHJtqa63GzYJ+kYzAVvrFJXdwL/TRXLBzv+6yyvYSIHi8uB6/o6CZN6hpjfpME
|
|
||||||
ph+oYPqXeNOyMd1E9Kg8ymcPrNyQKfE3WnCRXQARAQABiQIlBBgBAgAPBQJFWc3H
|
|
||||||
AhsMBQkB4TOAAAoJEEpghLnA1x9KXYMP/3D9JYti6C8DWuX2hWv+2SUbLcMa5u1e
|
|
||||||
ETewIo5S3mqGWSaxX4YLPVRkZ1lOLmFysOLimf0thYm7IsatLcWmBdYUpK92ilvr
|
|
||||||
Sk2sKlhrOoBXEX/79Kz+Aj5PjeyiQxgQ7Ba/afwhU6aTqs2Dp1T0YNu2eBvV+1QH
|
|
||||||
lZnW2Wh96zzwc0dJUuY9eBk5Fgpu08Wce7o6jxFPtVyAaQa0zcNAmw2TSY7wbunJ
|
|
||||||
WTl9OgATAyqVCuhWW7AnPcSqkH8lQigSc00wfqJKOD2Us0FqN6UKDCZTyQkdP6hx
|
|
||||||
G+3aUkkvGSOxy7u9bVWmrikuJMoiIY/CH/m+GcJJATVibI7t5MhhtBGySKc3PAwc
|
|
||||||
58sVe9AnbDvs84efrNP59j2KG2KKqcqjTGAmKyJnG3N50xJGakDIsqfneIRNWpEE
|
|
||||||
pOOPaOqR4qnPAS9OSt9A3hqBpWPjQcScd6AuO+J2PE5y23pTnb9PtLBQb5e4VFiv
|
|
||||||
N54u8j4bU2CO0SC2isZ3CR68dPHthWsxt4XbjhgktjbpQRQ8L2EDBQ8oE13GOrOw
|
|
||||||
P8x4Q0eC5uzkXNyRqzKOsxlZEuc+75aDDd3M2GDw08FG7GI1p/L+NgenwT+9TmFX
|
|
||||||
2hOKVrjgyx+fPut1t5DJJubDWXGOK33qvrL7HTCEv1zz7LNbbPwwNHK4lfMAWuJW
|
|
||||||
D9wc3Y9Se/P/
|
|
||||||
=5MAs
|
|
||||||
-----END PGP PUBLIC KEY BLOCK-----
|
|
||||||
2
debian/watch
vendored
2
debian/watch
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
version=3
|
|
||||||
opts=pgpsigurlmangle=s/$/.sig/ http://www.tinc-vpn.org/packages/tinc-(1\.0\.\d+)\.tar\.gz
|
|
||||||
335
depcomp
335
depcomp
|
|
@ -1,9 +1,10 @@
|
||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# depcomp - compile a program generating dependencies as side-effects
|
# depcomp - compile a program generating dependencies as side-effects
|
||||||
|
|
||||||
scriptversion=2018-03-07.03; # UTC
|
scriptversion=2012-03-27.16; # UTC
|
||||||
|
|
||||||
# Copyright (C) 1999-2020 Free Software Foundation, Inc.
|
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010,
|
||||||
|
# 2011, 2012 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|
@ -16,7 +17,7 @@ scriptversion=2018-03-07.03; # UTC
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
|
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
# As a special exception to the GNU General Public License, if you
|
# As a special exception to the GNU General Public License, if you
|
||||||
# distribute this file as part of a program that contains a
|
# distribute this file as part of a program that contains a
|
||||||
|
|
@ -56,65 +57,11 @@ EOF
|
||||||
;;
|
;;
|
||||||
esac
|
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.
|
# A tabulation character.
|
||||||
tab=' '
|
tab=' '
|
||||||
# A newline character.
|
# A newline character.
|
||||||
nl='
|
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
|
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
|
||||||
echo "depcomp: Variables source, object and depmode must be set" 1>&2
|
echo "depcomp: Variables source, object and depmode must be set" 1>&2
|
||||||
|
|
@ -128,9 +75,6 @@ tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
|
||||||
|
|
||||||
rm -f "$tmpdepfile"
|
rm -f "$tmpdepfile"
|
||||||
|
|
||||||
# Avoid interferences from the environment.
|
|
||||||
gccflag= dashmflag=
|
|
||||||
|
|
||||||
# Some modes work just like other modes, but use different flags. We
|
# Some modes work just like other modes, but use different flags. We
|
||||||
# parameterize here, but still list the modes in the big case below,
|
# 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
|
# to make depend.m4 easier to write. Note that we *cannot* use a case
|
||||||
|
|
@ -165,7 +109,7 @@ if test "$depmode" = msvc7msys; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$depmode" = xlc; then
|
if test "$depmode" = xlc; then
|
||||||
# IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
|
# IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations.
|
||||||
gccflag=-qmakedep=gcc,-MF
|
gccflag=-qmakedep=gcc,-MF
|
||||||
depmode=gcc
|
depmode=gcc
|
||||||
fi
|
fi
|
||||||
|
|
@ -190,7 +134,8 @@ gcc3)
|
||||||
done
|
done
|
||||||
"$@"
|
"$@"
|
||||||
stat=$?
|
stat=$?
|
||||||
if test $stat -ne 0; then
|
if test $stat -eq 0; then :
|
||||||
|
else
|
||||||
rm -f "$tmpdepfile"
|
rm -f "$tmpdepfile"
|
||||||
exit $stat
|
exit $stat
|
||||||
fi
|
fi
|
||||||
|
|
@ -198,17 +143,13 @@ gcc3)
|
||||||
;;
|
;;
|
||||||
|
|
||||||
gcc)
|
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
|
## There are various ways to get dependency output from gcc. Here's
|
||||||
## why we pick this rather obscure method:
|
## why we pick this rather obscure method:
|
||||||
## - Don't want to use -MD because we'd like the dependencies to end
|
## - 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.
|
## up in a subdir. Having to rename by hand is ugly.
|
||||||
## (We might end up doing this anyway to support other compilers.)
|
## (We might end up doing this anyway to support other compilers.)
|
||||||
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
|
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
|
||||||
## -MM, not -M (despite what the docs say). Also, it might not be
|
## -MM, not -M (despite what the docs say).
|
||||||
## supported by the other compilers which use the 'gcc' depmode.
|
|
||||||
## - Using -M directly means running the compiler twice (even worse
|
## - Using -M directly means running the compiler twice (even worse
|
||||||
## than renaming).
|
## than renaming).
|
||||||
if test -z "$gccflag"; then
|
if test -z "$gccflag"; then
|
||||||
|
|
@ -216,14 +157,15 @@ gcc)
|
||||||
fi
|
fi
|
||||||
"$@" -Wp,"$gccflag$tmpdepfile"
|
"$@" -Wp,"$gccflag$tmpdepfile"
|
||||||
stat=$?
|
stat=$?
|
||||||
if test $stat -ne 0; then
|
if test $stat -eq 0; then :
|
||||||
|
else
|
||||||
rm -f "$tmpdepfile"
|
rm -f "$tmpdepfile"
|
||||||
exit $stat
|
exit $stat
|
||||||
fi
|
fi
|
||||||
rm -f "$depfile"
|
rm -f "$depfile"
|
||||||
echo "$object : \\" > "$depfile"
|
echo "$object : \\" > "$depfile"
|
||||||
# The second -e expression handles DOS-style file names with drive
|
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
|
||||||
# letters.
|
## The second -e expression handles DOS-style file names with drive letters.
|
||||||
sed -e 's/^[^:]*: / /' \
|
sed -e 's/^[^:]*: / /' \
|
||||||
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
|
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
|
||||||
## This next piece of magic avoids the "deleted header file" problem.
|
## This next piece of magic avoids the "deleted header file" problem.
|
||||||
|
|
@ -232,14 +174,14 @@ gcc)
|
||||||
## typically no way to rebuild the header). We avoid this by adding
|
## typically no way to rebuild the header). We avoid this by adding
|
||||||
## dummy dependencies for each header file. Too bad gcc doesn't do
|
## dummy dependencies for each header file. Too bad gcc doesn't do
|
||||||
## this for us directly.
|
## this for us directly.
|
||||||
|
tr ' ' "$nl" < "$tmpdepfile" |
|
||||||
## Some versions of gcc put a space before the ':'. On the theory
|
## 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
|
## 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
|
## well. hp depmode also adds that space, but also prefixes the VPATH
|
||||||
## to the object. Take care to not repeat it in the output.
|
## 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
|
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||||
## correctly. Breaking it into two sed invocations is a workaround.
|
## correctly. Breaking it into two sed invocations is a workaround.
|
||||||
tr ' ' "$nl" < "$tmpdepfile" \
|
sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
|
||||||
| sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
|
|
||||||
| sed -e 's/$/ :/' >> "$depfile"
|
| sed -e 's/$/ :/' >> "$depfile"
|
||||||
rm -f "$tmpdepfile"
|
rm -f "$tmpdepfile"
|
||||||
;;
|
;;
|
||||||
|
|
@ -258,7 +200,8 @@ sgi)
|
||||||
"$@" -MDupdate "$tmpdepfile"
|
"$@" -MDupdate "$tmpdepfile"
|
||||||
fi
|
fi
|
||||||
stat=$?
|
stat=$?
|
||||||
if test $stat -ne 0; then
|
if test $stat -eq 0; then :
|
||||||
|
else
|
||||||
rm -f "$tmpdepfile"
|
rm -f "$tmpdepfile"
|
||||||
exit $stat
|
exit $stat
|
||||||
fi
|
fi
|
||||||
|
|
@ -266,6 +209,7 @@ sgi)
|
||||||
|
|
||||||
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
|
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
|
||||||
echo "$object : \\" > "$depfile"
|
echo "$object : \\" > "$depfile"
|
||||||
|
|
||||||
# Clip off the initial element (the dependent). Don't try to be
|
# 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
|
# clever and replace this with sed code, as IRIX sed won't handle
|
||||||
# lines with more than a fixed number of characters (4096 in
|
# lines with more than a fixed number of characters (4096 in
|
||||||
|
|
@ -273,15 +217,19 @@ sgi)
|
||||||
# the IRIX cc adds comments like '#:fec' to the end of the
|
# the IRIX cc adds comments like '#:fec' to the end of the
|
||||||
# dependency line.
|
# dependency line.
|
||||||
tr ' ' "$nl" < "$tmpdepfile" \
|
tr ' ' "$nl" < "$tmpdepfile" \
|
||||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
|
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
|
||||||
| tr "$nl" ' ' >> "$depfile"
|
tr "$nl" ' ' >> "$depfile"
|
||||||
echo >> "$depfile"
|
echo >> "$depfile"
|
||||||
|
|
||||||
# The second pass generates a dummy entry for each header file.
|
# The second pass generates a dummy entry for each header file.
|
||||||
tr ' ' "$nl" < "$tmpdepfile" \
|
tr ' ' "$nl" < "$tmpdepfile" \
|
||||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
|
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
|
||||||
>> "$depfile"
|
>> "$depfile"
|
||||||
else
|
else
|
||||||
make_dummy_depfile
|
# 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
|
fi
|
||||||
rm -f "$tmpdepfile"
|
rm -f "$tmpdepfile"
|
||||||
;;
|
;;
|
||||||
|
|
@ -299,8 +247,9 @@ aix)
|
||||||
# current directory. Also, the AIX compiler puts '$object:' at the
|
# current directory. Also, the AIX compiler puts '$object:' at the
|
||||||
# start of each line; $object doesn't have directory information.
|
# start of each line; $object doesn't have directory information.
|
||||||
# Version 6 uses the directory in both cases.
|
# Version 6 uses the directory in both cases.
|
||||||
set_dir_from "$object"
|
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
|
||||||
set_base_from "$object"
|
test "x$dir" = "x$object" && dir=
|
||||||
|
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
|
||||||
if test "$libtool" = yes; then
|
if test "$libtool" = yes; then
|
||||||
tmpdepfile1=$dir$base.u
|
tmpdepfile1=$dir$base.u
|
||||||
tmpdepfile2=$base.u
|
tmpdepfile2=$base.u
|
||||||
|
|
@ -313,7 +262,9 @@ aix)
|
||||||
"$@" -M
|
"$@" -M
|
||||||
fi
|
fi
|
||||||
stat=$?
|
stat=$?
|
||||||
if test $stat -ne 0; then
|
|
||||||
|
if test $stat -eq 0; then :
|
||||||
|
else
|
||||||
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
||||||
exit $stat
|
exit $stat
|
||||||
fi
|
fi
|
||||||
|
|
@ -322,113 +273,65 @@ aix)
|
||||||
do
|
do
|
||||||
test -f "$tmpdepfile" && break
|
test -f "$tmpdepfile" && break
|
||||||
done
|
done
|
||||||
aix_post_process_depfile
|
if test -f "$tmpdepfile"; then
|
||||||
;;
|
# Each line is of the form 'foo.o: dependent.h'.
|
||||||
|
# Do two passes, one to just change these to
|
||||||
tcc)
|
# '$object: dependent.h' and one to simply 'dependent.h:'.
|
||||||
# tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
|
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
|
||||||
# FIXME: That version still under development at the moment of writing.
|
sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
|
||||||
# Make that this statement remains true also for stable, released
|
else
|
||||||
# versions.
|
# The sourcefile does not contain any dependencies, so just
|
||||||
# It will wrap lines (doesn't matter whether long or short) with a
|
# store a dummy comment line, to avoid errors with the Makefile
|
||||||
# trailing '\', as in:
|
# "include basename.Plo" scheme.
|
||||||
#
|
echo "#dummy" > "$depfile"
|
||||||
# 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 -ne 0; then
|
|
||||||
rm -f "$tmpdepfile"
|
|
||||||
exit $stat
|
|
||||||
fi
|
fi
|
||||||
rm -f "$depfile"
|
|
||||||
# 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"
|
rm -f "$tmpdepfile"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
## The order of this option in the case statement is important, since the
|
icc)
|
||||||
## shell code in configure will try each of these formats in the order
|
# Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'.
|
||||||
## listed in this file. A plain '-MD' option would be understood by many
|
# However on
|
||||||
## compilers, so we must ensure this comes after the gcc and icc options.
|
# $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c
|
||||||
pgcc)
|
# ICC 7.0 will fill foo.d with something like
|
||||||
# Portland's C compiler understands '-MD'.
|
# foo.o: sub/foo.c
|
||||||
# Will always output deps to 'file.d' where file is the root name of the
|
# foo.o: sub/foo.h
|
||||||
# source file under compilation, even if file resides in a subdirectory.
|
# which is wrong. We want
|
||||||
# The object file name does not affect the name of the '.d' file.
|
# sub/foo.o: sub/foo.c
|
||||||
# pgcc 10.2 will output
|
# 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
|
# foo.o: sub/foo.c sub/foo.h
|
||||||
# and will wrap long lines using '\' :
|
# and will wrap long lines using '\':
|
||||||
# foo.o: sub/foo.c ... \
|
# foo.o: sub/foo.c ... \
|
||||||
# sub/foo.h ... \
|
# sub/foo.h ... \
|
||||||
# ...
|
# ...
|
||||||
set_dir_from "$object"
|
# tcc 0.9.26 (FIXME still under development at the moment of writing)
|
||||||
# Use the source, not the object, to determine the base name, since
|
# will emit a similar output, but also prepend the continuation lines
|
||||||
# that's sadly what pgcc will do too.
|
# with horizontal tabulation characters.
|
||||||
set_base_from "$source"
|
"$@" -MD -MF "$tmpdepfile"
|
||||||
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=$?
|
stat=$?
|
||||||
# Release the lock.
|
if test $stat -eq 0; then :
|
||||||
rmdir "$lockdir"
|
|
||||||
break
|
|
||||||
else
|
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"
|
rm -f "$tmpdepfile"
|
||||||
exit $stat
|
exit $stat
|
||||||
fi
|
fi
|
||||||
rm -f "$depfile"
|
rm -f "$depfile"
|
||||||
# Each line is of the form `foo.o: dependent.h',
|
# Each line is of the form 'foo.o: dependent.h',
|
||||||
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
|
# or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'.
|
||||||
# Do two passes, one to just change these to
|
# Do two passes, one to just change these to
|
||||||
# `$object: dependent.h' and one to simply `dependent.h:'.
|
# '$object: dependent.h' and one to simply 'dependent.h:'.
|
||||||
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
|
sed -e "s/^[ $tab][ $tab]*/ /" -e "s,^[^:]*:,$object :," \
|
||||||
# Some versions of the HPUX 10.20 sed can't process this invocation
|
< "$tmpdepfile" > "$depfile"
|
||||||
# correctly. Breaking it into two sed invocations is a workaround.
|
sed '
|
||||||
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
|
s/[ '"$tab"'][ '"$tab"']*/ /g
|
||||||
| sed -e 's/$/ :/' >> "$depfile"
|
s/^ *//
|
||||||
|
s/ *\\*$//
|
||||||
|
s/^[^:]*: *//
|
||||||
|
/^$/d
|
||||||
|
/:$/d
|
||||||
|
s/$/ :/
|
||||||
|
' < "$tmpdepfile" >> "$depfile"
|
||||||
rm -f "$tmpdepfile"
|
rm -f "$tmpdepfile"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|
@ -439,8 +342,9 @@ hp2)
|
||||||
# 'foo.d', which lands next to the object file, wherever that
|
# 'foo.d', which lands next to the object file, wherever that
|
||||||
# happens to be.
|
# happens to be.
|
||||||
# Much of this is similar to the tru64 case; see comments there.
|
# Much of this is similar to the tru64 case; see comments there.
|
||||||
set_dir_from "$object"
|
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
|
||||||
set_base_from "$object"
|
test "x$dir" = "x$object" && dir=
|
||||||
|
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
|
||||||
if test "$libtool" = yes; then
|
if test "$libtool" = yes; then
|
||||||
tmpdepfile1=$dir$base.d
|
tmpdepfile1=$dir$base.d
|
||||||
tmpdepfile2=$dir.libs/$base.d
|
tmpdepfile2=$dir.libs/$base.d
|
||||||
|
|
@ -451,7 +355,8 @@ hp2)
|
||||||
"$@" +Maked
|
"$@" +Maked
|
||||||
fi
|
fi
|
||||||
stat=$?
|
stat=$?
|
||||||
if test $stat -ne 0; then
|
if test $stat -eq 0; then :
|
||||||
|
else
|
||||||
rm -f "$tmpdepfile1" "$tmpdepfile2"
|
rm -f "$tmpdepfile1" "$tmpdepfile2"
|
||||||
exit $stat
|
exit $stat
|
||||||
fi
|
fi
|
||||||
|
|
@ -461,7 +366,7 @@ hp2)
|
||||||
test -f "$tmpdepfile" && break
|
test -f "$tmpdepfile" && break
|
||||||
done
|
done
|
||||||
if test -f "$tmpdepfile"; then
|
if test -f "$tmpdepfile"; then
|
||||||
sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
|
sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
|
||||||
# Add 'dependent.h:' lines.
|
# Add 'dependent.h:' lines.
|
||||||
sed -ne '2,${
|
sed -ne '2,${
|
||||||
s/^ *//
|
s/^ *//
|
||||||
|
|
@ -470,7 +375,7 @@ hp2)
|
||||||
p
|
p
|
||||||
}' "$tmpdepfile" >> "$depfile"
|
}' "$tmpdepfile" >> "$depfile"
|
||||||
else
|
else
|
||||||
make_dummy_depfile
|
echo "#dummy" > "$depfile"
|
||||||
fi
|
fi
|
||||||
rm -f "$tmpdepfile" "$tmpdepfile2"
|
rm -f "$tmpdepfile" "$tmpdepfile2"
|
||||||
;;
|
;;
|
||||||
|
|
@ -481,40 +386,55 @@ tru64)
|
||||||
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
|
# 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.
|
# dependencies in 'foo.d' instead, so we check for that too.
|
||||||
# Subdirectories are respected.
|
# Subdirectories are respected.
|
||||||
set_dir_from "$object"
|
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
|
||||||
set_base_from "$object"
|
test "x$dir" = "x$object" && dir=
|
||||||
|
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
|
||||||
|
|
||||||
if test "$libtool" = yes; then
|
if test "$libtool" = yes; then
|
||||||
# Libtool generates 2 separate objects for the 2 libraries. These
|
# With Tru64 cc, shared objects can also be used to make a
|
||||||
# two compilations output dependencies in $dir.libs/$base.o.d and
|
# 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
|
# in $dir$base.o.d. We have to check for both files, because
|
||||||
# one of the two compilations can be disabled. We should prefer
|
# 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
|
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
|
||||||
# automatically cleaned when .libs/ is deleted, while ignoring
|
# automatically cleaned when .libs/ is deleted, while ignoring
|
||||||
# the former would cause a distcleancheck panic.
|
# the former would cause a distcleancheck panic.
|
||||||
tmpdepfile1=$dir$base.o.d # libtool 1.5
|
tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
|
||||||
tmpdepfile2=$dir.libs/$base.o.d # Likewise.
|
tmpdepfile2=$dir$base.o.d # libtool 1.5
|
||||||
tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504
|
tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
|
||||||
|
tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
|
||||||
"$@" -Wc,-MD
|
"$@" -Wc,-MD
|
||||||
else
|
else
|
||||||
tmpdepfile1=$dir$base.d
|
tmpdepfile1=$dir$base.o.d
|
||||||
tmpdepfile2=$dir$base.d
|
tmpdepfile2=$dir$base.d
|
||||||
tmpdepfile3=$dir$base.d
|
tmpdepfile3=$dir$base.d
|
||||||
|
tmpdepfile4=$dir$base.d
|
||||||
"$@" -MD
|
"$@" -MD
|
||||||
fi
|
fi
|
||||||
|
|
||||||
stat=$?
|
stat=$?
|
||||||
if test $stat -ne 0; then
|
if test $stat -eq 0; then :
|
||||||
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
else
|
||||||
|
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
|
||||||
exit $stat
|
exit $stat
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
|
||||||
do
|
do
|
||||||
test -f "$tmpdepfile" && break
|
test -f "$tmpdepfile" && break
|
||||||
done
|
done
|
||||||
# Same post-processing that is required for AIX mode.
|
if test -f "$tmpdepfile"; then
|
||||||
aix_post_process_depfile
|
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"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
msvc7)
|
msvc7)
|
||||||
|
|
@ -526,7 +446,8 @@ msvc7)
|
||||||
"$@" $showIncludes > "$tmpdepfile"
|
"$@" $showIncludes > "$tmpdepfile"
|
||||||
stat=$?
|
stat=$?
|
||||||
grep -v '^Note: including file: ' "$tmpdepfile"
|
grep -v '^Note: including file: ' "$tmpdepfile"
|
||||||
if test $stat -ne 0; then
|
if test "$stat" = 0; then :
|
||||||
|
else
|
||||||
rm -f "$tmpdepfile"
|
rm -f "$tmpdepfile"
|
||||||
exit $stat
|
exit $stat
|
||||||
fi
|
fi
|
||||||
|
|
@ -552,7 +473,6 @@ $ {
|
||||||
G
|
G
|
||||||
p
|
p
|
||||||
}' >> "$depfile"
|
}' >> "$depfile"
|
||||||
echo >> "$depfile" # make sure the fragment doesn't end with a backslash
|
|
||||||
rm -f "$tmpdepfile"
|
rm -f "$tmpdepfile"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|
@ -604,14 +524,13 @@ dashmstdout)
|
||||||
# in the target name. This is to cope with DOS-style filenames:
|
# 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.
|
# a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
|
||||||
"$@" $dashmflag |
|
"$@" $dashmflag |
|
||||||
sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
|
sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile"
|
||||||
rm -f "$depfile"
|
rm -f "$depfile"
|
||||||
cat < "$tmpdepfile" > "$depfile"
|
cat < "$tmpdepfile" > "$depfile"
|
||||||
# Some versions of the HPUX 10.20 sed can't process this sed invocation
|
tr ' ' "$nl" < "$tmpdepfile" | \
|
||||||
# correctly. Breaking it into two sed invocations is a workaround.
|
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||||
tr ' ' "$nl" < "$tmpdepfile" \
|
## correctly. Breaking it into two sed invocations is a workaround.
|
||||||
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
|
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||||
| sed -e 's/$/ :/' >> "$depfile"
|
|
||||||
rm -f "$tmpdepfile"
|
rm -f "$tmpdepfile"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|
@ -664,12 +583,10 @@ makedepend)
|
||||||
# makedepend may prepend the VPATH from the source file name to the object.
|
# makedepend may prepend the VPATH from the source file name to the object.
|
||||||
# No need to regex-escape $object, excess matching of '.' is harmless.
|
# No need to regex-escape $object, excess matching of '.' is harmless.
|
||||||
sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
|
sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
|
||||||
# Some versions of the HPUX 10.20 sed can't process the last invocation
|
sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \
|
||||||
# correctly. Breaking it into two sed invocations is a workaround.
|
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||||
sed '1,2d' "$tmpdepfile" \
|
## correctly. Breaking it into two sed invocations is a workaround.
|
||||||
| tr ' ' "$nl" \
|
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||||
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
|
|
||||||
| sed -e 's/$/ :/' >> "$depfile"
|
|
||||||
rm -f "$tmpdepfile" "$tmpdepfile".bak
|
rm -f "$tmpdepfile" "$tmpdepfile".bak
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|
@ -705,10 +622,10 @@ cpp)
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
"$@" -E \
|
"$@" -E |
|
||||||
| sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
|
sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
|
||||||
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
|
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
|
||||||
| sed '$ s: \\$::' > "$tmpdepfile"
|
sed '$ s: \\$::' > "$tmpdepfile"
|
||||||
rm -f "$depfile"
|
rm -f "$depfile"
|
||||||
echo "$object : \\" > "$depfile"
|
echo "$object : \\" > "$depfile"
|
||||||
cat < "$tmpdepfile" >> "$depfile"
|
cat < "$tmpdepfile" >> "$depfile"
|
||||||
|
|
@ -783,9 +700,9 @@ exit 0
|
||||||
# Local Variables:
|
# Local Variables:
|
||||||
# mode: shell-script
|
# mode: shell-script
|
||||||
# sh-indentation: 2
|
# sh-indentation: 2
|
||||||
# eval: (add-hook 'before-save-hook 'time-stamp)
|
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||||
# time-stamp-start: "scriptversion="
|
# time-stamp-start: "scriptversion="
|
||||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||||
# time-stamp-time-zone: "UTC0"
|
# time-stamp-time-zone: "UTC"
|
||||||
# time-stamp-end: "; # UTC"
|
# time-stamp-end: "; # UTC"
|
||||||
# End:
|
# End:
|
||||||
|
|
|
||||||
|
|
@ -1,35 +1,46 @@
|
||||||
## Process this file with automake to get Makefile.in
|
## Process this file with automake to get Makefile.in
|
||||||
|
|
||||||
info_TEXINFOS = tinc.texi
|
info_TEXINFOS = tinc.texi
|
||||||
tinc_TEXINFOS = tincinclude.texi
|
|
||||||
|
|
||||||
man_MANS = tincd.8 tinc.conf.5
|
man_MANS = tincd.8 tinc.conf.5
|
||||||
|
|
||||||
EXTRA_DIST = tincinclude.texi.in tincd.8.in tinc.conf.5.in sample-config
|
EXTRA_DIST = tincinclude.texi.in tincd.8.in tinc.conf.5.in sample-config.tar.gz
|
||||||
|
|
||||||
CLEANFILES = *.html tincd.8 tinc.conf.5 tincinclude.texi
|
CLEANFILES = *.html tinc.info tincd.8 tinc.conf.5 tincinclude.texi
|
||||||
|
|
||||||
|
# Use `ginstall' in the definition of man_MANS to avoid
|
||||||
|
# confusion with the `install' target. The install rule transforms `ginstall'
|
||||||
|
# to install before applying any user-specified name transformations.
|
||||||
|
transform = s/ginstall/install/; @program_transform_name@
|
||||||
|
|
||||||
|
# For additional rules usually of interest only to the maintainer,
|
||||||
|
# see GNUmakefile and Makefile.maint.
|
||||||
|
|
||||||
|
sample-config.tar.gz: sample-config
|
||||||
|
GZIP=$(GZIP_ENV) $(AMTAR) chozf sample-config.tar.gz --exclude .svn sample-config
|
||||||
|
|
||||||
texi2html: tinc.texi
|
texi2html: tinc.texi
|
||||||
$(AM_V_GEN)texi2html -split=chapter $<
|
texi2html -split=chapter tinc.texi
|
||||||
|
|
||||||
tincd.8.html: tincd.8
|
tincd.8.html: tincd.8
|
||||||
$(AM_V_GEN)w3mman2html $< > $@
|
w3mman2html $< > $@
|
||||||
|
|
||||||
tinc.conf.5.html: tinc.conf.5
|
tinc.conf.5.html: tinc.conf.5
|
||||||
$(AM_V_GEN)w3mman2html $< > $@
|
w3mman2html $< > $@
|
||||||
|
|
||||||
substitute = sed \
|
substitute = sed \
|
||||||
-e s,'@PACKAGE\@',"$(PACKAGE)",g \
|
-e s,'@PACKAGE\@',"$(PACKAGE)",g \
|
||||||
-e s,'@VERSION\@',"$(VERSION)",g \
|
-e s,'@VERSION\@',"$(VERSION)",g \
|
||||||
-e s,'@sysconfdir\@',"$(sysconfdir)",g \
|
-e s,'@sysconfdir\@',"$(sysconfdir)",g \
|
||||||
-e s,'@runstatedir\@',"$(runstatedir)",g \
|
|
||||||
-e s,'@localstatedir\@',"$(localstatedir)",g
|
-e s,'@localstatedir\@',"$(localstatedir)",g
|
||||||
|
|
||||||
tincd.8: $(srcdir)/tincd.8.in
|
tincd.8: tincd.8.in
|
||||||
$(AM_V_GEN)$(substitute) $(srcdir)/tincd.8.in > $@
|
$(substitute) tincd.8.in > tincd.8
|
||||||
|
|
||||||
tinc.conf.5: $(srcdir)/tinc.conf.5.in
|
tinc.conf.5: tinc.conf.5.in
|
||||||
$(AM_V_GEN)$(substitute) $(srcdir)/tinc.conf.5.in > $@
|
$(substitute) tinc.conf.5.in > tinc.conf.5
|
||||||
|
|
||||||
tincinclude.texi: $(srcdir)/tincinclude.texi.in
|
tincinclude.texi: tincinclude.texi.in
|
||||||
$(AM_V_GEN)$(substitute) $(srcdir)/tincinclude.texi.in > $@
|
$(substitute) tincinclude.texi.in > tincinclude.texi
|
||||||
|
|
||||||
|
tinc.texi: tincinclude.texi
|
||||||
|
|
|
||||||
289
doc/Makefile.in
289
doc/Makefile.in
|
|
@ -1,8 +1,9 @@
|
||||||
# Makefile.in generated by automake 1.16.2 from Makefile.am.
|
# Makefile.in generated by automake 1.11.5 from Makefile.am.
|
||||||
# @configure_input@
|
# @configure_input@
|
||||||
|
|
||||||
# Copyright (C) 1994-2020 Free Software Foundation, Inc.
|
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||||
|
# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
|
||||||
|
# Foundation, Inc.
|
||||||
# This Makefile.in is free software; the Free Software Foundation
|
# This Makefile.in is free software; the Free Software Foundation
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
# with or without modifications, as long as this notice is preserved.
|
# with or without modifications, as long as this notice is preserved.
|
||||||
|
|
@ -14,61 +15,23 @@
|
||||||
|
|
||||||
@SET_MAKE@
|
@SET_MAKE@
|
||||||
VPATH = @srcdir@
|
VPATH = @srcdir@
|
||||||
am__is_gnu_make = { \
|
am__make_dryrun = \
|
||||||
if test -z '$(MAKELEVEL)'; then \
|
{ \
|
||||||
false; \
|
am__dry=no; \
|
||||||
elif test -n '$(MAKE_HOST)'; then \
|
|
||||||
true; \
|
|
||||||
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
|
|
||||||
true; \
|
|
||||||
else \
|
|
||||||
false; \
|
|
||||||
fi; \
|
|
||||||
}
|
|
||||||
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 \
|
case $$MAKEFLAGS in \
|
||||||
*\\[\ \ ]*) \
|
*\\[\ \ ]*) \
|
||||||
bs=\\; \
|
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
|
||||||
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
|
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
|
||||||
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
|
*) \
|
||||||
|
for am__flg in $$MAKEFLAGS; do \
|
||||||
|
case $$am__flg in \
|
||||||
|
*=*|--*) ;; \
|
||||||
|
*n*) am__dry=yes; break;; \
|
||||||
esac; \
|
esac; \
|
||||||
fi; \
|
done;; \
|
||||||
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; \
|
esac; \
|
||||||
case $$flg in \
|
test $$am__dry = yes; \
|
||||||
*$$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@
|
pkgdatadir = $(datadir)/@PACKAGE@
|
||||||
pkgincludedir = $(includedir)/@PACKAGE@
|
pkgincludedir = $(includedir)/@PACKAGE@
|
||||||
pkglibdir = $(libdir)/@PACKAGE@
|
pkglibdir = $(libdir)/@PACKAGE@
|
||||||
|
|
@ -78,7 +41,6 @@ install_sh_DATA = $(install_sh) -c -m 644
|
||||||
install_sh_PROGRAM = $(install_sh) -c
|
install_sh_PROGRAM = $(install_sh) -c
|
||||||
install_sh_SCRIPT = $(install_sh) -c
|
install_sh_SCRIPT = $(install_sh) -c
|
||||||
INSTALL_HEADER = $(INSTALL_DATA)
|
INSTALL_HEADER = $(INSTALL_DATA)
|
||||||
transform = $(program_transform_name)
|
|
||||||
NORMAL_INSTALL = :
|
NORMAL_INSTALL = :
|
||||||
PRE_INSTALL = :
|
PRE_INSTALL = :
|
||||||
POST_INSTALL = :
|
POST_INSTALL = :
|
||||||
|
|
@ -88,65 +50,20 @@ POST_UNINSTALL = :
|
||||||
build_triplet = @build@
|
build_triplet = @build@
|
||||||
host_triplet = @host@
|
host_triplet = @host@
|
||||||
subdir = doc
|
subdir = doc
|
||||||
|
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in texinfo.tex
|
||||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||||
am__aclocal_m4_deps = $(top_srcdir)/m4/attribute.m4 \
|
am__aclocal_m4_deps = $(top_srcdir)/m4/attribute.m4 \
|
||||||
$(top_srcdir)/m4/ax_append_flag.m4 \
|
$(top_srcdir)/m4/lzo.m4 $(top_srcdir)/m4/openssl.m4 \
|
||||||
$(top_srcdir)/m4/ax_cflags_warn_all.m4 \
|
$(top_srcdir)/m4/zlib.m4 $(top_srcdir)/configure.in
|
||||||
$(top_srcdir)/m4/ax_check_compile_flag.m4 \
|
|
||||||
$(top_srcdir)/m4/ax_check_link_flag.m4 \
|
|
||||||
$(top_srcdir)/m4/ax_require_defined.m4 $(top_srcdir)/m4/lzo.m4 \
|
|
||||||
$(top_srcdir)/m4/openssl.m4 $(top_srcdir)/m4/zlib.m4 \
|
|
||||||
$(top_srcdir)/configure.ac
|
|
||||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||||
$(ACLOCAL_M4)
|
$(ACLOCAL_M4)
|
||||||
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
|
|
||||||
mkinstalldirs = $(install_sh) -d
|
mkinstalldirs = $(install_sh) -d
|
||||||
CONFIG_HEADER = $(top_builddir)/config.h
|
CONFIG_HEADER = $(top_builddir)/config.h
|
||||||
CONFIG_CLEAN_FILES =
|
CONFIG_CLEAN_FILES =
|
||||||
CONFIG_CLEAN_VPATH_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 =
|
SOURCES =
|
||||||
DIST_SOURCES =
|
DIST_SOURCES =
|
||||||
AM_V_DVIPS = $(am__v_DVIPS_@AM_V@)
|
INFO_DEPS = tinc.info
|
||||||
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 = $(srcdir)/tinc.info
|
|
||||||
am__TEXINFO_TEX_DIR = $(srcdir)
|
am__TEXINFO_TEX_DIR = $(srcdir)
|
||||||
DVIS = tinc.dvi
|
DVIS = tinc.dvi
|
||||||
PDFS = tinc.pdf
|
PDFS = tinc.pdf
|
||||||
|
|
@ -196,12 +113,15 @@ man5dir = $(mandir)/man5
|
||||||
man8dir = $(mandir)/man8
|
man8dir = $(mandir)/man8
|
||||||
NROFF = nroff
|
NROFF = nroff
|
||||||
MANS = $(man_MANS)
|
MANS = $(man_MANS)
|
||||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
|
|
||||||
am__DIST_COMMON = $(srcdir)/Makefile.in $(tinc_TEXINFOS) texinfo.tex
|
|
||||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||||
|
|
||||||
|
# Use `ginstall' in the definition of man_MANS to avoid
|
||||||
|
# confusion with the `install' target. The install rule transforms `ginstall'
|
||||||
|
# to install before applying any user-specified name transformations.
|
||||||
|
transform = s/ginstall/install/; @program_transform_name@
|
||||||
ACLOCAL = @ACLOCAL@
|
ACLOCAL = @ACLOCAL@
|
||||||
|
ALLOCA = @ALLOCA@
|
||||||
AMTAR = @AMTAR@
|
AMTAR = @AMTAR@
|
||||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
|
||||||
AUTOCONF = @AUTOCONF@
|
AUTOCONF = @AUTOCONF@
|
||||||
AUTOHEADER = @AUTOHEADER@
|
AUTOHEADER = @AUTOHEADER@
|
||||||
AUTOMAKE = @AUTOMAKE@
|
AUTOMAKE = @AUTOMAKE@
|
||||||
|
|
@ -220,6 +140,7 @@ ECHO_T = @ECHO_T@
|
||||||
EGREP = @EGREP@
|
EGREP = @EGREP@
|
||||||
EXEEXT = @EXEEXT@
|
EXEEXT = @EXEEXT@
|
||||||
GREP = @GREP@
|
GREP = @GREP@
|
||||||
|
INCLUDES = @INCLUDES@
|
||||||
INSTALL = @INSTALL@
|
INSTALL = @INSTALL@
|
||||||
INSTALL_DATA = @INSTALL_DATA@
|
INSTALL_DATA = @INSTALL_DATA@
|
||||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||||
|
|
@ -228,7 +149,9 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||||
LDFLAGS = @LDFLAGS@
|
LDFLAGS = @LDFLAGS@
|
||||||
LIBOBJS = @LIBOBJS@
|
LIBOBJS = @LIBOBJS@
|
||||||
LIBS = @LIBS@
|
LIBS = @LIBS@
|
||||||
|
LN_S = @LN_S@
|
||||||
LTLIBOBJS = @LTLIBOBJS@
|
LTLIBOBJS = @LTLIBOBJS@
|
||||||
|
MAINT = @MAINT@
|
||||||
MAKEINFO = @MAKEINFO@
|
MAKEINFO = @MAKEINFO@
|
||||||
MKDIR_P = @MKDIR_P@
|
MKDIR_P = @MKDIR_P@
|
||||||
OBJEXT = @OBJEXT@
|
OBJEXT = @OBJEXT@
|
||||||
|
|
@ -240,6 +163,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||||
PACKAGE_URL = @PACKAGE_URL@
|
PACKAGE_URL = @PACKAGE_URL@
|
||||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||||
|
RANLIB = @RANLIB@
|
||||||
SET_MAKE = @SET_MAKE@
|
SET_MAKE = @SET_MAKE@
|
||||||
SHELL = @SHELL@
|
SHELL = @SHELL@
|
||||||
STRIP = @STRIP@
|
STRIP = @STRIP@
|
||||||
|
|
@ -286,33 +210,29 @@ pdfdir = @pdfdir@
|
||||||
prefix = @prefix@
|
prefix = @prefix@
|
||||||
program_transform_name = @program_transform_name@
|
program_transform_name = @program_transform_name@
|
||||||
psdir = @psdir@
|
psdir = @psdir@
|
||||||
runstatedir = @runstatedir@
|
|
||||||
sbindir = @sbindir@
|
sbindir = @sbindir@
|
||||||
sharedstatedir = @sharedstatedir@
|
sharedstatedir = @sharedstatedir@
|
||||||
srcdir = @srcdir@
|
srcdir = @srcdir@
|
||||||
sysconfdir = @sysconfdir@
|
sysconfdir = @sysconfdir@
|
||||||
systemd_path = @systemd_path@
|
|
||||||
target_alias = @target_alias@
|
target_alias = @target_alias@
|
||||||
top_build_prefix = @top_build_prefix@
|
top_build_prefix = @top_build_prefix@
|
||||||
top_builddir = @top_builddir@
|
top_builddir = @top_builddir@
|
||||||
top_srcdir = @top_srcdir@
|
top_srcdir = @top_srcdir@
|
||||||
info_TEXINFOS = tinc.texi
|
info_TEXINFOS = tinc.texi
|
||||||
tinc_TEXINFOS = tincinclude.texi
|
|
||||||
man_MANS = tincd.8 tinc.conf.5
|
man_MANS = tincd.8 tinc.conf.5
|
||||||
EXTRA_DIST = tincinclude.texi.in tincd.8.in tinc.conf.5.in sample-config
|
EXTRA_DIST = tincinclude.texi.in tincd.8.in tinc.conf.5.in sample-config.tar.gz
|
||||||
CLEANFILES = *.html tincd.8 tinc.conf.5 tincinclude.texi
|
CLEANFILES = *.html tinc.info tincd.8 tinc.conf.5 tincinclude.texi
|
||||||
substitute = sed \
|
substitute = sed \
|
||||||
-e s,'@PACKAGE\@',"$(PACKAGE)",g \
|
-e s,'@PACKAGE\@',"$(PACKAGE)",g \
|
||||||
-e s,'@VERSION\@',"$(VERSION)",g \
|
-e s,'@VERSION\@',"$(VERSION)",g \
|
||||||
-e s,'@sysconfdir\@',"$(sysconfdir)",g \
|
-e s,'@sysconfdir\@',"$(sysconfdir)",g \
|
||||||
-e s,'@runstatedir\@',"$(runstatedir)",g \
|
|
||||||
-e s,'@localstatedir\@',"$(localstatedir)",g
|
-e s,'@localstatedir\@',"$(localstatedir)",g
|
||||||
|
|
||||||
all: all-am
|
all: all-am
|
||||||
|
|
||||||
.SUFFIXES:
|
.SUFFIXES:
|
||||||
.SUFFIXES: .dvi .html .info .pdf .ps .texi
|
.SUFFIXES: .dvi .ps
|
||||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
|
||||||
@for dep in $?; do \
|
@for dep in $?; do \
|
||||||
case '$(am__configure_deps)' in \
|
case '$(am__configure_deps)' in \
|
||||||
*$$dep*) \
|
*$$dep*) \
|
||||||
|
|
@ -324,74 +244,69 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \
|
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \
|
||||||
$(am__cd) $(top_srcdir) && \
|
$(am__cd) $(top_srcdir) && \
|
||||||
$(AUTOMAKE) --gnu doc/Makefile
|
$(AUTOMAKE) --gnu doc/Makefile
|
||||||
|
.PRECIOUS: Makefile
|
||||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||||
@case '$?' in \
|
@case '$?' in \
|
||||||
*config.status*) \
|
*config.status*) \
|
||||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||||
*) \
|
*) \
|
||||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
|
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
|
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||||
esac;
|
esac;
|
||||||
|
|
||||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||||
|
|
||||||
$(top_srcdir)/configure: $(am__configure_deps)
|
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||||
$(am__aclocal_m4_deps):
|
$(am__aclocal_m4_deps):
|
||||||
|
|
||||||
.texi.info:
|
tinc.info: tinc.texi
|
||||||
$(AM_V_MAKEINFO)restore=: && backupdir="$(am__leading_dot)am$$$$" && \
|
restore=: && backupdir="$(am__leading_dot)am$$$$" && \
|
||||||
am__cwd=`pwd` && $(am__cd) $(srcdir) && \
|
|
||||||
rm -rf $$backupdir && mkdir $$backupdir && \
|
rm -rf $$backupdir && mkdir $$backupdir && \
|
||||||
if ($(MAKEINFO) --version) >/dev/null 2>&1; then \
|
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 \
|
for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \
|
||||||
if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \
|
if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \
|
||||||
done; \
|
done; \
|
||||||
else :; fi && \
|
else :; fi && \
|
||||||
cd "$$am__cwd"; \
|
|
||||||
if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
|
if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
|
||||||
-o $@ $<; \
|
-o $@ `test -f 'tinc.texi' || echo '$(srcdir)/'`tinc.texi; \
|
||||||
then \
|
then \
|
||||||
rc=0; \
|
rc=0; \
|
||||||
$(am__cd) $(srcdir); \
|
|
||||||
else \
|
else \
|
||||||
rc=$$?; \
|
rc=$$?; \
|
||||||
$(am__cd) $(srcdir) && \
|
|
||||||
$$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \
|
$$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \
|
||||||
fi; \
|
fi; \
|
||||||
rm -rf $$backupdir; exit $$rc
|
rm -rf $$backupdir; exit $$rc
|
||||||
|
|
||||||
.texi.dvi:
|
tinc.dvi: tinc.texi
|
||||||
$(AM_V_TEXI2DVI)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
|
TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
|
||||||
MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
|
MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
|
||||||
$(TEXI2DVI) $(AM_V_texinfo) --build-dir=$(@:.dvi=.t2d) -o $@ $(AM_V_texidevnull) \
|
$(TEXI2DVI) -o $@ `test -f 'tinc.texi' || echo '$(srcdir)/'`tinc.texi
|
||||||
$<
|
|
||||||
|
|
||||||
.texi.pdf:
|
tinc.pdf: tinc.texi
|
||||||
$(AM_V_TEXI2PDF)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
|
TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
|
||||||
MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
|
MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
|
||||||
$(TEXI2PDF) $(AM_V_texinfo) --build-dir=$(@:.pdf=.t2p) -o $@ $(AM_V_texidevnull) \
|
$(TEXI2PDF) -o $@ `test -f 'tinc.texi' || echo '$(srcdir)/'`tinc.texi
|
||||||
$<
|
|
||||||
|
|
||||||
.texi.html:
|
tinc.html: tinc.texi
|
||||||
$(AM_V_MAKEINFO)rm -rf $(@:.html=.htp)
|
rm -rf $(@:.html=.htp)
|
||||||
$(AM_V_at)if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
|
if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
|
||||||
-o $(@:.html=.htp) $<; \
|
-o $(@:.html=.htp) `test -f 'tinc.texi' || echo '$(srcdir)/'`tinc.texi; \
|
||||||
then \
|
then \
|
||||||
rm -rf $@ && mv $(@:.html=.htp) $@; \
|
rm -rf $@; \
|
||||||
|
if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \
|
||||||
|
mv $(@:.html=) $@; else mv $(@:.html=.htp) $@; fi; \
|
||||||
else \
|
else \
|
||||||
rm -rf $(@:.html=.htp); exit 1; \
|
if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \
|
||||||
|
rm -rf $(@:.html=); else rm -Rf $(@:.html=.htp) $@; fi; \
|
||||||
|
exit 1; \
|
||||||
fi
|
fi
|
||||||
$(srcdir)/tinc.info: tinc.texi $(tinc_TEXINFOS)
|
|
||||||
tinc.dvi: tinc.texi $(tinc_TEXINFOS)
|
|
||||||
tinc.pdf: tinc.texi $(tinc_TEXINFOS)
|
|
||||||
tinc.html: tinc.texi $(tinc_TEXINFOS)
|
|
||||||
.dvi.ps:
|
.dvi.ps:
|
||||||
$(AM_V_DVIPS)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
|
TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
|
||||||
$(DVIPS) $(AM_V_texinfo) -o $@ $<
|
$(DVIPS) -o $@ $<
|
||||||
|
|
||||||
uninstall-dvi-am:
|
uninstall-dvi-am:
|
||||||
@$(NORMAL_UNINSTALL)
|
@$(NORMAL_UNINSTALL)
|
||||||
|
|
@ -470,7 +385,9 @@ dist-info: $(INFO_DEPS)
|
||||||
done
|
done
|
||||||
|
|
||||||
mostlyclean-aminfo:
|
mostlyclean-aminfo:
|
||||||
-rm -rf tinc.t2d tinc.t2p
|
-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
|
||||||
|
|
||||||
clean-aminfo:
|
clean-aminfo:
|
||||||
-test -z "tinc.dvi tinc.pdf tinc.ps tinc.html" \
|
-test -z "tinc.dvi tinc.pdf tinc.ps tinc.html" \
|
||||||
|
|
@ -568,17 +485,27 @@ uninstall-man8:
|
||||||
} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
|
} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
|
||||||
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
|
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
|
||||||
dir='$(DESTDIR)$(man8dir)'; $(am__uninstall_files_from_dir)
|
dir='$(DESTDIR)$(man8dir)'; $(am__uninstall_files_from_dir)
|
||||||
tags TAGS:
|
tags: TAGS
|
||||||
|
TAGS:
|
||||||
|
|
||||||
ctags CTAGS:
|
ctags: CTAGS
|
||||||
|
CTAGS:
|
||||||
cscope cscopelist:
|
|
||||||
|
|
||||||
|
|
||||||
distdir: $(BUILT_SOURCES)
|
distdir: $(DISTFILES)
|
||||||
$(MAKE) $(AM_MAKEFLAGS) distdir-am
|
@list='$(MANS)'; if test -n "$$list"; then \
|
||||||
|
list=`for p in $$list; do \
|
||||||
distdir-am: $(DISTFILES)
|
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'`; \
|
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||||
list='$(DISTFILES)'; \
|
list='$(DISTFILES)'; \
|
||||||
|
|
@ -813,40 +740,46 @@ uninstall-man: uninstall-man5 uninstall-man8
|
||||||
.MAKE: install-am install-strip
|
.MAKE: install-am install-strip
|
||||||
|
|
||||||
.PHONY: all all-am check check-am clean clean-aminfo clean-generic \
|
.PHONY: all all-am check check-am clean clean-aminfo clean-generic \
|
||||||
cscopelist-am ctags-am dist-info distclean distclean-generic \
|
dist-info distclean distclean-generic distdir dvi dvi-am html \
|
||||||
distdir dvi dvi-am html html-am info info-am install \
|
html-am info info-am install install-am install-data \
|
||||||
install-am install-data install-data-am install-dvi \
|
install-data-am install-dvi install-dvi-am install-exec \
|
||||||
install-dvi-am install-exec install-exec-am install-html \
|
install-exec-am install-html install-html-am install-info \
|
||||||
install-html-am install-info install-info-am install-man \
|
install-info-am install-man install-man5 install-man8 \
|
||||||
install-man5 install-man8 install-pdf install-pdf-am \
|
install-pdf install-pdf-am install-ps install-ps-am \
|
||||||
install-ps install-ps-am install-strip installcheck \
|
install-strip installcheck installcheck-am installdirs \
|
||||||
installcheck-am installdirs maintainer-clean \
|
maintainer-clean maintainer-clean-aminfo \
|
||||||
maintainer-clean-aminfo maintainer-clean-generic mostlyclean \
|
maintainer-clean-generic mostlyclean mostlyclean-aminfo \
|
||||||
mostlyclean-aminfo mostlyclean-generic pdf pdf-am ps ps-am \
|
mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am \
|
||||||
tags-am uninstall uninstall-am uninstall-dvi-am \
|
uninstall-dvi-am uninstall-html-am uninstall-info-am \
|
||||||
uninstall-html-am uninstall-info-am uninstall-man \
|
uninstall-man uninstall-man5 uninstall-man8 uninstall-pdf-am \
|
||||||
uninstall-man5 uninstall-man8 uninstall-pdf-am uninstall-ps-am
|
uninstall-ps-am
|
||||||
|
|
||||||
.PRECIOUS: Makefile
|
|
||||||
|
|
||||||
|
# For additional rules usually of interest only to the maintainer,
|
||||||
|
# see GNUmakefile and Makefile.maint.
|
||||||
|
|
||||||
|
sample-config.tar.gz: sample-config
|
||||||
|
GZIP=$(GZIP_ENV) $(AMTAR) chozf sample-config.tar.gz --exclude .svn sample-config
|
||||||
|
|
||||||
texi2html: tinc.texi
|
texi2html: tinc.texi
|
||||||
$(AM_V_GEN)texi2html -split=chapter $<
|
texi2html -split=chapter tinc.texi
|
||||||
|
|
||||||
tincd.8.html: tincd.8
|
tincd.8.html: tincd.8
|
||||||
$(AM_V_GEN)w3mman2html $< > $@
|
w3mman2html $< > $@
|
||||||
|
|
||||||
tinc.conf.5.html: tinc.conf.5
|
tinc.conf.5.html: tinc.conf.5
|
||||||
$(AM_V_GEN)w3mman2html $< > $@
|
w3mman2html $< > $@
|
||||||
|
|
||||||
tincd.8: $(srcdir)/tincd.8.in
|
tincd.8: tincd.8.in
|
||||||
$(AM_V_GEN)$(substitute) $(srcdir)/tincd.8.in > $@
|
$(substitute) tincd.8.in > tincd.8
|
||||||
|
|
||||||
tinc.conf.5: $(srcdir)/tinc.conf.5.in
|
tinc.conf.5: tinc.conf.5.in
|
||||||
$(AM_V_GEN)$(substitute) $(srcdir)/tinc.conf.5.in > $@
|
$(substitute) tinc.conf.5.in > tinc.conf.5
|
||||||
|
|
||||||
tincinclude.texi: $(srcdir)/tincinclude.texi.in
|
tincinclude.texi: tincinclude.texi.in
|
||||||
$(AM_V_GEN)$(substitute) $(srcdir)/tincinclude.texi.in > $@
|
$(substitute) tincinclude.texi.in > tincinclude.texi
|
||||||
|
|
||||||
|
tinc.texi: tincinclude.texi
|
||||||
|
|
||||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||||
|
|
|
||||||
BIN
doc/sample-config.tar.gz
Normal file
BIN
doc/sample-config.tar.gz
Normal file
Binary file not shown.
|
|
@ -1,15 +0,0 @@
|
||||||
# Sample host configuration file
|
|
||||||
|
|
||||||
# The real IP address of this tinc host. Can be used by other tinc hosts.
|
|
||||||
Address = 123.234.35.67
|
|
||||||
|
|
||||||
# Portnumber for incoming connections. Default is 655.
|
|
||||||
Port = 655
|
|
||||||
|
|
||||||
# Subnet on the virtual private network that is local for this host.
|
|
||||||
Subnet = 192.168.1.0/24
|
|
||||||
|
|
||||||
# The public key generated by `tincd -n example -K' is stored here
|
|
||||||
-----BEGIN RSA PUBLIC KEY-----
|
|
||||||
...
|
|
||||||
-----END RSA PUBLIC KEY-----
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
# Sample host configuration file
|
|
||||||
# This file was generated by host beta.
|
|
||||||
|
|
||||||
# The real IP address of this tinc host. Can be used by other tinc hosts.
|
|
||||||
Address = 123.45.67.189
|
|
||||||
|
|
||||||
# Portnumber for incoming connections. Default is 655.
|
|
||||||
Port = 6500
|
|
||||||
|
|
||||||
# Subnet on the virtual private network that is local for this host.
|
|
||||||
Subnet = 192.168.2.0/24
|
|
||||||
|
|
||||||
# The public key generated by `tincd -n example -K' is stored here
|
|
||||||
-----BEGIN RSA PUBLIC KEY-----
|
|
||||||
...
|
|
||||||
-----END RSA PUBLIC KEY-----
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
# Generate this file with `tincd -n example -K`
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
# This file closes down the tap device.
|
|
||||||
|
|
||||||
ifconfig $INTERFACE down
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
# This file sets up the tap device.
|
|
||||||
# It gives you the freedom to do anything you want with it.
|
|
||||||
# Use the correct name for the tap device:
|
|
||||||
# The environment variable $INTERFACE is set to the right name
|
|
||||||
# on most platforms, but if it doesn't work try to set it manually.
|
|
||||||
|
|
||||||
# Give it the right ip and netmask. Remember, the subnet of the
|
|
||||||
# tap device must be larger than that of the individual Subnets
|
|
||||||
# as defined in the host configuration file!
|
|
||||||
ifconfig $INTERFACE 192.168.1.1 netmask 255.255.0.0
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
# Sample tinc configuration file
|
|
||||||
|
|
||||||
# This is a comment.
|
|
||||||
# Spaces and tabs are eliminated.
|
|
||||||
# The = sign isn't strictly necessary any longer, though you may want
|
|
||||||
# to leave it in as it improves readability :)
|
|
||||||
# Variable names are treated case insensitive.
|
|
||||||
|
|
||||||
# The name of this tinc host. Required.
|
|
||||||
Name = alpha
|
|
||||||
|
|
||||||
# The internet host to connect with.
|
|
||||||
# Comment these out to make yourself a listen-only connection
|
|
||||||
# You must use the name of another tinc host.
|
|
||||||
# May be used multiple times for redundance.
|
|
||||||
ConnectTo = beta
|
|
||||||
|
|
||||||
# The tap device tinc will use.
|
|
||||||
# /dev/tap0 for ethertap, FreeBSD or OpenBSD
|
|
||||||
# /dev/tun0 for Solaris
|
|
||||||
# /dev/net/tun for Linux tun/tap
|
|
||||||
Device = /dev/net/tun
|
|
||||||
5839
doc/texinfo.tex
5839
doc/texinfo.tex
File diff suppressed because it is too large
Load diff
|
|
@ -1,21 +1,25 @@
|
||||||
.Dd 2016-10-29
|
.Dd 2010-01-16
|
||||||
.Dt TINC.CONF 5
|
.Dt TINC.CONF 5
|
||||||
.\" Manual page created by:
|
.\" Manual page created by:
|
||||||
.\" Ivo Timmermans
|
.\" Ivo Timmermans
|
||||||
.\" Guus Sliepen <guus@tinc-vpn.org>
|
.\" Guus Sliepen <guus@tinc-vpn.org>
|
||||||
|
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
.Nm tinc.conf
|
.Nm tinc.conf
|
||||||
.Nd tinc daemon configuration
|
.Nd tinc daemon configuration
|
||||||
|
|
||||||
.Sh DESCRIPTION
|
.Sh DESCRIPTION
|
||||||
The files in the
|
The files in the
|
||||||
.Pa @sysconfdir@/tinc/
|
.Pa @sysconfdir@/tinc/
|
||||||
directory contain runtime and security information for the tinc daemon.
|
directory contain runtime and security information for the tinc daemon.
|
||||||
|
|
||||||
.Sh NETWORKS
|
.Sh NETWORKS
|
||||||
It is perfectly ok for you to run more than one tinc daemon.
|
It is perfectly ok for you to run more than one tinc daemon.
|
||||||
However, in its default form,
|
However, in its default form,
|
||||||
you will soon notice that you can't use two different configuration files without the
|
you will soon notice that you can't use two different configuration files without the
|
||||||
.Fl c
|
.Fl c
|
||||||
option.
|
option.
|
||||||
|
|
||||||
.Pp
|
.Pp
|
||||||
We have thought of another way of dealing with this: network names.
|
We have thought of another way of dealing with this: network names.
|
||||||
This means that you call
|
This means that you call
|
||||||
|
|
@ -23,6 +27,7 @@ This means that you call
|
||||||
with the
|
with the
|
||||||
.Fl n
|
.Fl n
|
||||||
option, which will assign a name to this daemon.
|
option, which will assign a name to this daemon.
|
||||||
|
|
||||||
.Pp
|
.Pp
|
||||||
The effect of this is that the daemon will set its configuration root to
|
The effect of this is that the daemon will set its configuration root to
|
||||||
.Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa / ,
|
.Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa / ,
|
||||||
|
|
@ -33,6 +38,7 @@ is your argument to the
|
||||||
option.
|
option.
|
||||||
You'll notice that messages appear in syslog as coming from
|
You'll notice that messages appear in syslog as coming from
|
||||||
.Nm tincd. Ns Ar NETNAME .
|
.Nm tincd. Ns Ar NETNAME .
|
||||||
|
|
||||||
.Pp
|
.Pp
|
||||||
However, it is not strictly necessary that you call tinc with the
|
However, it is not strictly necessary that you call tinc with the
|
||||||
.Fl n
|
.Fl n
|
||||||
|
|
@ -48,21 +54,25 @@ the configuration file should be
|
||||||
.Pa @sysconfdir@/tinc/tinc.conf ,
|
.Pa @sysconfdir@/tinc/tinc.conf ,
|
||||||
and the host configuration files are now expected to be in
|
and the host configuration files are now expected to be in
|
||||||
.Pa @sysconfdir@/tinc/hosts/ .
|
.Pa @sysconfdir@/tinc/hosts/ .
|
||||||
|
|
||||||
.Pp
|
.Pp
|
||||||
But it is highly recommended that you use this feature of
|
But it is highly recommended that you use this feature of
|
||||||
.Nm tinc ,
|
.Nm tinc ,
|
||||||
because it will be so much clearer whom your daemon talks to.
|
because it will be so much clearer whom your daemon talks to.
|
||||||
Hence, we will assume that you use it.
|
Hence, we will assume that you use it.
|
||||||
|
|
||||||
.Sh NAMES
|
.Sh NAMES
|
||||||
Each tinc daemon must have a name that is unique in the network which it will be part of.
|
Each tinc daemon should have a name that is unique in the network which it will be part of.
|
||||||
The name will be used by other tinc daemons for identification.
|
The name will be used by other tinc daemons for identification.
|
||||||
The name has to be declared in the
|
The name has to be declared in the
|
||||||
.Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /tinc.conf
|
.Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /tinc.conf
|
||||||
file.
|
file.
|
||||||
|
|
||||||
.Pp
|
.Pp
|
||||||
To make things easy,
|
To make things easy,
|
||||||
choose something that will give unique and easy to remember names to your tinc daemon(s).
|
choose something that will give unique and easy to remember names to your tinc daemon(s).
|
||||||
You could try things like hostnames, owner surnames or location names.
|
You could try things like hostnames, owner surnames or location names.
|
||||||
|
|
||||||
.Sh PUBLIC/PRIVATE KEYS
|
.Sh PUBLIC/PRIVATE KEYS
|
||||||
You should use
|
You should use
|
||||||
.Ic tincd -K
|
.Ic tincd -K
|
||||||
|
|
@ -81,14 +91,17 @@ The public key should be stored in the host configuration file
|
||||||
.Va NAME
|
.Va NAME
|
||||||
stands for the name of the local tinc daemon (see
|
stands for the name of the local tinc daemon (see
|
||||||
.Sx NAMES ) .
|
.Sx NAMES ) .
|
||||||
|
|
||||||
.Sh SERVER CONFIGURATION
|
.Sh SERVER CONFIGURATION
|
||||||
The server configuration of the daemon is done in the file
|
The server configuration of the daemon is done in the file
|
||||||
.Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /tinc.conf .
|
.Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /tinc.conf .
|
||||||
This file consists of comments (lines started with a
|
This file consists of comments (lines started with a
|
||||||
.Li # )
|
.Li # )
|
||||||
or assignments in the form of:
|
or assignments in the form of:
|
||||||
|
|
||||||
.Pp
|
.Pp
|
||||||
.Va Variable Li = Ar Value .
|
.Va Variable Li = Ar Value .
|
||||||
|
|
||||||
.Pp
|
.Pp
|
||||||
The variable names are case insensitive, and any spaces, tabs,
|
The variable names are case insensitive, and any spaces, tabs,
|
||||||
newlines and carriage returns are ignored.
|
newlines and carriage returns are ignored.
|
||||||
|
|
@ -96,22 +109,26 @@ Note: it is not required that you put in the
|
||||||
.Li =
|
.Li =
|
||||||
sign, but doing so improves readability.
|
sign, but doing so improves readability.
|
||||||
If you leave it out, remember to replace it with at least one space character.
|
If you leave it out, remember to replace it with at least one space character.
|
||||||
|
|
||||||
.Pp
|
.Pp
|
||||||
The server configuration is complemented with host specific configuration (see the next section).
|
The server configuration is complemented with host specific configuration (see the next section).
|
||||||
Although all configuration options for the local host listed in this document can also be put in
|
Although all configuration options for the local host listed in this document can also be put in
|
||||||
.Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /tinc.conf ,
|
.Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /tinc.conf ,
|
||||||
it is recommended to put host specific configuration options in the host configuration file,
|
it is recommended to put host specific configuration options in the host configuration file,
|
||||||
as this makes it easy to exchange with other nodes.
|
as this makes it easy to exchange with other nodes.
|
||||||
|
|
||||||
.Pp
|
.Pp
|
||||||
Here are all valid variables, listed in alphabetical order.
|
Here are all valid variables, listed in alphabetical order.
|
||||||
The default value is given between parentheses.
|
The default value is given between parentheses.
|
||||||
.Bl -tag -width indent
|
.Bl -tag -width indent
|
||||||
|
|
||||||
.It Va AddressFamily Li = ipv4 | ipv6 | any Pq any
|
.It Va AddressFamily Li = ipv4 | ipv6 | any Pq any
|
||||||
This option affects the address family of listening and outgoing sockets.
|
This option affects the address family of listening and outgoing sockets.
|
||||||
If
|
If
|
||||||
.Qq any
|
.Qq any
|
||||||
is selected, then depending on the operating system both IPv4 and IPv6 or just
|
is selected, then depending on the operating system both IPv4 and IPv6 or just
|
||||||
IPv6 listening sockets will be created.
|
IPv6 listening sockets will be created.
|
||||||
|
|
||||||
.It Va BindToAddress Li = Ar address Oo Ar port Oc Bq experimental
|
.It Va BindToAddress Li = Ar address Oo Ar port Oc Bq experimental
|
||||||
If your computer has more than one IPv4 or IPv6 address,
|
If your computer has more than one IPv4 or IPv6 address,
|
||||||
.Nm tinc
|
.Nm tinc
|
||||||
|
|
@ -132,31 +149,36 @@ for the
|
||||||
.Ar address .
|
.Ar address .
|
||||||
.Pp
|
.Pp
|
||||||
This option may not work on all platforms.
|
This option may not work on all platforms.
|
||||||
|
|
||||||
.It Va BindToInterface Li = Ar interface Bq experimental
|
.It Va BindToInterface Li = Ar interface Bq experimental
|
||||||
If your computer has more than one network interface,
|
If your computer has more than one network interface,
|
||||||
.Nm tinc
|
.Nm tinc
|
||||||
will by default listen on all of them for incoming connections.
|
will by default listen on all of them for incoming connections.
|
||||||
It is possible to bind only to a single interface with this variable.
|
It is possible to bind only to a single interface with this variable.
|
||||||
|
|
||||||
.Pp
|
.Pp
|
||||||
This option may not work on all platforms.
|
This option may not work on all platforms.
|
||||||
Also, on some platforms it will not actually bind to an interface,
|
|
||||||
but rather to the address that the interface has at the moment a socket is created.
|
|
||||||
.It Va Broadcast Li = no | mst | direct Po mst Pc Bq experimental
|
.It Va Broadcast Li = no | mst | direct Po mst Pc Bq experimental
|
||||||
This option selects the way broadcast packets are sent to other daemons.
|
This option selects the way broadcast packets are sent to other daemons.
|
||||||
NOTE: all nodes in a VPN must use the same
|
NOTE: all nodes in a VPN must use the same
|
||||||
.Va Broadcast
|
.Va Broadcast
|
||||||
mode, otherwise routing loops can form.
|
mode, otherwise routing loops can form.
|
||||||
|
|
||||||
.Bl -tag -width indent
|
.Bl -tag -width indent
|
||||||
.It no
|
.It no
|
||||||
Broadcast packets are never sent to other nodes.
|
Broadcast packets are never sent to other nodes.
|
||||||
|
|
||||||
.It mst
|
.It mst
|
||||||
Broadcast packets are sent and forwarded via the VPN's Minimum Spanning Tree.
|
Broadcast packets are sent and forwarded via the VPN's Minimum Spanning Tree.
|
||||||
This ensures broadcast packets reach all nodes.
|
This ensures broadcast packets reach all nodes.
|
||||||
|
|
||||||
.It direct
|
.It direct
|
||||||
Broadcast packets are sent directly to all nodes that can be reached directly.
|
Broadcast packets are sent directly to all nodes that can be reached directly.
|
||||||
Broadcast packets received from other nodes are never forwarded.
|
Broadcast packets received from other nodes are never forwarded.
|
||||||
If the IndirectData option is also set, broadcast packets will only be sent to nodes which we have a meta connection to.
|
If the IndirectData option is also set, broadcast packets will only be sent to nodes which we have a meta connection to.
|
||||||
.El
|
.El
|
||||||
|
|
||||||
.It Va ConnectTo Li = Ar name
|
.It Va ConnectTo Li = Ar name
|
||||||
Specifies which other tinc daemon to connect to on startup.
|
Specifies which other tinc daemon to connect to on startup.
|
||||||
Multiple
|
Multiple
|
||||||
|
|
@ -167,12 +189,14 @@ The names should be known to this tinc daemon
|
||||||
(i.e., there should be a host configuration file for the name on the
|
(i.e., there should be a host configuration file for the name on the
|
||||||
.Va ConnectTo
|
.Va ConnectTo
|
||||||
line).
|
line).
|
||||||
|
|
||||||
.Pp
|
.Pp
|
||||||
If you don't specify a host with
|
If you don't specify a host with
|
||||||
.Va ConnectTo ,
|
.Va ConnectTo ,
|
||||||
.Nm tinc
|
.Nm tinc
|
||||||
won't try to connect to other daemons at all,
|
won't try to connect to other daemons at all,
|
||||||
and will instead just listen for incoming connections.
|
and will instead just listen for incoming connections.
|
||||||
|
|
||||||
.It Va DecrementTTL Li = yes | no Po no Pc Bq experimental
|
.It Va DecrementTTL Li = yes | no Po no Pc Bq experimental
|
||||||
When enabled,
|
When enabled,
|
||||||
.Nm tinc
|
.Nm tinc
|
||||||
|
|
@ -182,6 +206,7 @@ and will drop packets that have a TTL value of zero,
|
||||||
in which case it will send an ICMP Time Exceeded packet back.
|
in which case it will send an ICMP Time Exceeded packet back.
|
||||||
.Pp
|
.Pp
|
||||||
Do not use this option if you use switch mode and want to use IPv6.
|
Do not use this option if you use switch mode and want to use IPv6.
|
||||||
|
|
||||||
.It Va Device Li = Ar device Po Pa /dev/tap0 , Pa /dev/net/tun No or other depending on platform Pc
|
.It Va Device Li = Ar device Po Pa /dev/tap0 , Pa /dev/net/tun No or other depending on platform Pc
|
||||||
The virtual network device to use.
|
The virtual network device to use.
|
||||||
.Nm tinc
|
.Nm tinc
|
||||||
|
|
@ -193,15 +218,18 @@ instead of
|
||||||
.Va Device .
|
.Va Device .
|
||||||
The info pages of the tinc package contain more information
|
The info pages of the tinc package contain more information
|
||||||
about configuring the virtual network device.
|
about configuring the virtual network device.
|
||||||
|
|
||||||
.It Va DeviceType Li = Ar type Pq platform dependent
|
.It Va DeviceType Li = Ar type Pq platform dependent
|
||||||
The type of the virtual network device.
|
The type of the virtual network device.
|
||||||
Tinc will normally automatically select the right type of tun/tap interface, and this option should not be used.
|
Tinc will normally automatically select the right type of tun/tap interface, and this option should not be used.
|
||||||
However, this option can be used to select one of the special interface types, if support for them is compiled in.
|
However, this option can be used to select one of the special interface types, if support for them is compiled in.
|
||||||
.Bl -tag -width indent
|
.Bl -tag -width indent
|
||||||
|
|
||||||
.It dummy
|
.It dummy
|
||||||
Use a dummy interface.
|
Use a dummy interface.
|
||||||
No packets are ever read or written to a virtual network device.
|
No packets are ever read or written to a virtual network device.
|
||||||
Useful for testing, or when setting up a node that only forwards packets for other nodes.
|
Useful for testing, or when setting up a node that only forwards packets for other nodes.
|
||||||
|
|
||||||
.It raw_socket
|
.It raw_socket
|
||||||
Open a raw socket, and bind it to a pre-existing
|
Open a raw socket, and bind it to a pre-existing
|
||||||
.Va Interface
|
.Va Interface
|
||||||
|
|
@ -209,6 +237,7 @@ Open a raw socket, and bind it to a pre-existing
|
||||||
All packets are read from this interface.
|
All packets are read from this interface.
|
||||||
Packets received for the local node are written to the raw socket.
|
Packets received for the local node are written to the raw socket.
|
||||||
However, at least on Linux, the operating system does not process IP packets destined for the local host.
|
However, at least on Linux, the operating system does not process IP packets destined for the local host.
|
||||||
|
|
||||||
.It multicast
|
.It multicast
|
||||||
Open a multicast UDP socket and bind it to the address and port (separated by spaces) and optionally a TTL value specified using
|
Open a multicast UDP socket and bind it to the address and port (separated by spaces) and optionally a TTL value specified using
|
||||||
.Va Device .
|
.Va Device .
|
||||||
|
|
@ -218,67 +247,78 @@ Do NOT connect multiple
|
||||||
.Nm tinc
|
.Nm tinc
|
||||||
daemons to the same multicast address, this will very likely cause routing loops.
|
daemons to the same multicast address, this will very likely cause routing loops.
|
||||||
Also note that this can cause decrypted VPN packets to be sent out on a real network if misconfigured.
|
Also note that this can cause decrypted VPN packets to be sent out on a real network if misconfigured.
|
||||||
|
|
||||||
.It uml Pq not compiled in by default
|
.It uml Pq not compiled in by default
|
||||||
Create a UNIX socket with the filename specified by
|
Create a UNIX socket with the filename specified by
|
||||||
.Va Device ,
|
.Va Device ,
|
||||||
or
|
or
|
||||||
.Pa @runstatedir@/ Ns Ar NETNAME Ns Pa .umlsocket
|
.Pa @localstatedir@/run/ Ns Ar NETNAME Ns Pa .umlsocket
|
||||||
if not specified.
|
if not specified.
|
||||||
.Nm tinc
|
.Nm tinc
|
||||||
will wait for a User Mode Linux instance to connect to this socket.
|
will wait for a User Mode Linux instance to connect to this socket.
|
||||||
|
|
||||||
.It vde Pq not compiled in by default
|
.It vde Pq not compiled in by default
|
||||||
Uses the libvdeplug library to connect to a Virtual Distributed Ethernet switch,
|
Uses the libvdeplug library to connect to a Virtual Distributed Ethernet switch,
|
||||||
using the UNIX socket specified by
|
using the UNIX socket specified by
|
||||||
.Va Device ,
|
.Va Device ,
|
||||||
or
|
or
|
||||||
.Pa @runstatedir@/vde.ctl
|
.Pa @localstatedir@/run/vde.ctl
|
||||||
if not specified.
|
if not specified.
|
||||||
.El
|
.El
|
||||||
|
|
||||||
Also, in case tinc does not seem to correctly interpret packets received from the virtual network device,
|
Also, in case tinc does not seem to correctly interpret packets received from the virtual network device,
|
||||||
it can be used to change the way packets are interpreted:
|
it can be used to change the way packets are interpreted:
|
||||||
|
|
||||||
.Bl -tag -width indent
|
.Bl -tag -width indent
|
||||||
|
|
||||||
.It tun Pq BSD and Linux
|
.It tun Pq BSD and Linux
|
||||||
Set type to tun.
|
Set type to tun.
|
||||||
Depending on the platform, this can either be with or without an address family header (see below).
|
Depending on the platform, this can either be with or without an address family header (see below).
|
||||||
|
|
||||||
.It tunnohead Pq BSD
|
.It tunnohead Pq BSD
|
||||||
Set type to tun without an address family header.
|
Set type to tun without an address family header.
|
||||||
Tinc will expect packets read from the virtual network device to start with an IP header.
|
Tinc will expect packets read from the virtual network device to start with an IP header.
|
||||||
On some platforms IPv6 packets cannot be read from or written to the device in this mode.
|
On some platforms IPv6 packets cannot be read from or written to the device in this mode.
|
||||||
|
|
||||||
.It tunifhead Pq BSD
|
.It tunifhead Pq BSD
|
||||||
Set type to tun with an address family header.
|
Set type to tun with an address family header.
|
||||||
Tinc will expect packets read from the virtual network device
|
Tinc will expect packets read from the virtual network device
|
||||||
to start with a four byte header containing the address family,
|
to start with a four byte header containing the address family,
|
||||||
followed by an IP header.
|
followed by an IP header.
|
||||||
This mode should support both IPv4 and IPv6 packets.
|
This mode should support both IPv4 and IPv6 packets.
|
||||||
.It utun Pq OS X
|
|
||||||
Set type to utun.
|
|
||||||
This is only supported on OS X version 10.6.8 and higher, but doesn't require the tuntaposx module.
|
|
||||||
This mode should support both IPv4 and IPv6 packets.
|
|
||||||
.It tap Pq BSD and Linux
|
.It tap Pq BSD and Linux
|
||||||
Set type to tap.
|
Set type to tap.
|
||||||
Tinc will expect packets read from the virtual network device
|
Tinc will expect packets read from the virtual network device
|
||||||
to start with an Ethernet header.
|
to start with an Ethernet header.
|
||||||
.El
|
.El
|
||||||
|
|
||||||
.It Va DirectOnly Li = yes | no Po no Pc Bq experimental
|
.It Va DirectOnly Li = yes | no Po no Pc Bq experimental
|
||||||
When this option is enabled, packets that cannot be sent directly to the destination node,
|
When this option is enabled, packets that cannot be sent directly to the destination node,
|
||||||
but which would have to be forwarded by an intermediate node, are dropped instead.
|
but which would have to be forwarded by an intermediate node, are dropped instead.
|
||||||
When combined with the IndirectData option,
|
When combined with the IndirectData option,
|
||||||
packets for nodes for which we do not have a meta connection with are also dropped.
|
packets for nodes for which we do not have a meta connection with are also dropped.
|
||||||
|
|
||||||
.It Va Forwarding Li = off | internal | kernel Po internal Pc Bq experimental
|
.It Va Forwarding Li = off | internal | kernel Po internal Pc Bq experimental
|
||||||
This option selects the way indirect packets are forwarded.
|
This option selects the way indirect packets are forwarded.
|
||||||
.Bl -tag -width indent
|
.Bl -tag -width indent
|
||||||
|
|
||||||
.It off
|
.It off
|
||||||
Incoming packets that are not meant for the local node,
|
Incoming packets that are not meant for the local node,
|
||||||
but which should be forwarded to another node, are dropped.
|
but which should be forwarded to another node, are dropped.
|
||||||
|
|
||||||
.It internal
|
.It internal
|
||||||
Incoming packets that are meant for another node are forwarded by tinc internally.
|
Incoming packets that are meant for another node are forwarded by tinc internally.
|
||||||
|
|
||||||
.Pp
|
.Pp
|
||||||
This is the default mode, and unless you really know you need another forwarding mode, don't change it.
|
This is the default mode, and unless you really know you need another forwarding mode, don't change it.
|
||||||
|
|
||||||
.It kernel
|
.It kernel
|
||||||
Incoming packets are always sent to the TUN/TAP device, even if the packets are not for the local node.
|
Incoming packets are always sent to the TUN/TAP device, even if the packets are not for the local node.
|
||||||
This is less efficient, but allows the kernel to apply its routing and firewall rules on them,
|
This is less efficient, but allows the kernel to apply its routing and firewall rules on them,
|
||||||
and can also help debugging.
|
and can also help debugging.
|
||||||
.El
|
.El
|
||||||
|
|
||||||
.It Va GraphDumpFile Li = Ar filename Bq experimental
|
.It Va GraphDumpFile Li = Ar filename Bq experimental
|
||||||
If this option is present,
|
If this option is present,
|
||||||
.Nm tinc
|
.Nm tinc
|
||||||
|
|
@ -291,16 +331,20 @@ If
|
||||||
starts with a pipe symbol |,
|
starts with a pipe symbol |,
|
||||||
then the rest of the filename is interpreted as a shell command
|
then the rest of the filename is interpreted as a shell command
|
||||||
that is executed, the graph is then sent to stdin.
|
that is executed, the graph is then sent to stdin.
|
||||||
|
|
||||||
.It Va Hostnames Li = yes | no Pq no
|
.It Va Hostnames Li = yes | no Pq no
|
||||||
This option selects whether IP addresses (both real and on the VPN) should
|
This option selects whether IP addresses (both real and on the VPN) should
|
||||||
be resolved. Since DNS lookups are blocking, it might affect tinc's
|
be resolved. Since DNS lookups are blocking, it might affect tinc's
|
||||||
efficiency, even stopping the daemon for a few seconds every time it does
|
efficiency, even stopping the daemon for a few seconds every time it does
|
||||||
a lookup if your DNS server is not responding.
|
a lookup if your DNS server is not responding.
|
||||||
|
|
||||||
.Pp
|
.Pp
|
||||||
This does not affect resolving hostnames to IP addresses from the
|
This does not affect resolving hostnames to IP addresses from the
|
||||||
host configuration files, but whether hostnames should be resolved while logging.
|
host configuration files.
|
||||||
|
|
||||||
.It Va IffOneQueue Li = yes | no Po no Pc Bq experimental
|
.It Va IffOneQueue Li = yes | no Po no Pc Bq experimental
|
||||||
(Linux only) Set IFF_ONE_QUEUE flag on TUN/TAP devices.
|
(Linux only) Set IFF_ONE_QUEUE flag on TUN/TAP devices.
|
||||||
|
|
||||||
.It Va Interface Li = Ar interface
|
.It Va Interface Li = Ar interface
|
||||||
Defines the name of the interface corresponding to the virtual network device.
|
Defines the name of the interface corresponding to the virtual network device.
|
||||||
Depending on the operating system and the type of device this may or may not actually set the name of the interface.
|
Depending on the operating system and the type of device this may or may not actually set the name of the interface.
|
||||||
|
|
@ -308,10 +352,12 @@ Under Windows, this variable is used to select which network interface will be u
|
||||||
If you specified a
|
If you specified a
|
||||||
.Va Device ,
|
.Va Device ,
|
||||||
this variable is almost always already correctly set.
|
this variable is almost always already correctly set.
|
||||||
|
|
||||||
.It Va KeyExpire Li = Ar seconds Pq 3600
|
.It Va KeyExpire Li = Ar seconds Pq 3600
|
||||||
This option controls the period the encryption keys used to encrypt the data are valid.
|
This option controls the period the encryption keys used to encrypt the data are valid.
|
||||||
It is common practice to change keys at regular intervals to make it even harder for crackers,
|
It is common practice to change keys at regular intervals to make it even harder for crackers,
|
||||||
even though it is thought to be nearly impossible to crack a single key.
|
even though it is thought to be nearly impossible to crack a single key.
|
||||||
|
|
||||||
.It Va LocalDiscovery Li = yes | no Po no Pc Bq experimental
|
.It Va LocalDiscovery Li = yes | no Po no Pc Bq experimental
|
||||||
When enabled,
|
When enabled,
|
||||||
.Nm tinc
|
.Nm tinc
|
||||||
|
|
@ -319,43 +365,54 @@ will try to detect peers that are on the same local network.
|
||||||
This will allow direct communication using LAN addresses, even if both peers are behind a NAT
|
This will allow direct communication using LAN addresses, even if both peers are behind a NAT
|
||||||
and they only ConnectTo a third node outside the NAT,
|
and they only ConnectTo a third node outside the NAT,
|
||||||
which normally would prevent the peers from learning each other's LAN address.
|
which normally would prevent the peers from learning each other's LAN address.
|
||||||
|
|
||||||
.Pp
|
.Pp
|
||||||
Currently, local discovery is implemented by sending broadcast packets to the LAN during path MTU discovery.
|
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.
|
This feature may not work in all possible situations.
|
||||||
|
|
||||||
.It Va MACExpire Li = Ar seconds Pq 600
|
.It Va MACExpire Li = Ar seconds Pq 600
|
||||||
This option controls the amount of time MAC addresses are kept before they are removed.
|
This option controls the amount of time MAC addresses are kept before they are removed.
|
||||||
This only has effect when
|
This only has effect when
|
||||||
.Va Mode
|
.Va Mode
|
||||||
is set to
|
is set to
|
||||||
.Qq switch .
|
.Qq switch .
|
||||||
|
|
||||||
.It Va MaxTimeout Li = Ar seconds Pq 900
|
.It Va MaxTimeout Li = Ar seconds Pq 900
|
||||||
This is the maximum delay before trying to reconnect to other tinc daemons.
|
This is the maximum delay before trying to reconnect to other tinc daemons.
|
||||||
|
|
||||||
.It Va Mode Li = router | switch | hub Pq router
|
.It Va Mode Li = router | switch | hub Pq router
|
||||||
This option selects the way packets are routed to other daemons.
|
This option selects the way packets are routed to other daemons.
|
||||||
.Bl -tag -width indent
|
.Bl -tag -width indent
|
||||||
|
|
||||||
.It router
|
.It router
|
||||||
In this mode
|
In this mode
|
||||||
.Va Subnet
|
.Va Subnet
|
||||||
variables in the host configuration files will be used to form a routing table.
|
variables in the host configuration files will be used to form a routing table.
|
||||||
Only unicast packets of routable protocols (IPv4 and IPv6) are supported in this mode.
|
Only unicast packets of routable protocols (IPv4 and IPv6) are supported in this mode.
|
||||||
|
|
||||||
.Pp
|
.Pp
|
||||||
This is the default mode, and unless you really know you need another mode, don't change it.
|
This is the default mode, and unless you really know you need another mode, don't change it.
|
||||||
|
|
||||||
.It switch
|
.It switch
|
||||||
In this mode the MAC addresses of the packets on the VPN will be used to
|
In this mode the MAC addresses of the packets on the VPN will be used to
|
||||||
dynamically create a routing table just like an Ethernet switch does.
|
dynamically create a routing table just like an Ethernet switch does.
|
||||||
Unicast, multicast and broadcast packets of every protocol that runs over Ethernet are supported in this mode
|
Unicast, multicast and broadcast packets of every protocol that runs over Ethernet are supported in this mode
|
||||||
at the cost of frequent broadcast ARP requests and routing table updates.
|
at the cost of frequent broadcast ARP requests and routing table updates.
|
||||||
|
|
||||||
.Pp
|
.Pp
|
||||||
This mode is primarily useful if you want to bridge Ethernet segments.
|
This mode is primarily useful if you want to bridge Ethernet segments.
|
||||||
|
|
||||||
.It hub
|
.It hub
|
||||||
This mode is almost the same as the switch mode, but instead
|
This mode is almost the same as the switch mode, but instead
|
||||||
every packet will be broadcast to the other daemons
|
every packet will be broadcast to the other daemons
|
||||||
while no routing table is managed.
|
while no routing table is managed.
|
||||||
.El
|
.El
|
||||||
|
|
||||||
.It Va Name Li = Ar name Bq required
|
.It Va Name Li = Ar name Bq required
|
||||||
This is the name which identifies this tinc daemon.
|
This is the name which identifies this tinc daemon.
|
||||||
It must be unique for the virtual private network this daemon will connect to.
|
It must be unique for the virtual private network this daemon will connect to.
|
||||||
The Name may only consist of alphanumeric and underscore characters.
|
The Name may only consist of alphanumeric and underscore characters.
|
||||||
|
|
||||||
If
|
If
|
||||||
.Va Name
|
.Va Name
|
||||||
starts with a
|
starts with a
|
||||||
|
|
@ -366,27 +423,39 @@ If
|
||||||
.Va Name
|
.Va Name
|
||||||
is
|
is
|
||||||
.Li $HOST ,
|
.Li $HOST ,
|
||||||
but no such environment variable exist, the hostname will be read using the gethostname() system call.
|
but no such environment variable exist, the hostname will be read using the gethostnname() system call.
|
||||||
|
|
||||||
.It Va PingInterval Li = Ar seconds Pq 60
|
.It Va PingInterval Li = Ar seconds Pq 60
|
||||||
The number of seconds of inactivity that
|
The number of seconds of inactivity that
|
||||||
.Nm tinc
|
.Nm tinc
|
||||||
will wait before sending a probe to the other end.
|
will wait before sending a probe to the other end.
|
||||||
|
|
||||||
.It Va PingTimeout Li = Ar seconds Pq 5
|
.It Va PingTimeout Li = Ar seconds Pq 5
|
||||||
The number of seconds to wait for a response to pings or to allow meta
|
The number of seconds to wait for a response to pings or to allow meta
|
||||||
connections to block. If the other end doesn't respond within this time,
|
connections to block. If the other end doesn't respond within this time,
|
||||||
the connection is terminated,
|
the connection is terminated,
|
||||||
and the others will be notified of this.
|
and the others will be notified of this.
|
||||||
|
|
||||||
.It Va PriorityInheritance Li = yes | no Po no Pc Bq experimental
|
.It Va PriorityInheritance Li = yes | no Po no Pc Bq experimental
|
||||||
When this option is enabled the value of the TOS field of tunneled IPv4 packets
|
When this option is enabled the value of the TOS field of tunneled IPv4 packets
|
||||||
will be inherited by the UDP packets that are sent out.
|
will be inherited by the UDP packets that are sent out.
|
||||||
|
|
||||||
.It Va PrivateKey Li = Ar key Bq obsolete
|
.It Va PrivateKey Li = Ar key Bq obsolete
|
||||||
The private RSA key of this tinc daemon.
|
The private RSA key of this tinc daemon.
|
||||||
It will allow this tinc daemon to authenticate itself to other daemons.
|
It will allow this tinc daemon to authenticate itself to other daemons.
|
||||||
|
|
||||||
.It Va PrivateKeyFile Li = Ar filename Po Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /rsa_key.priv Pc
|
.It Va PrivateKeyFile Li = Ar filename Po Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /rsa_key.priv Pc
|
||||||
The file in which the private RSA key of this tinc daemon resides.
|
The file in which the private RSA key of this tinc daemon resides.
|
||||||
|
Note that there must be exactly one of
|
||||||
|
.Va PrivateKey
|
||||||
|
or
|
||||||
|
.Va PrivateKeyFile
|
||||||
|
specified in the configuration file.
|
||||||
|
|
||||||
.It Va ProcessPriority Li = low | normal | high
|
.It Va ProcessPriority Li = low | normal | high
|
||||||
When this option is used the priority of the tincd process will be adjusted.
|
When this option is used the priority of the tincd process will be adjusted.
|
||||||
Increasing the priority may help to reduce latency and packet loss on the VPN.
|
Increasing the priority may help to reduce latency and packet loss on the VPN.
|
||||||
|
|
||||||
.It Va Proxy Li = socks4 | socks5 | http | exec Ar ... Bq experimental
|
.It Va Proxy Li = socks4 | socks5 | http | exec Ar ... Bq experimental
|
||||||
Use a proxy when making outgoing connections.
|
Use a proxy when making outgoing connections.
|
||||||
The following proxy types are currently supported:
|
The following proxy types are currently supported:
|
||||||
|
|
@ -419,8 +488,9 @@ and
|
||||||
.Ev REMOTEPORT
|
.Ev REMOTEPORT
|
||||||
are available.
|
are available.
|
||||||
.El
|
.El
|
||||||
|
|
||||||
.It Va ReplayWindow Li = Ar bytes Pq 16
|
.It Va ReplayWindow Li = Ar bytes Pq 16
|
||||||
This is the size of the replay tracking window for each remote node, in bytes.
|
vhis is the size of the replay tracking window for each remote node, in bytes.
|
||||||
The window is a bitfield which tracks 1 packet per bit, so for example
|
The window is a bitfield which tracks 1 packet per bit, so for example
|
||||||
the default setting of 16 will track up to 128 packets in the window. In high
|
the default setting of 16 will track up to 128 packets in the window. In high
|
||||||
bandwidth scenarios, setting this to a higher value can reduce packet loss from
|
bandwidth scenarios, setting this to a higher value can reduce packet loss from
|
||||||
|
|
@ -428,30 +498,35 @@ the interaction of replay tracking with underlying real packet loss and/or
|
||||||
reordering. Setting this to zero will disable replay tracking completely and
|
reordering. Setting this to zero will disable replay tracking completely and
|
||||||
pass all traffic, but leaves tinc vulnerable to replay-based attacks on your
|
pass all traffic, but leaves tinc vulnerable to replay-based attacks on your
|
||||||
traffic.
|
traffic.
|
||||||
|
|
||||||
.It Va StrictSubnets Li = yes | no Po no Pc Bq experimental
|
.It Va StrictSubnets Li = yes | no Po no Pc Bq experimental
|
||||||
When this option is enabled tinc will only use Subnet statements which are
|
When this option is enabled tinc will only use Subnet statements which are
|
||||||
present in the host config files in the local
|
present in the host config files in the local
|
||||||
.Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /hosts/
|
.Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /hosts/
|
||||||
directory. Subnets learned via connections to other nodes and which are not
|
directory.
|
||||||
present in the local host config files are ignored.
|
|
||||||
.It Va TunnelServer Li = yes | no Po no Pc Bq experimental
|
.It Va TunnelServer Li = yes | no Po no Pc Bq experimental
|
||||||
When this option is enabled tinc will no longer forward information between other tinc daemons,
|
When this option is enabled tinc will no longer forward information between other tinc daemons,
|
||||||
and will only allow connections with nodes for which host config files are present in the local
|
and will only allow connections with nodes for which host config files are present in the local
|
||||||
.Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /hosts/
|
.Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /hosts/
|
||||||
directory.
|
directory.
|
||||||
Setting this options also implicitly sets StrictSubnets.
|
Setting this options also implicitly sets StrictSubnets.
|
||||||
|
|
||||||
.It Va UDPRcvBuf Li = Ar bytes Pq OS default
|
.It Va UDPRcvBuf Li = Ar bytes Pq OS default
|
||||||
Sets the socket receive buffer size for the UDP socket, in bytes.
|
Sets the socket receive buffer size for the UDP socket, in bytes.
|
||||||
If unset, the default buffer size will be used by the operating system.
|
If unset, the default buffer size will be used by the operating system.
|
||||||
|
|
||||||
.It Va UDPSndBuf Li = Ar bytes Pq OS default
|
.It Va UDPSndBuf Li = Ar bytes Pq OS default
|
||||||
Sets the socket send buffer size for the UDP socket, in bytes.
|
Sets the socket send buffer size for the UDP socket, in bytes.
|
||||||
If unset, the default buffer size will be used by the operating system.
|
If unset, the default buffer size will be used by the operating system.
|
||||||
.El
|
.El
|
||||||
|
|
||||||
.Sh HOST CONFIGURATION FILES
|
.Sh HOST CONFIGURATION FILES
|
||||||
The host configuration files contain all information needed
|
The host configuration files contain all information needed
|
||||||
to establish a connection to those hosts.
|
to establish a connection to those hosts.
|
||||||
A host configuration file is also required for the local tinc daemon,
|
A host configuration file is also required for the local tinc daemon,
|
||||||
it will use it to read in it's listen port, public key and subnets.
|
it will use it to read in it's listen port, public key and subnets.
|
||||||
|
|
||||||
.Pp
|
.Pp
|
||||||
The idea is that these files are portable.
|
The idea is that these files are portable.
|
||||||
You can safely mail your own host configuration file to someone else.
|
You can safely mail your own host configuration file to someone else.
|
||||||
|
|
@ -460,6 +535,7 @@ and now his tinc daemon will be able to connect to your tinc daemon.
|
||||||
Since host configuration files only contain public keys,
|
Since host configuration files only contain public keys,
|
||||||
no secrets are revealed by sending out this information.
|
no secrets are revealed by sending out this information.
|
||||||
.Bl -tag -width indent
|
.Bl -tag -width indent
|
||||||
|
|
||||||
.It Va Address Li = Ar address Oo Ar port Oc Bq recommended
|
.It Va Address Li = Ar address Oo Ar port Oc Bq recommended
|
||||||
The IP address or hostname of this tinc daemon on the real network.
|
The IP address or hostname of this tinc daemon on the real network.
|
||||||
This will only be used when trying to make an outgoing connection to this tinc daemon.
|
This will only be used when trying to make an outgoing connection to this tinc daemon.
|
||||||
|
|
@ -468,51 +544,66 @@ Multiple
|
||||||
.Va Address
|
.Va Address
|
||||||
variables can be specified, in which case each address will be tried until a working
|
variables can be specified, in which case each address will be tried until a working
|
||||||
connection has been established.
|
connection has been established.
|
||||||
.It Va Cipher Li = Ar cipher Pq aes-256-cbc
|
|
||||||
|
.It Va Cipher Li = Ar cipher Pq blowfish
|
||||||
The symmetric cipher algorithm used to encrypt UDP packets.
|
The symmetric cipher algorithm used to encrypt UDP packets.
|
||||||
Any cipher supported by LibreSSL or OpenSSL is recognised.
|
Any cipher supported by OpenSSL is recognised.
|
||||||
Furthermore, specifying
|
Furthermore, specifying
|
||||||
.Qq none
|
.Qq none
|
||||||
will turn off packet encryption.
|
will turn off packet encryption.
|
||||||
It is best to use only those ciphers which support CBC mode.
|
It is best to use only those ciphers which support CBC mode.
|
||||||
|
|
||||||
.It Va ClampMSS Li = yes | no Pq yes
|
.It Va ClampMSS Li = yes | no Pq yes
|
||||||
This option specifies whether tinc should clamp the maximum segment size (MSS)
|
This option specifies whether tinc should clamp the maximum segment size (MSS)
|
||||||
of TCP packets to the path MTU. This helps in situations where ICMP
|
of TCP packets to the path MTU. This helps in situations where ICMP
|
||||||
Fragmentation Needed or Packet too Big messages are dropped by firewalls.
|
Fragmentation Needed or Packet too Big messages are dropped by firewalls.
|
||||||
|
|
||||||
.It Va Compression Li = Ar level Pq 0
|
.It Va Compression Li = Ar level Pq 0
|
||||||
This option sets the level of compression used for UDP packets.
|
This option sets the level of compression used for UDP packets.
|
||||||
Possible values are 0 (off), 1 (fast zlib) and any integer up to 9 (best zlib),
|
Possible values are 0 (off), 1 (fast zlib) and any integer up to 9 (best zlib),
|
||||||
10 (fast lzo) and 11 (best lzo).
|
10 (fast lzo) and 11 (best lzo).
|
||||||
.It Va Digest Li = Ar digest Pq sha256
|
|
||||||
|
.It Va Digest Li = Ar digest Pq sha1
|
||||||
The digest algorithm used to authenticate UDP packets.
|
The digest algorithm used to authenticate UDP packets.
|
||||||
Any digest supported by LibreSSL or OpenSSL is recognised.
|
Any digest supported by OpenSSL is recognised.
|
||||||
Furthermore, specifying
|
Furthermore, specifying
|
||||||
.Qq none
|
.Qq none
|
||||||
will turn off packet authentication.
|
will turn off packet authentication.
|
||||||
|
|
||||||
.It Va IndirectData Li = yes | no Pq no
|
.It Va IndirectData Li = yes | no Pq no
|
||||||
When set to yes, only nodes which already have a meta connection to you
|
This option specifies whether other tinc daemons besides the one you specified with
|
||||||
will try to establish direct communication with you.
|
.Va ConnectTo
|
||||||
It is best to leave this option out or set it to no.
|
can make a direct connection to you.
|
||||||
|
This is especially useful if you are behind a firewall
|
||||||
|
and it is impossible to make a connection from the outside to your tinc daemon.
|
||||||
|
Otherwise, it is best to leave this option out or set it to no.
|
||||||
|
|
||||||
.It Va MACLength Li = Ar length Pq 4
|
.It Va MACLength Li = Ar length Pq 4
|
||||||
The length of the message authentication code used to authenticate UDP packets.
|
The length of the message authentication code used to authenticate UDP packets.
|
||||||
Can be anything from
|
Can be anything from
|
||||||
.Qq 0
|
.Qq 0
|
||||||
up to the length of the digest produced by the digest algorithm.
|
up to the length of the digest produced by the digest algorithm.
|
||||||
|
|
||||||
.It Va PMTU Li = Ar mtu Po 1514 Pc
|
.It Va PMTU Li = Ar mtu Po 1514 Pc
|
||||||
This option controls the initial path MTU to this node.
|
This option controls the initial path MTU to this node.
|
||||||
|
|
||||||
.It Va PMTUDiscovery Li = yes | no Po yes Pc
|
.It Va PMTUDiscovery Li = yes | no Po yes Pc
|
||||||
When this option is enabled, tinc will try to discover the path MTU to this node.
|
When this option is enabled, tinc will try to discover the path MTU to this node.
|
||||||
After the path MTU has been discovered, it will be enforced on the VPN.
|
After the path MTU has been discovered, it will be enforced on the VPN.
|
||||||
|
|
||||||
.It Va Port Li = Ar port Pq 655
|
.It Va Port Li = Ar port Pq 655
|
||||||
The port number on which this tinc daemon is listening for incoming connections,
|
The port number on which this tinc daemon is listening for incoming connections,
|
||||||
which is used if no port number is specified in an
|
which is used if no port number is specified in an
|
||||||
.Va Address
|
.Va Address
|
||||||
statement.
|
statement.
|
||||||
|
|
||||||
.It Va PublicKey Li = Ar key Bq obsolete
|
.It Va PublicKey Li = Ar key Bq obsolete
|
||||||
The public RSA key of this tinc daemon.
|
The public RSA key of this tinc daemon.
|
||||||
It will be used to cryptographically verify it's identity and to set up a secure connection.
|
It will be used to cryptographically verify it's identity and to set up a secure connection.
|
||||||
|
|
||||||
.It Va PublicKeyFile Li = Ar filename Bq obsolete
|
.It Va PublicKeyFile Li = Ar filename Bq obsolete
|
||||||
The file in which the public RSA key of this tinc daemon resides.
|
The file in which the public RSA key of this tinc daemon resides.
|
||||||
|
|
||||||
.Pp
|
.Pp
|
||||||
From version 1.0pre4 on
|
From version 1.0pre4 on
|
||||||
.Nm tinc
|
.Nm tinc
|
||||||
|
|
@ -521,6 +612,7 @@ the above two options then are not necessary.
|
||||||
Either the PEM format is used, or exactly one of the above two options must be specified
|
Either the PEM format is used, or exactly one of the above two options must be specified
|
||||||
in each host configuration file,
|
in each host configuration file,
|
||||||
if you want to be able to establish a connection with that host.
|
if you want to be able to establish a connection with that host.
|
||||||
|
|
||||||
.It Va Subnet Li = Ar address Ns Op Li / Ns Ar prefixlength Ns Op Li # Ns Ar weight
|
.It Va Subnet Li = Ar address Ns Op Li / Ns Ar prefixlength Ns Op Li # Ns Ar weight
|
||||||
The subnet which this tinc daemon will serve.
|
The subnet which this tinc daemon will serve.
|
||||||
.Nm tinc
|
.Nm tinc
|
||||||
|
|
@ -530,6 +622,7 @@ it will be sent to the daemon who has this subnet in his host configuration file
|
||||||
Multiple
|
Multiple
|
||||||
.Va Subnet
|
.Va Subnet
|
||||||
variables can be specified.
|
variables can be specified.
|
||||||
|
|
||||||
.Pp
|
.Pp
|
||||||
Subnets can either be single MAC, IPv4 or IPv6 addresses,
|
Subnets can either be single MAC, IPv4 or IPv6 addresses,
|
||||||
in which case a subnet consisting of only that single address is assumed,
|
in which case a subnet consisting of only that single address is assumed,
|
||||||
|
|
@ -540,12 +633,14 @@ Note that subnets like 192.168.1.1/24 are invalid!
|
||||||
Read a networking HOWTO/FAQ/guide if you don't understand this.
|
Read a networking HOWTO/FAQ/guide if you don't understand this.
|
||||||
IPv6 subnets are notated like fec0:0:0:1::/64.
|
IPv6 subnets are notated like fec0:0:0:1::/64.
|
||||||
MAC addresses are notated like 0:1a:2b:3c:4d:5e.
|
MAC addresses are notated like 0:1a:2b:3c:4d:5e.
|
||||||
|
|
||||||
.Pp
|
.Pp
|
||||||
A Subnet can be given a weight to indicate its priority over identical Subnets
|
A Subnet can be given a weight to indicate its priority over identical Subnets
|
||||||
owned by different nodes. The default weight is 10. Lower values indicate
|
owned by different nodes. The default weight is 10. Lower values indicate
|
||||||
higher priority. Packets will be sent to the node with the highest priority,
|
higher priority. Packets will be sent to the node with the highest priority,
|
||||||
unless that node is not reachable, in which case the node with the next highest
|
unless that node is not reachable, in which case the node with the next highest
|
||||||
priority will be tried, and so on.
|
priority will be tried, and so on.
|
||||||
|
|
||||||
.It Va TCPOnly Li = yes | no Pq no Bq obsolete
|
.It Va TCPOnly Li = yes | no Pq no Bq obsolete
|
||||||
If this variable is set to yes,
|
If this variable is set to yes,
|
||||||
then the packets are tunnelled over the TCP connection instead of a UDP connection.
|
then the packets are tunnelled over the TCP connection instead of a UDP connection.
|
||||||
|
|
@ -553,51 +648,53 @@ This is especially useful for those who want to run a tinc daemon
|
||||||
from behind a masquerading firewall,
|
from behind a masquerading firewall,
|
||||||
or if UDP packet routing is disabled somehow.
|
or if UDP packet routing is disabled somehow.
|
||||||
Setting this options also implicitly sets IndirectData.
|
Setting this options also implicitly sets IndirectData.
|
||||||
|
|
||||||
.Pp
|
.Pp
|
||||||
Since version 1.0.10, tinc will automatically detect whether communication via
|
Since version 1.0.10, tinc will automatically detect whether communication via
|
||||||
UDP is possible or not.
|
UDP is possible or not.
|
||||||
.El
|
.El
|
||||||
|
|
||||||
.Sh SCRIPTS
|
.Sh SCRIPTS
|
||||||
Apart from reading the server and host configuration files,
|
Apart from reading the server and host configuration files,
|
||||||
tinc can also run scripts at certain moments.
|
tinc can also run scripts at certain moments.
|
||||||
Below is a list of filenames of scripts and a description of when they are run.
|
Under Windows (not Cygwin), the scripts should have the extension
|
||||||
A script is only run if it exists and if it is executable.
|
|
||||||
.Pp
|
|
||||||
Scripts are run synchronously;
|
|
||||||
this means that tinc will temporarily stop processing packets until the called script finishes executing.
|
|
||||||
This guarantees that scripts will execute in the exact same order as the events that trigger them.
|
|
||||||
If you need to run commands asynchronously, you have to ensure yourself that they are being run in the background.
|
|
||||||
.Pp
|
|
||||||
Under Windows (not Cygwin), the scripts must have the extension
|
|
||||||
.Pa .bat .
|
.Pa .bat .
|
||||||
.Bl -tag -width indent
|
.Bl -tag -width indent
|
||||||
|
|
||||||
.It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /tinc-up
|
.It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /tinc-up
|
||||||
This is the most important script.
|
This is the most important script.
|
||||||
If it is present it will be executed right after the tinc daemon has been started and has connected to the virtual network device.
|
If it is present it will be executed right after the tinc daemon has been started and has connected to the virtual network device.
|
||||||
It should be used to set up the corresponding network interface,
|
It should be used to set up the corresponding network interface,
|
||||||
but can also be used to start other things.
|
but can also be used to start other things.
|
||||||
.Pp
|
|
||||||
Under Windows you can use the Network Connections control panel instead of creating this script.
|
Under Windows you can use the Network Connections control panel instead of creating this script.
|
||||||
|
|
||||||
.It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /tinc-down
|
.It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /tinc-down
|
||||||
This script is started right before the tinc daemon quits.
|
This script is started right before the tinc daemon quits.
|
||||||
|
|
||||||
.It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /hosts/ Ns Ar HOST Ns Pa -up
|
.It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /hosts/ Ns Ar HOST Ns Pa -up
|
||||||
This script is started when the tinc daemon with name
|
This script is started when the tinc daemon with name
|
||||||
.Ar HOST
|
.Ar HOST
|
||||||
becomes reachable.
|
becomes reachable.
|
||||||
|
|
||||||
.It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /hosts/ Ns Ar HOST Ns Pa -down
|
.It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /hosts/ Ns Ar HOST Ns Pa -down
|
||||||
This script is started when the tinc daemon with name
|
This script is started when the tinc daemon with name
|
||||||
.Ar HOST
|
.Ar HOST
|
||||||
becomes unreachable.
|
becomes unreachable.
|
||||||
|
|
||||||
.It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /host-up
|
.It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /host-up
|
||||||
This script is started when any host becomes reachable.
|
This script is started when any host becomes reachable.
|
||||||
|
|
||||||
.It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /host-down
|
.It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /host-down
|
||||||
This script is started when any host becomes unreachable.
|
This script is started when any host becomes unreachable.
|
||||||
|
|
||||||
.It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /subnet-up
|
.It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /subnet-up
|
||||||
This script is started when a Subnet becomes reachable.
|
This script is started when a Subnet becomes reachable.
|
||||||
The Subnet and the node it belongs to are passed in environment variables.
|
The Subnet and the node it belongs to are passed in environment variables.
|
||||||
|
|
||||||
.It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /subnet-down
|
.It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /subnet-down
|
||||||
This script is started when a Subnet becomes unreachable.
|
This script is started when a Subnet becomes unreachable.
|
||||||
.El
|
.El
|
||||||
|
|
||||||
.Pp
|
.Pp
|
||||||
The scripts are started without command line arguments, but can make use of certain environment variables.
|
The scripts are started without command line arguments, but can make use of certain environment variables.
|
||||||
Under UNIX like operating systems the names of environment variables must be preceded by a
|
Under UNIX like operating systems the names of environment variables must be preceded by a
|
||||||
|
|
@ -609,56 +706,68 @@ files, they have to be put between
|
||||||
.Li %
|
.Li %
|
||||||
signs.
|
signs.
|
||||||
.Bl -tag -width indent
|
.Bl -tag -width indent
|
||||||
|
|
||||||
.It Ev NETNAME
|
.It Ev NETNAME
|
||||||
If a netname was specified, this environment variable contains it.
|
If a netname was specified, this environment variable contains it.
|
||||||
|
|
||||||
.It Ev NAME
|
.It Ev NAME
|
||||||
Contains the name of this tinc daemon.
|
Contains the name of this tinc daemon.
|
||||||
|
|
||||||
.It Ev DEVICE
|
.It Ev DEVICE
|
||||||
Contains the name of the virtual network device that tinc uses.
|
Contains the name of the virtual network device that tinc uses.
|
||||||
|
|
||||||
.It Ev INTERFACE
|
.It Ev INTERFACE
|
||||||
Contains the name of the virtual network interface that tinc uses.
|
Contains the name of the virtual network interface that tinc uses.
|
||||||
This should be used for commands like
|
This should be used for commands like
|
||||||
.Pa ifconfig .
|
.Pa ifconfig .
|
||||||
|
|
||||||
.It Ev NODE
|
.It Ev NODE
|
||||||
When a host becomes (un)reachable, this is set to its name.
|
When a host becomes (un)reachable, this is set to its name.
|
||||||
If a subnet becomes (un)reachable, this is set to the owner of that subnet.
|
If a subnet becomes (un)reachable, this is set to the owner of that subnet.
|
||||||
|
|
||||||
.It Ev REMOTEADDRESS
|
.It Ev REMOTEADDRESS
|
||||||
When a host becomes (un)reachable, this is set to its real address.
|
When a host becomes (un)reachable, this is set to its real address.
|
||||||
|
|
||||||
.It Ev REMOTEPORT
|
.It Ev REMOTEPORT
|
||||||
When a host becomes (un)reachable, this is set to the port number it uses for communication with other tinc daemons.
|
When a host becomes (un)reachable, this is set to the port number it uses for communication with other tinc daemons.
|
||||||
|
|
||||||
.It Ev SUBNET
|
.It Ev SUBNET
|
||||||
When a subnet becomes (un)reachable, this is set to the subnet.
|
When a subnet becomes (un)reachable, this is set to the subnet.
|
||||||
|
|
||||||
.It Ev WEIGHT
|
.It Ev WEIGHT
|
||||||
When a subnet becomes (un)reachable, this is set to the subnet weight.
|
When a subnet becomes (un)reachable, this is set to the subnet weight.
|
||||||
.El
|
.El
|
||||||
.Pp
|
|
||||||
Do not forget that under UNIX operating systems, you have to make the scripts executable, using the command
|
|
||||||
.Nm chmod Li a+x Pa script .
|
|
||||||
.Sh FILES
|
.Sh FILES
|
||||||
The most important files are:
|
The most important files are:
|
||||||
.Bl -tag -width indent
|
.Bl -tag -width indent
|
||||||
|
|
||||||
.It Pa @sysconfdir@/tinc/
|
.It Pa @sysconfdir@/tinc/
|
||||||
The top directory for configuration files.
|
The top directory for configuration files.
|
||||||
|
|
||||||
.It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /tinc.conf
|
.It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /tinc.conf
|
||||||
The default name of the server configuration file for net
|
The default name of the server configuration file for net
|
||||||
.Ar NETNAME .
|
.Ar NETNAME .
|
||||||
.It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /conf.d/
|
|
||||||
Optional directory from which any *.conf file will be loaded
|
|
||||||
.It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /hosts/
|
.It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /hosts/
|
||||||
Host configuration files are kept in this directory.
|
Host configuration files are kept in this directory.
|
||||||
|
|
||||||
.It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /tinc-up
|
.It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /tinc-up
|
||||||
If an executable file with this name exists,
|
If an executable file with this name exists,
|
||||||
it will be executed right after the tinc daemon has connected to the virtual network device.
|
it will be executed right after the tinc daemon has connected to the virtual network device.
|
||||||
It can be used to set up the corresponding network interface.
|
It can be used to set up the corresponding network interface.
|
||||||
|
|
||||||
.It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /tinc-down
|
.It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /tinc-down
|
||||||
If an executable file with this name exists,
|
If an executable file with this name exists,
|
||||||
it will be executed right before the tinc daemon is going to close
|
it will be executed right before the tinc daemon is going to close
|
||||||
its connection to the virtual network device.
|
its connection to the virtual network device.
|
||||||
.El
|
.El
|
||||||
|
|
||||||
.Sh SEE ALSO
|
.Sh SEE ALSO
|
||||||
.Xr tincd 8 ,
|
.Xr tincd 8 ,
|
||||||
.Pa https://www.tinc-vpn.org/ ,
|
.Pa http://www.tinc-vpn.org/ ,
|
||||||
.Pa http://www.tldp.org/LDP/nag2/ .
|
.Pa http://www.linuxdoc.org/LDP/nag2/ .
|
||||||
|
|
||||||
.Pp
|
.Pp
|
||||||
The full documentation for
|
The full documentation for
|
||||||
.Nm tinc
|
.Nm tinc
|
||||||
|
|
@ -666,6 +775,7 @@ is maintained as a Texinfo manual.
|
||||||
If the info and tinc programs are properly installed at your site, the command
|
If the info and tinc programs are properly installed at your site, the command
|
||||||
.Ic info tinc
|
.Ic info tinc
|
||||||
should give you access to the complete manual.
|
should give you access to the complete manual.
|
||||||
|
|
||||||
.Pp
|
.Pp
|
||||||
.Nm tinc
|
.Nm tinc
|
||||||
comes with ABSOLUTELY NO WARRANTY.
|
comes with ABSOLUTELY NO WARRANTY.
|
||||||
|
|
|
||||||
1528
doc/tinc.info
1528
doc/tinc.info
File diff suppressed because it is too large
Load diff
356
doc/tinc.texi
356
doc/tinc.texi
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
This is the info manual for @value{PACKAGE} version @value{VERSION}, a Virtual Private Network daemon.
|
This is the info manual for @value{PACKAGE} version @value{VERSION}, a Virtual Private Network daemon.
|
||||||
|
|
||||||
Copyright @copyright{} 1998-2019 Ivo Timmermans,
|
Copyright @copyright{} 1998-2012 Ivo Timmermans,
|
||||||
Guus Sliepen <guus@@tinc-vpn.org> and
|
Guus Sliepen <guus@@tinc-vpn.org> and
|
||||||
Wessel Dankers <wsl@@tinc-vpn.org>.
|
Wessel Dankers <wsl@@tinc-vpn.org>.
|
||||||
|
|
||||||
|
|
@ -39,7 +39,7 @@ permission notice identical to this one.
|
||||||
@vskip 0pt plus 1filll
|
@vskip 0pt plus 1filll
|
||||||
This is the info manual for @value{PACKAGE} version @value{VERSION}, a Virtual Private Network daemon.
|
This is the info manual for @value{PACKAGE} version @value{VERSION}, a Virtual Private Network daemon.
|
||||||
|
|
||||||
Copyright @copyright{} 1998-2019 Ivo Timmermans,
|
Copyright @copyright{} 1998-2012 Ivo Timmermans,
|
||||||
Guus Sliepen <guus@@tinc-vpn.org> and
|
Guus Sliepen <guus@@tinc-vpn.org> and
|
||||||
Wessel Dankers <wsl@@tinc-vpn.org>.
|
Wessel Dankers <wsl@@tinc-vpn.org>.
|
||||||
|
|
||||||
|
|
@ -155,7 +155,7 @@ professional package.
|
||||||
|
|
||||||
@cindex traditional VPNs
|
@cindex traditional VPNs
|
||||||
@cindex scalability
|
@cindex scalability
|
||||||
Tinc also allows more than two sites to connect to each other and form a single VPN.
|
Tinc also allows more than two sites to connect to eachother and form a single VPN.
|
||||||
Traditionally VPNs are created by making tunnels, which only have two endpoints.
|
Traditionally VPNs are created by making tunnels, which only have two endpoints.
|
||||||
Larger VPNs with more sites are created by adding more tunnels.
|
Larger VPNs with more sites are created by adding more tunnels.
|
||||||
Tinc takes another approach: only endpoints are specified,
|
Tinc takes another approach: only endpoints are specified,
|
||||||
|
|
@ -176,7 +176,7 @@ available too.
|
||||||
@section Supported platforms
|
@section Supported platforms
|
||||||
|
|
||||||
@cindex platforms
|
@cindex platforms
|
||||||
Tinc has been verified to work under Linux, FreeBSD, OpenBSD, NetBSD, Mac OS X (Darwin), Solaris, and Windows (both natively and in a Cygwin environment),
|
Tinc has been verified to work under Linux, FreeBSD, OpenBSD, NetBSD, MacOS/X (Darwin), Solaris, and Windows (both natively and in a Cygwin environment),
|
||||||
with various hardware architectures. These are some of the platforms
|
with various hardware architectures. These are some of the platforms
|
||||||
that are supported by the universal tun/tap device driver or other virtual network device drivers.
|
that are supported by the universal tun/tap device driver or other virtual network device drivers.
|
||||||
Without such a driver, tinc will most
|
Without such a driver, tinc will most
|
||||||
|
|
@ -186,7 +186,7 @@ packets.
|
||||||
@cindex release
|
@cindex release
|
||||||
For an up to date list of supported platforms, please check the list on
|
For an up to date list of supported platforms, please check the list on
|
||||||
our website:
|
our website:
|
||||||
@uref{https://www.tinc-vpn.org/platforms/}.
|
@uref{http://www.tinc-vpn.org/platforms}.
|
||||||
|
|
||||||
@c
|
@c
|
||||||
@c
|
@c
|
||||||
|
|
@ -224,7 +224,7 @@ support tinc.
|
||||||
* Configuration of OpenBSD kernels::
|
* Configuration of OpenBSD kernels::
|
||||||
* Configuration of NetBSD kernels::
|
* Configuration of NetBSD kernels::
|
||||||
* Configuration of Solaris kernels::
|
* Configuration of Solaris kernels::
|
||||||
* Configuration of Darwin (Mac OS X) kernels::
|
* Configuration of Darwin (MacOS/X) kernels::
|
||||||
* Configuration of Windows::
|
* Configuration of Windows::
|
||||||
@end menu
|
@end menu
|
||||||
|
|
||||||
|
|
@ -261,15 +261,19 @@ alias char-major-10-200 tun
|
||||||
@subsection Configuration of FreeBSD kernels
|
@subsection Configuration of FreeBSD kernels
|
||||||
|
|
||||||
For FreeBSD version 4.1 and higher, tun and tap drivers are included in the default kernel configuration.
|
For FreeBSD version 4.1 and higher, tun and tap drivers are included in the default kernel configuration.
|
||||||
The tap driver can be loaded with @code{kldload if_tap}, or by adding @code{if_tap_load="YES"} to @file{/boot/loader.conf}.
|
Using tap devices is recommended.
|
||||||
|
|
||||||
|
|
||||||
@c ==================================================================
|
@c ==================================================================
|
||||||
@node Configuration of OpenBSD kernels
|
@node Configuration of OpenBSD kernels
|
||||||
@subsection Configuration of OpenBSD kernels
|
@subsection Configuration of OpenBSD kernels
|
||||||
|
|
||||||
Recent versions of OpenBSD come with both tun and tap devices enabled in the default kernel configuration.
|
For OpenBSD version 2.9 and higher,
|
||||||
|
the tun driver is included in the default kernel configuration.
|
||||||
|
There is also a kernel patch from @uref{http://diehard.n-r-g.com/stuff/openbsd/}
|
||||||
|
which adds a tap device to OpenBSD which should work with tinc,
|
||||||
|
but with recent versions of OpenBSD,
|
||||||
|
a tun device can act as a tap device by setting the link0 option with ifconfig.
|
||||||
|
|
||||||
@c ==================================================================
|
@c ==================================================================
|
||||||
@node Configuration of NetBSD kernels
|
@node Configuration of NetBSD kernels
|
||||||
|
|
@ -288,23 +292,24 @@ Tunneling IPv6 may not work on NetBSD's tun device.
|
||||||
For Solaris 8 (SunOS 5.8) and higher,
|
For Solaris 8 (SunOS 5.8) and higher,
|
||||||
the tun driver may or may not be included in the default kernel configuration.
|
the tun driver may or may not be included in the default kernel configuration.
|
||||||
If it isn't, the source can be downloaded from @uref{http://vtun.sourceforge.net/tun/}.
|
If it isn't, the source can be downloaded from @uref{http://vtun.sourceforge.net/tun/}.
|
||||||
For x86 and sparc64 architectures, precompiled versions can be found at @uref{https://www.monkey.org/~dugsong/fragroute/}.
|
For x86 and sparc64 architectures, precompiled versions can be found at @uref{http://www.monkey.org/~dugsong/fragroute/}.
|
||||||
If the @file{net/if_tun.h} header file is missing, install it from the source package.
|
If the @file{net/if_tun.h} header file is missing, install it from the source package.
|
||||||
|
|
||||||
|
|
||||||
@c ==================================================================
|
@c ==================================================================
|
||||||
@node Configuration of Darwin (Mac OS X) kernels
|
@node Configuration of Darwin (MacOS/X) kernels
|
||||||
@subsection Configuration of Darwin (Mac OS X) kernels
|
@subsection Configuration of Darwin (MacOS/X) kernels
|
||||||
|
|
||||||
Tinc on Darwin relies on a tunnel driver for its data acquisition from the kernel.
|
Tinc on Darwin relies on a tunnel driver for its data acquisition from the kernel.
|
||||||
OS X version 10.6.8 and later have a built-in tun driver called "utun".
|
Tinc supports either the driver from @uref{http://tuntaposx.sourceforge.net/},
|
||||||
Tinc also supports the driver from @uref{http://tuntaposx.sourceforge.net/},
|
which supports both tun and tap style devices,
|
||||||
which supports both tun and tap style devices.
|
and also the driver from from @uref{http://chrisp.de/en/projects/tunnel.html}.
|
||||||
|
The former driver is recommended.
|
||||||
|
The tunnel driver must be loaded before starting tinc with the following command:
|
||||||
|
|
||||||
By default, tinc expects the tuntaposx driver to be installed.
|
@example
|
||||||
To use the utun driver, set add @code{Device = utunX} to @file{tinc.conf},
|
kmodload tunnel
|
||||||
where X is the desired number for the utun interface.
|
@end example
|
||||||
You can also omit the number, in which case the first free number will be chosen.
|
|
||||||
|
|
||||||
|
|
||||||
@c ==================================================================
|
@c ==================================================================
|
||||||
|
|
@ -312,7 +317,7 @@ You can also omit the number, in which case the first free number will be chosen
|
||||||
@subsection Configuration of Windows
|
@subsection Configuration of Windows
|
||||||
|
|
||||||
You will need to install the latest TAP-Win32 driver from OpenVPN.
|
You will need to install the latest TAP-Win32 driver from OpenVPN.
|
||||||
You can download it from @uref{https://openvpn.net/index.php/open-source/downloads.html}.
|
You can download it from @uref{http://openvpn.sourceforge.net}.
|
||||||
Using the Network Connections control panel,
|
Using the Network Connections control panel,
|
||||||
configure the TAP-Win32 network interface in the same way as you would do from the tinc-up script,
|
configure the TAP-Win32 network interface in the same way as you would do from the tinc-up script,
|
||||||
as explained in the rest of the documentation.
|
as explained in the rest of the documentation.
|
||||||
|
|
@ -324,51 +329,48 @@ as explained in the rest of the documentation.
|
||||||
|
|
||||||
@cindex requirements
|
@cindex requirements
|
||||||
@cindex libraries
|
@cindex libraries
|
||||||
Before you can configure or build tinc, you need to have the LibreSSL or OpenSSL,
|
Before you can configure or build tinc, you need to have the OpenSSL,
|
||||||
zlib and lzo libraries installed on your system. If you try to configure tinc without
|
zlib and lzo libraries installed on your system. If you try to configure tinc without
|
||||||
having them installed, configure will give you an error message, and stop.
|
having them installed, configure will give you an error message, and stop.
|
||||||
|
|
||||||
@menu
|
@menu
|
||||||
* LibreSSL/OpenSSL::
|
* OpenSSL::
|
||||||
* zlib::
|
* zlib::
|
||||||
* lzo::
|
* lzo::
|
||||||
@end menu
|
@end menu
|
||||||
|
|
||||||
|
|
||||||
@c ==================================================================
|
@c ==================================================================
|
||||||
@node LibreSSL/OpenSSL
|
@node OpenSSL
|
||||||
@subsection LibreSSL/OpenSSL
|
@subsection OpenSSL
|
||||||
|
|
||||||
@cindex LibreSSL
|
|
||||||
@cindex OpenSSL
|
@cindex OpenSSL
|
||||||
For all cryptography-related functions, tinc uses the functions provided
|
For all cryptography-related functions, tinc uses the functions provided
|
||||||
by the LibreSSL or the OpenSSL library.
|
by the OpenSSL library.
|
||||||
|
|
||||||
If this library is not installed, you will get an error when configuring
|
If this library is not installed, you wil get an error when configuring
|
||||||
tinc for build. Support for running tinc with other cryptographic libraries
|
tinc for build. Support for running tinc without having OpenSSL
|
||||||
installed @emph{may} be added in the future.
|
installed @emph{may} be added in the future.
|
||||||
|
|
||||||
You can use your operating system's package manager to install this if
|
You can use your operating system's package manager to install this if
|
||||||
available. Make sure you install the development AND runtime versions
|
available. Make sure you install the development AND runtime versions
|
||||||
of this package.
|
of this package.
|
||||||
|
|
||||||
If your operating system comes neither with LibreSSL or OpenSSL, you have to
|
If you have to install OpenSSL manually, you can get the source code
|
||||||
install one manually. It is recommended that you get the latest version of
|
from @url{http://www.openssl.org/}. Instructions on how to configure,
|
||||||
LibreSSL from @url{http://www.libressl.org/}. Instructions on how to
|
build and install this package are included within the package. Please
|
||||||
configure, build and install this package are included within the package.
|
make sure you build development and runtime libraries (which is the
|
||||||
Please make sure you build development and runtime libraries (which is the
|
|
||||||
default).
|
default).
|
||||||
|
|
||||||
If you installed the LibreSSL or OpenSSL libraries from source, it may be necessary
|
If you installed the OpenSSL libraries from source, it may be necessary
|
||||||
to let configure know where they are, by passing configure one of the
|
to let configure know where they are, by passing configure one of the
|
||||||
--with-openssl-* parameters. Note that you even have to use --with-openssl-* if you
|
--with-openssl-* parameters.
|
||||||
are using LibreSSL.
|
|
||||||
|
|
||||||
@example
|
@example
|
||||||
--with-openssl=DIR LibreSSL/OpenSSL library and headers prefix
|
--with-openssl=DIR OpenSSL library and headers prefix
|
||||||
--with-openssl-include=DIR LibreSSL/OpenSSL headers directory
|
--with-openssl-include=DIR OpenSSL headers directory
|
||||||
(Default is OPENSSL_DIR/include)
|
(Default is OPENSSL_DIR/include)
|
||||||
--with-openssl-lib=DIR LibreSSL/OpenSSL library directory
|
--with-openssl-lib=DIR OpenSSL library directory
|
||||||
(Default is OPENSSL_DIR/lib)
|
(Default is OPENSSL_DIR/lib)
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
|
|
@ -379,7 +381,7 @@ are using LibreSSL.
|
||||||
The complete source code of tinc is covered by the GNU GPL version 2.
|
The complete source code of tinc is covered by the GNU GPL version 2.
|
||||||
Since the license under which OpenSSL is distributed is not directly
|
Since the license under which OpenSSL is distributed is not directly
|
||||||
compatible with the terms of the GNU GPL
|
compatible with the terms of the GNU GPL
|
||||||
@uref{https://www.openssl.org/support/faq.html#LEGAL2}, we
|
@uref{http://www.openssl.org/support/faq.html#LEGAL2}, we
|
||||||
include an exemption to the GPL (see also the file COPYING.README) to allow
|
include an exemption to the GPL (see also the file COPYING.README) to allow
|
||||||
everyone to create a statically or dynamically linked executable:
|
everyone to create a statically or dynamically linked executable:
|
||||||
|
|
||||||
|
|
@ -395,8 +397,8 @@ we also present the following exemption:
|
||||||
|
|
||||||
@quotation
|
@quotation
|
||||||
Hereby I grant a special exception to the tinc VPN project
|
Hereby I grant a special exception to the tinc VPN project
|
||||||
(https://www.tinc-vpn.org/) to link the LZO library with the OpenSSL library
|
(http://www.tinc-vpn.org/) to link the LZO library with the OpenSSL library
|
||||||
(https://www.openssl.org).
|
(http://www.openssl.org).
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer
|
Markus F.X.J. Oberhumer
|
||||||
@end quotation
|
@end quotation
|
||||||
|
|
@ -410,18 +412,16 @@ Markus F.X.J. Oberhumer
|
||||||
For the optional compression of UDP packets, tinc uses the functions provided
|
For the optional compression of UDP packets, tinc uses the functions provided
|
||||||
by the zlib library.
|
by the zlib library.
|
||||||
|
|
||||||
If this library is not installed, you will get an error when running the
|
If this library is not installed, you wil get an error when configuring
|
||||||
configure script. You can either install the zlib library, or disable support
|
tinc for build. Support for running tinc without having zlib
|
||||||
for zlib compression by using the "--disable-zlib" option when running the
|
installed @emph{may} be added in the future.
|
||||||
configure script. Note that if you disable support for zlib, the resulting
|
|
||||||
binary will not work correctly on VPNs where zlib compression is used.
|
|
||||||
|
|
||||||
You can use your operating system's package manager to install this if
|
You can use your operating system's package manager to install this if
|
||||||
available. Make sure you install the development AND runtime versions
|
available. Make sure you install the development AND runtime versions
|
||||||
of this package.
|
of this package.
|
||||||
|
|
||||||
If you have to install zlib manually, you can get the source code
|
If you have to install zlib manually, you can get the source code
|
||||||
from @url{https://zlib.net/}. Instructions on how to configure,
|
from @url{http://www.gzip.org/zlib/}. Instructions on how to configure,
|
||||||
build and install this package are included within the package. Please
|
build and install this package are included within the package. Please
|
||||||
make sure you build development and runtime libraries (which is the
|
make sure you build development and runtime libraries (which is the
|
||||||
default).
|
default).
|
||||||
|
|
@ -432,20 +432,18 @@ default).
|
||||||
@subsection lzo
|
@subsection lzo
|
||||||
|
|
||||||
@cindex lzo
|
@cindex lzo
|
||||||
Another form of compression is offered using the LZO library.
|
Another form of compression is offered using the lzo library.
|
||||||
|
|
||||||
If this library is not installed, you will get an error when running the
|
If this library is not installed, you wil get an error when configuring
|
||||||
configure script. You can either install the LZO library, or disable support
|
tinc for build. Support for running tinc without having lzo
|
||||||
for LZO compression by using the "--disable-lzo" option when running the
|
installed @emph{may} be added in the future.
|
||||||
configure script. Note that if you disable support for LZO, the resulting
|
|
||||||
binary will not work correctly on VPNs where LZO compression is used.
|
|
||||||
|
|
||||||
You can use your operating system's package manager to install this if
|
You can use your operating system's package manager to install this if
|
||||||
available. Make sure you install the development AND runtime versions
|
available. Make sure you install the development AND runtime versions
|
||||||
of this package.
|
of this package.
|
||||||
|
|
||||||
If you have to install lzo manually, you can get the source code
|
If you have to install lzo manually, you can get the source code
|
||||||
from @url{https://www.oberhumer.com/opensource/lzo/}. Instructions on how to configure,
|
from @url{http://www.oberhumer.com/opensource/lzo/}. Instructions on how to configure,
|
||||||
build and install this package are included within the package. Please
|
build and install this package are included within the package. Please
|
||||||
make sure you build development and runtime libraries (which is the
|
make sure you build development and runtime libraries (which is the
|
||||||
default).
|
default).
|
||||||
|
|
@ -471,7 +469,9 @@ system startup scripts and sample configurations.
|
||||||
If you cannot use one of the precompiled packages, or you want to compile tinc
|
If you cannot use one of the precompiled packages, or you want to compile tinc
|
||||||
for yourself, you can use the source. The source is distributed under
|
for yourself, you can use the source. The source is distributed under
|
||||||
the GNU General Public License (GPL). Download the source from the
|
the GNU General Public License (GPL). Download the source from the
|
||||||
@uref{https://www.tinc-vpn.org/download/, download page}.
|
@uref{http://www.tinc-vpn.org/download, download page}, which has
|
||||||
|
the checksums of these files listed; you may wish to check these with
|
||||||
|
md5sum before continuing.
|
||||||
|
|
||||||
Tinc comes in a convenient autoconf/automake package, which you can just
|
Tinc comes in a convenient autoconf/automake package, which you can just
|
||||||
treat the same as any other package. Which is just untar it, type
|
treat the same as any other package. Which is just untar it, type
|
||||||
|
|
@ -498,28 +498,29 @@ you can use the package management tools of that distribution to install tinc.
|
||||||
The documentation that comes along with your distribution will tell you how to do that.
|
The documentation that comes along with your distribution will tell you how to do that.
|
||||||
|
|
||||||
@menu
|
@menu
|
||||||
* Darwin (Mac OS X) build environment::
|
* Darwin (MacOS/X) build environment::
|
||||||
* Cygwin (Windows) build environment::
|
* Cygwin (Windows) build environment::
|
||||||
* MinGW (Windows) build environment::
|
* MinGW (Windows) build environment::
|
||||||
@end menu
|
@end menu
|
||||||
|
|
||||||
|
|
||||||
@c ==================================================================
|
@c ==================================================================
|
||||||
@node Darwin (Mac OS X) build environment
|
@node Darwin (MacOS/X) build environment
|
||||||
@subsection Darwin (Mac OS X) build environment
|
@subsection Darwin (MacOS/X) build environment
|
||||||
|
|
||||||
In order to build tinc on Darwin, you need to install Xcode from @uref{https://developer.apple.com/xcode/}.
|
In order to build tinc on Darwin, you need to install the MacOS/X Developer Tools
|
||||||
It might also help to install a recent version of Fink from @uref{http://www.finkproject.org/}.
|
from @uref{http://developer.apple.com/tools/macosxtools.html} and
|
||||||
|
a recent version of Fink from @uref{http://fink.sourceforge.net/}.
|
||||||
|
|
||||||
You need to download and install LibreSSL (or OpenSSL) and LZO,
|
After installation use fink to download and install the following packages:
|
||||||
either directly from their websites (see @ref{Libraries}) or using Fink.
|
autoconf25, automake, dlcompat, m4, openssl, zlib and lzo.
|
||||||
|
|
||||||
@c ==================================================================
|
@c ==================================================================
|
||||||
@node Cygwin (Windows) build environment
|
@node Cygwin (Windows) build environment
|
||||||
@subsection Cygwin (Windows) build environment
|
@subsection Cygwin (Windows) build environment
|
||||||
|
|
||||||
If Cygwin hasn't already been installed, install it directly from
|
If Cygwin hasn't already been installed, install it directly from
|
||||||
@uref{https://www.cygwin.com/}.
|
@uref{http://www.cygwin.com/}.
|
||||||
|
|
||||||
When tinc is compiled in a Cygwin environment, it can only be run in this environment,
|
When tinc is compiled in a Cygwin environment, it can only be run in this environment,
|
||||||
but all programs, including those started outside the Cygwin environment, will be able to use the VPN.
|
but all programs, including those started outside the Cygwin environment, will be able to use the VPN.
|
||||||
|
|
@ -530,7 +531,6 @@ It will also support all features.
|
||||||
@subsection MinGW (Windows) build environment
|
@subsection MinGW (Windows) build environment
|
||||||
|
|
||||||
You will need to install the MinGW environment from @uref{http://www.mingw.org}.
|
You will need to install the MinGW environment from @uref{http://www.mingw.org}.
|
||||||
You also need to download and install LibreSSL (or OpenSSL) and LZO.
|
|
||||||
|
|
||||||
When tinc is compiled using MinGW it runs natively under Windows,
|
When tinc is compiled using MinGW it runs natively under Windows,
|
||||||
it is not necessary to keep MinGW installed.
|
it is not necessary to keep MinGW installed.
|
||||||
|
|
@ -638,7 +638,7 @@ you will not find the answers in this documentation.
|
||||||
Make sure you have an adequate understanding of networks in general.
|
Make sure you have an adequate understanding of networks in general.
|
||||||
@cindex Network Administrators Guide
|
@cindex Network Administrators Guide
|
||||||
A good resource on networking is the
|
A good resource on networking is the
|
||||||
@uref{http://www.tldp.org/LDP/nag2/, Linux Network Administrators Guide}.
|
@uref{http://www.linuxdoc.org/LDP/nag2/, Linux Network Administrators Guide}.
|
||||||
|
|
||||||
If you have everything clearly pictured in your mind,
|
If you have everything clearly pictured in your mind,
|
||||||
proceed in the following order:
|
proceed in the following order:
|
||||||
|
|
@ -661,7 +661,7 @@ It is not required if you only run one tinc daemon,
|
||||||
it doesn't even have to be the same on all the sites of your VPN,
|
it doesn't even have to be the same on all the sites of your VPN,
|
||||||
but it is recommended that you choose one anyway.
|
but it is recommended that you choose one anyway.
|
||||||
|
|
||||||
We will assume you use a netname throughout this document.
|
We will asume you use a netname throughout this document.
|
||||||
This means that you call tincd with the -n argument,
|
This means that you call tincd with the -n argument,
|
||||||
which will assign a netname to this daemon.
|
which will assign a netname to this daemon.
|
||||||
|
|
||||||
|
|
@ -689,7 +689,7 @@ reads in the configuration file tinc.conf.
|
||||||
If it sees one or more `ConnectTo' values pointing to other tinc daemons in that file,
|
If it sees one or more `ConnectTo' values pointing to other tinc daemons in that file,
|
||||||
it will try to connect to those other daemons.
|
it will try to connect to those other daemons.
|
||||||
Whether this succeeds or not and whether `ConnectTo' is specified or not,
|
Whether this succeeds or not and whether `ConnectTo' is specified or not,
|
||||||
tinc will listen for incoming connection from other daemons.
|
tinc will listen for incoming connection from other deamons.
|
||||||
If you did specify a `ConnectTo' value and the other side is not responding,
|
If you did specify a `ConnectTo' value and the other side is not responding,
|
||||||
tinc will keep retrying.
|
tinc will keep retrying.
|
||||||
This means that once started, tinc will stay running until you tell it to stop,
|
This means that once started, tinc will stay running until you tell it to stop,
|
||||||
|
|
@ -713,9 +713,6 @@ The actual configuration of the daemon is done in the file
|
||||||
@file{@value{sysconfdir}/tinc/@var{netname}/tinc.conf} and at least one other file in the directory
|
@file{@value{sysconfdir}/tinc/@var{netname}/tinc.conf} and at least one other file in the directory
|
||||||
@file{@value{sysconfdir}/tinc/@var{netname}/hosts/}.
|
@file{@value{sysconfdir}/tinc/@var{netname}/hosts/}.
|
||||||
|
|
||||||
An optional directory @file{@value{sysconfdir}/tinc/@var{netname}/conf.d} can be added from which
|
|
||||||
any .conf file will be read.
|
|
||||||
|
|
||||||
These file consists of comments (lines started with a #) or assignments
|
These file consists of comments (lines started with a #) or assignments
|
||||||
in the form of
|
in the form of
|
||||||
|
|
||||||
|
|
@ -824,6 +821,7 @@ Do not use this option if you use switch mode and want to use IPv6.
|
||||||
@item Device = <@var{device}> (@file{/dev/tap0}, @file{/dev/net/tun} or other depending on platform)
|
@item Device = <@var{device}> (@file{/dev/tap0}, @file{/dev/net/tun} or other depending on platform)
|
||||||
The virtual network device to use.
|
The virtual network device to use.
|
||||||
Tinc will automatically detect what kind of device it is.
|
Tinc will automatically detect what kind of device it is.
|
||||||
|
Note that you can only use one device per daemon.
|
||||||
Under Windows, use @var{Interface} instead of @var{Device}.
|
Under Windows, use @var{Interface} instead of @var{Device}.
|
||||||
Note that you can only use one device per daemon.
|
Note that you can only use one device per daemon.
|
||||||
See also @ref{Device files}.
|
See also @ref{Device files}.
|
||||||
|
|
@ -860,7 +858,7 @@ Also note that this can cause decrypted VPN packets to be sent out on a real net
|
||||||
@cindex UML
|
@cindex UML
|
||||||
@item uml (not compiled in by default)
|
@item uml (not compiled in by default)
|
||||||
Create a UNIX socket with the filename specified by
|
Create a UNIX socket with the filename specified by
|
||||||
@var{Device}, or @file{@value{runstatedir}/@var{netname}.umlsocket}
|
@var{Device}, or @file{@value{localstatedir}/run/@var{netname}.umlsocket}
|
||||||
if not specified.
|
if not specified.
|
||||||
Tinc will wait for a User Mode Linux instance to connect to this socket.
|
Tinc will wait for a User Mode Linux instance to connect to this socket.
|
||||||
|
|
||||||
|
|
@ -868,7 +866,7 @@ Tinc will wait for a User Mode Linux instance to connect to this socket.
|
||||||
@item vde (not compiled in by default)
|
@item vde (not compiled in by default)
|
||||||
Uses the libvdeplug library to connect to a Virtual Distributed Ethernet switch,
|
Uses the libvdeplug library to connect to a Virtual Distributed Ethernet switch,
|
||||||
using the UNIX socket specified by
|
using the UNIX socket specified by
|
||||||
@var{Device}, or @file{@value{runstatedir}/vde.ctl}
|
@var{Device}, or @file{@value{localstatedir}/run/vde.ctl}
|
||||||
if not specified.
|
if not specified.
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
|
|
@ -894,12 +892,6 @@ to start with a four byte header containing the address family,
|
||||||
followed by an IP header.
|
followed by an IP header.
|
||||||
This mode should support both IPv4 and IPv6 packets.
|
This mode should support both IPv4 and IPv6 packets.
|
||||||
|
|
||||||
@cindex utun
|
|
||||||
@item utun (OS X)
|
|
||||||
Set type to utun.
|
|
||||||
This is only supported on OS X version 10.6.8 and higher, but doesn't require the tuntaposx module.
|
|
||||||
This mode should support both IPv4 and IPv6 packets.
|
|
||||||
|
|
||||||
@item tap (BSD and Linux)
|
@item tap (BSD and Linux)
|
||||||
Set type to tap.
|
Set type to tap.
|
||||||
Tinc will expect packets read from the virtual network device
|
Tinc will expect packets read from the virtual network device
|
||||||
|
|
@ -947,15 +939,11 @@ that is executed, the graph is then sent to stdin.
|
||||||
@item Hostnames = <yes|no> (no)
|
@item Hostnames = <yes|no> (no)
|
||||||
This option selects whether IP addresses (both real and on the VPN)
|
This option selects whether IP addresses (both real and on the VPN)
|
||||||
should be resolved. Since DNS lookups are blocking, it might affect
|
should be resolved. Since DNS lookups are blocking, it might affect
|
||||||
tinc's efficiency, even stopping the daemon for a few seconds every time
|
tinc's efficiency, even stopping the daemon for a few seconds everytime
|
||||||
it does a lookup if your DNS server is not responding.
|
it does a lookup if your DNS server is not responding.
|
||||||
|
|
||||||
This does not affect resolving hostnames to IP addresses from the
|
This does not affect resolving hostnames to IP addresses from the
|
||||||
configuration file, but whether hostnames should be resolved while logging.
|
configuration file.
|
||||||
|
|
||||||
@cindex IffOneQueue
|
|
||||||
@item IffOneQueue = <yes|no> (no) [experimental]
|
|
||||||
(Linux only) Set IFF_ONE_QUEUE flag on TUN/TAP devices.
|
|
||||||
|
|
||||||
@cindex Interface
|
@cindex Interface
|
||||||
@item Interface = <@var{interface}>
|
@item Interface = <@var{interface}>
|
||||||
|
|
@ -964,13 +952,6 @@ Depending on the operating system and the type of device this may or may not act
|
||||||
Under Windows, this variable is used to select which network interface will be used.
|
Under Windows, this variable is used to select which network interface will be used.
|
||||||
If you specified a Device, this variable is almost always already correctly set.
|
If you specified a Device, this variable is almost always already correctly set.
|
||||||
|
|
||||||
@cindex KeyExpire
|
|
||||||
@item KeyExpire = <@var{seconds}> (3600)
|
|
||||||
This option controls the time the encryption keys used to encrypt the data
|
|
||||||
are valid. It is common practice to change keys at regular intervals to
|
|
||||||
make it even harder for crackers, even though it is thought to be nearly
|
|
||||||
impossible to crack a single key.
|
|
||||||
|
|
||||||
@cindex LocalDiscovery
|
@cindex LocalDiscovery
|
||||||
@item LocalDiscovery = <yes | no> (no) [experimental]
|
@item LocalDiscovery = <yes | no> (no) [experimental]
|
||||||
When enabled, tinc will try to detect peers that are on the same local network.
|
When enabled, tinc will try to detect peers that are on the same local network.
|
||||||
|
|
@ -981,15 +962,6 @@ 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.
|
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.
|
This feature may not work in all possible situations.
|
||||||
|
|
||||||
@cindex MACExpire
|
|
||||||
@item MACExpire = <@var{seconds}> (600)
|
|
||||||
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 MaxTimeout
|
|
||||||
@item MaxTimeout = <@var{seconds}> (900)
|
|
||||||
This is the maximum delay before trying to reconnect to other tinc daemons.
|
|
||||||
|
|
||||||
@cindex Mode
|
@cindex Mode
|
||||||
@item Mode = <router|switch|hub> (router)
|
@item Mode = <router|switch|hub> (router)
|
||||||
This option selects the way packets are routed to other daemons.
|
This option selects the way packets are routed to other daemons.
|
||||||
|
|
@ -1019,15 +991,27 @@ every packet will be broadcast to the other daemons
|
||||||
while no routing table is managed.
|
while no routing table is managed.
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
|
@cindex KeyExpire
|
||||||
|
@item KeyExpire = <@var{seconds}> (3600)
|
||||||
|
This option controls the time the encryption keys used to encrypt the data
|
||||||
|
are valid. It is common practice to change keys at regular intervals to
|
||||||
|
make it even harder for crackers, even though it is thought to be nearly
|
||||||
|
impossible to crack a single key.
|
||||||
|
|
||||||
|
@cindex MACExpire
|
||||||
|
@item MACExpire = <@var{seconds}> (600)
|
||||||
|
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 Name
|
@cindex Name
|
||||||
@item Name = <@var{name}> [required]
|
@item Name = <@var{name}> [required]
|
||||||
This is a symbolic name for this connection.
|
This is a symbolic name for this connection.
|
||||||
The name must consist only of alphanumeric and underscore characters (a-z, A-Z, 0-9 and _).
|
The name should consist only of alfanumeric and underscore characters (a-z, A-Z, 0-9 and _).
|
||||||
|
|
||||||
If Name starts with a $, then the contents of the environment variable that follows will be used.
|
If Name starts with a $, then the contents of the environment variable that follows will be used.
|
||||||
In that case, invalid characters will be converted to underscores.
|
In that case, invalid characters will be converted to underscores.
|
||||||
If Name is $HOST, but no such environment variable exist,
|
If Name is $HOST, but no such environment variable exist,
|
||||||
the hostname will be read using the gethostname() system call.
|
the hostname will be read using the gethostnname() system call.
|
||||||
|
|
||||||
@cindex PingInterval
|
@cindex PingInterval
|
||||||
@item PingInterval = <@var{seconds}> (60)
|
@item PingInterval = <@var{seconds}> (60)
|
||||||
|
|
@ -1049,7 +1033,7 @@ will be inherited by the UDP packets that are sent out.
|
||||||
@item PrivateKey = <@var{key}> [obsolete]
|
@item PrivateKey = <@var{key}> [obsolete]
|
||||||
This is the RSA private key for tinc. However, for safety reasons it is
|
This is the RSA private key for tinc. However, for safety reasons it is
|
||||||
advised to store private keys of any kind in separate files. This prevents
|
advised to store private keys of any kind in separate files. This prevents
|
||||||
accidental eavesdropping if you are editing the configuration file.
|
accidental eavesdropping if you are editting the configuration file.
|
||||||
|
|
||||||
@cindex PrivateKeyFile
|
@cindex PrivateKeyFile
|
||||||
@item PrivateKeyFile = <@var{path}> (@file{@value{sysconfdir}/tinc/@var{netname}/rsa_key.priv})
|
@item PrivateKeyFile = <@var{path}> (@file{@value{sysconfdir}/tinc/@var{netname}/rsa_key.priv})
|
||||||
|
|
@ -1057,13 +1041,17 @@ This is the full path name of the RSA private key file that was
|
||||||
generated by @samp{tincd --generate-keys}. It must be a full path, not a
|
generated by @samp{tincd --generate-keys}. It must be a full path, not a
|
||||||
relative directory.
|
relative directory.
|
||||||
|
|
||||||
|
Note that there must be exactly one of PrivateKey
|
||||||
|
or PrivateKeyFile
|
||||||
|
specified in the configuration file.
|
||||||
|
|
||||||
@cindex ProcessPriority
|
@cindex ProcessPriority
|
||||||
@item ProcessPriority = <low|normal|high>
|
@item ProcessPriority = <low|normal|high>
|
||||||
When this option is used the priority of the tincd process will be adjusted.
|
When this option is used the priority of the tincd process will be adjusted.
|
||||||
Increasing the priority may help to reduce latency and packet loss on the VPN.
|
Increasing the priority may help to reduce latency and packet loss on the VPN.
|
||||||
|
|
||||||
@cindex Proxy
|
@cindex Proxy
|
||||||
@item Proxy = socks4 | socks5 | http | exec @var{...} [experimental]
|
@item Proxy = socks4 | socks4 | http | exec @var{...} [experimental]
|
||||||
Use a proxy when making outgoing connections.
|
Use a proxy when making outgoing connections.
|
||||||
The following proxy types are currently supported:
|
The following proxy types are currently supported:
|
||||||
|
|
||||||
|
|
@ -1074,7 +1062,7 @@ Connects to the proxy using the SOCKS version 4 protocol.
|
||||||
Optionally, a @var{username} can be supplied which will be passed on to the proxy server.
|
Optionally, a @var{username} can be supplied which will be passed on to the proxy server.
|
||||||
|
|
||||||
@cindex socks5
|
@cindex socks5
|
||||||
@item socks5 <@var{address}> <@var{port}> [<@var{username}> <@var{password}>]
|
@item socks4 <@var{address}> <@var{port}> [<@var{username}> <@var{password}>]
|
||||||
Connect to the proxy using the SOCKS version 5 protocol.
|
Connect to the proxy using the SOCKS version 5 protocol.
|
||||||
If a @var{username} and @var{password} are given, basic username/password authentication will be used,
|
If a @var{username} and @var{password} are given, basic username/password authentication will be used,
|
||||||
otherwise no authentication will be used.
|
otherwise no authentication will be used.
|
||||||
|
|
@ -1100,13 +1088,12 @@ reordering. Setting this to zero will disable replay tracking completely and
|
||||||
pass all traffic, but leaves tinc vulnerable to replay-based attacks on your
|
pass all traffic, but leaves tinc vulnerable to replay-based attacks on your
|
||||||
traffic.
|
traffic.
|
||||||
|
|
||||||
|
|
||||||
@cindex StrictSubnets
|
@cindex StrictSubnets
|
||||||
@item StrictSubnets = <yes|no> (no) [experimental]
|
@item StrictSubnets <yes|no> (no) [experimental]
|
||||||
When this option is enabled tinc will only use Subnet statements which are
|
When this option is enabled tinc will only use Subnet statements which are
|
||||||
present in the host config files in the local
|
present in the host config files in the local
|
||||||
@file{@value{sysconfdir}/tinc/@var{netname}/hosts/} directory.
|
@file{@value{sysconfdir}/tinc/@var{netname}/hosts/} directory.
|
||||||
Subnets learned via connections to other nodes and which are not
|
|
||||||
present in the local host config files are ignored.
|
|
||||||
|
|
||||||
@cindex TunnelServer
|
@cindex TunnelServer
|
||||||
@item TunnelServer = <yes|no> (no) [experimental]
|
@item TunnelServer = <yes|no> (no) [experimental]
|
||||||
|
|
@ -1139,13 +1126,11 @@ This variable is only required if you want to connect to this host. It
|
||||||
must resolve to the external IP address where the host can be reached,
|
must resolve to the external IP address where the host can be reached,
|
||||||
not the one that is internal to the VPN.
|
not the one that is internal to the VPN.
|
||||||
If no port is specified, the default Port is used.
|
If no port is specified, the default Port is used.
|
||||||
Multiple Address variables can be specified, in which case each address will be
|
|
||||||
tried until a working connection has been established.
|
|
||||||
|
|
||||||
@cindex Cipher
|
@cindex Cipher
|
||||||
@item Cipher = <@var{cipher}> (aes-256-cbc)
|
@item Cipher = <@var{cipher}> (blowfish)
|
||||||
The symmetric cipher algorithm used to encrypt UDP packets.
|
The symmetric cipher algorithm used to encrypt UDP packets.
|
||||||
Any cipher supported by LibreSSL or OpenSSL is recognized.
|
Any cipher supported by OpenSSL is recognized.
|
||||||
Furthermore, specifying "none" will turn off packet encryption.
|
Furthermore, specifying "none" will turn off packet encryption.
|
||||||
It is best to use only those ciphers which support CBC mode.
|
It is best to use only those ciphers which support CBC mode.
|
||||||
|
|
||||||
|
|
@ -1162,9 +1147,9 @@ Possible values are 0 (off), 1 (fast zlib) and any integer up to 9 (best zlib),
|
||||||
10 (fast lzo) and 11 (best lzo).
|
10 (fast lzo) and 11 (best lzo).
|
||||||
|
|
||||||
@cindex Digest
|
@cindex Digest
|
||||||
@item Digest = <@var{digest}> (sha256)
|
@item Digest = <@var{digest}> (sha1)
|
||||||
The digest algorithm used to authenticate UDP packets.
|
The digest algorithm used to authenticate UDP packets.
|
||||||
Any digest supported by LibreSSL or OpenSSL is recognized.
|
Any digest supported by OpenSSL is recognized.
|
||||||
Furthermore, specifying "none" will turn off packet authentication.
|
Furthermore, specifying "none" will turn off packet authentication.
|
||||||
|
|
||||||
@cindex IndirectData
|
@cindex IndirectData
|
||||||
|
|
@ -1216,7 +1201,7 @@ connection with that host.
|
||||||
@cindex Subnet
|
@cindex Subnet
|
||||||
@item Subnet = <@var{address}[/@var{prefixlength}[#@var{weight}]]>
|
@item Subnet = <@var{address}[/@var{prefixlength}[#@var{weight}]]>
|
||||||
The subnet which this tinc daemon will serve.
|
The subnet which this tinc daemon will serve.
|
||||||
Tinc tries to look up which other daemon it should send a packet to by searching the appropriate subnet.
|
Tinc tries to look up which other daemon it should send a packet to by searching the appropiate subnet.
|
||||||
If the packet matches a subnet,
|
If the packet matches a subnet,
|
||||||
it will be sent to the daemon who has this subnet in his host configuration file.
|
it will be sent to the daemon who has this subnet in his host configuration file.
|
||||||
Multiple subnet lines can be specified for each daemon.
|
Multiple subnet lines can be specified for each daemon.
|
||||||
|
|
@ -1235,7 +1220,7 @@ MAC addresses are notated like 0:1a:2b:3c:4d:5e.
|
||||||
Prefixlength is the number of bits set to 1 in the netmask part; for
|
Prefixlength is the number of bits set to 1 in the netmask part; for
|
||||||
example: netmask 255.255.255.0 would become /24, 255.255.252.0 becomes
|
example: netmask 255.255.255.0 would become /24, 255.255.252.0 becomes
|
||||||
/22. This conforms to standard CIDR notation as described in
|
/22. This conforms to standard CIDR notation as described in
|
||||||
@uref{https://www.ietf.org/rfc/rfc1519.txt, RFC1519}
|
@uref{ftp://ftp.isi.edu/in-notes/rfc1519.txt, RFC1519}
|
||||||
|
|
||||||
@cindex Subnet weight
|
@cindex Subnet weight
|
||||||
A Subnet can be given a weight to indicate its priority over identical Subnets
|
A Subnet can be given a weight to indicate its priority over identical Subnets
|
||||||
|
|
@ -1264,15 +1249,7 @@ UDP is possible or not.
|
||||||
@cindex scripts
|
@cindex scripts
|
||||||
Apart from reading the server and host configuration files,
|
Apart from reading the server and host configuration files,
|
||||||
tinc can also run scripts at certain moments.
|
tinc can also run scripts at certain moments.
|
||||||
Below is a list of filenames of scripts and a description of when they are run.
|
Under Windows (not Cygwin), the scripts should have the extension .bat.
|
||||||
A script is only run if it exists and if it is executable.
|
|
||||||
|
|
||||||
Scripts are run synchronously;
|
|
||||||
this means that tinc will temporarily stop processing packets until the called script finishes executing.
|
|
||||||
This guarantees that scripts will execute in the exact same order as the events that trigger them.
|
|
||||||
If you need to run commands asynchronously, you have to ensure yourself that they are being run in the background.
|
|
||||||
|
|
||||||
Under Windows (not Cygwin), the scripts must have the extension .bat.
|
|
||||||
|
|
||||||
@table @file
|
@table @file
|
||||||
@cindex tinc-up
|
@cindex tinc-up
|
||||||
|
|
@ -1282,7 +1259,6 @@ If it is present it will be executed right after the tinc daemon has been
|
||||||
started and has connected to the virtual network device.
|
started and has connected to the virtual network device.
|
||||||
It should be used to set up the corresponding network interface,
|
It should be used to set up the corresponding network interface,
|
||||||
but can also be used to start other things.
|
but can also be used to start other things.
|
||||||
|
|
||||||
Under Windows you can use the Network Connections control panel instead of creating this script.
|
Under Windows you can use the Network Connections control panel instead of creating this script.
|
||||||
|
|
||||||
@cindex tinc-down
|
@cindex tinc-down
|
||||||
|
|
@ -1302,11 +1278,11 @@ This script is started when any host becomes reachable.
|
||||||
This script is started when any host becomes unreachable.
|
This script is started when any host becomes unreachable.
|
||||||
|
|
||||||
@item @value{sysconfdir}/tinc/@var{netname}/subnet-up
|
@item @value{sysconfdir}/tinc/@var{netname}/subnet-up
|
||||||
This script is started when a subnet becomes reachable.
|
This script is started when a Subnet becomes reachable.
|
||||||
The Subnet and the node it belongs to are passed in environment variables.
|
The Subnet and the node it belongs to are passed in environment variables.
|
||||||
|
|
||||||
@item @value{sysconfdir}/tinc/@var{netname}/subnet-down
|
@item @value{sysconfdir}/tinc/@var{netname}/subnet-down
|
||||||
This script is started when a subnet becomes unreachable.
|
This script is started when a Subnet becomes unreachable.
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
@cindex environment variables
|
@cindex environment variables
|
||||||
|
|
@ -1377,7 +1353,7 @@ add `ConnectTo' values.
|
||||||
|
|
||||||
@subsubheading Step 2. Creating your host configuration file
|
@subsubheading Step 2. Creating your host configuration file
|
||||||
|
|
||||||
If you added a line containing `Name = yourname' in the main configuration file,
|
If you added a line containing `Name = yourname' in the main configuarion file,
|
||||||
you will need to create a host configuration file @file{@value{sysconfdir}/tinc/@var{netname}/hosts/yourname}.
|
you will need to create a host configuration file @file{@value{sysconfdir}/tinc/@var{netname}/hosts/yourname}.
|
||||||
Adapt the following example to create a host configuration file:
|
Adapt the following example to create a host configuration file:
|
||||||
|
|
||||||
|
|
@ -1730,7 +1706,7 @@ Write log entries to a file instead of to the system logging facility.
|
||||||
If @var{file} is omitted, the default is @file{@value{localstatedir}/log/tinc.@var{netname}.log}.
|
If @var{file} is omitted, the default is @file{@value{localstatedir}/log/tinc.@var{netname}.log}.
|
||||||
|
|
||||||
@item --pidfile=@var{file}
|
@item --pidfile=@var{file}
|
||||||
Write PID to @var{file} instead of @file{@value{runstatedir}/tinc.@var{netname}.pid}.
|
Write PID to @var{file} instead of @file{@value{localstatedir}/run/tinc.@var{netname}.pid}.
|
||||||
|
|
||||||
@item --bypass-security
|
@item --bypass-security
|
||||||
Disables encryption and authentication.
|
Disables encryption and authentication.
|
||||||
|
|
@ -1743,14 +1719,10 @@ located (@file{@value{sysconfdir}/tinc/@var{netname}/} as determined by
|
||||||
The chroot is performed after all the initialization is done, after
|
The chroot is performed after all the initialization is done, after
|
||||||
writing pid files and opening network sockets.
|
writing pid files and opening network sockets.
|
||||||
|
|
||||||
This option is best used in combination with the -U/--user option described below.
|
Note that this option alone does not do any good without -U/--user, below.
|
||||||
|
|
||||||
You will need to ensure the chroot environment contains all the files necessary
|
Note also that tinc can't run scripts anymore (such as tinc-down or host-up),
|
||||||
for tinc to run correctly.
|
unless it's setup to be runnable inside chroot environment.
|
||||||
Most importantly, for tinc to be able to resolve hostnames inside the chroot environment,
|
|
||||||
you must copy @file{/etc/resolv.conf} into the chroot directory.
|
|
||||||
If you want to be able to run scripts other than @file{tinc-up} in the chroot,
|
|
||||||
you must ensure the appropriate shell is also installed in the chroot, along with all its dependencies.
|
|
||||||
|
|
||||||
@item -U, --user=@var{user}
|
@item -U, --user=@var{user}
|
||||||
Switch to the given @var{user} after initialization, at the same time as
|
Switch to the given @var{user} after initialization, at the same time as
|
||||||
|
|
@ -2035,7 +2007,7 @@ There are two possible types of virtual network devices:
|
||||||
and `tap' style, which are Ethernet devices and handle complete Ethernet frames.
|
and `tap' style, which are Ethernet devices and handle complete Ethernet frames.
|
||||||
|
|
||||||
So when tinc reads an Ethernet frame from the device, it determines its
|
So when tinc reads an Ethernet frame from the device, it determines its
|
||||||
type. When tinc is in its default routing mode, it can handle IPv4 and IPv6
|
type. When tinc is in it's default routing mode, it can handle IPv4 and IPv6
|
||||||
packets. Depending on the Subnet lines, it will send the packets off to their destination IP address.
|
packets. Depending on the Subnet lines, it will send the packets off to their destination IP address.
|
||||||
In the `switch' and `hub' mode, tinc will use broadcasts and MAC address discovery
|
In the `switch' and `hub' mode, tinc will use broadcasts and MAC address discovery
|
||||||
to deduce the destination of the packets.
|
to deduce the destination of the packets.
|
||||||
|
|
@ -2066,7 +2038,7 @@ If the virtual network device is a `tun' device (a point-to-point tunnel),
|
||||||
there is no problem for the kernel to accept a packet.
|
there is no problem for the kernel to accept a packet.
|
||||||
However, if it is a `tap' device (this is the only available type on FreeBSD),
|
However, if it is a `tap' device (this is the only available type on FreeBSD),
|
||||||
the destination MAC address must match that of the virtual network interface.
|
the destination MAC address must match that of the virtual network interface.
|
||||||
If tinc is in its default routing mode, ARP does not work, so the correct destination MAC
|
If tinc is in it's default routing mode, ARP does not work, so the correct destination MAC
|
||||||
can not be known by the sending host.
|
can not be known by the sending host.
|
||||||
Tinc solves this by letting the receiving end detect the MAC address of its own virtual network interface
|
Tinc solves this by letting the receiving end detect the MAC address of its own virtual network interface
|
||||||
and overwriting the destination MAC address of the received packet.
|
and overwriting the destination MAC address of the received packet.
|
||||||
|
|
@ -2075,7 +2047,7 @@ In switch or hub modes ARP does work so the sender already knows the correct des
|
||||||
In those modes every interface should have a unique MAC address, so make sure they are not the same.
|
In those modes every interface should have a unique MAC address, so make sure they are not the same.
|
||||||
Because switch and hub modes rely on MAC addresses to function correctly,
|
Because switch and hub modes rely on MAC addresses to function correctly,
|
||||||
these modes cannot be used on the following operating systems which don't have a `tap' style virtual network device:
|
these modes cannot be used on the following operating systems which don't have a `tap' style virtual network device:
|
||||||
NetBSD, Darwin and Solaris.
|
OpenBSD, NetBSD, Darwin and Solaris.
|
||||||
|
|
||||||
|
|
||||||
@c ==================================================================
|
@c ==================================================================
|
||||||
|
|
@ -2254,7 +2226,7 @@ eavesdroppers cannot get and cannot change any information at all from the
|
||||||
packets they can intercept. The encryption algorithm and message authentication
|
packets they can intercept. The encryption algorithm and message authentication
|
||||||
algorithm can be changed in the configuration. The length of the message
|
algorithm can be changed in the configuration. The length of the message
|
||||||
authentication codes is also adjustable. The length of the key for the
|
authentication codes is also adjustable. The length of the key for the
|
||||||
encryption algorithm is always the default length used by LibreSSL/OpenSSL.
|
encryption algorithm is always the default length used by OpenSSL.
|
||||||
|
|
||||||
@menu
|
@menu
|
||||||
* Authentication protocol::
|
* Authentication protocol::
|
||||||
|
|
@ -2413,7 +2385,7 @@ the MACLength configuration variable.
|
||||||
In August 2000, we discovered the existence of a security hole in all versions
|
In August 2000, we discovered the existence of a security hole in all versions
|
||||||
of tinc up to and including 1.0pre2. This had to do with the way we exchanged
|
of tinc up to and including 1.0pre2. This had to do with the way we exchanged
|
||||||
keys. Since then, we have been working on a new authentication scheme to make
|
keys. Since then, we have been working on a new authentication scheme to make
|
||||||
tinc as secure as possible. The current version uses the LibreSSL or OpenSSL library and
|
tinc as secure as possible. The current version uses the OpenSSL library and
|
||||||
uses strong authentication with RSA keys.
|
uses strong authentication with RSA keys.
|
||||||
|
|
||||||
On the 29th of December 2001, Jerome Etienne posted a security analysis of tinc
|
On the 29th of December 2001, Jerome Etienne posted a security analysis of tinc
|
||||||
|
|
@ -2433,7 +2405,7 @@ We will address these issues in tinc 2.0.
|
||||||
Cryptography is a hard thing to get right. We cannot make any
|
Cryptography is a hard thing to get right. We cannot make any
|
||||||
guarantees. Time, review and feedback are the only things that can
|
guarantees. Time, review and feedback are the only things that can
|
||||||
prove the security of any cryptographic product. If you wish to review
|
prove the security of any cryptographic product. If you wish to review
|
||||||
tinc or give us feedback, you are strongly encouraged to do so.
|
tinc or give us feedback, you are stronly encouraged to do so.
|
||||||
|
|
||||||
|
|
||||||
@c ==================================================================
|
@c ==================================================================
|
||||||
|
|
@ -2443,7 +2415,6 @@ tinc or give us feedback, you are strongly encouraged to do so.
|
||||||
@menu
|
@menu
|
||||||
* Interface configuration::
|
* Interface configuration::
|
||||||
* Routes::
|
* Routes::
|
||||||
* Automatically starting tinc::
|
|
||||||
@end menu
|
@end menu
|
||||||
|
|
||||||
@c ==================================================================
|
@c ==================================================================
|
||||||
|
|
@ -2460,7 +2431,7 @@ netmask should be such that it encompasses the entire VPN.
|
||||||
|
|
||||||
For IPv4 addresses:
|
For IPv4 addresses:
|
||||||
|
|
||||||
@multitable {Darwin (Mac OS X)} {ifconfig route add -bla network address netmask netmask prefixlength interface}
|
@multitable {Darwin (MacOS/X)} {ifconfig route add -bla network address netmask netmask prefixlength interface}
|
||||||
@item Linux
|
@item Linux
|
||||||
@tab @code{ifconfig} @var{interface} @var{address} @code{netmask} @var{netmask}
|
@tab @code{ifconfig} @var{interface} @var{address} @code{netmask} @var{netmask}
|
||||||
@item Linux iproute2
|
@item Linux iproute2
|
||||||
|
|
@ -2473,7 +2444,7 @@ For IPv4 addresses:
|
||||||
@tab @code{ifconfig} @var{interface} @var{address} @code{netmask} @var{netmask}
|
@tab @code{ifconfig} @var{interface} @var{address} @code{netmask} @var{netmask}
|
||||||
@item Solaris
|
@item Solaris
|
||||||
@tab @code{ifconfig} @var{interface} @var{address} @code{netmask} @var{netmask}
|
@tab @code{ifconfig} @var{interface} @var{address} @code{netmask} @var{netmask}
|
||||||
@item Darwin (Mac OS X)
|
@item Darwin (MacOS/X)
|
||||||
@tab @code{ifconfig} @var{interface} @var{address} @code{netmask} @var{netmask}
|
@tab @code{ifconfig} @var{interface} @var{address} @code{netmask} @var{netmask}
|
||||||
@item Windows
|
@item Windows
|
||||||
@tab @code{netsh interface ip set address} @var{interface} @code{static} @var{address} @var{netmask}
|
@tab @code{netsh interface ip set address} @var{interface} @code{static} @var{address} @var{netmask}
|
||||||
|
|
@ -2481,7 +2452,7 @@ For IPv4 addresses:
|
||||||
|
|
||||||
For IPv6 addresses:
|
For IPv6 addresses:
|
||||||
|
|
||||||
@multitable {Darwin (Mac OS X)} {ifconfig route add -bla network address netmask netmask prefixlength interface}
|
@multitable {Darwin (MacOS/X)} {ifconfig route add -bla network address netmask netmask prefixlength interface}
|
||||||
@item Linux
|
@item Linux
|
||||||
@tab @code{ifconfig} @var{interface} @code{add} @var{address}@code{/}@var{prefixlength}
|
@tab @code{ifconfig} @var{interface} @code{add} @var{address}@code{/}@var{prefixlength}
|
||||||
@item FreeBSD
|
@item FreeBSD
|
||||||
|
|
@ -2494,18 +2465,25 @@ For IPv6 addresses:
|
||||||
@tab @code{ifconfig} @var{interface} @code{inet6 plumb up}
|
@tab @code{ifconfig} @var{interface} @code{inet6 plumb up}
|
||||||
@item
|
@item
|
||||||
@tab @code{ifconfig} @var{interface} @code{inet6 addif} @var{address} @var{address}
|
@tab @code{ifconfig} @var{interface} @code{inet6 addif} @var{address} @var{address}
|
||||||
@item Darwin (Mac OS X)
|
@item Darwin (MacOS/X)
|
||||||
@tab @code{ifconfig} @var{interface} @code{inet6} @var{address} @code{prefixlen} @var{prefixlength}
|
@tab @code{ifconfig} @var{interface} @code{inet6} @var{address} @code{prefixlen} @var{prefixlength}
|
||||||
@item Windows
|
@item Windows
|
||||||
@tab @code{netsh interface ipv6 add address} @var{interface} @code{static} @var{address}/@var{prefixlength}
|
@tab @code{netsh interface ipv6 add address} @var{interface} @code{static} @var{address}/@var{prefixlength}
|
||||||
@end multitable
|
@end multitable
|
||||||
|
|
||||||
|
On some platforms, when running tinc in switch mode, the VPN interface must be set to tap mode with an ifconfig command:
|
||||||
|
|
||||||
|
@multitable {Darwin (MacOS/X)} {ifconfig route add -bla network address netmask netmask prefixlength interface}
|
||||||
|
@item OpenBSD
|
||||||
|
@tab @code{ifconfig} @var{interface} @code{link0}
|
||||||
|
@end multitable
|
||||||
|
|
||||||
On Linux, it is possible to create a persistent tun/tap interface which will
|
On Linux, it is possible to create a persistent tun/tap interface which will
|
||||||
continue to exist even if tinc quit, although this is normally not required.
|
continue to exist even if tinc quit, although this is normally not required.
|
||||||
It can be useful to set up a tun/tap interface owned by a non-root user, so
|
It can be useful to set up a tun/tap interface owned by a non-root user, so
|
||||||
tinc can be started without needing any root privileges at all.
|
tinc can be started without needing any root privileges at all.
|
||||||
|
|
||||||
@multitable {Darwin (Mac OS X)} {ifconfig route add -bla network address netmask netmask prefixlength interface}
|
@multitable {Darwin (MacOS/X)} {ifconfig route add -bla network address netmask netmask prefixlength interface}
|
||||||
@item Linux
|
@item Linux
|
||||||
@tab @code{ip tuntap add dev} @var{interface} @code{mode} @var{tun|tap} @code{user} @var{username}
|
@tab @code{ip tuntap add dev} @var{interface} @code{mode} @var{tun|tap} @code{user} @var{username}
|
||||||
@end multitable
|
@end multitable
|
||||||
|
|
@ -2523,7 +2501,7 @@ support this.
|
||||||
|
|
||||||
Adding routes to IPv4 subnets:
|
Adding routes to IPv4 subnets:
|
||||||
|
|
||||||
@multitable {Darwin (Mac OS X)} {ifconfig route add -bla network address netmask netmask prefixlength interface}
|
@multitable {Darwin (MacOS/X)} {ifconfig route add -bla network address netmask netmask prefixlength interface}
|
||||||
@item Linux
|
@item Linux
|
||||||
@tab @code{route add -net} @var{network_address} @code{netmask} @var{netmask} @var{interface}
|
@tab @code{route add -net} @var{network_address} @code{netmask} @var{netmask} @var{interface}
|
||||||
@item Linux iproute2
|
@item Linux iproute2
|
||||||
|
|
@ -2536,15 +2514,15 @@ Adding routes to IPv4 subnets:
|
||||||
@tab @code{route add} @var{network_address}@code{/}@var{prefixlength} @var{local_address}
|
@tab @code{route add} @var{network_address}@code{/}@var{prefixlength} @var{local_address}
|
||||||
@item Solaris
|
@item Solaris
|
||||||
@tab @code{route add} @var{network_address}@code{/}@var{prefixlength} @var{local_address} @code{-interface}
|
@tab @code{route add} @var{network_address}@code{/}@var{prefixlength} @var{local_address} @code{-interface}
|
||||||
@item Darwin (Mac OS X)
|
@item Darwin (MacOS/X)
|
||||||
@tab @code{route add} @var{network_address}@code{/}@var{prefixlength} @code{-interface} @var{interface}
|
@tab @code{route add} @var{network_address}@code{/}@var{prefixlength} @var{local_address}
|
||||||
@item Windows
|
@item Windows
|
||||||
@tab @code{netsh routing ip add persistentroute} @var{network_address} @var{netmask} @var{interface} @var{local_address}
|
@tab @code{netsh routing ip add persistentroute} @var{network_address} @var{netmask} @var{interface} @var{local_address}
|
||||||
@end multitable
|
@end multitable
|
||||||
|
|
||||||
Adding routes to IPv6 subnets:
|
Adding routes to IPv6 subnets:
|
||||||
|
|
||||||
@multitable {Darwin (Mac OS X)} {ifconfig route add -bla network address netmask netmask prefixlength interface}
|
@multitable {Darwin (MacOS/X)} {ifconfig route add -bla network address netmask netmask prefixlength interface}
|
||||||
@item Linux
|
@item Linux
|
||||||
@tab @code{route add -A inet6} @var{network_address}@code{/}@var{prefixlength} @var{interface}
|
@tab @code{route add -A inet6} @var{network_address}@code{/}@var{prefixlength} @var{interface}
|
||||||
@item Linux iproute2
|
@item Linux iproute2
|
||||||
|
|
@ -2557,72 +2535,12 @@ Adding routes to IPv6 subnets:
|
||||||
@tab @code{route add -inet6} @var{network_address} @var{local_address} @code{-prefixlen} @var{prefixlength}
|
@tab @code{route add -inet6} @var{network_address} @var{local_address} @code{-prefixlen} @var{prefixlength}
|
||||||
@item Solaris
|
@item Solaris
|
||||||
@tab @code{route add -inet6} @var{network_address}@code{/}@var{prefixlength} @var{local_address} @code{-interface}
|
@tab @code{route add -inet6} @var{network_address}@code{/}@var{prefixlength} @var{local_address} @code{-interface}
|
||||||
@item Darwin (Mac OS X)
|
@item Darwin (MacOS/X)
|
||||||
@tab @code{route add -inet6} @var{network_address}@code{/}@var{prefixlength} @code{-interface} @var{interface}
|
@tab ?
|
||||||
@item Windows
|
@item Windows
|
||||||
@tab @code{netsh interface ipv6 add route} @var{network address}/@var{prefixlength} @var{interface}
|
@tab @code{netsh interface ipv6 add route} @var{network address}/@var{prefixlength} @var{interface}
|
||||||
@end multitable
|
@end multitable
|
||||||
|
|
||||||
@c ==================================================================
|
|
||||||
@node Automatically starting tinc
|
|
||||||
@section Automatically starting tinc
|
|
||||||
|
|
||||||
@menu
|
|
||||||
* Linux::
|
|
||||||
* Windows::
|
|
||||||
* Other platforms::
|
|
||||||
@end menu
|
|
||||||
|
|
||||||
@c ==================================================================
|
|
||||||
@node Linux
|
|
||||||
@subsection Linux
|
|
||||||
|
|
||||||
@cindex systemd
|
|
||||||
There are many Linux distributions, and historically, many of them had their
|
|
||||||
own way of starting programs at boot time. Today, a number of major Linux
|
|
||||||
distributions have chosen to use systemd as their init system. Tinc ships with
|
|
||||||
systemd service files that allow you to start and stop tinc using systemd.
|
|
||||||
There are two service files: @code{tinc.service} is used to globally enable or
|
|
||||||
disable all tinc daemons managed by systemd, and
|
|
||||||
@code{tinc@@@var{netname}.service} is used to enable or disable specific tinc
|
|
||||||
daemons. So if one has created a tinc network with netname @code{foo}, then
|
|
||||||
you have to run the following two commands to ensure it is started at boot
|
|
||||||
time:
|
|
||||||
|
|
||||||
@example
|
|
||||||
systemctl enable tinc
|
|
||||||
systemctl enable tinc@@foo
|
|
||||||
@end example
|
|
||||||
|
|
||||||
To start the tinc daemon immediately if it wasn't already running, use the
|
|
||||||
following command:
|
|
||||||
|
|
||||||
@example
|
|
||||||
systemctl start tinc@@foo
|
|
||||||
@end example
|
|
||||||
|
|
||||||
You can also use @samp{systemctl start tinc}, this will start all tinc daemons
|
|
||||||
that are enabled. You can stop and disable tinc networks in the same way.
|
|
||||||
|
|
||||||
If your system is not using systemd, then you have to look up your
|
|
||||||
distribution's way of starting tinc at boot time.
|
|
||||||
|
|
||||||
@c ==================================================================
|
|
||||||
@node Windows
|
|
||||||
@subsection Windows
|
|
||||||
|
|
||||||
On Windows, if tinc is started without the @code{-D} or @code{--no-detach}
|
|
||||||
option, it will automatically register itself as a service that is started at
|
|
||||||
boot time. When tinc is stopped using the @code{-k} or @code{--kill}, it will
|
|
||||||
also automatically unregister itself. Once tinc is registered as a service, it
|
|
||||||
is also possible to stop and start tinc using the Windows Services Manager.
|
|
||||||
|
|
||||||
@c ==================================================================
|
|
||||||
@node Other platforms
|
|
||||||
@subsection Other platforms
|
|
||||||
|
|
||||||
On platforms other than the ones mentioned in the earlier sections, you have to
|
|
||||||
look up your platform's way of starting programs at boot time.
|
|
||||||
|
|
||||||
@c ==================================================================
|
@c ==================================================================
|
||||||
@node About us
|
@node About us
|
||||||
|
|
@ -2640,14 +2558,14 @@ look up your platform's way of starting programs at boot time.
|
||||||
@section Contact information
|
@section Contact information
|
||||||
|
|
||||||
@cindex website
|
@cindex website
|
||||||
Tinc's website is at @url{https://www.tinc-vpn.org/},
|
Tinc's website is at @url{http://www.tinc-vpn.org/},
|
||||||
this server is located in the Netherlands.
|
this server is located in the Netherlands.
|
||||||
|
|
||||||
@cindex IRC
|
@cindex IRC
|
||||||
We have an IRC channel on the FreeNode and OFTC IRC networks. Connect to
|
We have an IRC channel on the FreeNode and OFTC IRC networks. Connect to
|
||||||
@uref{https://freenode.net/, irc.freenode.net}
|
@uref{http://www.freenode.net/, irc.freenode.net}
|
||||||
or
|
or
|
||||||
@uref{https://www.oftc.net/, irc.oftc.net}
|
@uref{http://www.oftc.net/, irc.oftc.net}
|
||||||
and join channel #tinc.
|
and join channel #tinc.
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
.Dd 2014-05-11
|
.Dd 2011-01-02
|
||||||
.Dt TINCD 8
|
.Dt TINCD 8
|
||||||
.\" Manual page created by:
|
.\" Manual page created by:
|
||||||
.\" Ivo Timmermans
|
.\" Ivo Timmermans
|
||||||
|
|
@ -109,7 +109,7 @@ is omitted, the default is
|
||||||
Write PID to
|
Write PID to
|
||||||
.Ar FILE
|
.Ar FILE
|
||||||
instead of
|
instead of
|
||||||
.Pa @runstatedir@/tinc. Ns Ar NETNAME Ns Pa .pid.
|
.Pa @localstatedir@/run/tinc. Ns Ar NETNAME Ns Pa .pid.
|
||||||
Under Windows this option will be ignored.
|
Under Windows this option will be ignored.
|
||||||
.It Fl -bypass-security
|
.It Fl -bypass-security
|
||||||
Disables encryption and authentication of the meta protocol.
|
Disables encryption and authentication of the meta protocol.
|
||||||
|
|
@ -190,7 +190,7 @@ This will log all network traffic over the virtual private network.
|
||||||
Directory containing the configuration files tinc uses.
|
Directory containing the configuration files tinc uses.
|
||||||
For more information, see
|
For more information, see
|
||||||
.Xr tinc.conf 5 .
|
.Xr tinc.conf 5 .
|
||||||
.It Pa @runstatedir@/tinc. Ns Ar NETNAME Ns Pa .pid
|
.It Pa @localstatedir@/run/tinc. Ns Ar NETNAME Ns Pa .pid
|
||||||
The PID of the currently running
|
The PID of the currently running
|
||||||
.Nm
|
.Nm
|
||||||
is stored in this file.
|
is stored in this file.
|
||||||
|
|
@ -207,7 +207,7 @@ If you find any bugs, report them to tinc@tinc-vpn.org.
|
||||||
A lot, especially security auditing.
|
A lot, especially security auditing.
|
||||||
.Sh SEE ALSO
|
.Sh SEE ALSO
|
||||||
.Xr tinc.conf 5 ,
|
.Xr tinc.conf 5 ,
|
||||||
.Pa https://www.tinc-vpn.org/ ,
|
.Pa http://www.tinc-vpn.org/ ,
|
||||||
.Pa http://www.cabal.org/ .
|
.Pa http://www.cabal.org/ .
|
||||||
.Pp
|
.Pp
|
||||||
The full documentation for tinc is maintained as a Texinfo manual.
|
The full documentation for tinc is maintained as a Texinfo manual.
|
||||||
|
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
@set VERSION 1.0.36
|
|
||||||
@set PACKAGE tinc
|
|
||||||
@set sysconfdir /etc
|
|
||||||
@set localstatedir /var
|
|
||||||
@set runstatedir /run
|
|
||||||
|
|
@ -2,4 +2,3 @@
|
||||||
@set PACKAGE @PACKAGE@
|
@set PACKAGE @PACKAGE@
|
||||||
@set sysconfdir @sysconfdir@
|
@set sysconfdir @sysconfdir@
|
||||||
@set localstatedir @localstatedir@
|
@set localstatedir @localstatedir@
|
||||||
@set runstatedir @runstatedir@
|
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,7 @@
|
||||||
#ifndef TINC_HAVE_H
|
|
||||||
#define TINC_HAVE_H
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
have.h -- include headers which are known to exist
|
have.h -- include headers which are known to exist
|
||||||
Copyright (C) 1998-2005 Ivo Timmermans
|
Copyright (C) 1998-2005 Ivo Timmermans
|
||||||
2003-2015 Guus Sliepen <guus@tinc-vpn.org>
|
2003-2011 Guus Sliepen <guus@tinc-vpn.org>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|
@ -21,6 +18,9 @@
|
||||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifndef __TINC_HAVE_H__
|
||||||
|
#define __TINC_HAVE_H__
|
||||||
|
|
||||||
#ifdef HAVE_MINGW
|
#ifdef HAVE_MINGW
|
||||||
#ifdef WITH_WINDOWS2000
|
#ifdef WITH_WINDOWS2000
|
||||||
#define WINVER Windows2000
|
#define WINVER Windows2000
|
||||||
|
|
@ -30,19 +30,14 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdbool.h>
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <inttypes.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
#include <signal.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <limits.h>
|
|
||||||
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <signal.h>
|
|
||||||
|
|
||||||
#ifdef HAVE_MINGW
|
#ifdef HAVE_MINGW
|
||||||
#include <w32api.h>
|
#include <w32api.h>
|
||||||
|
|
@ -59,6 +54,10 @@
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_INTTYPES_H
|
||||||
|
#include <inttypes.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_ALLOCA_H
|
#ifdef HAVE_ALLOCA_H
|
||||||
#include <alloca.h>
|
#include <alloca.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -196,19 +195,4 @@
|
||||||
#include <netinet/if_ether.h>
|
#include <netinet/if_ether.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_ARPA_NAMESER_H
|
#endif /* __TINC_SYSTEM_H__ */
|
||||||
#include <arpa/nameser.h>
|
|
||||||
#ifdef STATUS
|
|
||||||
#undef STATUS
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_RESOLV_H
|
|
||||||
#include <resolv.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_LINUX_IF_TUN_H
|
|
||||||
#include <linux/if_tun.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
168
install-sh
168
install-sh
|
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# install - install a program, script, or datafile
|
# install - install a program, script, or datafile
|
||||||
|
|
||||||
scriptversion=2018-03-11.20; # UTC
|
scriptversion=2011-01-19.21; # UTC
|
||||||
|
|
||||||
# This originates from X11R5 (mit/util/scripts/install.sh), which was
|
# This originates from X11R5 (mit/util/scripts/install.sh), which was
|
||||||
# later released in X11R6 (xc/config/util/install.sh) with the
|
# later released in X11R6 (xc/config/util/install.sh) with the
|
||||||
|
|
@ -35,21 +35,25 @@ scriptversion=2018-03-11.20; # UTC
|
||||||
# FSF changes to this file are in the public domain.
|
# FSF changes to this file are in the public domain.
|
||||||
#
|
#
|
||||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
# 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.
|
# when there is no Makefile.
|
||||||
#
|
#
|
||||||
# This script is compatible with the BSD install script, but was written
|
# This script is compatible with the BSD install script, but was written
|
||||||
# from scratch.
|
# from scratch.
|
||||||
|
|
||||||
tab=' '
|
|
||||||
nl='
|
nl='
|
||||||
'
|
'
|
||||||
IFS=" $tab$nl"
|
IFS=" "" $nl"
|
||||||
|
|
||||||
# Set DOITPROG to "echo" to test this script.
|
# set DOITPROG to echo to test this script
|
||||||
|
|
||||||
|
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
||||||
doit=${DOITPROG-}
|
doit=${DOITPROG-}
|
||||||
doit_exec=${doit:-exec}
|
if test -z "$doit"; then
|
||||||
|
doit_exec=exec
|
||||||
|
else
|
||||||
|
doit_exec=$doit
|
||||||
|
fi
|
||||||
|
|
||||||
# Put in absolute file names if you don't have them in your path;
|
# Put in absolute file names if you don't have them in your path;
|
||||||
# or use environment vars.
|
# or use environment vars.
|
||||||
|
|
@ -64,6 +68,17 @@ mvprog=${MVPROG-mv}
|
||||||
rmprog=${RMPROG-rm}
|
rmprog=${RMPROG-rm}
|
||||||
stripprog=${STRIPPROG-strip}
|
stripprog=${STRIPPROG-strip}
|
||||||
|
|
||||||
|
posix_glob='?'
|
||||||
|
initialize_posix_glob='
|
||||||
|
test "$posix_glob" != "?" || {
|
||||||
|
if (set -f) 2>/dev/null; then
|
||||||
|
posix_glob=
|
||||||
|
else
|
||||||
|
posix_glob=:
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
'
|
||||||
|
|
||||||
posix_mkdir=
|
posix_mkdir=
|
||||||
|
|
||||||
# Desired mode of installed file.
|
# Desired mode of installed file.
|
||||||
|
|
@ -82,7 +97,7 @@ dir_arg=
|
||||||
dst_arg=
|
dst_arg=
|
||||||
|
|
||||||
copy_on_change=false
|
copy_on_change=false
|
||||||
is_target_a_directory=possibly
|
no_target_directory=
|
||||||
|
|
||||||
usage="\
|
usage="\
|
||||||
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
|
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
|
||||||
|
|
@ -128,7 +143,8 @@ while test $# -ne 0; do
|
||||||
|
|
||||||
-m) mode=$2
|
-m) mode=$2
|
||||||
case $mode in
|
case $mode in
|
||||||
*' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
|
*' '* | *' '* | *'
|
||||||
|
'* | *'*'* | *'?'* | *'['*)
|
||||||
echo "$0: invalid mode: $mode" >&2
|
echo "$0: invalid mode: $mode" >&2
|
||||||
exit 1;;
|
exit 1;;
|
||||||
esac
|
esac
|
||||||
|
|
@ -139,16 +155,14 @@ while test $# -ne 0; do
|
||||||
|
|
||||||
-s) stripcmd=$stripprog;;
|
-s) stripcmd=$stripprog;;
|
||||||
|
|
||||||
-t)
|
-t) dst_arg=$2
|
||||||
is_target_a_directory=always
|
# Protect names problematic for `test' and other utilities.
|
||||||
dst_arg=$2
|
|
||||||
# Protect names problematic for 'test' and other utilities.
|
|
||||||
case $dst_arg in
|
case $dst_arg in
|
||||||
-* | [=\(\)!]) dst_arg=./$dst_arg;;
|
-* | [=\(\)!]) dst_arg=./$dst_arg;;
|
||||||
esac
|
esac
|
||||||
shift;;
|
shift;;
|
||||||
|
|
||||||
-T) is_target_a_directory=never;;
|
-T) no_target_directory=true;;
|
||||||
|
|
||||||
--version) echo "$0 $scriptversion"; exit $?;;
|
--version) echo "$0 $scriptversion"; exit $?;;
|
||||||
|
|
||||||
|
|
@ -163,16 +177,6 @@ while test $# -ne 0; do
|
||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
# We allow the use of options -d and -T together, by making -d
|
|
||||||
# take the precedence; this is for compatibility with GNU install.
|
|
||||||
|
|
||||||
if test -n "$dir_arg"; then
|
|
||||||
if test -n "$dst_arg"; then
|
|
||||||
echo "$0: target directory not allowed when installing a directory." >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
|
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
|
||||||
# When -d is used, all remaining arguments are directories to create.
|
# When -d is used, all remaining arguments are directories to create.
|
||||||
# When -t is used, the destination is already specified.
|
# When -t is used, the destination is already specified.
|
||||||
|
|
@ -186,7 +190,7 @@ if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
|
||||||
fi
|
fi
|
||||||
shift # arg
|
shift # arg
|
||||||
dst_arg=$arg
|
dst_arg=$arg
|
||||||
# Protect names problematic for 'test' and other utilities.
|
# Protect names problematic for `test' and other utilities.
|
||||||
case $dst_arg in
|
case $dst_arg in
|
||||||
-* | [=\(\)!]) dst_arg=./$dst_arg;;
|
-* | [=\(\)!]) dst_arg=./$dst_arg;;
|
||||||
esac
|
esac
|
||||||
|
|
@ -198,20 +202,11 @@ if test $# -eq 0; then
|
||||||
echo "$0: no input file specified." >&2
|
echo "$0: no input file specified." >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
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.
|
# This can happen when creating conditional directories.
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test -z "$dir_arg"; then
|
|
||||||
if test $# -gt 1 || test "$is_target_a_directory" = always; then
|
|
||||||
if test ! -d "$dst_arg"; then
|
|
||||||
echo "$0: $dst_arg: Is not a directory." >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test -z "$dir_arg"; then
|
if test -z "$dir_arg"; then
|
||||||
do_exit='(exit $ret); exit $ret'
|
do_exit='(exit $ret); exit $ret'
|
||||||
trap "ret=129; $do_exit" 1
|
trap "ret=129; $do_exit" 1
|
||||||
|
|
@ -245,7 +240,7 @@ fi
|
||||||
|
|
||||||
for src
|
for src
|
||||||
do
|
do
|
||||||
# Protect names problematic for 'test' and other utilities.
|
# Protect names problematic for `test' and other utilities.
|
||||||
case $src in
|
case $src in
|
||||||
-* | [=\(\)!]) src=./$src;;
|
-* | [=\(\)!]) src=./$src;;
|
||||||
esac
|
esac
|
||||||
|
|
@ -271,31 +266,49 @@ do
|
||||||
fi
|
fi
|
||||||
dst=$dst_arg
|
dst=$dst_arg
|
||||||
|
|
||||||
# If destination is a directory, append the input filename.
|
# If destination is a directory, append the input filename; won't work
|
||||||
|
# if double slashes aren't ignored.
|
||||||
if test -d "$dst"; then
|
if test -d "$dst"; then
|
||||||
if test "$is_target_a_directory" = never; then
|
if test -n "$no_target_directory"; then
|
||||||
echo "$0: $dst_arg: Is a directory" >&2
|
echo "$0: $dst_arg: Is a directory" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
dstdir=$dst
|
dstdir=$dst
|
||||||
dstbase=`basename "$src"`
|
dst=$dstdir/`basename "$src"`
|
||||||
case $dst in
|
|
||||||
*/) dst=$dst$dstbase;;
|
|
||||||
*) dst=$dst/$dstbase;;
|
|
||||||
esac
|
|
||||||
dstdir_status=0
|
dstdir_status=0
|
||||||
else
|
else
|
||||||
dstdir=`dirname "$dst"`
|
# Prefer dirname, but fall back on a substitute if dirname fails.
|
||||||
|
dstdir=`
|
||||||
|
(dirname "$dst") 2>/dev/null ||
|
||||||
|
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
|
||||||
|
X"$dst" : 'X\(//\)[^/]' \| \
|
||||||
|
X"$dst" : 'X\(//\)$' \| \
|
||||||
|
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
|
||||||
|
echo X"$dst" |
|
||||||
|
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
|
||||||
|
s//\1/
|
||||||
|
q
|
||||||
|
}
|
||||||
|
/^X\(\/\/\)[^/].*/{
|
||||||
|
s//\1/
|
||||||
|
q
|
||||||
|
}
|
||||||
|
/^X\(\/\/\)$/{
|
||||||
|
s//\1/
|
||||||
|
q
|
||||||
|
}
|
||||||
|
/^X\(\/\).*/{
|
||||||
|
s//\1/
|
||||||
|
q
|
||||||
|
}
|
||||||
|
s/.*/./; q'
|
||||||
|
`
|
||||||
|
|
||||||
test -d "$dstdir"
|
test -d "$dstdir"
|
||||||
dstdir_status=$?
|
dstdir_status=$?
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
case $dstdir in
|
|
||||||
*/) dstdirslash=$dstdir;;
|
|
||||||
*) dstdirslash=$dstdir/;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
obsolete_mkdir_used=false
|
obsolete_mkdir_used=false
|
||||||
|
|
||||||
if test $dstdir_status != 0; then
|
if test $dstdir_status != 0; then
|
||||||
|
|
@ -332,43 +345,34 @@ do
|
||||||
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
|
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
# Note that $RANDOM variable is not portable (e.g. dash); Use it
|
|
||||||
# here however when possible just to lower collision chance.
|
|
||||||
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
|
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
|
||||||
|
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
|
||||||
|
|
||||||
trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0
|
|
||||||
|
|
||||||
# Because "mkdir -p" follows existing symlinks and we likely work
|
|
||||||
# directly in world-writeable /tmp, make sure that the '$tmpdir'
|
|
||||||
# directory is successfully created first before we actually test
|
|
||||||
# 'mkdir -p' feature.
|
|
||||||
if (umask $mkdir_umask &&
|
if (umask $mkdir_umask &&
|
||||||
$mkdirprog $mkdir_mode "$tmpdir" &&
|
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
|
||||||
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
|
|
||||||
then
|
then
|
||||||
if test -z "$dir_arg" || {
|
if test -z "$dir_arg" || {
|
||||||
# Check for POSIX incompatibilities with -m.
|
# Check for POSIX incompatibilities with -m.
|
||||||
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
|
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
|
||||||
# other-writable bit of parent directory when it shouldn't.
|
# other-writeable bit of parent directory when it shouldn't.
|
||||||
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
|
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
|
||||||
test_tmpdir="$tmpdir/a"
|
ls_ld_tmpdir=`ls -ld "$tmpdir"`
|
||||||
ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
|
|
||||||
case $ls_ld_tmpdir in
|
case $ls_ld_tmpdir in
|
||||||
d????-?r-*) different_mode=700;;
|
d????-?r-*) different_mode=700;;
|
||||||
d????-?--*) different_mode=755;;
|
d????-?--*) different_mode=755;;
|
||||||
*) false;;
|
*) false;;
|
||||||
esac &&
|
esac &&
|
||||||
$mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
|
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
|
||||||
ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
|
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
|
||||||
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
|
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
then posix_mkdir=:
|
then posix_mkdir=:
|
||||||
fi
|
fi
|
||||||
rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
|
rmdir "$tmpdir/d" "$tmpdir"
|
||||||
else
|
else
|
||||||
# Remove any dirs left behind by ancient mkdir implementations.
|
# Remove any dirs left behind by ancient mkdir implementations.
|
||||||
rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
|
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
|
||||||
fi
|
fi
|
||||||
trap '' 0;;
|
trap '' 0;;
|
||||||
esac;;
|
esac;;
|
||||||
|
|
@ -392,12 +396,14 @@ do
|
||||||
*) prefix='';;
|
*) prefix='';;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
eval "$initialize_posix_glob"
|
||||||
|
|
||||||
oIFS=$IFS
|
oIFS=$IFS
|
||||||
IFS=/
|
IFS=/
|
||||||
set -f
|
$posix_glob set -f
|
||||||
set fnord $dstdir
|
set fnord $dstdir
|
||||||
shift
|
shift
|
||||||
set +f
|
$posix_glob set +f
|
||||||
IFS=$oIFS
|
IFS=$oIFS
|
||||||
|
|
||||||
prefixes=
|
prefixes=
|
||||||
|
|
@ -444,25 +450,14 @@ do
|
||||||
else
|
else
|
||||||
|
|
||||||
# Make a couple of temp file names in the proper directory.
|
# Make a couple of temp file names in the proper directory.
|
||||||
dsttmp=${dstdirslash}_inst.$$_
|
dsttmp=$dstdir/_inst.$$_
|
||||||
rmtmp=${dstdirslash}_rm.$$_
|
rmtmp=$dstdir/_rm.$$_
|
||||||
|
|
||||||
# Trap to clean up those temp files at exit.
|
# Trap to clean up those temp files at exit.
|
||||||
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
|
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
|
||||||
|
|
||||||
# Copy the file name to the temp name.
|
# Copy the file name to the temp name.
|
||||||
(umask $cp_umask &&
|
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
|
||||||
{ test -z "$stripcmd" || {
|
|
||||||
# Create $dsttmp read-write so that cp doesn't create it read-only,
|
|
||||||
# which would cause strip to fail.
|
|
||||||
if test -z "$doit"; then
|
|
||||||
: >"$dsttmp" # No need to fork-exec 'touch'.
|
|
||||||
else
|
|
||||||
$doit touch "$dsttmp"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
} &&
|
|
||||||
$doit_exec $cpprog "$src" "$dsttmp") &&
|
|
||||||
|
|
||||||
# and set any options; do chmod last to preserve setuid bits.
|
# and set any options; do chmod last to preserve setuid bits.
|
||||||
#
|
#
|
||||||
|
|
@ -479,10 +474,13 @@ do
|
||||||
if $copy_on_change &&
|
if $copy_on_change &&
|
||||||
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
|
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
|
||||||
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
|
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
|
||||||
set -f &&
|
|
||||||
|
eval "$initialize_posix_glob" &&
|
||||||
|
$posix_glob set -f &&
|
||||||
set X $old && old=:$2:$4:$5:$6 &&
|
set X $old && old=:$2:$4:$5:$6 &&
|
||||||
set X $new && new=:$2:$4:$5:$6 &&
|
set X $new && new=:$2:$4:$5:$6 &&
|
||||||
set +f &&
|
$posix_glob set +f &&
|
||||||
|
|
||||||
test "$old" = "$new" &&
|
test "$old" = "$new" &&
|
||||||
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
|
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
|
||||||
then
|
then
|
||||||
|
|
@ -521,9 +519,9 @@ do
|
||||||
done
|
done
|
||||||
|
|
||||||
# Local variables:
|
# Local variables:
|
||||||
# eval: (add-hook 'before-save-hook 'time-stamp)
|
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||||
# time-stamp-start: "scriptversion="
|
# time-stamp-start: "scriptversion="
|
||||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||||
# time-stamp-time-zone: "UTC0"
|
# time-stamp-time-zone: "UTC"
|
||||||
# time-stamp-end: "; # UTC"
|
# time-stamp-end: "; # UTC"
|
||||||
# End:
|
# End:
|
||||||
|
|
|
||||||
14
lib/Makefile.am
Normal file
14
lib/Makefile.am
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
## Process this file with automake to produce Makefile.in
|
||||||
|
|
||||||
|
noinst_LIBRARIES = libvpn.a
|
||||||
|
|
||||||
|
INCLUDES = @INCLUDES@ -I. -I$(top_builddir)
|
||||||
|
|
||||||
|
libvpn_a_SOURCES = xmalloc.c pidfile.c utils.c getopt.c getopt1.c list.c avl_tree.c dropin.c fake-getaddrinfo.c fake-getnameinfo.c
|
||||||
|
|
||||||
|
libvpn_a_LIBADD = @LIBOBJS@ @ALLOCA@
|
||||||
|
libvpn_a_DEPENDENCIES = $(libvpn_a_LIBADD)
|
||||||
|
|
||||||
|
noinst_HEADERS = xalloc.h pidfile.h utils.h getopt.h list.h avl_tree.h dropin.h fake-getaddrinfo.h fake-getnameinfo.h fake-gai-errnos.h ipv6.h ipv4.h ethernet.h
|
||||||
|
|
||||||
|
EXTRA_DIST =
|
||||||
481
lib/Makefile.in
Normal file
481
lib/Makefile.in
Normal file
|
|
@ -0,0 +1,481 @@
|
||||||
|
# Makefile.in generated by automake 1.11.5 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.
|
||||||
|
# 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.
|
||||||
|
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||||
|
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||||
|
# PARTICULAR PURPOSE.
|
||||||
|
|
||||||
|
@SET_MAKE@
|
||||||
|
|
||||||
|
|
||||||
|
VPATH = @srcdir@
|
||||||
|
am__make_dryrun = \
|
||||||
|
{ \
|
||||||
|
am__dry=no; \
|
||||||
|
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;; \
|
||||||
|
esac; \
|
||||||
|
test $$am__dry = yes; \
|
||||||
|
}
|
||||||
|
pkgdatadir = $(datadir)/@PACKAGE@
|
||||||
|
pkgincludedir = $(includedir)/@PACKAGE@
|
||||||
|
pkglibdir = $(libdir)/@PACKAGE@
|
||||||
|
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
||||||
|
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||||
|
install_sh_DATA = $(install_sh) -c -m 644
|
||||||
|
install_sh_PROGRAM = $(install_sh) -c
|
||||||
|
install_sh_SCRIPT = $(install_sh) -c
|
||||||
|
INSTALL_HEADER = $(INSTALL_DATA)
|
||||||
|
transform = $(program_transform_name)
|
||||||
|
NORMAL_INSTALL = :
|
||||||
|
PRE_INSTALL = :
|
||||||
|
POST_INSTALL = :
|
||||||
|
NORMAL_UNINSTALL = :
|
||||||
|
PRE_UNINSTALL = :
|
||||||
|
POST_UNINSTALL = :
|
||||||
|
build_triplet = @build@
|
||||||
|
host_triplet = @host@
|
||||||
|
subdir = lib
|
||||||
|
DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
|
||||||
|
$(srcdir)/Makefile.in alloca.c malloc.c memcmp.c realloc.c
|
||||||
|
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||||
|
am__aclocal_m4_deps = $(top_srcdir)/m4/attribute.m4 \
|
||||||
|
$(top_srcdir)/m4/lzo.m4 $(top_srcdir)/m4/openssl.m4 \
|
||||||
|
$(top_srcdir)/m4/zlib.m4 $(top_srcdir)/configure.in
|
||||||
|
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 =
|
||||||
|
LIBRARIES = $(noinst_LIBRARIES)
|
||||||
|
AR = ar
|
||||||
|
ARFLAGS = cru
|
||||||
|
libvpn_a_AR = $(AR) $(ARFLAGS)
|
||||||
|
am_libvpn_a_OBJECTS = xmalloc.$(OBJEXT) pidfile.$(OBJEXT) \
|
||||||
|
utils.$(OBJEXT) getopt.$(OBJEXT) getopt1.$(OBJEXT) \
|
||||||
|
list.$(OBJEXT) avl_tree.$(OBJEXT) dropin.$(OBJEXT) \
|
||||||
|
fake-getaddrinfo.$(OBJEXT) fake-getnameinfo.$(OBJEXT)
|
||||||
|
libvpn_a_OBJECTS = $(am_libvpn_a_OBJECTS)
|
||||||
|
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
|
||||||
|
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||||
|
am__depfiles_maybe = depfiles
|
||||||
|
am__mv = mv -f
|
||||||
|
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||||
|
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||||
|
CCLD = $(CC)
|
||||||
|
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||||
|
SOURCES = $(libvpn_a_SOURCES)
|
||||||
|
DIST_SOURCES = $(libvpn_a_SOURCES)
|
||||||
|
am__can_run_installinfo = \
|
||||||
|
case $$AM_UPDATE_INFO_DIR in \
|
||||||
|
n|no|NO) false;; \
|
||||||
|
*) (install-info --version) >/dev/null 2>&1;; \
|
||||||
|
esac
|
||||||
|
HEADERS = $(noinst_HEADERS)
|
||||||
|
ETAGS = etags
|
||||||
|
CTAGS = ctags
|
||||||
|
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||||
|
ACLOCAL = @ACLOCAL@
|
||||||
|
ALLOCA = @ALLOCA@
|
||||||
|
AMTAR = @AMTAR@
|
||||||
|
AUTOCONF = @AUTOCONF@
|
||||||
|
AUTOHEADER = @AUTOHEADER@
|
||||||
|
AUTOMAKE = @AUTOMAKE@
|
||||||
|
AWK = @AWK@
|
||||||
|
CC = @CC@
|
||||||
|
CCDEPMODE = @CCDEPMODE@
|
||||||
|
CFLAGS = @CFLAGS@
|
||||||
|
CPP = @CPP@
|
||||||
|
CPPFLAGS = @CPPFLAGS@
|
||||||
|
CYGPATH_W = @CYGPATH_W@
|
||||||
|
DEFS = @DEFS@
|
||||||
|
DEPDIR = @DEPDIR@
|
||||||
|
ECHO_C = @ECHO_C@
|
||||||
|
ECHO_N = @ECHO_N@
|
||||||
|
ECHO_T = @ECHO_T@
|
||||||
|
EGREP = @EGREP@
|
||||||
|
EXEEXT = @EXEEXT@
|
||||||
|
GREP = @GREP@
|
||||||
|
INCLUDES = @INCLUDES@ -I. -I$(top_builddir)
|
||||||
|
INSTALL = @INSTALL@
|
||||||
|
INSTALL_DATA = @INSTALL_DATA@
|
||||||
|
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||||
|
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||||
|
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||||
|
LDFLAGS = @LDFLAGS@
|
||||||
|
LIBOBJS = @LIBOBJS@
|
||||||
|
LIBS = @LIBS@
|
||||||
|
LN_S = @LN_S@
|
||||||
|
LTLIBOBJS = @LTLIBOBJS@
|
||||||
|
MAINT = @MAINT@
|
||||||
|
MAKEINFO = @MAKEINFO@
|
||||||
|
MKDIR_P = @MKDIR_P@
|
||||||
|
OBJEXT = @OBJEXT@
|
||||||
|
PACKAGE = @PACKAGE@
|
||||||
|
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||||
|
PACKAGE_NAME = @PACKAGE_NAME@
|
||||||
|
PACKAGE_STRING = @PACKAGE_STRING@
|
||||||
|
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||||
|
PACKAGE_URL = @PACKAGE_URL@
|
||||||
|
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||||
|
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||||
|
RANLIB = @RANLIB@
|
||||||
|
SET_MAKE = @SET_MAKE@
|
||||||
|
SHELL = @SHELL@
|
||||||
|
STRIP = @STRIP@
|
||||||
|
VERSION = @VERSION@
|
||||||
|
abs_builddir = @abs_builddir@
|
||||||
|
abs_srcdir = @abs_srcdir@
|
||||||
|
abs_top_builddir = @abs_top_builddir@
|
||||||
|
abs_top_srcdir = @abs_top_srcdir@
|
||||||
|
ac_ct_CC = @ac_ct_CC@
|
||||||
|
am__include = @am__include@
|
||||||
|
am__leading_dot = @am__leading_dot@
|
||||||
|
am__quote = @am__quote@
|
||||||
|
am__tar = @am__tar@
|
||||||
|
am__untar = @am__untar@
|
||||||
|
bindir = @bindir@
|
||||||
|
build = @build@
|
||||||
|
build_alias = @build_alias@
|
||||||
|
build_cpu = @build_cpu@
|
||||||
|
build_os = @build_os@
|
||||||
|
build_vendor = @build_vendor@
|
||||||
|
builddir = @builddir@
|
||||||
|
datadir = @datadir@
|
||||||
|
datarootdir = @datarootdir@
|
||||||
|
docdir = @docdir@
|
||||||
|
dvidir = @dvidir@
|
||||||
|
exec_prefix = @exec_prefix@
|
||||||
|
host = @host@
|
||||||
|
host_alias = @host_alias@
|
||||||
|
host_cpu = @host_cpu@
|
||||||
|
host_os = @host_os@
|
||||||
|
host_vendor = @host_vendor@
|
||||||
|
htmldir = @htmldir@
|
||||||
|
includedir = @includedir@
|
||||||
|
infodir = @infodir@
|
||||||
|
install_sh = @install_sh@
|
||||||
|
libdir = @libdir@
|
||||||
|
libexecdir = @libexecdir@
|
||||||
|
localedir = @localedir@
|
||||||
|
localstatedir = @localstatedir@
|
||||||
|
mandir = @mandir@
|
||||||
|
mkdir_p = @mkdir_p@
|
||||||
|
oldincludedir = @oldincludedir@
|
||||||
|
pdfdir = @pdfdir@
|
||||||
|
prefix = @prefix@
|
||||||
|
program_transform_name = @program_transform_name@
|
||||||
|
psdir = @psdir@
|
||||||
|
sbindir = @sbindir@
|
||||||
|
sharedstatedir = @sharedstatedir@
|
||||||
|
srcdir = @srcdir@
|
||||||
|
sysconfdir = @sysconfdir@
|
||||||
|
target_alias = @target_alias@
|
||||||
|
top_build_prefix = @top_build_prefix@
|
||||||
|
top_builddir = @top_builddir@
|
||||||
|
top_srcdir = @top_srcdir@
|
||||||
|
noinst_LIBRARIES = libvpn.a
|
||||||
|
libvpn_a_SOURCES = xmalloc.c pidfile.c utils.c getopt.c getopt1.c list.c avl_tree.c dropin.c fake-getaddrinfo.c fake-getnameinfo.c
|
||||||
|
libvpn_a_LIBADD = @LIBOBJS@ @ALLOCA@
|
||||||
|
libvpn_a_DEPENDENCIES = $(libvpn_a_LIBADD)
|
||||||
|
noinst_HEADERS = xalloc.h pidfile.h utils.h getopt.h list.h avl_tree.h dropin.h fake-getaddrinfo.h fake-getnameinfo.h fake-gai-errnos.h ipv6.h ipv4.h ethernet.h
|
||||||
|
EXTRA_DIST =
|
||||||
|
all: all-am
|
||||||
|
|
||||||
|
.SUFFIXES:
|
||||||
|
.SUFFIXES: .c .o .obj
|
||||||
|
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
|
||||||
|
@for dep in $?; do \
|
||||||
|
case '$(am__configure_deps)' in \
|
||||||
|
*$$dep*) \
|
||||||
|
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
||||||
|
&& { if test -f $@; then exit 0; else break; fi; }; \
|
||||||
|
exit 1;; \
|
||||||
|
esac; \
|
||||||
|
done; \
|
||||||
|
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/Makefile'; \
|
||||||
|
$(am__cd) $(top_srcdir) && \
|
||||||
|
$(AUTOMAKE) --gnu lib/Makefile
|
||||||
|
.PRECIOUS: Makefile
|
||||||
|
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||||
|
@case '$?' in \
|
||||||
|
*config.status*) \
|
||||||
|
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||||
|
*) \
|
||||||
|
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||||
|
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||||
|
esac;
|
||||||
|
|
||||||
|
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||||
|
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||||
|
|
||||||
|
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||||
|
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||||
|
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||||
|
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||||
|
$(am__aclocal_m4_deps):
|
||||||
|
|
||||||
|
clean-noinstLIBRARIES:
|
||||||
|
-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
|
||||||
|
libvpn.a: $(libvpn_a_OBJECTS) $(libvpn_a_DEPENDENCIES) $(EXTRA_libvpn_a_DEPENDENCIES)
|
||||||
|
-rm -f libvpn.a
|
||||||
|
$(libvpn_a_AR) libvpn.a $(libvpn_a_OBJECTS) $(libvpn_a_LIBADD)
|
||||||
|
$(RANLIB) libvpn.a
|
||||||
|
|
||||||
|
mostlyclean-compile:
|
||||||
|
-rm -f *.$(OBJEXT)
|
||||||
|
|
||||||
|
distclean-compile:
|
||||||
|
-rm -f *.tab.c
|
||||||
|
|
||||||
|
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/alloca.Po@am__quote@
|
||||||
|
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/malloc.Po@am__quote@
|
||||||
|
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/memcmp.Po@am__quote@
|
||||||
|
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/realloc.Po@am__quote@
|
||||||
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/avl_tree.Po@am__quote@
|
||||||
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dropin.Po@am__quote@
|
||||||
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fake-getaddrinfo.Po@am__quote@
|
||||||
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fake-getnameinfo.Po@am__quote@
|
||||||
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@
|
||||||
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt1.Po@am__quote@
|
||||||
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list.Po@am__quote@
|
||||||
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pidfile.Po@am__quote@
|
||||||
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utils.Po@am__quote@
|
||||||
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmalloc.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@
|
||||||
|
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||||
|
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
|
||||||
|
|
||||||
|
.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@
|
||||||
|
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||||
|
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
|
||||||
|
|
||||||
|
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||||
|
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||||
|
unique=`for i in $$list; do \
|
||||||
|
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||||
|
done | \
|
||||||
|
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||||
|
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||||
|
mkid -fID $$unique
|
||||||
|
tags: TAGS
|
||||||
|
|
||||||
|
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||||
|
$(TAGS_FILES) $(LISP)
|
||||||
|
set x; \
|
||||||
|
here=`pwd`; \
|
||||||
|
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||||
|
unique=`for i in $$list; do \
|
||||||
|
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||||
|
done | \
|
||||||
|
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||||
|
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||||
|
shift; \
|
||||||
|
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||||
|
test -n "$$unique" || unique=$$empty_fix; \
|
||||||
|
if test $$# -gt 0; then \
|
||||||
|
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||||
|
"$$@" $$unique; \
|
||||||
|
else \
|
||||||
|
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||||
|
$$unique; \
|
||||||
|
fi; \
|
||||||
|
fi
|
||||||
|
ctags: CTAGS
|
||||||
|
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||||
|
$(TAGS_FILES) $(LISP)
|
||||||
|
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||||
|
unique=`for i in $$list; do \
|
||||||
|
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||||
|
done | \
|
||||||
|
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||||
|
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||||
|
test -z "$(CTAGS_ARGS)$$unique" \
|
||||||
|
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||||
|
$$unique
|
||||||
|
|
||||||
|
GTAGS:
|
||||||
|
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||||
|
&& $(am__cd) $(top_srcdir) \
|
||||||
|
&& gtags -i $(GTAGS_ARGS) "$$here"
|
||||||
|
|
||||||
|
distclean-tags:
|
||||||
|
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||||
|
|
||||||
|
distdir: $(DISTFILES)
|
||||||
|
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||||
|
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||||
|
list='$(DISTFILES)'; \
|
||||||
|
dist_files=`for file in $$list; do echo $$file; done | \
|
||||||
|
sed -e "s|^$$srcdirstrip/||;t" \
|
||||||
|
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||||
|
case $$dist_files in \
|
||||||
|
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||||
|
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||||
|
sort -u` ;; \
|
||||||
|
esac; \
|
||||||
|
for file in $$dist_files; do \
|
||||||
|
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||||
|
if test -d $$d/$$file; then \
|
||||||
|
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||||
|
if test -d "$(distdir)/$$file"; then \
|
||||||
|
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||||
|
fi; \
|
||||||
|
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||||
|
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
||||||
|
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||||
|
fi; \
|
||||||
|
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
||||||
|
else \
|
||||||
|
test -f "$(distdir)/$$file" \
|
||||||
|
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
||||||
|
|| exit 1; \
|
||||||
|
fi; \
|
||||||
|
done
|
||||||
|
check-am: all-am
|
||||||
|
check: check-am
|
||||||
|
all-am: Makefile $(LIBRARIES) $(HEADERS)
|
||||||
|
installdirs:
|
||||||
|
install: install-am
|
||||||
|
install-exec: install-exec-am
|
||||||
|
install-data: install-data-am
|
||||||
|
uninstall: uninstall-am
|
||||||
|
|
||||||
|
install-am: all-am
|
||||||
|
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||||
|
|
||||||
|
installcheck: installcheck-am
|
||||||
|
install-strip:
|
||||||
|
if test -z '$(STRIP)'; then \
|
||||||
|
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||||
|
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||||
|
install; \
|
||||||
|
else \
|
||||||
|
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||||
|
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||||
|
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
||||||
|
fi
|
||||||
|
mostlyclean-generic:
|
||||||
|
|
||||||
|
clean-generic:
|
||||||
|
|
||||||
|
distclean-generic:
|
||||||
|
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||||
|
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||||
|
|
||||||
|
maintainer-clean-generic:
|
||||||
|
@echo "This command is intended for maintainers to use"
|
||||||
|
@echo "it deletes files that may require special tools to rebuild."
|
||||||
|
clean: clean-am
|
||||||
|
|
||||||
|
clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am
|
||||||
|
|
||||||
|
distclean: distclean-am
|
||||||
|
-rm -rf $(DEPDIR) ./$(DEPDIR)
|
||||||
|
-rm -f Makefile
|
||||||
|
distclean-am: clean-am distclean-compile distclean-generic \
|
||||||
|
distclean-tags
|
||||||
|
|
||||||
|
dvi: dvi-am
|
||||||
|
|
||||||
|
dvi-am:
|
||||||
|
|
||||||
|
html: html-am
|
||||||
|
|
||||||
|
html-am:
|
||||||
|
|
||||||
|
info: info-am
|
||||||
|
|
||||||
|
info-am:
|
||||||
|
|
||||||
|
install-data-am:
|
||||||
|
|
||||||
|
install-dvi: install-dvi-am
|
||||||
|
|
||||||
|
install-dvi-am:
|
||||||
|
|
||||||
|
install-exec-am:
|
||||||
|
|
||||||
|
install-html: install-html-am
|
||||||
|
|
||||||
|
install-html-am:
|
||||||
|
|
||||||
|
install-info: install-info-am
|
||||||
|
|
||||||
|
install-info-am:
|
||||||
|
|
||||||
|
install-man:
|
||||||
|
|
||||||
|
install-pdf: install-pdf-am
|
||||||
|
|
||||||
|
install-pdf-am:
|
||||||
|
|
||||||
|
install-ps: install-ps-am
|
||||||
|
|
||||||
|
install-ps-am:
|
||||||
|
|
||||||
|
installcheck-am:
|
||||||
|
|
||||||
|
maintainer-clean: maintainer-clean-am
|
||||||
|
-rm -rf $(DEPDIR) ./$(DEPDIR)
|
||||||
|
-rm -f Makefile
|
||||||
|
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||||
|
|
||||||
|
mostlyclean: mostlyclean-am
|
||||||
|
|
||||||
|
mostlyclean-am: mostlyclean-compile mostlyclean-generic
|
||||||
|
|
||||||
|
pdf: pdf-am
|
||||||
|
|
||||||
|
pdf-am:
|
||||||
|
|
||||||
|
ps: ps-am
|
||||||
|
|
||||||
|
ps-am:
|
||||||
|
|
||||||
|
uninstall-am:
|
||||||
|
|
||||||
|
.MAKE: install-am install-strip
|
||||||
|
|
||||||
|
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
|
||||||
|
clean-noinstLIBRARIES ctags 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-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
|
||||||
|
|
||||||
|
|
||||||
|
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||||
|
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||||
|
.NOEXPORT:
|
||||||
494
lib/alloca.c
Normal file
494
lib/alloca.c
Normal file
|
|
@ -0,0 +1,494 @@
|
||||||
|
/* alloca.c -- allocate automatically reclaimed memory
|
||||||
|
(Mostly) portable public-domain implementation -- D A Gwyn
|
||||||
|
|
||||||
|
This implementation of the PWB library alloca function,
|
||||||
|
which is used to allocate space off the run-time stack so
|
||||||
|
that it is automatically reclaimed upon procedure exit,
|
||||||
|
was inspired by discussions with J. Q. Johnson of Cornell.
|
||||||
|
J.Otto Tennant <jot@cray.com> contributed the Cray support.
|
||||||
|
|
||||||
|
There are some preprocessor constants that can
|
||||||
|
be defined when compiling for your specific system, for
|
||||||
|
improved efficiency; however, the defaults should be okay.
|
||||||
|
|
||||||
|
The general concept of this implementation is to keep
|
||||||
|
track of all alloca-allocated blocks, and reclaim any
|
||||||
|
that are found to be deeper in the stack than the current
|
||||||
|
invocation. This heuristic does not reclaim storage as
|
||||||
|
soon as it becomes invalid, but it will do so eventually.
|
||||||
|
|
||||||
|
As a special case, alloca(0) reclaims storage without
|
||||||
|
allocating any. It is a good idea to use alloca(0) in
|
||||||
|
your main control loop, etc. to force garbage collection. */
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
# include <config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef emacs
|
||||||
|
# include "blockinput.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* If compiling with GCC 2, this file's not needed. */
|
||||||
|
#if !defined (__GNUC__) || __GNUC__ < 2
|
||||||
|
|
||||||
|
/* If someone has defined alloca as a macro,
|
||||||
|
there must be some other way alloca is supposed to work. */
|
||||||
|
# ifndef alloca
|
||||||
|
|
||||||
|
# ifdef emacs
|
||||||
|
# ifdef static
|
||||||
|
/* actually, only want this if static is defined as ""
|
||||||
|
-- this is for usg, in which emacs must undefine static
|
||||||
|
in order to make unexec workable
|
||||||
|
*/
|
||||||
|
# ifndef STACK_DIRECTION
|
||||||
|
you
|
||||||
|
lose
|
||||||
|
-- must know STACK_DIRECTION at compile-time
|
||||||
|
# endif /* STACK_DIRECTION undefined */
|
||||||
|
# endif /* static */
|
||||||
|
# endif /* emacs */
|
||||||
|
|
||||||
|
/* If your stack is a linked list of frames, you have to
|
||||||
|
provide an "address metric" ADDRESS_FUNCTION macro. */
|
||||||
|
|
||||||
|
# if defined (CRAY) && defined (CRAY_STACKSEG_END)
|
||||||
|
long i00afunc ();
|
||||||
|
# define ADDRESS_FUNCTION(arg) (char *) i00afunc (&(arg))
|
||||||
|
# else
|
||||||
|
# define ADDRESS_FUNCTION(arg) &(arg)
|
||||||
|
# endif
|
||||||
|
|
||||||
|
# if __STDC__
|
||||||
|
typedef void *pointer;
|
||||||
|
# else
|
||||||
|
typedef char *pointer;
|
||||||
|
# endif
|
||||||
|
|
||||||
|
# ifndef NULL
|
||||||
|
# define NULL 0
|
||||||
|
# endif
|
||||||
|
|
||||||
|
/* Different portions of Emacs need to call different versions of
|
||||||
|
malloc. The Emacs executable needs alloca to call xmalloc, because
|
||||||
|
ordinary malloc isn't protected from input signals. On the other
|
||||||
|
hand, the utilities in lib-src need alloca to call malloc; some of
|
||||||
|
them are very simple, and don't have an xmalloc routine.
|
||||||
|
|
||||||
|
Non-Emacs programs expect this to call xmalloc.
|
||||||
|
|
||||||
|
Callers below should use malloc. */
|
||||||
|
|
||||||
|
# ifndef emacs
|
||||||
|
# define malloc xmalloc
|
||||||
|
# endif
|
||||||
|
extern pointer malloc ();
|
||||||
|
|
||||||
|
/* Define STACK_DIRECTION if you know the direction of stack
|
||||||
|
growth for your system; otherwise it will be automatically
|
||||||
|
deduced at run-time.
|
||||||
|
|
||||||
|
STACK_DIRECTION > 0 => grows toward higher addresses
|
||||||
|
STACK_DIRECTION < 0 => grows toward lower addresses
|
||||||
|
STACK_DIRECTION = 0 => direction of growth unknown */
|
||||||
|
|
||||||
|
# ifndef STACK_DIRECTION
|
||||||
|
# define STACK_DIRECTION 0 /* Direction unknown. */
|
||||||
|
# endif
|
||||||
|
|
||||||
|
# if STACK_DIRECTION != 0
|
||||||
|
|
||||||
|
# define STACK_DIR STACK_DIRECTION /* Known at compile-time. */
|
||||||
|
|
||||||
|
# else /* STACK_DIRECTION == 0; need run-time code. */
|
||||||
|
|
||||||
|
static int stack_dir; /* 1 or -1 once known. */
|
||||||
|
# define STACK_DIR stack_dir
|
||||||
|
|
||||||
|
static void
|
||||||
|
find_stack_direction ()
|
||||||
|
{
|
||||||
|
static char *addr = NULL; /* Address of first `dummy', once known. */
|
||||||
|
auto char dummy; /* To get stack address. */
|
||||||
|
|
||||||
|
if (addr == NULL)
|
||||||
|
{ /* Initial entry. */
|
||||||
|
addr = ADDRESS_FUNCTION (dummy);
|
||||||
|
|
||||||
|
find_stack_direction (); /* Recurse once. */
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Second entry. */
|
||||||
|
if (ADDRESS_FUNCTION (dummy) > addr)
|
||||||
|
stack_dir = 1; /* Stack grew upward. */
|
||||||
|
else
|
||||||
|
stack_dir = -1; /* Stack grew downward. */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# endif /* STACK_DIRECTION == 0 */
|
||||||
|
|
||||||
|
/* An "alloca header" is used to:
|
||||||
|
(a) chain together all alloca'ed blocks;
|
||||||
|
(b) keep track of stack depth.
|
||||||
|
|
||||||
|
It is very important that sizeof(header) agree with malloc
|
||||||
|
alignment chunk size. The following default should work okay. */
|
||||||
|
|
||||||
|
# ifndef ALIGN_SIZE
|
||||||
|
# define ALIGN_SIZE sizeof(double)
|
||||||
|
# endif
|
||||||
|
|
||||||
|
typedef union hdr
|
||||||
|
{
|
||||||
|
char align[ALIGN_SIZE]; /* To force sizeof(header). */
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
union hdr *next; /* For chaining headers. */
|
||||||
|
char *deep; /* For stack depth measure. */
|
||||||
|
} h;
|
||||||
|
} header;
|
||||||
|
|
||||||
|
static header *last_alloca_header = NULL; /* -> last alloca header. */
|
||||||
|
|
||||||
|
/* Return a pointer to at least SIZE bytes of storage,
|
||||||
|
which will be automatically reclaimed upon exit from
|
||||||
|
the procedure that called alloca. Originally, this space
|
||||||
|
was supposed to be taken from the current stack frame of the
|
||||||
|
caller, but that method cannot be made to work for some
|
||||||
|
implementations of C, for example under Gould's UTX/32. */
|
||||||
|
|
||||||
|
pointer
|
||||||
|
alloca (size)
|
||||||
|
unsigned size;
|
||||||
|
{
|
||||||
|
auto char probe; /* Probes stack depth: */
|
||||||
|
register char *depth = ADDRESS_FUNCTION (probe);
|
||||||
|
|
||||||
|
# if STACK_DIRECTION == 0
|
||||||
|
if (STACK_DIR == 0) /* Unknown growth direction. */
|
||||||
|
find_stack_direction ();
|
||||||
|
# endif
|
||||||
|
|
||||||
|
/* Reclaim garbage, defined as all alloca'd storage that
|
||||||
|
was allocated from deeper in the stack than currently. */
|
||||||
|
|
||||||
|
{
|
||||||
|
register header *hp; /* Traverses linked list. */
|
||||||
|
|
||||||
|
# ifdef emacs
|
||||||
|
BLOCK_INPUT;
|
||||||
|
# endif
|
||||||
|
|
||||||
|
for (hp = last_alloca_header; hp != NULL;)
|
||||||
|
if ((STACK_DIR > 0 && hp->h.deep > depth)
|
||||||
|
|| (STACK_DIR < 0 && hp->h.deep < depth))
|
||||||
|
{
|
||||||
|
register header *np = hp->h.next;
|
||||||
|
|
||||||
|
free ((pointer) hp); /* Collect garbage. */
|
||||||
|
|
||||||
|
hp = np; /* -> next header. */
|
||||||
|
}
|
||||||
|
else
|
||||||
|
break; /* Rest are not deeper. */
|
||||||
|
|
||||||
|
last_alloca_header = hp; /* -> last valid storage. */
|
||||||
|
|
||||||
|
# ifdef emacs
|
||||||
|
UNBLOCK_INPUT;
|
||||||
|
# endif
|
||||||
|
}
|
||||||
|
|
||||||
|
if (size == 0)
|
||||||
|
return NULL; /* No allocation required. */
|
||||||
|
|
||||||
|
/* Allocate combined header + user data storage. */
|
||||||
|
|
||||||
|
{
|
||||||
|
register pointer new = malloc (sizeof (header) + size);
|
||||||
|
/* Address of header. */
|
||||||
|
|
||||||
|
((header *) new)->h.next = last_alloca_header;
|
||||||
|
((header *) new)->h.deep = depth;
|
||||||
|
|
||||||
|
last_alloca_header = (header *) new;
|
||||||
|
|
||||||
|
/* User storage begins just after header. */
|
||||||
|
|
||||||
|
return (pointer) ((char *) new + sizeof (header));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# if defined (CRAY) && defined (CRAY_STACKSEG_END)
|
||||||
|
|
||||||
|
# ifdef DEBUG_I00AFUNC
|
||||||
|
# include <stdio.h>
|
||||||
|
# endif
|
||||||
|
|
||||||
|
# ifndef CRAY_STACK
|
||||||
|
# define CRAY_STACK
|
||||||
|
# ifndef CRAY2
|
||||||
|
/* Stack structures for CRAY-1, CRAY X-MP, and CRAY Y-MP */
|
||||||
|
struct stack_control_header
|
||||||
|
{
|
||||||
|
long shgrow:32; /* Number of times stack has grown. */
|
||||||
|
long shaseg:32; /* Size of increments to stack. */
|
||||||
|
long shhwm:32; /* High water mark of stack. */
|
||||||
|
long shsize:32; /* Current size of stack (all segments). */
|
||||||
|
};
|
||||||
|
|
||||||
|
/* The stack segment linkage control information occurs at
|
||||||
|
the high-address end of a stack segment. (The stack
|
||||||
|
grows from low addresses to high addresses.) The initial
|
||||||
|
part of the stack segment linkage control information is
|
||||||
|
0200 (octal) words. This provides for register storage
|
||||||
|
for the routine which overflows the stack. */
|
||||||
|
|
||||||
|
struct stack_segment_linkage
|
||||||
|
{
|
||||||
|
long ss[0200]; /* 0200 overflow words. */
|
||||||
|
long sssize:32; /* Number of words in this segment. */
|
||||||
|
long ssbase:32; /* Offset to stack base. */
|
||||||
|
long:32;
|
||||||
|
long sspseg:32; /* Offset to linkage control of previous
|
||||||
|
segment of stack. */
|
||||||
|
long:32;
|
||||||
|
long sstcpt:32; /* Pointer to task common address block. */
|
||||||
|
long sscsnm; /* Private control structure number for
|
||||||
|
microtasking. */
|
||||||
|
long ssusr1; /* Reserved for user. */
|
||||||
|
long ssusr2; /* Reserved for user. */
|
||||||
|
long sstpid; /* Process ID for pid based multi-tasking. */
|
||||||
|
long ssgvup; /* Pointer to multitasking thread giveup. */
|
||||||
|
long sscray[7]; /* Reserved for Cray Research. */
|
||||||
|
long ssa0;
|
||||||
|
long ssa1;
|
||||||
|
long ssa2;
|
||||||
|
long ssa3;
|
||||||
|
long ssa4;
|
||||||
|
long ssa5;
|
||||||
|
long ssa6;
|
||||||
|
long ssa7;
|
||||||
|
long sss0;
|
||||||
|
long sss1;
|
||||||
|
long sss2;
|
||||||
|
long sss3;
|
||||||
|
long sss4;
|
||||||
|
long sss5;
|
||||||
|
long sss6;
|
||||||
|
long sss7;
|
||||||
|
};
|
||||||
|
|
||||||
|
# else /* CRAY2 */
|
||||||
|
/* The following structure defines the vector of words
|
||||||
|
returned by the STKSTAT library routine. */
|
||||||
|
struct stk_stat
|
||||||
|
{
|
||||||
|
long now; /* Current total stack size. */
|
||||||
|
long maxc; /* Amount of contiguous space which would
|
||||||
|
be required to satisfy the maximum
|
||||||
|
stack demand to date. */
|
||||||
|
long high_water; /* Stack high-water mark. */
|
||||||
|
long overflows; /* Number of stack overflow ($STKOFEN) calls. */
|
||||||
|
long hits; /* Number of internal buffer hits. */
|
||||||
|
long extends; /* Number of block extensions. */
|
||||||
|
long stko_mallocs; /* Block allocations by $STKOFEN. */
|
||||||
|
long underflows; /* Number of stack underflow calls ($STKRETN). */
|
||||||
|
long stko_free; /* Number of deallocations by $STKRETN. */
|
||||||
|
long stkm_free; /* Number of deallocations by $STKMRET. */
|
||||||
|
long segments; /* Current number of stack segments. */
|
||||||
|
long maxs; /* Maximum number of stack segments so far. */
|
||||||
|
long pad_size; /* Stack pad size. */
|
||||||
|
long current_address; /* Current stack segment address. */
|
||||||
|
long current_size; /* Current stack segment size. This
|
||||||
|
number is actually corrupted by STKSTAT to
|
||||||
|
include the fifteen word trailer area. */
|
||||||
|
long initial_address; /* Address of initial segment. */
|
||||||
|
long initial_size; /* Size of initial segment. */
|
||||||
|
};
|
||||||
|
|
||||||
|
/* The following structure describes the data structure which trails
|
||||||
|
any stack segment. I think that the description in 'asdef' is
|
||||||
|
out of date. I only describe the parts that I am sure about. */
|
||||||
|
|
||||||
|
struct stk_trailer
|
||||||
|
{
|
||||||
|
long this_address; /* Address of this block. */
|
||||||
|
long this_size; /* Size of this block (does not include
|
||||||
|
this trailer). */
|
||||||
|
long unknown2;
|
||||||
|
long unknown3;
|
||||||
|
long link; /* Address of trailer block of previous
|
||||||
|
segment. */
|
||||||
|
long unknown5;
|
||||||
|
long unknown6;
|
||||||
|
long unknown7;
|
||||||
|
long unknown8;
|
||||||
|
long unknown9;
|
||||||
|
long unknown10;
|
||||||
|
long unknown11;
|
||||||
|
long unknown12;
|
||||||
|
long unknown13;
|
||||||
|
long unknown14;
|
||||||
|
};
|
||||||
|
|
||||||
|
# endif /* CRAY2 */
|
||||||
|
# endif /* not CRAY_STACK */
|
||||||
|
|
||||||
|
# ifdef CRAY2
|
||||||
|
/* Determine a "stack measure" for an arbitrary ADDRESS.
|
||||||
|
I doubt that "lint" will like this much. */
|
||||||
|
|
||||||
|
static long
|
||||||
|
i00afunc (long *address)
|
||||||
|
{
|
||||||
|
struct stk_stat status;
|
||||||
|
struct stk_trailer *trailer;
|
||||||
|
long *block, size;
|
||||||
|
long result = 0;
|
||||||
|
|
||||||
|
/* We want to iterate through all of the segments. The first
|
||||||
|
step is to get the stack status structure. We could do this
|
||||||
|
more quickly and more directly, perhaps, by referencing the
|
||||||
|
$LM00 common block, but I know that this works. */
|
||||||
|
|
||||||
|
STKSTAT (&status);
|
||||||
|
|
||||||
|
/* Set up the iteration. */
|
||||||
|
|
||||||
|
trailer = (struct stk_trailer *) (status.current_address
|
||||||
|
+ status.current_size
|
||||||
|
- 15);
|
||||||
|
|
||||||
|
/* There must be at least one stack segment. Therefore it is
|
||||||
|
a fatal error if "trailer" is null. */
|
||||||
|
|
||||||
|
if (trailer == 0)
|
||||||
|
abort ();
|
||||||
|
|
||||||
|
/* Discard segments that do not contain our argument address. */
|
||||||
|
|
||||||
|
while (trailer != 0)
|
||||||
|
{
|
||||||
|
block = (long *) trailer->this_address;
|
||||||
|
size = trailer->this_size;
|
||||||
|
if (block == 0 || size == 0)
|
||||||
|
abort ();
|
||||||
|
trailer = (struct stk_trailer *) trailer->link;
|
||||||
|
if ((block <= address) && (address < (block + size)))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Set the result to the offset in this segment and add the sizes
|
||||||
|
of all predecessor segments. */
|
||||||
|
|
||||||
|
result = address - block;
|
||||||
|
|
||||||
|
if (trailer == 0)
|
||||||
|
{
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
if (trailer->this_size <= 0)
|
||||||
|
abort ();
|
||||||
|
result += trailer->this_size;
|
||||||
|
trailer = (struct stk_trailer *) trailer->link;
|
||||||
|
}
|
||||||
|
while (trailer != 0);
|
||||||
|
|
||||||
|
/* We are done. Note that if you present a bogus address (one
|
||||||
|
not in any segment), you will get a different number back, formed
|
||||||
|
from subtracting the address of the first block. This is probably
|
||||||
|
not what you want. */
|
||||||
|
|
||||||
|
return (result);
|
||||||
|
}
|
||||||
|
|
||||||
|
# else /* not CRAY2 */
|
||||||
|
/* Stack address function for a CRAY-1, CRAY X-MP, or CRAY Y-MP.
|
||||||
|
Determine the number of the cell within the stack,
|
||||||
|
given the address of the cell. The purpose of this
|
||||||
|
routine is to linearize, in some sense, stack addresses
|
||||||
|
for alloca. */
|
||||||
|
|
||||||
|
static long
|
||||||
|
i00afunc (long address)
|
||||||
|
{
|
||||||
|
long stkl = 0;
|
||||||
|
|
||||||
|
long size, pseg, this_segment, stack;
|
||||||
|
long result = 0;
|
||||||
|
|
||||||
|
struct stack_segment_linkage *ssptr;
|
||||||
|
|
||||||
|
/* Register B67 contains the address of the end of the
|
||||||
|
current stack segment. If you (as a subprogram) store
|
||||||
|
your registers on the stack and find that you are past
|
||||||
|
the contents of B67, you have overflowed the segment.
|
||||||
|
|
||||||
|
B67 also points to the stack segment linkage control
|
||||||
|
area, which is what we are really interested in. */
|
||||||
|
|
||||||
|
stkl = CRAY_STACKSEG_END ();
|
||||||
|
ssptr = (struct stack_segment_linkage *) stkl;
|
||||||
|
|
||||||
|
/* If one subtracts 'size' from the end of the segment,
|
||||||
|
one has the address of the first word of the segment.
|
||||||
|
|
||||||
|
If this is not the first segment, 'pseg' will be
|
||||||
|
nonzero. */
|
||||||
|
|
||||||
|
pseg = ssptr->sspseg;
|
||||||
|
size = ssptr->sssize;
|
||||||
|
|
||||||
|
this_segment = stkl - size;
|
||||||
|
|
||||||
|
/* It is possible that calling this routine itself caused
|
||||||
|
a stack overflow. Discard stack segments which do not
|
||||||
|
contain the target address. */
|
||||||
|
|
||||||
|
while (!(this_segment <= address && address <= stkl))
|
||||||
|
{
|
||||||
|
# ifdef DEBUG_I00AFUNC
|
||||||
|
fprintf (stderr, "%011o %011o %011o\n", this_segment, address, stkl);
|
||||||
|
# endif
|
||||||
|
if (pseg == 0)
|
||||||
|
break;
|
||||||
|
stkl = stkl - pseg;
|
||||||
|
ssptr = (struct stack_segment_linkage *) stkl;
|
||||||
|
size = ssptr->sssize;
|
||||||
|
pseg = ssptr->sspseg;
|
||||||
|
this_segment = stkl - size;
|
||||||
|
}
|
||||||
|
|
||||||
|
result = address - this_segment;
|
||||||
|
|
||||||
|
/* If you subtract pseg from the current end of the stack,
|
||||||
|
you get the address of the previous stack segment's end.
|
||||||
|
This seems a little convoluted to me, but I'll bet you save
|
||||||
|
a cycle somewhere. */
|
||||||
|
|
||||||
|
while (pseg != 0)
|
||||||
|
{
|
||||||
|
# ifdef DEBUG_I00AFUNC
|
||||||
|
fprintf (stderr, "%011o %011o\n", pseg, size);
|
||||||
|
# endif
|
||||||
|
stkl = stkl - pseg;
|
||||||
|
ssptr = (struct stack_segment_linkage *) stkl;
|
||||||
|
size = ssptr->sssize;
|
||||||
|
pseg = ssptr->sspseg;
|
||||||
|
result += size;
|
||||||
|
}
|
||||||
|
return (result);
|
||||||
|
}
|
||||||
|
|
||||||
|
# endif /* not CRAY2 */
|
||||||
|
# endif /* CRAY */
|
||||||
|
|
||||||
|
# endif /* no alloca */
|
||||||
|
#endif /* not GCC version 2 */
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
avl_tree.c -- avl_ tree and linked list convenience
|
avl_tree.c -- avl_ tree and linked list convenience
|
||||||
Copyright (C) 1998 Michael H. Buselli
|
Copyright (C) 1998 Michael H. Buselli
|
||||||
2000-2005 Ivo Timmermans,
|
2000-2005 Ivo Timmermans,
|
||||||
2000-2015 Guus Sliepen <guus@tinc-vpn.org>
|
2000-2006 Guus Sliepen <guus@tinc-vpn.org>
|
||||||
2000-2005 Wessel Dankers <wsl@tinc-vpn.org>
|
2000-2005 Wessel Dankers <wsl@tinc-vpn.org>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
the code. Mail me if you found a bug.
|
the code. Mail me if you found a bug.
|
||||||
|
|
||||||
Cleaned up and incorporated some of the ideas from the red-black tree
|
Cleaned up and incorporated some of the ideas from the red-black tree
|
||||||
library for inclusion into tinc (https://www.tinc-vpn.org/) by
|
library for inclusion into tinc (http://www.tinc-vpn.org/) by
|
||||||
Guus Sliepen <guus@tinc-vpn.org>.
|
Guus Sliepen <guus@tinc-vpn.org>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -50,14 +50,14 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef AVL_DEPTH
|
#ifndef AVL_DEPTH
|
||||||
static int lg(unsigned int u) __attribute__((__const__));
|
static int lg(unsigned int u) __attribute__ ((__const__));
|
||||||
|
|
||||||
static int lg(unsigned int u) {
|
static int lg(unsigned int u)
|
||||||
|
{
|
||||||
int r = 1;
|
int r = 1;
|
||||||
|
|
||||||
if(!u) {
|
if(!u)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
|
||||||
|
|
||||||
if(u & 0xffff0000) {
|
if(u & 0xffff0000) {
|
||||||
u >>= 16;
|
u >>= 16;
|
||||||
|
|
@ -79,9 +79,8 @@ static int lg(unsigned int u) {
|
||||||
r += 2;
|
r += 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(u & 0x00000002) {
|
if(u & 0x00000002)
|
||||||
r++;
|
r++;
|
||||||
}
|
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
@ -89,7 +88,8 @@ static int lg(unsigned int u) {
|
||||||
|
|
||||||
/* Internal helper functions */
|
/* Internal helper functions */
|
||||||
|
|
||||||
static int avl_check_balance(const avl_node_t *node) {
|
static int avl_check_balance(const avl_node_t *node)
|
||||||
|
{
|
||||||
#ifdef AVL_DEPTH
|
#ifdef AVL_DEPTH
|
||||||
int d;
|
int d;
|
||||||
|
|
||||||
|
|
@ -97,7 +97,7 @@ static int avl_check_balance(const avl_node_t *node) {
|
||||||
|
|
||||||
return d < -1 ? -1 : d > 1 ? 1 : 0;
|
return d < -1 ? -1 : d > 1 ? 1 : 0;
|
||||||
#else
|
#else
|
||||||
/* int d;
|
/* int d;
|
||||||
* d = lg(AVL_R_COUNT(node)) - lg(AVL_L_COUNT(node));
|
* d = lg(AVL_R_COUNT(node)) - lg(AVL_L_COUNT(node));
|
||||||
* d = d<-1?-1:d>1?1:0;
|
* d = d<-1?-1:d>1?1:0;
|
||||||
*/
|
*/
|
||||||
|
|
@ -106,24 +106,25 @@ static int avl_check_balance(const avl_node_t *node) {
|
||||||
pl = lg(AVL_L_COUNT(node));
|
pl = lg(AVL_L_COUNT(node));
|
||||||
r = AVL_R_COUNT(node);
|
r = AVL_R_COUNT(node);
|
||||||
|
|
||||||
if(r >> pl + 1) {
|
if(r >> pl + 1)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
|
||||||
|
|
||||||
if(pl < 2 || r >> pl - 2) {
|
if(pl < 2 || r >> pl - 2)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void avl_rebalance(avl_tree_t *tree, avl_node_t *node) {
|
static void avl_rebalance(avl_tree_t *tree, avl_node_t *node)
|
||||||
|
{
|
||||||
avl_node_t *child;
|
avl_node_t *child;
|
||||||
avl_node_t *gchild;
|
avl_node_t *gchild;
|
||||||
avl_node_t *parent;
|
avl_node_t *parent;
|
||||||
avl_node_t **superparent;
|
avl_node_t **superparent;
|
||||||
|
|
||||||
|
parent = node;
|
||||||
|
|
||||||
while(node) {
|
while(node) {
|
||||||
parent = node->parent;
|
parent = node->parent;
|
||||||
|
|
||||||
|
|
@ -131,21 +132,17 @@ static void avl_rebalance(avl_tree_t *tree, avl_node_t *node) {
|
||||||
parent ? node ==
|
parent ? node ==
|
||||||
parent->left ? &parent->left : &parent->right : &tree->root;
|
parent->left ? &parent->left : &parent->right : &tree->root;
|
||||||
|
|
||||||
switch(avl_check_balance(node)) {
|
switch (avl_check_balance(node)) {
|
||||||
case -1:
|
case -1:
|
||||||
child = node->left;
|
child = node->left;
|
||||||
#ifdef AVL_DEPTH
|
#ifdef AVL_DEPTH
|
||||||
|
|
||||||
if(L_AVL_DEPTH(child) >= R_AVL_DEPTH(child)) {
|
if(L_AVL_DEPTH(child) >= R_AVL_DEPTH(child)) {
|
||||||
#else
|
#else
|
||||||
|
|
||||||
if(AVL_L_COUNT(child) >= AVL_R_COUNT(child)) {
|
if(AVL_L_COUNT(child) >= AVL_R_COUNT(child)) {
|
||||||
#endif
|
#endif
|
||||||
node->left = child->right;
|
node->left = child->right;
|
||||||
|
if(node->left)
|
||||||
if(node->left) {
|
|
||||||
node->left->parent = node;
|
node->left->parent = node;
|
||||||
}
|
|
||||||
|
|
||||||
child->right = node;
|
child->right = node;
|
||||||
node->parent = child;
|
node->parent = child;
|
||||||
|
|
@ -163,24 +160,22 @@ static void avl_rebalance(avl_tree_t *tree, avl_node_t *node) {
|
||||||
gchild = child->right;
|
gchild = child->right;
|
||||||
node->left = gchild->right;
|
node->left = gchild->right;
|
||||||
|
|
||||||
if(node->left) {
|
if(node->left)
|
||||||
node->left->parent = node;
|
node->left->parent = node;
|
||||||
}
|
|
||||||
|
|
||||||
child->right = gchild->left;
|
child->right = gchild->left;
|
||||||
|
|
||||||
if(child->right) {
|
if(child->right)
|
||||||
child->right->parent = child;
|
child->right->parent = child;
|
||||||
}
|
|
||||||
|
|
||||||
gchild->right = node;
|
gchild->right = node;
|
||||||
|
|
||||||
|
if(gchild->right)
|
||||||
gchild->right->parent = gchild;
|
gchild->right->parent = gchild;
|
||||||
gchild->left = child;
|
gchild->left = child;
|
||||||
|
|
||||||
|
if(gchild->left)
|
||||||
gchild->left->parent = gchild;
|
gchild->left->parent = gchild;
|
||||||
|
|
||||||
*superparent = gchild;
|
*superparent = gchild;
|
||||||
|
|
||||||
gchild->parent = parent;
|
gchild->parent = parent;
|
||||||
#ifdef AVL_COUNT
|
#ifdef AVL_COUNT
|
||||||
node->count = AVL_CALC_COUNT(node);
|
node->count = AVL_CALC_COUNT(node);
|
||||||
|
|
@ -193,24 +188,18 @@ static void avl_rebalance(avl_tree_t *tree, avl_node_t *node) {
|
||||||
gchild->depth = AVL_CALC_DEPTH(gchild);
|
gchild->depth = AVL_CALC_DEPTH(gchild);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
child = node->right;
|
child = node->right;
|
||||||
#ifdef AVL_DEPTH
|
#ifdef AVL_DEPTH
|
||||||
|
|
||||||
if(R_AVL_DEPTH(child) >= L_AVL_DEPTH(child)) {
|
if(R_AVL_DEPTH(child) >= L_AVL_DEPTH(child)) {
|
||||||
#else
|
#else
|
||||||
|
|
||||||
if(AVL_R_COUNT(child) >= AVL_L_COUNT(child)) {
|
if(AVL_R_COUNT(child) >= AVL_L_COUNT(child)) {
|
||||||
#endif
|
#endif
|
||||||
node->right = child->left;
|
node->right = child->left;
|
||||||
|
if(node->right)
|
||||||
if(node->right) {
|
|
||||||
node->right->parent = node;
|
node->right->parent = node;
|
||||||
}
|
|
||||||
|
|
||||||
child->left = node;
|
child->left = node;
|
||||||
node->parent = child;
|
node->parent = child;
|
||||||
*superparent = child;
|
*superparent = child;
|
||||||
|
|
@ -227,21 +216,19 @@ static void avl_rebalance(avl_tree_t *tree, avl_node_t *node) {
|
||||||
gchild = child->left;
|
gchild = child->left;
|
||||||
node->right = gchild->left;
|
node->right = gchild->left;
|
||||||
|
|
||||||
if(node->right) {
|
if(node->right)
|
||||||
node->right->parent = node;
|
node->right->parent = node;
|
||||||
}
|
|
||||||
|
|
||||||
child->left = gchild->right;
|
child->left = gchild->right;
|
||||||
|
|
||||||
if(child->left) {
|
if(child->left)
|
||||||
child->left->parent = child;
|
child->left->parent = child;
|
||||||
}
|
|
||||||
|
|
||||||
gchild->left = node;
|
gchild->left = node;
|
||||||
|
|
||||||
|
if(gchild->left)
|
||||||
gchild->left->parent = gchild;
|
gchild->left->parent = gchild;
|
||||||
gchild->right = child;
|
gchild->right = child;
|
||||||
|
|
||||||
|
if(gchild->right)
|
||||||
gchild->right->parent = gchild;
|
gchild->right->parent = gchild;
|
||||||
|
|
||||||
*superparent = gchild;
|
*superparent = gchild;
|
||||||
|
|
@ -257,7 +244,6 @@ static void avl_rebalance(avl_tree_t *tree, avl_node_t *node) {
|
||||||
gchild->depth = AVL_CALC_DEPTH(gchild);
|
gchild->depth = AVL_CALC_DEPTH(gchild);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
@ -268,14 +254,14 @@ static void avl_rebalance(avl_tree_t *tree, avl_node_t *node) {
|
||||||
node->depth = AVL_CALC_DEPTH(node);
|
node->depth = AVL_CALC_DEPTH(node);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
node = parent;
|
node = parent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (De)constructors */
|
/* (De)constructors */
|
||||||
|
|
||||||
avl_tree_t *avl_alloc_tree(avl_compare_t compare, avl_action_t delete) {
|
avl_tree_t *avl_alloc_tree(avl_compare_t compare, avl_action_t delete)
|
||||||
|
{
|
||||||
avl_tree_t *tree;
|
avl_tree_t *tree;
|
||||||
|
|
||||||
tree = xmalloc_and_zero(sizeof(avl_tree_t));
|
tree = xmalloc_and_zero(sizeof(avl_tree_t));
|
||||||
|
|
@ -285,25 +271,28 @@ avl_tree_t *avl_alloc_tree(avl_compare_t compare, avl_action_t delete) {
|
||||||
return tree;
|
return tree;
|
||||||
}
|
}
|
||||||
|
|
||||||
void avl_free_tree(avl_tree_t *tree) {
|
void avl_free_tree(avl_tree_t *tree)
|
||||||
|
{
|
||||||
free(tree);
|
free(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
avl_node_t *avl_alloc_node(void) {
|
avl_node_t *avl_alloc_node(void)
|
||||||
|
{
|
||||||
return xmalloc_and_zero(sizeof(avl_node_t));
|
return xmalloc_and_zero(sizeof(avl_node_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
void avl_free_node(avl_tree_t *tree, avl_node_t *node) {
|
void avl_free_node(avl_tree_t *tree, avl_node_t *node)
|
||||||
if(node->data && tree->delete) {
|
{
|
||||||
|
if(node->data && tree->delete)
|
||||||
tree->delete(node->data);
|
tree->delete(node->data);
|
||||||
}
|
|
||||||
|
|
||||||
free(node);
|
free(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Searching */
|
/* Searching */
|
||||||
|
|
||||||
void *avl_search(const avl_tree_t *tree, const void *data) {
|
void *avl_search(const avl_tree_t *tree, const void *data)
|
||||||
|
{
|
||||||
avl_node_t *node;
|
avl_node_t *node;
|
||||||
|
|
||||||
node = avl_search_node(tree, data);
|
node = avl_search_node(tree, data);
|
||||||
|
|
@ -311,7 +300,8 @@ void *avl_search(const avl_tree_t *tree, const void *data) {
|
||||||
return node ? node->data : NULL;
|
return node ? node->data : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *avl_search_closest(const avl_tree_t *tree, const void *data, int *result) {
|
void *avl_search_closest(const avl_tree_t *tree, const void *data, int *result)
|
||||||
|
{
|
||||||
avl_node_t *node;
|
avl_node_t *node;
|
||||||
|
|
||||||
node = avl_search_closest_node(tree, data, result);
|
node = avl_search_closest_node(tree, data, result);
|
||||||
|
|
@ -319,7 +309,8 @@ void *avl_search_closest(const avl_tree_t *tree, const void *data, int *result)
|
||||||
return node ? node->data : NULL;
|
return node ? node->data : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *avl_search_closest_smaller(const avl_tree_t *tree, const void *data) {
|
void *avl_search_closest_smaller(const avl_tree_t *tree, const void *data)
|
||||||
|
{
|
||||||
avl_node_t *node;
|
avl_node_t *node;
|
||||||
|
|
||||||
node = avl_search_closest_smaller_node(tree, data);
|
node = avl_search_closest_smaller_node(tree, data);
|
||||||
|
|
@ -327,7 +318,8 @@ void *avl_search_closest_smaller(const avl_tree_t *tree, const void *data) {
|
||||||
return node ? node->data : NULL;
|
return node ? node->data : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *avl_search_closest_greater(const avl_tree_t *tree, const void *data) {
|
void *avl_search_closest_greater(const avl_tree_t *tree, const void *data)
|
||||||
|
{
|
||||||
avl_node_t *node;
|
avl_node_t *node;
|
||||||
|
|
||||||
node = avl_search_closest_greater_node(tree, data);
|
node = avl_search_closest_greater_node(tree, data);
|
||||||
|
|
@ -335,7 +327,8 @@ void *avl_search_closest_greater(const avl_tree_t *tree, const void *data) {
|
||||||
return node ? node->data : NULL;
|
return node ? node->data : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
avl_node_t *avl_search_node(const avl_tree_t *tree, const void *data) {
|
avl_node_t *avl_search_node(const avl_tree_t *tree, const void *data)
|
||||||
|
{
|
||||||
avl_node_t *node;
|
avl_node_t *node;
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
|
|
@ -345,17 +338,16 @@ avl_node_t *avl_search_node(const avl_tree_t *tree, const void *data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
avl_node_t *avl_search_closest_node(const avl_tree_t *tree, const void *data,
|
avl_node_t *avl_search_closest_node(const avl_tree_t *tree, const void *data,
|
||||||
int *result) {
|
int *result)
|
||||||
|
{
|
||||||
avl_node_t *node;
|
avl_node_t *node;
|
||||||
int c;
|
int c;
|
||||||
|
|
||||||
node = tree->root;
|
node = tree->root;
|
||||||
|
|
||||||
if(!node) {
|
if(!node) {
|
||||||
if(result) {
|
if(result)
|
||||||
*result = 0;
|
*result = 0;
|
||||||
}
|
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -363,30 +355,24 @@ avl_node_t *avl_search_closest_node(const avl_tree_t *tree, const void *data,
|
||||||
c = tree->compare(data, node->data);
|
c = tree->compare(data, node->data);
|
||||||
|
|
||||||
if(c < 0) {
|
if(c < 0) {
|
||||||
if(node->left) {
|
if(node->left)
|
||||||
node = node->left;
|
node = node->left;
|
||||||
} else {
|
else {
|
||||||
if(result) {
|
if(result)
|
||||||
*result = -1;
|
*result = -1;
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else if(c > 0) {
|
} else if(c > 0) {
|
||||||
if(node->right) {
|
if(node->right)
|
||||||
node = node->right;
|
node = node->right;
|
||||||
} else {
|
else {
|
||||||
if(result) {
|
if(result)
|
||||||
*result = 1;
|
*result = 1;
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(result) {
|
if(result)
|
||||||
*result = 0;
|
*result = 0;
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -395,36 +381,37 @@ avl_node_t *avl_search_closest_node(const avl_tree_t *tree, const void *data,
|
||||||
}
|
}
|
||||||
|
|
||||||
avl_node_t *avl_search_closest_smaller_node(const avl_tree_t *tree,
|
avl_node_t *avl_search_closest_smaller_node(const avl_tree_t *tree,
|
||||||
const void *data) {
|
const void *data)
|
||||||
|
{
|
||||||
avl_node_t *node;
|
avl_node_t *node;
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
node = avl_search_closest_node(tree, data, &result);
|
node = avl_search_closest_node(tree, data, &result);
|
||||||
|
|
||||||
if(result < 0) {
|
if(result < 0)
|
||||||
node = node->prev;
|
node = node->prev;
|
||||||
}
|
|
||||||
|
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
avl_node_t *avl_search_closest_greater_node(const avl_tree_t *tree,
|
avl_node_t *avl_search_closest_greater_node(const avl_tree_t *tree,
|
||||||
const void *data) {
|
const void *data)
|
||||||
|
{
|
||||||
avl_node_t *node;
|
avl_node_t *node;
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
node = avl_search_closest_node(tree, data, &result);
|
node = avl_search_closest_node(tree, data, &result);
|
||||||
|
|
||||||
if(result > 0) {
|
if(result > 0)
|
||||||
node = node->next;
|
node = node->next;
|
||||||
}
|
|
||||||
|
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Insertion and deletion */
|
/* Insertion and deletion */
|
||||||
|
|
||||||
avl_node_t *avl_insert(avl_tree_t *tree, void *data) {
|
avl_node_t *avl_insert(avl_tree_t *tree, void *data)
|
||||||
|
{
|
||||||
avl_node_t *closest, *new;
|
avl_node_t *closest, *new;
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
|
|
@ -435,7 +422,7 @@ avl_node_t *avl_insert(avl_tree_t *tree, void *data) {
|
||||||
} else {
|
} else {
|
||||||
closest = avl_search_closest_node(tree, data, &result);
|
closest = avl_search_closest_node(tree, data, &result);
|
||||||
|
|
||||||
switch(result) {
|
switch (result) {
|
||||||
case -1:
|
case -1:
|
||||||
new = avl_alloc_node();
|
new = avl_alloc_node();
|
||||||
new->data = data;
|
new->data = data;
|
||||||
|
|
@ -463,16 +450,17 @@ avl_node_t *avl_insert(avl_tree_t *tree, void *data) {
|
||||||
return new;
|
return new;
|
||||||
}
|
}
|
||||||
|
|
||||||
avl_node_t *avl_insert_node(avl_tree_t *tree, avl_node_t *node) {
|
avl_node_t *avl_insert_node(avl_tree_t *tree, avl_node_t *node)
|
||||||
|
{
|
||||||
avl_node_t *closest;
|
avl_node_t *closest;
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
if(!tree->root) {
|
if(!tree->root)
|
||||||
avl_insert_top(tree, node);
|
avl_insert_top(tree, node);
|
||||||
} else {
|
else {
|
||||||
closest = avl_search_closest_node(tree, node->data, &result);
|
closest = avl_search_closest_node(tree, node->data, &result);
|
||||||
|
|
||||||
switch(result) {
|
switch (result) {
|
||||||
case -1:
|
case -1:
|
||||||
avl_insert_before(tree, closest, node);
|
avl_insert_before(tree, closest, node);
|
||||||
break;
|
break;
|
||||||
|
|
@ -496,20 +484,20 @@ avl_node_t *avl_insert_node(avl_tree_t *tree, avl_node_t *node) {
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
void avl_insert_top(avl_tree_t *tree, avl_node_t *node) {
|
void avl_insert_top(avl_tree_t *tree, avl_node_t *node)
|
||||||
|
{
|
||||||
node->prev = node->next = node->parent = NULL;
|
node->prev = node->next = node->parent = NULL;
|
||||||
tree->head = tree->tail = tree->root = node;
|
tree->head = tree->tail = tree->root = node;
|
||||||
}
|
}
|
||||||
|
|
||||||
void avl_insert_before(avl_tree_t *tree, avl_node_t *before,
|
void avl_insert_before(avl_tree_t *tree, avl_node_t *before,
|
||||||
avl_node_t *node) {
|
avl_node_t *node)
|
||||||
|
{
|
||||||
if(!before) {
|
if(!before) {
|
||||||
if(tree->tail) {
|
if(tree->tail)
|
||||||
avl_insert_after(tree, tree->tail, node);
|
avl_insert_after(tree, tree->tail, node);
|
||||||
} else {
|
else
|
||||||
avl_insert_top(tree, node);
|
avl_insert_top(tree, node);
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -522,11 +510,10 @@ void avl_insert_before(avl_tree_t *tree, avl_node_t *before,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(before->prev) {
|
if(before->prev)
|
||||||
before->prev->next = node;
|
before->prev->next = node;
|
||||||
} else {
|
else
|
||||||
tree->head = node;
|
tree->head = node;
|
||||||
}
|
|
||||||
|
|
||||||
before->prev = node;
|
before->prev = node;
|
||||||
before->left = node;
|
before->left = node;
|
||||||
|
|
@ -534,14 +521,13 @@ void avl_insert_before(avl_tree_t *tree, avl_node_t *before,
|
||||||
avl_rebalance(tree, before);
|
avl_rebalance(tree, before);
|
||||||
}
|
}
|
||||||
|
|
||||||
void avl_insert_after(avl_tree_t *tree, avl_node_t *after, avl_node_t *node) {
|
void avl_insert_after(avl_tree_t *tree, avl_node_t *after, avl_node_t *node)
|
||||||
|
{
|
||||||
if(!after) {
|
if(!after) {
|
||||||
if(tree->head) {
|
if(tree->head)
|
||||||
avl_insert_before(tree, tree->head, node);
|
avl_insert_before(tree, tree->head, node);
|
||||||
} else {
|
else
|
||||||
avl_insert_top(tree, node);
|
avl_insert_top(tree, node);
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -554,11 +540,10 @@ void avl_insert_after(avl_tree_t *tree, avl_node_t *after, avl_node_t *node) {
|
||||||
node->parent = after;
|
node->parent = after;
|
||||||
node->next = after->next;
|
node->next = after->next;
|
||||||
|
|
||||||
if(after->next) {
|
if(after->next)
|
||||||
after->next->prev = node;
|
after->next->prev = node;
|
||||||
} else {
|
else
|
||||||
tree->tail = node;
|
tree->tail = node;
|
||||||
}
|
|
||||||
|
|
||||||
after->next = node;
|
after->next = node;
|
||||||
after->right = node;
|
after->right = node;
|
||||||
|
|
@ -566,35 +551,33 @@ void avl_insert_after(avl_tree_t *tree, avl_node_t *after, avl_node_t *node) {
|
||||||
avl_rebalance(tree, after);
|
avl_rebalance(tree, after);
|
||||||
}
|
}
|
||||||
|
|
||||||
avl_node_t *avl_unlink(avl_tree_t *tree, void *data) {
|
avl_node_t *avl_unlink(avl_tree_t *tree, void *data)
|
||||||
|
{
|
||||||
avl_node_t *node;
|
avl_node_t *node;
|
||||||
|
|
||||||
node = avl_search_node(tree, data);
|
node = avl_search_node(tree, data);
|
||||||
|
|
||||||
if(node) {
|
if(node)
|
||||||
avl_unlink_node(tree, node);
|
avl_unlink_node(tree, node);
|
||||||
}
|
|
||||||
|
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
void avl_unlink_node(avl_tree_t *tree, avl_node_t *node) {
|
void avl_unlink_node(avl_tree_t *tree, avl_node_t *node)
|
||||||
|
{
|
||||||
avl_node_t *parent;
|
avl_node_t *parent;
|
||||||
avl_node_t **superparent;
|
avl_node_t **superparent;
|
||||||
avl_node_t *subst, *left, *right;
|
avl_node_t *subst, *left, *right;
|
||||||
avl_node_t *balnode;
|
avl_node_t *balnode;
|
||||||
|
|
||||||
if(node->prev) {
|
if(node->prev)
|
||||||
node->prev->next = node->next;
|
node->prev->next = node->next;
|
||||||
} else {
|
else
|
||||||
tree->head = node->next;
|
tree->head = node->next;
|
||||||
}
|
if(node->next)
|
||||||
|
|
||||||
if(node->next) {
|
|
||||||
node->next->prev = node->prev;
|
node->next->prev = node->prev;
|
||||||
} else {
|
else
|
||||||
tree->tail = node->prev;
|
tree->tail = node->prev;
|
||||||
}
|
|
||||||
|
|
||||||
parent = node->parent;
|
parent = node->parent;
|
||||||
|
|
||||||
|
|
@ -604,13 +587,11 @@ void avl_unlink_node(avl_tree_t *tree, avl_node_t *node) {
|
||||||
|
|
||||||
left = node->left;
|
left = node->left;
|
||||||
right = node->right;
|
right = node->right;
|
||||||
|
|
||||||
if(!left) {
|
if(!left) {
|
||||||
*superparent = right;
|
*superparent = right;
|
||||||
|
|
||||||
if(right) {
|
if(right)
|
||||||
right->parent = parent;
|
right->parent = parent;
|
||||||
}
|
|
||||||
|
|
||||||
balnode = parent;
|
balnode = parent;
|
||||||
} else if(!right) {
|
} else if(!right) {
|
||||||
|
|
@ -620,19 +601,14 @@ void avl_unlink_node(avl_tree_t *tree, avl_node_t *node) {
|
||||||
} else {
|
} else {
|
||||||
subst = node->prev;
|
subst = node->prev;
|
||||||
|
|
||||||
if(!subst) { // This only happens if node is not actually in a tree at all.
|
|
||||||
abort();
|
|
||||||
}
|
|
||||||
|
|
||||||
if(subst == left) {
|
if(subst == left) {
|
||||||
balnode = subst;
|
balnode = subst;
|
||||||
} else {
|
} else {
|
||||||
balnode = subst->parent;
|
balnode = subst->parent;
|
||||||
balnode->right = subst->left;
|
balnode->right = subst->left;
|
||||||
|
|
||||||
if(balnode->right) {
|
if(balnode->right)
|
||||||
balnode->right->parent = balnode;
|
balnode->right->parent = balnode;
|
||||||
}
|
|
||||||
|
|
||||||
subst->left = left;
|
subst->left = left;
|
||||||
left->parent = subst;
|
left->parent = subst;
|
||||||
|
|
@ -656,24 +632,26 @@ void avl_unlink_node(avl_tree_t *tree, avl_node_t *node) {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void avl_delete_node(avl_tree_t *tree, avl_node_t *node) {
|
void avl_delete_node(avl_tree_t *tree, avl_node_t *node)
|
||||||
|
{
|
||||||
avl_unlink_node(tree, node);
|
avl_unlink_node(tree, node);
|
||||||
avl_free_node(tree, node);
|
avl_free_node(tree, node);
|
||||||
}
|
}
|
||||||
|
|
||||||
void avl_delete(avl_tree_t *tree, void *data) {
|
void avl_delete(avl_tree_t *tree, void *data)
|
||||||
|
{
|
||||||
avl_node_t *node;
|
avl_node_t *node;
|
||||||
|
|
||||||
node = avl_search_node(tree, data);
|
node = avl_search_node(tree, data);
|
||||||
|
|
||||||
if(node) {
|
if(node)
|
||||||
avl_delete_node(tree, node);
|
avl_delete_node(tree, node);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Fast tree cleanup */
|
/* Fast tree cleanup */
|
||||||
|
|
||||||
void avl_delete_tree(avl_tree_t *tree) {
|
void avl_delete_tree(avl_tree_t *tree)
|
||||||
|
{
|
||||||
avl_node_t *node, *next;
|
avl_node_t *node, *next;
|
||||||
|
|
||||||
for(node = tree->head; node; node = next) {
|
for(node = tree->head; node; node = next) {
|
||||||
|
|
@ -686,7 +664,8 @@ void avl_delete_tree(avl_tree_t *tree) {
|
||||||
|
|
||||||
/* Tree walking */
|
/* Tree walking */
|
||||||
|
|
||||||
void avl_foreach(const avl_tree_t *tree, avl_action_t action) {
|
void avl_foreach(const avl_tree_t *tree, avl_action_t action)
|
||||||
|
{
|
||||||
avl_node_t *node, *next;
|
avl_node_t *node, *next;
|
||||||
|
|
||||||
for(node = tree->head; node; node = next) {
|
for(node = tree->head; node; node = next) {
|
||||||
|
|
@ -695,7 +674,8 @@ void avl_foreach(const avl_tree_t *tree, avl_action_t action) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void avl_foreach_node(const avl_tree_t *tree, avl_action_t action) {
|
void avl_foreach_node(const avl_tree_t *tree, avl_action_t action)
|
||||||
|
{
|
||||||
avl_node_t *node, *next;
|
avl_node_t *node, *next;
|
||||||
|
|
||||||
for(node = tree->head; node; node = next) {
|
for(node = tree->head; node; node = next) {
|
||||||
|
|
@ -707,11 +687,13 @@ void avl_foreach_node(const avl_tree_t *tree, avl_action_t action) {
|
||||||
/* Indexing */
|
/* Indexing */
|
||||||
|
|
||||||
#ifdef AVL_COUNT
|
#ifdef AVL_COUNT
|
||||||
unsigned int avl_count(const avl_tree_t *tree) {
|
unsigned int avl_count(const avl_tree_t *tree)
|
||||||
|
{
|
||||||
return AVL_NODE_COUNT(tree->root);
|
return AVL_NODE_COUNT(tree->root);
|
||||||
}
|
}
|
||||||
|
|
||||||
avl_node_t *avl_get_node(const avl_tree_t *tree, unsigned int index) {
|
avl_node_t *avl_get_node(const avl_tree_t *tree, unsigned int index)
|
||||||
|
{
|
||||||
avl_node_t *node;
|
avl_node_t *node;
|
||||||
unsigned int c;
|
unsigned int c;
|
||||||
|
|
||||||
|
|
@ -733,17 +715,16 @@ avl_node_t *avl_get_node(const avl_tree_t *tree, unsigned int index) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int avl_index(const avl_node_t *node) {
|
unsigned int avl_index(const avl_node_t *node)
|
||||||
|
{
|
||||||
avl_node_t *next;
|
avl_node_t *next;
|
||||||
unsigned int index;
|
unsigned int index;
|
||||||
|
|
||||||
index = AVL_L_COUNT(node);
|
index = AVL_L_COUNT(node);
|
||||||
|
|
||||||
while((next = node->parent)) {
|
while((next = node->parent)) {
|
||||||
if(node == next->right) {
|
if(node == next->right)
|
||||||
index += AVL_L_COUNT(next) + 1;
|
index += AVL_L_COUNT(next) + 1;
|
||||||
}
|
|
||||||
|
|
||||||
node = next;
|
node = next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -751,7 +732,8 @@ unsigned int avl_index(const avl_node_t *node) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef AVL_DEPTH
|
#ifdef AVL_DEPTH
|
||||||
unsigned int avl_depth(const avl_tree_t *tree) {
|
unsigned int avl_depth(const avl_tree_t *tree)
|
||||||
|
{
|
||||||
return AVL_NODE_DEPTH(tree->root);
|
return AVL_NODE_DEPTH(tree->root);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -1,6 +1,3 @@
|
||||||
#ifndef TINC_AVL_TREE_H
|
|
||||||
#define TINC_AVL_TREE_H
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
avl_tree.h -- header file for avl_tree.c
|
avl_tree.h -- header file for avl_tree.c
|
||||||
Copyright (C) 1998 Michael H. Buselli
|
Copyright (C) 1998 Michael H. Buselli
|
||||||
|
|
@ -29,10 +26,14 @@
|
||||||
the code. Mail me if you found a bug.
|
the code. Mail me if you found a bug.
|
||||||
|
|
||||||
Cleaned up and incorporated some of the ideas from the red-black tree
|
Cleaned up and incorporated some of the ideas from the red-black tree
|
||||||
library for inclusion into tinc (https://www.tinc-vpn.org/) by
|
library for inclusion into tinc (http://www.tinc-vpn.org/) by
|
||||||
Guus Sliepen <guus@tinc-vpn.org>.
|
Guus Sliepen <guus@tinc-vpn.org>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef __AVL_TREE_H__
|
||||||
|
#define __AVL_TREE_H__
|
||||||
|
|
||||||
#ifndef AVL_DEPTH
|
#ifndef AVL_DEPTH
|
||||||
#ifndef AVL_COUNT
|
#ifndef AVL_COUNT
|
||||||
#define AVL_DEPTH
|
#define AVL_DEPTH
|
||||||
|
|
@ -65,9 +66,9 @@ typedef struct avl_node_t {
|
||||||
|
|
||||||
} avl_node_t;
|
} avl_node_t;
|
||||||
|
|
||||||
typedef int (*avl_compare_t)(const void *data1, const void *data2);
|
typedef int (*avl_compare_t)(const void *, const void *);
|
||||||
typedef void (*avl_action_t)(const void *data);
|
typedef void (*avl_action_t)(const void *);
|
||||||
typedef void (*avl_action_node_t)(const avl_node_t *node);
|
typedef void (*avl_action_node_t)(const avl_node_t *);
|
||||||
|
|
||||||
typedef struct avl_tree_t {
|
typedef struct avl_tree_t {
|
||||||
|
|
||||||
|
|
@ -87,56 +88,56 @@ typedef struct avl_tree_t {
|
||||||
|
|
||||||
/* (De)constructors */
|
/* (De)constructors */
|
||||||
|
|
||||||
extern avl_tree_t *avl_alloc_tree(avl_compare_t compare, avl_action_t delete);
|
extern avl_tree_t *avl_alloc_tree(avl_compare_t, avl_action_t);
|
||||||
extern void avl_free_tree(avl_tree_t *tree);
|
extern void avl_free_tree(avl_tree_t *);
|
||||||
|
|
||||||
extern avl_node_t *avl_alloc_node(void);
|
extern avl_node_t *avl_alloc_node(void);
|
||||||
extern void avl_free_node(avl_tree_t *tree, avl_node_t *node);
|
extern void avl_free_node(avl_tree_t *tree, avl_node_t *);
|
||||||
|
|
||||||
/* Insertion and deletion */
|
/* Insertion and deletion */
|
||||||
|
|
||||||
extern avl_node_t *avl_insert(avl_tree_t *tree, void *data);
|
extern avl_node_t *avl_insert(avl_tree_t *, void *);
|
||||||
extern avl_node_t *avl_insert_node(avl_tree_t *tree, avl_node_t *node);
|
extern avl_node_t *avl_insert_node(avl_tree_t *, avl_node_t *);
|
||||||
|
|
||||||
extern void avl_insert_top(avl_tree_t *tree, avl_node_t *node);
|
extern void avl_insert_top(avl_tree_t *, avl_node_t *);
|
||||||
extern void avl_insert_before(avl_tree_t *tree, avl_node_t *before, avl_node_t *node);
|
extern void avl_insert_before(avl_tree_t *, avl_node_t *, avl_node_t *);
|
||||||
extern void avl_insert_after(avl_tree_t *tree, avl_node_t *after, avl_node_t *node);
|
extern void avl_insert_after(avl_tree_t *, avl_node_t *, avl_node_t *);
|
||||||
|
|
||||||
extern avl_node_t *avl_unlink(avl_tree_t *tree, void *data);
|
extern avl_node_t *avl_unlink(avl_tree_t *, void *);
|
||||||
extern void avl_unlink_node(avl_tree_t *tree, avl_node_t *node);
|
extern void avl_unlink_node(avl_tree_t *tree, avl_node_t *);
|
||||||
extern void avl_delete(avl_tree_t *tree, void *data);
|
extern void avl_delete(avl_tree_t *, void *);
|
||||||
extern void avl_delete_node(avl_tree_t *tree, avl_node_t *node);
|
extern void avl_delete_node(avl_tree_t *, avl_node_t *);
|
||||||
|
|
||||||
/* Fast tree cleanup */
|
/* Fast tree cleanup */
|
||||||
|
|
||||||
extern void avl_delete_tree(avl_tree_t *tree);
|
extern void avl_delete_tree(avl_tree_t *);
|
||||||
|
|
||||||
/* Searching */
|
/* Searching */
|
||||||
|
|
||||||
extern void *avl_search(const avl_tree_t *tree, const void *data);
|
extern void *avl_search(const avl_tree_t *, const void *);
|
||||||
extern void *avl_search_closest(const avl_tree_t *tree, const void *data, int *result);
|
extern void *avl_search_closest(const avl_tree_t *, const void *, int *);
|
||||||
extern void *avl_search_closest_smaller(const avl_tree_t *tree, const void *data);
|
extern void *avl_search_closest_smaller(const avl_tree_t *, const void *);
|
||||||
extern void *avl_search_closest_greater(const avl_tree_t *tree, const void *data);
|
extern void *avl_search_closest_greater(const avl_tree_t *, const void *);
|
||||||
|
|
||||||
extern avl_node_t *avl_search_node(const avl_tree_t *tree, const void *data);
|
extern avl_node_t *avl_search_node(const avl_tree_t *, const void *);
|
||||||
extern avl_node_t *avl_search_closest_node(const avl_tree_t *tree, const void *data, int *result);
|
extern avl_node_t *avl_search_closest_node(const avl_tree_t *, const void *, int *);
|
||||||
extern avl_node_t *avl_search_closest_smaller_node(const avl_tree_t *tree, const void *data);
|
extern avl_node_t *avl_search_closest_smaller_node(const avl_tree_t *, const void *);
|
||||||
extern avl_node_t *avl_search_closest_greater_node(const avl_tree_t *tree, const void *data);
|
extern avl_node_t *avl_search_closest_greater_node(const avl_tree_t *, const void *);
|
||||||
|
|
||||||
/* Tree walking */
|
/* Tree walking */
|
||||||
|
|
||||||
extern void avl_foreach(const avl_tree_t *tree, avl_action_t action);
|
extern void avl_foreach(const avl_tree_t *, avl_action_t);
|
||||||
extern void avl_foreach_node(const avl_tree_t *tree, avl_action_t action);
|
extern void avl_foreach_node(const avl_tree_t *, avl_action_t);
|
||||||
|
|
||||||
/* Indexing */
|
/* Indexing */
|
||||||
|
|
||||||
#ifdef AVL_COUNT
|
#ifdef AVL_COUNT
|
||||||
extern unsigned int avl_count(const avl_tree_t *tree);
|
extern unsigned int avl_count(const avl_tree_t *);
|
||||||
extern avl_node_t *avl_get_node(const avl_tree_t *tree, unsigned int index);
|
extern avl_node_t *avl_get_node(const avl_tree_t *, unsigned int);
|
||||||
extern unsigned int avl_index(const avl_node_t *node);
|
extern unsigned int avl_index(const avl_node_t *);
|
||||||
#endif
|
#endif
|
||||||
#ifdef AVL_DEPTH
|
#ifdef AVL_DEPTH
|
||||||
extern unsigned int avl_depth(const avl_tree_t *tree);
|
extern unsigned int avl_depth(const avl_tree_t *);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif /* __AVL_TREE_H__ */
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
dropin.c -- a set of drop-in replacements for libc functions
|
dropin.c -- a set of drop-in replacements for libc functions
|
||||||
Copyright (C) 2000-2005 Ivo Timmermans,
|
Copyright (C) 2000-2005 Ivo Timmermans,
|
||||||
2000-2016 Guus Sliepen <guus@tinc-vpn.org>
|
2000-2011 Guus Sliepen <guus@tinc-vpn.org>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|
@ -50,9 +50,8 @@ int daemon(int nochdir, int noclose) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If we are the parent, terminate */
|
/* If we are the parent, terminate */
|
||||||
if(pid) {
|
if(pid)
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
|
||||||
|
|
||||||
/* Detach by becoming the new process group leader */
|
/* Detach by becoming the new process group leader */
|
||||||
if(setsid() < 0) {
|
if(setsid() < 0) {
|
||||||
|
|
@ -87,6 +86,40 @@ int daemon(int nochdir, int noclose) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAVE_GET_CURRENT_DIR_NAME
|
||||||
|
/*
|
||||||
|
Replacement for the GNU get_current_dir_name function:
|
||||||
|
|
||||||
|
get_current_dir_name will malloc(3) an array big enough to hold the
|
||||||
|
current directory name. If the environment variable PWD is set, and
|
||||||
|
its value is correct, then that value will be returned.
|
||||||
|
*/
|
||||||
|
char *get_current_dir_name(void) {
|
||||||
|
size_t size;
|
||||||
|
char *buf;
|
||||||
|
char *r;
|
||||||
|
|
||||||
|
/* Start with 100 bytes. If this turns out to be insufficient to
|
||||||
|
contain the working directory, double the size. */
|
||||||
|
size = 100;
|
||||||
|
buf = xmalloc(size);
|
||||||
|
|
||||||
|
errno = 0; /* Success */
|
||||||
|
r = getcwd(buf, size);
|
||||||
|
|
||||||
|
/* getcwd returns NULL and sets errno to ERANGE if the bufferspace
|
||||||
|
is insufficient to contain the entire working directory. */
|
||||||
|
while(r == NULL && errno == ERANGE) {
|
||||||
|
free(buf);
|
||||||
|
size <<= 1; /* double the size */
|
||||||
|
buf = xmalloc(size);
|
||||||
|
r = getcwd(buf, size);
|
||||||
|
}
|
||||||
|
|
||||||
|
return buf;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef HAVE_ASPRINTF
|
#ifndef HAVE_ASPRINTF
|
||||||
int asprintf(char **buf, const char *fmt, ...) {
|
int asprintf(char **buf, const char *fmt, ...) {
|
||||||
int result;
|
int result;
|
||||||
|
|
@ -107,12 +140,10 @@ int vasprintf(char **buf, const char *fmt, va_list ap) {
|
||||||
|
|
||||||
va_copy(aq, ap);
|
va_copy(aq, ap);
|
||||||
status = vsnprintf(*buf, len, fmt, aq);
|
status = vsnprintf(*buf, len, fmt, aq);
|
||||||
buf[len - 1] = 0;
|
|
||||||
va_end(aq);
|
va_end(aq);
|
||||||
|
|
||||||
if(status >= 0) {
|
if(status >= 0)
|
||||||
*buf = xrealloc(*buf, status + 1);
|
*buf = xrealloc(*buf, status + 1);
|
||||||
}
|
|
||||||
|
|
||||||
if(status > len - 1) {
|
if(status > len - 1) {
|
||||||
len = status;
|
len = status;
|
||||||
|
|
@ -1,6 +1,3 @@
|
||||||
#ifndef TINC_DROPIN_H
|
|
||||||
#define TINC_DROPIN_H
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
dropin.h -- header file for dropin.c
|
dropin.h -- header file for dropin.c
|
||||||
Copyright (C) 2000-2005 Ivo Timmermans,
|
Copyright (C) 2000-2005 Ivo Timmermans,
|
||||||
|
|
@ -21,11 +18,14 @@
|
||||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifndef __DROPIN_H__
|
||||||
|
#define __DROPIN_H__
|
||||||
|
|
||||||
#include "fake-getaddrinfo.h"
|
#include "fake-getaddrinfo.h"
|
||||||
#include "fake-getnameinfo.h"
|
#include "fake-getnameinfo.h"
|
||||||
|
|
||||||
#ifndef HAVE_DAEMON
|
#ifndef HAVE_DAEMON
|
||||||
extern int daemon(int nochdir, int noclose);
|
extern int daemon(int, int);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef HAVE_GET_CURRENT_DIR_NAME
|
#ifndef HAVE_GET_CURRENT_DIR_NAME
|
||||||
|
|
@ -33,16 +33,16 @@ extern char *get_current_dir_name(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef HAVE_ASPRINTF
|
#ifndef HAVE_ASPRINTF
|
||||||
extern int asprintf(char **buf, const char *fmt, ...);
|
extern int asprintf(char **, const char *, ...);
|
||||||
extern int vasprintf(char **buf, const char *fmt, va_list ap);
|
extern int vasprintf(char **, const char *, va_list ap);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef HAVE_GETTIMEOFDAY
|
#ifndef HAVE_GETTIMEOFDAY
|
||||||
extern int gettimeofday(struct timeval *tv, void *tz);
|
extern int gettimeofday(struct timeval *, void *);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef HAVE_USLEEP
|
#ifndef HAVE_USLEEP
|
||||||
extern int usleep(long long usec);
|
extern int usleep(long long);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif /* __DROPIN_H__ */
|
||||||
|
|
@ -1,6 +1,3 @@
|
||||||
#ifndef TINC_ETHERNET_H
|
|
||||||
#define TINC_ETHERNET_H
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
ethernet.h -- missing Ethernet related definitions
|
ethernet.h -- missing Ethernet related definitions
|
||||||
Copyright (C) 2005 Ivo Timmermans
|
Copyright (C) 2005 Ivo Timmermans
|
||||||
|
|
@ -21,6 +18,9 @@
|
||||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifndef __TINC_ETHERNET_H__
|
||||||
|
#define __TINC_ETHERNET_H__
|
||||||
|
|
||||||
#ifndef ETH_ALEN
|
#ifndef ETH_ALEN
|
||||||
#define ETH_ALEN 6
|
#define ETH_ALEN 6
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -41,16 +41,12 @@
|
||||||
#define ETH_P_IPV6 0x86DD
|
#define ETH_P_IPV6 0x86DD
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef ETH_P_8021Q
|
|
||||||
#define ETH_P_8021Q 0x8100
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef HAVE_STRUCT_ETHER_HEADER
|
#ifndef HAVE_STRUCT_ETHER_HEADER
|
||||||
struct ether_header {
|
struct ether_header {
|
||||||
uint8_t ether_dhost[ETH_ALEN];
|
uint8_t ether_dhost[ETH_ALEN];
|
||||||
uint8_t ether_shost[ETH_ALEN];
|
uint8_t ether_shost[ETH_ALEN];
|
||||||
uint16_t ether_type;
|
uint16_t ether_type;
|
||||||
} __attribute__((__packed__));
|
} __attribute__ ((__packed__));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef HAVE_STRUCT_ARPHDR
|
#ifndef HAVE_STRUCT_ARPHDR
|
||||||
|
|
@ -60,7 +56,7 @@ struct arphdr {
|
||||||
uint8_t ar_hln;
|
uint8_t ar_hln;
|
||||||
uint8_t ar_pln;
|
uint8_t ar_pln;
|
||||||
uint16_t ar_op;
|
uint16_t ar_op;
|
||||||
} __attribute__((__packed__));
|
} __attribute__ ((__packed__));
|
||||||
|
|
||||||
#define ARPOP_REQUEST 1
|
#define ARPOP_REQUEST 1
|
||||||
#define ARPOP_REPLY 2
|
#define ARPOP_REPLY 2
|
||||||
|
|
@ -78,7 +74,7 @@ struct ether_arp {
|
||||||
uint8_t arp_spa[4];
|
uint8_t arp_spa[4];
|
||||||
uint8_t arp_tha[ETH_ALEN];
|
uint8_t arp_tha[ETH_ALEN];
|
||||||
uint8_t arp_tpa[4];
|
uint8_t arp_tpa[4];
|
||||||
} __attribute__((__packed__));
|
} __attribute__ ((__packed__));
|
||||||
#define arp_hrd ea_hdr.ar_hrd
|
#define arp_hrd ea_hdr.ar_hrd
|
||||||
#define arp_pro ea_hdr.ar_pro
|
#define arp_pro ea_hdr.ar_pro
|
||||||
#define arp_hln ea_hdr.ar_hln
|
#define arp_hln ea_hdr.ar_hln
|
||||||
|
|
@ -86,4 +82,4 @@ struct ether_arp {
|
||||||
#define arp_op ea_hdr.ar_op
|
#define arp_op ea_hdr.ar_op
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif /* __TINC_ETHERNET_H__ */
|
||||||
19
lib/fake-gai-errnos.h
Normal file
19
lib/fake-gai-errnos.h
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
/*
|
||||||
|
* fake library for ssh
|
||||||
|
*
|
||||||
|
* This file is included in getaddrinfo.c and getnameinfo.c.
|
||||||
|
* See getaddrinfo.c and getnameinfo.c.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* for old netdb.h */
|
||||||
|
#ifndef EAI_NODATA
|
||||||
|
#define EAI_NODATA 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef EAI_MEMORY
|
||||||
|
#define EAI_MEMORY 2
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef EAI_FAMILY
|
||||||
|
#define EAI_FAMILY 3
|
||||||
|
#endif
|
||||||
|
|
@ -2,10 +2,10 @@
|
||||||
* fake library for ssh
|
* fake library for ssh
|
||||||
*
|
*
|
||||||
* This file includes getaddrinfo(), freeaddrinfo() and gai_strerror().
|
* This file includes getaddrinfo(), freeaddrinfo() and gai_strerror().
|
||||||
* These functions are defined in rfc2133.
|
* These funtions are defined in rfc2133.
|
||||||
*
|
*
|
||||||
* But these functions are not implemented correctly. The minimum subset
|
* But these functions are not implemented correctly. The minimum subset
|
||||||
* is implemented for ssh use only. For example, this routine assumes
|
* is implemented for ssh use only. For exapmle, this routine assumes
|
||||||
* that ai_family is AF_INET. Don't use it for another purpose.
|
* that ai_family is AF_INET. Don't use it for another purpose.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -17,17 +17,15 @@
|
||||||
#include "xalloc.h"
|
#include "xalloc.h"
|
||||||
|
|
||||||
#if !HAVE_DECL_GAI_STRERROR
|
#if !HAVE_DECL_GAI_STRERROR
|
||||||
char *gai_strerror(int ecode) {
|
char *gai_strerror(int ecode)
|
||||||
switch(ecode) {
|
{
|
||||||
|
switch (ecode) {
|
||||||
case EAI_NODATA:
|
case EAI_NODATA:
|
||||||
return "No address associated with hostname";
|
return "No address associated with hostname";
|
||||||
|
|
||||||
case EAI_MEMORY:
|
case EAI_MEMORY:
|
||||||
return "Memory allocation failure";
|
return "Memory allocation failure";
|
||||||
|
|
||||||
case EAI_FAMILY:
|
case EAI_FAMILY:
|
||||||
return "Address family not supported";
|
return "Address family not supported";
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return "Unknown error";
|
return "Unknown error";
|
||||||
}
|
}
|
||||||
|
|
@ -35,7 +33,8 @@ char *gai_strerror(int ecode) {
|
||||||
#endif /* !HAVE_GAI_STRERROR */
|
#endif /* !HAVE_GAI_STRERROR */
|
||||||
|
|
||||||
#if !HAVE_DECL_FREEADDRINFO
|
#if !HAVE_DECL_FREEADDRINFO
|
||||||
void freeaddrinfo(struct addrinfo *ai) {
|
void freeaddrinfo(struct addrinfo *ai)
|
||||||
|
{
|
||||||
struct addrinfo *next;
|
struct addrinfo *next;
|
||||||
|
|
||||||
while(ai) {
|
while(ai) {
|
||||||
|
|
@ -47,7 +46,8 @@ void freeaddrinfo(struct addrinfo *ai) {
|
||||||
#endif /* !HAVE_FREEADDRINFO */
|
#endif /* !HAVE_FREEADDRINFO */
|
||||||
|
|
||||||
#if !HAVE_DECL_GETADDRINFO
|
#if !HAVE_DECL_GETADDRINFO
|
||||||
static struct addrinfo *malloc_ai(uint16_t port, uint32_t addr) {
|
static struct addrinfo *malloc_ai(uint16_t port, uint32_t addr)
|
||||||
|
{
|
||||||
struct addrinfo *ai;
|
struct addrinfo *ai;
|
||||||
|
|
||||||
ai = xmalloc_and_zero(sizeof(struct addrinfo) + sizeof(struct sockaddr_in));
|
ai = xmalloc_and_zero(sizeof(struct addrinfo) + sizeof(struct sockaddr_in));
|
||||||
|
|
@ -62,43 +62,40 @@ static struct addrinfo *malloc_ai(uint16_t port, uint32_t addr) {
|
||||||
return ai;
|
return ai;
|
||||||
}
|
}
|
||||||
|
|
||||||
int getaddrinfo(const char *hostname, const char *servname, const struct addrinfo *hints, struct addrinfo **res) {
|
int getaddrinfo(const char *hostname, const char *servname, const struct addrinfo *hints, struct addrinfo **res)
|
||||||
|
{
|
||||||
struct addrinfo *prev = NULL;
|
struct addrinfo *prev = NULL;
|
||||||
struct hostent *hp;
|
struct hostent *hp;
|
||||||
struct in_addr in = {0};
|
struct in_addr in = {0};
|
||||||
int i;
|
int i;
|
||||||
uint16_t port = 0;
|
uint16_t port = 0;
|
||||||
|
|
||||||
if(hints && hints->ai_family != AF_INET && hints->ai_family != AF_UNSPEC) {
|
if(hints && hints->ai_family != AF_INET && hints->ai_family != AF_UNSPEC)
|
||||||
return EAI_FAMILY;
|
return EAI_FAMILY;
|
||||||
}
|
|
||||||
|
|
||||||
if(servname) {
|
if (servname)
|
||||||
port = htons(atoi(servname));
|
port = htons(atoi(servname));
|
||||||
}
|
|
||||||
|
|
||||||
if(hints && hints->ai_flags & AI_PASSIVE) {
|
if (hints && hints->ai_flags & AI_PASSIVE) {
|
||||||
*res = malloc_ai(port, htonl(0x00000000));
|
*res = malloc_ai(port, htonl(0x00000000));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!hostname) {
|
if (!hostname) {
|
||||||
*res = malloc_ai(port, htonl(0x7f000001));
|
*res = malloc_ai(port, htonl(0x7f000001));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
hp = gethostbyname(hostname);
|
hp = gethostbyname(hostname);
|
||||||
|
|
||||||
if(!hp || !hp->h_addr_list || !hp->h_addr_list[0]) {
|
if(!hp || !hp->h_addr_list || !hp->h_addr_list[0])
|
||||||
return EAI_NODATA;
|
return EAI_NODATA;
|
||||||
}
|
|
||||||
|
|
||||||
for(i = 0; hp->h_addr_list[i]; i++) {
|
for (i = 0; hp->h_addr_list[i]; i++) {
|
||||||
*res = malloc_ai(port, ((struct in_addr *)hp->h_addr_list[i])->s_addr);
|
*res = malloc_ai(port, ((struct in_addr *)hp->h_addr_list[i])->s_addr);
|
||||||
|
|
||||||
if(prev) {
|
if(prev)
|
||||||
prev->ai_next = *res;
|
prev->ai_next = *res;
|
||||||
}
|
|
||||||
|
|
||||||
prev = *res;
|
prev = *res;
|
||||||
}
|
}
|
||||||
47
lib/fake-getaddrinfo.h
Normal file
47
lib/fake-getaddrinfo.h
Normal file
|
|
@ -0,0 +1,47 @@
|
||||||
|
#ifndef _FAKE_GETADDRINFO_H
|
||||||
|
#define _FAKE_GETADDRINFO_H
|
||||||
|
|
||||||
|
#include "fake-gai-errnos.h"
|
||||||
|
|
||||||
|
#ifndef AI_PASSIVE
|
||||||
|
# define AI_PASSIVE 1
|
||||||
|
# define AI_CANONNAME 2
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef NI_NUMERICHOST
|
||||||
|
# define NI_NUMERICHOST 2
|
||||||
|
# define NI_NAMEREQD 4
|
||||||
|
# define NI_NUMERICSERV 8
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef AI_NUMERICHOST
|
||||||
|
#define AI_NUMERICHOST 4
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAVE_STRUCT_ADDRINFO
|
||||||
|
struct addrinfo {
|
||||||
|
int ai_flags; /* AI_PASSIVE, AI_CANONNAME */
|
||||||
|
int ai_family; /* PF_xxx */
|
||||||
|
int ai_socktype; /* SOCK_xxx */
|
||||||
|
int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */
|
||||||
|
size_t ai_addrlen; /* length of ai_addr */
|
||||||
|
char *ai_canonname; /* canonical name for hostname */
|
||||||
|
struct sockaddr *ai_addr; /* binary address */
|
||||||
|
struct addrinfo *ai_next; /* next structure in linked list */
|
||||||
|
};
|
||||||
|
#endif /* !HAVE_STRUCT_ADDRINFO */
|
||||||
|
|
||||||
|
#if !HAVE_DECL_GETADDRINFO
|
||||||
|
int getaddrinfo(const char *hostname, const char *servname,
|
||||||
|
const struct addrinfo *hints, struct addrinfo **res);
|
||||||
|
#endif /* !HAVE_GETADDRINFO */
|
||||||
|
|
||||||
|
#if !HAVE_DECL_GAI_STRERROR
|
||||||
|
char *gai_strerror(int ecode);
|
||||||
|
#endif /* !HAVE_GAI_STRERROR */
|
||||||
|
|
||||||
|
#if !HAVE_DECL_FREEADDRINFO
|
||||||
|
void freeaddrinfo(struct addrinfo *ai);
|
||||||
|
#endif /* !HAVE_FREEADDRINFO */
|
||||||
|
|
||||||
|
#endif /* _FAKE_GETADDRINFO_H */
|
||||||
|
|
@ -2,10 +2,10 @@
|
||||||
* fake library for ssh
|
* fake library for ssh
|
||||||
*
|
*
|
||||||
* This file includes getnameinfo().
|
* This file includes getnameinfo().
|
||||||
* These functions are defined in rfc2133.
|
* These funtions are defined in rfc2133.
|
||||||
*
|
*
|
||||||
* But these functions are not implemented correctly. The minimum subset
|
* But these functions are not implemented correctly. The minimum subset
|
||||||
* is implemented for ssh use only. For example, this routine assumes
|
* is implemented for ssh use only. For exapmle, this routine assumes
|
||||||
* that ai_family is AF_INET. Don't use it for another purpose.
|
* that ai_family is AF_INET. Don't use it for another purpose.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -16,48 +16,39 @@
|
||||||
|
|
||||||
#if !HAVE_DECL_GETNAMEINFO
|
#if !HAVE_DECL_GETNAMEINFO
|
||||||
|
|
||||||
int getnameinfo(const struct sockaddr *sa, size_t salen, char *host, size_t hostlen, char *serv, size_t servlen, int flags) {
|
int getnameinfo(const struct sockaddr *sa, size_t salen, char *host, size_t hostlen, char *serv, size_t servlen, int flags)
|
||||||
|
{
|
||||||
struct sockaddr_in *sin = (struct sockaddr_in *)sa;
|
struct sockaddr_in *sin = (struct sockaddr_in *)sa;
|
||||||
struct hostent *hp;
|
struct hostent *hp;
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
if(sa->sa_family != AF_INET) {
|
if(sa->sa_family != AF_INET)
|
||||||
return EAI_FAMILY;
|
return EAI_FAMILY;
|
||||||
}
|
|
||||||
|
|
||||||
if(serv && servlen) {
|
if(serv && servlen) {
|
||||||
len = snprintf(serv, servlen, "%d", ntohs(sin->sin_port));
|
len = snprintf(serv, servlen, "%d", ntohs(sin->sin_port));
|
||||||
|
if(len < 0 || len >= servlen)
|
||||||
if(len < 0 || len >= servlen) {
|
|
||||||
return EAI_MEMORY;
|
return EAI_MEMORY;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(!host || !hostlen) {
|
if(!host || !hostlen)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
|
||||||
|
|
||||||
if(flags & NI_NUMERICHOST) {
|
if(flags & NI_NUMERICHOST) {
|
||||||
len = snprintf(host, hostlen, "%s", inet_ntoa(sin->sin_addr));
|
len = snprintf(host, hostlen, "%s", inet_ntoa(sin->sin_addr));
|
||||||
|
if(len < 0 || len >= hostlen)
|
||||||
if(len < 0 || len >= hostlen) {
|
|
||||||
return EAI_MEMORY;
|
return EAI_MEMORY;
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
hp = gethostbyaddr((char *)&sin->sin_addr, sizeof(struct in_addr), AF_INET);
|
hp = gethostbyaddr((char *)&sin->sin_addr, sizeof(struct in_addr), AF_INET);
|
||||||
|
|
||||||
if(!hp || !hp->h_name || !hp->h_name[0]) {
|
if(!hp || !hp->h_name || !hp->h_name[0])
|
||||||
return EAI_NODATA;
|
return EAI_NODATA;
|
||||||
}
|
|
||||||
|
|
||||||
len = snprintf(host, hostlen, "%s", hp->h_name);
|
len = snprintf(host, hostlen, "%s", hp->h_name);
|
||||||
|
if(len < 0 || len >= hostlen)
|
||||||
if(len < 0 || len >= hostlen) {
|
|
||||||
return EAI_MEMORY;
|
return EAI_MEMORY;
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
#ifndef TINC_FAKE_GETNAMEINFO_H
|
#ifndef _FAKE_GETNAMEINFO_H
|
||||||
#define TINC_FAKE_GETNAMEINFO_H
|
#define _FAKE_GETNAMEINFO_H
|
||||||
|
|
||||||
#if !HAVE_DECL_GETNAMEINFO
|
#if !HAVE_DECL_GETNAMEINFO
|
||||||
int getnameinfo(const struct sockaddr *sa, size_t salen, char *host,
|
int getnameinfo(const struct sockaddr *sa, size_t salen, char *host,
|
||||||
|
|
@ -13,4 +13,4 @@ int getnameinfo(const struct sockaddr *sa, size_t salen, char *host,
|
||||||
# define NI_MAXHOST 1025
|
# define NI_MAXHOST 1025
|
||||||
#endif /* !NI_MAXHOST */
|
#endif /* !NI_MAXHOST */
|
||||||
|
|
||||||
#endif
|
#endif /* _FAKE_GETNAMEINFO_H */
|
||||||
1048
lib/getopt.c
Normal file
1048
lib/getopt.c
Normal file
File diff suppressed because it is too large
Load diff
133
lib/getopt.h
Normal file
133
lib/getopt.h
Normal file
|
|
@ -0,0 +1,133 @@
|
||||||
|
/* Declarations for getopt.
|
||||||
|
Copyright (C) 1989,90,91,92,93,94,96,97 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||||
|
Bugs can be reported to bug-glibc@prep.ai.mit.edu.
|
||||||
|
|
||||||
|
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, write to the Free Software Foundation, Inc.,
|
||||||
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _GETOPT_H
|
||||||
|
#define _GETOPT_H 1
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* For communication from `getopt' to the caller.
|
||||||
|
When `getopt' finds an option that takes an argument,
|
||||||
|
the argument value is returned here.
|
||||||
|
Also, when `ordering' is RETURN_IN_ORDER,
|
||||||
|
each non-option ARGV-element is returned here. */
|
||||||
|
|
||||||
|
extern char *optarg;
|
||||||
|
|
||||||
|
/* Index in ARGV of the next element to be scanned.
|
||||||
|
This is used for communication to and from the caller
|
||||||
|
and for communication between successive calls to `getopt'.
|
||||||
|
|
||||||
|
On entry to `getopt', zero means this is the first call; initialize.
|
||||||
|
|
||||||
|
When `getopt' returns -1, this is the index of the first of the
|
||||||
|
non-option elements that the caller should itself scan.
|
||||||
|
|
||||||
|
Otherwise, `optind' communicates from one call to the next
|
||||||
|
how much of ARGV has been scanned so far. */
|
||||||
|
|
||||||
|
extern int optind;
|
||||||
|
|
||||||
|
/* Callers store zero here to inhibit the error message `getopt' prints
|
||||||
|
for unrecognized options. */
|
||||||
|
|
||||||
|
extern int opterr;
|
||||||
|
|
||||||
|
/* Set to an option character which was unrecognized. */
|
||||||
|
|
||||||
|
extern int optopt;
|
||||||
|
|
||||||
|
/* Describe the long-named options requested by the application.
|
||||||
|
The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
|
||||||
|
of `struct option' terminated by an element containing a name which is
|
||||||
|
zero.
|
||||||
|
|
||||||
|
The field `has_arg' is:
|
||||||
|
no_argument (or 0) if the option does not take an argument,
|
||||||
|
required_argument (or 1) if the option requires an argument,
|
||||||
|
optional_argument (or 2) if the option takes an optional argument.
|
||||||
|
|
||||||
|
If the field `flag' is not NULL, it points to a variable that is set
|
||||||
|
to the value given in the field `val' when the option is found, but
|
||||||
|
left unchanged if the option is not found.
|
||||||
|
|
||||||
|
To have a long-named option do something other than set an `int' to
|
||||||
|
a compiled-in constant, such as set a value from `optarg', set the
|
||||||
|
option's `flag' field to zero and its `val' field to a nonzero
|
||||||
|
value (the equivalent single-letter option character, if there is
|
||||||
|
one). For long options that have a zero `flag' field, `getopt'
|
||||||
|
returns the contents of the `val' field. */
|
||||||
|
|
||||||
|
struct option
|
||||||
|
{
|
||||||
|
#if defined (__STDC__) && __STDC__
|
||||||
|
const char *name;
|
||||||
|
#else
|
||||||
|
char *name;
|
||||||
|
#endif
|
||||||
|
/* has_arg can't be an enum because some compilers complain about
|
||||||
|
type mismatches in all the code that assumes it is an int. */
|
||||||
|
int has_arg;
|
||||||
|
int *flag;
|
||||||
|
int val;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Names for the values of the `has_arg' field of `struct option'. */
|
||||||
|
|
||||||
|
#define no_argument 0
|
||||||
|
#define required_argument 1
|
||||||
|
#define optional_argument 2
|
||||||
|
|
||||||
|
#if defined (__STDC__) && __STDC__
|
||||||
|
#ifdef __GNU_LIBRARY__
|
||||||
|
/* Many other libraries have conflicting prototypes for getopt, with
|
||||||
|
differences in the consts, in stdlib.h. To avoid compilation
|
||||||
|
errors, only prototype getopt for the GNU C library. */
|
||||||
|
extern int getopt (int argc, char *const *argv, const char *shortopts);
|
||||||
|
#else /* not __GNU_LIBRARY__ */
|
||||||
|
extern int getopt ();
|
||||||
|
#endif /* __GNU_LIBRARY__ */
|
||||||
|
extern int getopt_long (int argc, char *const *argv, const char *shortopts,
|
||||||
|
const struct option *longopts, int *longind);
|
||||||
|
extern int getopt_long_only (int argc, char *const *argv,
|
||||||
|
const char *shortopts,
|
||||||
|
const struct option *longopts, int *longind);
|
||||||
|
|
||||||
|
/* Internal only. Users should not call this directly. */
|
||||||
|
extern int _getopt_internal (int argc, char *const *argv,
|
||||||
|
const char *shortopts,
|
||||||
|
const struct option *longopts, int *longind,
|
||||||
|
int long_only);
|
||||||
|
#else /* not __STDC__ */
|
||||||
|
extern int getopt ();
|
||||||
|
extern int getopt_long ();
|
||||||
|
extern int getopt_long_only ();
|
||||||
|
|
||||||
|
extern int _getopt_internal ();
|
||||||
|
#endif /* __STDC__ */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* _GETOPT_H */
|
||||||
|
|
@ -20,7 +20,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "../config.h"
|
#include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "getopt.h"
|
#include "getopt.h"
|
||||||
|
|
@ -65,14 +65,14 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int
|
int
|
||||||
getopt_long(argc, argv, options, long_options, opt_index)
|
getopt_long (argc, argv, options, long_options, opt_index)
|
||||||
int argc;
|
int argc;
|
||||||
char *const *argv;
|
char *const *argv;
|
||||||
const char *options;
|
const char *options;
|
||||||
const struct option *long_options;
|
const struct option *long_options;
|
||||||
int *opt_index;
|
int *opt_index;
|
||||||
{
|
{
|
||||||
return _getopt_internal(argc, argv, options, long_options, opt_index, 0);
|
return _getopt_internal (argc, argv, options, long_options, opt_index, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Like getopt_long, but '-' as well as '--' can indicate a long option.
|
/* Like getopt_long, but '-' as well as '--' can indicate a long option.
|
||||||
|
|
@ -81,14 +81,14 @@ int *opt_index;
|
||||||
instead. */
|
instead. */
|
||||||
|
|
||||||
int
|
int
|
||||||
getopt_long_only(argc, argv, options, long_options, opt_index)
|
getopt_long_only (argc, argv, options, long_options, opt_index)
|
||||||
int argc;
|
int argc;
|
||||||
char *const *argv;
|
char *const *argv;
|
||||||
const char *options;
|
const char *options;
|
||||||
const struct option *long_options;
|
const struct option *long_options;
|
||||||
int *opt_index;
|
int *opt_index;
|
||||||
{
|
{
|
||||||
return _getopt_internal(argc, argv, options, long_options, opt_index, 1);
|
return _getopt_internal (argc, argv, options, long_options, opt_index, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -99,17 +99,19 @@ int *opt_index;
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
int
|
int
|
||||||
main(argc, argv)
|
main (argc, argv)
|
||||||
int argc;
|
int argc;
|
||||||
char **argv;
|
char **argv;
|
||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
int digit_optind = 0;
|
int digit_optind = 0;
|
||||||
|
|
||||||
while(1) {
|
while (1)
|
||||||
|
{
|
||||||
int this_option_optind = optind ? optind : 1;
|
int this_option_optind = optind ? optind : 1;
|
||||||
int option_index = 0;
|
int option_index = 0;
|
||||||
static struct option long_options[] = {
|
static struct option long_options[] =
|
||||||
|
{
|
||||||
{"add", 1, 0, 0},
|
{"add", 1, 0, 0},
|
||||||
{"append", 0, 0, 0},
|
{"append", 0, 0, 0},
|
||||||
{"delete", 1, 0, 0},
|
{"delete", 1, 0, 0},
|
||||||
|
|
@ -119,22 +121,18 @@ char **argv;
|
||||||
{0, 0, 0, 0}
|
{0, 0, 0, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
c = getopt_long(argc, argv, "abc:d:0123456789",
|
c = getopt_long (argc, argv, "abc:d:0123456789",
|
||||||
long_options, &option_index);
|
long_options, &option_index);
|
||||||
|
if (c == -1)
|
||||||
if(c == -1) {
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
|
|
||||||
switch(c) {
|
switch (c)
|
||||||
|
{
|
||||||
case 0:
|
case 0:
|
||||||
printf("option %s", long_options[option_index].name);
|
printf ("option %s", long_options[option_index].name);
|
||||||
|
if (optarg)
|
||||||
if(optarg) {
|
printf (" with arg %s", optarg);
|
||||||
printf(" with arg %s", optarg);
|
printf ("\n");
|
||||||
}
|
|
||||||
|
|
||||||
printf("\n");
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '0':
|
case '0':
|
||||||
|
|
@ -147,49 +145,45 @@ char **argv;
|
||||||
case '7':
|
case '7':
|
||||||
case '8':
|
case '8':
|
||||||
case '9':
|
case '9':
|
||||||
if(digit_optind != 0 && digit_optind != this_option_optind) {
|
if (digit_optind != 0 && digit_optind != this_option_optind)
|
||||||
printf("digits occur in two different argv-elements.\n");
|
printf ("digits occur in two different argv-elements.\n");
|
||||||
}
|
|
||||||
|
|
||||||
digit_optind = this_option_optind;
|
digit_optind = this_option_optind;
|
||||||
printf("option %c\n", c);
|
printf ("option %c\n", c);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'a':
|
case 'a':
|
||||||
printf("option a\n");
|
printf ("option a\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'b':
|
case 'b':
|
||||||
printf("option b\n");
|
printf ("option b\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'c':
|
case 'c':
|
||||||
printf("option c with value `%s'\n", optarg);
|
printf ("option c with value `%s'\n", optarg);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'd':
|
case 'd':
|
||||||
printf("option d with value `%s'\n", optarg);
|
printf ("option d with value `%s'\n", optarg);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '?':
|
case '?':
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
printf("?? getopt returned character code 0%o ??\n", c);
|
printf ("?? getopt returned character code 0%o ??\n", c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(optind < argc) {
|
if (optind < argc)
|
||||||
printf("non-option ARGV-elements: ");
|
{
|
||||||
|
printf ("non-option ARGV-elements: ");
|
||||||
while(optind < argc) {
|
while (optind < argc)
|
||||||
printf("%s ", argv[optind++]);
|
printf ("%s ", argv[optind++]);
|
||||||
|
printf ("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("\n");
|
exit (0);
|
||||||
}
|
|
||||||
|
|
||||||
exit(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TEST */
|
#endif /* TEST */
|
||||||
|
|
@ -1,6 +1,3 @@
|
||||||
#ifndef TINC_IPV4_H
|
|
||||||
#define TINC_IPV4_H
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
ipv4.h -- missing IPv4 related definitions
|
ipv4.h -- missing IPv4 related definitions
|
||||||
Copyright (C) 2005 Ivo Timmermans
|
Copyright (C) 2005 Ivo Timmermans
|
||||||
|
|
@ -21,6 +18,9 @@
|
||||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifndef __TINC_IPV4_H__
|
||||||
|
#define __TINC_IPV4_H__
|
||||||
|
|
||||||
#ifndef AF_INET
|
#ifndef AF_INET
|
||||||
#define AF_INET 2
|
#define AF_INET 2
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -64,11 +64,11 @@
|
||||||
#ifndef HAVE_STRUCT_IP
|
#ifndef HAVE_STRUCT_IP
|
||||||
struct ip {
|
struct ip {
|
||||||
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
||||||
unsigned int ip_hl: 4;
|
unsigned int ip_hl:4;
|
||||||
unsigned int ip_v: 4;
|
unsigned int ip_v:4;
|
||||||
#else
|
#else
|
||||||
unsigned int ip_v: 4;
|
unsigned int ip_v:4;
|
||||||
unsigned int ip_hl: 4;
|
unsigned int ip_hl:4;
|
||||||
#endif
|
#endif
|
||||||
uint8_t ip_tos;
|
uint8_t ip_tos;
|
||||||
uint16_t ip_len;
|
uint16_t ip_len;
|
||||||
|
|
@ -81,7 +81,7 @@ struct ip {
|
||||||
uint8_t ip_p;
|
uint8_t ip_p;
|
||||||
uint16_t ip_sum;
|
uint16_t ip_sum;
|
||||||
struct in_addr ip_src, ip_dst;
|
struct in_addr ip_src, ip_dst;
|
||||||
} __attribute__((__packed__));
|
} __attribute__ ((__packed__));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef IP_OFFMASK
|
#ifndef IP_OFFMASK
|
||||||
|
|
@ -143,7 +143,7 @@ struct icmp {
|
||||||
#define icmp_radv icmp_dun.id_radv
|
#define icmp_radv icmp_dun.id_radv
|
||||||
#define icmp_mask icmp_dun.id_mask
|
#define icmp_mask icmp_dun.id_mask
|
||||||
#define icmp_data icmp_dun.id_data
|
#define icmp_data icmp_dun.id_data
|
||||||
} __attribute__((__packed__));
|
} __attribute__ ((__packed__));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif /* __TINC_IPV4_H__ */
|
||||||
|
|
@ -1,6 +1,3 @@
|
||||||
#ifndef TINC_IPV6_H
|
|
||||||
#define TINC_IPV6_H
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
ipv6.h -- missing IPv6 related definitions
|
ipv6.h -- missing IPv6 related definitions
|
||||||
Copyright (C) 2005 Ivo Timmermans
|
Copyright (C) 2005 Ivo Timmermans
|
||||||
|
|
@ -21,6 +18,9 @@
|
||||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifndef __TINC_IPV6_H__
|
||||||
|
#define __TINC_IPV6_H__
|
||||||
|
|
||||||
#ifndef AF_INET6
|
#ifndef AF_INET6
|
||||||
#define AF_INET6 10
|
#define AF_INET6 10
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -36,7 +36,7 @@ struct in6_addr {
|
||||||
uint16_t u6_addr16[8];
|
uint16_t u6_addr16[8];
|
||||||
uint32_t u6_addr32[4];
|
uint32_t u6_addr32[4];
|
||||||
} in6_u;
|
} in6_u;
|
||||||
} __attribute__((__packed__));
|
} __attribute__ ((__packed__));
|
||||||
#define s6_addr in6_u.u6_addr8
|
#define s6_addr in6_u.u6_addr8
|
||||||
#define s6_addr16 in6_u.u6_addr16
|
#define s6_addr16 in6_u.u6_addr16
|
||||||
#define s6_addr32 in6_u.u6_addr32
|
#define s6_addr32 in6_u.u6_addr32
|
||||||
|
|
@ -49,14 +49,14 @@ struct sockaddr_in6 {
|
||||||
uint32_t sin6_flowinfo;
|
uint32_t sin6_flowinfo;
|
||||||
struct in6_addr sin6_addr;
|
struct in6_addr sin6_addr;
|
||||||
uint32_t sin6_scope_id;
|
uint32_t sin6_scope_id;
|
||||||
} __attribute__((__packed__));
|
} __attribute__ ((__packed__));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef IN6_IS_ADDR_V4MAPPED
|
#ifndef IN6_IS_ADDR_V4MAPPED
|
||||||
#define IN6_IS_ADDR_V4MAPPED(a) \
|
#define IN6_IS_ADDR_V4MAPPED(a) \
|
||||||
((((const uint32_t *) (a))[0] == 0) \
|
((((__const uint32_t *) (a))[0] == 0) \
|
||||||
&& (((const uint32_t *) (a))[1] == 0) \
|
&& (((__const uint32_t *) (a))[1] == 0) \
|
||||||
&& (((const uint32_t *) (a))[2] == htonl (0xffff)))
|
&& (((__const uint32_t *) (a))[2] == htonl (0xffff)))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef HAVE_STRUCT_IP6_HDR
|
#ifndef HAVE_STRUCT_IP6_HDR
|
||||||
|
|
@ -72,7 +72,7 @@ struct ip6_hdr {
|
||||||
} ip6_ctlun;
|
} ip6_ctlun;
|
||||||
struct in6_addr ip6_src;
|
struct in6_addr ip6_src;
|
||||||
struct in6_addr ip6_dst;
|
struct in6_addr ip6_dst;
|
||||||
} __attribute__((__packed__));
|
} __attribute__ ((__packed__));
|
||||||
#define ip6_vfc ip6_ctlun.ip6_un2_vfc
|
#define ip6_vfc ip6_ctlun.ip6_un2_vfc
|
||||||
#define ip6_flow ip6_ctlun.ip6_un1.ip6_un1_flow
|
#define ip6_flow ip6_ctlun.ip6_un1.ip6_un1_flow
|
||||||
#define ip6_plen ip6_ctlun.ip6_un1.ip6_un1_plen
|
#define ip6_plen ip6_ctlun.ip6_un1.ip6_un1_plen
|
||||||
|
|
@ -91,7 +91,7 @@ struct icmp6_hdr {
|
||||||
uint16_t icmp6_un_data16[2];
|
uint16_t icmp6_un_data16[2];
|
||||||
uint8_t icmp6_un_data8[4];
|
uint8_t icmp6_un_data8[4];
|
||||||
} icmp6_dataun;
|
} icmp6_dataun;
|
||||||
} __attribute__((__packed__));
|
} __attribute__ ((__packed__));
|
||||||
#define ICMP6_DST_UNREACH_NOROUTE 0
|
#define ICMP6_DST_UNREACH_NOROUTE 0
|
||||||
#define ICMP6_DST_UNREACH 1
|
#define ICMP6_DST_UNREACH 1
|
||||||
#define ICMP6_PACKET_TOO_BIG 2
|
#define ICMP6_PACKET_TOO_BIG 2
|
||||||
|
|
@ -111,7 +111,7 @@ struct icmp6_hdr {
|
||||||
struct nd_neighbor_solicit {
|
struct nd_neighbor_solicit {
|
||||||
struct icmp6_hdr nd_ns_hdr;
|
struct icmp6_hdr nd_ns_hdr;
|
||||||
struct in6_addr nd_ns_target;
|
struct in6_addr nd_ns_target;
|
||||||
} __attribute__((__packed__));
|
} __attribute__ ((__packed__));
|
||||||
#define ND_OPT_SOURCE_LINKADDR 1
|
#define ND_OPT_SOURCE_LINKADDR 1
|
||||||
#define ND_OPT_TARGET_LINKADDR 2
|
#define ND_OPT_TARGET_LINKADDR 2
|
||||||
#define nd_ns_type nd_ns_hdr.icmp6_type
|
#define nd_ns_type nd_ns_hdr.icmp6_type
|
||||||
|
|
@ -124,7 +124,7 @@ struct nd_neighbor_solicit {
|
||||||
struct nd_opt_hdr {
|
struct nd_opt_hdr {
|
||||||
uint8_t nd_opt_type;
|
uint8_t nd_opt_type;
|
||||||
uint8_t nd_opt_len;
|
uint8_t nd_opt_len;
|
||||||
} __attribute__((__packed__));
|
} __attribute__ ((__packed__));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif /* __TINC_IPV6_H__ */
|
||||||
|
|
@ -43,9 +43,8 @@ list_node_t *list_alloc_node(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void list_free_node(list_t *list, list_node_t *node) {
|
void list_free_node(list_t *list, list_node_t *node) {
|
||||||
if(node->data && list->delete) {
|
if(node->data && list->delete)
|
||||||
list->delete(node->data);
|
list->delete(node->data);
|
||||||
}
|
|
||||||
|
|
||||||
free(node);
|
free(node);
|
||||||
}
|
}
|
||||||
|
|
@ -62,11 +61,10 @@ list_node_t *list_insert_head(list_t *list, void *data) {
|
||||||
node->next = list->head;
|
node->next = list->head;
|
||||||
list->head = node;
|
list->head = node;
|
||||||
|
|
||||||
if(node->next) {
|
if(node->next)
|
||||||
node->next->prev = node;
|
node->next->prev = node;
|
||||||
} else {
|
else
|
||||||
list->tail = node;
|
list->tail = node;
|
||||||
}
|
|
||||||
|
|
||||||
list->count++;
|
list->count++;
|
||||||
|
|
||||||
|
|
@ -83,11 +81,10 @@ list_node_t *list_insert_tail(list_t *list, void *data) {
|
||||||
node->prev = list->tail;
|
node->prev = list->tail;
|
||||||
list->tail = node;
|
list->tail = node;
|
||||||
|
|
||||||
if(node->prev) {
|
if(node->prev)
|
||||||
node->prev->next = node;
|
node->prev->next = node;
|
||||||
} else {
|
else
|
||||||
list->head = node;
|
list->head = node;
|
||||||
}
|
|
||||||
|
|
||||||
list->count++;
|
list->count++;
|
||||||
|
|
||||||
|
|
@ -95,17 +92,15 @@ list_node_t *list_insert_tail(list_t *list, void *data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void list_unlink_node(list_t *list, list_node_t *node) {
|
void list_unlink_node(list_t *list, list_node_t *node) {
|
||||||
if(node->prev) {
|
if(node->prev)
|
||||||
node->prev->next = node->next;
|
node->prev->next = node->next;
|
||||||
} else {
|
else
|
||||||
list->head = node->next;
|
list->head = node->next;
|
||||||
}
|
|
||||||
|
|
||||||
if(node->next) {
|
if(node->next)
|
||||||
node->next->prev = node->prev;
|
node->next->prev = node->prev;
|
||||||
} else {
|
else
|
||||||
list->tail = node->prev;
|
list->tail = node->prev;
|
||||||
}
|
|
||||||
|
|
||||||
list->count--;
|
list->count--;
|
||||||
}
|
}
|
||||||
|
|
@ -126,19 +121,17 @@ void list_delete_tail(list_t *list) {
|
||||||
/* Head/tail lookup */
|
/* Head/tail lookup */
|
||||||
|
|
||||||
void *list_get_head(list_t *list) {
|
void *list_get_head(list_t *list) {
|
||||||
if(list->head) {
|
if(list->head)
|
||||||
return list->head->data;
|
return list->head->data;
|
||||||
} else {
|
else
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void *list_get_tail(list_t *list) {
|
void *list_get_tail(list_t *list) {
|
||||||
if(list->tail) {
|
if(list->tail)
|
||||||
return list->tail->data;
|
return list->tail->data;
|
||||||
} else {
|
else
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Fast list deletion */
|
/* Fast list deletion */
|
||||||
|
|
@ -170,9 +163,7 @@ void list_foreach(list_t *list, list_action_t action) {
|
||||||
|
|
||||||
for(node = list->head; node; node = next) {
|
for(node = list->head; node; node = next) {
|
||||||
next = node->next;
|
next = node->next;
|
||||||
|
if(node->data)
|
||||||
if(node->data) {
|
|
||||||
action(node->data);
|
action(node->data);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
@ -1,6 +1,3 @@
|
||||||
#ifndef TINC_LIST_H
|
|
||||||
#define TINC_LIST_H
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
list.h -- header file for list.c
|
list.h -- header file for list.c
|
||||||
Copyright (C) 2000-2005 Ivo Timmermans
|
Copyright (C) 2000-2005 Ivo Timmermans
|
||||||
|
|
@ -21,6 +18,9 @@
|
||||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifndef __TINC_LIST_H__
|
||||||
|
#define __TINC_LIST_H__
|
||||||
|
|
||||||
typedef struct list_node_t {
|
typedef struct list_node_t {
|
||||||
struct list_node_t *prev;
|
struct list_node_t *prev;
|
||||||
struct list_node_t *next;
|
struct list_node_t *next;
|
||||||
|
|
@ -45,34 +45,34 @@ typedef struct list_t {
|
||||||
|
|
||||||
/* (De)constructors */
|
/* (De)constructors */
|
||||||
|
|
||||||
extern list_t *list_alloc(list_action_t) __attribute__((__malloc__));
|
extern list_t *list_alloc(list_action_t) __attribute__ ((__malloc__));
|
||||||
extern void list_free(list_t *list);
|
extern void list_free(list_t *);
|
||||||
extern list_node_t *list_alloc_node(void);
|
extern list_node_t *list_alloc_node(void);
|
||||||
extern void list_free_node(list_t *list, list_node_t *node);
|
extern void list_free_node(list_t *, list_node_t *);
|
||||||
|
|
||||||
/* Insertion and deletion */
|
/* Insertion and deletion */
|
||||||
|
|
||||||
extern list_node_t *list_insert_head(list_t *list, void *data);
|
extern list_node_t *list_insert_head(list_t *, void *);
|
||||||
extern list_node_t *list_insert_tail(list_t *list, void *data);
|
extern list_node_t *list_insert_tail(list_t *, void *);
|
||||||
|
|
||||||
extern void list_unlink_node(list_t *list, list_node_t *node);
|
extern void list_unlink_node(list_t *, list_node_t *);
|
||||||
extern void list_delete_node(list_t *list, list_node_t *node);
|
extern void list_delete_node(list_t *, list_node_t *);
|
||||||
|
|
||||||
extern void list_delete_head(list_t *list);
|
extern void list_delete_head(list_t *);
|
||||||
extern void list_delete_tail(list_t *list);
|
extern void list_delete_tail(list_t *);
|
||||||
|
|
||||||
/* Head/tail lookup */
|
/* Head/tail lookup */
|
||||||
|
|
||||||
extern void *list_get_head(list_t *list);
|
extern void *list_get_head(list_t *);
|
||||||
extern void *list_get_tail(list_t *list);
|
extern void *list_get_tail(list_t *);
|
||||||
|
|
||||||
/* Fast list deletion */
|
/* Fast list deletion */
|
||||||
|
|
||||||
extern void list_delete_list(list_t *list);
|
extern void list_delete_list(list_t *);
|
||||||
|
|
||||||
/* Traversing */
|
/* Traversing */
|
||||||
|
|
||||||
extern void list_foreach(list_t *list, list_action_t action);
|
extern void list_foreach(list_t *, list_action_t);
|
||||||
extern void list_foreach_node(list_t *list, list_action_node_t action);
|
extern void list_foreach_node(list_t *, list_action_node_t);
|
||||||
|
|
||||||
#endif
|
#endif /* __TINC_LIST_H__ */
|
||||||
39
lib/malloc.c
Normal file
39
lib/malloc.c
Normal file
|
|
@ -0,0 +1,39 @@
|
||||||
|
/* Work around bug on some systems where malloc (0) fails.
|
||||||
|
Copyright (C) 1997 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
|
||||||
|
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, write to the Free Software Foundation, Inc., Foundation,
|
||||||
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
|
||||||
|
|
||||||
|
/* written by Jim Meyering */
|
||||||
|
|
||||||
|
#if HAVE_CONFIG_H
|
||||||
|
# include <config.h>
|
||||||
|
#endif
|
||||||
|
#undef malloc
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
char *malloc ();
|
||||||
|
|
||||||
|
/* Allocate an N-byte block of memory from the heap.
|
||||||
|
If N is zero, allocate a 1-byte block. */
|
||||||
|
|
||||||
|
char *
|
||||||
|
rpl_malloc (n)
|
||||||
|
size_t n;
|
||||||
|
{
|
||||||
|
if (n == 0)
|
||||||
|
n = 1;
|
||||||
|
return malloc (n);
|
||||||
|
}
|
||||||
395
lib/memcmp.c
Normal file
395
lib/memcmp.c
Normal file
|
|
@ -0,0 +1,395 @@
|
||||||
|
/* Copyright (C) 1991, 1993, 1995, 1997, 1998 Free Software Foundation, Inc.
|
||||||
|
Contributed by Torbjorn Granlund (tege@sics.se).
|
||||||
|
|
||||||
|
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||||
|
Bugs can be reported to bug-glibc@prep.ai.mit.edu.
|
||||||
|
|
||||||
|
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, write to the Free Software Foundation, Inc.,
|
||||||
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
# include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_INTTYPES_H
|
||||||
|
#include <inttypes.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#undef __ptr_t
|
||||||
|
#if defined __cplusplus || (defined __STDC__ && __STDC__)
|
||||||
|
# define __ptr_t void *
|
||||||
|
#else /* Not C++ or ANSI C. */
|
||||||
|
# undef const
|
||||||
|
# define const
|
||||||
|
# define __ptr_t char *
|
||||||
|
#endif /* C++ or ANSI C. */
|
||||||
|
|
||||||
|
#ifndef __P
|
||||||
|
# if defined __GNUC__ || (defined __STDC__ && __STDC__)
|
||||||
|
# define __P(args) args
|
||||||
|
# else
|
||||||
|
# define __P(args) ()
|
||||||
|
# endif /* GCC. */
|
||||||
|
#endif /* Not __P. */
|
||||||
|
|
||||||
|
#if defined HAVE_STRING_H || defined _LIBC
|
||||||
|
# include <string.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#undef memcmp
|
||||||
|
|
||||||
|
#ifdef _LIBC
|
||||||
|
|
||||||
|
# include <memcopy.h>
|
||||||
|
|
||||||
|
#else /* Not in the GNU C library. */
|
||||||
|
|
||||||
|
# include <sys/types.h>
|
||||||
|
|
||||||
|
/* Type to use for aligned memory operations.
|
||||||
|
This should normally be the biggest type supported by a single load
|
||||||
|
and store. Must be an unsigned type. */
|
||||||
|
# define op_t unsigned long int
|
||||||
|
# define OPSIZ (sizeof(op_t))
|
||||||
|
|
||||||
|
/* Threshold value for when to enter the unrolled loops. */
|
||||||
|
# define OP_T_THRES 16
|
||||||
|
|
||||||
|
/* Type to use for unaligned operations. */
|
||||||
|
typedef unsigned char byte;
|
||||||
|
|
||||||
|
# ifndef WORDS_BIGENDIAN
|
||||||
|
# define MERGE(w0, sh_1, w1, sh_2) (((w0) >> (sh_1)) | ((w1) << (sh_2)))
|
||||||
|
# else
|
||||||
|
# define MERGE(w0, sh_1, w1, sh_2) (((w0) << (sh_1)) | ((w1) >> (sh_2)))
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#endif /* In the GNU C library. */
|
||||||
|
|
||||||
|
#ifdef WORDS_BIGENDIAN
|
||||||
|
# define CMP_LT_OR_GT(a, b) ((a) > (b) ? 1 : -1)
|
||||||
|
#else
|
||||||
|
# define CMP_LT_OR_GT(a, b) memcmp_bytes ((a), (b))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* BE VERY CAREFUL IF YOU CHANGE THIS CODE! */
|
||||||
|
|
||||||
|
/* The strategy of this memcmp is:
|
||||||
|
|
||||||
|
1. Compare bytes until one of the block pointers is aligned.
|
||||||
|
|
||||||
|
2. Compare using memcmp_common_alignment or
|
||||||
|
memcmp_not_common_alignment, regarding the alignment of the other
|
||||||
|
block after the initial byte operations. The maximum number of
|
||||||
|
full words (of type op_t) are compared in this way.
|
||||||
|
|
||||||
|
3. Compare the few remaining bytes. */
|
||||||
|
|
||||||
|
#ifndef WORDS_BIGENDIAN
|
||||||
|
/* memcmp_bytes -- Compare A and B bytewise in the byte order of the machine.
|
||||||
|
A and B are known to be different.
|
||||||
|
This is needed only on little-endian machines. */
|
||||||
|
|
||||||
|
static int memcmp_bytes __P((op_t, op_t));
|
||||||
|
|
||||||
|
# ifdef __GNUC__
|
||||||
|
__inline
|
||||||
|
# endif
|
||||||
|
static int
|
||||||
|
memcmp_bytes (a, b)
|
||||||
|
op_t a, b;
|
||||||
|
{
|
||||||
|
intptr_t srcp1 = (intptr_t) &a;
|
||||||
|
intptr_t srcp2 = (intptr_t) &b;
|
||||||
|
op_t a0, b0;
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
a0 = ((byte *) srcp1)[0];
|
||||||
|
b0 = ((byte *) srcp2)[0];
|
||||||
|
srcp1 += 1;
|
||||||
|
srcp2 += 1;
|
||||||
|
}
|
||||||
|
while (a0 == b0);
|
||||||
|
return a0 - b0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static int memcmp_common_alignment __P((intptr_t, intptr_t, size_t));
|
||||||
|
|
||||||
|
/* memcmp_common_alignment -- Compare blocks at SRCP1 and SRCP2 with LEN `op_t'
|
||||||
|
objects (not LEN bytes!). Both SRCP1 and SRCP2 should be aligned for
|
||||||
|
memory operations on `op_t's. */
|
||||||
|
#ifdef __GNUC__
|
||||||
|
__inline
|
||||||
|
#endif
|
||||||
|
static int
|
||||||
|
memcmp_common_alignment (srcp1, srcp2, len)
|
||||||
|
intptr_t srcp1;
|
||||||
|
intptr_t srcp2;
|
||||||
|
size_t len;
|
||||||
|
{
|
||||||
|
op_t a0, a1;
|
||||||
|
op_t b0, b1;
|
||||||
|
|
||||||
|
switch (len % 4)
|
||||||
|
{
|
||||||
|
default: /* Avoid warning about uninitialized local variables. */
|
||||||
|
case 2:
|
||||||
|
a0 = ((op_t *) srcp1)[0];
|
||||||
|
b0 = ((op_t *) srcp2)[0];
|
||||||
|
srcp1 -= 2 * OPSIZ;
|
||||||
|
srcp2 -= 2 * OPSIZ;
|
||||||
|
len += 2;
|
||||||
|
goto do1;
|
||||||
|
case 3:
|
||||||
|
a1 = ((op_t *) srcp1)[0];
|
||||||
|
b1 = ((op_t *) srcp2)[0];
|
||||||
|
srcp1 -= OPSIZ;
|
||||||
|
srcp2 -= OPSIZ;
|
||||||
|
len += 1;
|
||||||
|
goto do2;
|
||||||
|
case 0:
|
||||||
|
if (OP_T_THRES <= 3 * OPSIZ && len == 0)
|
||||||
|
return 0;
|
||||||
|
a0 = ((op_t *) srcp1)[0];
|
||||||
|
b0 = ((op_t *) srcp2)[0];
|
||||||
|
goto do3;
|
||||||
|
case 1:
|
||||||
|
a1 = ((op_t *) srcp1)[0];
|
||||||
|
b1 = ((op_t *) srcp2)[0];
|
||||||
|
srcp1 += OPSIZ;
|
||||||
|
srcp2 += OPSIZ;
|
||||||
|
len -= 1;
|
||||||
|
if (OP_T_THRES <= 3 * OPSIZ && len == 0)
|
||||||
|
goto do0;
|
||||||
|
/* Fall through. */
|
||||||
|
}
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
a0 = ((op_t *) srcp1)[0];
|
||||||
|
b0 = ((op_t *) srcp2)[0];
|
||||||
|
if (a1 != b1)
|
||||||
|
return CMP_LT_OR_GT (a1, b1);
|
||||||
|
|
||||||
|
do3:
|
||||||
|
a1 = ((op_t *) srcp1)[1];
|
||||||
|
b1 = ((op_t *) srcp2)[1];
|
||||||
|
if (a0 != b0)
|
||||||
|
return CMP_LT_OR_GT (a0, b0);
|
||||||
|
|
||||||
|
do2:
|
||||||
|
a0 = ((op_t *) srcp1)[2];
|
||||||
|
b0 = ((op_t *) srcp2)[2];
|
||||||
|
if (a1 != b1)
|
||||||
|
return CMP_LT_OR_GT (a1, b1);
|
||||||
|
|
||||||
|
do1:
|
||||||
|
a1 = ((op_t *) srcp1)[3];
|
||||||
|
b1 = ((op_t *) srcp2)[3];
|
||||||
|
if (a0 != b0)
|
||||||
|
return CMP_LT_OR_GT (a0, b0);
|
||||||
|
|
||||||
|
srcp1 += 4 * OPSIZ;
|
||||||
|
srcp2 += 4 * OPSIZ;
|
||||||
|
len -= 4;
|
||||||
|
}
|
||||||
|
while (len != 0);
|
||||||
|
|
||||||
|
/* This is the right position for do0. Please don't move
|
||||||
|
it into the loop. */
|
||||||
|
do0:
|
||||||
|
if (a1 != b1)
|
||||||
|
return CMP_LT_OR_GT (a1, b1);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int memcmp_not_common_alignment __P((intptr_t, intptr_t, size_t));
|
||||||
|
|
||||||
|
/* memcmp_not_common_alignment -- Compare blocks at SRCP1 and SRCP2 with LEN
|
||||||
|
`op_t' objects (not LEN bytes!). SRCP2 should be aligned for memory
|
||||||
|
operations on `op_t', but SRCP1 *should be unaligned*. */
|
||||||
|
#ifdef __GNUC__
|
||||||
|
__inline
|
||||||
|
#endif
|
||||||
|
static int
|
||||||
|
memcmp_not_common_alignment (srcp1, srcp2, len)
|
||||||
|
intptr_t srcp1;
|
||||||
|
intptr_t srcp2;
|
||||||
|
size_t len;
|
||||||
|
{
|
||||||
|
op_t a0, a1, a2, a3;
|
||||||
|
op_t b0, b1, b2, b3;
|
||||||
|
op_t x;
|
||||||
|
int shl, shr;
|
||||||
|
|
||||||
|
/* Calculate how to shift a word read at the memory operation
|
||||||
|
aligned srcp1 to make it aligned for comparison. */
|
||||||
|
|
||||||
|
shl = 8 * (srcp1 % OPSIZ);
|
||||||
|
shr = 8 * OPSIZ - shl;
|
||||||
|
|
||||||
|
/* Make SRCP1 aligned by rounding it down to the beginning of the `op_t'
|
||||||
|
it points in the middle of. */
|
||||||
|
srcp1 &= -OPSIZ;
|
||||||
|
|
||||||
|
switch (len % 4)
|
||||||
|
{
|
||||||
|
default: /* Avoid warning about uninitialized local variables. */
|
||||||
|
case 2:
|
||||||
|
a1 = ((op_t *) srcp1)[0];
|
||||||
|
a2 = ((op_t *) srcp1)[1];
|
||||||
|
b2 = ((op_t *) srcp2)[0];
|
||||||
|
srcp1 -= 1 * OPSIZ;
|
||||||
|
srcp2 -= 2 * OPSIZ;
|
||||||
|
len += 2;
|
||||||
|
goto do1;
|
||||||
|
case 3:
|
||||||
|
a0 = ((op_t *) srcp1)[0];
|
||||||
|
a1 = ((op_t *) srcp1)[1];
|
||||||
|
b1 = ((op_t *) srcp2)[0];
|
||||||
|
srcp2 -= 1 * OPSIZ;
|
||||||
|
len += 1;
|
||||||
|
goto do2;
|
||||||
|
case 0:
|
||||||
|
if (OP_T_THRES <= 3 * OPSIZ && len == 0)
|
||||||
|
return 0;
|
||||||
|
a3 = ((op_t *) srcp1)[0];
|
||||||
|
a0 = ((op_t *) srcp1)[1];
|
||||||
|
b0 = ((op_t *) srcp2)[0];
|
||||||
|
srcp1 += 1 * OPSIZ;
|
||||||
|
goto do3;
|
||||||
|
case 1:
|
||||||
|
a2 = ((op_t *) srcp1)[0];
|
||||||
|
a3 = ((op_t *) srcp1)[1];
|
||||||
|
b3 = ((op_t *) srcp2)[0];
|
||||||
|
srcp1 += 2 * OPSIZ;
|
||||||
|
srcp2 += 1 * OPSIZ;
|
||||||
|
len -= 1;
|
||||||
|
if (OP_T_THRES <= 3 * OPSIZ && len == 0)
|
||||||
|
goto do0;
|
||||||
|
/* Fall through. */
|
||||||
|
}
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
a0 = ((op_t *) srcp1)[0];
|
||||||
|
b0 = ((op_t *) srcp2)[0];
|
||||||
|
x = MERGE(a2, shl, a3, shr);
|
||||||
|
if (x != b3)
|
||||||
|
return CMP_LT_OR_GT (x, b3);
|
||||||
|
|
||||||
|
do3:
|
||||||
|
a1 = ((op_t *) srcp1)[1];
|
||||||
|
b1 = ((op_t *) srcp2)[1];
|
||||||
|
x = MERGE(a3, shl, a0, shr);
|
||||||
|
if (x != b0)
|
||||||
|
return CMP_LT_OR_GT (x, b0);
|
||||||
|
|
||||||
|
do2:
|
||||||
|
a2 = ((op_t *) srcp1)[2];
|
||||||
|
b2 = ((op_t *) srcp2)[2];
|
||||||
|
x = MERGE(a0, shl, a1, shr);
|
||||||
|
if (x != b1)
|
||||||
|
return CMP_LT_OR_GT (x, b1);
|
||||||
|
|
||||||
|
do1:
|
||||||
|
a3 = ((op_t *) srcp1)[3];
|
||||||
|
b3 = ((op_t *) srcp2)[3];
|
||||||
|
x = MERGE(a1, shl, a2, shr);
|
||||||
|
if (x != b2)
|
||||||
|
return CMP_LT_OR_GT (x, b2);
|
||||||
|
|
||||||
|
srcp1 += 4 * OPSIZ;
|
||||||
|
srcp2 += 4 * OPSIZ;
|
||||||
|
len -= 4;
|
||||||
|
}
|
||||||
|
while (len != 0);
|
||||||
|
|
||||||
|
/* This is the right position for do0. Please don't move
|
||||||
|
it into the loop. */
|
||||||
|
do0:
|
||||||
|
x = MERGE(a2, shl, a3, shr);
|
||||||
|
if (x != b3)
|
||||||
|
return CMP_LT_OR_GT (x, b3);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
rpl_memcmp (s1, s2, len)
|
||||||
|
const __ptr_t s1;
|
||||||
|
const __ptr_t s2;
|
||||||
|
size_t len;
|
||||||
|
{
|
||||||
|
op_t a0;
|
||||||
|
op_t b0;
|
||||||
|
intptr_t srcp1 = (intptr_t) s1;
|
||||||
|
intptr_t srcp2 = (intptr_t) s2;
|
||||||
|
op_t res;
|
||||||
|
|
||||||
|
if (len >= OP_T_THRES)
|
||||||
|
{
|
||||||
|
/* There are at least some bytes to compare. No need to test
|
||||||
|
for LEN == 0 in this alignment loop. */
|
||||||
|
while (srcp2 % OPSIZ != 0)
|
||||||
|
{
|
||||||
|
a0 = ((byte *) srcp1)[0];
|
||||||
|
b0 = ((byte *) srcp2)[0];
|
||||||
|
srcp1 += 1;
|
||||||
|
srcp2 += 1;
|
||||||
|
res = a0 - b0;
|
||||||
|
if (res != 0)
|
||||||
|
return res;
|
||||||
|
len -= 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* SRCP2 is now aligned for memory operations on `op_t'.
|
||||||
|
SRCP1 alignment determines if we can do a simple,
|
||||||
|
aligned compare or need to shuffle bits. */
|
||||||
|
|
||||||
|
if (srcp1 % OPSIZ == 0)
|
||||||
|
res = memcmp_common_alignment (srcp1, srcp2, len / OPSIZ);
|
||||||
|
else
|
||||||
|
res = memcmp_not_common_alignment (srcp1, srcp2, len / OPSIZ);
|
||||||
|
if (res != 0)
|
||||||
|
return res;
|
||||||
|
|
||||||
|
/* Number of bytes remaining in the interval [0..OPSIZ-1]. */
|
||||||
|
srcp1 += len & -OPSIZ;
|
||||||
|
srcp2 += len & -OPSIZ;
|
||||||
|
len %= OPSIZ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* There are just a few bytes to compare. Use byte memory operations. */
|
||||||
|
while (len != 0)
|
||||||
|
{
|
||||||
|
a0 = ((byte *) srcp1)[0];
|
||||||
|
b0 = ((byte *) srcp2)[0];
|
||||||
|
srcp1 += 1;
|
||||||
|
srcp2 += 1;
|
||||||
|
res = a0 - b0;
|
||||||
|
if (res != 0)
|
||||||
|
return res;
|
||||||
|
len -= 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef weak_alias
|
||||||
|
# undef bcmp
|
||||||
|
weak_alias (memcmp, bcmp)
|
||||||
|
#endif
|
||||||
|
|
@ -36,20 +36,17 @@
|
||||||
* 0 is returned if either there's no pidfile, it's empty
|
* 0 is returned if either there's no pidfile, it's empty
|
||||||
* or no pid can be read.
|
* or no pid can be read.
|
||||||
*/
|
*/
|
||||||
pid_t read_pid(const char *pidfile) {
|
pid_t read_pid (const char *pidfile)
|
||||||
|
{
|
||||||
FILE *f;
|
FILE *f;
|
||||||
long pid;
|
long pid;
|
||||||
|
|
||||||
if(!(f = fopen(pidfile, "r"))) {
|
if (!(f=fopen(pidfile,"r")))
|
||||||
return 0;
|
return 0;
|
||||||
}
|
if(fscanf(f,"%20ld", &pid) != 1)
|
||||||
|
|
||||||
if(fscanf(f, "%20ld", &pid) != 1) {
|
|
||||||
pid = 0;
|
pid = 0;
|
||||||
}
|
|
||||||
|
|
||||||
fclose(f);
|
fclose(f);
|
||||||
return (pid_t)pid;
|
return pid;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check_pid
|
/* check_pid
|
||||||
|
|
@ -58,13 +55,13 @@ pid_t read_pid(const char *pidfile) {
|
||||||
* table (using /proc) to determine if the process already exists. If
|
* table (using /proc) to determine if the process already exists. If
|
||||||
* so the pid is returned, otherwise 0.
|
* so the pid is returned, otherwise 0.
|
||||||
*/
|
*/
|
||||||
pid_t check_pid(const char *pidfile) {
|
pid_t check_pid (const char *pidfile)
|
||||||
|
{
|
||||||
pid_t pid = read_pid(pidfile);
|
pid_t pid = read_pid(pidfile);
|
||||||
|
|
||||||
/* Amazing ! _I_ am already holding the pid file... */
|
/* Amazing ! _I_ am already holding the pid file... */
|
||||||
if((!pid) || (pid == getpid())) {
|
if ((!pid) || (pid == getpid ()))
|
||||||
return 0;
|
return 0;
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The 'standard' method of doing this is to try and do a 'fake' kill
|
* The 'standard' method of doing this is to try and do a 'fake' kill
|
||||||
|
|
@ -73,10 +70,8 @@ pid_t check_pid(const char *pidfile) {
|
||||||
*/
|
*/
|
||||||
/* But... errno is usually changed only on error.. */
|
/* But... errno is usually changed only on error.. */
|
||||||
errno = 0;
|
errno = 0;
|
||||||
|
if (kill(pid, 0) && errno == ESRCH)
|
||||||
if(kill(pid, 0) && errno == ESRCH) {
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
|
||||||
|
|
||||||
return pid;
|
return pid;
|
||||||
}
|
}
|
||||||
|
|
@ -86,45 +81,40 @@ pid_t check_pid(const char *pidfile) {
|
||||||
* Writes the pid to the specified file. If that fails 0 is
|
* Writes the pid to the specified file. If that fails 0 is
|
||||||
* returned, otherwise the pid.
|
* returned, otherwise the pid.
|
||||||
*/
|
*/
|
||||||
pid_t write_pid(const char *pidfile) {
|
pid_t write_pid (const char *pidfile)
|
||||||
|
{
|
||||||
FILE *f;
|
FILE *f;
|
||||||
int fd;
|
int fd;
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
|
|
||||||
if((fd = open(pidfile, O_RDWR | O_CREAT, 0644)) == -1) {
|
if ((fd = open(pidfile, O_RDWR|O_CREAT, 0644)) == -1) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((f = fdopen(fd, "r+")) == NULL) {
|
if ((f = fdopen(fd, "r+")) == NULL) {
|
||||||
close(fd);
|
close(fd);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_FLOCK
|
#ifdef HAVE_FLOCK
|
||||||
|
if (flock(fd, LOCK_EX|LOCK_NB) == -1) {
|
||||||
if(flock(fd, LOCK_EX | LOCK_NB) == -1) {
|
|
||||||
fclose(f);
|
fclose(f);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
pid = getpid();
|
pid = getpid();
|
||||||
|
if (!fprintf(f,"%ld\n", (long)pid)) {
|
||||||
if(!fprintf(f, "%ld\n", (long)pid)) {
|
|
||||||
fclose(f);
|
fclose(f);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
fflush(f);
|
fflush(f);
|
||||||
|
|
||||||
#ifdef HAVE_FLOCK
|
#ifdef HAVE_FLOCK
|
||||||
|
if (flock(fd, LOCK_UN) == -1) {
|
||||||
if(flock(fd, LOCK_UN) == -1) {
|
|
||||||
fclose(f);
|
fclose(f);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
|
||||||
|
|
@ -136,7 +126,8 @@ pid_t write_pid(const char *pidfile) {
|
||||||
* Remove the the specified file. The result from unlink(2)
|
* Remove the the specified file. The result from unlink(2)
|
||||||
* is returned
|
* is returned
|
||||||
*/
|
*/
|
||||||
int remove_pid(const char *pidfile) {
|
int remove_pid (const char *pidfile)
|
||||||
return unlink(pidfile);
|
{
|
||||||
|
return unlink (pidfile);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -1,6 +1,3 @@
|
||||||
#ifndef TINC_PIDFILE_H
|
|
||||||
#define TINC_PIDFILE_H
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
pidfile.h - interact with pidfiles
|
pidfile.h - interact with pidfiles
|
||||||
Copyright (c) 1995 Martin Schulze <Martin.Schulze@Linux.DE>
|
Copyright (c) 1995 Martin Schulze <Martin.Schulze@Linux.DE>
|
||||||
|
|
@ -29,7 +26,7 @@
|
||||||
* 0 is returned if either there's no pidfile, it's empty
|
* 0 is returned if either there's no pidfile, it's empty
|
||||||
* or no pid can be read.
|
* or no pid can be read.
|
||||||
*/
|
*/
|
||||||
extern pid_t read_pid(const char *pidfile);
|
extern pid_t read_pid (const char *pidfile);
|
||||||
|
|
||||||
/* check_pid
|
/* check_pid
|
||||||
*
|
*
|
||||||
|
|
@ -37,21 +34,19 @@ extern pid_t read_pid(const char *pidfile);
|
||||||
* table (using /proc) to determine if the process already exists. If
|
* table (using /proc) to determine if the process already exists. If
|
||||||
* so 1 is returned, otherwise 0.
|
* so 1 is returned, otherwise 0.
|
||||||
*/
|
*/
|
||||||
extern pid_t check_pid(const char *pidfile);
|
extern pid_t check_pid (const char *pidfile);
|
||||||
|
|
||||||
/* write_pid
|
/* write_pid
|
||||||
*
|
*
|
||||||
* Writes the pid to the specified file. If that fails 0 is
|
* Writes the pid to the specified file. If that fails 0 is
|
||||||
* returned, otherwise the pid.
|
* returned, otherwise the pid.
|
||||||
*/
|
*/
|
||||||
extern pid_t write_pid(const char *pidfile);
|
extern pid_t write_pid (const char *pidfile);
|
||||||
|
|
||||||
/* remove_pid
|
/* remove_pid
|
||||||
*
|
*
|
||||||
* Remove the the specified file. The result from unlink(2)
|
* Remove the the specified file. The result from unlink(2)
|
||||||
* is returned
|
* is returned
|
||||||
*/
|
*/
|
||||||
extern int remove_pid(const char *pidfile);
|
extern int remove_pid (const char *pidfile);
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
44
lib/realloc.c
Normal file
44
lib/realloc.c
Normal file
|
|
@ -0,0 +1,44 @@
|
||||||
|
/* Work around bug on some systems where realloc (NULL, 0) fails.
|
||||||
|
Copyright (C) 1997 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
|
||||||
|
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, write to the Free Software Foundation, Inc., Foundation,
|
||||||
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
|
||||||
|
|
||||||
|
/* written by Jim Meyering */
|
||||||
|
|
||||||
|
#if HAVE_CONFIG_H
|
||||||
|
# include <config.h>
|
||||||
|
#endif
|
||||||
|
#undef realloc
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
char *malloc ();
|
||||||
|
char *realloc ();
|
||||||
|
|
||||||
|
/* Change the size of an allocated block of memory P to N bytes,
|
||||||
|
with error checking. If N is zero, change it to 1. If P is NULL,
|
||||||
|
use malloc. */
|
||||||
|
|
||||||
|
char *
|
||||||
|
rpl_realloc (p, n)
|
||||||
|
char *p;
|
||||||
|
size_t n;
|
||||||
|
{
|
||||||
|
if (n == 0)
|
||||||
|
n = 1;
|
||||||
|
if (p == 0)
|
||||||
|
return malloc (n);
|
||||||
|
return realloc (p, n);
|
||||||
|
}
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
utils.c -- gathering of some stupid small functions
|
utils.c -- gathering of some stupid small functions
|
||||||
Copyright (C) 1999-2005 Ivo Timmermans
|
Copyright (C) 1999-2005 Ivo Timmermans
|
||||||
2000-2014 Guus Sliepen <guus@tinc-vpn.org>
|
2000-2009 Guus Sliepen <guus@tinc-vpn.org>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|
@ -26,28 +26,21 @@
|
||||||
static const char hexadecimals[] = "0123456789ABCDEF";
|
static const char hexadecimals[] = "0123456789ABCDEF";
|
||||||
|
|
||||||
static int charhex2bin(char c) {
|
static int charhex2bin(char c) {
|
||||||
if(isdigit(c)) {
|
if(isdigit(c))
|
||||||
return c - '0';
|
return c - '0';
|
||||||
} else {
|
else
|
||||||
return toupper(c) - 'A' + 10;
|
return toupper(c) - 'A' + 10;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool hex2bin(char *src, char *dst, int length) {
|
|
||||||
for(int i = 0; i < length; i++) {
|
|
||||||
if(!isxdigit(src[i * 2]) || !isxdigit(src[i * 2 + 1])) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
void hex2bin(char *src, char *dst, int length) {
|
||||||
|
int i;
|
||||||
|
for(i = 0; i < length; i++)
|
||||||
dst[i] = charhex2bin(src[i * 2]) * 16 + charhex2bin(src[i * 2 + 1]);
|
dst[i] = charhex2bin(src[i * 2]) * 16 + charhex2bin(src[i * 2 + 1]);
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void bin2hex(char *src, char *dst, int length) {
|
void bin2hex(char *src, char *dst, int length) {
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for(i = length - 1; i >= 0; i--) {
|
for(i = length - 1; i >= 0; i--) {
|
||||||
dst[i * 2 + 1] = hexadecimals[(unsigned char) src[i] & 15];
|
dst[i * 2 + 1] = hexadecimals[(unsigned char) src[i] & 15];
|
||||||
dst[i * 2] = hexadecimals[(unsigned char) src[i] >> 4];
|
dst[i * 2] = hexadecimals[(unsigned char) src[i] >> 4];
|
||||||
|
|
@ -64,14 +57,13 @@ const char *winerror(int err) {
|
||||||
|
|
||||||
ptr = buf + sprintf(buf, "(%d) ", err);
|
ptr = buf + sprintf(buf, "(%d) ", err);
|
||||||
|
|
||||||
if(!FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
|
if (!FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
|
||||||
NULL, err, MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), ptr, sizeof(buf) - (ptr - buf), NULL)) {
|
NULL, err, MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), ptr, sizeof(buf) - (ptr - buf), NULL)) {
|
||||||
strcpy(ptr, "(unable to format errormessage)");
|
strcpy(ptr, "(unable to format errormessage)");
|
||||||
};
|
};
|
||||||
|
|
||||||
if((ptr = strchr(buf, '\r'))) {
|
if((ptr = strchr(buf, '\r')))
|
||||||
*ptr = '\0';
|
*ptr = '\0';
|
||||||
}
|
|
||||||
|
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
@ -79,27 +71,8 @@ const char *winerror(int err) {
|
||||||
|
|
||||||
unsigned int bitfield_to_int(const void *bitfield, size_t size) {
|
unsigned int bitfield_to_int(const void *bitfield, size_t size) {
|
||||||
unsigned int value = 0;
|
unsigned int value = 0;
|
||||||
|
if(size > sizeof value)
|
||||||
if(size > sizeof(value)) {
|
size = sizeof value;
|
||||||
size = sizeof(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
memcpy(&value, bitfield, size);
|
memcpy(&value, bitfield, size);
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* As memcmp(), but constant-time.
|
|
||||||
* Returns 0 when data is equal, non-zero otherwise.
|
|
||||||
*/
|
|
||||||
int memcmp_constant_time(const void *a, const void *b, size_t size) {
|
|
||||||
const uint8_t *a1 = a, *b1 = b;
|
|
||||||
int ret = 0;
|
|
||||||
size_t i;
|
|
||||||
|
|
||||||
for(i = 0; i < size; i++) {
|
|
||||||
ret |= *a1++ ^ *b1++;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
@ -1,10 +1,7 @@
|
||||||
#ifndef TINC_UTILS_H
|
|
||||||
#define TINC_UTILS_H
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
utils.h -- header file for utils.c
|
utils.h -- header file for utils.c
|
||||||
Copyright (C) 1999-2005 Ivo Timmermans
|
Copyright (C) 1999-2005 Ivo Timmermans
|
||||||
2000-2014 Guus Sliepen <guus@tinc-vpn.org>
|
2000-2009 Guus Sliepen <guus@tinc-vpn.org>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|
@ -21,14 +18,14 @@
|
||||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
extern bool hex2bin(char *src, char *dst, int length);
|
#ifndef __TINC_UTILS_H__
|
||||||
|
#define __TINC_UTILS_H__
|
||||||
|
|
||||||
|
extern void hex2bin(char *src, char *dst, int length);
|
||||||
extern void bin2hex(char *src, char *dst, int length);
|
extern void bin2hex(char *src, char *dst, int length);
|
||||||
|
|
||||||
#if defined(HAVE_MINGW) || defined(HAVE_CYGWIN)
|
|
||||||
extern const char *winerror(int);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_MINGW
|
#ifdef HAVE_MINGW
|
||||||
|
extern const char *winerror(int);
|
||||||
#define strerror(x) ((x)>0?strerror(x):winerror(GetLastError()))
|
#define strerror(x) ((x)>0?strerror(x):winerror(GetLastError()))
|
||||||
#define sockerrno WSAGetLastError()
|
#define sockerrno WSAGetLastError()
|
||||||
#define sockstrerror(x) winerror(x)
|
#define sockstrerror(x) winerror(x)
|
||||||
|
|
@ -45,6 +42,4 @@ extern const char *winerror(int);
|
||||||
|
|
||||||
extern unsigned int bitfield_to_int(const void *bitfield, size_t size);
|
extern unsigned int bitfield_to_int(const void *bitfield, size_t size);
|
||||||
|
|
||||||
int memcmp_constant_time(const void *a, const void *b, size_t size);
|
#endif /* __TINC_UTILS_H__ */
|
||||||
|
|
||||||
#endif
|
|
||||||
29
lib/xalloc.h
Normal file
29
lib/xalloc.h
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
#ifndef PARAMS
|
||||||
|
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
|
||||||
|
# define PARAMS(Args) Args
|
||||||
|
# else
|
||||||
|
# define PARAMS(Args) ()
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Exit value when the requested amount of memory is not available.
|
||||||
|
The caller may set it to some other value. */
|
||||||
|
extern int xalloc_exit_failure;
|
||||||
|
|
||||||
|
/* FIXME: describe */
|
||||||
|
extern char *const xalloc_msg_memory_exhausted;
|
||||||
|
|
||||||
|
/* FIXME: describe */
|
||||||
|
extern void (*xalloc_fail_func) (int);
|
||||||
|
|
||||||
|
void *xmalloc PARAMS ((size_t n)) __attribute__ ((__malloc__));
|
||||||
|
void *xmalloc_and_zero PARAMS ((size_t n)) __attribute__ ((__malloc__));
|
||||||
|
void *xcalloc PARAMS ((size_t n, size_t s));
|
||||||
|
void *xrealloc PARAMS ((void *p, size_t n)) __attribute__ ((__malloc__));
|
||||||
|
|
||||||
|
char *xstrdup PARAMS ((const char *s)) __attribute__ ((__malloc__));
|
||||||
|
|
||||||
|
extern int xasprintf(char **strp, const char *fmt, ...);
|
||||||
|
extern int xvasprintf(char **strp, const char *fmt, va_list ap);
|
||||||
156
lib/xmalloc.c
Normal file
156
lib/xmalloc.c
Normal file
|
|
@ -0,0 +1,156 @@
|
||||||
|
/* xmalloc.c -- malloc with out of memory checking
|
||||||
|
Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97 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
|
||||||
|
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, write to the Free Software Foundation, Inc., Foundation,
|
||||||
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
|
||||||
|
|
||||||
|
#if HAVE_CONFIG_H
|
||||||
|
# include <config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdarg.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
|
#if STDC_HEADERS
|
||||||
|
# include <stdlib.h>
|
||||||
|
#else
|
||||||
|
void *calloc ();
|
||||||
|
void *malloc ();
|
||||||
|
void *realloc ();
|
||||||
|
void free ();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "dropin.h"
|
||||||
|
#include "xalloc.h"
|
||||||
|
|
||||||
|
#ifndef EXIT_FAILURE
|
||||||
|
# define EXIT_FAILURE 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Prototypes for functions defined here. */
|
||||||
|
#if defined (__STDC__) && __STDC__
|
||||||
|
void *xmalloc (size_t n);
|
||||||
|
void *xcalloc (size_t n, size_t s);
|
||||||
|
void *xrealloc (void *p, size_t n);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Exit value when the requested amount of memory is not available.
|
||||||
|
The caller may set it to some other value. */
|
||||||
|
int xalloc_exit_failure = EXIT_FAILURE;
|
||||||
|
|
||||||
|
/* FIXME: describe */
|
||||||
|
char *const xalloc_msg_memory_exhausted = "Memory exhausted";
|
||||||
|
|
||||||
|
/* FIXME: describe */
|
||||||
|
void (*xalloc_fail_func) (int) = NULL;
|
||||||
|
|
||||||
|
static void
|
||||||
|
xalloc_fail (int size)
|
||||||
|
{
|
||||||
|
if (xalloc_fail_func)
|
||||||
|
(*xalloc_fail_func) (size);
|
||||||
|
fprintf(stderr, "%s\n", xalloc_msg_memory_exhausted);
|
||||||
|
exit(xalloc_exit_failure);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Allocate N bytes of memory dynamically, with error checking. */
|
||||||
|
|
||||||
|
void *
|
||||||
|
xmalloc (size_t n)
|
||||||
|
{
|
||||||
|
void *p;
|
||||||
|
|
||||||
|
p = malloc (n);
|
||||||
|
if (p == NULL)
|
||||||
|
xalloc_fail ((int)n);
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Allocate N bytes of memory dynamically, and set it all to zero. */
|
||||||
|
|
||||||
|
void *
|
||||||
|
xmalloc_and_zero (size_t n)
|
||||||
|
{
|
||||||
|
void *p;
|
||||||
|
|
||||||
|
p = malloc (n);
|
||||||
|
if (p == NULL)
|
||||||
|
xalloc_fail ((int)n);
|
||||||
|
memset (p, '\0', n);
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Change the size of an allocated block of memory P to N bytes,
|
||||||
|
with error checking.
|
||||||
|
If P is NULL, run xmalloc. */
|
||||||
|
|
||||||
|
void *
|
||||||
|
xrealloc (void *p, size_t n)
|
||||||
|
{
|
||||||
|
p = realloc (p, n);
|
||||||
|
if (p == NULL)
|
||||||
|
xalloc_fail (n);
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Duplicate a string */
|
||||||
|
|
||||||
|
char *xstrdup(const char *s)
|
||||||
|
{
|
||||||
|
char *p;
|
||||||
|
|
||||||
|
p = strdup(s);
|
||||||
|
if(!p)
|
||||||
|
xalloc_fail ((int)strlen(s));
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef NOT_USED
|
||||||
|
|
||||||
|
/* Allocate memory for N elements of S bytes, with error checking. */
|
||||||
|
|
||||||
|
void *
|
||||||
|
xcalloc (n, s)
|
||||||
|
size_t n, s;
|
||||||
|
{
|
||||||
|
void *p;
|
||||||
|
|
||||||
|
p = calloc (n, s);
|
||||||
|
if (p == NULL)
|
||||||
|
xalloc_fail ();
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* NOT_USED */
|
||||||
|
|
||||||
|
int xasprintf(char **strp, const char *fmt, ...) {
|
||||||
|
int result;
|
||||||
|
va_list ap;
|
||||||
|
va_start(ap, fmt);
|
||||||
|
result = xvasprintf(strp, fmt, ap);
|
||||||
|
va_end(ap);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
int xvasprintf(char **strp, const char *fmt, va_list ap) {
|
||||||
|
int result = vasprintf(strp, fmt, ap);
|
||||||
|
if(result < 0) {
|
||||||
|
fprintf(stderr, "vasprintf() failed: %s\n", strerror(errno));
|
||||||
|
exit(xalloc_exit_failure);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
4
m4/Makefile.am
Normal file
4
m4/Makefile.am
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||||
|
|
||||||
|
EXTRA_DIST = README *.m4
|
||||||
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
# Makefile.in generated by automake 1.16.2 from Makefile.am.
|
# Makefile.in generated by automake 1.11.5 from Makefile.am.
|
||||||
# @configure_input@
|
# @configure_input@
|
||||||
|
|
||||||
# Copyright (C) 1994-2020 Free Software Foundation, Inc.
|
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||||
|
# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
|
||||||
|
# Foundation, Inc.
|
||||||
# This Makefile.in is free software; the Free Software Foundation
|
# This Makefile.in is free software; the Free Software Foundation
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
# with or without modifications, as long as this notice is preserved.
|
# with or without modifications, as long as this notice is preserved.
|
||||||
|
|
@ -13,63 +14,24 @@
|
||||||
# PARTICULAR PURPOSE.
|
# PARTICULAR PURPOSE.
|
||||||
|
|
||||||
@SET_MAKE@
|
@SET_MAKE@
|
||||||
|
|
||||||
VPATH = @srcdir@
|
VPATH = @srcdir@
|
||||||
am__is_gnu_make = { \
|
am__make_dryrun = \
|
||||||
if test -z '$(MAKELEVEL)'; then \
|
{ \
|
||||||
false; \
|
am__dry=no; \
|
||||||
elif test -n '$(MAKE_HOST)'; then \
|
|
||||||
true; \
|
|
||||||
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
|
|
||||||
true; \
|
|
||||||
else \
|
|
||||||
false; \
|
|
||||||
fi; \
|
|
||||||
}
|
|
||||||
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 \
|
case $$MAKEFLAGS in \
|
||||||
*\\[\ \ ]*) \
|
*\\[\ \ ]*) \
|
||||||
bs=\\; \
|
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
|
||||||
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
|
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
|
||||||
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
|
*) \
|
||||||
|
for am__flg in $$MAKEFLAGS; do \
|
||||||
|
case $$am__flg in \
|
||||||
|
*=*|--*) ;; \
|
||||||
|
*n*) am__dry=yes; break;; \
|
||||||
esac; \
|
esac; \
|
||||||
fi; \
|
done;; \
|
||||||
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; \
|
esac; \
|
||||||
case $$flg in \
|
test $$am__dry = yes; \
|
||||||
*$$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@
|
pkgdatadir = $(datadir)/@PACKAGE@
|
||||||
pkgincludedir = $(includedir)/@PACKAGE@
|
pkgincludedir = $(includedir)/@PACKAGE@
|
||||||
pkglibdir = $(libdir)/@PACKAGE@
|
pkglibdir = $(libdir)/@PACKAGE@
|
||||||
|
|
@ -88,35 +50,18 @@ PRE_UNINSTALL = :
|
||||||
POST_UNINSTALL = :
|
POST_UNINSTALL = :
|
||||||
build_triplet = @build@
|
build_triplet = @build@
|
||||||
host_triplet = @host@
|
host_triplet = @host@
|
||||||
subdir = systemd
|
subdir = m4
|
||||||
|
DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
|
||||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||||
am__aclocal_m4_deps = $(top_srcdir)/m4/attribute.m4 \
|
am__aclocal_m4_deps = $(top_srcdir)/m4/attribute.m4 \
|
||||||
$(top_srcdir)/m4/ax_append_flag.m4 \
|
$(top_srcdir)/m4/lzo.m4 $(top_srcdir)/m4/openssl.m4 \
|
||||||
$(top_srcdir)/m4/ax_cflags_warn_all.m4 \
|
$(top_srcdir)/m4/zlib.m4 $(top_srcdir)/configure.in
|
||||||
$(top_srcdir)/m4/ax_check_compile_flag.m4 \
|
|
||||||
$(top_srcdir)/m4/ax_check_link_flag.m4 \
|
|
||||||
$(top_srcdir)/m4/ax_require_defined.m4 $(top_srcdir)/m4/lzo.m4 \
|
|
||||||
$(top_srcdir)/m4/openssl.m4 $(top_srcdir)/m4/zlib.m4 \
|
|
||||||
$(top_srcdir)/configure.ac
|
|
||||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||||
$(ACLOCAL_M4)
|
$(ACLOCAL_M4)
|
||||||
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
|
|
||||||
mkinstalldirs = $(install_sh) -d
|
mkinstalldirs = $(install_sh) -d
|
||||||
CONFIG_HEADER = $(top_builddir)/config.h
|
CONFIG_HEADER = $(top_builddir)/config.h
|
||||||
CONFIG_CLEAN_FILES =
|
CONFIG_CLEAN_FILES =
|
||||||
CONFIG_CLEAN_VPATH_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 =
|
SOURCES =
|
||||||
DIST_SOURCES =
|
DIST_SOURCES =
|
||||||
am__can_run_installinfo = \
|
am__can_run_installinfo = \
|
||||||
|
|
@ -124,41 +69,10 @@ am__can_run_installinfo = \
|
||||||
n|no|NO) false;; \
|
n|no|NO) false;; \
|
||||||
*) (install-info --version) >/dev/null 2>&1;; \
|
*) (install-info --version) >/dev/null 2>&1;; \
|
||||||
esac
|
esac
|
||||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
|
||||||
am__vpath_adj = case $$p in \
|
|
||||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
|
||||||
*) f=$$p;; \
|
|
||||||
esac;
|
|
||||||
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
|
|
||||||
am__install_max = 40
|
|
||||||
am__nobase_strip_setup = \
|
|
||||||
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
|
|
||||||
am__nobase_strip = \
|
|
||||||
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
|
|
||||||
am__nobase_list = $(am__nobase_strip_setup); \
|
|
||||||
for p in $$list; do echo "$$p $$p"; done | \
|
|
||||||
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
|
|
||||||
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
|
|
||||||
if (++n[$$2] == $(am__install_max)) \
|
|
||||||
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
|
|
||||||
END { for (dir in files) print dir, files[dir] }'
|
|
||||||
am__base_list = \
|
|
||||||
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
|
|
||||||
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
|
|
||||||
am__uninstall_files_from_dir = { \
|
|
||||||
test -z "$$files" \
|
|
||||||
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|
|
||||||
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
|
|
||||||
$(am__cd) "$$dir" && rm -f $$files; }; \
|
|
||||||
}
|
|
||||||
am__installdirs = "$(DESTDIR)$(systemddir)"
|
|
||||||
DATA = $(nodist_systemd_DATA)
|
|
||||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
|
|
||||||
am__DIST_COMMON = $(srcdir)/Makefile.in
|
|
||||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||||
ACLOCAL = @ACLOCAL@
|
ACLOCAL = @ACLOCAL@
|
||||||
|
ALLOCA = @ALLOCA@
|
||||||
AMTAR = @AMTAR@
|
AMTAR = @AMTAR@
|
||||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
|
||||||
AUTOCONF = @AUTOCONF@
|
AUTOCONF = @AUTOCONF@
|
||||||
AUTOHEADER = @AUTOHEADER@
|
AUTOHEADER = @AUTOHEADER@
|
||||||
AUTOMAKE = @AUTOMAKE@
|
AUTOMAKE = @AUTOMAKE@
|
||||||
|
|
@ -177,6 +91,7 @@ ECHO_T = @ECHO_T@
|
||||||
EGREP = @EGREP@
|
EGREP = @EGREP@
|
||||||
EXEEXT = @EXEEXT@
|
EXEEXT = @EXEEXT@
|
||||||
GREP = @GREP@
|
GREP = @GREP@
|
||||||
|
INCLUDES = @INCLUDES@
|
||||||
INSTALL = @INSTALL@
|
INSTALL = @INSTALL@
|
||||||
INSTALL_DATA = @INSTALL_DATA@
|
INSTALL_DATA = @INSTALL_DATA@
|
||||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||||
|
|
@ -185,7 +100,9 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||||
LDFLAGS = @LDFLAGS@
|
LDFLAGS = @LDFLAGS@
|
||||||
LIBOBJS = @LIBOBJS@
|
LIBOBJS = @LIBOBJS@
|
||||||
LIBS = @LIBS@
|
LIBS = @LIBS@
|
||||||
|
LN_S = @LN_S@
|
||||||
LTLIBOBJS = @LTLIBOBJS@
|
LTLIBOBJS = @LTLIBOBJS@
|
||||||
|
MAINT = @MAINT@
|
||||||
MAKEINFO = @MAKEINFO@
|
MAKEINFO = @MAKEINFO@
|
||||||
MKDIR_P = @MKDIR_P@
|
MKDIR_P = @MKDIR_P@
|
||||||
OBJEXT = @OBJEXT@
|
OBJEXT = @OBJEXT@
|
||||||
|
|
@ -197,6 +114,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||||
PACKAGE_URL = @PACKAGE_URL@
|
PACKAGE_URL = @PACKAGE_URL@
|
||||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||||
|
RANLIB = @RANLIB@
|
||||||
SET_MAKE = @SET_MAKE@
|
SET_MAKE = @SET_MAKE@
|
||||||
SHELL = @SHELL@
|
SHELL = @SHELL@
|
||||||
STRIP = @STRIP@
|
STRIP = @STRIP@
|
||||||
|
|
@ -243,28 +161,19 @@ pdfdir = @pdfdir@
|
||||||
prefix = @prefix@
|
prefix = @prefix@
|
||||||
program_transform_name = @program_transform_name@
|
program_transform_name = @program_transform_name@
|
||||||
psdir = @psdir@
|
psdir = @psdir@
|
||||||
runstatedir = @runstatedir@
|
|
||||||
sbindir = @sbindir@
|
sbindir = @sbindir@
|
||||||
sharedstatedir = @sharedstatedir@
|
sharedstatedir = @sharedstatedir@
|
||||||
srcdir = @srcdir@
|
srcdir = @srcdir@
|
||||||
sysconfdir = @sysconfdir@
|
sysconfdir = @sysconfdir@
|
||||||
systemd_path = @systemd_path@
|
|
||||||
target_alias = @target_alias@
|
target_alias = @target_alias@
|
||||||
top_build_prefix = @top_build_prefix@
|
top_build_prefix = @top_build_prefix@
|
||||||
top_builddir = @top_builddir@
|
top_builddir = @top_builddir@
|
||||||
top_srcdir = @top_srcdir@
|
top_srcdir = @top_srcdir@
|
||||||
EXTRA_DIST = tinc.service.in tinc@.service.in
|
EXTRA_DIST = README *.m4
|
||||||
CLEANFILES = tinc.service tinc@.service
|
|
||||||
@WITH_SYSTEMD_TRUE@systemddir = @systemd_path@
|
|
||||||
@WITH_SYSTEMD_TRUE@nodist_systemd_DATA = tinc.service tinc@.service
|
|
||||||
substitute = sed \
|
|
||||||
-e s,'@sbindir\@',"$(sbindir)",g \
|
|
||||||
-e s,'@sysconfdir\@',"$(sysconfdir)",g
|
|
||||||
|
|
||||||
all: all-am
|
all: all-am
|
||||||
|
|
||||||
.SUFFIXES:
|
.SUFFIXES:
|
||||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
|
||||||
@for dep in $?; do \
|
@for dep in $?; do \
|
||||||
case '$(am__configure_deps)' in \
|
case '$(am__configure_deps)' in \
|
||||||
*$$dep*) \
|
*$$dep*) \
|
||||||
|
|
@ -273,58 +182,35 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||||
exit 1;; \
|
exit 1;; \
|
||||||
esac; \
|
esac; \
|
||||||
done; \
|
done; \
|
||||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu systemd/Makefile'; \
|
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu m4/Makefile'; \
|
||||||
$(am__cd) $(top_srcdir) && \
|
$(am__cd) $(top_srcdir) && \
|
||||||
$(AUTOMAKE) --gnu systemd/Makefile
|
$(AUTOMAKE) --gnu m4/Makefile
|
||||||
|
.PRECIOUS: Makefile
|
||||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||||
@case '$?' in \
|
@case '$?' in \
|
||||||
*config.status*) \
|
*config.status*) \
|
||||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||||
*) \
|
*) \
|
||||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
|
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
|
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||||
esac;
|
esac;
|
||||||
|
|
||||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||||
|
|
||||||
$(top_srcdir)/configure: $(am__configure_deps)
|
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||||
$(am__aclocal_m4_deps):
|
$(am__aclocal_m4_deps):
|
||||||
install-nodist_systemdDATA: $(nodist_systemd_DATA)
|
tags: TAGS
|
||||||
@$(NORMAL_INSTALL)
|
TAGS:
|
||||||
@list='$(nodist_systemd_DATA)'; test -n "$(systemddir)" || list=; \
|
|
||||||
if test -n "$$list"; then \
|
|
||||||
echo " $(MKDIR_P) '$(DESTDIR)$(systemddir)'"; \
|
|
||||||
$(MKDIR_P) "$(DESTDIR)$(systemddir)" || exit 1; \
|
|
||||||
fi; \
|
|
||||||
for p in $$list; do \
|
|
||||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
|
||||||
echo "$$d$$p"; \
|
|
||||||
done | $(am__base_list) | \
|
|
||||||
while read files; do \
|
|
||||||
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(systemddir)'"; \
|
|
||||||
$(INSTALL_DATA) $$files "$(DESTDIR)$(systemddir)" || exit $$?; \
|
|
||||||
done
|
|
||||||
|
|
||||||
uninstall-nodist_systemdDATA:
|
ctags: CTAGS
|
||||||
@$(NORMAL_UNINSTALL)
|
CTAGS:
|
||||||
@list='$(nodist_systemd_DATA)'; test -n "$(systemddir)" || list=; \
|
|
||||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
|
||||||
dir='$(DESTDIR)$(systemddir)'; $(am__uninstall_files_from_dir)
|
|
||||||
tags TAGS:
|
|
||||||
|
|
||||||
ctags CTAGS:
|
|
||||||
|
|
||||||
cscope cscopelist:
|
|
||||||
|
|
||||||
|
|
||||||
distdir: $(BUILT_SOURCES)
|
distdir: $(DISTFILES)
|
||||||
$(MAKE) $(AM_MAKEFLAGS) distdir-am
|
|
||||||
|
|
||||||
distdir-am: $(DISTFILES)
|
|
||||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||||
list='$(DISTFILES)'; \
|
list='$(DISTFILES)'; \
|
||||||
|
|
@ -356,11 +242,8 @@ distdir-am: $(DISTFILES)
|
||||||
done
|
done
|
||||||
check-am: all-am
|
check-am: all-am
|
||||||
check: check-am
|
check: check-am
|
||||||
all-am: Makefile $(DATA)
|
all-am: Makefile
|
||||||
installdirs:
|
installdirs:
|
||||||
for dir in "$(DESTDIR)$(systemddir)"; do \
|
|
||||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
|
||||||
done
|
|
||||||
install: install-am
|
install: install-am
|
||||||
install-exec: install-exec-am
|
install-exec: install-exec-am
|
||||||
install-data: install-data-am
|
install-data: install-data-am
|
||||||
|
|
@ -383,7 +266,6 @@ install-strip:
|
||||||
mostlyclean-generic:
|
mostlyclean-generic:
|
||||||
|
|
||||||
clean-generic:
|
clean-generic:
|
||||||
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
|
||||||
|
|
||||||
distclean-generic:
|
distclean-generic:
|
||||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||||
|
|
@ -412,7 +294,7 @@ info: info-am
|
||||||
|
|
||||||
info-am:
|
info-am:
|
||||||
|
|
||||||
install-data-am: install-nodist_systemdDATA
|
install-data-am:
|
||||||
|
|
||||||
install-dvi: install-dvi-am
|
install-dvi: install-dvi-am
|
||||||
|
|
||||||
|
|
@ -456,30 +338,20 @@ ps: ps-am
|
||||||
|
|
||||||
ps-am:
|
ps-am:
|
||||||
|
|
||||||
uninstall-am: uninstall-nodist_systemdDATA
|
uninstall-am:
|
||||||
|
|
||||||
.MAKE: install-am install-strip
|
.MAKE: install-am install-strip
|
||||||
|
|
||||||
.PHONY: all all-am check check-am clean clean-generic cscopelist-am \
|
.PHONY: all all-am check check-am clean clean-generic distclean \
|
||||||
ctags-am distclean distclean-generic distdir dvi dvi-am html \
|
distclean-generic distdir dvi dvi-am html html-am info info-am \
|
||||||
html-am info info-am install install-am install-data \
|
install install-am install-data install-data-am install-dvi \
|
||||||
install-data-am install-dvi install-dvi-am install-exec \
|
install-dvi-am install-exec install-exec-am install-html \
|
||||||
install-exec-am install-html install-html-am install-info \
|
install-html-am install-info install-info-am install-man \
|
||||||
install-info-am install-man install-nodist_systemdDATA \
|
|
||||||
install-pdf install-pdf-am install-ps install-ps-am \
|
install-pdf install-pdf-am install-ps install-ps-am \
|
||||||
install-strip installcheck installcheck-am installdirs \
|
install-strip installcheck installcheck-am installdirs \
|
||||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
maintainer-clean maintainer-clean-generic mostlyclean \
|
||||||
mostlyclean-generic pdf pdf-am ps ps-am tags-am uninstall \
|
mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am
|
||||||
uninstall-am uninstall-nodist_systemdDATA
|
|
||||||
|
|
||||||
.PRECIOUS: Makefile
|
|
||||||
|
|
||||||
|
|
||||||
tinc.service: $(srcdir)/tinc.service.in
|
|
||||||
$(AM_V_GEN)$(substitute) $(srcdir)/tinc.service.in > $@
|
|
||||||
|
|
||||||
tinc@.service: $(srcdir)/tinc@.service.in
|
|
||||||
$(AM_V_GEN)$(substitute) $(srcdir)/tinc@.service.in > $@
|
|
||||||
|
|
||||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||||
8
m4/README
Normal file
8
m4/README
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
These files are used by a program called aclocal (part of the GNU automake
|
||||||
|
package). aclocal uses these files to create aclocal.m4 which is in turn
|
||||||
|
used by autoconf to create the configure script at the the top level in
|
||||||
|
this distribution.
|
||||||
|
|
||||||
|
The Makefile.am file in this directory is automatically generated
|
||||||
|
from the template file, Makefile.am.in. The generation will fail
|
||||||
|
if you don't have all the right tools.
|
||||||
|
|
@ -9,8 +9,8 @@ AC_DEFUN([tinc_ATTRIBUTE],
|
||||||
CFLAGS="$CFLAGS -Wall -Werror"
|
CFLAGS="$CFLAGS -Wall -Werror"
|
||||||
AC_COMPILE_IFELSE(
|
AC_COMPILE_IFELSE(
|
||||||
[AC_LANG_SOURCE(
|
[AC_LANG_SOURCE(
|
||||||
[void *test(void) __attribute__ (($1));
|
[void test(void) __attribute__ (($1));
|
||||||
void *test(void) { return (void *)0; }
|
void test(void) { return; }
|
||||||
],
|
],
|
||||||
)],
|
)],
|
||||||
[tinc_cv_attribute_$1=yes],
|
[tinc_cv_attribute_$1=yes],
|
||||||
|
|
|
||||||
|
|
@ -1,69 +0,0 @@
|
||||||
# ===========================================================================
|
|
||||||
# http://www.gnu.org/software/autoconf-archive/ax_append_flag.html
|
|
||||||
# ===========================================================================
|
|
||||||
#
|
|
||||||
# SYNOPSIS
|
|
||||||
#
|
|
||||||
# AX_APPEND_FLAG(FLAG, [FLAGS-VARIABLE])
|
|
||||||
#
|
|
||||||
# DESCRIPTION
|
|
||||||
#
|
|
||||||
# FLAG is appended to the FLAGS-VARIABLE shell variable, with a space
|
|
||||||
# added in between.
|
|
||||||
#
|
|
||||||
# If FLAGS-VARIABLE is not specified, the current language's flags (e.g.
|
|
||||||
# CFLAGS) is used. FLAGS-VARIABLE is not changed if it already contains
|
|
||||||
# FLAG. If FLAGS-VARIABLE is unset in the shell, it is set to exactly
|
|
||||||
# FLAG.
|
|
||||||
#
|
|
||||||
# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION.
|
|
||||||
#
|
|
||||||
# LICENSE
|
|
||||||
#
|
|
||||||
# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
|
|
||||||
# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.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 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.
|
|
||||||
#
|
|
||||||
# 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, the respective Autoconf Macro's copyright owner
|
|
||||||
# gives unlimited permission to copy, distribute and modify the configure
|
|
||||||
# scripts that are the output of Autoconf when processing the Macro. You
|
|
||||||
# need not follow the terms of the GNU General Public License when using
|
|
||||||
# or distributing such scripts, even though portions of the text of the
|
|
||||||
# Macro appear in them. The GNU General Public License (GPL) does govern
|
|
||||||
# all other use of the material that constitutes the Autoconf Macro.
|
|
||||||
#
|
|
||||||
# This special exception to the GPL applies to versions of the Autoconf
|
|
||||||
# Macro released by the Autoconf Archive. When you make and distribute a
|
|
||||||
# modified version of the Autoconf Macro, you may extend this special
|
|
||||||
# exception to the GPL to apply to your modified version as well.
|
|
||||||
|
|
||||||
#serial 2
|
|
||||||
|
|
||||||
AC_DEFUN([AX_APPEND_FLAG],
|
|
||||||
[AC_PREREQ(2.59)dnl for _AC_LANG_PREFIX
|
|
||||||
AS_VAR_PUSHDEF([FLAGS], [m4_default($2,_AC_LANG_PREFIX[FLAGS])])dnl
|
|
||||||
AS_VAR_SET_IF(FLAGS,
|
|
||||||
[case " AS_VAR_GET(FLAGS) " in
|
|
||||||
*" $1 "*)
|
|
||||||
AC_RUN_LOG([: FLAGS already contains $1])
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
AC_RUN_LOG([: FLAGS="$FLAGS $1"])
|
|
||||||
AS_VAR_SET(FLAGS, ["AS_VAR_GET(FLAGS) $1"])
|
|
||||||
;;
|
|
||||||
esac],
|
|
||||||
[AS_VAR_SET(FLAGS,["$1"])])
|
|
||||||
AS_VAR_POPDEF([FLAGS])dnl
|
|
||||||
])dnl AX_APPEND_FLAG
|
|
||||||
|
|
@ -1,122 +0,0 @@
|
||||||
# ===========================================================================
|
|
||||||
# http://www.gnu.org/software/autoconf-archive/ax_cflags_warn_all.html
|
|
||||||
# ===========================================================================
|
|
||||||
#
|
|
||||||
# SYNOPSIS
|
|
||||||
#
|
|
||||||
# AX_CFLAGS_WARN_ALL [(shellvar [,default, [A/NA]])]
|
|
||||||
# AX_CXXFLAGS_WARN_ALL [(shellvar [,default, [A/NA]])]
|
|
||||||
# AX_FCFLAGS_WARN_ALL [(shellvar [,default, [A/NA]])]
|
|
||||||
#
|
|
||||||
# DESCRIPTION
|
|
||||||
#
|
|
||||||
# Try to find a compiler option that enables most reasonable warnings.
|
|
||||||
#
|
|
||||||
# For the GNU compiler it will be -Wall (and -ansi -pedantic) The result
|
|
||||||
# is added to the shellvar being CFLAGS, CXXFLAGS, or FCFLAGS by default.
|
|
||||||
#
|
|
||||||
# Currently this macro knows about the GCC, Solaris, Digital Unix, AIX,
|
|
||||||
# HP-UX, IRIX, NEC SX-5 (Super-UX 10), Cray J90 (Unicos 10.0.0.8), and
|
|
||||||
# Intel compilers. For a given compiler, the Fortran flags are much more
|
|
||||||
# experimental than their C equivalents.
|
|
||||||
#
|
|
||||||
# - $1 shell-variable-to-add-to : CFLAGS, CXXFLAGS, or FCFLAGS
|
|
||||||
# - $2 add-value-if-not-found : nothing
|
|
||||||
# - $3 action-if-found : add value to shellvariable
|
|
||||||
# - $4 action-if-not-found : nothing
|
|
||||||
#
|
|
||||||
# NOTE: These macros depend on AX_APPEND_FLAG.
|
|
||||||
#
|
|
||||||
# LICENSE
|
|
||||||
#
|
|
||||||
# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
|
|
||||||
# Copyright (c) 2010 Rhys Ulerich <rhys.ulerich@gmail.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 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.
|
|
||||||
#
|
|
||||||
# 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, the respective Autoconf Macro's copyright owner
|
|
||||||
# gives unlimited permission to copy, distribute and modify the configure
|
|
||||||
# scripts that are the output of Autoconf when processing the Macro. You
|
|
||||||
# need not follow the terms of the GNU General Public License when using
|
|
||||||
# or distributing such scripts, even though portions of the text of the
|
|
||||||
# Macro appear in them. The GNU General Public License (GPL) does govern
|
|
||||||
# all other use of the material that constitutes the Autoconf Macro.
|
|
||||||
#
|
|
||||||
# This special exception to the GPL applies to versions of the Autoconf
|
|
||||||
# Macro released by the Autoconf Archive. When you make and distribute a
|
|
||||||
# modified version of the Autoconf Macro, you may extend this special
|
|
||||||
# exception to the GPL to apply to your modified version as well.
|
|
||||||
|
|
||||||
#serial 15
|
|
||||||
|
|
||||||
AC_DEFUN([AX_FLAGS_WARN_ALL],[dnl
|
|
||||||
AS_VAR_PUSHDEF([FLAGS],[_AC_LANG_PREFIX[]FLAGS])dnl
|
|
||||||
AS_VAR_PUSHDEF([VAR],[ac_cv_[]_AC_LANG_ABBREV[]flags_warn_all])dnl
|
|
||||||
AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum warnings],
|
|
||||||
VAR,[VAR="no, unknown"
|
|
||||||
ac_save_[]FLAGS="$[]FLAGS"
|
|
||||||
for ac_arg dnl
|
|
||||||
in "-warn all % -warn all" dnl Intel
|
|
||||||
"-pedantic % -Wall" dnl GCC
|
|
||||||
"-xstrconst % -v" dnl Solaris C
|
|
||||||
"-std1 % -verbose -w0 -warnprotos" dnl Digital Unix
|
|
||||||
"-qlanglvl=ansi % -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" dnl AIX
|
|
||||||
"-ansi -ansiE % -fullwarn" dnl IRIX
|
|
||||||
"+ESlit % +w1" dnl HP-UX C
|
|
||||||
"-Xc % -pvctl[,]fullmsg" dnl NEC SX-5 (Super-UX 10)
|
|
||||||
"-h conform % -h msglevel 2" dnl Cray C (Unicos)
|
|
||||||
#
|
|
||||||
do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
|
|
||||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
|
|
||||||
[VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
|
|
||||||
done
|
|
||||||
FLAGS="$ac_save_[]FLAGS"
|
|
||||||
])
|
|
||||||
AS_VAR_POPDEF([FLAGS])dnl
|
|
||||||
AX_REQUIRE_DEFINED([AX_APPEND_FLAG])
|
|
||||||
case ".$VAR" in
|
|
||||||
.ok|.ok,*) m4_ifvaln($3,$3) ;;
|
|
||||||
.|.no|.no,*) m4_default($4,[m4_ifval($2,[AX_APPEND_FLAG([$2], [$1])])]) ;;
|
|
||||||
*) m4_default($3,[AX_APPEND_FLAG([$VAR], [$1])]) ;;
|
|
||||||
esac
|
|
||||||
AS_VAR_POPDEF([VAR])dnl
|
|
||||||
])dnl AX_FLAGS_WARN_ALL
|
|
||||||
dnl implementation tactics:
|
|
||||||
dnl the for-argument contains a list of options. The first part of
|
|
||||||
dnl these does only exist to detect the compiler - usually it is
|
|
||||||
dnl a global option to enable -ansi or -extrawarnings. All other
|
|
||||||
dnl compilers will fail about it. That was needed since a lot of
|
|
||||||
dnl compilers will give false positives for some option-syntax
|
|
||||||
dnl like -Woption or -Xoption as they think of it is a pass-through
|
|
||||||
dnl to later compile stages or something. The "%" is used as a
|
|
||||||
dnl delimiter. A non-option comment can be given after "%%" marks
|
|
||||||
dnl which will be shown but not added to the respective C/CXXFLAGS.
|
|
||||||
|
|
||||||
AC_DEFUN([AX_CFLAGS_WARN_ALL],[dnl
|
|
||||||
AC_LANG_PUSH([C])
|
|
||||||
AX_FLAGS_WARN_ALL([$1], [$2], [$3], [$4])
|
|
||||||
AC_LANG_POP([C])
|
|
||||||
])
|
|
||||||
|
|
||||||
AC_DEFUN([AX_CXXFLAGS_WARN_ALL],[dnl
|
|
||||||
AC_LANG_PUSH([C++])
|
|
||||||
AX_FLAGS_WARN_ALL([$1], [$2], [$3], [$4])
|
|
||||||
AC_LANG_POP([C++])
|
|
||||||
])
|
|
||||||
|
|
||||||
AC_DEFUN([AX_FCFLAGS_WARN_ALL],[dnl
|
|
||||||
AC_LANG_PUSH([Fortran])
|
|
||||||
AX_FLAGS_WARN_ALL([$1], [$2], [$3], [$4])
|
|
||||||
AC_LANG_POP([Fortran])
|
|
||||||
])
|
|
||||||
|
|
@ -1,72 +0,0 @@
|
||||||
# ===========================================================================
|
|
||||||
# http://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
|
|
||||||
# ===========================================================================
|
|
||||||
#
|
|
||||||
# SYNOPSIS
|
|
||||||
#
|
|
||||||
# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS])
|
|
||||||
#
|
|
||||||
# DESCRIPTION
|
|
||||||
#
|
|
||||||
# Check whether the given FLAG works with the current language's compiler
|
|
||||||
# or gives an error. (Warnings, however, are ignored)
|
|
||||||
#
|
|
||||||
# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
|
|
||||||
# success/failure.
|
|
||||||
#
|
|
||||||
# If EXTRA-FLAGS is defined, it is added to the current language's default
|
|
||||||
# flags (e.g. CFLAGS) when the check is done. The check is thus made with
|
|
||||||
# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
|
|
||||||
# force the compiler to issue an error when a bad flag is given.
|
|
||||||
#
|
|
||||||
# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
|
|
||||||
# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
|
|
||||||
#
|
|
||||||
# LICENSE
|
|
||||||
#
|
|
||||||
# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
|
|
||||||
# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.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 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.
|
|
||||||
#
|
|
||||||
# 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, the respective Autoconf Macro's copyright owner
|
|
||||||
# gives unlimited permission to copy, distribute and modify the configure
|
|
||||||
# scripts that are the output of Autoconf when processing the Macro. You
|
|
||||||
# need not follow the terms of the GNU General Public License when using
|
|
||||||
# or distributing such scripts, even though portions of the text of the
|
|
||||||
# Macro appear in them. The GNU General Public License (GPL) does govern
|
|
||||||
# all other use of the material that constitutes the Autoconf Macro.
|
|
||||||
#
|
|
||||||
# This special exception to the GPL applies to versions of the Autoconf
|
|
||||||
# Macro released by the Autoconf Archive. When you make and distribute a
|
|
||||||
# modified version of the Autoconf Macro, you may extend this special
|
|
||||||
# exception to the GPL to apply to your modified version as well.
|
|
||||||
|
|
||||||
#serial 2
|
|
||||||
|
|
||||||
AC_DEFUN([AX_CHECK_COMPILE_FLAG],
|
|
||||||
[AC_PREREQ(2.59)dnl for _AC_LANG_PREFIX
|
|
||||||
AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
|
|
||||||
AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
|
|
||||||
ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
|
|
||||||
_AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
|
|
||||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
|
|
||||||
[AS_VAR_SET(CACHEVAR,[yes])],
|
|
||||||
[AS_VAR_SET(CACHEVAR,[no])])
|
|
||||||
_AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
|
|
||||||
AS_IF([test x"AS_VAR_GET(CACHEVAR)" = xyes],
|
|
||||||
[m4_default([$2], :)],
|
|
||||||
[m4_default([$3], :)])
|
|
||||||
AS_VAR_POPDEF([CACHEVAR])dnl
|
|
||||||
])dnl AX_CHECK_COMPILE_FLAGS
|
|
||||||
|
|
@ -1,71 +0,0 @@
|
||||||
# ===========================================================================
|
|
||||||
# http://www.gnu.org/software/autoconf-archive/ax_check_link_flag.html
|
|
||||||
# ===========================================================================
|
|
||||||
#
|
|
||||||
# SYNOPSIS
|
|
||||||
#
|
|
||||||
# AX_CHECK_LINK_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS])
|
|
||||||
#
|
|
||||||
# DESCRIPTION
|
|
||||||
#
|
|
||||||
# Check whether the given FLAG works with the linker or gives an error.
|
|
||||||
# (Warnings, however, are ignored)
|
|
||||||
#
|
|
||||||
# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
|
|
||||||
# success/failure.
|
|
||||||
#
|
|
||||||
# If EXTRA-FLAGS is defined, it is added to the linker's default flags
|
|
||||||
# when the check is done. The check is thus made with the flags: "LDFLAGS
|
|
||||||
# EXTRA-FLAGS FLAG". This can for example be used to force the linker to
|
|
||||||
# issue an error when a bad flag is given.
|
|
||||||
#
|
|
||||||
# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
|
|
||||||
# macro in sync with AX_CHECK_{PREPROC,COMPILE}_FLAG.
|
|
||||||
#
|
|
||||||
# LICENSE
|
|
||||||
#
|
|
||||||
# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
|
|
||||||
# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.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 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.
|
|
||||||
#
|
|
||||||
# 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, the respective Autoconf Macro's copyright owner
|
|
||||||
# gives unlimited permission to copy, distribute and modify the configure
|
|
||||||
# scripts that are the output of Autoconf when processing the Macro. You
|
|
||||||
# need not follow the terms of the GNU General Public License when using
|
|
||||||
# or distributing such scripts, even though portions of the text of the
|
|
||||||
# Macro appear in them. The GNU General Public License (GPL) does govern
|
|
||||||
# all other use of the material that constitutes the Autoconf Macro.
|
|
||||||
#
|
|
||||||
# This special exception to the GPL applies to versions of the Autoconf
|
|
||||||
# Macro released by the Autoconf Archive. When you make and distribute a
|
|
||||||
# modified version of the Autoconf Macro, you may extend this special
|
|
||||||
# exception to the GPL to apply to your modified version as well.
|
|
||||||
|
|
||||||
#serial 2
|
|
||||||
|
|
||||||
AC_DEFUN([AX_CHECK_LINK_FLAG],
|
|
||||||
[AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_ldflags_$4_$1])dnl
|
|
||||||
AC_CACHE_CHECK([whether the linker accepts $1], CACHEVAR, [
|
|
||||||
ax_check_save_flags=$LDFLAGS
|
|
||||||
LDFLAGS="$LDFLAGS $4 $1"
|
|
||||||
AC_LINK_IFELSE([AC_LANG_PROGRAM()],
|
|
||||||
[AS_VAR_SET(CACHEVAR,[yes])],
|
|
||||||
[AS_VAR_SET(CACHEVAR,[no])])
|
|
||||||
LDFLAGS=$ax_check_save_flags])
|
|
||||||
AS_IF([test x"AS_VAR_GET(CACHEVAR)" = xyes],
|
|
||||||
[m4_default([$2], :)],
|
|
||||||
[m4_default([$3], :)])
|
|
||||||
AS_VAR_POPDEF([CACHEVAR])dnl
|
|
||||||
])dnl AX_CHECK_LINK_FLAGS
|
|
||||||
|
|
@ -1,37 +0,0 @@
|
||||||
# ===========================================================================
|
|
||||||
# http://www.gnu.org/software/autoconf-archive/ax_require_defined.html
|
|
||||||
# ===========================================================================
|
|
||||||
#
|
|
||||||
# SYNOPSIS
|
|
||||||
#
|
|
||||||
# AX_REQUIRE_DEFINED(MACRO)
|
|
||||||
#
|
|
||||||
# DESCRIPTION
|
|
||||||
#
|
|
||||||
# AX_REQUIRE_DEFINED is a simple helper for making sure other macros have
|
|
||||||
# been defined and thus are available for use. This avoids random issues
|
|
||||||
# where a macro isn't expanded. Instead the configure script emits a
|
|
||||||
# non-fatal:
|
|
||||||
#
|
|
||||||
# ./configure: line 1673: AX_CFLAGS_WARN_ALL: command not found
|
|
||||||
#
|
|
||||||
# It's like AC_REQUIRE except it doesn't expand the required macro.
|
|
||||||
#
|
|
||||||
# Here's an example:
|
|
||||||
#
|
|
||||||
# AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG])
|
|
||||||
#
|
|
||||||
# LICENSE
|
|
||||||
#
|
|
||||||
# Copyright (c) 2014 Mike Frysinger <vapier@gentoo.org>
|
|
||||||
#
|
|
||||||
# Copying and distribution of this file, with or without modification, are
|
|
||||||
# permitted in any medium without royalty provided the copyright notice
|
|
||||||
# and this notice are preserved. This file is offered as-is, without any
|
|
||||||
# warranty.
|
|
||||||
|
|
||||||
#serial 1
|
|
||||||
|
|
||||||
AC_DEFUN([AX_REQUIRE_DEFINED], [dnl
|
|
||||||
m4_ifndef([$1], [m4_fatal([macro ]$1[ is not defined; is a m4 file missing?])])
|
|
||||||
])dnl AX_REQUIRE_DEFINED
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
dnl Check to find the LibreSSL/OpenSSL headers/libraries
|
dnl Check to find the OpenSSL headers/libraries
|
||||||
|
|
||||||
AC_DEFUN([tinc_OPENSSL],
|
AC_DEFUN([tinc_OPENSSL],
|
||||||
[
|
[
|
||||||
|
|
@ -10,49 +10,47 @@ AC_DEFUN([tinc_OPENSSL],
|
||||||
[],
|
[],
|
||||||
[AC_CHECK_LIB(dl, dlopen,
|
[AC_CHECK_LIB(dl, dlopen,
|
||||||
[LIBS="$LIBS -ldl"],
|
[LIBS="$LIBS -ldl"],
|
||||||
[AC_MSG_ERROR([LibreSSL/OpenSSL depends on libdl.]); break]
|
[AC_MSG_ERROR([OpenSSL depends on libdl.]); break]
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
AC_ARG_WITH(openssl,
|
AC_ARG_WITH(openssl,
|
||||||
AS_HELP_STRING([--with-openssl=DIR], [LibreSSL/OpenSSL base directory, or:]),
|
AS_HELP_STRING([--with-openssl=DIR], [OpenSSL base directory, or:]),
|
||||||
[openssl="$withval"
|
[openssl="$withval"
|
||||||
CPPFLAGS="$CPPFLAGS -I$withval/include"
|
CPPFLAGS="$CPPFLAGS -I$withval/include"
|
||||||
LDFLAGS="$LDFLAGS -L$withval/lib"]
|
LDFLAGS="$LDFLAGS -L$withval/lib"]
|
||||||
)
|
)
|
||||||
|
|
||||||
AC_ARG_WITH(openssl-include,
|
AC_ARG_WITH(openssl-include,
|
||||||
AS_HELP_STRING([--with-openssl-include=DIR], [LibreSSL/OpenSSL headers directory (without trailing /openssl)]),
|
AS_HELP_STRING([--with-openssl-include=DIR], [OpenSSL headers directory (without trailing /openssl)]),
|
||||||
[openssl_include="$withval"
|
[openssl_include="$withval"
|
||||||
CPPFLAGS="$CPPFLAGS -I$withval"]
|
CPPFLAGS="$CPPFLAGS -I$withval"]
|
||||||
)
|
)
|
||||||
|
|
||||||
AC_ARG_WITH(openssl-lib,
|
AC_ARG_WITH(openssl-lib,
|
||||||
AS_HELP_STRING([--with-openssl-lib=DIR], [LibreSSL/OpenSSL library directory]),
|
AS_HELP_STRING([--with-openssl-lib=DIR], [OpenSSL library directory]),
|
||||||
[openssl_lib="$withval"
|
[openssl_lib="$withval"
|
||||||
LDFLAGS="$LDFLAGS -L$withval"]
|
LDFLAGS="$LDFLAGS -L$withval"]
|
||||||
)
|
)
|
||||||
|
|
||||||
AC_CHECK_HEADERS(openssl/evp.h openssl/rsa.h openssl/rand.h openssl/err.h openssl/sha.h openssl/pem.h openssl/engine.h,
|
AC_CHECK_HEADERS(openssl/evp.h openssl/rsa.h openssl/rand.h openssl/err.h openssl/sha.h openssl/pem.h openssl/engine.h,
|
||||||
[],
|
[],
|
||||||
[AC_MSG_ERROR([LibreSSL/OpenSSL header files not found.]); break]
|
[AC_MSG_ERROR([OpenSSL header files not found.]); break]
|
||||||
)
|
)
|
||||||
|
|
||||||
AC_CHECK_LIB(crypto, EVP_EncryptInit_ex,
|
AC_CHECK_LIB(crypto, EVP_EncryptInit_ex,
|
||||||
[LIBS="-lcrypto $LIBS"],
|
[LIBS="-lcrypto $LIBS"],
|
||||||
[AC_MSG_ERROR([LibreSSL/OpenSSL libraries not found.])]
|
[AC_MSG_ERROR([OpenSSL libraries not found.])]
|
||||||
)
|
)
|
||||||
|
|
||||||
AC_CHECK_FUNCS([RAND_bytes EVP_EncryptInit_ex EVP_CIPHER_CTX_new], ,
|
AC_CHECK_FUNCS([RAND_pseudo_bytes EVP_EncryptInit_ex], ,
|
||||||
[AC_MSG_ERROR([Missing LibreSSL/OpenSSL functionality, make sure you have installed the latest version.]); break],
|
[AC_MSG_ERROR([Missing OpenSSL functionality, make sure you have installed the latest version.]); break],
|
||||||
)
|
)
|
||||||
|
|
||||||
AC_CHECK_DECLS([OpenSSL_add_all_algorithms, EVP_aes_256_cfb], ,
|
AC_CHECK_DECL([OpenSSL_add_all_algorithms], ,
|
||||||
[AC_MSG_ERROR([Missing LibreSSL/OpenSSL functionality, make sure you have installed the latest version.]); break],
|
[AC_MSG_ERROR([Missing OpenSSL functionality, make sure you have installed the latest version.]); break],
|
||||||
[#include <openssl/evp.h>]
|
[#include <openssl/evp.h>]
|
||||||
)
|
)
|
||||||
|
|
||||||
AC_CHECK_FUNCS([BN_GENCB_new RSA_set0_key], , , [#include <openssl/rsa.h>])
|
|
||||||
])
|
])
|
||||||
|
|
|
||||||
402
missing
402
missing
|
|
@ -1,10 +1,11 @@
|
||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# Common wrapper for a few potentially missing GNU programs.
|
# Common stub for a few missing GNU programs while installing.
|
||||||
|
|
||||||
scriptversion=2018-03-07.03; # UTC
|
scriptversion=2012-01-06.13; # UTC
|
||||||
|
|
||||||
# Copyright (C) 1996-2020 Free Software Foundation, Inc.
|
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
|
||||||
# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
|
# 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
|
||||||
|
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
|
||||||
|
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|
@ -17,7 +18,7 @@ scriptversion=2018-03-07.03; # UTC
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
|
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
# As a special exception to the GNU General Public License, if you
|
# As a special exception to the GNU General Public License, if you
|
||||||
# distribute this file as part of a program that contains a
|
# distribute this file as part of a program that contains a
|
||||||
|
|
@ -25,40 +26,68 @@ scriptversion=2018-03-07.03; # UTC
|
||||||
# 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.
|
||||||
|
|
||||||
if test $# -eq 0; then
|
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
|
exit 1
|
||||||
fi
|
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
|
case $1 in
|
||||||
|
--run)
|
||||||
--is-lightweight)
|
# Try to run requested program, and just exit if it succeeds.
|
||||||
# Used by our autoconf macros to check whether the available missing
|
run=
|
||||||
# script is modern enough.
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
|
|
||||||
--run)
|
|
||||||
# Back-compat with the calling convention used by older automake.
|
|
||||||
shift
|
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
|
||||||
;;
|
;;
|
||||||
|
|
||||||
-h|--h|--he|--hel|--help)
|
-h|--h|--he|--hel|--help)
|
||||||
echo "\
|
echo "\
|
||||||
$0 [OPTION]... PROGRAM [ARGUMENT]...
|
$0 [OPTION]... PROGRAM [ARGUMENT]...
|
||||||
|
|
||||||
Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
|
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
|
||||||
to PROGRAM being missing or too old.
|
error status if there is no known handling for PROGRAM.
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
-h, --help display this help and exit
|
-h, --help display this help and exit
|
||||||
-v, --version output version information 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:
|
Supported PROGRAM values:
|
||||||
aclocal autoconf autoheader autom4te automake makeinfo
|
aclocal touch file \`aclocal.m4'
|
||||||
bison yacc flex lex help2man
|
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]
|
||||||
|
|
||||||
Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
|
Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
|
||||||
'g' are ignored when checking the name.
|
\`g' are ignored when checking the name.
|
||||||
|
|
||||||
Send bug reports to <bug-automake@gnu.org>."
|
Send bug reports to <bug-automake@gnu.org>."
|
||||||
exit $?
|
exit $?
|
||||||
|
|
@ -70,146 +99,233 @@ Send bug reports to <bug-automake@gnu.org>."
|
||||||
;;
|
;;
|
||||||
|
|
||||||
-*)
|
-*)
|
||||||
echo 1>&2 "$0: unknown '$1' option"
|
echo 1>&2 "$0: Unknown \`$1' option"
|
||||||
echo 1>&2 "Try '$0 --help' for more information"
|
echo 1>&2 "Try \`$0 --help' for more information"
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Run the given program, remember its exit status.
|
# normalize program name to check for.
|
||||||
"$@"; st=$?
|
program=`echo "$1" | sed '
|
||||||
|
|
||||||
# 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=https://www.perl.org/
|
|
||||||
flex_URL=https://github.com/westes/flex
|
|
||||||
gnu_software_URL=https://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/^gnu//; t
|
s/^gnu//; t
|
||||||
s/^g//; t'`
|
s/^g//; t'`
|
||||||
|
|
||||||
printf '%s\n' "'$1' is $msg."
|
# 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.
|
||||||
|
;;
|
||||||
|
|
||||||
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 'autom4te' 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"
|
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
|
||||||
echo "tools for further handling them. Check the 'README' file, it"
|
# We have it, but it failed.
|
||||||
echo "often tells you about the needed prerequisites for installing"
|
exit 1
|
||||||
echo "this package. You may also peek at any GNU archive site, in"
|
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
|
||||||
echo "case some other package contains this missing '$1' program."
|
# 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
|
||||||
|
|
||||||
|
# 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
|
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
|
||||||
|
;;
|
||||||
|
|
||||||
give_advice "$1" | sed -e '1s/^/WARNING: /' \
|
lex*|flex*)
|
||||||
-e '2,$s/^/ /' >&2
|
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
|
||||||
|
;;
|
||||||
|
|
||||||
# Propagate the correct exit status (expected to be 127 for a program
|
help2man*)
|
||||||
# not found, 63 for a program that failed due to version mismatch).
|
echo 1>&2 "\
|
||||||
exit $st
|
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
|
||||||
|
|
||||||
# Local variables:
|
# Local variables:
|
||||||
# eval: (add-hook 'before-save-hook 'time-stamp)
|
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||||
# time-stamp-start: "scriptversion="
|
# time-stamp-start: "scriptversion="
|
||||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||||
# time-stamp-time-zone: "UTC0"
|
# time-stamp-time-zone: "UTC"
|
||||||
# time-stamp-end: "; # UTC"
|
# time-stamp-end: "; # UTC"
|
||||||
# End:
|
# End:
|
||||||
|
|
|
||||||
|
|
@ -2,77 +2,12 @@
|
||||||
|
|
||||||
sbin_PROGRAMS = tincd
|
sbin_PROGRAMS = tincd
|
||||||
|
|
||||||
tincd_SOURCES = \
|
EXTRA_DIST = linux/device.c bsd/device.c solaris/device.c cygwin/device.c mingw/device.c mingw/common.h
|
||||||
have.h \
|
|
||||||
system.h \
|
|
||||||
avl_tree.c avl_tree.h \
|
|
||||||
conf.c conf.h \
|
|
||||||
connection.c connection.h \
|
|
||||||
device.h \
|
|
||||||
dropin.c dropin.h \
|
|
||||||
dummy_device.c \
|
|
||||||
edge.c edge.h \
|
|
||||||
ethernet.h \
|
|
||||||
event.c event.h \
|
|
||||||
fake-getaddrinfo.c fake-getaddrinfo.h \
|
|
||||||
fake-getnameinfo.c fake-getnameinfo.h \
|
|
||||||
graph.c graph.h \
|
|
||||||
ipv4.h \
|
|
||||||
ipv6.h \
|
|
||||||
list.c list.h \
|
|
||||||
logger.c logger.h \
|
|
||||||
meta.c meta.h \
|
|
||||||
multicast_device.c \
|
|
||||||
net.c net.h \
|
|
||||||
net_packet.c \
|
|
||||||
net_setup.c \
|
|
||||||
net_socket.c \
|
|
||||||
netutl.c netutl.h \
|
|
||||||
node.c node.h \
|
|
||||||
pidfile.c pidfile.h \
|
|
||||||
process.c process.h \
|
|
||||||
protocol.c protocol.h \
|
|
||||||
protocol_auth.c \
|
|
||||||
protocol_edge.c \
|
|
||||||
protocol_misc.c \
|
|
||||||
protocol_key.c \
|
|
||||||
protocol_subnet.c \
|
|
||||||
proxy.c proxy.h \
|
|
||||||
raw_socket_device.c \
|
|
||||||
route.c route.h \
|
|
||||||
subnet.c subnet.h \
|
|
||||||
tincd.c \
|
|
||||||
utils.c utils.h \
|
|
||||||
xalloc.h
|
|
||||||
|
|
||||||
if !GETOPT
|
tincd_SOURCES = conf.c connection.c edge.c event.c graph.c logger.c meta.c net.c net_packet.c net_setup.c \
|
||||||
tincd_SOURCES += \
|
net_socket.c netutl.c node.c process.c protocol.c protocol_auth.c protocol_edge.c protocol_misc.c \
|
||||||
getopt.c getopt.h \
|
protocol_key.c protocol_subnet.c route.c subnet.c tincd.c \
|
||||||
getopt1.c
|
dummy_device.c raw_socket_device.c multicast_device.c
|
||||||
endif
|
|
||||||
|
|
||||||
if LINUX
|
|
||||||
tincd_SOURCES += linux/device.c
|
|
||||||
endif
|
|
||||||
|
|
||||||
if BSD
|
|
||||||
tincd_SOURCES += bsd/device.c
|
|
||||||
if TUNEMU
|
|
||||||
tincd_SOURCES += bsd/tunemu.c bsd/tunemu.h
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
if SOLARIS
|
|
||||||
tincd_SOURCES += solaris/device.c
|
|
||||||
endif
|
|
||||||
|
|
||||||
if MINGW
|
|
||||||
tincd_SOURCES += mingw/device.c mingw/common.h
|
|
||||||
endif
|
|
||||||
|
|
||||||
if CYGWIN
|
|
||||||
tincd_SOURCES += cygwin/device.c
|
|
||||||
endif
|
|
||||||
|
|
||||||
if UML
|
if UML
|
||||||
tincd_SOURCES += uml_device.c
|
tincd_SOURCES += uml_device.c
|
||||||
|
|
@ -82,8 +17,29 @@ if VDE
|
||||||
tincd_SOURCES += vde_device.c
|
tincd_SOURCES += vde_device.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if TUNEMU
|
||||||
|
tincd_SOURCES += bsd/tunemu.c
|
||||||
|
endif
|
||||||
|
|
||||||
|
nodist_tincd_SOURCES = device.c
|
||||||
|
|
||||||
|
DEFAULT_INCLUDES =
|
||||||
|
|
||||||
|
INCLUDES = @INCLUDES@ -I$(top_builddir) -I$(top_srcdir)/lib
|
||||||
|
|
||||||
|
noinst_HEADERS = conf.h connection.h device.h edge.h event.h graph.h logger.h meta.h net.h netutl.h node.h process.h \
|
||||||
|
protocol.h route.h subnet.h bsd/tunemu.h
|
||||||
|
|
||||||
|
LIBS = @LIBS@
|
||||||
|
|
||||||
if TUNEMU
|
if TUNEMU
|
||||||
LIBS += -lpcap
|
LIBS += -lpcap
|
||||||
endif
|
endif
|
||||||
|
|
||||||
AM_CPPFLAGS = -DCONFDIR=\"$(sysconfdir)\" -DRUNSTATEDIR=\"$(runstatedir)\" -DLOCALSTATEDIR=\"$(localstatedir)\" -I $(abs_top_builddir)/
|
tincd_LDADD = \
|
||||||
|
$(top_builddir)/lib/libvpn.a
|
||||||
|
|
||||||
|
AM_CFLAGS = -DCONFDIR=\"$(sysconfdir)\" -DLOCALSTATEDIR=\"$(localstatedir)\"
|
||||||
|
|
||||||
|
dist-hook:
|
||||||
|
rm -f `find . -type l`
|
||||||
|
|
|
||||||
664
src/Makefile.in
664
src/Makefile.in
|
|
@ -1,8 +1,9 @@
|
||||||
# Makefile.in generated by automake 1.16.2 from Makefile.am.
|
# Makefile.in generated by automake 1.11.5 from Makefile.am.
|
||||||
# @configure_input@
|
# @configure_input@
|
||||||
|
|
||||||
# Copyright (C) 1994-2020 Free Software Foundation, Inc.
|
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||||
|
# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
|
||||||
|
# Foundation, Inc.
|
||||||
# This Makefile.in is free software; the Free Software Foundation
|
# This Makefile.in is free software; the Free Software Foundation
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
# with or without modifications, as long as this notice is preserved.
|
# with or without modifications, as long as this notice is preserved.
|
||||||
|
|
@ -14,62 +15,25 @@
|
||||||
|
|
||||||
@SET_MAKE@
|
@SET_MAKE@
|
||||||
|
|
||||||
|
|
||||||
VPATH = @srcdir@
|
VPATH = @srcdir@
|
||||||
am__is_gnu_make = { \
|
am__make_dryrun = \
|
||||||
if test -z '$(MAKELEVEL)'; then \
|
{ \
|
||||||
false; \
|
am__dry=no; \
|
||||||
elif test -n '$(MAKE_HOST)'; then \
|
|
||||||
true; \
|
|
||||||
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
|
|
||||||
true; \
|
|
||||||
else \
|
|
||||||
false; \
|
|
||||||
fi; \
|
|
||||||
}
|
|
||||||
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 \
|
case $$MAKEFLAGS in \
|
||||||
*\\[\ \ ]*) \
|
*\\[\ \ ]*) \
|
||||||
bs=\\; \
|
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
|
||||||
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
|
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
|
||||||
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
|
*) \
|
||||||
|
for am__flg in $$MAKEFLAGS; do \
|
||||||
|
case $$am__flg in \
|
||||||
|
*=*|--*) ;; \
|
||||||
|
*n*) am__dry=yes; break;; \
|
||||||
esac; \
|
esac; \
|
||||||
fi; \
|
done;; \
|
||||||
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; \
|
esac; \
|
||||||
case $$flg in \
|
test $$am__dry = yes; \
|
||||||
*$$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@
|
pkgdatadir = $(datadir)/@PACKAGE@
|
||||||
pkgincludedir = $(includedir)/@PACKAGE@
|
pkgincludedir = $(includedir)/@PACKAGE@
|
||||||
pkglibdir = $(libdir)/@PACKAGE@
|
pkglibdir = $(libdir)/@PACKAGE@
|
||||||
|
|
@ -89,162 +53,70 @@ POST_UNINSTALL = :
|
||||||
build_triplet = @build@
|
build_triplet = @build@
|
||||||
host_triplet = @host@
|
host_triplet = @host@
|
||||||
sbin_PROGRAMS = tincd$(EXEEXT)
|
sbin_PROGRAMS = tincd$(EXEEXT)
|
||||||
@GETOPT_FALSE@am__append_1 = \
|
@UML_TRUE@am__append_1 = uml_device.c
|
||||||
@GETOPT_FALSE@ getopt.c getopt.h \
|
@VDE_TRUE@am__append_2 = vde_device.c
|
||||||
@GETOPT_FALSE@ getopt1.c
|
@TUNEMU_TRUE@am__append_3 = bsd/tunemu.c
|
||||||
|
@TUNEMU_TRUE@am__append_4 = -lpcap
|
||||||
@LINUX_TRUE@am__append_2 = linux/device.c
|
|
||||||
@BSD_TRUE@am__append_3 = bsd/device.c
|
|
||||||
@BSD_TRUE@@TUNEMU_TRUE@am__append_4 = bsd/tunemu.c bsd/tunemu.h
|
|
||||||
@SOLARIS_TRUE@am__append_5 = solaris/device.c
|
|
||||||
@MINGW_TRUE@am__append_6 = mingw/device.c mingw/common.h
|
|
||||||
@CYGWIN_TRUE@am__append_7 = cygwin/device.c
|
|
||||||
@UML_TRUE@am__append_8 = uml_device.c
|
|
||||||
@VDE_TRUE@am__append_9 = vde_device.c
|
|
||||||
@TUNEMU_TRUE@am__append_10 = -lpcap
|
|
||||||
subdir = src
|
subdir = src
|
||||||
|
DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
|
||||||
|
$(srcdir)/Makefile.in
|
||||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||||
am__aclocal_m4_deps = $(top_srcdir)/m4/attribute.m4 \
|
am__aclocal_m4_deps = $(top_srcdir)/m4/attribute.m4 \
|
||||||
$(top_srcdir)/m4/ax_append_flag.m4 \
|
$(top_srcdir)/m4/lzo.m4 $(top_srcdir)/m4/openssl.m4 \
|
||||||
$(top_srcdir)/m4/ax_cflags_warn_all.m4 \
|
$(top_srcdir)/m4/zlib.m4 $(top_srcdir)/configure.in
|
||||||
$(top_srcdir)/m4/ax_check_compile_flag.m4 \
|
|
||||||
$(top_srcdir)/m4/ax_check_link_flag.m4 \
|
|
||||||
$(top_srcdir)/m4/ax_require_defined.m4 $(top_srcdir)/m4/lzo.m4 \
|
|
||||||
$(top_srcdir)/m4/openssl.m4 $(top_srcdir)/m4/zlib.m4 \
|
|
||||||
$(top_srcdir)/configure.ac
|
|
||||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||||
$(ACLOCAL_M4)
|
$(ACLOCAL_M4)
|
||||||
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
|
|
||||||
mkinstalldirs = $(install_sh) -d
|
mkinstalldirs = $(install_sh) -d
|
||||||
CONFIG_HEADER = $(top_builddir)/config.h
|
CONFIG_HEADER = $(top_builddir)/config.h
|
||||||
CONFIG_CLEAN_FILES =
|
CONFIG_CLEAN_FILES =
|
||||||
CONFIG_CLEAN_VPATH_FILES =
|
CONFIG_CLEAN_VPATH_FILES =
|
||||||
am__installdirs = "$(DESTDIR)$(sbindir)"
|
am__installdirs = "$(DESTDIR)$(sbindir)"
|
||||||
PROGRAMS = $(sbin_PROGRAMS)
|
PROGRAMS = $(sbin_PROGRAMS)
|
||||||
am__tincd_SOURCES_DIST = have.h system.h avl_tree.c avl_tree.h conf.c \
|
am__tincd_SOURCES_DIST = conf.c connection.c edge.c event.c graph.c \
|
||||||
conf.h connection.c connection.h device.h dropin.c dropin.h \
|
logger.c meta.c net.c net_packet.c net_setup.c net_socket.c \
|
||||||
dummy_device.c edge.c edge.h ethernet.h event.c event.h \
|
netutl.c node.c process.c protocol.c protocol_auth.c \
|
||||||
fake-getaddrinfo.c fake-getaddrinfo.h fake-getnameinfo.c \
|
protocol_edge.c protocol_misc.c protocol_key.c \
|
||||||
fake-getnameinfo.h graph.c graph.h ipv4.h ipv6.h list.c list.h \
|
protocol_subnet.c route.c subnet.c tincd.c dummy_device.c \
|
||||||
logger.c logger.h meta.c meta.h multicast_device.c net.c net.h \
|
raw_socket_device.c multicast_device.c uml_device.c \
|
||||||
net_packet.c net_setup.c net_socket.c netutl.c netutl.h node.c \
|
vde_device.c bsd/tunemu.c
|
||||||
node.h pidfile.c pidfile.h process.c process.h protocol.c \
|
@UML_TRUE@am__objects_1 = uml_device.$(OBJEXT)
|
||||||
protocol.h protocol_auth.c protocol_edge.c protocol_misc.c \
|
@VDE_TRUE@am__objects_2 = vde_device.$(OBJEXT)
|
||||||
protocol_key.c protocol_subnet.c proxy.c proxy.h \
|
@TUNEMU_TRUE@am__objects_3 = tunemu.$(OBJEXT)
|
||||||
raw_socket_device.c route.c route.h subnet.c subnet.h tincd.c \
|
am_tincd_OBJECTS = conf.$(OBJEXT) connection.$(OBJEXT) edge.$(OBJEXT) \
|
||||||
utils.c utils.h xalloc.h getopt.c getopt.h getopt1.c \
|
event.$(OBJEXT) graph.$(OBJEXT) logger.$(OBJEXT) \
|
||||||
linux/device.c bsd/device.c bsd/tunemu.c bsd/tunemu.h \
|
meta.$(OBJEXT) net.$(OBJEXT) net_packet.$(OBJEXT) \
|
||||||
solaris/device.c mingw/device.c mingw/common.h cygwin/device.c \
|
net_setup.$(OBJEXT) net_socket.$(OBJEXT) netutl.$(OBJEXT) \
|
||||||
uml_device.c vde_device.c
|
node.$(OBJEXT) process.$(OBJEXT) protocol.$(OBJEXT) \
|
||||||
@GETOPT_FALSE@am__objects_1 = getopt.$(OBJEXT) getopt1.$(OBJEXT)
|
|
||||||
am__dirstamp = $(am__leading_dot)dirstamp
|
|
||||||
@LINUX_TRUE@am__objects_2 = linux/device.$(OBJEXT)
|
|
||||||
@BSD_TRUE@am__objects_3 = bsd/device.$(OBJEXT)
|
|
||||||
@BSD_TRUE@@TUNEMU_TRUE@am__objects_4 = bsd/tunemu.$(OBJEXT)
|
|
||||||
@SOLARIS_TRUE@am__objects_5 = solaris/device.$(OBJEXT)
|
|
||||||
@MINGW_TRUE@am__objects_6 = mingw/device.$(OBJEXT)
|
|
||||||
@CYGWIN_TRUE@am__objects_7 = cygwin/device.$(OBJEXT)
|
|
||||||
@UML_TRUE@am__objects_8 = uml_device.$(OBJEXT)
|
|
||||||
@VDE_TRUE@am__objects_9 = vde_device.$(OBJEXT)
|
|
||||||
am_tincd_OBJECTS = avl_tree.$(OBJEXT) conf.$(OBJEXT) \
|
|
||||||
connection.$(OBJEXT) dropin.$(OBJEXT) dummy_device.$(OBJEXT) \
|
|
||||||
edge.$(OBJEXT) event.$(OBJEXT) fake-getaddrinfo.$(OBJEXT) \
|
|
||||||
fake-getnameinfo.$(OBJEXT) graph.$(OBJEXT) list.$(OBJEXT) \
|
|
||||||
logger.$(OBJEXT) meta.$(OBJEXT) multicast_device.$(OBJEXT) \
|
|
||||||
net.$(OBJEXT) net_packet.$(OBJEXT) net_setup.$(OBJEXT) \
|
|
||||||
net_socket.$(OBJEXT) netutl.$(OBJEXT) node.$(OBJEXT) \
|
|
||||||
pidfile.$(OBJEXT) process.$(OBJEXT) protocol.$(OBJEXT) \
|
|
||||||
protocol_auth.$(OBJEXT) protocol_edge.$(OBJEXT) \
|
protocol_auth.$(OBJEXT) protocol_edge.$(OBJEXT) \
|
||||||
protocol_misc.$(OBJEXT) protocol_key.$(OBJEXT) \
|
protocol_misc.$(OBJEXT) protocol_key.$(OBJEXT) \
|
||||||
protocol_subnet.$(OBJEXT) proxy.$(OBJEXT) \
|
protocol_subnet.$(OBJEXT) route.$(OBJEXT) subnet.$(OBJEXT) \
|
||||||
raw_socket_device.$(OBJEXT) route.$(OBJEXT) subnet.$(OBJEXT) \
|
tincd.$(OBJEXT) dummy_device.$(OBJEXT) \
|
||||||
tincd.$(OBJEXT) utils.$(OBJEXT) $(am__objects_1) \
|
raw_socket_device.$(OBJEXT) multicast_device.$(OBJEXT) \
|
||||||
$(am__objects_2) $(am__objects_3) $(am__objects_4) \
|
$(am__objects_1) $(am__objects_2) $(am__objects_3)
|
||||||
$(am__objects_5) $(am__objects_6) $(am__objects_7) \
|
nodist_tincd_OBJECTS = device.$(OBJEXT)
|
||||||
$(am__objects_8) $(am__objects_9)
|
tincd_OBJECTS = $(am_tincd_OBJECTS) $(nodist_tincd_OBJECTS)
|
||||||
tincd_OBJECTS = $(am_tincd_OBJECTS)
|
tincd_DEPENDENCIES = $(top_builddir)/lib/libvpn.a
|
||||||
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 =
|
|
||||||
DEFAULT_INCLUDES =
|
|
||||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||||
am__maybe_remake_depfiles = depfiles
|
am__depfiles_maybe = depfiles
|
||||||
am__depfiles_remade = ./$(DEPDIR)/avl_tree.Po ./$(DEPDIR)/conf.Po \
|
|
||||||
./$(DEPDIR)/connection.Po ./$(DEPDIR)/dropin.Po \
|
|
||||||
./$(DEPDIR)/dummy_device.Po ./$(DEPDIR)/edge.Po \
|
|
||||||
./$(DEPDIR)/event.Po ./$(DEPDIR)/fake-getaddrinfo.Po \
|
|
||||||
./$(DEPDIR)/fake-getnameinfo.Po ./$(DEPDIR)/getopt.Po \
|
|
||||||
./$(DEPDIR)/getopt1.Po ./$(DEPDIR)/graph.Po \
|
|
||||||
./$(DEPDIR)/list.Po ./$(DEPDIR)/logger.Po ./$(DEPDIR)/meta.Po \
|
|
||||||
./$(DEPDIR)/multicast_device.Po ./$(DEPDIR)/net.Po \
|
|
||||||
./$(DEPDIR)/net_packet.Po ./$(DEPDIR)/net_setup.Po \
|
|
||||||
./$(DEPDIR)/net_socket.Po ./$(DEPDIR)/netutl.Po \
|
|
||||||
./$(DEPDIR)/node.Po ./$(DEPDIR)/pidfile.Po \
|
|
||||||
./$(DEPDIR)/process.Po ./$(DEPDIR)/protocol.Po \
|
|
||||||
./$(DEPDIR)/protocol_auth.Po ./$(DEPDIR)/protocol_edge.Po \
|
|
||||||
./$(DEPDIR)/protocol_key.Po ./$(DEPDIR)/protocol_misc.Po \
|
|
||||||
./$(DEPDIR)/protocol_subnet.Po ./$(DEPDIR)/proxy.Po \
|
|
||||||
./$(DEPDIR)/raw_socket_device.Po ./$(DEPDIR)/route.Po \
|
|
||||||
./$(DEPDIR)/subnet.Po ./$(DEPDIR)/tincd.Po \
|
|
||||||
./$(DEPDIR)/uml_device.Po ./$(DEPDIR)/utils.Po \
|
|
||||||
./$(DEPDIR)/vde_device.Po bsd/$(DEPDIR)/device.Po \
|
|
||||||
bsd/$(DEPDIR)/tunemu.Po cygwin/$(DEPDIR)/device.Po \
|
|
||||||
linux/$(DEPDIR)/device.Po mingw/$(DEPDIR)/device.Po \
|
|
||||||
solaris/$(DEPDIR)/device.Po
|
|
||||||
am__mv = mv -f
|
am__mv = mv -f
|
||||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
$(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)
|
CCLD = $(CC)
|
||||||
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
|
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||||
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
|
SOURCES = $(tincd_SOURCES) $(nodist_tincd_SOURCES)
|
||||||
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
|
|
||||||
am__v_CCLD_0 = @echo " CCLD " $@;
|
|
||||||
am__v_CCLD_1 =
|
|
||||||
SOURCES = $(tincd_SOURCES)
|
|
||||||
DIST_SOURCES = $(am__tincd_SOURCES_DIST)
|
DIST_SOURCES = $(am__tincd_SOURCES_DIST)
|
||||||
am__can_run_installinfo = \
|
am__can_run_installinfo = \
|
||||||
case $$AM_UPDATE_INFO_DIR in \
|
case $$AM_UPDATE_INFO_DIR in \
|
||||||
n|no|NO) false;; \
|
n|no|NO) false;; \
|
||||||
*) (install-info --version) >/dev/null 2>&1;; \
|
*) (install-info --version) >/dev/null 2>&1;; \
|
||||||
esac
|
esac
|
||||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
|
HEADERS = $(noinst_HEADERS)
|
||||||
# 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
|
ETAGS = etags
|
||||||
CTAGS = ctags
|
CTAGS = ctags
|
||||||
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
|
|
||||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||||
ACLOCAL = @ACLOCAL@
|
ACLOCAL = @ACLOCAL@
|
||||||
|
ALLOCA = @ALLOCA@
|
||||||
AMTAR = @AMTAR@
|
AMTAR = @AMTAR@
|
||||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
|
||||||
AUTOCONF = @AUTOCONF@
|
AUTOCONF = @AUTOCONF@
|
||||||
AUTOHEADER = @AUTOHEADER@
|
AUTOHEADER = @AUTOHEADER@
|
||||||
AUTOMAKE = @AUTOMAKE@
|
AUTOMAKE = @AUTOMAKE@
|
||||||
|
|
@ -263,6 +135,7 @@ ECHO_T = @ECHO_T@
|
||||||
EGREP = @EGREP@
|
EGREP = @EGREP@
|
||||||
EXEEXT = @EXEEXT@
|
EXEEXT = @EXEEXT@
|
||||||
GREP = @GREP@
|
GREP = @GREP@
|
||||||
|
INCLUDES = @INCLUDES@ -I$(top_builddir) -I$(top_srcdir)/lib
|
||||||
INSTALL = @INSTALL@
|
INSTALL = @INSTALL@
|
||||||
INSTALL_DATA = @INSTALL_DATA@
|
INSTALL_DATA = @INSTALL_DATA@
|
||||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||||
|
|
@ -270,8 +143,10 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||||
LDFLAGS = @LDFLAGS@
|
LDFLAGS = @LDFLAGS@
|
||||||
LIBOBJS = @LIBOBJS@
|
LIBOBJS = @LIBOBJS@
|
||||||
LIBS = @LIBS@ $(am__append_10)
|
LIBS = @LIBS@ $(am__append_4)
|
||||||
|
LN_S = @LN_S@
|
||||||
LTLIBOBJS = @LTLIBOBJS@
|
LTLIBOBJS = @LTLIBOBJS@
|
||||||
|
MAINT = @MAINT@
|
||||||
MAKEINFO = @MAKEINFO@
|
MAKEINFO = @MAKEINFO@
|
||||||
MKDIR_P = @MKDIR_P@
|
MKDIR_P = @MKDIR_P@
|
||||||
OBJEXT = @OBJEXT@
|
OBJEXT = @OBJEXT@
|
||||||
|
|
@ -283,6 +158,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||||
PACKAGE_URL = @PACKAGE_URL@
|
PACKAGE_URL = @PACKAGE_URL@
|
||||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||||
|
RANLIB = @RANLIB@
|
||||||
SET_MAKE = @SET_MAKE@
|
SET_MAKE = @SET_MAKE@
|
||||||
SHELL = @SHELL@
|
SHELL = @SHELL@
|
||||||
STRIP = @STRIP@
|
STRIP = @STRIP@
|
||||||
|
|
@ -329,37 +205,36 @@ pdfdir = @pdfdir@
|
||||||
prefix = @prefix@
|
prefix = @prefix@
|
||||||
program_transform_name = @program_transform_name@
|
program_transform_name = @program_transform_name@
|
||||||
psdir = @psdir@
|
psdir = @psdir@
|
||||||
runstatedir = @runstatedir@
|
|
||||||
sbindir = @sbindir@
|
sbindir = @sbindir@
|
||||||
sharedstatedir = @sharedstatedir@
|
sharedstatedir = @sharedstatedir@
|
||||||
srcdir = @srcdir@
|
srcdir = @srcdir@
|
||||||
sysconfdir = @sysconfdir@
|
sysconfdir = @sysconfdir@
|
||||||
systemd_path = @systemd_path@
|
|
||||||
target_alias = @target_alias@
|
target_alias = @target_alias@
|
||||||
top_build_prefix = @top_build_prefix@
|
top_build_prefix = @top_build_prefix@
|
||||||
top_builddir = @top_builddir@
|
top_builddir = @top_builddir@
|
||||||
top_srcdir = @top_srcdir@
|
top_srcdir = @top_srcdir@
|
||||||
tincd_SOURCES = have.h system.h avl_tree.c avl_tree.h conf.c conf.h \
|
EXTRA_DIST = linux/device.c bsd/device.c solaris/device.c cygwin/device.c mingw/device.c mingw/common.h
|
||||||
connection.c connection.h device.h dropin.c dropin.h \
|
tincd_SOURCES = conf.c connection.c edge.c event.c graph.c logger.c \
|
||||||
dummy_device.c edge.c edge.h ethernet.h event.c event.h \
|
meta.c net.c net_packet.c net_setup.c net_socket.c netutl.c \
|
||||||
fake-getaddrinfo.c fake-getaddrinfo.h fake-getnameinfo.c \
|
node.c process.c protocol.c protocol_auth.c protocol_edge.c \
|
||||||
fake-getnameinfo.h graph.c graph.h ipv4.h ipv6.h list.c list.h \
|
protocol_misc.c protocol_key.c protocol_subnet.c route.c \
|
||||||
logger.c logger.h meta.c meta.h multicast_device.c net.c net.h \
|
subnet.c tincd.c dummy_device.c raw_socket_device.c \
|
||||||
net_packet.c net_setup.c net_socket.c netutl.c netutl.h node.c \
|
multicast_device.c $(am__append_1) $(am__append_2) \
|
||||||
node.h pidfile.c pidfile.h process.c process.h protocol.c \
|
$(am__append_3)
|
||||||
protocol.h protocol_auth.c protocol_edge.c protocol_misc.c \
|
nodist_tincd_SOURCES = device.c
|
||||||
protocol_key.c protocol_subnet.c proxy.c proxy.h \
|
DEFAULT_INCLUDES =
|
||||||
raw_socket_device.c route.c route.h subnet.c subnet.h tincd.c \
|
noinst_HEADERS = conf.h connection.h device.h edge.h event.h graph.h logger.h meta.h net.h netutl.h node.h process.h \
|
||||||
utils.c utils.h xalloc.h $(am__append_1) $(am__append_2) \
|
protocol.h route.h subnet.h bsd/tunemu.h
|
||||||
$(am__append_3) $(am__append_4) $(am__append_5) \
|
|
||||||
$(am__append_6) $(am__append_7) $(am__append_8) \
|
tincd_LDADD = \
|
||||||
$(am__append_9)
|
$(top_builddir)/lib/libvpn.a
|
||||||
AM_CPPFLAGS = -DCONFDIR=\"$(sysconfdir)\" -DRUNSTATEDIR=\"$(runstatedir)\" -DLOCALSTATEDIR=\"$(localstatedir)\" -I $(abs_top_builddir)/
|
|
||||||
|
AM_CFLAGS = -DCONFDIR=\"$(sysconfdir)\" -DLOCALSTATEDIR=\"$(localstatedir)\"
|
||||||
all: all-am
|
all: all-am
|
||||||
|
|
||||||
.SUFFIXES:
|
.SUFFIXES:
|
||||||
.SUFFIXES: .c .o .obj
|
.SUFFIXES: .c .o .obj
|
||||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
|
||||||
@for dep in $?; do \
|
@for dep in $?; do \
|
||||||
case '$(am__configure_deps)' in \
|
case '$(am__configure_deps)' in \
|
||||||
*$$dep*) \
|
*$$dep*) \
|
||||||
|
|
@ -371,21 +246,22 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \
|
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \
|
||||||
$(am__cd) $(top_srcdir) && \
|
$(am__cd) $(top_srcdir) && \
|
||||||
$(AUTOMAKE) --gnu src/Makefile
|
$(AUTOMAKE) --gnu src/Makefile
|
||||||
|
.PRECIOUS: Makefile
|
||||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||||
@case '$?' in \
|
@case '$?' in \
|
||||||
*config.status*) \
|
*config.status*) \
|
||||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||||
*) \
|
*) \
|
||||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
|
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
|
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||||
esac;
|
esac;
|
||||||
|
|
||||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||||
|
|
||||||
$(top_srcdir)/configure: $(am__configure_deps)
|
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||||
$(am__aclocal_m4_deps):
|
$(am__aclocal_m4_deps):
|
||||||
install-sbinPROGRAMS: $(sbin_PROGRAMS)
|
install-sbinPROGRAMS: $(sbin_PROGRAMS)
|
||||||
|
|
@ -397,11 +273,10 @@ install-sbinPROGRAMS: $(sbin_PROGRAMS)
|
||||||
fi; \
|
fi; \
|
||||||
for p in $$list; do echo "$$p $$p"; done | \
|
for p in $$list; do echo "$$p $$p"; done | \
|
||||||
sed 's/$(EXEEXT)$$//' | \
|
sed 's/$(EXEEXT)$$//' | \
|
||||||
while read p p1; do if test -f $$p \
|
while read p p1; do if test -f $$p; \
|
||||||
; then echo "$$p"; echo "$$p"; else :; fi; \
|
then echo "$$p"; echo "$$p"; else :; fi; \
|
||||||
done | \
|
done | \
|
||||||
sed -e 'p;s,.*/,,;n;h' \
|
sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
|
||||||
-e 's|.*|.|' \
|
|
||||||
-e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
|
-e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
|
||||||
sed 'N;N;N;s,\n, ,g' | \
|
sed 'N;N;N;s,\n, ,g' | \
|
||||||
$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
|
$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
|
||||||
|
|
@ -422,164 +297,102 @@ uninstall-sbinPROGRAMS:
|
||||||
@list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
|
@list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
|
||||||
files=`for p in $$list; do echo "$$p"; done | \
|
files=`for p in $$list; do echo "$$p"; done | \
|
||||||
sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
|
sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
|
||||||
-e 's/$$/$(EXEEXT)/' \
|
-e 's/$$/$(EXEEXT)/' `; \
|
||||||
`; \
|
|
||||||
test -n "$$list" || exit 0; \
|
test -n "$$list" || exit 0; \
|
||||||
echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \
|
echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \
|
||||||
cd "$(DESTDIR)$(sbindir)" && rm -f $$files
|
cd "$(DESTDIR)$(sbindir)" && rm -f $$files
|
||||||
|
|
||||||
clean-sbinPROGRAMS:
|
clean-sbinPROGRAMS:
|
||||||
-test -z "$(sbin_PROGRAMS)" || rm -f $(sbin_PROGRAMS)
|
-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
|
|
||||||
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)
|
tincd$(EXEEXT): $(tincd_OBJECTS) $(tincd_DEPENDENCIES) $(EXTRA_tincd_DEPENDENCIES)
|
||||||
@rm -f tincd$(EXEEXT)
|
@rm -f tincd$(EXEEXT)
|
||||||
$(AM_V_CCLD)$(LINK) $(tincd_OBJECTS) $(tincd_LDADD) $(LIBS)
|
$(LINK) $(tincd_OBJECTS) $(tincd_LDADD) $(LIBS)
|
||||||
|
|
||||||
mostlyclean-compile:
|
mostlyclean-compile:
|
||||||
-rm -f *.$(OBJEXT)
|
-rm -f *.$(OBJEXT)
|
||||||
-rm -f bsd/*.$(OBJEXT)
|
|
||||||
-rm -f cygwin/*.$(OBJEXT)
|
|
||||||
-rm -f linux/*.$(OBJEXT)
|
|
||||||
-rm -f mingw/*.$(OBJEXT)
|
|
||||||
-rm -f solaris/*.$(OBJEXT)
|
|
||||||
|
|
||||||
distclean-compile:
|
distclean-compile:
|
||||||
-rm -f *.tab.c
|
-rm -f *.tab.c
|
||||||
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/avl_tree.Po@am__quote@ # am--include-marker
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conf.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conf.Po@am__quote@ # am--include-marker
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connection.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connection.Po@am__quote@ # am--include-marker
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/device.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dropin.Po@am__quote@ # am--include-marker
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dummy_device.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dummy_device.Po@am__quote@ # am--include-marker
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/edge.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/edge.Po@am__quote@ # am--include-marker
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/event.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/event.Po@am__quote@ # am--include-marker
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/graph.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fake-getaddrinfo.Po@am__quote@ # am--include-marker
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/logger.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fake-getnameinfo.Po@am__quote@ # am--include-marker
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/meta.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@ # am--include-marker
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/multicast_device.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt1.Po@am__quote@ # am--include-marker
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/graph.Po@am__quote@ # am--include-marker
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net_packet.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list.Po@am__quote@ # am--include-marker
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net_setup.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/logger.Po@am__quote@ # am--include-marker
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net_socket.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/meta.Po@am__quote@ # am--include-marker
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netutl.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/multicast_device.Po@am__quote@ # am--include-marker
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/node.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net.Po@am__quote@ # am--include-marker
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/process.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net_packet.Po@am__quote@ # am--include-marker
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net_setup.Po@am__quote@ # am--include-marker
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol_auth.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net_socket.Po@am__quote@ # am--include-marker
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol_edge.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netutl.Po@am__quote@ # am--include-marker
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol_key.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/node.Po@am__quote@ # am--include-marker
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol_misc.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pidfile.Po@am__quote@ # am--include-marker
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol_subnet.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/process.Po@am__quote@ # am--include-marker
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raw_socket_device.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol.Po@am__quote@ # am--include-marker
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/route.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol_auth.Po@am__quote@ # am--include-marker
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/subnet.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol_edge.Po@am__quote@ # am--include-marker
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tincd.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol_key.Po@am__quote@ # am--include-marker
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tunemu.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol_misc.Po@am__quote@ # am--include-marker
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uml_device.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol_subnet.Po@am__quote@ # am--include-marker
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vde_device.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proxy.Po@am__quote@ # am--include-marker
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raw_socket_device.Po@am__quote@ # am--include-marker
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/route.Po@am__quote@ # am--include-marker
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/subnet.Po@am__quote@ # am--include-marker
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tincd.Po@am__quote@ # am--include-marker
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uml_device.Po@am__quote@ # am--include-marker
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utils.Po@am__quote@ # am--include-marker
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vde_device.Po@am__quote@ # am--include-marker
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@bsd/$(DEPDIR)/device.Po@am__quote@ # am--include-marker
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@bsd/$(DEPDIR)/tunemu.Po@am__quote@ # am--include-marker
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@cygwin/$(DEPDIR)/device.Po@am__quote@ # am--include-marker
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@linux/$(DEPDIR)/device.Po@am__quote@ # am--include-marker
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@mingw/$(DEPDIR)/device.Po@am__quote@ # am--include-marker
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@solaris/$(DEPDIR)/device.Po@am__quote@ # am--include-marker
|
|
||||||
|
|
||||||
$(am__depfiles_remade):
|
|
||||||
@$(MKDIR_P) $(@D)
|
|
||||||
@echo '# dummy' >$@-t && $(am__mv) $@-t $@
|
|
||||||
|
|
||||||
am--depfiles: $(am__depfiles_remade)
|
|
||||||
|
|
||||||
.c.o:
|
.c.o:
|
||||||
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
|
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||||
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
|
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||||
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
|
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
|
||||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
|
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
|
||||||
|
|
||||||
.c.obj:
|
.c.obj:
|
||||||
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
|
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
|
||||||
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
|
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||||
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
|
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
|
||||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
|
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
|
||||||
|
|
||||||
ID: $(am__tagged_files)
|
tunemu.o: bsd/tunemu.c
|
||||||
$(am__define_uniq_tagged_files); mkid -fID $$unique
|
@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
|
||||||
tags: tags-am
|
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tunemu.Tpo $(DEPDIR)/tunemu.Po
|
||||||
TAGS: tags
|
@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
|
||||||
|
|
||||||
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
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)
|
||||||
set x; \
|
set x; \
|
||||||
here=`pwd`; \
|
here=`pwd`; \
|
||||||
$(am__define_uniq_tagged_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; }; }'`; \
|
||||||
shift; \
|
shift; \
|
||||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||||
test -n "$$unique" || unique=$$empty_fix; \
|
test -n "$$unique" || unique=$$empty_fix; \
|
||||||
|
|
@ -591,11 +404,15 @@ tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||||
$$unique; \
|
$$unique; \
|
||||||
fi; \
|
fi; \
|
||||||
fi
|
fi
|
||||||
ctags: ctags-am
|
ctags: CTAGS
|
||||||
|
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||||
CTAGS: ctags
|
$(TAGS_FILES) $(LISP)
|
||||||
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||||
$(am__define_uniq_tagged_files); \
|
unique=`for i in $$list; do \
|
||||||
|
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||||
|
done | \
|
||||||
|
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||||
|
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||||
test -z "$(CTAGS_ARGS)$$unique" \
|
test -z "$(CTAGS_ARGS)$$unique" \
|
||||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||||
$$unique
|
$$unique
|
||||||
|
|
@ -604,29 +421,11 @@ GTAGS:
|
||||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||||
&& $(am__cd) $(top_srcdir) \
|
&& $(am__cd) $(top_srcdir) \
|
||||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
&& 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:
|
distclean-tags:
|
||||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||||
|
|
||||||
distdir: $(BUILT_SOURCES)
|
distdir: $(DISTFILES)
|
||||||
$(MAKE) $(AM_MAKEFLAGS) distdir-am
|
|
||||||
|
|
||||||
distdir-am: $(DISTFILES)
|
|
||||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||||
list='$(DISTFILES)'; \
|
list='$(DISTFILES)'; \
|
||||||
|
|
@ -656,9 +455,12 @@ distdir-am: $(DISTFILES)
|
||||||
|| exit 1; \
|
|| exit 1; \
|
||||||
fi; \
|
fi; \
|
||||||
done
|
done
|
||||||
|
$(MAKE) $(AM_MAKEFLAGS) \
|
||||||
|
top_distdir="$(top_distdir)" distdir="$(distdir)" \
|
||||||
|
dist-hook
|
||||||
check-am: all-am
|
check-am: all-am
|
||||||
check: check-am
|
check: check-am
|
||||||
all-am: Makefile $(PROGRAMS)
|
all-am: Makefile $(PROGRAMS) $(HEADERS)
|
||||||
installdirs:
|
installdirs:
|
||||||
for dir in "$(DESTDIR)$(sbindir)"; do \
|
for dir in "$(DESTDIR)$(sbindir)"; do \
|
||||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||||
|
|
@ -689,16 +491,6 @@ clean-generic:
|
||||||
distclean-generic:
|
distclean-generic:
|
||||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 linux/$(DEPDIR)/$(am__dirstamp)
|
|
||||||
-rm -f linux/$(am__dirstamp)
|
|
||||||
-rm -f mingw/$(DEPDIR)/$(am__dirstamp)
|
|
||||||
-rm -f mingw/$(am__dirstamp)
|
|
||||||
-rm -f solaris/$(DEPDIR)/$(am__dirstamp)
|
|
||||||
-rm -f solaris/$(am__dirstamp)
|
|
||||||
|
|
||||||
maintainer-clean-generic:
|
maintainer-clean-generic:
|
||||||
@echo "This command is intended for maintainers to use"
|
@echo "This command is intended for maintainers to use"
|
||||||
|
|
@ -708,50 +500,7 @@ clean: clean-am
|
||||||
clean-am: clean-generic clean-sbinPROGRAMS mostlyclean-am
|
clean-am: clean-generic clean-sbinPROGRAMS mostlyclean-am
|
||||||
|
|
||||||
distclean: distclean-am
|
distclean: distclean-am
|
||||||
-rm -f ./$(DEPDIR)/avl_tree.Po
|
-rm -rf ./$(DEPDIR)
|
||||||
-rm -f ./$(DEPDIR)/conf.Po
|
|
||||||
-rm -f ./$(DEPDIR)/connection.Po
|
|
||||||
-rm -f ./$(DEPDIR)/dropin.Po
|
|
||||||
-rm -f ./$(DEPDIR)/dummy_device.Po
|
|
||||||
-rm -f ./$(DEPDIR)/edge.Po
|
|
||||||
-rm -f ./$(DEPDIR)/event.Po
|
|
||||||
-rm -f ./$(DEPDIR)/fake-getaddrinfo.Po
|
|
||||||
-rm -f ./$(DEPDIR)/fake-getnameinfo.Po
|
|
||||||
-rm -f ./$(DEPDIR)/getopt.Po
|
|
||||||
-rm -f ./$(DEPDIR)/getopt1.Po
|
|
||||||
-rm -f ./$(DEPDIR)/graph.Po
|
|
||||||
-rm -f ./$(DEPDIR)/list.Po
|
|
||||||
-rm -f ./$(DEPDIR)/logger.Po
|
|
||||||
-rm -f ./$(DEPDIR)/meta.Po
|
|
||||||
-rm -f ./$(DEPDIR)/multicast_device.Po
|
|
||||||
-rm -f ./$(DEPDIR)/net.Po
|
|
||||||
-rm -f ./$(DEPDIR)/net_packet.Po
|
|
||||||
-rm -f ./$(DEPDIR)/net_setup.Po
|
|
||||||
-rm -f ./$(DEPDIR)/net_socket.Po
|
|
||||||
-rm -f ./$(DEPDIR)/netutl.Po
|
|
||||||
-rm -f ./$(DEPDIR)/node.Po
|
|
||||||
-rm -f ./$(DEPDIR)/pidfile.Po
|
|
||||||
-rm -f ./$(DEPDIR)/process.Po
|
|
||||||
-rm -f ./$(DEPDIR)/protocol.Po
|
|
||||||
-rm -f ./$(DEPDIR)/protocol_auth.Po
|
|
||||||
-rm -f ./$(DEPDIR)/protocol_edge.Po
|
|
||||||
-rm -f ./$(DEPDIR)/protocol_key.Po
|
|
||||||
-rm -f ./$(DEPDIR)/protocol_misc.Po
|
|
||||||
-rm -f ./$(DEPDIR)/protocol_subnet.Po
|
|
||||||
-rm -f ./$(DEPDIR)/proxy.Po
|
|
||||||
-rm -f ./$(DEPDIR)/raw_socket_device.Po
|
|
||||||
-rm -f ./$(DEPDIR)/route.Po
|
|
||||||
-rm -f ./$(DEPDIR)/subnet.Po
|
|
||||||
-rm -f ./$(DEPDIR)/tincd.Po
|
|
||||||
-rm -f ./$(DEPDIR)/uml_device.Po
|
|
||||||
-rm -f ./$(DEPDIR)/utils.Po
|
|
||||||
-rm -f ./$(DEPDIR)/vde_device.Po
|
|
||||||
-rm -f bsd/$(DEPDIR)/device.Po
|
|
||||||
-rm -f bsd/$(DEPDIR)/tunemu.Po
|
|
||||||
-rm -f cygwin/$(DEPDIR)/device.Po
|
|
||||||
-rm -f linux/$(DEPDIR)/device.Po
|
|
||||||
-rm -f mingw/$(DEPDIR)/device.Po
|
|
||||||
-rm -f solaris/$(DEPDIR)/device.Po
|
|
||||||
-rm -f Makefile
|
-rm -f Makefile
|
||||||
distclean-am: clean-am distclean-compile distclean-generic \
|
distclean-am: clean-am distclean-compile distclean-generic \
|
||||||
distclean-tags
|
distclean-tags
|
||||||
|
|
@ -794,53 +543,10 @@ install-ps: install-ps-am
|
||||||
|
|
||||||
install-ps-am:
|
install-ps-am:
|
||||||
|
|
||||||
installcheck-am: installcheck-sbinPROGRAMS
|
installcheck-am:
|
||||||
|
|
||||||
maintainer-clean: maintainer-clean-am
|
maintainer-clean: maintainer-clean-am
|
||||||
-rm -f ./$(DEPDIR)/avl_tree.Po
|
-rm -rf ./$(DEPDIR)
|
||||||
-rm -f ./$(DEPDIR)/conf.Po
|
|
||||||
-rm -f ./$(DEPDIR)/connection.Po
|
|
||||||
-rm -f ./$(DEPDIR)/dropin.Po
|
|
||||||
-rm -f ./$(DEPDIR)/dummy_device.Po
|
|
||||||
-rm -f ./$(DEPDIR)/edge.Po
|
|
||||||
-rm -f ./$(DEPDIR)/event.Po
|
|
||||||
-rm -f ./$(DEPDIR)/fake-getaddrinfo.Po
|
|
||||||
-rm -f ./$(DEPDIR)/fake-getnameinfo.Po
|
|
||||||
-rm -f ./$(DEPDIR)/getopt.Po
|
|
||||||
-rm -f ./$(DEPDIR)/getopt1.Po
|
|
||||||
-rm -f ./$(DEPDIR)/graph.Po
|
|
||||||
-rm -f ./$(DEPDIR)/list.Po
|
|
||||||
-rm -f ./$(DEPDIR)/logger.Po
|
|
||||||
-rm -f ./$(DEPDIR)/meta.Po
|
|
||||||
-rm -f ./$(DEPDIR)/multicast_device.Po
|
|
||||||
-rm -f ./$(DEPDIR)/net.Po
|
|
||||||
-rm -f ./$(DEPDIR)/net_packet.Po
|
|
||||||
-rm -f ./$(DEPDIR)/net_setup.Po
|
|
||||||
-rm -f ./$(DEPDIR)/net_socket.Po
|
|
||||||
-rm -f ./$(DEPDIR)/netutl.Po
|
|
||||||
-rm -f ./$(DEPDIR)/node.Po
|
|
||||||
-rm -f ./$(DEPDIR)/pidfile.Po
|
|
||||||
-rm -f ./$(DEPDIR)/process.Po
|
|
||||||
-rm -f ./$(DEPDIR)/protocol.Po
|
|
||||||
-rm -f ./$(DEPDIR)/protocol_auth.Po
|
|
||||||
-rm -f ./$(DEPDIR)/protocol_edge.Po
|
|
||||||
-rm -f ./$(DEPDIR)/protocol_key.Po
|
|
||||||
-rm -f ./$(DEPDIR)/protocol_misc.Po
|
|
||||||
-rm -f ./$(DEPDIR)/protocol_subnet.Po
|
|
||||||
-rm -f ./$(DEPDIR)/proxy.Po
|
|
||||||
-rm -f ./$(DEPDIR)/raw_socket_device.Po
|
|
||||||
-rm -f ./$(DEPDIR)/route.Po
|
|
||||||
-rm -f ./$(DEPDIR)/subnet.Po
|
|
||||||
-rm -f ./$(DEPDIR)/tincd.Po
|
|
||||||
-rm -f ./$(DEPDIR)/uml_device.Po
|
|
||||||
-rm -f ./$(DEPDIR)/utils.Po
|
|
||||||
-rm -f ./$(DEPDIR)/vde_device.Po
|
|
||||||
-rm -f bsd/$(DEPDIR)/device.Po
|
|
||||||
-rm -f bsd/$(DEPDIR)/tunemu.Po
|
|
||||||
-rm -f cygwin/$(DEPDIR)/device.Po
|
|
||||||
-rm -f linux/$(DEPDIR)/device.Po
|
|
||||||
-rm -f mingw/$(DEPDIR)/device.Po
|
|
||||||
-rm -f solaris/$(DEPDIR)/device.Po
|
|
||||||
-rm -f Makefile
|
-rm -f Makefile
|
||||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||||
|
|
||||||
|
|
@ -860,22 +566,22 @@ uninstall-am: uninstall-sbinPROGRAMS
|
||||||
|
|
||||||
.MAKE: install-am install-strip
|
.MAKE: install-am install-strip
|
||||||
|
|
||||||
.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
|
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
|
||||||
clean-generic clean-sbinPROGRAMS cscopelist-am ctags ctags-am \
|
clean-sbinPROGRAMS ctags dist-hook distclean distclean-compile \
|
||||||
distclean distclean-compile distclean-generic distclean-tags \
|
distclean-generic distclean-tags distdir dvi dvi-am html \
|
||||||
distdir dvi dvi-am html html-am info info-am install \
|
html-am info info-am install install-am install-data \
|
||||||
install-am install-data install-data-am install-dvi \
|
install-data-am install-dvi install-dvi-am install-exec \
|
||||||
install-dvi-am install-exec install-exec-am install-html \
|
install-exec-am install-html install-html-am install-info \
|
||||||
install-html-am install-info install-info-am install-man \
|
install-info-am install-man install-pdf install-pdf-am \
|
||||||
install-pdf install-pdf-am install-ps install-ps-am \
|
install-ps install-ps-am install-sbinPROGRAMS install-strip \
|
||||||
install-sbinPROGRAMS install-strip installcheck \
|
installcheck installcheck-am installdirs maintainer-clean \
|
||||||
installcheck-am installcheck-sbinPROGRAMS installdirs \
|
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
||||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
|
||||||
mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
|
uninstall-am uninstall-sbinPROGRAMS
|
||||||
tags tags-am uninstall uninstall-am uninstall-sbinPROGRAMS
|
|
||||||
|
|
||||||
.PRECIOUS: Makefile
|
|
||||||
|
|
||||||
|
dist-hook:
|
||||||
|
rm -f `find . -type l`
|
||||||
|
|
||||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||||
|
|
|
||||||
276
src/bsd/device.c
276
src/bsd/device.c
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
device.c -- Interaction BSD tun/tap device
|
device.c -- Interaction BSD tun/tap device
|
||||||
Copyright (C) 2001-2005 Ivo Timmermans,
|
Copyright (C) 2001-2005 Ivo Timmermans,
|
||||||
2001-2016 Guus Sliepen <guus@tinc-vpn.org>
|
2001-2012 Guus Sliepen <guus@tinc-vpn.org>
|
||||||
2009 Grzegorz Dymarek <gregd72002@googlemail.com>
|
2009 Grzegorz Dymarek <gregd72002@googlemail.com>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
|
@ -19,46 +19,38 @@
|
||||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../system.h"
|
#include "system.h"
|
||||||
|
|
||||||
#include "../conf.h"
|
#include "conf.h"
|
||||||
#include "../device.h"
|
#include "device.h"
|
||||||
#include "../logger.h"
|
#include "logger.h"
|
||||||
#include "../net.h"
|
#include "net.h"
|
||||||
#include "../route.h"
|
#include "route.h"
|
||||||
#include "../utils.h"
|
#include "utils.h"
|
||||||
#include "../xalloc.h"
|
#include "xalloc.h"
|
||||||
|
|
||||||
#ifdef ENABLE_TUNEMU
|
#ifdef HAVE_TUNEMU
|
||||||
#include "tunemu.h"
|
#include "bsd/tunemu.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_NET_IF_UTUN_H
|
#define DEFAULT_DEVICE "/dev/tun0"
|
||||||
#include <sys/sys_domain.h>
|
|
||||||
#include <sys/kern_control.h>
|
|
||||||
#include <net/if_utun.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define DEFAULT_TUN_DEVICE "/dev/tun0"
|
|
||||||
#define DEFAULT_TAP_DEVICE "/dev/tap0"
|
|
||||||
|
|
||||||
typedef enum device_type {
|
typedef enum device_type {
|
||||||
DEVICE_TYPE_TUN,
|
DEVICE_TYPE_TUN,
|
||||||
DEVICE_TYPE_TUNIFHEAD,
|
DEVICE_TYPE_TUNIFHEAD,
|
||||||
DEVICE_TYPE_TAP,
|
DEVICE_TYPE_TAP,
|
||||||
#ifdef ENABLE_TUNEMU
|
#ifdef HAVE_TUNEMU
|
||||||
DEVICE_TYPE_TUNEMU,
|
DEVICE_TYPE_TUNEMU,
|
||||||
#endif
|
#endif
|
||||||
DEVICE_TYPE_UTUN,
|
|
||||||
} device_type_t;
|
} device_type_t;
|
||||||
|
|
||||||
int device_fd = -1;
|
int device_fd = -1;
|
||||||
char *device = NULL;
|
char *device = NULL;
|
||||||
char *iface = NULL;
|
char *iface = NULL;
|
||||||
static const char *device_info = "OS X utun device";
|
static char *device_info = NULL;
|
||||||
static uint64_t device_total_in = 0;
|
static uint64_t device_total_in = 0;
|
||||||
static uint64_t device_total_out = 0;
|
static uint64_t device_total_out = 0;
|
||||||
#if defined(ENABLE_TUNEMU)
|
#if defined(TUNEMU)
|
||||||
static device_type_t device_type = DEVICE_TYPE_TUNEMU;
|
static device_type_t device_type = DEVICE_TYPE_TUNEMU;
|
||||||
#elif defined(HAVE_OPENBSD) || defined(HAVE_FREEBSD) || defined(HAVE_DRAGONFLY)
|
#elif defined(HAVE_OPENBSD) || defined(HAVE_FREEBSD) || defined(HAVE_DRAGONFLY)
|
||||||
static device_type_t device_type = DEVICE_TYPE_TUNIFHEAD;
|
static device_type_t device_type = DEVICE_TYPE_TUNIFHEAD;
|
||||||
|
|
@ -66,138 +58,45 @@ static device_type_t device_type = DEVICE_TYPE_TUNIFHEAD;
|
||||||
static device_type_t device_type = DEVICE_TYPE_TUN;
|
static device_type_t device_type = DEVICE_TYPE_TUN;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_NET_IF_UTUN_H
|
|
||||||
static bool setup_utun(void) {
|
|
||||||
device_fd = socket(PF_SYSTEM, SOCK_DGRAM, SYSPROTO_CONTROL);
|
|
||||||
|
|
||||||
if(device_fd == -1) {
|
|
||||||
logger(LOG_ERR, "Could not open PF_SYSTEM socket: %s\n", strerror(errno));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
struct ctl_info info = {};
|
|
||||||
|
|
||||||
strlcpy(info.ctl_name, UTUN_CONTROL_NAME, sizeof(info.ctl_name));
|
|
||||||
|
|
||||||
if(ioctl(device_fd, CTLIOCGINFO, &info) == -1) {
|
|
||||||
logger(LOG_ERR, "ioctl(CTLIOCGINFO) failed: %s", strerror(errno));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
int unit = -1;
|
|
||||||
char *p = strstr(device, "utun"), *e = NULL;
|
|
||||||
|
|
||||||
if(p) {
|
|
||||||
unit = strtol(p + 4, &e, 10);
|
|
||||||
|
|
||||||
if(!e) {
|
|
||||||
unit = -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
struct sockaddr_ctl sc = {
|
|
||||||
.sc_id = info.ctl_id,
|
|
||||||
.sc_len = sizeof(sc),
|
|
||||||
.sc_family = AF_SYSTEM,
|
|
||||||
.ss_sysaddr = AF_SYS_CONTROL,
|
|
||||||
.sc_unit = unit + 1,
|
|
||||||
};
|
|
||||||
|
|
||||||
if(connect(device_fd, (struct sockaddr *)&sc, sizeof(sc)) == -1) {
|
|
||||||
logger(LOG_ERR, "Could not connect utun socket: %s\n", strerror(errno));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
char name[64] = "";
|
|
||||||
socklen_t len = sizeof(name);
|
|
||||||
|
|
||||||
if(getsockopt(device_fd, SYSPROTO_CONTROL, UTUN_OPT_IFNAME, name, &len)) {
|
|
||||||
iface = xstrdup(device);
|
|
||||||
} else {
|
|
||||||
iface = xstrdup(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
logger(LOG_INFO, "%s is a %s", device, device_info);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static bool setup_device(void) {
|
static bool setup_device(void) {
|
||||||
// Find out which device file to open
|
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Find out if it's supposed to be a tun or a tap device
|
|
||||||
|
|
||||||
char *type;
|
char *type;
|
||||||
|
|
||||||
|
if(!get_config_string(lookup_config(config_tree, "Device"), &device))
|
||||||
|
device = xstrdup(DEFAULT_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(get_config_string(lookup_config(config_tree, "DeviceType"), &type)) {
|
||||||
if(!strcasecmp(type, "tun"))
|
if(!strcasecmp(type, "tun"))
|
||||||
/* use default */;
|
/* use default */;
|
||||||
|
#ifdef HAVE_TUNEMU
|
||||||
#ifdef ENABLE_TUNEMU
|
else if(!strcasecmp(type, "tunemu"))
|
||||||
else if(!strcasecmp(type, "tunemu")) {
|
|
||||||
device_type = DEVICE_TYPE_TUNEMU;
|
device_type = DEVICE_TYPE_TUNEMU;
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_NET_IF_UTUN_H
|
else if(!strcasecmp(type, "tunnohead"))
|
||||||
else if(!strcasecmp(type, "utun")) {
|
|
||||||
device_type = DEVICE_TYPE_UTUN;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
else if(!strcasecmp(type, "tunnohead")) {
|
|
||||||
device_type = DEVICE_TYPE_TUN;
|
device_type = DEVICE_TYPE_TUN;
|
||||||
} else if(!strcasecmp(type, "tunifhead")) {
|
else if(!strcasecmp(type, "tunifhead"))
|
||||||
device_type = DEVICE_TYPE_TUNIFHEAD;
|
device_type = DEVICE_TYPE_TUNIFHEAD;
|
||||||
} else if(!strcasecmp(type, "tap")) {
|
else if(!strcasecmp(type, "tap"))
|
||||||
device_type = DEVICE_TYPE_TAP;
|
device_type = DEVICE_TYPE_TAP;
|
||||||
} else {
|
else {
|
||||||
logger(LOG_ERR, "Unknown device type %s!", type);
|
logger(LOG_ERR, "Unknown device type %s!", type);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
#ifdef HAVE_NET_IF_UTUN_H
|
if(strstr(device, "tap") || routing_mode != RMODE_ROUTER)
|
||||||
|
|
||||||
if(strncmp(device, "utun", 4) == 0 || strncmp(device, "/dev/utun", 9) == 0) {
|
|
||||||
device_type = DEVICE_TYPE_UTUN;
|
|
||||||
} else
|
|
||||||
#endif
|
|
||||||
if(strstr(device, "tap") || routing_mode != RMODE_ROUTER) {
|
|
||||||
device_type = DEVICE_TYPE_TAP;
|
device_type = DEVICE_TYPE_TAP;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(routing_mode == RMODE_SWITCH && device_type != DEVICE_TYPE_TAP) {
|
|
||||||
logger(LOG_ERR, "Only tap devices support switch mode!");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Open the device
|
|
||||||
|
|
||||||
switch(device_type) {
|
switch(device_type) {
|
||||||
#ifdef ENABLE_TUNEMU
|
#ifdef HAVE_TUNEMU
|
||||||
|
|
||||||
case DEVICE_TYPE_TUNEMU: {
|
case DEVICE_TYPE_TUNEMU: {
|
||||||
char dynamic_name[256] = "";
|
char dynamic_name[256] = "";
|
||||||
device_fd = tunemu_open(dynamic_name);
|
device_fd = tunemu_open(dynamic_name);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_NET_IF_UTUN_H
|
|
||||||
|
|
||||||
case DEVICE_TYPE_UTUN:
|
|
||||||
return setup_utun();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
device_fd = open(device, O_RDWR | O_NONBLOCK);
|
device_fd = open(device, O_RDWR | O_NONBLOCK);
|
||||||
}
|
}
|
||||||
|
|
@ -211,118 +110,70 @@ static bool setup_device(void) {
|
||||||
fcntl(device_fd, F_SETFD, FD_CLOEXEC);
|
fcntl(device_fd, F_SETFD, FD_CLOEXEC);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Guess what the corresponding interface is called
|
|
||||||
|
|
||||||
char *realname = NULL;
|
|
||||||
|
|
||||||
#if defined(HAVE_FDEVNAME)
|
|
||||||
realname = fdevname(device_fd);
|
|
||||||
#elif defined(HAVE_DEVNAME)
|
|
||||||
struct stat buf;
|
|
||||||
|
|
||||||
if(!fstat(device_fd, &buf)) {
|
|
||||||
realname = devname(buf.st_rdev, S_IFCHR);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if(!realname) {
|
|
||||||
realname = device;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!get_config_string(lookup_config(config_tree, "Interface"), &iface)) {
|
|
||||||
iface = xstrdup(strrchr(realname, '/') ? strrchr(realname, '/') + 1 : realname);
|
|
||||||
} else if(strcmp(iface, strrchr(realname, '/') ? strrchr(realname, '/') + 1 : realname)) {
|
|
||||||
logger(LOG_WARNING, "Warning: Interface does not match Device. $INTERFACE might be set incorrectly.");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Configure the device as best as we can
|
|
||||||
|
|
||||||
switch(device_type) {
|
switch(device_type) {
|
||||||
default:
|
default:
|
||||||
device_type = DEVICE_TYPE_TUN;
|
device_type = DEVICE_TYPE_TUN;
|
||||||
|
|
||||||
case DEVICE_TYPE_TUN:
|
case DEVICE_TYPE_TUN:
|
||||||
#ifdef TUNSIFHEAD
|
#ifdef TUNSIFHEAD
|
||||||
{
|
{
|
||||||
const int zero = 0;
|
const int zero = 0;
|
||||||
|
if(ioctl(device_fd, TUNSIFHEAD, &zero, sizeof zero) == -1) {
|
||||||
if(ioctl(device_fd, TUNSIFHEAD, &zero, sizeof(zero)) == -1) {
|
|
||||||
logger(LOG_ERR, "System call `%s' failed: %s", "ioctl", strerror(errno));
|
logger(LOG_ERR, "System call `%s' failed: %s", "ioctl", strerror(errno));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#if defined(TUNSIFMODE) && defined(IFF_BROADCAST) && defined(IFF_MULTICAST)
|
#if defined(TUNSIFMODE) && defined(IFF_BROADCAST) && defined(IFF_MULTICAST)
|
||||||
{
|
{
|
||||||
const int mode = IFF_BROADCAST | IFF_MULTICAST;
|
const int mode = IFF_BROADCAST | IFF_MULTICAST;
|
||||||
ioctl(device_fd, TUNSIFMODE, &mode, sizeof(mode));
|
ioctl(device_fd, TUNSIFMODE, &mode, sizeof mode);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
device_info = "Generic BSD tun device";
|
device_info = "Generic BSD tun device";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DEVICE_TYPE_TUNIFHEAD:
|
case DEVICE_TYPE_TUNIFHEAD:
|
||||||
#ifdef TUNSIFHEAD
|
#ifdef TUNSIFHEAD
|
||||||
{
|
{
|
||||||
const int one = 1;
|
const int one = 1;
|
||||||
|
if(ioctl(device_fd, TUNSIFHEAD, &one, sizeof one) == -1) {
|
||||||
if(ioctl(device_fd, TUNSIFHEAD, &one, sizeof(one)) == -1) {
|
|
||||||
logger(LOG_ERR, "System call `%s' failed: %s", "ioctl", strerror(errno));
|
logger(LOG_ERR, "System call `%s' failed: %s", "ioctl", strerror(errno));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#if defined(TUNSIFMODE) && defined(IFF_BROADCAST) && defined(IFF_MULTICAST)
|
#if defined(TUNSIFMODE) && defined(IFF_BROADCAST) && defined(IFF_MULTICAST)
|
||||||
{
|
{
|
||||||
const int mode = IFF_BROADCAST | IFF_MULTICAST;
|
const int mode = IFF_BROADCAST | IFF_MULTICAST;
|
||||||
ioctl(device_fd, TUNSIFMODE, &mode, sizeof(mode));
|
ioctl(device_fd, TUNSIFMODE, &mode, sizeof mode);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
device_info = "Generic BSD tun device";
|
device_info = "Generic BSD tun device";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DEVICE_TYPE_TAP:
|
case DEVICE_TYPE_TAP:
|
||||||
if(routing_mode == RMODE_ROUTER) {
|
if(routing_mode == RMODE_ROUTER)
|
||||||
overwrite_mac = true;
|
overwrite_mac = true;
|
||||||
}
|
|
||||||
|
|
||||||
device_info = "Generic BSD tap device";
|
device_info = "Generic BSD tap device";
|
||||||
#ifdef TAPGIFNAME
|
#ifdef TAPGIFNAME
|
||||||
{
|
{
|
||||||
struct ifreq ifr;
|
struct ifreq ifr;
|
||||||
|
if(ioctl(device_fd, TAPGIFNAME, (void*)&ifr) == 0) {
|
||||||
if(ioctl(device_fd, TAPGIFNAME, (void *)&ifr) == 0) {
|
if(iface)
|
||||||
if(iface) {
|
|
||||||
free(iface);
|
free(iface);
|
||||||
}
|
|
||||||
|
|
||||||
iface = xstrdup(ifr.ifr_name);
|
iface = xstrdup(ifr.ifr_name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
#ifdef ENABLE_TUNEMU
|
#ifdef HAVE_TUNEMU
|
||||||
|
|
||||||
case DEVICE_TYPE_TUNEMU:
|
case DEVICE_TYPE_TUNEMU:
|
||||||
device_info = "BSD tunemu device";
|
device_info = "BSD tunemu device";
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef SIOCGIFADDR
|
|
||||||
|
|
||||||
if(overwrite_mac) {
|
|
||||||
ioctl(device_fd, SIOCGIFADDR, mymac.x);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
logger(LOG_INFO, "%s is a %s", device, device_info);
|
logger(LOG_INFO, "%s is a %s", device, device_info);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -330,13 +181,11 @@ static bool setup_device(void) {
|
||||||
|
|
||||||
static void close_device(void) {
|
static void close_device(void) {
|
||||||
switch(device_type) {
|
switch(device_type) {
|
||||||
#ifdef ENABLE_TUNEMU
|
#ifdef HAVE_TUNEMU
|
||||||
|
|
||||||
case DEVICE_TYPE_TUNEMU:
|
case DEVICE_TYPE_TUNEMU:
|
||||||
tunemu_close(device_fd);
|
tunemu_close(device_fd);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
default:
|
default:
|
||||||
close(device_fd);
|
close(device_fd);
|
||||||
}
|
}
|
||||||
|
|
@ -350,11 +199,11 @@ static bool read_packet(vpn_packet_t *packet) {
|
||||||
|
|
||||||
switch(device_type) {
|
switch(device_type) {
|
||||||
case DEVICE_TYPE_TUN:
|
case DEVICE_TYPE_TUN:
|
||||||
#ifdef ENABLE_TUNEMU
|
#ifdef HAVE_TUNEMU
|
||||||
case DEVICE_TYPE_TUNEMU:
|
case DEVICE_TYPE_TUNEMU:
|
||||||
if(device_type == DEVICE_TYPE_TUNEMU) {
|
if(device_type == DEVICE_TYPE_TUNEMU)
|
||||||
lenin = tunemu_read(device_fd, packet->data + 14, MTU - 14);
|
lenin = tunemu_read(device_fd, packet->data + 14, MTU - 14);
|
||||||
} else
|
else
|
||||||
#endif
|
#endif
|
||||||
lenin = read(device_fd, packet->data + 14, MTU - 14);
|
lenin = read(device_fd, packet->data + 14, MTU - 14);
|
||||||
|
|
||||||
|
|
@ -369,12 +218,10 @@ static bool read_packet(vpn_packet_t *packet) {
|
||||||
packet->data[12] = 0x08;
|
packet->data[12] = 0x08;
|
||||||
packet->data[13] = 0x00;
|
packet->data[13] = 0x00;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 6:
|
case 6:
|
||||||
packet->data[12] = 0x86;
|
packet->data[12] = 0x86;
|
||||||
packet->data[13] = 0xDD;
|
packet->data[13] = 0xDD;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
ifdebug(TRAFFIC) logger(LOG_ERR,
|
ifdebug(TRAFFIC) logger(LOG_ERR,
|
||||||
"Unknown IP version %d while reading packet from %s %s",
|
"Unknown IP version %d while reading packet from %s %s",
|
||||||
|
|
@ -382,37 +229,37 @@ static bool read_packet(vpn_packet_t *packet) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(packet->data, 0, 12);
|
|
||||||
packet->len = lenin + 14;
|
packet->len = lenin + 14;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DEVICE_TYPE_UTUN:
|
|
||||||
case DEVICE_TYPE_TUNIFHEAD: {
|
case DEVICE_TYPE_TUNIFHEAD: {
|
||||||
if((lenin = read(device_fd, packet->data + 10, MTU - 10)) <= 0) {
|
u_int32_t type;
|
||||||
|
struct iovec vector[2] = {{&type, sizeof(type)}, {packet->data + 14, MTU - 14}};
|
||||||
|
|
||||||
|
if((lenin = readv(device_fd, vector, 2)) <= 0) {
|
||||||
logger(LOG_ERR, "Error while reading from %s %s: %s", device_info,
|
logger(LOG_ERR, "Error while reading from %s %s: %s", device_info,
|
||||||
device, strerror(errno));
|
device, strerror(errno));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch(packet->data[14] >> 4) {
|
switch (ntohl(type)) {
|
||||||
case 4:
|
case AF_INET:
|
||||||
packet->data[12] = 0x08;
|
packet->data[12] = 0x08;
|
||||||
packet->data[13] = 0x00;
|
packet->data[13] = 0x00;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 6:
|
case AF_INET6:
|
||||||
packet->data[12] = 0x86;
|
packet->data[12] = 0x86;
|
||||||
packet->data[13] = 0xDD;
|
packet->data[13] = 0xDD;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
ifdebug(TRAFFIC) logger(LOG_ERR,
|
ifdebug(TRAFFIC) logger(LOG_ERR,
|
||||||
"Unknown IP version %d while reading packet from %s %s",
|
"Unknown address family %x while reading packet from %s %s",
|
||||||
packet->data[14] >> 4, device_info, device);
|
ntohl(type), device_info, device);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(packet->data, 0, 12);
|
|
||||||
packet->len = lenin + 10;
|
packet->len = lenin + 10;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -450,23 +297,22 @@ static bool write_packet(vpn_packet_t *packet) {
|
||||||
device, strerror(errno));
|
device, strerror(errno));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DEVICE_TYPE_UTUN:
|
|
||||||
case DEVICE_TYPE_TUNIFHEAD: {
|
case DEVICE_TYPE_TUNIFHEAD: {
|
||||||
int af = (packet->data[12] << 8) + packet->data[13];
|
u_int32_t type;
|
||||||
uint32_t type;
|
struct iovec vector[2] = {{&type, sizeof(type)}, {packet->data + 14, packet->len - 14}};
|
||||||
|
int af;
|
||||||
|
|
||||||
switch(af) {
|
af = (packet->data[12] << 8) + packet->data[13];
|
||||||
|
|
||||||
|
switch (af) {
|
||||||
case 0x0800:
|
case 0x0800:
|
||||||
type = htonl(AF_INET);
|
type = htonl(AF_INET);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x86DD:
|
case 0x86DD:
|
||||||
type = htonl(AF_INET6);
|
type = htonl(AF_INET6);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
ifdebug(TRAFFIC) logger(LOG_ERR,
|
ifdebug(TRAFFIC) logger(LOG_ERR,
|
||||||
"Unknown address family %x while writing packet to %s %s",
|
"Unknown address family %x while writing packet to %s %s",
|
||||||
|
|
@ -474,14 +320,11 @@ static bool write_packet(vpn_packet_t *packet) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(packet->data + 10, &type, sizeof(type));
|
if(writev(device_fd, vector, 2) < 0) {
|
||||||
|
|
||||||
if(write(device_fd, packet->data + 10, packet->len - 10) < 0) {
|
|
||||||
logger(LOG_ERR, "Can't write to %s %s: %s", device_info, device,
|
logger(LOG_ERR, "Can't write to %s %s: %s", device_info, device,
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -491,18 +334,15 @@ static bool write_packet(vpn_packet_t *packet) {
|
||||||
device, strerror(errno));
|
device, strerror(errno));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#ifdef ENABLE_TUNEMU
|
#ifdef HAVE_TUNEMU
|
||||||
|
|
||||||
case DEVICE_TYPE_TUNEMU:
|
case DEVICE_TYPE_TUNEMU:
|
||||||
if(tunemu_write(device_fd, packet->data + 14, packet->len - 14) < 0) {
|
if(tunemu_write(device_fd, packet->data + 14, packet->len - 14) < 0) {
|
||||||
logger(LOG_ERR, "Error while writing to %s %s: %s", device_info,
|
logger(LOG_ERR, "Error while writing to %s %s: %s", device_info,
|
||||||
device, strerror(errno));
|
device, strerror(errno));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
175
src/bsd/tunemu.c
175
src/bsd/tunemu.c
|
|
@ -49,21 +49,24 @@
|
||||||
#define PPPIOCCONNECT _IOW('t', 58, int)
|
#define PPPIOCCONNECT _IOW('t', 58, int)
|
||||||
#define PPPIOCGUNIT _IOR('t', 86, int)
|
#define PPPIOCGUNIT _IOR('t', 86, int)
|
||||||
|
|
||||||
struct sockaddr_ppp {
|
struct sockaddr_ppp
|
||||||
|
{
|
||||||
u_int8_t ppp_len;
|
u_int8_t ppp_len;
|
||||||
u_int8_t ppp_family;
|
u_int8_t ppp_family;
|
||||||
u_int16_t ppp_proto;
|
u_int16_t ppp_proto;
|
||||||
u_int32_t ppp_cookie;
|
u_int32_t ppp_cookie;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum NPmode {
|
enum NPmode
|
||||||
|
{
|
||||||
NPMODE_PASS,
|
NPMODE_PASS,
|
||||||
NPMODE_DROP,
|
NPMODE_DROP,
|
||||||
NPMODE_ERROR,
|
NPMODE_ERROR,
|
||||||
NPMODE_QUEUE
|
NPMODE_QUEUE
|
||||||
};
|
};
|
||||||
|
|
||||||
struct npioctl {
|
struct npioctl
|
||||||
|
{
|
||||||
int protocol;
|
int protocol;
|
||||||
enum NPmode mode;
|
enum NPmode mode;
|
||||||
};
|
};
|
||||||
|
|
@ -80,55 +83,58 @@ static pcap_t *pcap = NULL;
|
||||||
static int data_buffer_length = 0;
|
static int data_buffer_length = 0;
|
||||||
static char *data_buffer = NULL;
|
static char *data_buffer = NULL;
|
||||||
|
|
||||||
static void tun_error(char *format, ...) {
|
static void tun_error(char *format, ...)
|
||||||
|
{
|
||||||
va_list vl;
|
va_list vl;
|
||||||
va_start(vl, format);
|
va_start(vl, format);
|
||||||
vsnprintf(tunemu_error, ERROR_BUFFER_SIZE, format, vl);
|
vsnprintf(tunemu_error, ERROR_BUFFER_SIZE, format, vl);
|
||||||
va_end(vl);
|
va_end(vl);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void tun_noerror() {
|
static void tun_noerror()
|
||||||
|
{
|
||||||
*tunemu_error = 0;
|
*tunemu_error = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void closeall() {
|
static void closeall()
|
||||||
|
{
|
||||||
int fd = getdtablesize();
|
int fd = getdtablesize();
|
||||||
|
while (fd--)
|
||||||
while(fd--) {
|
|
||||||
close(fd);
|
close(fd);
|
||||||
}
|
|
||||||
|
|
||||||
open("/dev/null", O_RDWR, 0);
|
open("/dev/null", O_RDWR, 0);
|
||||||
dup(0);
|
dup(0);
|
||||||
dup(0);
|
dup(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ppp_load_kext() {
|
static int ppp_load_kext()
|
||||||
|
{
|
||||||
int pid = fork();
|
int pid = fork();
|
||||||
|
if (pid < 0)
|
||||||
if(pid < 0) {
|
{
|
||||||
tun_error("fork for ppp kext: %s", strerror(errno));
|
tun_error("fork for ppp kext: %s", strerror(errno));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(pid == 0) {
|
if (pid == 0)
|
||||||
|
{
|
||||||
closeall();
|
closeall();
|
||||||
execle("/sbin/kextload", "kextload", PPP_KEXT_PATH, NULL, NULL);
|
execle("/sbin/kextload", "kextload", PPP_KEXT_PATH, NULL, NULL);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
int status;
|
int status;
|
||||||
|
while (waitpid(pid, &status, 0) < 0)
|
||||||
while(waitpid(pid, &status, 0) < 0) {
|
{
|
||||||
if(errno == EINTR) {
|
if (errno == EINTR)
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
|
|
||||||
tun_error("waitpid for ppp kext: %s", strerror(errno));
|
tun_error("waitpid for ppp kext: %s", strerror(errno));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(WEXITSTATUS(status) != 0) {
|
if (WEXITSTATUS(status) != 0)
|
||||||
|
{
|
||||||
tun_error("could not load ppp kext \"%s\"", PPP_KEXT_PATH);
|
tun_error("could not load ppp kext \"%s\"", PPP_KEXT_PATH);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
@ -137,18 +143,18 @@ static int ppp_load_kext() {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ppp_new_instance() {
|
static int ppp_new_instance()
|
||||||
|
{
|
||||||
// create ppp socket
|
// create ppp socket
|
||||||
int ppp_sockfd = socket(PF_PPP, SOCK_RAW, PPPPROTO_CTL);
|
int ppp_sockfd = socket(PF_PPP, SOCK_RAW, PPPPROTO_CTL);
|
||||||
|
if (ppp_sockfd < 0)
|
||||||
if(ppp_sockfd < 0) {
|
{
|
||||||
if(ppp_load_kext() < 0) {
|
if (ppp_load_kext() < 0)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
|
||||||
|
|
||||||
ppp_sockfd = socket(PF_PPP, SOCK_RAW, PPPPROTO_CTL);
|
ppp_sockfd = socket(PF_PPP, SOCK_RAW, PPPPROTO_CTL);
|
||||||
|
if (ppp_sockfd < 0)
|
||||||
if(ppp_sockfd < 0) {
|
{
|
||||||
tun_error("creating ppp socket: %s", strerror(errno));
|
tun_error("creating ppp socket: %s", strerror(errno));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
@ -160,8 +166,8 @@ static int ppp_new_instance() {
|
||||||
pppaddr.ppp_family = AF_PPP;
|
pppaddr.ppp_family = AF_PPP;
|
||||||
pppaddr.ppp_proto = PPPPROTO_CTL;
|
pppaddr.ppp_proto = PPPPROTO_CTL;
|
||||||
pppaddr.ppp_cookie = 0;
|
pppaddr.ppp_cookie = 0;
|
||||||
|
if (connect(ppp_sockfd, (struct sockaddr *)&pppaddr, sizeof(struct sockaddr_ppp)) < 0)
|
||||||
if(connect(ppp_sockfd, (struct sockaddr *)&pppaddr, sizeof(struct sockaddr_ppp)) < 0) {
|
{
|
||||||
tun_error("connecting ppp socket: %s", strerror(errno));
|
tun_error("connecting ppp socket: %s", strerror(errno));
|
||||||
close(ppp_sockfd);
|
close(ppp_sockfd);
|
||||||
return -1;
|
return -1;
|
||||||
|
|
@ -171,15 +177,15 @@ static int ppp_new_instance() {
|
||||||
return ppp_sockfd;
|
return ppp_sockfd;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ppp_new_unit(int *unit_number) {
|
static int ppp_new_unit(int *unit_number)
|
||||||
|
{
|
||||||
int fd = ppp_new_instance();
|
int fd = ppp_new_instance();
|
||||||
|
if (fd < 0)
|
||||||
if(fd < 0) {
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
|
||||||
|
|
||||||
// create ppp unit
|
// create ppp unit
|
||||||
if(ioctl(fd, PPPIOCNEWUNIT, unit_number) < 0) {
|
if (ioctl(fd, PPPIOCNEWUNIT, unit_number) < 0)
|
||||||
|
{
|
||||||
tun_error("creating ppp unit: %s", strerror(errno));
|
tun_error("creating ppp unit: %s", strerror(errno));
|
||||||
close(fd);
|
close(fd);
|
||||||
return -1;
|
return -1;
|
||||||
|
|
@ -189,11 +195,12 @@ static int ppp_new_unit(int *unit_number) {
|
||||||
return fd;
|
return fd;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ppp_setup_unit(int unit_fd) {
|
static int ppp_setup_unit(int unit_fd)
|
||||||
|
{
|
||||||
// send traffic to program
|
// send traffic to program
|
||||||
int flags = SC_LOOP_TRAFFIC;
|
int flags = SC_LOOP_TRAFFIC;
|
||||||
|
if (ioctl(unit_fd, PPPIOCSFLAGS, &flags) < 0)
|
||||||
if(ioctl(unit_fd, PPPIOCSFLAGS, &flags) < 0) {
|
{
|
||||||
tun_error("setting ppp loopback mode: %s", strerror(errno));
|
tun_error("setting ppp loopback mode: %s", strerror(errno));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
@ -202,8 +209,8 @@ static int ppp_setup_unit(int unit_fd) {
|
||||||
struct npioctl npi;
|
struct npioctl npi;
|
||||||
npi.protocol = PPP_IP;
|
npi.protocol = PPP_IP;
|
||||||
npi.mode = NPMODE_PASS;
|
npi.mode = NPMODE_PASS;
|
||||||
|
if (ioctl(unit_fd, PPPIOCSNPMODE, &npi) < 0)
|
||||||
if(ioctl(unit_fd, PPPIOCSNPMODE, &npi) < 0) {
|
{
|
||||||
tun_error("starting ppp unit: %s", strerror(errno));
|
tun_error("starting ppp unit: %s", strerror(errno));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
@ -212,8 +219,10 @@ static int ppp_setup_unit(int unit_fd) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int open_pcap() {
|
static int open_pcap()
|
||||||
if(pcap != NULL) {
|
{
|
||||||
|
if (pcap != NULL)
|
||||||
|
{
|
||||||
pcap_use_count++;
|
pcap_use_count++;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
@ -222,7 +231,8 @@ static int open_pcap() {
|
||||||
pcap = pcap_open_live("lo0", BUFSIZ, 0, 1, errbuf);
|
pcap = pcap_open_live("lo0", BUFSIZ, 0, 1, errbuf);
|
||||||
pcap_use_count = 1;
|
pcap_use_count = 1;
|
||||||
|
|
||||||
if(pcap == NULL) {
|
if (pcap == NULL)
|
||||||
|
{
|
||||||
tun_error("opening pcap: %s", errbuf);
|
tun_error("opening pcap: %s", errbuf);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
@ -231,57 +241,59 @@ static int open_pcap() {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void close_pcap() {
|
static void close_pcap()
|
||||||
if(pcap == NULL) {
|
{
|
||||||
|
if (pcap == NULL)
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
pcap_use_count--;
|
pcap_use_count--;
|
||||||
|
if (pcap_use_count == 0)
|
||||||
if(pcap_use_count == 0) {
|
{
|
||||||
pcap_close(pcap);
|
pcap_close(pcap);
|
||||||
pcap = NULL;
|
pcap = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void allocate_data_buffer(int size) {
|
static void allocate_data_buffer(int size)
|
||||||
if(data_buffer_length < size) {
|
{
|
||||||
|
if (data_buffer_length < size)
|
||||||
|
{
|
||||||
free(data_buffer);
|
free(data_buffer);
|
||||||
data_buffer_length = size;
|
data_buffer_length = size;
|
||||||
data_buffer = malloc(data_buffer_length);
|
data_buffer = malloc(data_buffer_length);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void make_device_name(tunemu_device device, int unit_number) {
|
static void make_device_name(tunemu_device device, int unit_number)
|
||||||
|
{
|
||||||
snprintf(device, sizeof(tunemu_device), "ppp%d", unit_number);
|
snprintf(device, sizeof(tunemu_device), "ppp%d", unit_number);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int check_device_name(tunemu_device device) {
|
static int check_device_name(tunemu_device device)
|
||||||
if(strlen(device) < 4) {
|
{
|
||||||
|
if (strlen(device) < 4)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
|
||||||
|
|
||||||
int unit_number = atoi(device + 3);
|
int unit_number = atoi(device + 3);
|
||||||
|
if (unit_number < 0 || unit_number > 999)
|
||||||
if(unit_number < 0 || unit_number > 999) {
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
|
||||||
|
|
||||||
tunemu_device compare;
|
tunemu_device compare;
|
||||||
make_device_name(compare, unit_number);
|
make_device_name(compare, unit_number);
|
||||||
|
|
||||||
if(strcmp(device, compare) != 0) {
|
if (strcmp(device, compare) != 0)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int tunemu_open(tunemu_device device) {
|
int tunemu_open(tunemu_device device)
|
||||||
|
{
|
||||||
int ppp_unit_number = -1;
|
int ppp_unit_number = -1;
|
||||||
|
if (device[0] != 0)
|
||||||
if(device[0] != 0) {
|
{
|
||||||
if(check_device_name(device) < 0) {
|
if (check_device_name(device) < 0)
|
||||||
|
{
|
||||||
tun_error("invalid device name \"%s\"", device);
|
tun_error("invalid device name \"%s\"", device);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
@ -290,17 +302,17 @@ int tunemu_open(tunemu_device device) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int ppp_unit_fd = ppp_new_unit(&ppp_unit_number);
|
int ppp_unit_fd = ppp_new_unit(&ppp_unit_number);
|
||||||
|
if (ppp_unit_fd < 0)
|
||||||
if(ppp_unit_fd < 0) {
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
|
||||||
|
|
||||||
if(ppp_setup_unit(ppp_unit_fd) < 0) {
|
if (ppp_setup_unit(ppp_unit_fd) < 0)
|
||||||
|
{
|
||||||
close(ppp_unit_fd);
|
close(ppp_unit_fd);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(open_pcap() < 0) {
|
if (open_pcap() < 0)
|
||||||
|
{
|
||||||
close(ppp_unit_fd);
|
close(ppp_unit_fd);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
@ -310,40 +322,39 @@ int tunemu_open(tunemu_device device) {
|
||||||
return ppp_unit_fd;
|
return ppp_unit_fd;
|
||||||
}
|
}
|
||||||
|
|
||||||
int tunemu_close(int ppp_sockfd) {
|
int tunemu_close(int ppp_sockfd)
|
||||||
|
{
|
||||||
int ret = close(ppp_sockfd);
|
int ret = close(ppp_sockfd);
|
||||||
|
|
||||||
if(ret == 0) {
|
if (ret == 0)
|
||||||
close_pcap();
|
close_pcap();
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int tunemu_read(int ppp_sockfd, char *buffer, int length) {
|
int tunemu_read(int ppp_sockfd, char *buffer, int length)
|
||||||
|
{
|
||||||
allocate_data_buffer(length + 2);
|
allocate_data_buffer(length + 2);
|
||||||
|
|
||||||
length = read(ppp_sockfd, data_buffer, length + 2);
|
length = read(ppp_sockfd, data_buffer, length + 2);
|
||||||
|
if (length < 0)
|
||||||
if(length < 0) {
|
{
|
||||||
tun_error("reading packet: %s", strerror(errno));
|
tun_error("reading packet: %s", strerror(errno));
|
||||||
return length;
|
return length;
|
||||||
}
|
}
|
||||||
|
|
||||||
tun_noerror();
|
tun_noerror();
|
||||||
|
|
||||||
length -= 2;
|
length -= 2;
|
||||||
|
if (length < 0)
|
||||||
if(length < 0) {
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
|
||||||
|
|
||||||
memcpy(buffer, data_buffer + 2, length);
|
memcpy(buffer, data_buffer + 2, length);
|
||||||
|
|
||||||
return length;
|
return length;
|
||||||
}
|
}
|
||||||
|
|
||||||
int tunemu_write(int ppp_sockfd, char *buffer, int length) {
|
int tunemu_write(int ppp_sockfd, char *buffer, int length)
|
||||||
|
{
|
||||||
allocate_data_buffer(length + 4);
|
allocate_data_buffer(length + 4);
|
||||||
|
|
||||||
data_buffer[0] = 0x02;
|
data_buffer[0] = 0x02;
|
||||||
|
|
@ -353,25 +364,23 @@ int tunemu_write(int ppp_sockfd, char *buffer, int length) {
|
||||||
|
|
||||||
memcpy(data_buffer + 4, buffer, length);
|
memcpy(data_buffer + 4, buffer, length);
|
||||||
|
|
||||||
if(pcap == NULL) {
|
if (pcap == NULL)
|
||||||
|
{
|
||||||
tun_error("pcap not open");
|
tun_error("pcap not open");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
length = pcap_inject(pcap, data_buffer, length + 4);
|
length = pcap_inject(pcap, data_buffer, length + 4);
|
||||||
|
if (length < 0)
|
||||||
if(length < 0) {
|
{
|
||||||
tun_error("injecting packet: %s", pcap_geterr(pcap));
|
tun_error("injecting packet: %s", pcap_geterr(pcap));
|
||||||
return length;
|
return length;
|
||||||
}
|
}
|
||||||
|
|
||||||
tun_noerror();
|
tun_noerror();
|
||||||
|
|
||||||
length -= 4;
|
length -= 4;
|
||||||
|
if (length < 0)
|
||||||
if(length < 0) {
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
|
||||||
|
|
||||||
return length;
|
return length;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
225
src/conf.c
225
src/conf.c
|
|
@ -2,7 +2,7 @@
|
||||||
conf.c -- configuration code
|
conf.c -- configuration code
|
||||||
Copyright (C) 1998 Robert van der Meulen
|
Copyright (C) 1998 Robert van der Meulen
|
||||||
1998-2005 Ivo Timmermans
|
1998-2005 Ivo Timmermans
|
||||||
2000-2014 Guus Sliepen <guus@tinc-vpn.org>
|
2000-2012 Guus Sliepen <guus@tinc-vpn.org>
|
||||||
2010-2011 Julien Muchembled <jm@jmuchemb.eu>
|
2010-2011 Julien Muchembled <jm@jmuchemb.eu>
|
||||||
2000 Cris van Pelt
|
2000 Cris van Pelt
|
||||||
|
|
||||||
|
|
@ -47,31 +47,27 @@ static int config_compare(const config_t *a, const config_t *b) {
|
||||||
|
|
||||||
result = strcasecmp(a->variable, b->variable);
|
result = strcasecmp(a->variable, b->variable);
|
||||||
|
|
||||||
if(result) {
|
if(result)
|
||||||
return result;
|
return result;
|
||||||
}
|
|
||||||
|
|
||||||
/* give priority to command line options */
|
/* give priority to command line options */
|
||||||
result = !b->file - !a->file;
|
result = !b->file - !a->file;
|
||||||
|
if (result)
|
||||||
if(result) {
|
|
||||||
return result;
|
return result;
|
||||||
}
|
|
||||||
|
|
||||||
result = a->line - b->line;
|
result = a->line - b->line;
|
||||||
|
|
||||||
if(result) {
|
if(result)
|
||||||
return result;
|
return result;
|
||||||
} else {
|
else
|
||||||
return a->file ? strcmp(a->file, b->file) : 0;
|
return a->file ? strcmp(a->file, b->file) : 0;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void init_configuration(avl_tree_t **config_tree) {
|
void init_configuration(avl_tree_t ** config_tree) {
|
||||||
*config_tree = avl_alloc_tree((avl_compare_t) config_compare, (avl_action_t) free_config);
|
*config_tree = avl_alloc_tree((avl_compare_t) config_compare, (avl_action_t) free_config);
|
||||||
}
|
}
|
||||||
|
|
||||||
void exit_configuration(avl_tree_t **config_tree) {
|
void exit_configuration(avl_tree_t ** config_tree) {
|
||||||
avl_delete_tree(*config_tree);
|
avl_delete_tree(*config_tree);
|
||||||
*config_tree = NULL;
|
*config_tree = NULL;
|
||||||
}
|
}
|
||||||
|
|
@ -81,9 +77,15 @@ config_t *new_config(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void free_config(config_t *cfg) {
|
void free_config(config_t *cfg) {
|
||||||
|
if(cfg->variable)
|
||||||
free(cfg->variable);
|
free(cfg->variable);
|
||||||
|
|
||||||
|
if(cfg->value)
|
||||||
free(cfg->value);
|
free(cfg->value);
|
||||||
|
|
||||||
|
if(cfg->file)
|
||||||
free(cfg->file);
|
free(cfg->file);
|
||||||
|
|
||||||
free(cfg);
|
free(cfg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -100,13 +102,11 @@ config_t *lookup_config(const avl_tree_t *config_tree, char *variable) {
|
||||||
|
|
||||||
found = avl_search_closest_greater(config_tree, &cfg);
|
found = avl_search_closest_greater(config_tree, &cfg);
|
||||||
|
|
||||||
if(!found) {
|
if(!found)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
|
||||||
|
|
||||||
if(strcasecmp(found->variable, variable)) {
|
if(strcasecmp(found->variable, variable))
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
|
||||||
|
|
||||||
return found;
|
return found;
|
||||||
}
|
}
|
||||||
|
|
@ -121,19 +121,17 @@ config_t *lookup_config_next(const avl_tree_t *config_tree, const config_t *cfg)
|
||||||
if(node->next) {
|
if(node->next) {
|
||||||
found = node->next->data;
|
found = node->next->data;
|
||||||
|
|
||||||
if(!strcasecmp(found->variable, cfg->variable)) {
|
if(!strcasecmp(found->variable, cfg->variable))
|
||||||
return found;
|
return found;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool get_config_bool(const config_t *cfg, bool *result) {
|
bool get_config_bool(const config_t *cfg, bool *result) {
|
||||||
if(!cfg) {
|
if(!cfg)
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
|
|
||||||
if(!strcasecmp(cfg->value, "yes")) {
|
if(!strcasecmp(cfg->value, "yes")) {
|
||||||
*result = true;
|
*result = true;
|
||||||
|
|
@ -150,13 +148,11 @@ bool get_config_bool(const config_t *cfg, bool *result) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool get_config_int(const config_t *cfg, int *result) {
|
bool get_config_int(const config_t *cfg, int *result) {
|
||||||
if(!cfg) {
|
if(!cfg)
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
|
|
||||||
if(sscanf(cfg->value, "%d", result) == 1) {
|
if(sscanf(cfg->value, "%d", result) == 1)
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
|
|
||||||
logger(LOG_ERR, "Integer expected for configuration variable %s in %s line %d",
|
logger(LOG_ERR, "Integer expected for configuration variable %s in %s line %d",
|
||||||
cfg->variable, cfg->file, cfg->line);
|
cfg->variable, cfg->file, cfg->line);
|
||||||
|
|
@ -165,9 +161,8 @@ bool get_config_int(const config_t *cfg, int *result) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool get_config_string(const config_t *cfg, char **result) {
|
bool get_config_string(const config_t *cfg, char **result) {
|
||||||
if(!cfg) {
|
if(!cfg)
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
|
|
||||||
*result = xstrdup(cfg->value);
|
*result = xstrdup(cfg->value);
|
||||||
|
|
||||||
|
|
@ -177,9 +172,8 @@ bool get_config_string(const config_t *cfg, char **result) {
|
||||||
bool get_config_address(const config_t *cfg, struct addrinfo **result) {
|
bool get_config_address(const config_t *cfg, struct addrinfo **result) {
|
||||||
struct addrinfo *ai;
|
struct addrinfo *ai;
|
||||||
|
|
||||||
if(!cfg) {
|
if(!cfg)
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
|
|
||||||
ai = str2addrinfo(cfg->value, NULL, 0);
|
ai = str2addrinfo(cfg->value, NULL, 0);
|
||||||
|
|
||||||
|
|
@ -194,12 +188,11 @@ bool get_config_address(const config_t *cfg, struct addrinfo **result) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool get_config_subnet(const config_t *cfg, subnet_t **result) {
|
bool get_config_subnet(const config_t *cfg, subnet_t ** result) {
|
||||||
subnet_t subnet = {0};
|
subnet_t subnet = {NULL};
|
||||||
|
|
||||||
if(!cfg) {
|
if(!cfg)
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
|
|
||||||
if(!str2net(&subnet, cfg->value)) {
|
if(!str2net(&subnet, cfg->value)) {
|
||||||
logger(LOG_ERR, "Subnet expected for configuration variable %s in %s line %d",
|
logger(LOG_ERR, "Subnet expected for configuration variable %s in %s line %d",
|
||||||
|
|
@ -226,31 +219,26 @@ bool get_config_subnet(const config_t *cfg, subnet_t **result) {
|
||||||
/*
|
/*
|
||||||
Read exactly one line and strip the trailing newline if any.
|
Read exactly one line and strip the trailing newline if any.
|
||||||
*/
|
*/
|
||||||
static char *readline(FILE *fp, char *buf, size_t buflen) {
|
static char *readline(FILE * fp, char *buf, size_t buflen) {
|
||||||
char *newline = NULL;
|
char *newline = NULL;
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
if(feof(fp)) {
|
if(feof(fp))
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
|
||||||
|
|
||||||
p = fgets(buf, buflen, fp);
|
p = fgets(buf, buflen, fp);
|
||||||
|
|
||||||
if(!p) {
|
if(!p)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
|
||||||
|
|
||||||
newline = strchr(p, '\n');
|
newline = strchr(p, '\n');
|
||||||
|
|
||||||
if(!newline) {
|
if(!newline)
|
||||||
return buf;
|
return buf;
|
||||||
}
|
|
||||||
|
|
||||||
*newline = '\0'; /* kill newline */
|
*newline = '\0'; /* kill newline */
|
||||||
|
if(newline > p && newline[-1] == '\r') /* and carriage return if necessary */
|
||||||
if(newline > p && newline[-1] == '\r') { /* and carriage return if necessary */
|
|
||||||
newline[-1] = '\0';
|
newline[-1] = '\0';
|
||||||
}
|
|
||||||
|
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
@ -262,32 +250,26 @@ config_t *parse_config_line(char *line, const char *fname, int lineno) {
|
||||||
variable = value = line;
|
variable = value = line;
|
||||||
|
|
||||||
eol = line + strlen(line);
|
eol = line + strlen(line);
|
||||||
|
while(strchr("\t ", *--eol))
|
||||||
while(strchr("\t ", *--eol)) {
|
|
||||||
*eol = '\0';
|
*eol = '\0';
|
||||||
}
|
|
||||||
|
|
||||||
len = strcspn(value, "\t =");
|
len = strcspn(value, "\t =");
|
||||||
value += len;
|
value += len;
|
||||||
value += strspn(value, "\t ");
|
value += strspn(value, "\t ");
|
||||||
|
|
||||||
if(*value == '=') {
|
if(*value == '=') {
|
||||||
value++;
|
value++;
|
||||||
value += strspn(value, "\t ");
|
value += strspn(value, "\t ");
|
||||||
}
|
}
|
||||||
|
|
||||||
variable[len] = '\0';
|
variable[len] = '\0';
|
||||||
|
|
||||||
if(!*value) {
|
if(!*value) {
|
||||||
const char err[] = "No value for variable";
|
const char err[] = "No value for variable";
|
||||||
|
if (fname)
|
||||||
if(fname)
|
|
||||||
logger(LOG_ERR, "%s `%s' on line %d while reading config file %s",
|
logger(LOG_ERR, "%s `%s' on line %d while reading config file %s",
|
||||||
err, variable, lineno, fname);
|
err, variable, lineno, fname);
|
||||||
else
|
else
|
||||||
logger(LOG_ERR, "%s `%s' in command line option %d",
|
logger(LOG_ERR, "%s `%s' in command line option %d",
|
||||||
err, variable, lineno);
|
err, variable, lineno);
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -321,27 +303,22 @@ bool read_config_file(avl_tree_t *config_tree, const char *fname) {
|
||||||
}
|
}
|
||||||
|
|
||||||
for(;;) {
|
for(;;) {
|
||||||
line = readline(fp, buffer, sizeof(buffer));
|
line = readline(fp, buffer, sizeof buffer);
|
||||||
|
|
||||||
if(!line) {
|
if(!line) {
|
||||||
if(feof(fp)) {
|
if(feof(fp))
|
||||||
result = true;
|
result = true;
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
lineno++;
|
lineno++;
|
||||||
|
|
||||||
if(!*line || *line == '#') {
|
if(!*line || *line == '#')
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
|
|
||||||
if(ignore) {
|
if(ignore) {
|
||||||
if(!strncmp(line, "-----END", 8)) {
|
if(!strncmp(line, "-----END", 8))
|
||||||
ignore = false;
|
ignore = false;
|
||||||
}
|
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -351,11 +328,8 @@ bool read_config_file(avl_tree_t *config_tree, const char *fname) {
|
||||||
}
|
}
|
||||||
|
|
||||||
cfg = parse_config_line(line, fname, lineno);
|
cfg = parse_config_line(line, fname, lineno);
|
||||||
|
if (!cfg)
|
||||||
if(!cfg) {
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
|
|
||||||
config_add(config_tree, cfg);
|
config_add(config_tree, cfg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -365,92 +339,63 @@ bool read_config_file(avl_tree_t *config_tree, const char *fname) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void read_config_options(avl_tree_t *config_tree, const char *prefix) {
|
void read_config_options(avl_tree_t *config_tree, const char *prefix) {
|
||||||
|
list_node_t *node, *next;
|
||||||
size_t prefix_len = prefix ? strlen(prefix) : 0;
|
size_t prefix_len = prefix ? strlen(prefix) : 0;
|
||||||
|
|
||||||
for(const list_node_t *node = cmdline_conf->tail; node; node = node->prev) {
|
for(node = cmdline_conf->tail; node; node = next) {
|
||||||
const config_t *cfg = node->data;
|
config_t *orig_cfg, *cfg = (config_t *)node->data;
|
||||||
|
next = node->prev;
|
||||||
|
|
||||||
if(!prefix) {
|
if(!prefix) {
|
||||||
if(strchr(cfg->variable, '.')) {
|
if(strchr(cfg->variable, '.'))
|
||||||
continue;
|
continue;
|
||||||
}
|
node->data = NULL;
|
||||||
|
list_unlink_node(cmdline_conf, node);
|
||||||
} else {
|
} else {
|
||||||
if(strncmp(prefix, cfg->variable, prefix_len) ||
|
if(strncmp(prefix, cfg->variable, prefix_len) ||
|
||||||
cfg->variable[prefix_len] != '.') {
|
cfg->variable[prefix_len] != '.')
|
||||||
continue;
|
continue;
|
||||||
|
/* Because host configuration is parsed again when
|
||||||
|
reconnecting, nodes must not be freed when a prefix
|
||||||
|
is given. */
|
||||||
|
orig_cfg = cfg;
|
||||||
|
cfg = new_config();
|
||||||
|
cfg->variable = xstrdup(orig_cfg->variable + prefix_len + 1);
|
||||||
|
cfg->value = xstrdup(orig_cfg->value);
|
||||||
|
cfg->file = NULL;
|
||||||
|
cfg->line = orig_cfg->line;
|
||||||
}
|
}
|
||||||
}
|
config_add(config_tree, cfg);
|
||||||
|
|
||||||
config_t *new = new_config();
|
|
||||||
|
|
||||||
if(prefix) {
|
|
||||||
new->variable = xstrdup(cfg->variable + prefix_len + 1);
|
|
||||||
} else {
|
|
||||||
new->variable = xstrdup(cfg->variable);
|
|
||||||
}
|
|
||||||
|
|
||||||
new->value = xstrdup(cfg->value);
|
|
||||||
new->file = NULL;
|
|
||||||
new->line = cfg->line;
|
|
||||||
|
|
||||||
config_add(config_tree, new);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool read_server_config(void) {
|
bool read_server_config(void) {
|
||||||
char fname[PATH_MAX];
|
char *fname;
|
||||||
bool x;
|
bool x;
|
||||||
|
|
||||||
read_config_options(config_tree, NULL);
|
read_config_options(config_tree, NULL);
|
||||||
|
|
||||||
snprintf(fname, sizeof(fname), "%s/tinc.conf", confbase);
|
xasprintf(&fname, "%s/tinc.conf", confbase);
|
||||||
errno = 0;
|
|
||||||
x = read_config_file(config_tree, fname);
|
x = read_config_file(config_tree, fname);
|
||||||
|
|
||||||
// We will try to read the conf files in the "conf.d" dir
|
if(!x) { /* System error: complain */
|
||||||
if(x) {
|
|
||||||
char dname[PATH_MAX];
|
|
||||||
snprintf(dname, sizeof(dname), "%s/conf.d", confbase);
|
|
||||||
DIR *dir = opendir(dname);
|
|
||||||
|
|
||||||
// If we can find this dir
|
|
||||||
if(dir) {
|
|
||||||
struct dirent *ep;
|
|
||||||
|
|
||||||
// We list all the files in it
|
|
||||||
while(x && (ep = readdir(dir))) {
|
|
||||||
size_t l = strlen(ep->d_name);
|
|
||||||
|
|
||||||
// And we try to read the ones that end with ".conf"
|
|
||||||
if(l > 5 && !strcmp(".conf", & ep->d_name[ l - 5 ])) {
|
|
||||||
if((size_t)snprintf(fname, sizeof(fname), "%s/%s", dname, ep->d_name) >= sizeof(fname)) {
|
|
||||||
logger(LOG_ERR, "Pathname too long: %s/%s", dname, ep->d_name);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
x = read_config_file(config_tree, fname);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
closedir(dir);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!x && errno) {
|
|
||||||
logger(LOG_ERR, "Failed to read `%s': %s", fname, strerror(errno));
|
logger(LOG_ERR, "Failed to read `%s': %s", fname, strerror(errno));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
free(fname);
|
||||||
|
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool read_connection_config(connection_t *c) {
|
bool read_connection_config(connection_t *c) {
|
||||||
char fname[PATH_MAX];
|
char *fname;
|
||||||
bool x;
|
bool x;
|
||||||
|
|
||||||
read_config_options(c->config_tree, c->name);
|
read_config_options(c->config_tree, c->name);
|
||||||
|
|
||||||
snprintf(fname, sizeof(fname), "%s/hosts/%s", confbase, c->name);
|
xasprintf(&fname, "%s/hosts/%s", confbase, c->name);
|
||||||
x = read_config_file(c->config_tree, fname);
|
x = read_config_file(c->config_tree, fname);
|
||||||
|
free(fname);
|
||||||
|
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
|
@ -462,43 +407,34 @@ static void disable_old_keys(const char *filename) {
|
||||||
FILE *r, *w;
|
FILE *r, *w;
|
||||||
|
|
||||||
r = fopen(filename, "r");
|
r = fopen(filename, "r");
|
||||||
|
if(!r)
|
||||||
if(!r) {
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
int len = snprintf(tmpfile, sizeof(tmpfile), "%s.tmp", filename);
|
snprintf(tmpfile, sizeof tmpfile, "%s.tmp", filename);
|
||||||
|
|
||||||
if(len < 0 || len >= PATH_MAX) {
|
|
||||||
fprintf(stderr, "Pathname too long: %s.tmp\n", filename);
|
|
||||||
w = NULL;
|
|
||||||
} else {
|
|
||||||
w = fopen(tmpfile, "w");
|
w = fopen(tmpfile, "w");
|
||||||
}
|
|
||||||
|
|
||||||
while(fgets(buf, sizeof(buf), r)) {
|
while(fgets(buf, sizeof buf, r)) {
|
||||||
if(!strncmp(buf, "-----BEGIN RSA", 14)) {
|
if(!strncmp(buf, "-----BEGIN RSA", 14)) {
|
||||||
buf[11] = 'O';
|
buf[11] = 'O';
|
||||||
buf[12] = 'L';
|
buf[12] = 'L';
|
||||||
buf[13] = 'D';
|
buf[13] = 'D';
|
||||||
disabled = true;
|
disabled = true;
|
||||||
} else if(!strncmp(buf, "-----END RSA", 12)) {
|
}
|
||||||
|
else if(!strncmp(buf, "-----END RSA", 12)) {
|
||||||
buf[ 9] = 'O';
|
buf[ 9] = 'O';
|
||||||
buf[10] = 'L';
|
buf[10] = 'L';
|
||||||
buf[11] = 'D';
|
buf[11] = 'D';
|
||||||
disabled = true;
|
disabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(w && fputs(buf, w) < 0) {
|
if(w && fputs(buf, w) < 0) {
|
||||||
disabled = false;
|
disabled = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(w) {
|
if(w)
|
||||||
fclose(w);
|
fclose(w);
|
||||||
}
|
|
||||||
|
|
||||||
fclose(r);
|
fclose(r);
|
||||||
|
|
||||||
if(!w && disabled) {
|
if(!w && disabled) {
|
||||||
|
|
@ -510,12 +446,10 @@ static void disable_old_keys(const char *filename) {
|
||||||
#ifdef HAVE_MINGW
|
#ifdef HAVE_MINGW
|
||||||
// We cannot atomically replace files on Windows.
|
// We cannot atomically replace files on Windows.
|
||||||
char bakfile[PATH_MAX] = "";
|
char bakfile[PATH_MAX] = "";
|
||||||
snprintf(bakfile, sizeof(bakfile), "%s.bak", filename);
|
snprintf(bakfile, sizeof bakfile, "%s.bak", filename);
|
||||||
|
|
||||||
if(rename(filename, bakfile) || rename(tmpfile, filename)) {
|
if(rename(filename, bakfile) || rename(tmpfile, filename)) {
|
||||||
rename(bakfile, filename);
|
rename(bakfile, filename);
|
||||||
#else
|
#else
|
||||||
|
|
||||||
if(rename(tmpfile, filename)) {
|
if(rename(tmpfile, filename)) {
|
||||||
#endif
|
#endif
|
||||||
fprintf(stderr, "Warning: old key(s) found, remove them by hand!\n");
|
fprintf(stderr, "Warning: old key(s) found, remove them by hand!\n");
|
||||||
|
|
@ -532,9 +466,8 @@ static void disable_old_keys(const char *filename) {
|
||||||
|
|
||||||
FILE *ask_and_open(const char *filename, const char *what) {
|
FILE *ask_and_open(const char *filename, const char *what) {
|
||||||
FILE *r;
|
FILE *r;
|
||||||
char directory[PATH_MAX];
|
char *directory;
|
||||||
char line[PATH_MAX];
|
char line[PATH_MAX];
|
||||||
char abspath[PATH_MAX];
|
|
||||||
const char *fn;
|
const char *fn;
|
||||||
|
|
||||||
/* Check stdin and stdout */
|
/* Check stdin and stdout */
|
||||||
|
|
@ -549,7 +482,7 @@ FILE *ask_and_open(const char *filename, const char *what) {
|
||||||
what, filename);
|
what, filename);
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
|
||||||
fn = readline(stdin, line, sizeof(line));
|
fn = readline(stdin, line, sizeof line);
|
||||||
|
|
||||||
if(!fn) {
|
if(!fn) {
|
||||||
fprintf(stderr, "Error while reading stdin: %s\n",
|
fprintf(stderr, "Error while reading stdin: %s\n",
|
||||||
|
|
@ -559,27 +492,21 @@ FILE *ask_and_open(const char *filename, const char *what) {
|
||||||
|
|
||||||
if(!strlen(fn))
|
if(!strlen(fn))
|
||||||
/* User just pressed enter. */
|
/* User just pressed enter. */
|
||||||
{
|
|
||||||
fn = filename;
|
fn = filename;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef HAVE_MINGW
|
#ifdef HAVE_MINGW
|
||||||
|
|
||||||
if(fn[0] != '\\' && fn[0] != '/' && !strchr(fn, ':')) {
|
if(fn[0] != '\\' && fn[0] != '/' && !strchr(fn, ':')) {
|
||||||
#else
|
#else
|
||||||
|
|
||||||
if(fn[0] != '/') {
|
if(fn[0] != '/') {
|
||||||
#endif
|
#endif
|
||||||
/* The directory is a relative path or a filename. */
|
/* The directory is a relative path or a filename. */
|
||||||
getcwd(directory, sizeof(directory));
|
char *p;
|
||||||
|
|
||||||
if((size_t)snprintf(abspath, sizeof(abspath), "%s/%s", directory, fn) >= sizeof(abspath)) {
|
directory = get_current_dir_name();
|
||||||
fprintf(stderr, "Pathname too long: %s/%s\n", directory, fn);
|
xasprintf(&p, "%s/%s", directory, fn);
|
||||||
return NULL;
|
free(directory);
|
||||||
}
|
fn = p;
|
||||||
|
|
||||||
fn = abspath;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
umask(0077); /* Disallow everything for group and other */
|
umask(0077); /* Disallow everything for group and other */
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue