mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2024-11-22 09:29:52 +03:00
v4.03-9411-rtm
This commit is contained in:
parent
52e6ca39c1
commit
d1bc9c57c5
10
ChangeLog
Normal file
10
ChangeLog
Normal file
@ -0,0 +1,10 @@
|
||||
ChangeLog of SoftEther VPN
|
||||
--------------------------
|
||||
|
||||
The ChangeLog of SoftEther VPN is on our web site:
|
||||
http://www.softether.org/5-download/history
|
||||
|
||||
(In Japanese: http://ja.softether.org/5-download/history)
|
||||
|
||||
Enjoy it!
|
||||
|
10
ChangeLog.txt
Normal file
10
ChangeLog.txt
Normal file
@ -0,0 +1,10 @@
|
||||
ChangeLog of SoftEther VPN
|
||||
--------------------------
|
||||
|
||||
The ChangeLog of SoftEther VPN is on our web site:
|
||||
http://www.softether.org/5-download/history
|
||||
|
||||
(In Japanese: http://ja.softether.org/5-download/history)
|
||||
|
||||
Enjoy it!
|
||||
|
2037
LICENSE.TXT
2037
LICENSE.TXT
File diff suppressed because it is too large
Load Diff
7
README
7
README
@ -114,10 +114,10 @@ on all the following open-source repositories:
|
||||
https://github.com/SoftEtherVPN/SoftEtherVPN/
|
||||
|
||||
- SourceForge
|
||||
https://sourceforge.net/projects/softethervpn/
|
||||
https://sourceforge.net/p/softethervpn/code/ci/master/tree/
|
||||
|
||||
- Google Code
|
||||
https://code.google.com/p/softether/
|
||||
https://code.google.com/p/softether/source/browse/
|
||||
|
||||
|
||||
To fetch the source code from GitHub:
|
||||
@ -179,6 +179,9 @@ SOFTWARE INTO OTHER COUNTRIES IS AT YOUR OWN RISK. SOME COUNTRIES
|
||||
PROHIBIT ENCRYPTED COMMUNICATIONS. USING THIS SOFTWARE IN OTHER
|
||||
COUNTRIES MIGHT BE RESTRICTED.
|
||||
|
||||
READ AND UNDERSTAND THE 'WARNING.TXT' FILE BEFORE USING THIS SOFTWARE.
|
||||
SOME SOFTWARE PROGRAMS FROM THIRD PARTIES ARE INCLUDED ON THIS SOFTWARE WITH LICENSE CONDITIONS WHICH ARE DESCRIBED ON THE 'THIRD_PARTY.TXT' FILE.
|
||||
|
||||
|
||||
ADVERTISEMENT
|
||||
-------------
|
||||
|
@ -114,10 +114,10 @@ on all the following open-source repositories:
|
||||
https://github.com/SoftEtherVPN/SoftEtherVPN/
|
||||
|
||||
- SourceForge
|
||||
https://sourceforge.net/projects/softethervpn/
|
||||
https://sourceforge.net/p/softethervpn/code/ci/master/tree/
|
||||
|
||||
- Google Code
|
||||
https://code.google.com/p/softether/
|
||||
https://code.google.com/p/softether/source/browse/
|
||||
|
||||
|
||||
To fetch the source code from GitHub:
|
||||
@ -179,6 +179,9 @@ SOFTWARE INTO OTHER COUNTRIES IS AT YOUR OWN RISK. SOME COUNTRIES
|
||||
PROHIBIT ENCRYPTED COMMUNICATIONS. USING THIS SOFTWARE IN OTHER
|
||||
COUNTRIES MIGHT BE RESTRICTED.
|
||||
|
||||
READ AND UNDERSTAND THE 'WARNING.TXT' FILE BEFORE USING THIS SOFTWARE.
|
||||
SOME SOFTWARE PROGRAMS FROM THIRD PARTIES ARE INCLUDED ON THIS SOFTWARE WITH LICENSE CONDITIONS WHICH ARE DESCRIBED ON THE 'THIRD_PARTY.TXT' FILE.
|
||||
|
||||
|
||||
ADVERTISEMENT
|
||||
-------------
|
||||
|
757
THIRD_PARTY.TXT
Normal file
757
THIRD_PARTY.TXT
Normal file
@ -0,0 +1,757 @@
|
||||
BitVisor(R) VPN Client Module (IPsec Driver):
|
||||
Copyright (c) 2007, 2008 University of Tsukuba.
|
||||
Copyright (C) 2007, 2008 National Institute of Information and Communications
|
||||
Technology.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
3. Neither the name of the University of Tsukuba nor the names of its
|
||||
contributors may be used to endorse or promote products derived from this
|
||||
software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
-------------------
|
||||
|
||||
Microsoft(R) C Runtime Library:
|
||||
(c) 2007 Microsoft Corporation. All Rights Reserved.
|
||||
|
||||
-------------------
|
||||
|
||||
RSA Security Inc. PKCS #11 Cryptographic Token Interface (Cryptoki):
|
||||
|
||||
License to copy and use this software is granted provided that it is
|
||||
identified as "RSA Security Inc. PKCS #11 Cryptographic Token Interface
|
||||
(Cryptoki)" in all material mentioning or referencing this software.
|
||||
|
||||
License is also granted to make and use derivative works provided that such
|
||||
works are identified as "derived from the RSA Security Inc. PKCS #11
|
||||
Cryptographic Token Interface (Cryptoki)" in all material mentioning or
|
||||
referencing the derived work.
|
||||
|
||||
RSA Security Inc. makes no representations concerning either the
|
||||
merchantability of this software or the suitability of this software for any
|
||||
particular purpose. It is provided "as is" without express or implied warranty
|
||||
of any kind.
|
||||
|
||||
-------------------
|
||||
|
||||
WinPcap:
|
||||
Copyright (c) 2001 - 2003 NetGroup, Politecnico di Torino (Italy)
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
3. Neither the name of the Politecnico di Torino nor the names of its
|
||||
contributors may be used to endorse or promote products derived from this
|
||||
software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
-------------------
|
||||
|
||||
libedit:
|
||||
Copyright (c) 1992, 1993 The Regents of the University of California. All
|
||||
rights reserved.
|
||||
|
||||
This code is derived from software contributed to Berkeley by Christos Zoulas
|
||||
of Cornell University.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
3. Neither the name of the University nor the names of its contributors may be
|
||||
used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
-------------------
|
||||
|
||||
libiconv:
|
||||
|
||||
GNU LIBRARY GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1991 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
Everyone is permitted to copy and distribute verbatim copies of this license
|
||||
document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the library GPL. It is
|
||||
numbered 2 because it goes with version 2 of the ordinary GPL.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your freedom to
|
||||
share and change it. By contrast, the GNU General Public Licenses are intended
|
||||
to guarantee your freedom to share and change free software--to make sure the
|
||||
software is free for all its users.
|
||||
|
||||
This license, the Library General Public License, applies to some specially
|
||||
designated Free Software Foundation software, and to any other libraries whose
|
||||
authors decide to use it. You can use it for your libraries, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not price. Our
|
||||
General Public Licenses are designed to make sure that you have the freedom to
|
||||
distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new free
|
||||
programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid anyone to
|
||||
deny you these rights or to ask you to surrender the rights. These
|
||||
restrictions translate to certain responsibilities for you if you distribute
|
||||
copies of the library, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis or for
|
||||
a fee, you must give the recipients all the rights that we gave you. You must
|
||||
make sure that they, too, receive or can get the source
|
||||
code. If you link a program with the library, you must provide complete object
|
||||
files to the recipients so that they can relink them with the library, after
|
||||
making changes to the library and recompiling it. And you must show them these
|
||||
terms so they know their rights.
|
||||
|
||||
Our method of protecting your rights has two steps: (1) copyright the
|
||||
library, and (2) offer you this license which gives you legal permission to
|
||||
copy, distribute and/or modify the library.
|
||||
|
||||
Also, for each distributor's protection, we want to make certain that
|
||||
everyone understands that there is no warranty for this free library. If the
|
||||
library is modified by someone else and passed on, we want its recipients to
|
||||
know that what they have is not the original version, so that any problems
|
||||
introduced by others will not reflect on the original authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software patents. We
|
||||
wish to avoid the danger that companies distributing free software will
|
||||
individually obtain patent licenses, thus in effect transforming the program
|
||||
into proprietary software. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the ordinary GNU
|
||||
General Public License, which was designed for utility programs. This license,
|
||||
the GNU Library General Public License, applies to certain designated
|
||||
libraries. This license is quite different from the ordinary one; be sure to
|
||||
read it in full, and don't assume that anything in it is the same as in the
|
||||
ordinary license.
|
||||
|
||||
The reason we have a separate public license for some libraries is that they
|
||||
blur the distinction we usually make between modifying or adding to a program
|
||||
and simply using it. Linking a program with a library, without changing the
|
||||
library, is in some sense simply using the library, and is analogous to
|
||||
running a utility program or application program. However, in a textual and
|
||||
legal sense, the linked executable is a combined work, a derivative of the
|
||||
original library, and the ordinary General Public License treats it as such.
|
||||
|
||||
Because of this blurred distinction, using the ordinary General Public
|
||||
License for libraries did not effectively promote software sharing, because
|
||||
most developers did not use the libraries. We concluded that weaker conditions
|
||||
might promote sharing better.
|
||||
|
||||
However, unrestricted linking of non-free programs would deprive the users
|
||||
of those programs of all benefit from the free status of the libraries
|
||||
themselves. This Library General Public License is intended to
|
||||
permit developers of non-free programs to use free libraries, while preserving
|
||||
your freedom as a user of such programs to change the free libraries that are
|
||||
incorporated in them. (We have not seen how to achieve this as regards changes
|
||||
in header files, but we have achieved it as regards changes in the actual
|
||||
functions of the Library.) The hope is that this will lead to faster
|
||||
development of free libraries.
|
||||
|
||||
The precise terms and conditions for copying, distribution and modification
|
||||
follow. Pay close attention to the difference between a "work based on the
|
||||
library" and a "work that uses the library". The former contains code derived
|
||||
from the library, while the latter only works together with the library.
|
||||
|
||||
Note that it is possible for a library to be covered by the ordinary General
|
||||
Public License rather than by this special one.
|
||||
|
||||
GNU LIBRARY GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library which contains a
|
||||
notice placed by the copyright holder or other authorized party saying it may
|
||||
be distributed under the terms of this Library
|
||||
General Public License (also called "this License"). Each licensee is
|
||||
addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data prepared so
|
||||
as to be conveniently linked with application programs (which use some of
|
||||
those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work which has
|
||||
been distributed under these terms. A "work based on the Library" means either
|
||||
the Library or any derivative work under copyright law: that is to say, a work
|
||||
containing the Library or a portion of it, either verbatim or with
|
||||
modifications and/or translated straightforwardly into another language.
|
||||
(Hereinafter, translation is included without limitation in the term
|
||||
"modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for making
|
||||
modifications to it. For a library, complete source code means all the source
|
||||
code for all modules it contains, plus any associated interface definition
|
||||
files, plus the scripts used to control compilation and installation of the
|
||||
library.
|
||||
|
||||
Activities other than copying, distribution and modification are not covered
|
||||
by this License; they are outside its scope. The act of running a program
|
||||
using the Library is not restricted, and output from such a program is covered
|
||||
only if its contents constitute a work based on the Library (independent of
|
||||
the use of the Library in a tool for writing it). Whether that is true depends
|
||||
on what the Library does and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's complete
|
||||
source code as you receive it, in any medium, provided that you conspicuously
|
||||
and appropriately publish on each copy an appropriate copyright notice and
|
||||
disclaimer of warranty; keep intact all the notices that refer to this License
|
||||
and to the absence of any warranty; and distribute a copy of this License
|
||||
along with the Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and you
|
||||
may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion of it,
|
||||
thus forming a work based on the Library, and copy and distribute such
|
||||
modifications or work under the terms of Section 1 above, provided that you
|
||||
also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices stating
|
||||
that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no charge to all
|
||||
third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a table
|
||||
of data to be supplied by an application program that uses the facility, other
|
||||
than as an argument passed when the facility is invoked, then you must make a
|
||||
good faith effort to ensure that, in the event an application does not supply
|
||||
such function or table, the facility still operates, and performs whatever
|
||||
part of its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has a
|
||||
purpose that is entirely well-defined independent of the application.
|
||||
Therefore, Subsection 2d requires that any application-supplied function or
|
||||
table used by this function must be optional: if the application does not
|
||||
supply it, the square root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If identifiable
|
||||
sections of that work are not derived from the Library, and can be reasonably
|
||||
considered independent and separate works in themselves, then this License,
|
||||
and its terms, do not apply to those sections when you distribute them as
|
||||
separate works. But when you distribute the same sections as part of a whole
|
||||
which is a work based on the Library, the distribution of the whole must be on
|
||||
the terms of this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest your
|
||||
rights to work written entirely by you; rather, the intent is to exercise the
|
||||
right to control the distribution of derivative or collective works based on
|
||||
the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library with
|
||||
the Library (or with a work based on the Library) on a volume of a storage or
|
||||
distribution medium does not bring the other work under the scope of this
|
||||
License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do this,
|
||||
you must alter all the notices that refer to this License, so that they refer
|
||||
to the ordinary GNU General Public License, version 2, instead of to this
|
||||
License. (If a newer version than version 2 of the ordinary GNU General Public
|
||||
License has appeared, then you can specify that version instead if you wish.)
|
||||
Do not make any other change in these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for that copy,
|
||||
so the ordinary GNU General Public License applies to all subsequent copies
|
||||
and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of the Library
|
||||
into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or derivative of
|
||||
it, under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you accompany it with the complete
|
||||
corresponding machine-readable source code, which must be distributed under
|
||||
the terms of Sections 1 and 2 above on a medium customarily used for software
|
||||
interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy from a
|
||||
designated place, then offering equivalent access to copy the source code from
|
||||
the same place satisfies the requirement to distribute the source code, even
|
||||
though third parties are not compelled to copy the source along with the
|
||||
object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the Library, but
|
||||
is designed to work with the Library by being compiled or linked with it, is
|
||||
called a "work that uses the Library". Such a work, in isolation, is not a
|
||||
derivative work of the Library, and therefore falls outside the scope of this
|
||||
License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library creates an
|
||||
executable that is a derivative of the Library (because it contains portions
|
||||
of the Library), rather than a "work that uses the library". The executable is
|
||||
therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file that is
|
||||
part of the Library, the object code for the work may be a derivative work of
|
||||
the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be linked
|
||||
without the Library, or if the work is itself a library. The threshold for
|
||||
this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data structure
|
||||
layouts and accessors, and small macros and small inline functions (ten lines
|
||||
or less in length), then the use of the object file is unrestricted,
|
||||
regardless of whether it is legally a derivative work. (Executables containing
|
||||
this object code plus portions of the Library will still fall under Section
|
||||
6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may distribute
|
||||
the object code for the work under the terms of Section 6. Any executables
|
||||
containing that work also fall under Section 6, whether or not they are linked
|
||||
directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also compile or link a
|
||||
"work that uses the Library" with the Library to produce a work containing
|
||||
portions of the Library, and distribute that work under terms of your choice,
|
||||
provided that the terms permit modification of the work for the customer's own
|
||||
use and reverse engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the Library
|
||||
is used in it and that the Library and its use are covered by this License.
|
||||
You must supply a copy of this License. If the work during execution displays
|
||||
copyright notices, you must include the copyright notice for the Library among
|
||||
them, as well as a reference directing the user to the copy of this License.
|
||||
Also, you must do one of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding machine-readable
|
||||
source code for the Library including whatever changes were used in the work
|
||||
(which must be distributed under Sections 1 and 2 above) ; and, if the work is
|
||||
an executable linked with the Library, with the complete machine-readable
|
||||
"work that uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified executable
|
||||
containing the modified Library. (It is understood that the user who changes
|
||||
the contents of definitions files in the Library will not necessarily be able
|
||||
to recompile the application to use the modified definitions.)
|
||||
|
||||
b) Accompany the work with a written offer, valid for at least three
|
||||
years, to give the same user the materials specified in Subsection 6a, above,
|
||||
for a charge no more than the cost of performing this distribution.
|
||||
|
||||
c) If distribution of the work is made by offering access to copy from a
|
||||
designated place, offer equivalent access to copy the above specified
|
||||
materials from the same place.
|
||||
|
||||
d) Verify that the user has already received a copy of these materials or
|
||||
that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the Library"
|
||||
must include any data and utility programs needed for reproducing the
|
||||
executable from it. However, as a special exception, the source code
|
||||
distributed need not include anything that is normally distributed (in either
|
||||
source or binary form) with the major components (compiler, kernel, and so on)
|
||||
of the operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license restrictions of
|
||||
other proprietary libraries that do not normally accompany the operating
|
||||
system. Such a contradiction means you cannot use both them and the Library
|
||||
together in an executable that you distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the Library
|
||||
side-by-side in a single library together with other library facilities not
|
||||
covered by this License, and distribute such a combined library, provided that
|
||||
the separate distribution of the work based on the Library and of the other
|
||||
library facilities is otherwise permitted, and provided that you do these two
|
||||
things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work based on
|
||||
the Library, uncombined with any other library facilities. This must be
|
||||
distributed under the terms of the Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact that part
|
||||
of it is a work based on the Library, and explaining where to find the
|
||||
accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute the
|
||||
Library except as expressly provided under this License. Any attempt otherwise
|
||||
to copy, modify, sublicense, link with, or distribute the Library is void, and
|
||||
will automatically terminate your rights under this License. However, parties
|
||||
who have received copies, or rights, from you under this License will not have
|
||||
their licenses terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not signed
|
||||
it. However, nothing else grants you permission to modify or distribute the
|
||||
Library or its derivative works. These actions are prohibited by law if you do
|
||||
not accept this License. Therefore, by modifying or distributing the Library
|
||||
(or any work based on the Library), you indicate your acceptance of this
|
||||
License to do so, and all its terms and conditions for copying, distributing
|
||||
or modifying the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the original
|
||||
licensor to copy, distribute, link with or modify the Library subject to these
|
||||
terms and conditions. You may not impose any further restrictions on the
|
||||
recipients' exercise of the rights granted herein. You are not responsible for
|
||||
enforcing compliance by third parties to this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or otherwise)
|
||||
that contradict the conditions of this License, they do not excuse you from
|
||||
the conditions of this License. If you cannot distribute so as to satisfy
|
||||
simultaneously your obligations under this License and any other pertinent
|
||||
obligations, then as a consequence you may not distribute the Library at all.
|
||||
For example, if a patent license would not permit royalty-free redistribution
|
||||
of the Library by all those who receive copies directly or indirectly through
|
||||
you, then the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply, and
|
||||
the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any patents or
|
||||
other property right claims or to contest validity of any such claims; this
|
||||
section has the sole purpose of protecting the integrity of the free software
|
||||
distribution system which is implemented by public license practices. Many
|
||||
people have made generous contributions to the wide range of software
|
||||
distributed through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing to
|
||||
distribute software through any other system and a licensee cannot impose that
|
||||
choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to be a
|
||||
consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in certain
|
||||
countries either by patents or by copyrighted interfaces, the original
|
||||
copyright holder who places the Library under this License may add an explicit
|
||||
geographical distribution limitation excluding those countries, so that
|
||||
distribution is permitted only in or among countries not thus excluded. In
|
||||
such case, this License incorporates the limitation as if written in the body
|
||||
of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new versions of
|
||||
the Library General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and "any later
|
||||
version", you have the option of following the terms and conditions either of
|
||||
that version or of any later version published by the Free Software
|
||||
Foundation. If the Library does not specify a license version number, you may
|
||||
choose any version ever published by the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free programs
|
||||
whose distribution conditions are incompatible with these, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free Software
|
||||
Foundation, write to the Free Software Foundation; we sometimes make
|
||||
exceptions for this. Our decision will be guided by the two goals of
|
||||
preserving the free status of all derivatives of our free software and of
|
||||
promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR
|
||||
THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE
|
||||
STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE
|
||||
LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
|
||||
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
|
||||
PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE,
|
||||
YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO
|
||||
LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR
|
||||
THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
-------------------
|
||||
|
||||
ncurses:
|
||||
Copyright (c) 1998-2005,2006 Free Software Foundation, Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, distribute with
|
||||
modifications, sublicense, and/or sell copies of the Software, and to permit
|
||||
persons to whom the Software is furnished to do so, subject to the following
|
||||
conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
|
||||
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
Except as contained in this notice, the name(s) of the above copyright holders
|
||||
shall not be used in advertising or otherwise to promote the sale, use or
|
||||
other dealings in this Software without prior written authorization.
|
||||
|
||||
-------------------
|
||||
|
||||
OpenSSL:
|
||||
OpenSSL License
|
||||
Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. All advertising materials mentioning features or use of this software must
|
||||
display the following acknowledgment: "This product includes software
|
||||
developed by the OpenSSL Project for use in the OpenSSL Toolkit.
|
||||
(http://www.openssl.org/)"
|
||||
|
||||
4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||
endorse or promote products derived from this software without prior written
|
||||
permission. For written permission, please contact openssl-core@openssl.org.
|
||||
|
||||
5. Products derived from this software may not be called "OpenSSL" nor may
|
||||
"OpenSSL" appear in their names without prior written permission of the
|
||||
OpenSSL Project.
|
||||
|
||||
6. Redistributions of any form whatsoever must retain the following
|
||||
acknowledgment: "This product includes software developed by the OpenSSL
|
||||
Project for use in the OpenSSL Toolkit (http://www.openssl.org/)"
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY EXPRESSED
|
||||
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
EVENT SHALL THE OpenSSL PROJECT OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
This product includes cryptographic software written by Eric Young
|
||||
(eay@cryptsoft.com). This product includes software written by Tim Hudson
|
||||
(tjh@cryptsoft.com).
|
||||
|
||||
Original SSLeay License
|
||||
Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) All rights reserved.
|
||||
|
||||
This package is an SSL implementation written by Eric Young
|
||||
(eay@cryptsoft.com). The implementation was written so as to conform with
|
||||
Netscapes SSL.
|
||||
|
||||
This library is free for commercial and non-commercial use as long as the
|
||||
following conditions are aheared to. The following conditions apply to all
|
||||
code found in this distribution, be it the RC4, RSA, lhash, DES, etc., code;
|
||||
not just the SSL code. The SSL documentation included with this distribution
|
||||
is covered by the same copyright terms except that the holder is Tim Hudson
|
||||
(tjh@cryptsoft.com).
|
||||
|
||||
Copyright remains Eric Young's, and as such any Copyright notices in the code
|
||||
are not to be removed. If this package is used in a product, Eric Young should
|
||||
be given attribution as the author of the parts of the library used. This can
|
||||
be in the form of a textual message at program startup or in documentation
|
||||
(online or textual) provided with the package.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
1. Redistributions of source code must retain the copyright notice, this list
|
||||
of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
3. All advertising materials mentioning features or use of this software must
|
||||
display the following acknowledgement: "This product includes cryptographic
|
||||
software written by Eric Young (eay@cryptsoft.com)" The word 'cryptographic'
|
||||
can be left out if the rouines from the library being used are not
|
||||
cryptographic related :-).
|
||||
4. If you include any Windows specific code (or a derivative thereof) from the
|
||||
apps directory (application code) you must include an acknowledgement: "This
|
||||
product includes software written by Tim Hudson (tjh@cryptsoft.com)"
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
The licence and distribution terms for any publically available version or
|
||||
derivative of this code cannot be changed. i.e. this code cannot simply be
|
||||
copied and put under another distribution licence [including the GNU Public
|
||||
Licence.]
|
||||
|
||||
-------------------
|
||||
|
||||
zlib:
|
||||
Acknowledgments:
|
||||
The deflate format used by zlib was defined by Phil Katz. The deflate and
|
||||
zlib specifications were written by L. Peter Deutsch. Thanks to all the people
|
||||
who reported problems and suggested various improvements in zlib; they are too
|
||||
numerous to cite here.
|
||||
|
||||
Copyright notice:
|
||||
(C) 1995-2004 Jean-loup Gailly and Mark Adler
|
||||
|
||||
This software is provided 'as-is', without any express or implied warranty.
|
||||
In no event will the authors be held liable for any damages arising from the
|
||||
use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it freely,
|
||||
subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software in a
|
||||
product, an acknowledgment in the product documentation would be appreciated
|
||||
but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
Jean-loup Gailly Mark Adler
|
||||
jloup@gzip.org madler@alumni.caltech.edu
|
||||
|
||||
If you use the zlib library in a product, we would appreciate *not* receiving
|
||||
lengthy legal documents to sign. The sources are provided for free but without
|
||||
warranty of any kind. The library has been entirely written by Jean-loup
|
||||
Gailly and Mark Adler; it does not include third-party code.
|
||||
|
||||
If you redistribute modified sources, we would appreciate that you include in
|
||||
the file ChangeLog history information documenting your changes. Please read
|
||||
the FAQ for more information on the distribution of modified source versions.
|
||||
|
||||
-------------------
|
||||
|
||||
Intel AESNI Sample Library:
|
||||
|
||||
Copyright (c) 2010, Intel Corporation
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
Issue Date: Aug 6, 2010
|
||||
|
||||
-------------------
|
||||
|
||||
NOTES WRITTEN BY SOFTETHER CORPORATION
|
||||
|
||||
Note for users of non-Windows version of PacketiX VPN: The enumerated bundle
|
||||
of License Agreements above are copies of original License Agreements of each
|
||||
library programs which PacketiX VPN uses. PacketiX VPN is not a delivered work
|
||||
from these libraries. PacketiX VPN is a separated work from the libraries, but
|
||||
it may call functions of the libraries (whether or not PacketiX VPN calls such
|
||||
functions are depended on the user's intention to link them or not on user's
|
||||
side computer). While some libraries indicate GPL or LGPL as a condition to
|
||||
re-distribute, PacketiX VPN is not license under GPL nor LGPL. Therefore, we
|
||||
took special care not to make PacketiX VPN become delivered works of any GPL
|
||||
or LGPL libraries. In order to achieve that, both PacketiX VPN and GPL/LGPL
|
||||
libraries are distributed with isolated forms (means that any program files of
|
||||
PacketiX VPN are not bound nor linked to any GPL/LGPL libraries). If a user of
|
||||
PacketiX VPN wants to link GPL/LGPL libraries by their own decisions,
|
||||
operations and responsibilities, he may do that on his computer. However, if a
|
||||
delivered work under copyright law is created as a result of such an
|
||||
operation, such a delivered work must not re-distributed to other people,
|
||||
because it may violate GPL/LGPL libraries' conditions.
|
||||
|
||||
Note for users of Windows version of PacketiX VPN: For technical reason, the
|
||||
above texts are exactly same as a file which is also contained on the
|
||||
non-Windows version of PacketiX VPN. Actually, the Windows version of PacketiX
|
||||
VPN has no relations to any GPL/LGPL libraries enumerated above.
|
||||
|
||||
SoftEther Corporation provides source codes of some GPL/LGPL/other libraries
|
||||
listed above on its web server. Anyone can download, use and re-distribute
|
||||
them under individual licenses which are contained on each archive file,
|
||||
available from the following URL:
|
||||
http://uploader.softether.co.jp/src/
|
||||
|
523
WARNING.TXT
Normal file
523
WARNING.TXT
Normal file
@ -0,0 +1,523 @@
|
||||
THE IMPORTANT NOTICES ABOUT SOFTETHER VPN
|
||||
|
||||
FUNCTIONS OF VPN COMMUNICATIONS EMBEDDED ON THIS SOFTWARE ARE VERY POWERFUL
|
||||
THAN EVER. THIS STRONG VPN ABILITY WILL BRING YOU HUGE BENEFITS. HOWEVER, IF
|
||||
YOU MISUSE THIS SOFTWARE, IT MIGHT DAMAGES YOURSELF. IN ORDER TO AVOID SUCH
|
||||
RISKS, THIS DOCUMENT ACCOUNTS IMPORTANT NOTICES FOR CUSTOMERS WHO ARE WILLING
|
||||
TO USE THIS SOFTWARE. THE FOLLOWING INSTRUCTIONS ARE VERY IMPORTANT. READ AND
|
||||
UNDERSTAND IT CAREFULLY. ADDITIONALLY, IF YOU ARE PLANNING TO USE THE DYNAMIC
|
||||
DNS, THE NAT TRAVERSAL OR THE VPN AZURE FUNCTIONS, READ THE SECTION 3.5
|
||||
CAREFULLY. THESE FUNCTIONS ARE FREE SERVICES PROVIDED VIA THE INTERNET, ARE
|
||||
NOT GUARANTEED, AND ARE NOT INTENDED TO BE USED FOR BUSINESS OR COMMERCIAL
|
||||
USE. DO NOT USE THESE SERVICES FOR YOUR BUSINESS OR COMMERCIAL USE.
|
||||
|
||||
|
||||
1. VPN Communication Protocols
|
||||
1.1. SoftEther VPN Protocol
|
||||
SoftEther VPN can perform VPN communication. Unlike traditional VPN protocols,
|
||||
SoftEther VPN has an implementation of the newly-designed "SoftEther VPN
|
||||
Protocol (SE-VPN Protocol)" . SE-VPN protocol encapsulates any Ethernet
|
||||
packets into a HTTPS (HTTP over SSL) connection. Therefore SE-VPN protocol can
|
||||
communicate beyond firewalls even if the firewall is configured to block
|
||||
traditional VPN packets by network administrator. SE-VPN protocol is designed
|
||||
and implemented to comply TLS 1.0 (RFC 5246) and HTTPS (RFC 2818). However, it
|
||||
sometimes have different behavior to RFCs. If you are a network administrator
|
||||
and want to block SE-VPN protocols on the firewall, you can adopt a
|
||||
"white-list" policy on the firewall to filter any TCP or UDP packets on the
|
||||
border except explicitly allowed packets towards specific web sites and
|
||||
servers.
|
||||
|
||||
1.2. NAT Traversal Function
|
||||
Generally, if you use traditional VPN systems you have to request a network
|
||||
administrator to make the NAT or firewall to "open" or "relay" specific TCP or
|
||||
UDP ports. However, there are demands somehow to eliminate such working costs
|
||||
on network administrators. In order to satisfy such demands, SoftEther VPN has
|
||||
the newly-implemented "NAT Traversal" function. NAT Traversal is enabled by
|
||||
default. A SoftEther VPN Server running on the computer behind NAT or firewall
|
||||
can accept VPN connections from the Internet, without any special
|
||||
configurations on firewalls or NATs. If you want to disable the NAT Traversal
|
||||
function, modify the "DisableNatTraversal" to "true" on the configuration file
|
||||
of SoftEther VPN Server. In order to disable it on the client-side, append
|
||||
"/tcp" suffix on the destination hostname.
|
||||
|
||||
1.3. Dynamic DNS Function
|
||||
Traditional legacy VPN system requires a static global IP address on the VPN
|
||||
server. In consideration of shortage of global IP addresses, SoftEther
|
||||
Corporation implements the "Dynamic DNS Function" on SoftEther VPN Server.
|
||||
Dynamic DNS is enabled by default. Dynamic DNS function notify the current
|
||||
global IP address of the PC to the Dynamic DNS Servers which are operated by
|
||||
SoftEther Corporation. A globally-unique hostname (FQDN) such as
|
||||
"abc.softether.net" ( "abc" varies as unique per a user) will be assigned on
|
||||
the VPN Server. If you tell this unique hostname to a VPN user, the user can
|
||||
specify it as the destination VPN Sever hostname on the VPN Client and will be
|
||||
able to connect the VPN Server. No IP addresses are required to know
|
||||
beforehand. If the IP address of the VPN Server varies, the registered IP
|
||||
address related to the hostname of Dynamic DNS service will be changed
|
||||
automatically. By this mechanism, no longer need a static global IP address
|
||||
which costs monthly to ISPs. You can use consumer-level inexpensive Internet
|
||||
connection with dynamic IP address in order to operate an enterprise-level VPN
|
||||
system. If you want to disable Dynamic DNS, specify "true" on the "Disabled"
|
||||
items of the "DDnsClient" directive on the SoftEther VPN Server configuration
|
||||
file. * Note for residents in People's Republic of China: If your VPN Server
|
||||
is running on the People's Republic of China, the DNS suffix will be replaced
|
||||
to "sedns.cn" domain. The "sedns.cn" domain is the service possessed and
|
||||
operated by "Beijing Daiyuu SoftEther Technology Co., Ltd" which is a
|
||||
Chinese-local enterprise.
|
||||
|
||||
1.4. VPN over ICMP / VPN over DNS functions
|
||||
If you want to make a VPN connection between SoftEther VPN Client / Bridge and
|
||||
SoftEther VPN Server, but if TCP and UDP packets are prohibited by the
|
||||
firewall, then you can encapsulates payloads into "ICMP" (as known as Ping) or
|
||||
"DNS" packets. This function can realize a VPN connection by using ICMP or DNS
|
||||
even if the firewall or router blocks every TCP or UDP connections. VPN over
|
||||
ICMP / VPN over DNS functions are designed to comply standard ICMP and DNS
|
||||
specifications as possible, however it sometimes has a behavior not to fully
|
||||
comply them. Therefore, few poor-quality routers may be caused a
|
||||
memory-overflow or something troubles when a lot of ICMP or DNS packets are
|
||||
passed, and such routers sometimes freezes or reboots. It might affects other
|
||||
users on the same network. To avoid such risks, append the suffix "/tcp" on
|
||||
the destination hostname which is specified on the VPN-client side to disable
|
||||
VPN over ICMP / DNS functions.
|
||||
|
||||
1.5. VPN Azure Cloud Service
|
||||
If your SoftEther VPN Server is placed behind the NAT or firwall, and by some
|
||||
reason you cannot use NAT Traversal function, Dynamic DNS function or VPN over
|
||||
ICMP/DNS function, you can use VPN Azure Clouse Service. SoftEther Corporation
|
||||
operates VPN Azure Cloud on Internet. After the VPN Server makes a connection
|
||||
to the VPN Azure Cloud, the hostname "abc.vpnazure.net" ( "abc" is a unique
|
||||
hostname) can be specified to connect to the VPN Server via the VPN Azure
|
||||
Cloud. Practically, such a hostname is pointing a global IP address of one of
|
||||
cloud servers which are operated by SoftEther Corporation. If A VPN Client
|
||||
connects to such a VPN Azure host, then the VPN Azure host will relay all
|
||||
traffics between the VPN Client and the VPN Server. VPN Azure is disabled by
|
||||
default. You can activate it easily by using VPN Server Configuration Tool.
|
||||
|
||||
1.6. UDP Acceleration
|
||||
SoftEther VPN has the UDP Acceleration Function. If a VPN consists of two
|
||||
sites detects that UDP channel can be established, UDP will be automatically
|
||||
used. By this function, throughput of UDP increases. If direct UDP channel can
|
||||
be established, direct UDP packets will be used. However, if there is
|
||||
something obstacles such as firewalls or NATs, the "UDP Hole Punching"
|
||||
technology will be used, instead. The "UDP Hole Punching" uses the cloud
|
||||
servers which SoftEther Corporation operates on Internet. UDP Acceleration can
|
||||
be disabled anytime by setting up so on the VPN-client side.
|
||||
|
||||
|
||||
2. VPN Software
|
||||
2.1. SoftEther VPN Client
|
||||
If you use SoftEther VPN Client on Windows, the Virtual Network Adapter device
|
||||
driver will be installed on Windows. The Virtual Network Adapter is
|
||||
implemented as a kernel-mode driver for Windows. The driver is
|
||||
digitally-signed by a certificate issued by VeriSign, Inc. and also sub-signed
|
||||
by Symantec Corporation. A message to ask you want to sure install the driver
|
||||
might be popped up on the screen. SoftEther VPN Client may response the
|
||||
message if possible. SoftEther VPN Client also optimizes the configuration of
|
||||
MMCSS (Multimedia Class Scheduler Service) on Windows. You can undo the
|
||||
optimizations of MMCSS afterwards.
|
||||
|
||||
2.2. SoftEther VPN Server / Bridge
|
||||
If you use SoftEther VPN Server / Bridge on Windows with "Local Bridge"
|
||||
functions, you have to install the low-level Ethernet packet processing driver
|
||||
on the computer. The driver is digitally-signed by a certificate issued by
|
||||
VeriSign, Inc. and also sub-signed by Symantec Corporation. SoftEther VPN
|
||||
Server / Bridge may disable the TCP/IP offloading features on the physical
|
||||
network adapter for Local Bridge function. In Windows Vista / 2008 or greater
|
||||
version, VPN Server may inject a packet-filter driver which complies Windows
|
||||
Filter Platform (WPF) specification into the kernel in order to provide IPsec
|
||||
function. The packet-filter driver will be loaded available only if IPsec
|
||||
function is enabled. Once you enables IPsec function of SoftEther VPN Server,
|
||||
the built-in IPsec function of Windows will be disabled. After you disabled
|
||||
IPsec function of SoftEther VPN Server, then the built-in IPsec function of
|
||||
Windows will revive. In order to provide the Local Bridge function, SoftEther
|
||||
VPN Server / Bridge disables the TCP/IP offloading function on the operating
|
||||
system.
|
||||
|
||||
2.3. User-mode Installation
|
||||
You can install SoftEther VPN Server and SoftEther VPN Bridge as "User-mode"
|
||||
on Windows. In other words, even if you don't have Windows system
|
||||
administrator's privileges, you can install SoftEther VPN as a normal user.
|
||||
User-mode install will disable a few functions, however other most functions
|
||||
work well. Therefore, for example, an employee can install SoftEther VPN
|
||||
Server on the computer in the office network, and he will be able to connect
|
||||
to the server from his home. In order to realize such a system by user-self,
|
||||
no system administrative privileges are required in the view-point of
|
||||
technical. However, breaking rules of the company to install software on the
|
||||
computer without authority might be regarded as an unfavorable behavior. If
|
||||
you are an employee and belong to the company, and the company-policy
|
||||
prohibits installing software or making communications towards Internet
|
||||
without permission, you have to obtain a permission from the network
|
||||
administrator or the executive officer of your company in advance to install
|
||||
SoftEther VPN. If you install VPN Server / Bridge as User-mode, an icon will
|
||||
be appeared on the Windows task-tray. If you feel that the icon disturbs you,
|
||||
you can hide it by your operation. However, you must not exploit this hiding
|
||||
function to install VPN Server on other person's computer as a spyware. Such
|
||||
behavior might be an offence against the criminal law.
|
||||
|
||||
2.4. Keep Alive Function
|
||||
SoftEther VPN Server and SoftEther VPN Bridge has Keep Alive Function by
|
||||
default. The purpose of this function is to sustain the Internet line active.
|
||||
The function transmits UDP packets with a random-byte-array-payload
|
||||
periodically. This function is useful to avoid automatic disconnection on
|
||||
mobile or dial-up connections. You can disable Keep Alive Function anytime.
|
||||
|
||||
2.5. Uninstallation
|
||||
The uninstallation process of SoftEther VPN software will delete all program
|
||||
files. However, non-program files (such as files and data which are generated
|
||||
by running of programs) ) will not be deleted. For technical reason, the exe
|
||||
and resource files of uninstaller might remain. Such remaining files never
|
||||
affects to use the computer, however you can delete it manually. Kernel-mode
|
||||
drivers might not be deleted, however such drivers will not be loaded after
|
||||
the next boot of Windows. You can use "sc" command of Windows to delete
|
||||
kernel-mode drivers manually.
|
||||
|
||||
2.6. Security
|
||||
You should set the administrator's password on SoftEther VPN Server / Bridge
|
||||
after installation. If you neglect to do it, another person can access to
|
||||
SoftEther VPN Server / Bridge and can set the password without your
|
||||
permission. This caution might be also applied on SoftEther VPN Client for
|
||||
Linux.
|
||||
|
||||
2.7. Automatic Update Notification
|
||||
SoftEther VPN software for Windows has an automatic update notification
|
||||
function. It accesses to the SoftEther Update server periodically to check
|
||||
whether or not the latest version of software is released. If the latest
|
||||
version is released, the notification message will be popped up on the screen.
|
||||
In order to achieve this purpose, the version, language settings, the unique
|
||||
identifier, the IP address of your computer and the hostname of VPN Server
|
||||
which is connected to will be sent to the SoftEther Update server. No personal
|
||||
information will be sent. Automatic Update Notification is enabled by default,
|
||||
however you can disable it on the configuration screen. The setting whether
|
||||
turned on or turned off will be saved individually corresponding to each
|
||||
destination VPN server, by VPN Server Manager.
|
||||
|
||||
2.8. Virtual NAT Function
|
||||
A Virtual Hub on SoftEther VPN Server / Bridge has "Virtual NAT Function" .
|
||||
Virtual NAT Function can share a single IP address on the physical network by
|
||||
multiple private IP address of VPN Clients. There are two operation mode of
|
||||
Virtual NAT: User-mode and Kernel-mode. In the user-mode operation, Virtual
|
||||
NAT shares an IP address which is assigned on the host operating system.
|
||||
Unlike user-mode, the kernel-mode operation attempts to find DHCP servers on
|
||||
the physical network. If there are two or more physical networks, a DHCP
|
||||
server will be sought automatically for each segments serially. If a DHCP
|
||||
server found, and an IP address is acquired, the IP address will be used by
|
||||
the Virtual NAT. In this case, an IP entry as a DHCP client will be registered
|
||||
on the IP pool of the physical DHCP Server. The physical default gateway and
|
||||
the DNS server will be used by the Virtual NAT in order to communicate with
|
||||
hosts in Internet. In kernel-mode operation, a Virtual Hub has a virtual MAC
|
||||
address which is operating on the physical Ethernet segment. In order to check
|
||||
the connectivity to Internet, SoftEther VPN periodically sends DNS query
|
||||
packet to resolve the IP address of host "www.yahoo.com" or "www.baidu.com" ,
|
||||
and attempts to connect to the TCP port 80 of such a resulted IP address for
|
||||
connectivity check.
|
||||
|
||||
2.9. Unattended Installation of Kernel-mode Components
|
||||
When SoftEther VPN will detect a necessity to install the kernel-mode
|
||||
components on Windows, a confirmation message will be appeared by Windows
|
||||
system. In this occasion, SoftEther VPN software will switch to the Unattended
|
||||
Installation mode in order to respond "Yes" to Windows. This is a solution to
|
||||
prevent dead-locks when a remote-administration is performed from remote
|
||||
place.
|
||||
|
||||
2.10. Windows Firewall
|
||||
SoftEther VPN software will register itself as a safe-program. Such an entry
|
||||
will be remain after the uninstallation. You can remove it manually from the
|
||||
Control Panel of Windows.
|
||||
|
||||
|
||||
3. Internet Services
|
||||
3.1. Internet Services which are provided by SoftEther Corporation
|
||||
SoftEther Corporation provides Dynamic DNS, NAT Traversal and VPN Azure server
|
||||
services on the Internet. These services are free of charge. Customers can
|
||||
access to the services by using SoftEther VPN software, via Internet. These
|
||||
service will be planned to be available from Open-Source version of "SoftEther
|
||||
VPN" which will be released in the future.
|
||||
|
||||
3.2. Sent Information and Privacy Protection
|
||||
SoftEther VPN software may send an IP address, hostname, the version of VPN
|
||||
software on the customer's computer to the cloud service operated by SoftEther
|
||||
Corporation, in order to use the above services. These sending of information
|
||||
are minimal necessary to use the services. No personal information will be
|
||||
sent. SoftEther Corporation records log files of the cloud service servers for
|
||||
90 days at least with the received information. Such logs will be used for
|
||||
troubleshooting and other legitimate activities. SoftEther Corporation may
|
||||
provide logs to a public servant of Japanese government who are belonging to
|
||||
courts, police stations and the prosecutor's office, in order to comply such
|
||||
authorities' order. (Every Japanese public servants are liable by law to keep
|
||||
the information close.) Moreover, the IP addresses or other information will
|
||||
be processed statistically and provided to the public, not to expose the each
|
||||
concrete IP address, in order to release the release of research activities.
|
||||
|
||||
3.3. Communication Data via VPN Azure Service
|
||||
Regardless of the above 3.2 rule, if the customer sends or receives VPN
|
||||
packets using VPN Azure Cloud Service, the actual payloads will stored and
|
||||
forwarded via the volatile memory of the servers for very short period. Such a
|
||||
behavior is naturally needed to provide the "VPN relay service" . No payloads
|
||||
will be recorded on "fixed" storages such as hard-drives. However, the
|
||||
"Wiretapping for Criminals Procedures Act" (The 137th legislation ruled on
|
||||
August 18, 1999 in Japan) requires telecommunication companies to allow the
|
||||
Japanese government authority to conduct a wire-tapping on the line. VPN Azure
|
||||
Servers which are physically placed on Japan are subjects of this law.
|
||||
|
||||
3.4. Comply to Japanese Telecommunication Laws
|
||||
SoftEther Corporation complies with Japanese Telecommunication Laws as
|
||||
necessary to provide online services via Internet.
|
||||
|
||||
3.5. Free and Academic Experiment Services
|
||||
SoftEther provides Dynamic DNS, NAT Traversal and VPN Azure as academic
|
||||
experiment services. Therefore, there services can be used for free of charge.
|
||||
These services are not parts of "SoftEther VPN Software Products" . These
|
||||
services are provided without any warranty. The services may be suspended or
|
||||
discontinued by technical or operational matters. In such occasions, users
|
||||
will not be able to use the services. A user have to understand such risks,
|
||||
and to acknowledge that such risks are borne by a user-self. SoftEther will
|
||||
never be liable to results or damages of use or unable-to-use of the service.
|
||||
Even if the user has already paid the license-fee of the commercial version of
|
||||
SoftEther VPN, such paid fees don't include any fees of these services.
|
||||
Therefore, if the online services will stop or be discontinued, no refunds or
|
||||
recoveries of damages will be provided by SoftEther Corporation.
|
||||
|
||||
3.6. DNS Proxy Cloud Servers
|
||||
In some regions, when a user uses Internet, a DNS query sometimes broken or
|
||||
lost when it is passing through the ISP line. If SoftEther VPN Server, Client
|
||||
or Bridge detects a possibility that the accessing to the actual VPN server
|
||||
might be unstable, then DNS queries will be also transferred to the DNS proxy
|
||||
cloud servers which are operated by SoftEther Corporation. A DNS proxy cloud
|
||||
server will respond DNS queries with answering correct a IP address.
|
||||
|
||||
|
||||
4. General Cautions
|
||||
4.1. Needs an Approval from Network Administrator
|
||||
SoftEther VPN has powerful functions which don't require special settings by
|
||||
network administrators. For example, you need not to ask the administrator to
|
||||
configure the existing firewall in order to "open" a TCP/UDP port. Such
|
||||
characteristic features are for the purpose to eliminate working times and
|
||||
costs of network administrators, and avoid misconfiguration-risks around the
|
||||
tasks to open specific exception ports on the firewall. However, any employees
|
||||
belong to the company have to obtain an approval from the network
|
||||
administrator before installs SoftEther VPN. If your network administrator
|
||||
neglects to provide such an approval, you can consider to take an approval
|
||||
from an upper authority. (For example, executive officer of the company.) If
|
||||
you use SoftEther VPN without any approvals from the authority of your
|
||||
company, you might have disadvantage. SoftEther Corporation will be never
|
||||
liable for results or damages of using SoftEther VPN.
|
||||
|
||||
4.2. Observe Laws of Your Country
|
||||
If your country's law prohibits the use of encryption, you have to disable the
|
||||
encryption function of SoftEther VPN by yourself. Similarly, in some countries
|
||||
or regions, some functions of SoftEther VPN might be prohibited to use by
|
||||
laws. Other countries' laws are none of SoftEther Corporation's concern
|
||||
because SoftEther Corporation is an enterprise which is located and registered
|
||||
in Japan physically. For example, there might be a risk that a part of
|
||||
SoftEther VPN conflicts an existing patent which is valid only on the specific
|
||||
region. SoftEther Corporation has no interests in such specific region outside
|
||||
Japan's territory. Therefore, if you want to use SoftEther VPN in regions
|
||||
outside Japan, you have to be careful not to violate third-person's rights.
|
||||
You have to verify the legitimacy of the use of SoftEther VPN in the specific
|
||||
region before you actually use it in such region. By nature, there are almost
|
||||
200 countries in the World, and each country's law is different each other. It
|
||||
is practically impossible to verify every countries' laws and regulations and
|
||||
make the software comply with all countries' laws in advance to release the
|
||||
software. Therefore SoftEther Corporation has verified the legitimacy of
|
||||
SoftEther VPN against the laws and regulations of only Japan. If a user uses
|
||||
SoftEther VPN in a specific country, and damaged by public servants of the
|
||||
government authority, SoftEther Corporation will never be liable to recover or
|
||||
compensate such damages or criminal responsibilities.
|
||||
|
||||
|
||||
5. VPN Gate Academic Experiment Project
|
||||
(This chapter applies only on SoftEther VPN software package which contains
|
||||
the extension plug-in for VPN Gate Academic Experiment Project.)
|
||||
5.1. About VPN Gate Academic Experiment Project
|
||||
VPN Gate Academic Experiment Project is an online service operated for just
|
||||
the academic research purpose at the graduate school of University of Tsukuba,
|
||||
Japan. The purpose of this research is to expend our knowledge about the
|
||||
"Global Distributed Public VPN Relay Server" (GDPVRS) technology. For details,
|
||||
please visit http://www.vpngate.net/.
|
||||
|
||||
5.2. About VPN Gate Service
|
||||
SoftEther VPN Server and SoftEther VPN Client may contain "VPN Gate Service"
|
||||
program. However, VPN Gate Service is disabled by default.
|
||||
VPN Gate Service should be activated and enabled by the voluntary intention of
|
||||
the owner of the computer which SoftEther VPN Server or SoftEther VPN Client
|
||||
is installed on. After you activate VPN Gate Service, the computer will be
|
||||
start to serve as a part of the Global Distributed Public VPN Relay Servers.
|
||||
The IP address, hostname and related information of the computer will be sent
|
||||
and registered to the directory server of VPN Gate Academic Experiment
|
||||
Project, and they will be published and disclosed to the public. This
|
||||
mechanism will allow any VPN Gate Client software's user to connect to the VPN
|
||||
Gate Service running on your computer. While the VPN session between a VPN
|
||||
Gate Client and your VPN Gate Service is established, the VPN Gate Client's
|
||||
user can send/receive any IP packets towards the Internet via the VPN Gate
|
||||
Service. The global IP address of the VPN Gate Service's hosing computer will
|
||||
be used as the source IP address of such communications which a VPN Gate
|
||||
Client initiates.
|
||||
VPN Gate Service will send some information to the VPN Gate Academic
|
||||
Experiment Service Directory Server. The information includes the operator's
|
||||
information which described in section 5.5, logging settings, uptime,
|
||||
operating system version, type of protocol, port numbers, quality information,
|
||||
statistical information, VPN Gate clients' log history data (includes dates,
|
||||
IP addresses, version numbers and IDs) and the version of the software. These
|
||||
information will be exposed on the directory. VPN Gate Service also receives a
|
||||
key for encoding which is described on the chapter 5.9 from the directory
|
||||
server.
|
||||
|
||||
5.3. Details of VPN Gate Service's Behavior
|
||||
If you enable VPN Gate Service manually, which is disabled by default, the
|
||||
"VPNGATE" Virtual Hub will be created on the SoftEther VPN Server. If you are
|
||||
using SoftEther VPN Client and attempt to active VPN Gate Service on it, an
|
||||
equivalent program to SoftEther VPN Server will be invoked on the same process
|
||||
of SoftEther VPN Client, and the "VPNGATE" Virtual Hub will be created. The
|
||||
"VPNGATE" Virtual Hub contains a user named "VPN" by default which permits
|
||||
anyone on the Internet to make a VPN connection to the Virtual Hub. Once a VPN
|
||||
Client connects to the "VPNGATE" Virtual Hub, any communication between the
|
||||
user and the Internet will pass through the Virtual Hub, and
|
||||
transmitted/received using the physical network interface on the computer
|
||||
which SoftEther VPN Server (or SoftEther VPN Client) is running on. This will
|
||||
cause the result that a destination host specified by the VPN Client will
|
||||
identify that the source of the communication has initiated from the VPN Gate
|
||||
Service's hosting computer's IP address. However, for safety, any packets
|
||||
which destinations are within 192.168.0.0/255.255.0.0, 172.16.0.0/255.240.0.0
|
||||
or 10.0.0.0/255.0.0.0 will be blocked by the "VPNGATE" Virtual Hub in order to
|
||||
protect your local network. Therefore, if you run VPN Gate Service on your
|
||||
corporate network or private network, it is safe because anonymous VPN Client
|
||||
users will not be permitted to access such private networks. VPN Gate Service
|
||||
also serves as relay for accessing to the VPN Gate Directory Server.
|
||||
In order to make VPN Gate Service familiar with firewalls and NATs, it opens
|
||||
an UDP port by using the NAT Traversal function which is described on the
|
||||
section 1.2. It also opens and listens on some TCP ports, and some TCP and UDP
|
||||
ports will be specified as the target port of Universal Plug and Play (UPnP)
|
||||
Port Transfer entries which are requested to your local routers. UPnP request
|
||||
packets will be sent periodically. Some routers keep such an opened TCP/UDP
|
||||
port permanently on the device. If you wish to close them, do it manually.
|
||||
VPN Gate Service also provides the mirror-site function for www.vpngate.net.
|
||||
This is a mechanism that a copy of the latest contents from www.vpngate.net
|
||||
will be hosted by the mirror-site tiny HTTP server which is running on the VPN
|
||||
Gate Service program. It will register itself on the mirror-sites list in
|
||||
www.vpngate.net. However, it never relays any other communications which are
|
||||
not towards www.vpngate.net.
|
||||
|
||||
5.4. Communication between Internet via VPN Gate Service
|
||||
VPN Gate Service provides a routing between users and the Internet, by using
|
||||
the Virtual NAT Function which is described on the section 2.8. VPN Gate
|
||||
Service sends polling Ping packets to the server which is located on
|
||||
University of Tsukuba, and the Google Public DNS Server which is identified as
|
||||
8.8.8.8, in order to check the latest quality of your Internet line. VPN Gate
|
||||
Service also sends and receives a lot of random packets to/from the Speed Test
|
||||
Server on University of Tsukuba. These quality data will be reported to VPN
|
||||
Gate Directory Server, automatically and periodically. The result will be
|
||||
saved and disclosed to the public. These periodical polling communication are
|
||||
adjusted not to occupy the Internet line, however in some circumstances they
|
||||
might occupy the line.
|
||||
|
||||
5.5. Operator's Information of VPN Gate Service
|
||||
If you activate VPN Gate Service on your computer, the computer will be a part
|
||||
of the Global Distributed Public VPN Relay Servers. Therefore, the Operator's
|
||||
administrative information of your VPN Gate Service should be reported and
|
||||
registered on the VPN Gate Service Directory. Operator's information contains
|
||||
the name of the operator and the abuse-reporting contact e-mail address. These
|
||||
information can be inputted on the screen if the VPN Gate configuration.
|
||||
Inputted information will be transmitted to the VPN Gate Directory Server,
|
||||
stored and disclosed to the public. So you have to be careful to input
|
||||
information. By the way, until you specify something as the operator's
|
||||
information, the computer's hostname will be used automatically as the field
|
||||
of the name of the operator, by appending the "'s owner" string after the
|
||||
hostname.
|
||||
|
||||
5.6. Observe Laws to Operate VPN Gate Service
|
||||
In some countries or regions, a user who is planning to activate and operate
|
||||
VPN Gate Service, he are mandated to obtain a license or register a service
|
||||
from/to the government. If your region has such a regulation, you must fulfill
|
||||
mandated process before activating VPN Gate Service in advance. Neither the
|
||||
developers nor operators of the VPN Gate Academic Experiment Project will be
|
||||
liable for legal/criminal responsibilities or damages which are occurred from
|
||||
failure to comply your local laws.
|
||||
|
||||
5.7. Protect Privacy of Communication
|
||||
Most of countries have a law which requires communication service's operators,
|
||||
including VPN Gate Service operators, to protect the privacy of communication
|
||||
of third-persons. When you operate VPN Gate Service, you must always protect
|
||||
user's privacy.
|
||||
|
||||
5.8. Packet Logs
|
||||
The packet logging function is implemented on VPN Gate Service. It records
|
||||
essential headers of major TCP/IP packets which are transmitted via the
|
||||
Virtual Hub. This function will be helpful to investigate the "original IP
|
||||
address" of the initiator of communication who was a connected user of your
|
||||
VPN Gate Service, by checking the packet logs and the connection logs. The
|
||||
packet logs are recorded only for such legitimate investigates purpose. Do not
|
||||
peek nor leak packet logs except the rightful purpose. Such act will be
|
||||
violate the section 5.7.
|
||||
|
||||
5.9. Packet Logs Automatic Archiving and Encoding Function
|
||||
The VPN Gate Academic Experiment Service is operated and running under the
|
||||
Japanese constitution and laws. The Japanese constitution laws demand strictly
|
||||
protection over the privacy of communication. Because this service is under
|
||||
Japanese rules, the program of VPN Gate Service implements this "Automatic Log
|
||||
File Encoding" protection mechanism, and enabled by default.
|
||||
The VPN Gate Service is currently configured to encode packet log files which
|
||||
has passed two or more weeks automatically, by default. In order to protect
|
||||
privacy of communication, if a packet log file is once encoded, even the
|
||||
administrator of the local computer cannot censor the packet log file. This
|
||||
mechanism protects privacy of end-users of VPN Gate Service.
|
||||
You can change the VPN Gate Service setting to disable this automatic encoding
|
||||
function. Then packet log files will never be encoded even after two weeks
|
||||
passed. In such a configuration, all packet logs will remain as plain-text on
|
||||
the disk. Therefore you have to take care not to violate user's privacy.
|
||||
If you are liable to decode an encoded packet log files (for example: a VPN
|
||||
Gate Service's user illegally abused your VPN Gate Service and you have to
|
||||
decode the packet logs in order to comply the laws), contact the administrator
|
||||
of the VPN Gate Academic Experiment Service at Graduate School of University
|
||||
of Tsukuba, Japan. You can find the contact address at
|
||||
http://www.vpngate.net/. The administrator of VPN Gate Service will respond to
|
||||
decode the packet logs if there is an appropriate and legal request from court
|
||||
or other judicial authorities, according to laws.
|
||||
|
||||
5.10. Caution if You Operate VPN Gate Service in the Japan's Territories
|
||||
When a user operates VPN Gate Service in the Japan's territories, such an act
|
||||
may be regulated under the Japanese Telecommunication Laws if the operation is
|
||||
a subject to the law. However, in such a circumstance, according to the
|
||||
"Japanese Telecommunication Business Compete Manual [supplemental version]" ,
|
||||
non- profitable operations of communications are not identified as a
|
||||
"telecommunication business" . So usual operators of VPN Gate Service are not
|
||||
subjects to "telecommunication business operators" , and not be mandated to
|
||||
register to the government. Even so, legalities to protect the privacy of
|
||||
communication still imposed. As a conclusion, if you operate VPN Gate Service
|
||||
in the Japan's Territories, you must not leak the secrets of communications
|
||||
which are transmitted via your operating VPN Gate Service.
|
||||
|
||||
5.11. VPN Gate Client
|
||||
If SoftEther VPN Client contains the VPN Gate Client plug-in, you can use it
|
||||
to obtain the list of current operating VPN Gate Service servers in the
|
||||
Internet, and make a VPN connection to a specific server on the list.
|
||||
VPN Gate Client always keeps the latest list of the VPN Gate Services
|
||||
periodically. Be careful if you are using a pay-per-use Internet line.
|
||||
When you start the VPN Gate Client software, the screen which asks you
|
||||
activate or not VPN Gate Service will be appeared. For details of VPN Gate
|
||||
Service, read the above sections.
|
||||
|
||||
5.12. Caution before Joining or Exploiting VPN Gate Academic Experiment
|
||||
Project
|
||||
The VPN Gate Academic Experiment Service is operated as a research project at
|
||||
the graduate school on University of Tsukuba, Japan. The service is governed
|
||||
under the Japanese laws. Other countries' laws are none of our concerns nor
|
||||
responsibilities.
|
||||
By nature, there are almost 200 countries in the World, with different laws.
|
||||
It is impossible to verify every countries' laws and regulations and make the
|
||||
software comply with all countries' laws in advance to release the software.
|
||||
If a user uses VPN Gate service in a specific country, and damaged by public
|
||||
servants of the authority, the developer of either the service or software
|
||||
will never be liable to recover or compensate such damages or criminal
|
||||
responsibilities.
|
||||
By using this software and service, the user must observe all concerned laws
|
||||
and rules with user's own responsibility. The user will be completely liable
|
||||
to any damages and responsibilities which are results of using this software
|
||||
and service, regardless of either inside or outside of Japan's territory.
|
||||
If you don't agree nor understand the above warnings, do not use any of VPN
|
||||
Gate Academic Experiment Service functions.
|
||||
VPN Gate is a research project for just academic purpose only. VPN Gate was
|
||||
developed as a plug-in for SoftEther VPN and UT-VPN. However, all parts of VPN
|
||||
Gate were developed on this research project at University of Tsukuba. Any
|
||||
parts of VPN Gate are not developed by SoftEther Corporation. The VPN Gate
|
||||
Research Project is not a subject to be led, operated, promoted nor guaranteed
|
||||
by SoftEther Corporation.
|
||||
|
2
configure
vendored
2
configure
vendored
@ -9,6 +9,8 @@ echo
|
||||
echo 'This program is free software; you can redistribute it and/or'
|
||||
echo 'modify it under the terms of the GNU General Public License'
|
||||
echo 'version 2 as published by the Free Software Foundation.'
|
||||
echo
|
||||
echo 'Read and understand README.TXT, LICENSE.TXT and WARNING.TXT before use.'
|
||||
echo '---------------------------------------------------------------------'
|
||||
echo
|
||||
|
||||
|
@ -45,13 +45,10 @@
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="CoreUtil, Version=1.1.4781.28908, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>.\CoreUtil.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.DirectoryServices" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.EnterpriseServices" />
|
||||
<Reference Include="System.Runtime.Serialization.Formatters.Soap" />
|
||||
@ -65,9 +62,39 @@
|
||||
<Compile Include="BuildUtilCommands.cs" />
|
||||
<Compile Include="BuildUtilMain.cs" />
|
||||
<Compile Include="CodeSign.cs" />
|
||||
<Compile Include="CoreUtil\Bmp.cs" />
|
||||
<Compile Include="CoreUtil\Buf.cs" />
|
||||
<Compile Include="CoreUtil\Cache.cs" />
|
||||
<Compile Include="CoreUtil\Compress.cs" />
|
||||
<Compile Include="CoreUtil\Console.cs" />
|
||||
<Compile Include="CoreUtil\Csv.cs" />
|
||||
<Compile Include="CoreUtil\Env.cs" />
|
||||
<Compile Include="CoreUtil\FileIO.cs" />
|
||||
<Compile Include="CoreUtil\GZip.cs" />
|
||||
<Compile Include="CoreUtil\Kernel.cs" />
|
||||
<Compile Include="CoreUtil\MultiLang.cs" />
|
||||
<Compile Include="CoreUtil\Packer.cs" />
|
||||
<Compile Include="CoreUtil\RC4.cs" />
|
||||
<Compile Include="CoreUtil\ReadIni.cs" />
|
||||
<Compile Include="CoreUtil\Reg.cs" />
|
||||
<Compile Include="CoreUtil\Secure.cs" />
|
||||
<Compile Include="CoreUtil\Stb.cs" />
|
||||
<Compile Include="CoreUtil\Str.cs" />
|
||||
<Compile Include="CoreUtil\Tar.cs" />
|
||||
<Compile Include="CoreUtil\Thread.cs" />
|
||||
<Compile Include="CoreUtil\Time.cs" />
|
||||
<Compile Include="CoreUtil\Util.cs" />
|
||||
<Compile Include="CoreUtil\Win32.cs" />
|
||||
<Compile Include="CoreUtil\Zip.cs" />
|
||||
<Compile Include="CoreUtil\ZLib.cs" />
|
||||
|
||||
<Compile Include="PEUtil.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
@ -167,6 +194,12 @@
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
|
@ -147,7 +147,7 @@ namespace BuildUtil
|
||||
public static int BuildUtil(ConsoleService c, string cmdName, string str)
|
||||
{
|
||||
Con.WriteLine("");
|
||||
Con.WriteLine("Copyright (c) SoftEther Corporation. All Rights Reserved.");
|
||||
Con.WriteLine("Copyright (c) SoftEther VPN Project. All Rights Reserved.");
|
||||
Con.WriteLine("");
|
||||
|
||||
ConsoleParam[] args =
|
||||
|
Binary file not shown.
188
src/BuildUtil/CoreUtil/Bmp.cs
Normal file
188
src/BuildUtil/CoreUtil/Bmp.cs
Normal file
@ -0,0 +1,188 @@
|
||||
// CoreUtil
|
||||
//
|
||||
// Copyright (C) 2012-2014 Daiyuu Nobori. All Rights Reserved.
|
||||
// Copyright (C) 2012-2014 SoftEther VPN Project at University of Tsukuba. All Rights Reserved.
|
||||
// Comments: Tetsuo Sugiyama, Ph.D.
|
||||
//
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// version 2 as published by the Free Software Foundation.
|
||||
//
|
||||
// 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 version 2
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// THE LICENSE AGREEMENT IS ATTACHED ON THE SOURCE-CODE PACKAGE
|
||||
// AS "LICENSE.TXT" FILE. READ THE TEXT FILE IN ADVANCE TO USE THE SOFTWARE.
|
||||
//
|
||||
//
|
||||
// THIS SOFTWARE IS DEVELOPED IN JAPAN, AND DISTRIBUTED FROM JAPAN,
|
||||
// UNDER JAPANESE LAWS. YOU MUST AGREE IN ADVANCE TO USE, COPY, MODIFY,
|
||||
// MERGE, PUBLISH, DISTRIBUTE, SUBLICENSE, AND/OR SELL COPIES OF THIS
|
||||
// SOFTWARE, THAT ANY JURIDICAL DISPUTES WHICH ARE CONCERNED TO THIS
|
||||
// SOFTWARE OR ITS CONTENTS, AGAINST US (SOFTETHER PROJECT, SOFTETHER
|
||||
// CORPORATION, DAIYUU NOBORI OR OTHER SUPPLIERS), OR ANY JURIDICAL
|
||||
// DISPUTES AGAINST US WHICH ARE CAUSED BY ANY KIND OF USING, COPYING,
|
||||
// MODIFYING, MERGING, PUBLISHING, DISTRIBUTING, SUBLICENSING, AND/OR
|
||||
// SELLING COPIES OF THIS SOFTWARE SHALL BE REGARDED AS BE CONSTRUED AND
|
||||
// CONTROLLED BY JAPANESE LAWS, AND YOU MUST FURTHER CONSENT TO
|
||||
// EXCLUSIVE JURISDICTION AND VENUE IN THE COURTS SITTING IN TOKYO,
|
||||
// JAPAN. YOU MUST WAIVE ALL DEFENSES OF LACK OF PERSONAL JURISDICTION
|
||||
// AND FORUM NON CONVENIENS. PROCESS MAY BE SERVED ON EITHER PARTY IN
|
||||
// THE MANNER AUTHORIZED BY APPLICABLE LAW OR COURT RULE.
|
||||
//
|
||||
// USE ONLY IN JAPAN. DO NOT USE IT IN OTHER COUNTRIES. IMPORTING THIS
|
||||
// SOFTWARE INTO OTHER COUNTRIES IS AT YOUR OWN RISK. SOME COUNTRIES
|
||||
// PROHIBIT ENCRYPTED COMMUNICATIONS. USING THIS SOFTWARE IN OTHER
|
||||
// COUNTRIES MIGHT BE RESTRICTED.
|
||||
//
|
||||
//
|
||||
// DEAR SECURITY EXPERTS
|
||||
// ---------------------
|
||||
//
|
||||
// If you find a bug or a security vulnerability please kindly inform us
|
||||
// about the problem immediately so that we can fix the security problem
|
||||
// to protect a lot of users around the world as soon as possible.
|
||||
//
|
||||
// Our e-mail address for security reports is:
|
||||
// softether-vpn-security [at] softether.org
|
||||
//
|
||||
// Please note that the above e-mail address is not a technical support
|
||||
// inquiry address. If you need technical assistance, please visit
|
||||
// http://www.softether.org/ and ask your question on the users forum.
|
||||
//
|
||||
// Thank you for your cooperation.
|
||||
|
||||
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Data;
|
||||
using System.Data.Sql;
|
||||
using System.Data.SqlClient;
|
||||
using System.Data.SqlTypes;
|
||||
using System.Text;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Cryptography;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
using System.IO;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Diagnostics;
|
||||
using System.Web.Mail;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Net.NetworkInformation;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace CoreUtil
|
||||
{
|
||||
public static class Bmp
|
||||
{
|
||||
public static Bitmap Load(string filename)
|
||||
{
|
||||
return Load(IO.ReadFile(filename));
|
||||
}
|
||||
public static Bitmap Load(byte[] data)
|
||||
{
|
||||
MemoryStream ms = new MemoryStream();
|
||||
ms.Write(data, 0, data.Length);
|
||||
ms.Seek(0, SeekOrigin.Begin);
|
||||
|
||||
return new Bitmap(ms);
|
||||
}
|
||||
|
||||
public static void SaveAsBitmap(Bitmap bmp, string filename)
|
||||
{
|
||||
IO.SaveFile(filename, SaveAsBitmap(bmp));
|
||||
}
|
||||
public static byte[] SaveAsBitmap(Bitmap bmp)
|
||||
{
|
||||
MemoryStream ms = new MemoryStream();
|
||||
|
||||
bmp.Save(ms, ImageFormat.Bmp);
|
||||
|
||||
return ms.ToArray();
|
||||
}
|
||||
|
||||
public static void SaveAsJpeg(Bitmap bmp, string filename)
|
||||
{
|
||||
IO.SaveFile(filename, SaveAsJpeg(bmp));
|
||||
}
|
||||
public static byte[] SaveAsJpeg(Bitmap bmp)
|
||||
{
|
||||
return SaveAsJpeg(bmp, 100);
|
||||
}
|
||||
public static void SaveAsJpeg(Bitmap bmp, string filename, int quality)
|
||||
{
|
||||
IO.SaveFile(filename, SaveAsJpeg(bmp, quality));
|
||||
}
|
||||
public static byte[] SaveAsJpeg(Bitmap bmp, int quality)
|
||||
{
|
||||
EncoderParameters eps = new EncoderParameters(1);
|
||||
EncoderParameter ep = new EncoderParameter(System.Drawing.Imaging.Encoder.Quality, quality);
|
||||
eps.Param[0] = ep;
|
||||
|
||||
ImageCodecInfo info = getEncoderInfo("image/jpeg");
|
||||
|
||||
MemoryStream ms = new MemoryStream();
|
||||
bmp.Save(ms, info, eps);
|
||||
|
||||
return ms.ToArray();
|
||||
}
|
||||
|
||||
static ImageCodecInfo getEncoderInfo(string type)
|
||||
{
|
||||
ImageCodecInfo[] encs = ImageCodecInfo.GetImageEncoders();
|
||||
|
||||
foreach (ImageCodecInfo enc in encs)
|
||||
{
|
||||
if (Str.StrCmpi(enc.MimeType, type))
|
||||
{
|
||||
return enc;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Bitmap ResizeBitmap(Bitmap bmp, int width, int height)
|
||||
{
|
||||
Bitmap dst = new Bitmap(width, height, PixelFormat.Format24bppRgb);
|
||||
Graphics g = Graphics.FromImage(dst);
|
||||
g.SmoothingMode = SmoothingMode.HighQuality;
|
||||
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
|
||||
|
||||
Rectangle r = new Rectangle(0, 0, width, height);
|
||||
|
||||
g.DrawImage(bmp, r);
|
||||
|
||||
return dst;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
673
src/BuildUtil/CoreUtil/Buf.cs
Normal file
673
src/BuildUtil/CoreUtil/Buf.cs
Normal file
@ -0,0 +1,673 @@
|
||||
// CoreUtil
|
||||
//
|
||||
// Copyright (C) 2012-2014 Daiyuu Nobori. All Rights Reserved.
|
||||
// Copyright (C) 2012-2014 SoftEther VPN Project at University of Tsukuba. All Rights Reserved.
|
||||
// Comments: Tetsuo Sugiyama, Ph.D.
|
||||
//
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// version 2 as published by the Free Software Foundation.
|
||||
//
|
||||
// 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 version 2
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// THE LICENSE AGREEMENT IS ATTACHED ON THE SOURCE-CODE PACKAGE
|
||||
// AS "LICENSE.TXT" FILE. READ THE TEXT FILE IN ADVANCE TO USE THE SOFTWARE.
|
||||
//
|
||||
//
|
||||
// THIS SOFTWARE IS DEVELOPED IN JAPAN, AND DISTRIBUTED FROM JAPAN,
|
||||
// UNDER JAPANESE LAWS. YOU MUST AGREE IN ADVANCE TO USE, COPY, MODIFY,
|
||||
// MERGE, PUBLISH, DISTRIBUTE, SUBLICENSE, AND/OR SELL COPIES OF THIS
|
||||
// SOFTWARE, THAT ANY JURIDICAL DISPUTES WHICH ARE CONCERNED TO THIS
|
||||
// SOFTWARE OR ITS CONTENTS, AGAINST US (SOFTETHER PROJECT, SOFTETHER
|
||||
// CORPORATION, DAIYUU NOBORI OR OTHER SUPPLIERS), OR ANY JURIDICAL
|
||||
// DISPUTES AGAINST US WHICH ARE CAUSED BY ANY KIND OF USING, COPYING,
|
||||
// MODIFYING, MERGING, PUBLISHING, DISTRIBUTING, SUBLICENSING, AND/OR
|
||||
// SELLING COPIES OF THIS SOFTWARE SHALL BE REGARDED AS BE CONSTRUED AND
|
||||
// CONTROLLED BY JAPANESE LAWS, AND YOU MUST FURTHER CONSENT TO
|
||||
// EXCLUSIVE JURISDICTION AND VENUE IN THE COURTS SITTING IN TOKYO,
|
||||
// JAPAN. YOU MUST WAIVE ALL DEFENSES OF LACK OF PERSONAL JURISDICTION
|
||||
// AND FORUM NON CONVENIENS. PROCESS MAY BE SERVED ON EITHER PARTY IN
|
||||
// THE MANNER AUTHORIZED BY APPLICABLE LAW OR COURT RULE.
|
||||
//
|
||||
// USE ONLY IN JAPAN. DO NOT USE IT IN OTHER COUNTRIES. IMPORTING THIS
|
||||
// SOFTWARE INTO OTHER COUNTRIES IS AT YOUR OWN RISK. SOME COUNTRIES
|
||||
// PROHIBIT ENCRYPTED COMMUNICATIONS. USING THIS SOFTWARE IN OTHER
|
||||
// COUNTRIES MIGHT BE RESTRICTED.
|
||||
//
|
||||
//
|
||||
// DEAR SECURITY EXPERTS
|
||||
// ---------------------
|
||||
//
|
||||
// If you find a bug or a security vulnerability please kindly inform us
|
||||
// about the problem immediately so that we can fix the security problem
|
||||
// to protect a lot of users around the world as soon as possible.
|
||||
//
|
||||
// Our e-mail address for security reports is:
|
||||
// softether-vpn-security [at] softether.org
|
||||
//
|
||||
// Please note that the above e-mail address is not a technical support
|
||||
// inquiry address. If you need technical assistance, please visit
|
||||
// http://www.softether.org/ and ask your question on the users forum.
|
||||
//
|
||||
// Thank you for your cooperation.
|
||||
|
||||
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Data;
|
||||
using System.Data.Sql;
|
||||
using System.Data.SqlClient;
|
||||
using System.Data.SqlTypes;
|
||||
using System.Text;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Cryptography;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
using System.IO;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Web.Mail;
|
||||
|
||||
namespace CoreUtil
|
||||
{
|
||||
// FIFO
|
||||
public class Fifo
|
||||
{
|
||||
byte[] p;
|
||||
int pos, size;
|
||||
public int Size
|
||||
{
|
||||
get { return size; }
|
||||
}
|
||||
public byte[] Data
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.p;
|
||||
}
|
||||
}
|
||||
public int DataOffset
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.pos;
|
||||
}
|
||||
}
|
||||
public int PhysicalSize
|
||||
{
|
||||
get
|
||||
{
|
||||
return p.Length;
|
||||
}
|
||||
}
|
||||
|
||||
int reallocMemSize;
|
||||
public const int FifoInitMemSize = 4096;
|
||||
public const int FifoReallocMemSize = 65536;
|
||||
public const int FifoReallocMemSizeSmall = 65536;
|
||||
|
||||
long totalWriteSize = 0, totalReadSize = 0;
|
||||
|
||||
public long TotalReadSize
|
||||
{
|
||||
get { return totalReadSize; }
|
||||
}
|
||||
public long TotalWriteSize
|
||||
{
|
||||
get { return totalWriteSize; }
|
||||
}
|
||||
|
||||
public Fifo()
|
||||
{
|
||||
init(0);
|
||||
}
|
||||
public Fifo(int reallocMemSize)
|
||||
{
|
||||
init(reallocMemSize);
|
||||
}
|
||||
|
||||
void init(int reallocMemSize)
|
||||
{
|
||||
if (reallocMemSize == 0)
|
||||
{
|
||||
reallocMemSize = FifoReallocMemSize;
|
||||
}
|
||||
|
||||
this.size = this.pos = 0;
|
||||
this.reallocMemSize = reallocMemSize;
|
||||
|
||||
this.p = new byte[FifoInitMemSize];
|
||||
}
|
||||
|
||||
public void Write(Buf buf)
|
||||
{
|
||||
Write(buf.ByteData);
|
||||
}
|
||||
public void Write(byte[] src)
|
||||
{
|
||||
Write(src, src.Length);
|
||||
}
|
||||
public void SkipWrite(int size)
|
||||
{
|
||||
Write(null, size);
|
||||
}
|
||||
public void Write(byte[] src, int size)
|
||||
{
|
||||
Write(src, 0, size);
|
||||
}
|
||||
public void Write(byte[] src, int offset, int size)
|
||||
{
|
||||
int i, need_size;
|
||||
bool realloc_flag;
|
||||
|
||||
i = this.size;
|
||||
this.size += size;
|
||||
need_size = this.pos + this.size;
|
||||
realloc_flag = false;
|
||||
|
||||
int memsize = p.Length;
|
||||
while (need_size > memsize)
|
||||
{
|
||||
memsize = Math.Max(memsize, FifoInitMemSize) * 3;
|
||||
realloc_flag = true;
|
||||
}
|
||||
|
||||
if (realloc_flag)
|
||||
{
|
||||
byte[] new_p = new byte[memsize];
|
||||
Util.CopyByte(new_p, 0, this.p, 0, this.p.Length);
|
||||
this.p = new_p;
|
||||
}
|
||||
|
||||
if (src != null)
|
||||
{
|
||||
Util.CopyByte(this.p, this.pos + i, src, offset, size);
|
||||
}
|
||||
|
||||
totalWriteSize += size;
|
||||
}
|
||||
|
||||
public byte[] Read()
|
||||
{
|
||||
return Read(this.Size);
|
||||
}
|
||||
public void ReadToBuf(Buf buf, int size)
|
||||
{
|
||||
byte[] data = Read(size);
|
||||
|
||||
buf.Write(data);
|
||||
}
|
||||
public Buf ReadToBuf(int size)
|
||||
{
|
||||
byte[] data = Read(size);
|
||||
|
||||
return new Buf(data);
|
||||
}
|
||||
public byte[] Read(int size)
|
||||
{
|
||||
byte[] ret = new byte[size];
|
||||
int read_size = Read(ret);
|
||||
Array.Resize<byte>(ref ret, read_size);
|
||||
|
||||
return ret;
|
||||
}
|
||||
public int Read(byte[] dst)
|
||||
{
|
||||
return Read(dst, dst.Length);
|
||||
}
|
||||
public int SkipRead(int size)
|
||||
{
|
||||
return Read(null, size);
|
||||
}
|
||||
public int Read(byte[] dst, int size)
|
||||
{
|
||||
return Read(dst, 0, size);
|
||||
}
|
||||
public int Read(byte[] dst, int offset, int size)
|
||||
{
|
||||
int read_size;
|
||||
|
||||
read_size = Math.Min(size, this.size);
|
||||
if (read_size == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
if (dst != null)
|
||||
{
|
||||
Util.CopyByte(dst, offset, this.p, this.pos, size);
|
||||
}
|
||||
this.pos += read_size;
|
||||
this.size -= read_size;
|
||||
|
||||
if (this.size == 0)
|
||||
{
|
||||
this.pos = 0;
|
||||
}
|
||||
|
||||
if (this.pos >= FifoInitMemSize &&
|
||||
this.p.Length >= this.reallocMemSize &&
|
||||
(this.p.Length / 2) > this.size)
|
||||
{
|
||||
byte[] new_p;
|
||||
int new_size;
|
||||
|
||||
new_size = Math.Max(this.p.Length / 2, FifoInitMemSize);
|
||||
new_p = new byte[new_size];
|
||||
Util.CopyByte(new_p, 0, this.p, this.pos, this.size);
|
||||
|
||||
this.p = new_p;
|
||||
|
||||
this.pos = 0;
|
||||
}
|
||||
|
||||
totalReadSize += read_size;
|
||||
|
||||
return read_size;
|
||||
}
|
||||
}
|
||||
|
||||
public class Buf
|
||||
{
|
||||
MemoryStream buf;
|
||||
|
||||
public Buf()
|
||||
{
|
||||
init(new byte[0]);
|
||||
}
|
||||
public Buf(byte[] data)
|
||||
{
|
||||
init(data);
|
||||
}
|
||||
void init(byte[] data)
|
||||
{
|
||||
buf = new MemoryStream();
|
||||
Write(data);
|
||||
SeekToBegin();
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
buf.SetLength(0);
|
||||
}
|
||||
|
||||
public void WriteByte(byte data)
|
||||
{
|
||||
byte[] a = new byte[1] { data };
|
||||
|
||||
Write(a);
|
||||
}
|
||||
public void Write(byte[] data)
|
||||
{
|
||||
buf.Write(data, 0, data.Length);
|
||||
}
|
||||
public void Write(byte[] data, int pos, int len)
|
||||
{
|
||||
buf.Write(data, pos, len);
|
||||
}
|
||||
|
||||
public uint Size
|
||||
{
|
||||
get
|
||||
{
|
||||
return (uint)buf.Length;
|
||||
}
|
||||
}
|
||||
|
||||
public uint Pos
|
||||
{
|
||||
get
|
||||
{
|
||||
return (uint)buf.Position;
|
||||
}
|
||||
}
|
||||
|
||||
public byte[] ByteData
|
||||
{
|
||||
get
|
||||
{
|
||||
return buf.ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
public byte this[uint i]
|
||||
{
|
||||
get
|
||||
{
|
||||
return buf.GetBuffer()[i];
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
buf.GetBuffer()[i] = value;
|
||||
}
|
||||
}
|
||||
|
||||
public byte[] Read()
|
||||
{
|
||||
return Read(this.Size);
|
||||
}
|
||||
public byte[] Read(uint size)
|
||||
{
|
||||
byte[] tmp = new byte[size];
|
||||
int i = buf.Read(tmp, 0, (int)size);
|
||||
|
||||
byte[] ret = new byte[i];
|
||||
Array.Copy(tmp, 0, ret, 0, i);
|
||||
|
||||
return ret;
|
||||
}
|
||||
public byte ReadByte()
|
||||
{
|
||||
byte[] a = Read(1);
|
||||
|
||||
return a[0];
|
||||
}
|
||||
|
||||
public void SeekToBegin()
|
||||
{
|
||||
Seek(0);
|
||||
}
|
||||
public void SeekToEnd()
|
||||
{
|
||||
Seek(0, SeekOrigin.End);
|
||||
}
|
||||
public void Seek(uint offset)
|
||||
{
|
||||
Seek(offset, SeekOrigin.Begin);
|
||||
}
|
||||
public void Seek(uint offset, SeekOrigin mode)
|
||||
{
|
||||
buf.Seek(offset, mode);
|
||||
}
|
||||
|
||||
public ushort ReadShort()
|
||||
{
|
||||
byte[] data = Read(2);
|
||||
if (data.Length != 2)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
if (Env.IsLittleEndian)
|
||||
{
|
||||
Array.Reverse(data);
|
||||
}
|
||||
return BitConverter.ToUInt16(data, 0);
|
||||
}
|
||||
public ushort RawReadShort()
|
||||
{
|
||||
byte[] data = Read(2);
|
||||
if (data.Length != 2)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return BitConverter.ToUInt16(data, 0);
|
||||
}
|
||||
|
||||
public uint ReadInt()
|
||||
{
|
||||
byte[] data = Read(4);
|
||||
if (data.Length != 4)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
if (Env.IsLittleEndian)
|
||||
{
|
||||
Array.Reverse(data);
|
||||
}
|
||||
return BitConverter.ToUInt32(data, 0);
|
||||
}
|
||||
public uint RawReadInt()
|
||||
{
|
||||
byte[] data = Read(4);
|
||||
if (data.Length != 4)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return BitConverter.ToUInt32(data, 0);
|
||||
}
|
||||
|
||||
public ulong ReadInt64()
|
||||
{
|
||||
byte[] data = Read(8);
|
||||
if (data.Length != 8)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
if (Env.IsLittleEndian)
|
||||
{
|
||||
Array.Reverse(data);
|
||||
}
|
||||
return BitConverter.ToUInt64(data, 0);
|
||||
}
|
||||
public ulong RawReadInt64()
|
||||
{
|
||||
byte[] data = Read(8);
|
||||
if (data.Length != 8)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return BitConverter.ToUInt64(data, 0);
|
||||
}
|
||||
|
||||
public string ReadStr()
|
||||
{
|
||||
return ReadStr(false);
|
||||
}
|
||||
public string ReadStr(bool include_null)
|
||||
{
|
||||
uint len = ReadInt();
|
||||
byte[] data = Read(len - (uint)(include_null ? 1 : 0));
|
||||
return Str.ShiftJisEncoding.GetString(data);
|
||||
}
|
||||
|
||||
public string ReadUniStr()
|
||||
{
|
||||
return ReadUniStr(false);
|
||||
}
|
||||
public string ReadUniStr(bool include_null)
|
||||
{
|
||||
uint len = ReadInt();
|
||||
if (len == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
byte[] data = Read(len - (uint)(include_null ? 2 : 0));
|
||||
return Str.Utf8Encoding.GetString(data);
|
||||
}
|
||||
public void WriteShort(ushort shortValue)
|
||||
{
|
||||
byte[] data = BitConverter.GetBytes(shortValue);
|
||||
if (Env.IsLittleEndian)
|
||||
{
|
||||
Array.Reverse(data);
|
||||
}
|
||||
Write(data);
|
||||
}
|
||||
public void RawWriteShort(ushort shortValue)
|
||||
{
|
||||
byte[] data = BitConverter.GetBytes(shortValue);
|
||||
Write(data);
|
||||
}
|
||||
|
||||
public void WriteInt(uint intValue)
|
||||
{
|
||||
byte[] data = BitConverter.GetBytes(intValue);
|
||||
if (Env.IsLittleEndian)
|
||||
{
|
||||
Array.Reverse(data);
|
||||
}
|
||||
Write(data);
|
||||
}
|
||||
public void RawWriteInt(uint intValue)
|
||||
{
|
||||
byte[] data = BitConverter.GetBytes(intValue);
|
||||
Write(data);
|
||||
}
|
||||
|
||||
public void WriteInt64(ulong int64Value)
|
||||
{
|
||||
byte[] data = BitConverter.GetBytes(int64Value);
|
||||
if (Env.IsLittleEndian)
|
||||
{
|
||||
Array.Reverse(data);
|
||||
}
|
||||
Write(data);
|
||||
}
|
||||
public void RawWriteInt64(ulong int64Value)
|
||||
{
|
||||
byte[] data = BitConverter.GetBytes(int64Value);
|
||||
Write(data);
|
||||
}
|
||||
|
||||
public string ReadNextLineAsString()
|
||||
{
|
||||
return ReadNextLineAsString(Str.Utf8Encoding);
|
||||
}
|
||||
public string ReadNextLineAsString(Encoding encoding)
|
||||
{
|
||||
byte[] ret = ReadNextLineAsData();
|
||||
if (ret == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return encoding.GetString(ret);
|
||||
}
|
||||
|
||||
public byte[] ReadNextLineAsData()
|
||||
{
|
||||
if (this.Size <= this.Pos)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
long pos = buf.Position;
|
||||
|
||||
long i;
|
||||
byte[] tmp = new byte[1];
|
||||
for (i = pos; i < buf.Length; i++)
|
||||
{
|
||||
buf.Read(tmp, 0, 1);
|
||||
|
||||
if (tmp[0] == 13 || tmp[0] == 10)
|
||||
{
|
||||
if (tmp[0] == 13)
|
||||
{
|
||||
if ((i + 2) < buf.Length)
|
||||
{
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
long len = i - pos;
|
||||
|
||||
buf.Position = pos;
|
||||
|
||||
byte[] ret = Read((uint)((int)len));
|
||||
|
||||
try
|
||||
{
|
||||
Seek(1, SeekOrigin.Current);
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
|
||||
if (ret.Length >= 1 && ret[ret.Length - 1] == 13)
|
||||
{
|
||||
Array.Resize<byte>(ref ret, ret.Length - 1);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
public void WriteStr(string strValue)
|
||||
{
|
||||
WriteStr(strValue, false);
|
||||
}
|
||||
public void WriteStr(string strValue, bool include_null)
|
||||
{
|
||||
byte[] data = Str.ShiftJisEncoding.GetBytes(strValue);
|
||||
WriteInt((uint)data.Length + (uint)(include_null ? 1 : 0));
|
||||
Write(data);
|
||||
}
|
||||
|
||||
public void WriteUniStr(string strValue)
|
||||
{
|
||||
WriteUniStr(strValue, false);
|
||||
}
|
||||
public void WriteUniStr(string strValue, bool include_null)
|
||||
{
|
||||
byte[] data = Str.Utf8Encoding.GetBytes(strValue);
|
||||
WriteInt((uint)data.Length + (uint)(include_null ? 2 : 0));
|
||||
Write(data);
|
||||
}
|
||||
|
||||
public static Buf ReadFromFile(string filename)
|
||||
{
|
||||
return new Buf(IO.ReadFile(filename));
|
||||
}
|
||||
|
||||
public void WriteToFile(string filename)
|
||||
{
|
||||
IO.SaveFile(filename, this.ByteData);
|
||||
}
|
||||
|
||||
public static Buf ReadFromStream(Stream st)
|
||||
{
|
||||
Buf ret = new Buf();
|
||||
int size = 32767;
|
||||
|
||||
while (true)
|
||||
{
|
||||
byte[] tmp = new byte[size];
|
||||
int i = st.Read(tmp, 0, tmp.Length);
|
||||
|
||||
if (i <= 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
Array.Resize<byte>(ref tmp, i);
|
||||
|
||||
ret.Write(tmp);
|
||||
}
|
||||
|
||||
ret.SeekToBegin();
|
||||
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
320
src/BuildUtil/CoreUtil/Cache.cs
Normal file
320
src/BuildUtil/CoreUtil/Cache.cs
Normal file
@ -0,0 +1,320 @@
|
||||
// CoreUtil
|
||||
//
|
||||
// Copyright (C) 2012-2014 Daiyuu Nobori. All Rights Reserved.
|
||||
// Copyright (C) 2012-2014 SoftEther VPN Project at University of Tsukuba. All Rights Reserved.
|
||||
// Comments: Tetsuo Sugiyama, Ph.D.
|
||||
//
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// version 2 as published by the Free Software Foundation.
|
||||
//
|
||||
// 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 version 2
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// THE LICENSE AGREEMENT IS ATTACHED ON THE SOURCE-CODE PACKAGE
|
||||
// AS "LICENSE.TXT" FILE. READ THE TEXT FILE IN ADVANCE TO USE THE SOFTWARE.
|
||||
//
|
||||
//
|
||||
// THIS SOFTWARE IS DEVELOPED IN JAPAN, AND DISTRIBUTED FROM JAPAN,
|
||||
// UNDER JAPANESE LAWS. YOU MUST AGREE IN ADVANCE TO USE, COPY, MODIFY,
|
||||
// MERGE, PUBLISH, DISTRIBUTE, SUBLICENSE, AND/OR SELL COPIES OF THIS
|
||||
// SOFTWARE, THAT ANY JURIDICAL DISPUTES WHICH ARE CONCERNED TO THIS
|
||||
// SOFTWARE OR ITS CONTENTS, AGAINST US (SOFTETHER PROJECT, SOFTETHER
|
||||
// CORPORATION, DAIYUU NOBORI OR OTHER SUPPLIERS), OR ANY JURIDICAL
|
||||
// DISPUTES AGAINST US WHICH ARE CAUSED BY ANY KIND OF USING, COPYING,
|
||||
// MODIFYING, MERGING, PUBLISHING, DISTRIBUTING, SUBLICENSING, AND/OR
|
||||
// SELLING COPIES OF THIS SOFTWARE SHALL BE REGARDED AS BE CONSTRUED AND
|
||||
// CONTROLLED BY JAPANESE LAWS, AND YOU MUST FURTHER CONSENT TO
|
||||
// EXCLUSIVE JURISDICTION AND VENUE IN THE COURTS SITTING IN TOKYO,
|
||||
// JAPAN. YOU MUST WAIVE ALL DEFENSES OF LACK OF PERSONAL JURISDICTION
|
||||
// AND FORUM NON CONVENIENS. PROCESS MAY BE SERVED ON EITHER PARTY IN
|
||||
// THE MANNER AUTHORIZED BY APPLICABLE LAW OR COURT RULE.
|
||||
//
|
||||
// USE ONLY IN JAPAN. DO NOT USE IT IN OTHER COUNTRIES. IMPORTING THIS
|
||||
// SOFTWARE INTO OTHER COUNTRIES IS AT YOUR OWN RISK. SOME COUNTRIES
|
||||
// PROHIBIT ENCRYPTED COMMUNICATIONS. USING THIS SOFTWARE IN OTHER
|
||||
// COUNTRIES MIGHT BE RESTRICTED.
|
||||
//
|
||||
//
|
||||
// DEAR SECURITY EXPERTS
|
||||
// ---------------------
|
||||
//
|
||||
// If you find a bug or a security vulnerability please kindly inform us
|
||||
// about the problem immediately so that we can fix the security problem
|
||||
// to protect a lot of users around the world as soon as possible.
|
||||
//
|
||||
// Our e-mail address for security reports is:
|
||||
// softether-vpn-security [at] softether.org
|
||||
//
|
||||
// Please note that the above e-mail address is not a technical support
|
||||
// inquiry address. If you need technical assistance, please visit
|
||||
// http://www.softether.org/ and ask your question on the users forum.
|
||||
//
|
||||
// Thank you for your cooperation.
|
||||
|
||||
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Data;
|
||||
using System.Data.Sql;
|
||||
using System.Data.SqlClient;
|
||||
using System.Data.SqlTypes;
|
||||
using System.Text;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Cryptography;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
using System.IO;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Diagnostics;
|
||||
using System.Web.Mail;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Net.NetworkInformation;
|
||||
|
||||
namespace CoreUtil
|
||||
{
|
||||
public enum CacheType
|
||||
{
|
||||
UpdateExpiresWhenAccess = 0,
|
||||
DoNotUpdateExpiresWhenAccess = 1,
|
||||
}
|
||||
|
||||
public class Cache<TKey, TValue>
|
||||
{
|
||||
class Entry
|
||||
{
|
||||
DateTime createdDateTime;
|
||||
public DateTime CreatedDateTime
|
||||
{
|
||||
get { return createdDateTime; }
|
||||
}
|
||||
DateTime updatedDateTime;
|
||||
public DateTime UpdatedDateTime
|
||||
{
|
||||
get { return updatedDateTime; }
|
||||
}
|
||||
DateTime lastAccessedDateTime;
|
||||
public DateTime LastAccessedDateTime
|
||||
{
|
||||
get { return lastAccessedDateTime; }
|
||||
}
|
||||
|
||||
TKey key;
|
||||
public TKey Key
|
||||
{
|
||||
get
|
||||
{
|
||||
return key;
|
||||
}
|
||||
}
|
||||
|
||||
TValue value;
|
||||
public TValue Value
|
||||
{
|
||||
get
|
||||
{
|
||||
lastAccessedDateTime = Time.NowDateTime;
|
||||
return this.value;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.value = value;
|
||||
updatedDateTime = Time.NowDateTime;
|
||||
lastAccessedDateTime = Time.NowDateTime;
|
||||
}
|
||||
}
|
||||
|
||||
public Entry(TKey key, TValue value)
|
||||
{
|
||||
this.key = key;
|
||||
this.value = value;
|
||||
lastAccessedDateTime = updatedDateTime = createdDateTime = Time.NowDateTime;
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return key.GetHashCode();
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return key.ToString() + "," + value.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
public static readonly TimeSpan DefaultExpireSpan = new TimeSpan(0, 5, 0);
|
||||
public const CacheType DefaultCacheType = CacheType.UpdateExpiresWhenAccess;
|
||||
|
||||
TimeSpan expireSpan;
|
||||
public TimeSpan ExpireSpan
|
||||
{
|
||||
get { return expireSpan; }
|
||||
}
|
||||
CacheType type;
|
||||
public CacheType Type
|
||||
{
|
||||
get { return type; }
|
||||
}
|
||||
Dictionary<TKey, Entry> list;
|
||||
object lockObj;
|
||||
|
||||
public Cache()
|
||||
{
|
||||
init(DefaultExpireSpan, DefaultCacheType);
|
||||
}
|
||||
public Cache(CacheType type)
|
||||
{
|
||||
init(DefaultExpireSpan, type);
|
||||
}
|
||||
public Cache(TimeSpan expireSpan)
|
||||
{
|
||||
init(expireSpan, DefaultCacheType);
|
||||
}
|
||||
public Cache(TimeSpan expireSpan, CacheType type)
|
||||
{
|
||||
init(expireSpan, type);
|
||||
}
|
||||
void init(TimeSpan expireSpan, CacheType type)
|
||||
{
|
||||
this.expireSpan = expireSpan;
|
||||
this.type = type;
|
||||
|
||||
list = new Dictionary<TKey, Entry>();
|
||||
lockObj = new object();
|
||||
}
|
||||
|
||||
public void Add(TKey key, TValue value)
|
||||
{
|
||||
lock (lockObj)
|
||||
{
|
||||
Entry e;
|
||||
|
||||
deleteExpired();
|
||||
|
||||
if (list.ContainsKey(key) == false)
|
||||
{
|
||||
e = new Entry(key, value);
|
||||
|
||||
list.Add(e.Key, e);
|
||||
|
||||
deleteExpired();
|
||||
}
|
||||
else
|
||||
{
|
||||
e = list[key];
|
||||
e.Value = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Delete(TKey key)
|
||||
{
|
||||
lock (lockObj)
|
||||
{
|
||||
if (list.ContainsKey(key))
|
||||
{
|
||||
list.Remove(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public TValue this[TKey key]
|
||||
{
|
||||
get
|
||||
{
|
||||
lock (lockObj)
|
||||
{
|
||||
deleteExpired();
|
||||
|
||||
if (list.ContainsKey(key) == false)
|
||||
{
|
||||
return default(TValue);
|
||||
}
|
||||
|
||||
return list[key].Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static long last_deleted = 0;
|
||||
|
||||
void deleteExpired()
|
||||
{
|
||||
bool do_delete = false;
|
||||
long now = Tick64.Value;
|
||||
long delete_inveral = expireSpan.Milliseconds / 10;
|
||||
|
||||
lock (lockObj)
|
||||
{
|
||||
if (last_deleted == 0 || now > (last_deleted + delete_inveral))
|
||||
{
|
||||
last_deleted = now;
|
||||
do_delete = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (do_delete == false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
lock (lockObj)
|
||||
{
|
||||
List<Entry> o = new List<Entry>();
|
||||
DateTime expire = Time.NowDateTime - this.expireSpan;
|
||||
|
||||
foreach (Entry e in list.Values)
|
||||
{
|
||||
if (this.type == CacheType.UpdateExpiresWhenAccess)
|
||||
{
|
||||
if (e.LastAccessedDateTime < expire)
|
||||
{
|
||||
o.Add(e);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (e.UpdatedDateTime < expire)
|
||||
{
|
||||
o.Add(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach (Entry e in o)
|
||||
{
|
||||
list.Remove(e.Key);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
182
src/BuildUtil/CoreUtil/Compress.cs
Normal file
182
src/BuildUtil/CoreUtil/Compress.cs
Normal file
@ -0,0 +1,182 @@
|
||||
// CoreUtil
|
||||
//
|
||||
// Copyright (C) 2012-2014 Daiyuu Nobori. All Rights Reserved.
|
||||
// Copyright (C) 2012-2014 SoftEther VPN Project at University of Tsukuba. All Rights Reserved.
|
||||
// Comments: Tetsuo Sugiyama, Ph.D.
|
||||
//
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// version 2 as published by the Free Software Foundation.
|
||||
//
|
||||
// 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 version 2
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// THE LICENSE AGREEMENT IS ATTACHED ON THE SOURCE-CODE PACKAGE
|
||||
// AS "LICENSE.TXT" FILE. READ THE TEXT FILE IN ADVANCE TO USE THE SOFTWARE.
|
||||
//
|
||||
//
|
||||
// THIS SOFTWARE IS DEVELOPED IN JAPAN, AND DISTRIBUTED FROM JAPAN,
|
||||
// UNDER JAPANESE LAWS. YOU MUST AGREE IN ADVANCE TO USE, COPY, MODIFY,
|
||||
// MERGE, PUBLISH, DISTRIBUTE, SUBLICENSE, AND/OR SELL COPIES OF THIS
|
||||
// SOFTWARE, THAT ANY JURIDICAL DISPUTES WHICH ARE CONCERNED TO THIS
|
||||
// SOFTWARE OR ITS CONTENTS, AGAINST US (SOFTETHER PROJECT, SOFTETHER
|
||||
// CORPORATION, DAIYUU NOBORI OR OTHER SUPPLIERS), OR ANY JURIDICAL
|
||||
// DISPUTES AGAINST US WHICH ARE CAUSED BY ANY KIND OF USING, COPYING,
|
||||
// MODIFYING, MERGING, PUBLISHING, DISTRIBUTING, SUBLICENSING, AND/OR
|
||||
// SELLING COPIES OF THIS SOFTWARE SHALL BE REGARDED AS BE CONSTRUED AND
|
||||
// CONTROLLED BY JAPANESE LAWS, AND YOU MUST FURTHER CONSENT TO
|
||||
// EXCLUSIVE JURISDICTION AND VENUE IN THE COURTS SITTING IN TOKYO,
|
||||
// JAPAN. YOU MUST WAIVE ALL DEFENSES OF LACK OF PERSONAL JURISDICTION
|
||||
// AND FORUM NON CONVENIENS. PROCESS MAY BE SERVED ON EITHER PARTY IN
|
||||
// THE MANNER AUTHORIZED BY APPLICABLE LAW OR COURT RULE.
|
||||
//
|
||||
// USE ONLY IN JAPAN. DO NOT USE IT IN OTHER COUNTRIES. IMPORTING THIS
|
||||
// SOFTWARE INTO OTHER COUNTRIES IS AT YOUR OWN RISK. SOME COUNTRIES
|
||||
// PROHIBIT ENCRYPTED COMMUNICATIONS. USING THIS SOFTWARE IN OTHER
|
||||
// COUNTRIES MIGHT BE RESTRICTED.
|
||||
//
|
||||
//
|
||||
// DEAR SECURITY EXPERTS
|
||||
// ---------------------
|
||||
//
|
||||
// If you find a bug or a security vulnerability please kindly inform us
|
||||
// about the problem immediately so that we can fix the security problem
|
||||
// to protect a lot of users around the world as soon as possible.
|
||||
//
|
||||
// Our e-mail address for security reports is:
|
||||
// softether-vpn-security [at] softether.org
|
||||
//
|
||||
// Please note that the above e-mail address is not a technical support
|
||||
// inquiry address. If you need technical assistance, please visit
|
||||
// http://www.softether.org/ and ask your question on the users forum.
|
||||
//
|
||||
// Thank you for your cooperation.
|
||||
|
||||
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Data;
|
||||
using System.Data.Sql;
|
||||
using System.Data.SqlClient;
|
||||
using System.Data.SqlTypes;
|
||||
using System.Text;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Cryptography;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
using System.IO;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Web.Mail;
|
||||
using CoreUtil.Internal;
|
||||
|
||||
namespace CoreUtil
|
||||
{
|
||||
public static class ZLib
|
||||
{
|
||||
public static byte[] Compress(byte[] src)
|
||||
{
|
||||
return Compress(src, zlibConst.Z_DEFAULT_COMPRESSION);
|
||||
}
|
||||
public static byte[] Compress(byte[] src, int level)
|
||||
{
|
||||
return Compress(src, level, false);
|
||||
}
|
||||
public static byte[] Compress(byte[] src, int level, bool noHeader)
|
||||
{
|
||||
int dstSize = src.Length * 2 + 100;
|
||||
byte[] dst = new byte[dstSize];
|
||||
|
||||
compress2(ref dst, src, level, noHeader);
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
||||
public static byte[] Uncompress(byte[] src, int originalSize)
|
||||
{
|
||||
byte[] dst = new byte[originalSize];
|
||||
|
||||
uncompress(ref dst, src);
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
||||
static void compress2(ref byte[] dest, byte[] src, int level, bool noHeader)
|
||||
{
|
||||
ZStream stream = new ZStream();
|
||||
|
||||
stream.next_in = src;
|
||||
stream.avail_in = src.Length;
|
||||
|
||||
stream.next_out = dest;
|
||||
stream.avail_out = dest.Length;
|
||||
|
||||
if (noHeader == false)
|
||||
{
|
||||
stream.deflateInit(level);
|
||||
}
|
||||
else
|
||||
{
|
||||
stream.deflateInit(level, -15);
|
||||
}
|
||||
|
||||
stream.deflate(zlibConst.Z_FINISH);
|
||||
|
||||
Array.Resize<byte>(ref dest, (int)stream.total_out);
|
||||
}
|
||||
|
||||
static void uncompress(ref byte[] dest, byte[] src)
|
||||
{
|
||||
ZStream stream = new ZStream();
|
||||
|
||||
stream.next_in = src;
|
||||
stream.avail_in = src.Length;
|
||||
|
||||
stream.next_out = dest;
|
||||
stream.avail_out = dest.Length;
|
||||
|
||||
stream.inflateInit();
|
||||
|
||||
int err = stream.inflate(zlibConst.Z_FINISH);
|
||||
if (err != zlibConst.Z_STREAM_END)
|
||||
{
|
||||
stream.inflateEnd();
|
||||
throw new ApplicationException();
|
||||
}
|
||||
|
||||
Array.Resize<byte>(ref dest, (int)stream.total_out);
|
||||
|
||||
err = stream.inflateEnd();
|
||||
if (err != zlibConst.Z_OK)
|
||||
{
|
||||
throw new ApplicationException();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
2180
src/BuildUtil/CoreUtil/Console.cs
Normal file
2180
src/BuildUtil/CoreUtil/Console.cs
Normal file
File diff suppressed because it is too large
Load Diff
497
src/BuildUtil/CoreUtil/Csv.cs
Normal file
497
src/BuildUtil/CoreUtil/Csv.cs
Normal file
@ -0,0 +1,497 @@
|
||||
// CoreUtil
|
||||
//
|
||||
// Copyright (C) 2012-2014 Daiyuu Nobori. All Rights Reserved.
|
||||
// Copyright (C) 2012-2014 SoftEther VPN Project at University of Tsukuba. All Rights Reserved.
|
||||
// Comments: Tetsuo Sugiyama, Ph.D.
|
||||
//
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// version 2 as published by the Free Software Foundation.
|
||||
//
|
||||
// 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 version 2
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// THE LICENSE AGREEMENT IS ATTACHED ON THE SOURCE-CODE PACKAGE
|
||||
// AS "LICENSE.TXT" FILE. READ THE TEXT FILE IN ADVANCE TO USE THE SOFTWARE.
|
||||
//
|
||||
//
|
||||
// THIS SOFTWARE IS DEVELOPED IN JAPAN, AND DISTRIBUTED FROM JAPAN,
|
||||
// UNDER JAPANESE LAWS. YOU MUST AGREE IN ADVANCE TO USE, COPY, MODIFY,
|
||||
// MERGE, PUBLISH, DISTRIBUTE, SUBLICENSE, AND/OR SELL COPIES OF THIS
|
||||
// SOFTWARE, THAT ANY JURIDICAL DISPUTES WHICH ARE CONCERNED TO THIS
|
||||
// SOFTWARE OR ITS CONTENTS, AGAINST US (SOFTETHER PROJECT, SOFTETHER
|
||||
// CORPORATION, DAIYUU NOBORI OR OTHER SUPPLIERS), OR ANY JURIDICAL
|
||||
// DISPUTES AGAINST US WHICH ARE CAUSED BY ANY KIND OF USING, COPYING,
|
||||
// MODIFYING, MERGING, PUBLISHING, DISTRIBUTING, SUBLICENSING, AND/OR
|
||||
// SELLING COPIES OF THIS SOFTWARE SHALL BE REGARDED AS BE CONSTRUED AND
|
||||
// CONTROLLED BY JAPANESE LAWS, AND YOU MUST FURTHER CONSENT TO
|
||||
// EXCLUSIVE JURISDICTION AND VENUE IN THE COURTS SITTING IN TOKYO,
|
||||
// JAPAN. YOU MUST WAIVE ALL DEFENSES OF LACK OF PERSONAL JURISDICTION
|
||||
// AND FORUM NON CONVENIENS. PROCESS MAY BE SERVED ON EITHER PARTY IN
|
||||
// THE MANNER AUTHORIZED BY APPLICABLE LAW OR COURT RULE.
|
||||
//
|
||||
// USE ONLY IN JAPAN. DO NOT USE IT IN OTHER COUNTRIES. IMPORTING THIS
|
||||
// SOFTWARE INTO OTHER COUNTRIES IS AT YOUR OWN RISK. SOME COUNTRIES
|
||||
// PROHIBIT ENCRYPTED COMMUNICATIONS. USING THIS SOFTWARE IN OTHER
|
||||
// COUNTRIES MIGHT BE RESTRICTED.
|
||||
//
|
||||
//
|
||||
// DEAR SECURITY EXPERTS
|
||||
// ---------------------
|
||||
//
|
||||
// If you find a bug or a security vulnerability please kindly inform us
|
||||
// about the problem immediately so that we can fix the security problem
|
||||
// to protect a lot of users around the world as soon as possible.
|
||||
//
|
||||
// Our e-mail address for security reports is:
|
||||
// softether-vpn-security [at] softether.org
|
||||
//
|
||||
// Please note that the above e-mail address is not a technical support
|
||||
// inquiry address. If you need technical assistance, please visit
|
||||
// http://www.softether.org/ and ask your question on the users forum.
|
||||
//
|
||||
// Thank you for your cooperation.
|
||||
|
||||
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Data;
|
||||
using System.Data.Sql;
|
||||
using System.Data.SqlClient;
|
||||
using System.Data.SqlTypes;
|
||||
using System.Text;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Cryptography;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
using System.IO;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Web.Mail;
|
||||
|
||||
|
||||
namespace CoreUtil
|
||||
{
|
||||
class CsvTimeSpan
|
||||
{
|
||||
public DateTime StartDateTime;
|
||||
public DateTime EndDateTime;
|
||||
public int StartIndex;
|
||||
public int NumIndex;
|
||||
|
||||
public CsvTimeSpan(DateTime startDateTime, DateTime endDateTime, int startIndex, int numIndex)
|
||||
{
|
||||
StartDateTime = startDateTime;
|
||||
EndDateTime = endDateTime;
|
||||
StartIndex = startIndex;
|
||||
NumIndex = numIndex;
|
||||
}
|
||||
}
|
||||
|
||||
public class Csv
|
||||
{
|
||||
List<CsvEntry> entryList;
|
||||
Encoding encoding;
|
||||
static Encoding defaultEncoding = Str.ShiftJisEncoding;
|
||||
|
||||
public Encoding Encoding
|
||||
{
|
||||
get
|
||||
{
|
||||
return encoding;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.encoding = value;
|
||||
}
|
||||
}
|
||||
|
||||
public CsvEntry First
|
||||
{
|
||||
get
|
||||
{
|
||||
return entryList[0];
|
||||
}
|
||||
}
|
||||
|
||||
public CsvEntry Last
|
||||
{
|
||||
get
|
||||
{
|
||||
return entryList[entryList.Count - 1];
|
||||
}
|
||||
}
|
||||
|
||||
public Csv()
|
||||
: this(defaultEncoding)
|
||||
{
|
||||
}
|
||||
public Csv(Encoding encoding)
|
||||
{
|
||||
init(null, encoding);
|
||||
}
|
||||
|
||||
public Csv(string filename)
|
||||
: this(filename, defaultEncoding)
|
||||
{
|
||||
}
|
||||
public Csv(string filename, Encoding encoding)
|
||||
{
|
||||
init(Buf.ReadFromFile(filename), encoding);
|
||||
}
|
||||
|
||||
public Csv(Buf data)
|
||||
{
|
||||
byte[] src = data.ByteData;
|
||||
int bomSize;
|
||||
|
||||
Encoding enc = Str.CheckBOM(src, out bomSize);
|
||||
|
||||
if (bomSize >= 1)
|
||||
{
|
||||
src = Util.RemoveStartByteArray(src, bomSize);
|
||||
}
|
||||
|
||||
init(new Buf(src), enc);
|
||||
}
|
||||
public Csv(Buf data, Encoding encoding)
|
||||
{
|
||||
init(data, encoding);
|
||||
}
|
||||
|
||||
void init(Buf data, Encoding encoding)
|
||||
{
|
||||
if (encoding == null)
|
||||
{
|
||||
encoding = defaultEncoding;
|
||||
}
|
||||
|
||||
int bomSize = 0;
|
||||
Encoding enc2 = null;
|
||||
if (data != null)
|
||||
{
|
||||
enc2 = Str.CheckBOM(data.ByteData, out bomSize);
|
||||
}
|
||||
if (bomSize >= 1)
|
||||
{
|
||||
data = new Buf(Util.RemoveStartByteArray(data.ByteData, bomSize));
|
||||
}
|
||||
if (enc2 != null)
|
||||
{
|
||||
encoding = enc2;
|
||||
}
|
||||
this.encoding = encoding;
|
||||
|
||||
entryList = new List<CsvEntry>();
|
||||
|
||||
if (data != null)
|
||||
{
|
||||
MemoryStream ms = new MemoryStream(data.ByteData);
|
||||
StreamReader sr = new StreamReader(ms, this.encoding);
|
||||
|
||||
while (true)
|
||||
{
|
||||
string s = sr.ReadLine();
|
||||
|
||||
if (s == null)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
char[] sep = { ',' };
|
||||
string[] strings = s.Trim().Split(sep, StringSplitOptions.None);
|
||||
|
||||
CsvEntry e = new CsvEntry(strings);
|
||||
Add(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
StringBuilder b = new StringBuilder();
|
||||
|
||||
foreach (CsvEntry e in entryList)
|
||||
{
|
||||
b.AppendLine(e.ToString());
|
||||
}
|
||||
|
||||
return b.ToString();
|
||||
}
|
||||
|
||||
public Buf ToBuf()
|
||||
{
|
||||
string s = ToString();
|
||||
|
||||
Buf b = new Buf();
|
||||
|
||||
byte[] bom = Str.GetBOM(this.Encoding);
|
||||
|
||||
if (bom != null)
|
||||
{
|
||||
b.Write(bom);
|
||||
}
|
||||
|
||||
b.Write(encoding.GetBytes(s));
|
||||
|
||||
b.SeekToBegin();
|
||||
|
||||
return b;
|
||||
}
|
||||
|
||||
public void SaveToFile(string filename)
|
||||
{
|
||||
File.WriteAllBytes(filename, ToBuf().ByteData);
|
||||
}
|
||||
|
||||
public void Add(CsvEntry e)
|
||||
{
|
||||
entryList.Add(e);
|
||||
}
|
||||
|
||||
public int Count
|
||||
{
|
||||
get
|
||||
{
|
||||
return entryList.Count;
|
||||
}
|
||||
}
|
||||
|
||||
public CsvEntry this[int index]
|
||||
{
|
||||
get
|
||||
{
|
||||
return entryList[index];
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable Items
|
||||
{
|
||||
get
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < entryList.Count; i++)
|
||||
{
|
||||
yield return entryList[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CsvCompare csvCompareMethod;
|
||||
int csvCompareIndex;
|
||||
Type csvCompareType;
|
||||
bool csvCompareReverse;
|
||||
|
||||
int sortInternal(CsvEntry e1, CsvEntry e2)
|
||||
{
|
||||
if (csvCompareMethod != null)
|
||||
{
|
||||
object o1 = e1.Convert(csvCompareType, csvCompareIndex);
|
||||
object o2 = e2.Convert(csvCompareType, csvCompareIndex);
|
||||
|
||||
return csvCompareMethod(o1, o2) * (csvCompareReverse ? -1 : 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
IComparable o1 = (IComparable)e1.Convert(csvCompareType, csvCompareIndex);
|
||||
IComparable o2 = (IComparable)e2.Convert(csvCompareType, csvCompareIndex);
|
||||
|
||||
return o1.CompareTo(o2) * (csvCompareReverse ? -1 : 1);
|
||||
}
|
||||
}
|
||||
|
||||
public void Sort(Type type)
|
||||
{
|
||||
Sort(null, type);
|
||||
}
|
||||
public void Sort(CsvCompare cmp, Type type)
|
||||
{
|
||||
Sort(cmp, type, false);
|
||||
}
|
||||
public void Sort(Type type, bool reverse)
|
||||
{
|
||||
Sort(null, type, reverse);
|
||||
}
|
||||
public void Sort(CsvCompare cmp, Type type, bool reverse)
|
||||
{
|
||||
Sort(cmp, 0, type, reverse);
|
||||
}
|
||||
public void Sort(int index, Type type)
|
||||
{
|
||||
Sort(null, index, type);
|
||||
}
|
||||
public void Sort(CsvCompare cmp, int index, Type type)
|
||||
{
|
||||
Sort(cmp, 0, type, false);
|
||||
}
|
||||
public void Sort(int index, Type type, bool reverse)
|
||||
{
|
||||
Sort(null, index, type, reverse);
|
||||
}
|
||||
public void Sort(CsvCompare cmp, int index, Type type, bool reverse)
|
||||
{
|
||||
csvCompareMethod = cmp;
|
||||
csvCompareIndex = index;
|
||||
csvCompareType = type;
|
||||
csvCompareReverse = reverse;
|
||||
|
||||
entryList.Sort(new Comparison<CsvEntry>(sortInternal));
|
||||
}
|
||||
|
||||
public static int CompareString(object o1, object o2)
|
||||
{
|
||||
string s1 = (string)o1;
|
||||
string s2 = (string)o2;
|
||||
return s1.CompareTo(s2);
|
||||
}
|
||||
|
||||
public static int CompareDatetime(object o1, object o2)
|
||||
{
|
||||
DateTime d1 = (DateTime)o1;
|
||||
DateTime d2 = (DateTime)o2;
|
||||
|
||||
return d1.CompareTo(d2);
|
||||
}
|
||||
|
||||
public void SetEncoding(Encoding e)
|
||||
{
|
||||
this.encoding = e;
|
||||
}
|
||||
|
||||
public Csv Clone()
|
||||
{
|
||||
Csv csv = new Csv(this.encoding);
|
||||
|
||||
foreach (CsvEntry e in entryList)
|
||||
{
|
||||
csv.Add(e.Clone());
|
||||
}
|
||||
|
||||
return csv;
|
||||
}
|
||||
}
|
||||
|
||||
public delegate int CsvCompare(object o1, object o2);
|
||||
|
||||
public class CsvEntry
|
||||
{
|
||||
List<string> strings;
|
||||
|
||||
public CsvEntry Clone()
|
||||
{
|
||||
string[] array = (string[])strings.ToArray().Clone();
|
||||
|
||||
CsvEntry e = new CsvEntry(array);
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
public CsvEntry(params string[] elements)
|
||||
{
|
||||
strings = new List<string>();
|
||||
foreach (string s in elements)
|
||||
{
|
||||
string str = s;
|
||||
|
||||
if (str.StartsWith("\"") && str.EndsWith("\"") && str.Length >= 2)
|
||||
{
|
||||
str = str.Substring(1, str.Length - 2);
|
||||
}
|
||||
|
||||
strings.Add(str);
|
||||
}
|
||||
}
|
||||
|
||||
public string this[int index]
|
||||
{
|
||||
get
|
||||
{
|
||||
return strings[index];
|
||||
}
|
||||
}
|
||||
|
||||
public int Count
|
||||
{
|
||||
get
|
||||
{
|
||||
return strings.Count;
|
||||
}
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
int i, num;
|
||||
string ret = "";
|
||||
|
||||
num = strings.Count;
|
||||
for (i = 0; i < num; i++)
|
||||
{
|
||||
string s = strings[i];
|
||||
|
||||
s = Str.ReplaceStr(s, ",", ".", false);
|
||||
s = Str.ReplaceStr(s, "\r\n", " ", false);
|
||||
s = Str.ReplaceStr(s, "\r", " ", false);
|
||||
s = Str.ReplaceStr(s, "\n", " ", false);
|
||||
|
||||
ret += s;
|
||||
|
||||
if ((i + 1) < num)
|
||||
{
|
||||
ret += ",";
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
Type lastType = null;
|
||||
object lastObject = null;
|
||||
int lastIndex = -1;
|
||||
|
||||
public object Convert(Type type, int index)
|
||||
{
|
||||
if (lastType == type && lastIndex == index)
|
||||
{
|
||||
return lastObject;
|
||||
}
|
||||
|
||||
lastType = type;
|
||||
lastIndex = index;
|
||||
lastObject = System.Convert.ChangeType(strings[index], type);
|
||||
|
||||
return lastObject;
|
||||
}
|
||||
|
||||
public DateTime ToDateTime(int index)
|
||||
{
|
||||
return (DateTime)Convert(typeof(DateTime), index);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
572
src/BuildUtil/CoreUtil/Env.cs
Normal file
572
src/BuildUtil/CoreUtil/Env.cs
Normal file
@ -0,0 +1,572 @@
|
||||
// CoreUtil
|
||||
//
|
||||
// Copyright (C) 2012-2014 Daiyuu Nobori. All Rights Reserved.
|
||||
// Copyright (C) 2012-2014 SoftEther VPN Project at University of Tsukuba. All Rights Reserved.
|
||||
// Comments: Tetsuo Sugiyama, Ph.D.
|
||||
//
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// version 2 as published by the Free Software Foundation.
|
||||
//
|
||||
// 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 version 2
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// THE LICENSE AGREEMENT IS ATTACHED ON THE SOURCE-CODE PACKAGE
|
||||
// AS "LICENSE.TXT" FILE. READ THE TEXT FILE IN ADVANCE TO USE THE SOFTWARE.
|
||||
//
|
||||
//
|
||||
// THIS SOFTWARE IS DEVELOPED IN JAPAN, AND DISTRIBUTED FROM JAPAN,
|
||||
// UNDER JAPANESE LAWS. YOU MUST AGREE IN ADVANCE TO USE, COPY, MODIFY,
|
||||
// MERGE, PUBLISH, DISTRIBUTE, SUBLICENSE, AND/OR SELL COPIES OF THIS
|
||||
// SOFTWARE, THAT ANY JURIDICAL DISPUTES WHICH ARE CONCERNED TO THIS
|
||||
// SOFTWARE OR ITS CONTENTS, AGAINST US (SOFTETHER PROJECT, SOFTETHER
|
||||
// CORPORATION, DAIYUU NOBORI OR OTHER SUPPLIERS), OR ANY JURIDICAL
|
||||
// DISPUTES AGAINST US WHICH ARE CAUSED BY ANY KIND OF USING, COPYING,
|
||||
// MODIFYING, MERGING, PUBLISHING, DISTRIBUTING, SUBLICENSING, AND/OR
|
||||
// SELLING COPIES OF THIS SOFTWARE SHALL BE REGARDED AS BE CONSTRUED AND
|
||||
// CONTROLLED BY JAPANESE LAWS, AND YOU MUST FURTHER CONSENT TO
|
||||
// EXCLUSIVE JURISDICTION AND VENUE IN THE COURTS SITTING IN TOKYO,
|
||||
// JAPAN. YOU MUST WAIVE ALL DEFENSES OF LACK OF PERSONAL JURISDICTION
|
||||
// AND FORUM NON CONVENIENS. PROCESS MAY BE SERVED ON EITHER PARTY IN
|
||||
// THE MANNER AUTHORIZED BY APPLICABLE LAW OR COURT RULE.
|
||||
//
|
||||
// USE ONLY IN JAPAN. DO NOT USE IT IN OTHER COUNTRIES. IMPORTING THIS
|
||||
// SOFTWARE INTO OTHER COUNTRIES IS AT YOUR OWN RISK. SOME COUNTRIES
|
||||
// PROHIBIT ENCRYPTED COMMUNICATIONS. USING THIS SOFTWARE IN OTHER
|
||||
// COUNTRIES MIGHT BE RESTRICTED.
|
||||
//
|
||||
//
|
||||
// DEAR SECURITY EXPERTS
|
||||
// ---------------------
|
||||
//
|
||||
// If you find a bug or a security vulnerability please kindly inform us
|
||||
// about the problem immediately so that we can fix the security problem
|
||||
// to protect a lot of users around the world as soon as possible.
|
||||
//
|
||||
// Our e-mail address for security reports is:
|
||||
// softether-vpn-security [at] softether.org
|
||||
//
|
||||
// Please note that the above e-mail address is not a technical support
|
||||
// inquiry address. If you need technical assistance, please visit
|
||||
// http://www.softether.org/ and ask your question on the users forum.
|
||||
//
|
||||
// Thank you for your cooperation.
|
||||
|
||||
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Data;
|
||||
using System.Data.Sql;
|
||||
using System.Data.SqlClient;
|
||||
using System.Data.SqlTypes;
|
||||
using System.Text;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Cryptography;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
using System.IO;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Diagnostics;
|
||||
using System.Web.Mail;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Net.NetworkInformation;
|
||||
using System.Net.Mail;
|
||||
using System.Net.Mime;
|
||||
using System.Reflection;
|
||||
using CoreUtil;
|
||||
|
||||
namespace CoreUtil
|
||||
{
|
||||
public static class Env
|
||||
{
|
||||
static object lockObj = new object();
|
||||
static bool inited = false;
|
||||
|
||||
static Env()
|
||||
{
|
||||
initCache();
|
||||
}
|
||||
|
||||
static void initCache()
|
||||
{
|
||||
lock (lockObj)
|
||||
{
|
||||
if (inited == false)
|
||||
{
|
||||
initValues();
|
||||
inited = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static string homeDir;
|
||||
static public string HomeDir
|
||||
{
|
||||
get { return homeDir; }
|
||||
}
|
||||
static string exeFileName;
|
||||
static public string ExeFileName
|
||||
{
|
||||
get { return exeFileName; }
|
||||
}
|
||||
static string exeFileDir;
|
||||
static public string ExeFileDir
|
||||
{
|
||||
get { return exeFileDir; }
|
||||
}
|
||||
static string windowsDir;
|
||||
static public string WindowsDir
|
||||
{
|
||||
get { return windowsDir; }
|
||||
}
|
||||
static string systemDir;
|
||||
static public string SystemDir
|
||||
{
|
||||
get { return systemDir; }
|
||||
}
|
||||
static string tempDir;
|
||||
static public string TempDir
|
||||
{
|
||||
get { return tempDir; }
|
||||
}
|
||||
static string winTempDir;
|
||||
static public string WinTempDir
|
||||
{
|
||||
get { return winTempDir; }
|
||||
}
|
||||
static string windowsDrive;
|
||||
static public string WindowsDrive
|
||||
{
|
||||
get { return windowsDrive; }
|
||||
}
|
||||
static string programFilesDir;
|
||||
static public string ProgramFilesDir
|
||||
{
|
||||
get { return programFilesDir; }
|
||||
}
|
||||
static string personalStartMenuDir;
|
||||
static public string PersonalStartMenuDir
|
||||
{
|
||||
get { return personalStartMenuDir; }
|
||||
}
|
||||
static string personalProgramsDir;
|
||||
static public string PersonalProgramsDir
|
||||
{
|
||||
get { return personalProgramsDir; }
|
||||
}
|
||||
static string personalStartupDir;
|
||||
static public string PersonalStartupDir
|
||||
{
|
||||
get { return personalStartupDir; }
|
||||
}
|
||||
static string personalAppDataDir;
|
||||
static public string PersonalAppDataDir
|
||||
{
|
||||
get { return personalAppDataDir; }
|
||||
}
|
||||
static string personalDesktopDir;
|
||||
static public string PersonalDesktopDir
|
||||
{
|
||||
get { return personalDesktopDir; }
|
||||
}
|
||||
static string myDocumentsDir;
|
||||
static public string MyDocumentsDir
|
||||
{
|
||||
get { return myDocumentsDir; }
|
||||
}
|
||||
static string localAppDataDir;
|
||||
static public string LocalAppDataDir
|
||||
{
|
||||
get { return localAppDataDir; }
|
||||
}
|
||||
static string userName;
|
||||
static public string UserName
|
||||
{
|
||||
get { return userName; }
|
||||
}
|
||||
static string userNameEx;
|
||||
static public string UserNameEx
|
||||
{
|
||||
get { return userNameEx; }
|
||||
}
|
||||
static string machineName;
|
||||
static public string MachineName
|
||||
{
|
||||
get { return machineName; }
|
||||
}
|
||||
static string commandLine;
|
||||
public static string CommandLine
|
||||
{
|
||||
get { return commandLine; }
|
||||
}
|
||||
public static StrToken CommandLineList
|
||||
{
|
||||
get
|
||||
{
|
||||
return new StrToken(CommandLine);
|
||||
}
|
||||
}
|
||||
static OperatingSystem osInfo;
|
||||
public static OperatingSystem OsInfo
|
||||
{
|
||||
get { return osInfo; }
|
||||
}
|
||||
static bool isNt;
|
||||
public static bool IsNt
|
||||
{
|
||||
get { return isNt; }
|
||||
}
|
||||
static bool is9x;
|
||||
public static bool Is9x
|
||||
{
|
||||
get { return is9x; }
|
||||
}
|
||||
static bool isCe;
|
||||
public static bool IsCe
|
||||
{
|
||||
get { return isCe; }
|
||||
}
|
||||
static bool isLittleEndian;
|
||||
public static bool IsLittleEndian
|
||||
{
|
||||
get { return Env.isLittleEndian; }
|
||||
}
|
||||
public static bool IsBigEndian
|
||||
{
|
||||
get { return !IsLittleEndian; }
|
||||
}
|
||||
static bool isAdmin;
|
||||
public static bool IsAdmin
|
||||
{
|
||||
get { return Env.isAdmin; }
|
||||
}
|
||||
static int processId;
|
||||
public static int ProcessId
|
||||
{
|
||||
get { return Env.processId; }
|
||||
}
|
||||
static string myTempDir;
|
||||
public static string MyTempDir
|
||||
{
|
||||
get { return myTempDir; }
|
||||
}
|
||||
static IO lockFile;
|
||||
|
||||
public static bool Is64BitProcess
|
||||
{
|
||||
get
|
||||
{
|
||||
return (IntPtr.Size == 8);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool Is64BitWindows
|
||||
{
|
||||
get
|
||||
{
|
||||
return Is64BitProcess || Kernel.InternalCheckIsWow64();
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsWow64
|
||||
{
|
||||
get
|
||||
{
|
||||
return Kernel.InternalCheckIsWow64();
|
||||
}
|
||||
}
|
||||
|
||||
static void initValues()
|
||||
{
|
||||
exeFileName = IO.RemoteLastEnMark(getMyExeFileName());
|
||||
if (Str.IsEmptyStr(exeFileName) == false)
|
||||
{
|
||||
exeFileDir = IO.RemoteLastEnMark(Path.GetDirectoryName(exeFileName));
|
||||
}
|
||||
else
|
||||
{
|
||||
exeFileDir = "";
|
||||
}
|
||||
homeDir = IO.RemoteLastEnMark(Kernel.GetEnvStr("HOME"));
|
||||
if (Str.IsEmptyStr(homeDir))
|
||||
{
|
||||
homeDir = IO.RemoteLastEnMark(Kernel.GetEnvStr("HOMEDRIVE") + Kernel.GetEnvStr("HOMEPATH"));
|
||||
}
|
||||
if (Str.IsEmptyStr(homeDir))
|
||||
{
|
||||
homeDir = CurrentDir;
|
||||
}
|
||||
systemDir = IO.RemoteLastEnMark(Environment.GetFolderPath(Environment.SpecialFolder.System));
|
||||
windowsDir = IO.RemoteLastEnMark(Path.GetDirectoryName(systemDir));
|
||||
tempDir = IO.RemoteLastEnMark(Path.GetTempPath());
|
||||
winTempDir = IO.RemoteLastEnMark(Path.Combine(windowsDir, "Temp"));
|
||||
IO.MakeDir(winTempDir);
|
||||
if (windowsDir.Length >= 2 && windowsDir[1] == ':')
|
||||
{
|
||||
windowsDrive = windowsDir.Substring(0, 2).ToUpper();
|
||||
}
|
||||
else
|
||||
{
|
||||
windowsDrive = "C:";
|
||||
}
|
||||
programFilesDir = IO.RemoteLastEnMark(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles));
|
||||
personalStartMenuDir = IO.RemoteLastEnMark(Environment.GetFolderPath(Environment.SpecialFolder.StartMenu));
|
||||
personalProgramsDir = IO.RemoteLastEnMark(Environment.GetFolderPath(Environment.SpecialFolder.Programs));
|
||||
personalStartupDir = IO.RemoteLastEnMark(Environment.GetFolderPath(Environment.SpecialFolder.Startup));
|
||||
personalAppDataDir = IO.RemoteLastEnMark(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData));
|
||||
personalDesktopDir = IO.RemoteLastEnMark(Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory));
|
||||
myDocumentsDir = IO.RemoteLastEnMark(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments));
|
||||
localAppDataDir = IO.RemoteLastEnMark(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData));
|
||||
userName = Environment.UserName;
|
||||
try
|
||||
{
|
||||
userNameEx = Environment.UserDomainName + "\\" + userName;
|
||||
}
|
||||
catch
|
||||
{
|
||||
userNameEx = userName;
|
||||
}
|
||||
machineName = Environment.MachineName;
|
||||
commandLine = initCommandLine(Environment.CommandLine);
|
||||
osInfo = Environment.OSVersion;
|
||||
isNt = (osInfo.Platform == PlatformID.Win32NT);
|
||||
isCe = (osInfo.Platform == PlatformID.WinCE);
|
||||
is9x = !(isNt || isCe);
|
||||
isLittleEndian = BitConverter.IsLittleEndian;
|
||||
processId = System.Diagnostics.Process.GetCurrentProcess().Id;
|
||||
isAdmin = checkIsAdmin();
|
||||
initMyTempDir();
|
||||
}
|
||||
|
||||
static void deleteUnusedTempDir()
|
||||
{
|
||||
DirEntry[] files;
|
||||
|
||||
files = IO.EnumDir(Env.tempDir);
|
||||
|
||||
foreach (DirEntry e in files)
|
||||
{
|
||||
if (e.IsFolder)
|
||||
{
|
||||
if (e.FileName.StartsWith("NET_", StringComparison.CurrentCultureIgnoreCase) && e.FileName.Length == 8)
|
||||
{
|
||||
string dirFullName = Path.Combine(Env.tempDir, e.fileName);
|
||||
string lockFileName = Path.Combine(dirFullName, "LockFile.dat");
|
||||
bool deleteNow = false;
|
||||
|
||||
try
|
||||
{
|
||||
IO io = IO.FileOpen(lockFileName);
|
||||
io.Close();
|
||||
|
||||
try
|
||||
{
|
||||
io = IO.FileOpen(lockFileName, true);
|
||||
deleteNow = true;
|
||||
io.Close();
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
DirEntry[] files2;
|
||||
|
||||
deleteNow = true;
|
||||
|
||||
try
|
||||
{
|
||||
files2 = IO.EnumDir(dirFullName);
|
||||
|
||||
foreach (DirEntry e2 in files2)
|
||||
{
|
||||
if (e2.IsFolder == false)
|
||||
{
|
||||
string fullPath = Path.Combine(dirFullName, e2.fileName);
|
||||
|
||||
try
|
||||
{
|
||||
IO io2 = IO.FileOpen(fullPath, true);
|
||||
io2.Close();
|
||||
}
|
||||
catch
|
||||
{
|
||||
deleteNow = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
deleteNow = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (deleteNow)
|
||||
{
|
||||
IO.DeleteDir(dirFullName, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void initMyTempDir()
|
||||
{
|
||||
try
|
||||
{
|
||||
deleteUnusedTempDir();
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
|
||||
int num = 0;
|
||||
|
||||
while (true)
|
||||
{
|
||||
byte[] rand = Secure.Rand(2);
|
||||
string tmp2 = Str.ByteToStr(rand);
|
||||
|
||||
string tmp = Path.Combine(Env.tempDir, "NET_" + tmp2);
|
||||
|
||||
if (IO.IsDirExists(tmp) == false && IO.MakeDir(tmp))
|
||||
{
|
||||
Env.myTempDir = tmp;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if ((num++) >= 100)
|
||||
{
|
||||
throw new SystemException();
|
||||
}
|
||||
}
|
||||
|
||||
string lockFileName = Path.Combine(Env.myTempDir, "LockFile.dat");
|
||||
lockFile = IO.FileCreate(lockFileName);
|
||||
}
|
||||
|
||||
static bool checkIsAdmin()
|
||||
{
|
||||
try
|
||||
{
|
||||
string name = "Vpn_Check_Admin_Key_NET_" + processId.ToString();
|
||||
string teststr = Str.GenRandStr();
|
||||
|
||||
if (Reg.WriteStr(RegRoot.LocalMachine, "", name, teststr) == false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
string ret = Reg.ReadStr(RegRoot.LocalMachine, "", name);
|
||||
|
||||
if (ret == teststr)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
finally
|
||||
{
|
||||
Reg.DeleteValue(RegRoot.LocalMachine, "", name);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
static string initCommandLine(string src)
|
||||
{
|
||||
try
|
||||
{
|
||||
int i;
|
||||
if (src.Length >= 1 && src[0] == '\"')
|
||||
{
|
||||
i = src.IndexOf('\"', 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
i = src.IndexOf(' ');
|
||||
}
|
||||
|
||||
if (i == -1)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
else
|
||||
{
|
||||
return src.Substring(i + 1).TrimStart(' ');
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
static string getMyExeFileName()
|
||||
{
|
||||
try
|
||||
{
|
||||
Assembly mainAssembly = Assembly.GetEntryAssembly();
|
||||
Module[] modules = mainAssembly.GetModules();
|
||||
return modules[0].FullyQualifiedName;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
static public string CurrentDir
|
||||
{
|
||||
get
|
||||
{
|
||||
return IO.RemoteLastEnMark(Environment.CurrentDirectory);
|
||||
}
|
||||
}
|
||||
static public string NewLine
|
||||
{
|
||||
get
|
||||
{
|
||||
return Environment.NewLine;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
1702
src/BuildUtil/CoreUtil/FileIO.cs
Normal file
1702
src/BuildUtil/CoreUtil/FileIO.cs
Normal file
File diff suppressed because it is too large
Load Diff
233
src/BuildUtil/CoreUtil/GZip.cs
Normal file
233
src/BuildUtil/CoreUtil/GZip.cs
Normal file
@ -0,0 +1,233 @@
|
||||
// CoreUtil
|
||||
//
|
||||
// Copyright (C) 2012-2014 Daiyuu Nobori. All Rights Reserved.
|
||||
// Copyright (C) 2012-2014 SoftEther VPN Project at University of Tsukuba. All Rights Reserved.
|
||||
// Comments: Tetsuo Sugiyama, Ph.D.
|
||||
//
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// version 2 as published by the Free Software Foundation.
|
||||
//
|
||||
// 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 version 2
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// THE LICENSE AGREEMENT IS ATTACHED ON THE SOURCE-CODE PACKAGE
|
||||
// AS "LICENSE.TXT" FILE. READ THE TEXT FILE IN ADVANCE TO USE THE SOFTWARE.
|
||||
//
|
||||
//
|
||||
// THIS SOFTWARE IS DEVELOPED IN JAPAN, AND DISTRIBUTED FROM JAPAN,
|
||||
// UNDER JAPANESE LAWS. YOU MUST AGREE IN ADVANCE TO USE, COPY, MODIFY,
|
||||
// MERGE, PUBLISH, DISTRIBUTE, SUBLICENSE, AND/OR SELL COPIES OF THIS
|
||||
// SOFTWARE, THAT ANY JURIDICAL DISPUTES WHICH ARE CONCERNED TO THIS
|
||||
// SOFTWARE OR ITS CONTENTS, AGAINST US (SOFTETHER PROJECT, SOFTETHER
|
||||
// CORPORATION, DAIYUU NOBORI OR OTHER SUPPLIERS), OR ANY JURIDICAL
|
||||
// DISPUTES AGAINST US WHICH ARE CAUSED BY ANY KIND OF USING, COPYING,
|
||||
// MODIFYING, MERGING, PUBLISHING, DISTRIBUTING, SUBLICENSING, AND/OR
|
||||
// SELLING COPIES OF THIS SOFTWARE SHALL BE REGARDED AS BE CONSTRUED AND
|
||||
// CONTROLLED BY JAPANESE LAWS, AND YOU MUST FURTHER CONSENT TO
|
||||
// EXCLUSIVE JURISDICTION AND VENUE IN THE COURTS SITTING IN TOKYO,
|
||||
// JAPAN. YOU MUST WAIVE ALL DEFENSES OF LACK OF PERSONAL JURISDICTION
|
||||
// AND FORUM NON CONVENIENS. PROCESS MAY BE SERVED ON EITHER PARTY IN
|
||||
// THE MANNER AUTHORIZED BY APPLICABLE LAW OR COURT RULE.
|
||||
//
|
||||
// USE ONLY IN JAPAN. DO NOT USE IT IN OTHER COUNTRIES. IMPORTING THIS
|
||||
// SOFTWARE INTO OTHER COUNTRIES IS AT YOUR OWN RISK. SOME COUNTRIES
|
||||
// PROHIBIT ENCRYPTED COMMUNICATIONS. USING THIS SOFTWARE IN OTHER
|
||||
// COUNTRIES MIGHT BE RESTRICTED.
|
||||
//
|
||||
//
|
||||
// DEAR SECURITY EXPERTS
|
||||
// ---------------------
|
||||
//
|
||||
// If you find a bug or a security vulnerability please kindly inform us
|
||||
// about the problem immediately so that we can fix the security problem
|
||||
// to protect a lot of users around the world as soon as possible.
|
||||
//
|
||||
// Our e-mail address for security reports is:
|
||||
// softether-vpn-security [at] softether.org
|
||||
//
|
||||
// Please note that the above e-mail address is not a technical support
|
||||
// inquiry address. If you need technical assistance, please visit
|
||||
// http://www.softether.org/ and ask your question on the users forum.
|
||||
//
|
||||
// Thank you for your cooperation.
|
||||
|
||||
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Data;
|
||||
using System.Data.Sql;
|
||||
using System.Data.SqlClient;
|
||||
using System.Data.SqlTypes;
|
||||
using System.Text;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Cryptography;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Runtime.InteropServices;
|
||||
using CoreUtil.Internal;
|
||||
|
||||
namespace CoreUtil
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
public struct GZipHeader
|
||||
{
|
||||
public byte ID1, ID2, CM, FLG;
|
||||
public uint MTIME;
|
||||
public byte XFL, OS;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
public struct GZipFooter
|
||||
{
|
||||
public uint CRC32;
|
||||
public uint ISIZE;
|
||||
}
|
||||
|
||||
public static class GZipUtil
|
||||
{
|
||||
public static byte[] Decompress(byte[] gzip)
|
||||
{
|
||||
using (GZipStream stream = new GZipStream(new MemoryStream(gzip), CompressionMode.Decompress))
|
||||
{
|
||||
const int size = 4096;
|
||||
byte[] buffer = new byte[size];
|
||||
using (MemoryStream memory = new MemoryStream())
|
||||
{
|
||||
int count = 0;
|
||||
do
|
||||
{
|
||||
count = stream.Read(buffer, 0, size);
|
||||
if (count > 0)
|
||||
{
|
||||
memory.Write(buffer, 0, count);
|
||||
}
|
||||
}
|
||||
while (count > 0);
|
||||
return memory.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class GZipPacker
|
||||
{
|
||||
Fifo fifo;
|
||||
ZStream zs;
|
||||
long currentSize;
|
||||
uint crc32;
|
||||
bool finished;
|
||||
|
||||
public bool Finished
|
||||
{
|
||||
get { return finished; }
|
||||
}
|
||||
|
||||
public Fifo GeneratedData
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.fifo;
|
||||
}
|
||||
}
|
||||
|
||||
public GZipPacker()
|
||||
{
|
||||
fifo = new Fifo();
|
||||
|
||||
zs = new ZStream();
|
||||
zs.deflateInit(-1, -15);
|
||||
|
||||
this.currentSize = 0;
|
||||
this.crc32 = 0xffffffff;
|
||||
this.finished = false;
|
||||
|
||||
GZipHeader h = new GZipHeader();
|
||||
h.ID1 = 0x1f;
|
||||
h.ID2 = 0x8b;
|
||||
h.FLG = 0;
|
||||
h.MTIME = Util.DateTimeToUnixTime(DateTime.Now.ToUniversalTime());
|
||||
h.XFL = 0;
|
||||
h.OS = 3;
|
||||
h.CM = 8;
|
||||
|
||||
fifo.Write(Util.StructToByte(h));
|
||||
}
|
||||
|
||||
public void Write(byte[] data, int pos, int len, bool finish)
|
||||
{
|
||||
byte[] srcData = Util.ExtractByteArray(data, pos, len);
|
||||
byte[] dstData = new byte[srcData.Length * 2 + 100];
|
||||
|
||||
if (this.finished)
|
||||
{
|
||||
throw new ApplicationException("already finished");
|
||||
}
|
||||
|
||||
zs.next_in = srcData;
|
||||
zs.avail_in = srcData.Length;
|
||||
zs.next_in_index = 0;
|
||||
|
||||
zs.next_out = dstData;
|
||||
zs.avail_out = dstData.Length;
|
||||
zs.next_out_index = 0;
|
||||
|
||||
if (finish)
|
||||
{
|
||||
zs.deflate(zlibConst.Z_FINISH);
|
||||
}
|
||||
else
|
||||
{
|
||||
zs.deflate(zlibConst.Z_SYNC_FLUSH);
|
||||
}
|
||||
|
||||
fifo.Write(dstData, 0, dstData.Length - zs.avail_out);
|
||||
|
||||
currentSize += len;
|
||||
|
||||
this.crc32 = ZipUtil.Crc32Next(data, pos, len, this.crc32);
|
||||
|
||||
if (finish)
|
||||
{
|
||||
this.finished = true;
|
||||
this.crc32 = ~this.crc32;
|
||||
|
||||
GZipFooter f = new GZipFooter();
|
||||
f.CRC32 = this.crc32;
|
||||
f.ISIZE = (uint)(this.currentSize % 0x100000000);
|
||||
|
||||
fifo.Write(Util.StructToByte(f));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
170
src/BuildUtil/CoreUtil/Kernel.cs
Normal file
170
src/BuildUtil/CoreUtil/Kernel.cs
Normal file
@ -0,0 +1,170 @@
|
||||
// CoreUtil
|
||||
//
|
||||
// Copyright (C) 2012-2014 Daiyuu Nobori. All Rights Reserved.
|
||||
// Copyright (C) 2012-2014 SoftEther VPN Project at University of Tsukuba. All Rights Reserved.
|
||||
// Comments: Tetsuo Sugiyama, Ph.D.
|
||||
//
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// version 2 as published by the Free Software Foundation.
|
||||
//
|
||||
// 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 version 2
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// THE LICENSE AGREEMENT IS ATTACHED ON THE SOURCE-CODE PACKAGE
|
||||
// AS "LICENSE.TXT" FILE. READ THE TEXT FILE IN ADVANCE TO USE THE SOFTWARE.
|
||||
//
|
||||
//
|
||||
// THIS SOFTWARE IS DEVELOPED IN JAPAN, AND DISTRIBUTED FROM JAPAN,
|
||||
// UNDER JAPANESE LAWS. YOU MUST AGREE IN ADVANCE TO USE, COPY, MODIFY,
|
||||
// MERGE, PUBLISH, DISTRIBUTE, SUBLICENSE, AND/OR SELL COPIES OF THIS
|
||||
// SOFTWARE, THAT ANY JURIDICAL DISPUTES WHICH ARE CONCERNED TO THIS
|
||||
// SOFTWARE OR ITS CONTENTS, AGAINST US (SOFTETHER PROJECT, SOFTETHER
|
||||
// CORPORATION, DAIYUU NOBORI OR OTHER SUPPLIERS), OR ANY JURIDICAL
|
||||
// DISPUTES AGAINST US WHICH ARE CAUSED BY ANY KIND OF USING, COPYING,
|
||||
// MODIFYING, MERGING, PUBLISHING, DISTRIBUTING, SUBLICENSING, AND/OR
|
||||
// SELLING COPIES OF THIS SOFTWARE SHALL BE REGARDED AS BE CONSTRUED AND
|
||||
// CONTROLLED BY JAPANESE LAWS, AND YOU MUST FURTHER CONSENT TO
|
||||
// EXCLUSIVE JURISDICTION AND VENUE IN THE COURTS SITTING IN TOKYO,
|
||||
// JAPAN. YOU MUST WAIVE ALL DEFENSES OF LACK OF PERSONAL JURISDICTION
|
||||
// AND FORUM NON CONVENIENS. PROCESS MAY BE SERVED ON EITHER PARTY IN
|
||||
// THE MANNER AUTHORIZED BY APPLICABLE LAW OR COURT RULE.
|
||||
//
|
||||
// USE ONLY IN JAPAN. DO NOT USE IT IN OTHER COUNTRIES. IMPORTING THIS
|
||||
// SOFTWARE INTO OTHER COUNTRIES IS AT YOUR OWN RISK. SOME COUNTRIES
|
||||
// PROHIBIT ENCRYPTED COMMUNICATIONS. USING THIS SOFTWARE IN OTHER
|
||||
// COUNTRIES MIGHT BE RESTRICTED.
|
||||
//
|
||||
//
|
||||
// DEAR SECURITY EXPERTS
|
||||
// ---------------------
|
||||
//
|
||||
// If you find a bug or a security vulnerability please kindly inform us
|
||||
// about the problem immediately so that we can fix the security problem
|
||||
// to protect a lot of users around the world as soon as possible.
|
||||
//
|
||||
// Our e-mail address for security reports is:
|
||||
// softether-vpn-security [at] softether.org
|
||||
//
|
||||
// Please note that the above e-mail address is not a technical support
|
||||
// inquiry address. If you need technical assistance, please visit
|
||||
// http://www.softether.org/ and ask your question on the users forum.
|
||||
//
|
||||
// Thank you for your cooperation.
|
||||
|
||||
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Data;
|
||||
using System.Data.Sql;
|
||||
using System.Data.SqlClient;
|
||||
using System.Data.SqlTypes;
|
||||
using System.Text;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Cryptography;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
using System.IO;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Diagnostics;
|
||||
using System.Web.Mail;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Net.NetworkInformation;
|
||||
using System.Net.Mail;
|
||||
using System.Net.Mime;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace CoreUtil
|
||||
{
|
||||
public static class Kernel
|
||||
{
|
||||
[DllImport("kernel32.dll", SetLastError = true, CallingConvention = CallingConvention.Winapi)]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
private static extern bool IsWow64Process(
|
||||
[In] IntPtr hProcess,
|
||||
[Out] out bool wow64Process
|
||||
);
|
||||
|
||||
public static bool InternalCheckIsWow64()
|
||||
{
|
||||
if ((Environment.OSVersion.Version.Major == 5 && Environment.OSVersion.Version.Minor >= 1) ||
|
||||
Environment.OSVersion.Version.Major >= 6)
|
||||
{
|
||||
using (Process p = Process.GetCurrentProcess())
|
||||
{
|
||||
bool retVal;
|
||||
if (!IsWow64Process(p.Handle, out retVal))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static void SleepThread(int millisec)
|
||||
{
|
||||
ThreadObj.Sleep(millisec);
|
||||
}
|
||||
|
||||
public static string GetEnvStr(string name)
|
||||
{
|
||||
string ret = Environment.GetEnvironmentVariable(name);
|
||||
|
||||
if (ret == null)
|
||||
{
|
||||
ret = "";
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static public void SelfKill()
|
||||
{
|
||||
System.Diagnostics.Process.GetCurrentProcess().Kill();
|
||||
}
|
||||
|
||||
public static Process Run(string exeName, string args)
|
||||
{
|
||||
Process p = new Process();
|
||||
p.StartInfo.FileName = IO.InnerFilePath(exeName);
|
||||
p.StartInfo.Arguments = args;
|
||||
|
||||
p.Start();
|
||||
|
||||
return p;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
939
src/BuildUtil/CoreUtil/MultiLang.cs
Normal file
939
src/BuildUtil/CoreUtil/MultiLang.cs
Normal file
@ -0,0 +1,939 @@
|
||||
// CoreUtil
|
||||
//
|
||||
// Copyright (C) 2012-2014 Daiyuu Nobori. All Rights Reserved.
|
||||
// Copyright (C) 2012-2014 SoftEther VPN Project at University of Tsukuba. All Rights Reserved.
|
||||
// Comments: Tetsuo Sugiyama, Ph.D.
|
||||
//
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// version 2 as published by the Free Software Foundation.
|
||||
//
|
||||
// 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 version 2
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// THE LICENSE AGREEMENT IS ATTACHED ON THE SOURCE-CODE PACKAGE
|
||||
// AS "LICENSE.TXT" FILE. READ THE TEXT FILE IN ADVANCE TO USE THE SOFTWARE.
|
||||
//
|
||||
//
|
||||
// THIS SOFTWARE IS DEVELOPED IN JAPAN, AND DISTRIBUTED FROM JAPAN,
|
||||
// UNDER JAPANESE LAWS. YOU MUST AGREE IN ADVANCE TO USE, COPY, MODIFY,
|
||||
// MERGE, PUBLISH, DISTRIBUTE, SUBLICENSE, AND/OR SELL COPIES OF THIS
|
||||
// SOFTWARE, THAT ANY JURIDICAL DISPUTES WHICH ARE CONCERNED TO THIS
|
||||
// SOFTWARE OR ITS CONTENTS, AGAINST US (SOFTETHER PROJECT, SOFTETHER
|
||||
// CORPORATION, DAIYUU NOBORI OR OTHER SUPPLIERS), OR ANY JURIDICAL
|
||||
// DISPUTES AGAINST US WHICH ARE CAUSED BY ANY KIND OF USING, COPYING,
|
||||
// MODIFYING, MERGING, PUBLISHING, DISTRIBUTING, SUBLICENSING, AND/OR
|
||||
// SELLING COPIES OF THIS SOFTWARE SHALL BE REGARDED AS BE CONSTRUED AND
|
||||
// CONTROLLED BY JAPANESE LAWS, AND YOU MUST FURTHER CONSENT TO
|
||||
// EXCLUSIVE JURISDICTION AND VENUE IN THE COURTS SITTING IN TOKYO,
|
||||
// JAPAN. YOU MUST WAIVE ALL DEFENSES OF LACK OF PERSONAL JURISDICTION
|
||||
// AND FORUM NON CONVENIENS. PROCESS MAY BE SERVED ON EITHER PARTY IN
|
||||
// THE MANNER AUTHORIZED BY APPLICABLE LAW OR COURT RULE.
|
||||
//
|
||||
// USE ONLY IN JAPAN. DO NOT USE IT IN OTHER COUNTRIES. IMPORTING THIS
|
||||
// SOFTWARE INTO OTHER COUNTRIES IS AT YOUR OWN RISK. SOME COUNTRIES
|
||||
// PROHIBIT ENCRYPTED COMMUNICATIONS. USING THIS SOFTWARE IN OTHER
|
||||
// COUNTRIES MIGHT BE RESTRICTED.
|
||||
//
|
||||
//
|
||||
// DEAR SECURITY EXPERTS
|
||||
// ---------------------
|
||||
//
|
||||
// If you find a bug or a security vulnerability please kindly inform us
|
||||
// about the problem immediately so that we can fix the security problem
|
||||
// to protect a lot of users around the world as soon as possible.
|
||||
//
|
||||
// Our e-mail address for security reports is:
|
||||
// softether-vpn-security [at] softether.org
|
||||
//
|
||||
// Please note that the above e-mail address is not a technical support
|
||||
// inquiry address. If you need technical assistance, please visit
|
||||
// http://www.softether.org/ and ask your question on the users forum.
|
||||
//
|
||||
// Thank you for your cooperation.
|
||||
|
||||
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Data.Sql;
|
||||
using System.Data.SqlClient;
|
||||
using System.Data.SqlTypes;
|
||||
using System.Text;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Cryptography;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
using System.IO;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Web.Mail;
|
||||
using System.Threading;
|
||||
using System.Xml;
|
||||
using System.Xml.Schema;
|
||||
using System.Xml.Serialization;
|
||||
using CoreUtil;
|
||||
|
||||
public static class AspUtil
|
||||
{
|
||||
public static void Redirect(Page page, string url)
|
||||
{
|
||||
Redirect(page, url, true);
|
||||
}
|
||||
public static void Redirect(Page page, string url, bool endSession)
|
||||
{
|
||||
MultiLang ml = new MultiLang(page, true);
|
||||
|
||||
ml.Redirect(url, true);
|
||||
}
|
||||
|
||||
public static string GetCurrentRequestUrl(Page page)
|
||||
{
|
||||
string s = (string)page.Request.Headers["SEISAPI_PHYSICAL_URL"];
|
||||
if (Str.IsEmptyStr(s) == false)
|
||||
{
|
||||
string[] tokens = s.Split('?');
|
||||
return tokens[0];
|
||||
}
|
||||
return page.Request.Path;
|
||||
}
|
||||
|
||||
public static string GetCurrentPhysicalFilePathForUser(Page page)
|
||||
{
|
||||
string s = (string)page.Request.Headers["SEISAPI_ORIGINAL_FILEPATH"];
|
||||
if (Str.IsEmptyStr(s) == false)
|
||||
{
|
||||
return s;
|
||||
}
|
||||
return page.Request.PhysicalPath;
|
||||
}
|
||||
|
||||
public static string RemoveDefaultHtml(string url)
|
||||
{
|
||||
string tmp = url.ToLower();
|
||||
if (tmp.EndsWith("/default.asp") || tmp.EndsWith("/default.aspx") || tmp.EndsWith("/default.htm") || tmp.EndsWith("/default.html"))
|
||||
{
|
||||
return GetUrlDirNameFromPath(url);
|
||||
}
|
||||
else
|
||||
{
|
||||
return url;
|
||||
}
|
||||
}
|
||||
|
||||
public static string GetUrlDirNameFromPath(string url)
|
||||
{
|
||||
string ret = "";
|
||||
string[] strs = url.Split('/');
|
||||
int i;
|
||||
if (strs.Length >= 1)
|
||||
{
|
||||
for (i = 0; i < strs.Length - 1; i++)
|
||||
{
|
||||
ret += strs[i] + "/";
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static string WebPathToFilePath(System.Web.UI.Page page, string path)
|
||||
{
|
||||
string appRootFilePath = page.Request.PhysicalApplicationPath;
|
||||
string appRootVirtualPath = page.Request.ApplicationPath;
|
||||
string ret;
|
||||
|
||||
path = RemoveDefaultHtml(path);
|
||||
if (path.ToUpper().StartsWith(appRootVirtualPath.ToUpper()) == false)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
path = path.Substring(appRootVirtualPath.Length).Replace("/", "\\");
|
||||
|
||||
if (path.StartsWith("\\"))
|
||||
{
|
||||
path = path.Substring(1);
|
||||
}
|
||||
|
||||
ret = appRootFilePath + path;
|
||||
|
||||
if (ret.IndexOf("..") != -1)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if (ret.EndsWith("\\"))
|
||||
{
|
||||
ret = GetDefaultDocumentIfExists(ret);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static string GetDefaultDocumentIfExists(string dir)
|
||||
{
|
||||
string[] targets =
|
||||
{
|
||||
"default.aspx",
|
||||
"default.asp",
|
||||
"default.html",
|
||||
"default.htm",
|
||||
"index.html",
|
||||
"index.htm",
|
||||
};
|
||||
|
||||
foreach (string s in targets)
|
||||
{
|
||||
string name = dir + s;
|
||||
|
||||
if (IsFileExists(name))
|
||||
{
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static bool IsFileExists(string name)
|
||||
{
|
||||
return File.Exists(name);
|
||||
}
|
||||
}
|
||||
|
||||
public class MultiLang
|
||||
{
|
||||
public readonly Page Page;
|
||||
public readonly HttpRequest Request;
|
||||
public readonly HttpResponse Response;
|
||||
public readonly bool IsUrlModefied;
|
||||
public readonly string OriginalUrl;
|
||||
public readonly string PhysicalUrl;
|
||||
public readonly bool IsFilenameModified;
|
||||
public readonly string OriginalFileName;
|
||||
public readonly string OriginalFilePath;
|
||||
public readonly string Args;
|
||||
public readonly CoreLanguageClass CurrentLanguage;
|
||||
public readonly CoreLanguageClass ContentsPrintLanguage;
|
||||
public readonly string CurrentLanguageCode;
|
||||
public readonly bool IsCurrentLanguageSupported;
|
||||
public readonly string GoogleTranslateUrl;
|
||||
public readonly string OriginalFullUrl;
|
||||
public readonly bool IsSSL;
|
||||
public readonly string Host;
|
||||
public readonly string BasicHostName;
|
||||
MultiLanguageFilterStream mfs;
|
||||
public readonly List<KeyValuePair<string, string>> ReplaceList;
|
||||
|
||||
public bool DisableFilter
|
||||
{
|
||||
get
|
||||
{
|
||||
return mfs.DisableFilter;
|
||||
}
|
||||
set
|
||||
{
|
||||
mfs.DisableFilter = value;
|
||||
}
|
||||
}
|
||||
|
||||
public readonly string HtmlBody = "";
|
||||
public readonly string HtmlFileName = "";
|
||||
|
||||
static MultiLang()
|
||||
{
|
||||
CoreLanguageList.RegardsJapanAsJP = true;
|
||||
}
|
||||
|
||||
public bool IsJapanese
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.CurrentLanguage == CoreLanguageList.Japanese)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsJapanesePrinting
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.ContentsPrintLanguage == CoreLanguageList.Japanese)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void Redirect(string url, bool endSession)
|
||||
{
|
||||
url = ConvertPath(url);
|
||||
if (url.StartsWith("http://") || url.StartsWith("https://") || url.StartsWith("ftp://") ||
|
||||
url.StartsWith("/"))
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
string originalUrl = OriginalUrl;
|
||||
if (originalUrl.EndsWith("/"))
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
int i;
|
||||
for (i = originalUrl.Length - 1; i >= 0; i--)
|
||||
{
|
||||
if (originalUrl[i] == '/' || originalUrl[i] == '\\')
|
||||
{
|
||||
originalUrl = originalUrl.Substring(0, i + 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
url = originalUrl + url;
|
||||
}
|
||||
Response.Redirect(url, endSession);
|
||||
}
|
||||
|
||||
public MultiLang(Page currentPage)
|
||||
: this(currentPage, false)
|
||||
{
|
||||
}
|
||||
public MultiLang(Page currentPage, bool fast) : this(currentPage, fast, null)
|
||||
{
|
||||
}
|
||||
public MultiLang(Page currentPage, bool fast, string basicHostName)
|
||||
: this(currentPage, fast, basicHostName, new List<KeyValuePair<string, string>>())
|
||||
{
|
||||
}
|
||||
public MultiLang(Page currentPage, bool fast, string basicHostName, List<KeyValuePair<string, string>> replaceList)
|
||||
{
|
||||
this.Page = currentPage;
|
||||
|
||||
this.Request = Page.Request;
|
||||
this.Response = Page.Response;
|
||||
this.BasicHostName = basicHostName;
|
||||
string tmp = Page.Request.ServerVariables["HTTPS"];
|
||||
string hostRaw = Page.Request.Headers["Host"];
|
||||
this.ReplaceList = replaceList;
|
||||
bool isSsl = false;
|
||||
string[] tokens;
|
||||
string host = "";
|
||||
|
||||
tokens = hostRaw.Split(':');
|
||||
if (tokens.Length >= 1)
|
||||
{
|
||||
host = tokens[0];
|
||||
}
|
||||
|
||||
host = host.ToLower();
|
||||
|
||||
if (tmp != null)
|
||||
{
|
||||
if (tmp.Equals("on", StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
isSsl = true;
|
||||
}
|
||||
}
|
||||
|
||||
this.IsSSL = isSsl;
|
||||
this.Host = host;
|
||||
|
||||
this.IsUrlModefied = Str.StrToBool((string)Request.Headers["SEISAPI_MODIFIED_URL"]);
|
||||
this.OriginalUrl = (string)Request.Headers["SEISAPI_ORIGINAL_URL"];
|
||||
|
||||
int i;
|
||||
i = this.OriginalUrl.IndexOf("?");
|
||||
if (i != -1)
|
||||
{
|
||||
this.OriginalUrl = this.OriginalUrl.Substring(0, i);
|
||||
}
|
||||
|
||||
if (Str.IsEmptyStr(this.OriginalUrl) || this.IsUrlModefied == false)
|
||||
{
|
||||
this.OriginalUrl = AspUtil.RemoveDefaultHtml(AspUtil.GetCurrentRequestUrl(Page));
|
||||
}
|
||||
|
||||
string s = (string)Request.Headers["SEISAPI_ORIGINAL_FILENAME"];
|
||||
if (Str.IsEmptyStr(s) == false)
|
||||
{
|
||||
this.IsFilenameModified = true;
|
||||
this.OriginalFileName = s;
|
||||
this.OriginalFilePath = (string)Request.Headers["SEISAPI_ORIGINAL_FILEPATH"];
|
||||
}
|
||||
|
||||
string langCode = GetCurrentLangCodeFromPath(this.OriginalUrl);
|
||||
|
||||
this.CurrentLanguage = CoreLanguageList.GetLanguageClassByName(langCode);
|
||||
this.CurrentLanguageCode = CurrentLanguage.Name;
|
||||
|
||||
try
|
||||
{
|
||||
HtmlFileName = AspUtil.WebPathToFilePath(currentPage, AspUtil.GetCurrentRequestUrl(currentPage));
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
|
||||
if (this.IsFilenameModified)
|
||||
{
|
||||
HtmlFileName = Path.Combine(Path.GetDirectoryName(HtmlFileName), Path.GetFileName(OriginalFilePath));
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if (fast == false)
|
||||
{
|
||||
HtmlBody = File.ReadAllText(HtmlFileName, Str.Utf8Encoding);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
|
||||
PhysicalUrl = AspUtil.RemoveDefaultHtml(AspUtil.GetCurrentRequestUrl((currentPage)));
|
||||
|
||||
Args = currentPage.Request.ServerVariables["QUERY_STRING"];
|
||||
|
||||
if (CurrentLanguage == CoreLanguageList.Japanese)
|
||||
{
|
||||
IsCurrentLanguageSupported = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
IsCurrentLanguageSupported = Str.SearchStr(HtmlBody, string.Format("<!-- ml:{0} -->", CurrentLanguage.Name), 0, false) != -1;
|
||||
}
|
||||
|
||||
GoogleTranslateUrl = string.Format("http://translate.google.com/translate?js=n&prev=_t&hl=en&ie=UTF-8&layout=2&eotf=1&sl=ja&tl={1}&u={0}",
|
||||
HttpUtility.UrlEncode((isSsl ? "https://" : "http://") + host + this.OriginalUrl, Str.Utf8Encoding),
|
||||
this.CurrentLanguageCode);
|
||||
|
||||
OriginalFullUrl = (isSsl ? "https://" : "http://") + host + this.OriginalUrl;
|
||||
|
||||
ContentsPrintLanguage = this.CurrentLanguage;
|
||||
if (IsCurrentLanguageSupported == false)
|
||||
{
|
||||
ContentsPrintLanguage = CoreLanguageList.Japanese;
|
||||
}
|
||||
|
||||
if (fast == false)
|
||||
{
|
||||
mfs = new MultiLanguageFilterStream(Response.Filter, ContentsPrintLanguage, this.CurrentLanguage, this.BasicHostName, this.ReplaceList);
|
||||
mfs.Page = Page;
|
||||
Response.Filter = mfs;
|
||||
}
|
||||
}
|
||||
|
||||
public string ConvertPath(string url)
|
||||
{
|
||||
return ConvertPath(url, this.CurrentLanguage);
|
||||
}
|
||||
public string ConvertPath(string url, CoreLanguageClass lang)
|
||||
{
|
||||
string ja = CoreLanguageList.Japanese.Name;
|
||||
|
||||
if (url.StartsWith("/" + ja, StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
url = "/" + lang.Name + url.Substring(ja.Length + 1);
|
||||
}
|
||||
|
||||
return url;
|
||||
}
|
||||
|
||||
public string GetPathForLanguage(CoreLanguageClass lang)
|
||||
{
|
||||
string url = PhysicalUrl;
|
||||
|
||||
return ConvertPath(url, lang);
|
||||
}
|
||||
|
||||
public string GetFullUrlForLanguage(CoreLanguageClass lang)
|
||||
{
|
||||
string url = (IsSSL ? "https://" : "http://") + Host + GetPathForLanguage(lang);
|
||||
|
||||
if (Str.IsEmptyStr(Args) == false)
|
||||
{
|
||||
url += "?" + Args;
|
||||
}
|
||||
|
||||
return url;
|
||||
}
|
||||
|
||||
public string ProcStr(string str)
|
||||
{
|
||||
return ProcStr(str, ContentsPrintLanguage);
|
||||
}
|
||||
|
||||
public static string ProcStrDefault(string str)
|
||||
{
|
||||
return ProcStr(str, CoreLanguageClass.CurrentThreadLanguageClass);
|
||||
}
|
||||
|
||||
public static string ProcStr(string str, CoreLanguageClass lang)
|
||||
{
|
||||
return ProcStr(str, lang, lang);
|
||||
}
|
||||
|
||||
public static string ProcStr(string str, CoreLanguageClass lang, CoreLanguageClass langPure)
|
||||
{
|
||||
MultiLanguageFilterStream st = new MultiLanguageFilterStream(null, lang, langPure, null, null);
|
||||
|
||||
return st.FilterString(str);
|
||||
}
|
||||
|
||||
public static string GetCurrentLangCodeFromPath(string str)
|
||||
{
|
||||
char[] sps =
|
||||
{
|
||||
'/', '?',
|
||||
};
|
||||
string[] tokens = str.Split(sps, StringSplitOptions.RemoveEmptyEntries);
|
||||
|
||||
if (tokens.Length >= 1)
|
||||
{
|
||||
return tokens[0].ToLower();
|
||||
}
|
||||
|
||||
return CoreLanguageList.Japanese.Name;
|
||||
}
|
||||
}
|
||||
|
||||
public static class MultiString
|
||||
{
|
||||
public const string ChangeLanguage = "[j]Select Language[e]Select Language[/]";
|
||||
public const string LanguageNotSupported = "[j]申し訳ございませんが、以下のコンテンツは現在日本語で公開されていません。[e]Unfortunately, following contents are not published in English yet. [/]";
|
||||
public const string ThisIsTranslatedByMachine = "Following contents are translated automatically by Google Translate.";
|
||||
public const string GoogleTranslate = "[j]Google で翻訳[e]Click here to translate the contents into English by Google Now[/]";
|
||||
public const string ShowSrc = "Show the original page";
|
||||
|
||||
public static string GetStr(string srcStr, CoreLanguageClass lang)
|
||||
{
|
||||
return MultiLang.ProcStr(srcStr, lang);
|
||||
}
|
||||
}
|
||||
|
||||
public class MultiLanguageFilterStream : Stream
|
||||
{
|
||||
public static readonly List<KeyValuePair<string, CoreLanguageClass>> langKeys = new List<KeyValuePair<string, CoreLanguageClass>>();
|
||||
public readonly List<KeyValuePair<string, string>> ReplaceList = null;
|
||||
public const string TagPure = "<!-- ml:pure -->";
|
||||
public const string TagEndPure = "<!-- ml:endpure -->";
|
||||
public bool DisableFilter = false;
|
||||
public Page Page;
|
||||
|
||||
static MultiLanguageFilterStream()
|
||||
{
|
||||
langKeys.Add(new KeyValuePair<string, CoreLanguageClass>("[j]", CoreLanguageList.Japanese));
|
||||
langKeys.Add(new KeyValuePair<string, CoreLanguageClass>("[e]", CoreLanguageList.English));
|
||||
langKeys.Add(new KeyValuePair<string, CoreLanguageClass>("[/]", null));
|
||||
}
|
||||
|
||||
Stack<CoreLanguageClass> stack = new Stack<CoreLanguageClass>();
|
||||
CoreLanguageClass currentBodyLanguage
|
||||
{
|
||||
get
|
||||
{
|
||||
if (stack.Count == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
return stack.ToArray()[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
bool isLang(CoreLanguageClass lang)
|
||||
{
|
||||
CoreLanguageClass[] langList = stack.ToArray();
|
||||
|
||||
foreach (CoreLanguageClass c in langList)
|
||||
{
|
||||
if (c != lang)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
CoreLanguageClass lastBodyLanguage
|
||||
{
|
||||
get
|
||||
{
|
||||
if (stack.Count == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
return stack.Peek();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public string FilterString(string src)
|
||||
{
|
||||
string[] strList = Str.DivideStringMulti(src, true,
|
||||
TagPure, TagEndPure);
|
||||
|
||||
bool b = false;
|
||||
|
||||
StringBuilder ret = new StringBuilder();
|
||||
|
||||
foreach (string str in strList)
|
||||
{
|
||||
if (str == TagPure)
|
||||
{
|
||||
b = true;
|
||||
}
|
||||
else if (str == TagEndPure)
|
||||
{
|
||||
b = false;
|
||||
}
|
||||
|
||||
ret.Append(filterStringInner(str, b ? this.currentLanguagePure : this.currentLanguage, this.currentLanguagePure));
|
||||
}
|
||||
|
||||
return ret.ToString();
|
||||
}
|
||||
|
||||
string filterStringInner(string src, CoreLanguageClass useLang, CoreLanguageClass useLangPure)
|
||||
{
|
||||
int i;
|
||||
string ret = src;
|
||||
|
||||
if (Str.IsEmptyStr(basicHostName) == false)
|
||||
{
|
||||
ret = Str.ReplaceStr(ret, "=\"/\"", "=\"http://" + basicHostName + "/\"", false);
|
||||
ret = Str.ReplaceStr(ret, "=\'/\'", "=\'http://" + basicHostName + "/\'", false);
|
||||
|
||||
ret = Str.ReplaceStr(ret, "=\"/" + CoreLanguageList.Japanese.Name + "/\"", "=\"http://" + basicHostName + "/" + useLangPure.Name + "/\"", false);
|
||||
ret = Str.ReplaceStr(ret, "=\'/" + CoreLanguageList.Japanese.Name + "/\'", "=\'http://" + basicHostName + "/" + useLangPure.Name + "/\'", false);
|
||||
}
|
||||
|
||||
ret = Str.ReplaceStr(ret, "=\"/" + CoreLanguageList.Japanese.Name + "/", "=\"/" + useLangPure.Name + "/", false);
|
||||
ret = Str.ReplaceStr(ret, "=\'/" + CoreLanguageList.Japanese.Name + "/", "=\'/" + useLangPure.Name + "/", false);
|
||||
|
||||
ret = Str.ReplaceStr(ret, "_lm_" + CoreLanguageList.Japanese.Name, "_lm_" + useLang.Name, false);
|
||||
|
||||
if (this.ReplaceList != null)
|
||||
{
|
||||
foreach (KeyValuePair<string, string> p in this.ReplaceList)
|
||||
{
|
||||
ret = Str.ReplaceStr(ret, p.Key, p.Value, false);
|
||||
}
|
||||
}
|
||||
|
||||
StringBuilder ret2 = new StringBuilder();
|
||||
|
||||
int next = 0;
|
||||
while (true)
|
||||
{
|
||||
int min = int.MaxValue;
|
||||
int j = -1;
|
||||
for (i = 0; i < langKeys.Count; i++)
|
||||
{
|
||||
int r = Str.SearchStr(ret, langKeys[i].Key, next, false);
|
||||
if (r != -1)
|
||||
{
|
||||
if (r < min)
|
||||
{
|
||||
j = i;
|
||||
min = r;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (j != -1)
|
||||
{
|
||||
KeyValuePair<string, CoreLanguageClass> v = langKeys[j];
|
||||
|
||||
if (currentBodyLanguage == null || isLang(useLang))
|
||||
{
|
||||
ret2.Append(ret.Substring(next, min - next));
|
||||
}
|
||||
|
||||
if (v.Value != null)
|
||||
{
|
||||
if (lastBodyLanguage == null || v.Value.Id <= lastBodyLanguage.Id)
|
||||
{
|
||||
stack.Push(v.Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
stack.Pop();
|
||||
stack.Push(v.Value);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
stack.Pop();
|
||||
}
|
||||
|
||||
next = min + v.Key.Length;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (currentBodyLanguage == null || isLang(useLang))
|
||||
{
|
||||
ret2.Append(ret.Substring(next, ret.Length - next));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ret = ret2.ToString();
|
||||
|
||||
string lang = useLangPure != CoreLanguageList.Japanese ? useLangPure.Name : "ja";
|
||||
|
||||
if (useLangPure != CoreLanguageList.Japanese)
|
||||
{
|
||||
ret = Str.ReplaceStr(ret, "<meta http-equiv=\"Content-Language\" content=\"ja\" />",
|
||||
string.Format("<meta http-equiv=\"Content-Language\" content=\"{0}\" />", lang), false);
|
||||
}
|
||||
|
||||
ret = Str.ReplaceStr(ret, "<html>", string.Format("<html lang=\"{0}\">", lang), false);
|
||||
|
||||
next = 0;
|
||||
while (true)
|
||||
{
|
||||
i = Str.SearchStr(ret, "<link rel=\"stylesheet\" href=\"", next, false);
|
||||
if (i == -1)
|
||||
{
|
||||
break;
|
||||
}
|
||||
next = i + 1;
|
||||
int j = Str.SearchStr(ret, "/>", next, false);
|
||||
if (j == -1)
|
||||
{
|
||||
break;
|
||||
}
|
||||
string linkStr = ret.Substring(i, j - i + 2 - 1);
|
||||
int k = Str.SearchStr(linkStr, "href=\"", 0, false);
|
||||
if (k != -1)
|
||||
{
|
||||
int m = Str.SearchStr(linkStr, "\"", k + 6, false);
|
||||
if (m != -1)
|
||||
{
|
||||
string fileName = linkStr.Substring(k + 6, m - k - 6);
|
||||
fileName = Str.ReplaceStr(fileName, ".css", "_" + lang + ".css", false);
|
||||
string linkStr2 = string.Format("<link rel=\"stylesheet\" href=\"{0}\" type=\"text/css\" />", fileName);
|
||||
|
||||
ret = ret.Substring(0, j + 2) + linkStr2 + ret.Substring(j + 2);
|
||||
next = j + 2 + linkStr2.Length;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
Stream baseStream;
|
||||
long position;
|
||||
CoreLanguageClass currentLanguage;
|
||||
CoreLanguageClass currentLanguagePure;
|
||||
string basicHostName;
|
||||
|
||||
public override bool CanRead
|
||||
{
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
public override bool CanSeek
|
||||
{
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
public override bool CanWrite
|
||||
{
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
public override void Flush()
|
||||
{
|
||||
baseStream.Flush();
|
||||
}
|
||||
|
||||
public override long Length
|
||||
{
|
||||
get { return 0; }
|
||||
}
|
||||
|
||||
public override long Position
|
||||
{
|
||||
get
|
||||
{
|
||||
return position;
|
||||
}
|
||||
set
|
||||
{
|
||||
position = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override long Seek(long offset, SeekOrigin origin)
|
||||
{
|
||||
return baseStream.Seek(offset, origin);
|
||||
}
|
||||
|
||||
public override void SetLength(long value)
|
||||
{
|
||||
baseStream.SetLength(value);
|
||||
}
|
||||
|
||||
public MultiLanguageFilterStream(Stream baseStream, CoreLanguageClass currentLanguage, CoreLanguageClass currentLanguagePure, string basicHostName, List<KeyValuePair<string, string>> replaceList)
|
||||
{
|
||||
this.baseStream = baseStream;
|
||||
this.currentLanguage = currentLanguage;
|
||||
this.currentLanguagePure = currentLanguagePure;
|
||||
this.basicHostName = basicHostName;
|
||||
this.ReplaceList = replaceList;
|
||||
}
|
||||
|
||||
public override int Read(byte[] buffer, int offset, int count)
|
||||
{
|
||||
return baseStream.Read(buffer, offset, count);
|
||||
}
|
||||
|
||||
string savedString = "";
|
||||
|
||||
public override void Write(byte[] buffer, int offset, int count)
|
||||
{
|
||||
if (DisableFilter)
|
||||
{
|
||||
baseStream.Write(buffer, offset, count);
|
||||
return;
|
||||
}
|
||||
byte[] data = new byte[count];
|
||||
Buffer.BlockCopy(buffer, offset, data, 0, count);
|
||||
|
||||
string inSrc = savedString + ByteDataToString(data);// Str.Utf8Encoding.GetString(data);
|
||||
|
||||
savedString = "";
|
||||
|
||||
if (inSrc.Length >= 2)
|
||||
{
|
||||
int len = inSrc.Length;
|
||||
string last2 = inSrc.Substring(len - 2, 2);
|
||||
string last1 = inSrc.Substring(len - 1, 1);
|
||||
|
||||
if (last1 == "[")
|
||||
{
|
||||
inSrc = inSrc.Substring(0, len - 1);
|
||||
|
||||
savedString = last1;
|
||||
}
|
||||
else if (Str.InStr(last2, "["))
|
||||
{
|
||||
inSrc = inSrc.Substring(0, len - 2);
|
||||
|
||||
savedString = last2;
|
||||
}
|
||||
}
|
||||
|
||||
string inStr = FilterString(inSrc);
|
||||
|
||||
data = StringToByteData(inStr);// Str.Utf8Encoding.GetBytes(inStr);
|
||||
|
||||
if (data.Length >= 1)
|
||||
{
|
||||
baseStream.Write(data, 0, data.Length);
|
||||
//byte[] t = Str.Utf8Encoding.GetBytes("" + count.ToString() + "");
|
||||
//baseStream.Write(t, 0, t.Length);
|
||||
}
|
||||
}
|
||||
|
||||
public static string ByteDataToString(byte[] data)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
foreach (byte b in data)
|
||||
{
|
||||
if (b <= 0x7f && b != (byte)('\\'))
|
||||
{
|
||||
sb.Append((char)b);
|
||||
}
|
||||
else
|
||||
{
|
||||
sb.Append("\\" + ((uint)b).ToString("X2"));
|
||||
}
|
||||
}
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
public byte[] StringToByteData(string str)
|
||||
{
|
||||
int i, len;
|
||||
|
||||
len = str.Length;
|
||||
Buf b = new Buf();
|
||||
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
char c = str[i];
|
||||
if (c == '\\')
|
||||
{
|
||||
string tmp = "";
|
||||
|
||||
//try
|
||||
{
|
||||
tmp = "" + str[i + 1] + str[i + 2];
|
||||
}
|
||||
/*catch (Exception ex)
|
||||
{
|
||||
tmp += "|err=" + ex.Message + ",len=" + len + ",i=" + i + "|src=" + str + "|";
|
||||
byte[] aa = Str.Utf8Encoding.GetBytes(tmp);
|
||||
b.Write(aa);
|
||||
}*/
|
||||
|
||||
i += 2;
|
||||
|
||||
//try
|
||||
{
|
||||
b.WriteByte(byte.Parse(tmp, System.Globalization.NumberStyles.HexNumber));
|
||||
}
|
||||
//catch
|
||||
{
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
b.WriteByte((byte)c);
|
||||
}
|
||||
}
|
||||
|
||||
return b.ByteData;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
202
src/BuildUtil/CoreUtil/Packer.cs
Normal file
202
src/BuildUtil/CoreUtil/Packer.cs
Normal file
@ -0,0 +1,202 @@
|
||||
// CoreUtil
|
||||
//
|
||||
// Copyright (C) 2012-2014 Daiyuu Nobori. All Rights Reserved.
|
||||
// Copyright (C) 2012-2014 SoftEther VPN Project at University of Tsukuba. All Rights Reserved.
|
||||
// Comments: Tetsuo Sugiyama, Ph.D.
|
||||
//
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// version 2 as published by the Free Software Foundation.
|
||||
//
|
||||
// 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 version 2
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// THE LICENSE AGREEMENT IS ATTACHED ON THE SOURCE-CODE PACKAGE
|
||||
// AS "LICENSE.TXT" FILE. READ THE TEXT FILE IN ADVANCE TO USE THE SOFTWARE.
|
||||
//
|
||||
//
|
||||
// THIS SOFTWARE IS DEVELOPED IN JAPAN, AND DISTRIBUTED FROM JAPAN,
|
||||
// UNDER JAPANESE LAWS. YOU MUST AGREE IN ADVANCE TO USE, COPY, MODIFY,
|
||||
// MERGE, PUBLISH, DISTRIBUTE, SUBLICENSE, AND/OR SELL COPIES OF THIS
|
||||
// SOFTWARE, THAT ANY JURIDICAL DISPUTES WHICH ARE CONCERNED TO THIS
|
||||
// SOFTWARE OR ITS CONTENTS, AGAINST US (SOFTETHER PROJECT, SOFTETHER
|
||||
// CORPORATION, DAIYUU NOBORI OR OTHER SUPPLIERS), OR ANY JURIDICAL
|
||||
// DISPUTES AGAINST US WHICH ARE CAUSED BY ANY KIND OF USING, COPYING,
|
||||
// MODIFYING, MERGING, PUBLISHING, DISTRIBUTING, SUBLICENSING, AND/OR
|
||||
// SELLING COPIES OF THIS SOFTWARE SHALL BE REGARDED AS BE CONSTRUED AND
|
||||
// CONTROLLED BY JAPANESE LAWS, AND YOU MUST FURTHER CONSENT TO
|
||||
// EXCLUSIVE JURISDICTION AND VENUE IN THE COURTS SITTING IN TOKYO,
|
||||
// JAPAN. YOU MUST WAIVE ALL DEFENSES OF LACK OF PERSONAL JURISDICTION
|
||||
// AND FORUM NON CONVENIENS. PROCESS MAY BE SERVED ON EITHER PARTY IN
|
||||
// THE MANNER AUTHORIZED BY APPLICABLE LAW OR COURT RULE.
|
||||
//
|
||||
// USE ONLY IN JAPAN. DO NOT USE IT IN OTHER COUNTRIES. IMPORTING THIS
|
||||
// SOFTWARE INTO OTHER COUNTRIES IS AT YOUR OWN RISK. SOME COUNTRIES
|
||||
// PROHIBIT ENCRYPTED COMMUNICATIONS. USING THIS SOFTWARE IN OTHER
|
||||
// COUNTRIES MIGHT BE RESTRICTED.
|
||||
//
|
||||
//
|
||||
// DEAR SECURITY EXPERTS
|
||||
// ---------------------
|
||||
//
|
||||
// If you find a bug or a security vulnerability please kindly inform us
|
||||
// about the problem immediately so that we can fix the security problem
|
||||
// to protect a lot of users around the world as soon as possible.
|
||||
//
|
||||
// Our e-mail address for security reports is:
|
||||
// softether-vpn-security [at] softether.org
|
||||
//
|
||||
// Please note that the above e-mail address is not a technical support
|
||||
// inquiry address. If you need technical assistance, please visit
|
||||
// http://www.softether.org/ and ask your question on the users forum.
|
||||
//
|
||||
// Thank you for your cooperation.
|
||||
|
||||
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Data;
|
||||
using System.Data.Sql;
|
||||
using System.Data.SqlClient;
|
||||
using System.Data.SqlTypes;
|
||||
using System.Text;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Cryptography;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
using System.IO;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace CoreUtil
|
||||
{
|
||||
public enum PackerFileFormat
|
||||
{
|
||||
ZipRaw,
|
||||
ZipCompressed,
|
||||
Tar,
|
||||
TarGZip,
|
||||
}
|
||||
|
||||
public delegate bool ProgressDelegate(string fileNameFullPath, string fileNameRelative, int currentFileNum, int totalFileNum);
|
||||
|
||||
public static class Packer
|
||||
{
|
||||
public static byte[] PackDir(PackerFileFormat format, string rootDirPath, string appendPrefixDirName)
|
||||
{
|
||||
return PackDir(format, rootDirPath, appendPrefixDirName, null);
|
||||
}
|
||||
public static byte[] PackDir(PackerFileFormat format, string topDirPath, string appendPrefixDirName, ProgressDelegate proc)
|
||||
{
|
||||
string[] fileList = Directory.GetFiles(topDirPath, "*", SearchOption.AllDirectories);
|
||||
List<string> relativeFileList = new List<string>();
|
||||
|
||||
foreach (string fileName in fileList)
|
||||
{
|
||||
string relativePath = IO.GetRelativeFileName(fileName, topDirPath);
|
||||
|
||||
if (Str.IsEmptyStr(appendPrefixDirName) == false)
|
||||
{
|
||||
relativePath = IO.RemoteLastEnMark(appendPrefixDirName) + "\\" + relativePath;
|
||||
}
|
||||
|
||||
relativeFileList.Add(relativePath);
|
||||
}
|
||||
|
||||
return PackFiles(format, fileList, relativeFileList.ToArray(), proc);
|
||||
}
|
||||
|
||||
public static byte[] PackFiles(PackerFileFormat format, string[] srcFileNameList, string[] relativeNameList)
|
||||
{
|
||||
return PackFiles(format, srcFileNameList, relativeNameList, null);
|
||||
}
|
||||
public static byte[] PackFiles(PackerFileFormat format, string[] srcFileNameList, string[] relativeNameList, ProgressDelegate proc)
|
||||
{
|
||||
if (srcFileNameList.Length != relativeNameList.Length)
|
||||
{
|
||||
throw new ApplicationException("srcFileNameList.Length != relativeNameList.Length");
|
||||
}
|
||||
|
||||
int num = srcFileNameList.Length;
|
||||
int i;
|
||||
|
||||
ZipPacker zip = new ZipPacker();
|
||||
TarPacker tar = new TarPacker();
|
||||
|
||||
for (i = 0; i < num; i++)
|
||||
{
|
||||
if (proc != null)
|
||||
{
|
||||
bool ret = proc(srcFileNameList[i], relativeNameList[i], i, num);
|
||||
|
||||
if (ret == false)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
byte[] srcData = File.ReadAllBytes(srcFileNameList[i]);
|
||||
DateTime date = File.GetLastWriteTime(srcFileNameList[i]);
|
||||
|
||||
switch (format)
|
||||
{
|
||||
case PackerFileFormat.Tar:
|
||||
case PackerFileFormat.TarGZip:
|
||||
tar.AddFileSimple(relativeNameList[i], srcData, 0, srcData.Length, date);
|
||||
break;
|
||||
|
||||
case PackerFileFormat.ZipRaw:
|
||||
case PackerFileFormat.ZipCompressed:
|
||||
zip.AddFileSimple(relativeNameList[i], date, FileAttributes.Normal, srcData, (format == PackerFileFormat.ZipCompressed));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
switch (format)
|
||||
{
|
||||
case PackerFileFormat.Tar:
|
||||
tar.Finish();
|
||||
return tar.GeneratedData.Read();
|
||||
|
||||
case PackerFileFormat.TarGZip:
|
||||
tar.Finish();
|
||||
return tar.CompressToGZip();
|
||||
|
||||
case PackerFileFormat.ZipCompressed:
|
||||
case PackerFileFormat.ZipRaw:
|
||||
zip.Finish();
|
||||
return zip.GeneratedData.Read();
|
||||
|
||||
default:
|
||||
throw new ApplicationException("format");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
225
src/BuildUtil/CoreUtil/RC4.cs
Normal file
225
src/BuildUtil/CoreUtil/RC4.cs
Normal file
@ -0,0 +1,225 @@
|
||||
// CoreUtil
|
||||
//
|
||||
// Copyright (C) 2012-2014 Daiyuu Nobori. All Rights Reserved.
|
||||
// Copyright (C) 2012-2014 SoftEther VPN Project at University of Tsukuba. All Rights Reserved.
|
||||
// Comments: Tetsuo Sugiyama, Ph.D.
|
||||
//
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// version 2 as published by the Free Software Foundation.
|
||||
//
|
||||
// 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 version 2
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// THE LICENSE AGREEMENT IS ATTACHED ON THE SOURCE-CODE PACKAGE
|
||||
// AS "LICENSE.TXT" FILE. READ THE TEXT FILE IN ADVANCE TO USE THE SOFTWARE.
|
||||
//
|
||||
//
|
||||
// THIS SOFTWARE IS DEVELOPED IN JAPAN, AND DISTRIBUTED FROM JAPAN,
|
||||
// UNDER JAPANESE LAWS. YOU MUST AGREE IN ADVANCE TO USE, COPY, MODIFY,
|
||||
// MERGE, PUBLISH, DISTRIBUTE, SUBLICENSE, AND/OR SELL COPIES OF THIS
|
||||
// SOFTWARE, THAT ANY JURIDICAL DISPUTES WHICH ARE CONCERNED TO THIS
|
||||
// SOFTWARE OR ITS CONTENTS, AGAINST US (SOFTETHER PROJECT, SOFTETHER
|
||||
// CORPORATION, DAIYUU NOBORI OR OTHER SUPPLIERS), OR ANY JURIDICAL
|
||||
// DISPUTES AGAINST US WHICH ARE CAUSED BY ANY KIND OF USING, COPYING,
|
||||
// MODIFYING, MERGING, PUBLISHING, DISTRIBUTING, SUBLICENSING, AND/OR
|
||||
// SELLING COPIES OF THIS SOFTWARE SHALL BE REGARDED AS BE CONSTRUED AND
|
||||
// CONTROLLED BY JAPANESE LAWS, AND YOU MUST FURTHER CONSENT TO
|
||||
// EXCLUSIVE JURISDICTION AND VENUE IN THE COURTS SITTING IN TOKYO,
|
||||
// JAPAN. YOU MUST WAIVE ALL DEFENSES OF LACK OF PERSONAL JURISDICTION
|
||||
// AND FORUM NON CONVENIENS. PROCESS MAY BE SERVED ON EITHER PARTY IN
|
||||
// THE MANNER AUTHORIZED BY APPLICABLE LAW OR COURT RULE.
|
||||
//
|
||||
// USE ONLY IN JAPAN. DO NOT USE IT IN OTHER COUNTRIES. IMPORTING THIS
|
||||
// SOFTWARE INTO OTHER COUNTRIES IS AT YOUR OWN RISK. SOME COUNTRIES
|
||||
// PROHIBIT ENCRYPTED COMMUNICATIONS. USING THIS SOFTWARE IN OTHER
|
||||
// COUNTRIES MIGHT BE RESTRICTED.
|
||||
//
|
||||
//
|
||||
// DEAR SECURITY EXPERTS
|
||||
// ---------------------
|
||||
//
|
||||
// If you find a bug or a security vulnerability please kindly inform us
|
||||
// about the problem immediately so that we can fix the security problem
|
||||
// to protect a lot of users around the world as soon as possible.
|
||||
//
|
||||
// Our e-mail address for security reports is:
|
||||
// softether-vpn-security [at] softether.org
|
||||
//
|
||||
// Please note that the above e-mail address is not a technical support
|
||||
// inquiry address. If you need technical assistance, please visit
|
||||
// http://www.softether.org/ and ask your question on the users forum.
|
||||
//
|
||||
// Thank you for your cooperation.
|
||||
|
||||
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Data;
|
||||
using System.Data.Sql;
|
||||
using System.Data.SqlClient;
|
||||
using System.Data.SqlTypes;
|
||||
using System.Text;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Cryptography;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
using System.IO;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Diagnostics;
|
||||
using System.Web.Mail;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Net.NetworkInformation;
|
||||
|
||||
namespace CoreUtil
|
||||
{
|
||||
public class RC4 : ICloneable
|
||||
{
|
||||
uint x, y;
|
||||
uint[] state;
|
||||
|
||||
public RC4(byte[] key)
|
||||
{
|
||||
state = new uint[256];
|
||||
|
||||
uint i, t, u, ki, si;
|
||||
|
||||
x = 0;
|
||||
y = 0;
|
||||
|
||||
for (i = 0; i < 256; i++)
|
||||
{
|
||||
state[i] = i;
|
||||
}
|
||||
|
||||
ki = si = 0;
|
||||
for (i = 0; i < 256; i++)
|
||||
{
|
||||
t = state[i];
|
||||
|
||||
si = (si + key[ki] + t) & 0xff;
|
||||
u = state[si];
|
||||
state[si] = t;
|
||||
state[i] = u;
|
||||
if (++ki >= key.Length)
|
||||
{
|
||||
ki = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private RC4()
|
||||
{
|
||||
}
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
RC4 rc4 = new RC4();
|
||||
|
||||
rc4.x = this.x;
|
||||
rc4.y = this.y;
|
||||
rc4.state = (uint[])this.state.Clone();
|
||||
|
||||
return rc4;
|
||||
}
|
||||
|
||||
public byte[] Encrypt(byte[] src)
|
||||
{
|
||||
return Encrypt(src, src.Length);
|
||||
}
|
||||
public byte[] Encrypt(byte[] src, int len)
|
||||
{
|
||||
return Encrypt(src, 0, len);
|
||||
}
|
||||
public byte[] Encrypt(byte[] src, int offset, int len)
|
||||
{
|
||||
byte[] dst = new byte[len];
|
||||
|
||||
uint x, y, sx, sy;
|
||||
x = this.x;
|
||||
y = this.y;
|
||||
|
||||
int src_i = 0, dst_i = 0, end_src_i;
|
||||
|
||||
for (end_src_i = src_i + len; src_i != end_src_i; src_i++, dst_i++)
|
||||
{
|
||||
x = (x + 1) & 0xff;
|
||||
sx = state[x];
|
||||
y = (sx + y) & 0xff;
|
||||
state[x] = sy = state[y];
|
||||
state[y] = sx;
|
||||
dst[dst_i] = (byte)(src[src_i + offset] ^ state[(sx + sy) & 0xff]);
|
||||
}
|
||||
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
|
||||
return dst;
|
||||
}
|
||||
public void SkipDecrypt(int len)
|
||||
{
|
||||
SkipEncrypt(len);
|
||||
}
|
||||
public void SkipEncrypt(int len)
|
||||
{
|
||||
uint x, y, sx, sy;
|
||||
x = this.x;
|
||||
y = this.y;
|
||||
|
||||
int src_i = 0, dst_i = 0, end_src_i;
|
||||
|
||||
for (end_src_i = src_i + len; src_i != end_src_i; src_i++, dst_i++)
|
||||
{
|
||||
x = (x + 1) & 0xff;
|
||||
sx = state[x];
|
||||
y = (sx + y) & 0xff;
|
||||
state[x] = sy = state[y];
|
||||
state[y] = sx;
|
||||
}
|
||||
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
public byte[] Decrypt(byte[] src)
|
||||
{
|
||||
return Decrypt(src, src.Length);
|
||||
}
|
||||
public byte[] Decrypt(byte[] src, int len)
|
||||
{
|
||||
return Decrypt(src, 0, len);
|
||||
}
|
||||
public byte[] Decrypt(byte[] src, int offset, int len)
|
||||
{
|
||||
return Encrypt(src, offset, len);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
306
src/BuildUtil/CoreUtil/ReadIni.cs
Normal file
306
src/BuildUtil/CoreUtil/ReadIni.cs
Normal file
@ -0,0 +1,306 @@
|
||||
// CoreUtil
|
||||
//
|
||||
// Copyright (C) 2012-2014 Daiyuu Nobori. All Rights Reserved.
|
||||
// Copyright (C) 2012-2014 SoftEther VPN Project at University of Tsukuba. All Rights Reserved.
|
||||
// Comments: Tetsuo Sugiyama, Ph.D.
|
||||
//
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// version 2 as published by the Free Software Foundation.
|
||||
//
|
||||
// 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 version 2
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// THE LICENSE AGREEMENT IS ATTACHED ON THE SOURCE-CODE PACKAGE
|
||||
// AS "LICENSE.TXT" FILE. READ THE TEXT FILE IN ADVANCE TO USE THE SOFTWARE.
|
||||
//
|
||||
//
|
||||
// THIS SOFTWARE IS DEVELOPED IN JAPAN, AND DISTRIBUTED FROM JAPAN,
|
||||
// UNDER JAPANESE LAWS. YOU MUST AGREE IN ADVANCE TO USE, COPY, MODIFY,
|
||||
// MERGE, PUBLISH, DISTRIBUTE, SUBLICENSE, AND/OR SELL COPIES OF THIS
|
||||
// SOFTWARE, THAT ANY JURIDICAL DISPUTES WHICH ARE CONCERNED TO THIS
|
||||
// SOFTWARE OR ITS CONTENTS, AGAINST US (SOFTETHER PROJECT, SOFTETHER
|
||||
// CORPORATION, DAIYUU NOBORI OR OTHER SUPPLIERS), OR ANY JURIDICAL
|
||||
// DISPUTES AGAINST US WHICH ARE CAUSED BY ANY KIND OF USING, COPYING,
|
||||
// MODIFYING, MERGING, PUBLISHING, DISTRIBUTING, SUBLICENSING, AND/OR
|
||||
// SELLING COPIES OF THIS SOFTWARE SHALL BE REGARDED AS BE CONSTRUED AND
|
||||
// CONTROLLED BY JAPANESE LAWS, AND YOU MUST FURTHER CONSENT TO
|
||||
// EXCLUSIVE JURISDICTION AND VENUE IN THE COURTS SITTING IN TOKYO,
|
||||
// JAPAN. YOU MUST WAIVE ALL DEFENSES OF LACK OF PERSONAL JURISDICTION
|
||||
// AND FORUM NON CONVENIENS. PROCESS MAY BE SERVED ON EITHER PARTY IN
|
||||
// THE MANNER AUTHORIZED BY APPLICABLE LAW OR COURT RULE.
|
||||
//
|
||||
// USE ONLY IN JAPAN. DO NOT USE IT IN OTHER COUNTRIES. IMPORTING THIS
|
||||
// SOFTWARE INTO OTHER COUNTRIES IS AT YOUR OWN RISK. SOME COUNTRIES
|
||||
// PROHIBIT ENCRYPTED COMMUNICATIONS. USING THIS SOFTWARE IN OTHER
|
||||
// COUNTRIES MIGHT BE RESTRICTED.
|
||||
//
|
||||
//
|
||||
// DEAR SECURITY EXPERTS
|
||||
// ---------------------
|
||||
//
|
||||
// If you find a bug or a security vulnerability please kindly inform us
|
||||
// about the problem immediately so that we can fix the security problem
|
||||
// to protect a lot of users around the world as soon as possible.
|
||||
//
|
||||
// Our e-mail address for security reports is:
|
||||
// softether-vpn-security [at] softether.org
|
||||
//
|
||||
// Please note that the above e-mail address is not a technical support
|
||||
// inquiry address. If you need technical assistance, please visit
|
||||
// http://www.softether.org/ and ask your question on the users forum.
|
||||
//
|
||||
// Thank you for your cooperation.
|
||||
|
||||
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Data;
|
||||
using System.Data.Sql;
|
||||
using System.Data.SqlClient;
|
||||
using System.Data.SqlTypes;
|
||||
using System.Text;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Cryptography;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
using System.IO;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Web.Mail;
|
||||
|
||||
namespace CoreUtil
|
||||
{
|
||||
class IniCache
|
||||
{
|
||||
static Dictionary<string, IniCacheEntry> caches = new Dictionary<string, IniCacheEntry>();
|
||||
|
||||
class IniCacheEntry
|
||||
{
|
||||
DateTime lastUpdate;
|
||||
public DateTime LastUpdate
|
||||
{
|
||||
get { return lastUpdate; }
|
||||
}
|
||||
|
||||
Dictionary<string, string> datas;
|
||||
public Dictionary<string, string> Datas
|
||||
{
|
||||
get { return datas; }
|
||||
}
|
||||
|
||||
public IniCacheEntry(DateTime lastUpdate, Dictionary<string, string> datas)
|
||||
{
|
||||
this.lastUpdate = lastUpdate;
|
||||
this.datas = datas;
|
||||
}
|
||||
}
|
||||
|
||||
public static Dictionary<string, string> GetCache(string filename, DateTime lastUpdate)
|
||||
{
|
||||
lock (caches)
|
||||
{
|
||||
try
|
||||
{
|
||||
IniCacheEntry e = caches[filename];
|
||||
if (e.LastUpdate == lastUpdate || lastUpdate.Ticks == 0)
|
||||
{
|
||||
return e.Datas;
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void AddCache(string filename, DateTime lastUpdate, Dictionary<string, string> datas)
|
||||
{
|
||||
lock (caches)
|
||||
{
|
||||
if (caches.ContainsKey(filename))
|
||||
{
|
||||
caches.Remove(filename);
|
||||
}
|
||||
|
||||
caches.Add(filename, new IniCacheEntry(lastUpdate, datas));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class ReadIni
|
||||
{
|
||||
Dictionary<string, string> datas;
|
||||
bool updated;
|
||||
|
||||
public bool Updated
|
||||
{
|
||||
get
|
||||
{
|
||||
return updated;
|
||||
}
|
||||
}
|
||||
|
||||
public StrData this[string key]
|
||||
{
|
||||
get
|
||||
{
|
||||
string s;
|
||||
try
|
||||
{
|
||||
s = datas[key.ToUpper()];
|
||||
}
|
||||
catch
|
||||
{
|
||||
s = null;
|
||||
}
|
||||
|
||||
return new StrData(s);
|
||||
}
|
||||
}
|
||||
|
||||
public string[] GetKeys()
|
||||
{
|
||||
List<string> ret = new List<string>();
|
||||
|
||||
foreach (string s in datas.Keys)
|
||||
{
|
||||
ret.Add(s);
|
||||
}
|
||||
|
||||
return ret.ToArray();
|
||||
}
|
||||
|
||||
public ReadIni(string filename)
|
||||
{
|
||||
init(null, filename);
|
||||
}
|
||||
|
||||
void init(byte[] data)
|
||||
{
|
||||
init(data, null);
|
||||
}
|
||||
void init(byte[] data, string filename)
|
||||
{
|
||||
updated = false;
|
||||
|
||||
lock (typeof(ReadIni))
|
||||
{
|
||||
string[] lines;
|
||||
string srcstr;
|
||||
DateTime lastUpdate = new DateTime(0);
|
||||
|
||||
if (filename != null)
|
||||
{
|
||||
lastUpdate = IO.GetLastWriteTimeUtc(filename);
|
||||
|
||||
datas = IniCache.GetCache(filename, lastUpdate);
|
||||
}
|
||||
|
||||
if (datas == null)
|
||||
{
|
||||
if (data == null)
|
||||
{
|
||||
try
|
||||
{
|
||||
data = Buf.ReadFromFile(filename).ByteData;
|
||||
}
|
||||
catch
|
||||
{
|
||||
data = new byte[0];
|
||||
datas = IniCache.GetCache(filename, new DateTime());
|
||||
}
|
||||
}
|
||||
|
||||
if (datas == null)
|
||||
{
|
||||
datas = new Dictionary<string, string>();
|
||||
Encoding currentEncoding = Str.Utf8Encoding;
|
||||
srcstr = currentEncoding.GetString(data);
|
||||
|
||||
lines = Str.GetLines(srcstr);
|
||||
|
||||
foreach (string s in lines)
|
||||
{
|
||||
string line = s.Trim();
|
||||
|
||||
if (Str.IsEmptyStr(line) == false)
|
||||
{
|
||||
if (line.StartsWith("#") == false &&
|
||||
line.StartsWith("//") == false &&
|
||||
line.StartsWith(";") == false)
|
||||
{
|
||||
string key, value;
|
||||
|
||||
if (Str.GetKeyAndValue(line, out key, out value))
|
||||
{
|
||||
key = key.ToUpper();
|
||||
|
||||
if (datas.ContainsKey(key) == false)
|
||||
{
|
||||
datas.Add(key, value);
|
||||
}
|
||||
else
|
||||
{
|
||||
int i;
|
||||
for (i = 1; ; i++)
|
||||
{
|
||||
string key2 = string.Format("{0}({1})", key, i).ToUpper();
|
||||
|
||||
if (datas.ContainsKey(key2) == false)
|
||||
{
|
||||
datas.Add(key2, value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (filename != null)
|
||||
{
|
||||
IniCache.AddCache(filename, lastUpdate, datas);
|
||||
}
|
||||
|
||||
updated = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
537
src/BuildUtil/CoreUtil/Reg.cs
Normal file
537
src/BuildUtil/CoreUtil/Reg.cs
Normal file
@ -0,0 +1,537 @@
|
||||
// CoreUtil
|
||||
//
|
||||
// Copyright (C) 2012-2014 Daiyuu Nobori. All Rights Reserved.
|
||||
// Copyright (C) 2012-2014 SoftEther VPN Project at University of Tsukuba. All Rights Reserved.
|
||||
// Comments: Tetsuo Sugiyama, Ph.D.
|
||||
//
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// version 2 as published by the Free Software Foundation.
|
||||
//
|
||||
// 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 version 2
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// THE LICENSE AGREEMENT IS ATTACHED ON THE SOURCE-CODE PACKAGE
|
||||
// AS "LICENSE.TXT" FILE. READ THE TEXT FILE IN ADVANCE TO USE THE SOFTWARE.
|
||||
//
|
||||
//
|
||||
// THIS SOFTWARE IS DEVELOPED IN JAPAN, AND DISTRIBUTED FROM JAPAN,
|
||||
// UNDER JAPANESE LAWS. YOU MUST AGREE IN ADVANCE TO USE, COPY, MODIFY,
|
||||
// MERGE, PUBLISH, DISTRIBUTE, SUBLICENSE, AND/OR SELL COPIES OF THIS
|
||||
// SOFTWARE, THAT ANY JURIDICAL DISPUTES WHICH ARE CONCERNED TO THIS
|
||||
// SOFTWARE OR ITS CONTENTS, AGAINST US (SOFTETHER PROJECT, SOFTETHER
|
||||
// CORPORATION, DAIYUU NOBORI OR OTHER SUPPLIERS), OR ANY JURIDICAL
|
||||
// DISPUTES AGAINST US WHICH ARE CAUSED BY ANY KIND OF USING, COPYING,
|
||||
// MODIFYING, MERGING, PUBLISHING, DISTRIBUTING, SUBLICENSING, AND/OR
|
||||
// SELLING COPIES OF THIS SOFTWARE SHALL BE REGARDED AS BE CONSTRUED AND
|
||||
// CONTROLLED BY JAPANESE LAWS, AND YOU MUST FURTHER CONSENT TO
|
||||
// EXCLUSIVE JURISDICTION AND VENUE IN THE COURTS SITTING IN TOKYO,
|
||||
// JAPAN. YOU MUST WAIVE ALL DEFENSES OF LACK OF PERSONAL JURISDICTION
|
||||
// AND FORUM NON CONVENIENS. PROCESS MAY BE SERVED ON EITHER PARTY IN
|
||||
// THE MANNER AUTHORIZED BY APPLICABLE LAW OR COURT RULE.
|
||||
//
|
||||
// USE ONLY IN JAPAN. DO NOT USE IT IN OTHER COUNTRIES. IMPORTING THIS
|
||||
// SOFTWARE INTO OTHER COUNTRIES IS AT YOUR OWN RISK. SOME COUNTRIES
|
||||
// PROHIBIT ENCRYPTED COMMUNICATIONS. USING THIS SOFTWARE IN OTHER
|
||||
// COUNTRIES MIGHT BE RESTRICTED.
|
||||
//
|
||||
//
|
||||
// DEAR SECURITY EXPERTS
|
||||
// ---------------------
|
||||
//
|
||||
// If you find a bug or a security vulnerability please kindly inform us
|
||||
// about the problem immediately so that we can fix the security problem
|
||||
// to protect a lot of users around the world as soon as possible.
|
||||
//
|
||||
// Our e-mail address for security reports is:
|
||||
// softether-vpn-security [at] softether.org
|
||||
//
|
||||
// Please note that the above e-mail address is not a technical support
|
||||
// inquiry address. If you need technical assistance, please visit
|
||||
// http://www.softether.org/ and ask your question on the users forum.
|
||||
//
|
||||
// Thank you for your cooperation.
|
||||
|
||||
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Data;
|
||||
using System.Data.Sql;
|
||||
using System.Data.SqlClient;
|
||||
using System.Data.SqlTypes;
|
||||
using System.Text;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Cryptography;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
using System.IO;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Diagnostics;
|
||||
using System.Web.Mail;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Net.NetworkInformation;
|
||||
using Microsoft.Win32;
|
||||
|
||||
namespace CoreUtil
|
||||
{
|
||||
public class AppReg
|
||||
{
|
||||
string appSubKey;
|
||||
public string AppSubKey
|
||||
{
|
||||
get { return appSubKey; }
|
||||
}
|
||||
RegRoot rootKey;
|
||||
public RegRoot RootKey
|
||||
{
|
||||
get { return rootKey; }
|
||||
}
|
||||
|
||||
public AppReg(RegRoot root, string subkey)
|
||||
{
|
||||
subkey = subkey.TrimEnd('\\');
|
||||
this.rootKey = root;
|
||||
this.appSubKey = subkey;
|
||||
}
|
||||
|
||||
public AppReg GetSubReg(string subKeyName)
|
||||
{
|
||||
return new AppReg(rootKey, appSubKey + "\\" + subKeyName);
|
||||
}
|
||||
|
||||
public bool WriteStr(string name, string value)
|
||||
{
|
||||
return Reg.WriteStr(rootKey, appSubKey, name, value);
|
||||
}
|
||||
|
||||
public bool WriteInt(string name, int value)
|
||||
{
|
||||
return Reg.WriteInt(rootKey, appSubKey, name, value);
|
||||
}
|
||||
|
||||
public bool WriteStrList(string name, string[] values)
|
||||
{
|
||||
return Reg.WriteStrList(rootKey, appSubKey, name, values);
|
||||
}
|
||||
|
||||
public bool WriteByte(string name, byte[] data)
|
||||
{
|
||||
return Reg.WriteByte(rootKey, appSubKey, name, data);
|
||||
}
|
||||
|
||||
public bool DeleteValue(string name)
|
||||
{
|
||||
return Reg.DeleteValue(rootKey, appSubKey, name);
|
||||
}
|
||||
|
||||
public string ReadStr(string name)
|
||||
{
|
||||
return Reg.ReadStr(rootKey, appSubKey, name);
|
||||
}
|
||||
|
||||
public int ReadInt(string name)
|
||||
{
|
||||
return Reg.ReadInt(rootKey, appSubKey, name);
|
||||
}
|
||||
|
||||
public string[] ReadStrList(string name)
|
||||
{
|
||||
return Reg.ReadStrList(rootKey, appSubKey, name);
|
||||
}
|
||||
|
||||
public byte[] ReadByte(string name)
|
||||
{
|
||||
return Reg.ReadByte(rootKey, appSubKey, name);
|
||||
}
|
||||
}
|
||||
|
||||
public enum RegRoot
|
||||
{
|
||||
LocalMachine = 0,
|
||||
CurrentUser = 1,
|
||||
Users = 2,
|
||||
}
|
||||
|
||||
public static class Reg
|
||||
{
|
||||
static RegistryKey rootKey(RegRoot r)
|
||||
{
|
||||
switch (r)
|
||||
{
|
||||
case RegRoot.LocalMachine:
|
||||
return Registry.LocalMachine;
|
||||
|
||||
case RegRoot.CurrentUser:
|
||||
return Registry.CurrentUser;
|
||||
|
||||
case RegRoot.Users:
|
||||
return Registry.Users;
|
||||
}
|
||||
|
||||
throw new ArgumentException();
|
||||
}
|
||||
|
||||
public static string[] EnumValue(RegRoot root, string keyname)
|
||||
{
|
||||
try
|
||||
{
|
||||
RegistryKey key = rootKey(root).OpenSubKey(keyname);
|
||||
|
||||
if (key == null)
|
||||
{
|
||||
return new string[0];
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
return key.GetValueNames();
|
||||
}
|
||||
finally
|
||||
{
|
||||
key.Close();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
return new string[0];
|
||||
}
|
||||
}
|
||||
|
||||
public static string[] EnumKey(RegRoot root, string keyname)
|
||||
{
|
||||
try
|
||||
{
|
||||
RegistryKey key = rootKey(root).OpenSubKey(keyname);
|
||||
|
||||
if (key == null)
|
||||
{
|
||||
return new string[0];
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
return key.GetSubKeyNames();
|
||||
}
|
||||
finally
|
||||
{
|
||||
key.Close();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
return new string[0];
|
||||
}
|
||||
}
|
||||
|
||||
public static bool WriteByte(RegRoot root, string keyname, string valuename, byte[] data)
|
||||
{
|
||||
return WriteValue(root, keyname, valuename, data);
|
||||
}
|
||||
|
||||
public static byte[] ReadByte(RegRoot root, string keyname, string valuename)
|
||||
{
|
||||
object o = ReadValue(root, keyname, valuename);
|
||||
if (o == null)
|
||||
{
|
||||
return new byte[0];
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
return (byte[])o;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return new byte[0];
|
||||
}
|
||||
}
|
||||
|
||||
public static bool WriteInt(RegRoot root, string keyname, string valuename, int value)
|
||||
{
|
||||
return WriteValue(root, keyname, valuename, value);
|
||||
}
|
||||
|
||||
public static int ReadInt(RegRoot root, string keyname, string valuename)
|
||||
{
|
||||
object o = ReadValue(root, keyname, valuename);
|
||||
if (o == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
return (int)o;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool WriteStrList(RegRoot root, string keyname, string valuename, string[] value)
|
||||
{
|
||||
return WriteValue(root, keyname, valuename, value);
|
||||
}
|
||||
|
||||
public static string[] ReadStrList(RegRoot root, string keyname, string valuename)
|
||||
{
|
||||
object o = ReadValue(root, keyname, valuename);
|
||||
if (o == null)
|
||||
{
|
||||
return new string[0];
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
return (string[])o;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return new string[0];
|
||||
}
|
||||
}
|
||||
|
||||
public static bool WriteStr(RegRoot root, string keyname, string valuename, string value)
|
||||
{
|
||||
return WriteValue(root, keyname, valuename, value);
|
||||
}
|
||||
|
||||
public static string ReadStr(RegRoot root, string keyname, string valuename)
|
||||
{
|
||||
object o = ReadValue(root, keyname, valuename);
|
||||
if (o == null)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
return (string)o;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
public static bool WriteValue(RegRoot root, string keyname, string valuename, object o)
|
||||
{
|
||||
try
|
||||
{
|
||||
RegistryKey key = rootKey(root).OpenSubKey(keyname, true);
|
||||
|
||||
if (key == null)
|
||||
{
|
||||
key = rootKey(root).CreateSubKey(keyname);
|
||||
|
||||
if (key == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
key.SetValue(valuename, o);
|
||||
|
||||
return true;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
finally
|
||||
{
|
||||
key.Close();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static object ReadValue(RegRoot root, string keyname, string valuename)
|
||||
{
|
||||
try
|
||||
{
|
||||
RegistryKey key = rootKey(root).OpenSubKey(keyname);
|
||||
|
||||
if (key == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
return key.GetValue(valuename);
|
||||
}
|
||||
finally
|
||||
{
|
||||
key.Close();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsValue(RegRoot root, string keyname, string valuename)
|
||||
{
|
||||
try
|
||||
{
|
||||
RegistryKey key = rootKey(root).OpenSubKey(keyname);
|
||||
|
||||
try
|
||||
{
|
||||
object o = key.GetValue(valuename);
|
||||
|
||||
if (o == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
key.Close();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool DeleteValue(RegRoot root, string keyname, string valuename)
|
||||
{
|
||||
try
|
||||
{
|
||||
RegistryKey key = rootKey(root).OpenSubKey(keyname, true);
|
||||
|
||||
if (key == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
key.DeleteValue(valuename);
|
||||
|
||||
return true;
|
||||
}
|
||||
finally
|
||||
{
|
||||
key.Close();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool DeleteKey(RegRoot root, string keyname)
|
||||
{
|
||||
return DeleteKey(root, keyname, false);
|
||||
}
|
||||
public static bool DeleteKey(RegRoot root, string keyname, bool deleteAll)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (deleteAll == false)
|
||||
{
|
||||
rootKey(root).DeleteSubKey(keyname);
|
||||
}
|
||||
else
|
||||
{
|
||||
rootKey(root).DeleteSubKeyTree(keyname);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool NewKey(RegRoot root, string keyname)
|
||||
{
|
||||
if (IsKey(root, keyname))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
RegistryKey key = rootKey(root).CreateSubKey(keyname);
|
||||
|
||||
if (key == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
key.Close();
|
||||
|
||||
return true;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsKey(RegRoot root, string name)
|
||||
{
|
||||
try
|
||||
{
|
||||
RegistryKey key = rootKey(root).OpenSubKey(name);
|
||||
|
||||
if (key == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
key.Close();
|
||||
|
||||
return true;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
1029
src/BuildUtil/CoreUtil/Secure.cs
Normal file
1029
src/BuildUtil/CoreUtil/Secure.cs
Normal file
File diff suppressed because it is too large
Load Diff
352
src/BuildUtil/CoreUtil/Stb.cs
Normal file
352
src/BuildUtil/CoreUtil/Stb.cs
Normal file
@ -0,0 +1,352 @@
|
||||
// CoreUtil
|
||||
//
|
||||
// Copyright (C) 2012-2014 Daiyuu Nobori. All Rights Reserved.
|
||||
// Copyright (C) 2012-2014 SoftEther VPN Project at University of Tsukuba. All Rights Reserved.
|
||||
// Comments: Tetsuo Sugiyama, Ph.D.
|
||||
//
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// version 2 as published by the Free Software Foundation.
|
||||
//
|
||||
// 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 version 2
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// THE LICENSE AGREEMENT IS ATTACHED ON THE SOURCE-CODE PACKAGE
|
||||
// AS "LICENSE.TXT" FILE. READ THE TEXT FILE IN ADVANCE TO USE THE SOFTWARE.
|
||||
//
|
||||
//
|
||||
// THIS SOFTWARE IS DEVELOPED IN JAPAN, AND DISTRIBUTED FROM JAPAN,
|
||||
// UNDER JAPANESE LAWS. YOU MUST AGREE IN ADVANCE TO USE, COPY, MODIFY,
|
||||
// MERGE, PUBLISH, DISTRIBUTE, SUBLICENSE, AND/OR SELL COPIES OF THIS
|
||||
// SOFTWARE, THAT ANY JURIDICAL DISPUTES WHICH ARE CONCERNED TO THIS
|
||||
// SOFTWARE OR ITS CONTENTS, AGAINST US (SOFTETHER PROJECT, SOFTETHER
|
||||
// CORPORATION, DAIYUU NOBORI OR OTHER SUPPLIERS), OR ANY JURIDICAL
|
||||
// DISPUTES AGAINST US WHICH ARE CAUSED BY ANY KIND OF USING, COPYING,
|
||||
// MODIFYING, MERGING, PUBLISHING, DISTRIBUTING, SUBLICENSING, AND/OR
|
||||
// SELLING COPIES OF THIS SOFTWARE SHALL BE REGARDED AS BE CONSTRUED AND
|
||||
// CONTROLLED BY JAPANESE LAWS, AND YOU MUST FURTHER CONSENT TO
|
||||
// EXCLUSIVE JURISDICTION AND VENUE IN THE COURTS SITTING IN TOKYO,
|
||||
// JAPAN. YOU MUST WAIVE ALL DEFENSES OF LACK OF PERSONAL JURISDICTION
|
||||
// AND FORUM NON CONVENIENS. PROCESS MAY BE SERVED ON EITHER PARTY IN
|
||||
// THE MANNER AUTHORIZED BY APPLICABLE LAW OR COURT RULE.
|
||||
//
|
||||
// USE ONLY IN JAPAN. DO NOT USE IT IN OTHER COUNTRIES. IMPORTING THIS
|
||||
// SOFTWARE INTO OTHER COUNTRIES IS AT YOUR OWN RISK. SOME COUNTRIES
|
||||
// PROHIBIT ENCRYPTED COMMUNICATIONS. USING THIS SOFTWARE IN OTHER
|
||||
// COUNTRIES MIGHT BE RESTRICTED.
|
||||
//
|
||||
//
|
||||
// DEAR SECURITY EXPERTS
|
||||
// ---------------------
|
||||
//
|
||||
// If you find a bug or a security vulnerability please kindly inform us
|
||||
// about the problem immediately so that we can fix the security problem
|
||||
// to protect a lot of users around the world as soon as possible.
|
||||
//
|
||||
// Our e-mail address for security reports is:
|
||||
// softether-vpn-security [at] softether.org
|
||||
//
|
||||
// Please note that the above e-mail address is not a technical support
|
||||
// inquiry address. If you need technical assistance, please visit
|
||||
// http://www.softether.org/ and ask your question on the users forum.
|
||||
//
|
||||
// Thank you for your cooperation.
|
||||
|
||||
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Data;
|
||||
using System.Data.Sql;
|
||||
using System.Data.SqlClient;
|
||||
using System.Data.SqlTypes;
|
||||
using System.Text;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Cryptography;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
using System.IO;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Diagnostics;
|
||||
using System.Web.Mail;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Net.NetworkInformation;
|
||||
using System.Net.Mail;
|
||||
using System.Net.Mime;
|
||||
using System.Reflection;
|
||||
using CoreUtil;
|
||||
|
||||
namespace CoreUtil
|
||||
{
|
||||
public class Stb
|
||||
{
|
||||
Dictionary<string, StbEntry> entryList;
|
||||
|
||||
public string this[string name]
|
||||
{
|
||||
get
|
||||
{
|
||||
if (entryList.ContainsKey(name.ToUpper()))
|
||||
{
|
||||
return entryList[name.ToUpper()].String;
|
||||
}
|
||||
else
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Stb(string filename)
|
||||
{
|
||||
init(IO.ReadFile(filename));
|
||||
}
|
||||
|
||||
public Stb(byte[] data)
|
||||
{
|
||||
init(data);
|
||||
}
|
||||
|
||||
void init(byte[] data)
|
||||
{
|
||||
entryList = new Dictionary<string, StbEntry>();
|
||||
MemoryStream ms = new MemoryStream(data);
|
||||
StreamReader sr = new StreamReader(ms);
|
||||
string prefix = "";
|
||||
|
||||
while (true)
|
||||
{
|
||||
string tmp = sr.ReadLine();
|
||||
if (tmp == null)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
StbEntry t = StbEntry.ParseTableLine(tmp, ref prefix);
|
||||
if (t != null)
|
||||
{
|
||||
if (entryList.ContainsKey(t.Name.ToUpper()) == false)
|
||||
{
|
||||
entryList.Add(t.Name.ToUpper(), t);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const string standardStbFileName = "|strtable.stb";
|
||||
static string defaultStbFileName = standardStbFileName;
|
||||
static object lockObj = new object();
|
||||
static Stb defaultStb = null;
|
||||
public static string DefaultStbFileName
|
||||
{
|
||||
set
|
||||
{
|
||||
defaultStbFileName = value;
|
||||
}
|
||||
|
||||
get
|
||||
{
|
||||
return defaultStbFileName;
|
||||
}
|
||||
}
|
||||
public static Stb DefaultStb
|
||||
{
|
||||
get
|
||||
{
|
||||
lock (lockObj)
|
||||
{
|
||||
if (defaultStb == null)
|
||||
{
|
||||
defaultStb = new Stb(Stb.DefaultStbFileName);
|
||||
}
|
||||
|
||||
return defaultStb;
|
||||
}
|
||||
}
|
||||
}
|
||||
public static string SS(string name)
|
||||
{
|
||||
return DefaultStb[name];
|
||||
}
|
||||
public static uint II(string name)
|
||||
{
|
||||
return Str.StrToUInt(SS(name));
|
||||
}
|
||||
}
|
||||
|
||||
public class StbEntry
|
||||
{
|
||||
string name;
|
||||
public string Name
|
||||
{
|
||||
get { return name; }
|
||||
}
|
||||
|
||||
string str;
|
||||
public string String
|
||||
{
|
||||
get { return str; }
|
||||
}
|
||||
|
||||
public StbEntry(string name, string str)
|
||||
{
|
||||
this.name = name;
|
||||
this.str = str;
|
||||
}
|
||||
public static StbEntry ParseTableLine(string line, ref string prefix)
|
||||
{
|
||||
int i, len;
|
||||
int string_start;
|
||||
int len_name;
|
||||
string name, name2;
|
||||
|
||||
line = line.TrimStart(' ', '\t');
|
||||
len = line.Length;
|
||||
if (len == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if (line[0] == '#' || (line[0] == '/' && line[1] == '/'))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
bool b = false;
|
||||
len_name = 0;
|
||||
for (i = 0; i < line.Length; i++)
|
||||
{
|
||||
if (line[i] == ' ' || line[i] == '\t')
|
||||
{
|
||||
b = true;
|
||||
break;
|
||||
}
|
||||
len_name++;
|
||||
}
|
||||
|
||||
if (b == false)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
name = line.Substring(0, len_name);
|
||||
|
||||
string_start = len_name;
|
||||
for (i = len_name; i < len; i++)
|
||||
{
|
||||
if (line[i] != ' ' && line[i] != '\t')
|
||||
{
|
||||
break;
|
||||
}
|
||||
string_start++;
|
||||
}
|
||||
if (i == len)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
string str = line.Substring(string_start);
|
||||
|
||||
str = UnescapeStr(str);
|
||||
|
||||
if (Str.StrCmpi(name, "PREFIX"))
|
||||
{
|
||||
prefix = str;
|
||||
prefix = prefix.TrimStart();
|
||||
|
||||
if (Str.StrCmpi(prefix, "$") || Str.StrCmpi(prefix, "NULL"))
|
||||
{
|
||||
prefix = "";
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
name2 = "";
|
||||
|
||||
if (prefix != "")
|
||||
{
|
||||
name2 += prefix + "@";
|
||||
}
|
||||
|
||||
name2 += name;
|
||||
|
||||
return new StbEntry(name2, str);
|
||||
}
|
||||
|
||||
public static string UnescapeStr(string str)
|
||||
{
|
||||
int i, len;
|
||||
string tmp;
|
||||
|
||||
len = str.Length;
|
||||
tmp = "";
|
||||
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
if (str[i] == '\\')
|
||||
{
|
||||
i++;
|
||||
switch (str[i])
|
||||
{
|
||||
case '\\':
|
||||
tmp += '\\';
|
||||
break;
|
||||
|
||||
case ' ':
|
||||
tmp += ' ';
|
||||
break;
|
||||
|
||||
case 'n':
|
||||
case 'N':
|
||||
tmp += '\n';
|
||||
break;
|
||||
|
||||
case 'r':
|
||||
case 'R':
|
||||
tmp += '\r';
|
||||
break;
|
||||
|
||||
case 't':
|
||||
case 'T':
|
||||
tmp += '\t';
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
tmp += str[i];
|
||||
}
|
||||
}
|
||||
|
||||
return tmp;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
4377
src/BuildUtil/CoreUtil/Str.cs
Normal file
4377
src/BuildUtil/CoreUtil/Str.cs
Normal file
File diff suppressed because it is too large
Load Diff
430
src/BuildUtil/CoreUtil/Tar.cs
Normal file
430
src/BuildUtil/CoreUtil/Tar.cs
Normal file
@ -0,0 +1,430 @@
|
||||
// CoreUtil
|
||||
//
|
||||
// Copyright (C) 2012-2014 Daiyuu Nobori. All Rights Reserved.
|
||||
// Copyright (C) 2012-2014 SoftEther VPN Project at University of Tsukuba. All Rights Reserved.
|
||||
// Comments: Tetsuo Sugiyama, Ph.D.
|
||||
//
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// version 2 as published by the Free Software Foundation.
|
||||
//
|
||||
// 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 version 2
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// THE LICENSE AGREEMENT IS ATTACHED ON THE SOURCE-CODE PACKAGE
|
||||
// AS "LICENSE.TXT" FILE. READ THE TEXT FILE IN ADVANCE TO USE THE SOFTWARE.
|
||||
//
|
||||
//
|
||||
// THIS SOFTWARE IS DEVELOPED IN JAPAN, AND DISTRIBUTED FROM JAPAN,
|
||||
// UNDER JAPANESE LAWS. YOU MUST AGREE IN ADVANCE TO USE, COPY, MODIFY,
|
||||
// MERGE, PUBLISH, DISTRIBUTE, SUBLICENSE, AND/OR SELL COPIES OF THIS
|
||||
// SOFTWARE, THAT ANY JURIDICAL DISPUTES WHICH ARE CONCERNED TO THIS
|
||||
// SOFTWARE OR ITS CONTENTS, AGAINST US (SOFTETHER PROJECT, SOFTETHER
|
||||
// CORPORATION, DAIYUU NOBORI OR OTHER SUPPLIERS), OR ANY JURIDICAL
|
||||
// DISPUTES AGAINST US WHICH ARE CAUSED BY ANY KIND OF USING, COPYING,
|
||||
// MODIFYING, MERGING, PUBLISHING, DISTRIBUTING, SUBLICENSING, AND/OR
|
||||
// SELLING COPIES OF THIS SOFTWARE SHALL BE REGARDED AS BE CONSTRUED AND
|
||||
// CONTROLLED BY JAPANESE LAWS, AND YOU MUST FURTHER CONSENT TO
|
||||
// EXCLUSIVE JURISDICTION AND VENUE IN THE COURTS SITTING IN TOKYO,
|
||||
// JAPAN. YOU MUST WAIVE ALL DEFENSES OF LACK OF PERSONAL JURISDICTION
|
||||
// AND FORUM NON CONVENIENS. PROCESS MAY BE SERVED ON EITHER PARTY IN
|
||||
// THE MANNER AUTHORIZED BY APPLICABLE LAW OR COURT RULE.
|
||||
//
|
||||
// USE ONLY IN JAPAN. DO NOT USE IT IN OTHER COUNTRIES. IMPORTING THIS
|
||||
// SOFTWARE INTO OTHER COUNTRIES IS AT YOUR OWN RISK. SOME COUNTRIES
|
||||
// PROHIBIT ENCRYPTED COMMUNICATIONS. USING THIS SOFTWARE IN OTHER
|
||||
// COUNTRIES MIGHT BE RESTRICTED.
|
||||
//
|
||||
//
|
||||
// DEAR SECURITY EXPERTS
|
||||
// ---------------------
|
||||
//
|
||||
// If you find a bug or a security vulnerability please kindly inform us
|
||||
// about the problem immediately so that we can fix the security problem
|
||||
// to protect a lot of users around the world as soon as possible.
|
||||
//
|
||||
// Our e-mail address for security reports is:
|
||||
// softether-vpn-security [at] softether.org
|
||||
//
|
||||
// Please note that the above e-mail address is not a technical support
|
||||
// inquiry address. If you need technical assistance, please visit
|
||||
// http://www.softether.org/ and ask your question on the users forum.
|
||||
//
|
||||
// Thank you for your cooperation.
|
||||
|
||||
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Data;
|
||||
using System.Data.Sql;
|
||||
using System.Data.SqlClient;
|
||||
using System.Data.SqlTypes;
|
||||
using System.Text;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Cryptography;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
using System.IO;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace CoreUtil
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
public struct TarHeader
|
||||
{
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 100)]
|
||||
public byte[] Name;
|
||||
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
|
||||
public byte[] Mode;
|
||||
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
|
||||
public byte[] UID;
|
||||
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
|
||||
public byte[] GID;
|
||||
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 12)]
|
||||
public byte[] Size;
|
||||
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 12)]
|
||||
public byte[] MTime;
|
||||
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
|
||||
public byte[] CheckSum;
|
||||
|
||||
public byte TypeFlag;
|
||||
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 100)]
|
||||
public byte[] LinkName;
|
||||
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)]
|
||||
public byte[] Magic;
|
||||
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
|
||||
public byte[] Version;
|
||||
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
|
||||
public byte[] UName;
|
||||
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
|
||||
public byte[] GName;
|
||||
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
|
||||
public byte[] DevMajor;
|
||||
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
|
||||
public byte[] DevMinor;
|
||||
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 155)]
|
||||
public byte[] Prefix;
|
||||
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 12)]
|
||||
public byte[] Padding;
|
||||
|
||||
public TarHeader(bool dummy)
|
||||
{
|
||||
this.Name = new byte[100];
|
||||
this.Mode = new byte[8];
|
||||
this.UID = new byte[8];
|
||||
this.GID = new byte[8];
|
||||
this.Size = new byte[12];
|
||||
this.MTime = new byte[12];
|
||||
this.CheckSum = new byte[8];
|
||||
this.LinkName = new byte[100];
|
||||
this.Magic = new byte[6];
|
||||
this.Version = new byte[2];
|
||||
this.UName = new byte[32];
|
||||
this.GName = new byte[32];
|
||||
this.DevMajor = new byte[8];
|
||||
this.DevMinor = new byte[8];
|
||||
this.Prefix = new byte[155];
|
||||
this.Padding = new byte[12];
|
||||
this.TypeFlag = 0;
|
||||
|
||||
this.Version[0] = 0x20;
|
||||
this.Version[1] = 0x00;
|
||||
|
||||
byte[] data = Str.ShiftJisEncoding.GetBytes("ustar ");
|
||||
Util.CopyByte(this.Magic, 0, data, 0, 6);
|
||||
}
|
||||
|
||||
public void SetName(string name, Encoding encoding)
|
||||
{
|
||||
byte[] data = encoding.GetBytes(name);
|
||||
if (data.Length <= 100)
|
||||
{
|
||||
Util.CopyByte(this.Name, 0, data, 0, data.Length);
|
||||
}
|
||||
else
|
||||
{
|
||||
Util.CopyByte(this.Name, 0, data, 0, 100);
|
||||
Util.CopyByte(this.Prefix, 0, data, 100, data.Length - 100);
|
||||
}
|
||||
}
|
||||
|
||||
public void SetMode(string str)
|
||||
{
|
||||
StrToByteArray(this.Mode, str);
|
||||
}
|
||||
|
||||
public void SetUID(string str)
|
||||
{
|
||||
StrToByteArray(this.UID, str);
|
||||
}
|
||||
|
||||
public void SetGID(string str)
|
||||
{
|
||||
StrToByteArray(this.GID, str);
|
||||
}
|
||||
|
||||
public void SetSize(long size)
|
||||
{
|
||||
if (size >= 0x1FFFFFFFF || size < 0)
|
||||
{
|
||||
throw new InvalidDataException("size");
|
||||
}
|
||||
StrToByteArray(this.Size, Str.AppendZeroToNumString(Convert.ToString(size, 8), 11));
|
||||
}
|
||||
|
||||
public void SetMTime(DateTime dt)
|
||||
{
|
||||
uint t = Util.DateTimeToUnixTime(dt.ToUniversalTime());
|
||||
|
||||
StrToByteArray(this.MTime, Str.AppendZeroToNumString(Convert.ToString(t, 8), 11));
|
||||
}
|
||||
|
||||
public void CalcChecksum()
|
||||
{
|
||||
TarHeader h2 = this;
|
||||
Array.Clear(h2.CheckSum, 0, h2.CheckSum.Length);
|
||||
byte[] data = Util.StructToByte(h2);
|
||||
SetChecksum(data);
|
||||
}
|
||||
|
||||
public void SetChecksum(byte[] data)
|
||||
{
|
||||
ulong sum = 0;
|
||||
int i;
|
||||
for (i = 0; i < data.Length; i++)
|
||||
{
|
||||
sum += (ulong)data[i];
|
||||
}
|
||||
|
||||
sum += 0x100;
|
||||
|
||||
StrToByteArray(this.CheckSum, Str.AppendZeroToNumString(Convert.ToString((long)sum, 8), 6));
|
||||
this.CheckSum[7] = 0x20;
|
||||
}
|
||||
|
||||
public void SetTypeFlag(int flag)
|
||||
{
|
||||
this.TypeFlag = (byte)flag.ToString()[0];
|
||||
}
|
||||
|
||||
public void SetUName(string str)
|
||||
{
|
||||
StrToByteArray(this.UName, str);
|
||||
}
|
||||
|
||||
public void SetGName(string str)
|
||||
{
|
||||
StrToByteArray(this.GName, str);
|
||||
}
|
||||
|
||||
public static void StrToByteArray(byte[] dst, string str)
|
||||
{
|
||||
Encoding e = Str.ShiftJisEncoding;
|
||||
|
||||
byte[] d = e.GetBytes(str);
|
||||
|
||||
Array.Clear(dst, 0, dst.Length);
|
||||
Util.CopyByte(dst, 0, d, 0, Math.Min(d.Length, dst.Length - 1));
|
||||
}
|
||||
}
|
||||
|
||||
public static class TarUtil
|
||||
{
|
||||
public static TarHeader CreateTarHeader(string name, Encoding encoding, int type, long size, DateTime dt)
|
||||
{
|
||||
return CreateTarHeader(name, encoding, type, size, dt, "0000777");
|
||||
}
|
||||
|
||||
public static TarHeader CreateTarHeader(string name, Encoding encoding, int type, long size, DateTime dt, string mode)
|
||||
{
|
||||
TarHeader h = new TarHeader(false);
|
||||
|
||||
h.SetName(name, encoding);
|
||||
|
||||
h.SetMode(mode);
|
||||
h.SetMTime(dt);
|
||||
h.SetName(name, encoding);
|
||||
h.SetSize(size);
|
||||
h.SetTypeFlag(type);
|
||||
h.SetGID("0000000");
|
||||
h.SetUID("0000000");
|
||||
|
||||
h.CalcChecksum();
|
||||
|
||||
return h;
|
||||
}
|
||||
}
|
||||
|
||||
public class TarPacker
|
||||
{
|
||||
Fifo fifo;
|
||||
Dictionary<string, int> dirList;
|
||||
Encoding encoding;
|
||||
|
||||
public TarPacker()
|
||||
: this(Str.ShiftJisEncoding)
|
||||
{
|
||||
}
|
||||
public TarPacker(Encoding encoding)
|
||||
{
|
||||
fifo = new Fifo();
|
||||
dirList = new Dictionary<string, int>(new StrEqualityComparer(true));
|
||||
this.encoding = encoding;
|
||||
}
|
||||
|
||||
public void AddDirectory(string name, DateTime dt, string mode)
|
||||
{
|
||||
name = name.Replace('\\', '/');
|
||||
if (name.EndsWith("/") == false)
|
||||
{
|
||||
name = name + "/";
|
||||
}
|
||||
|
||||
if (dirList.ContainsKey(name) == false)
|
||||
{
|
||||
TarHeader h = TarUtil.CreateTarHeader(name, encoding, 5, 0, dt, mode);
|
||||
fifo.Write(Util.StructToByte(h));
|
||||
|
||||
dirList.Add(name, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public void AddDirectory(string name, DateTime dt)
|
||||
{
|
||||
AddDirectory(name, dt, "0000777");
|
||||
}
|
||||
|
||||
long currentFileSize = 0;
|
||||
long currentPos = 0;
|
||||
|
||||
public void AddFileSimple(string name, byte[] data, int pos, int len, DateTime dt)
|
||||
{
|
||||
AddFileSimple(name, data, pos, len, dt, "0000777", "0000777");
|
||||
}
|
||||
|
||||
public void AddFileSimple(string name, byte[] data, int pos, int len, DateTime dt, string directory_mode, string mode)
|
||||
{
|
||||
AddFileStart(name, len, dt, directory_mode, mode);
|
||||
AddFileData(data, pos, len);
|
||||
}
|
||||
|
||||
public void AddFileStart(string name, long size, DateTime dt)
|
||||
{
|
||||
AddFileStart(name, size, dt, "0000777", "0000777");
|
||||
}
|
||||
|
||||
public void AddFileStart(string name, long size, DateTime dt, string directory_mode, string mode)
|
||||
{
|
||||
if (currentFileSize != 0 || currentPos != 0)
|
||||
{
|
||||
throw new ApplicationException("last file not completed.");
|
||||
}
|
||||
|
||||
name = name.Replace('\\', '/');
|
||||
if (Str.InStr(name, "/", true))
|
||||
{
|
||||
AddDirectory(Path.GetDirectoryName(name), dt, directory_mode);
|
||||
}
|
||||
|
||||
TarHeader h = TarUtil.CreateTarHeader(name, encoding, 0, size, dt, mode);
|
||||
fifo.Write(Util.StructToByte(h));
|
||||
|
||||
currentFileSize = size;
|
||||
currentPos = 0;
|
||||
}
|
||||
|
||||
public void AddFileData(byte[] data, int pos, int len)
|
||||
{
|
||||
long totalSize = currentPos + len;
|
||||
|
||||
if (totalSize > currentFileSize)
|
||||
{
|
||||
throw new ApplicationException("totalSize > currentFileSize");
|
||||
}
|
||||
|
||||
fifo.Write(data, pos, len);
|
||||
|
||||
currentPos += len;
|
||||
if (currentPos >= currentFileSize)
|
||||
{
|
||||
long padding = ((currentFileSize + 511) / 512) * 512 - currentFileSize;
|
||||
|
||||
byte[] pad = new byte[padding];
|
||||
Array.Clear(pad, 0, pad.Length);
|
||||
fifo.Write(pad, 0, pad.Length);
|
||||
|
||||
currentFileSize = 0;
|
||||
currentPos = 0;
|
||||
}
|
||||
}
|
||||
|
||||
public Fifo GeneratedData
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.fifo;
|
||||
}
|
||||
}
|
||||
|
||||
public void Finish()
|
||||
{
|
||||
byte[] data = new byte[1024];
|
||||
Array.Clear(data, 0, data.Length);
|
||||
|
||||
fifo.Write(data);
|
||||
}
|
||||
|
||||
public byte[] CompressToGZip()
|
||||
{
|
||||
GZipPacker g = new GZipPacker();
|
||||
byte[] data = this.fifo.Read();
|
||||
|
||||
g.Write(data, 0, data.Length, true);
|
||||
|
||||
return g.GeneratedData.Read();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
542
src/BuildUtil/CoreUtil/Thread.cs
Normal file
542
src/BuildUtil/CoreUtil/Thread.cs
Normal file
@ -0,0 +1,542 @@
|
||||
// CoreUtil
|
||||
//
|
||||
// Copyright (C) 2012-2014 Daiyuu Nobori. All Rights Reserved.
|
||||
// Copyright (C) 2012-2014 SoftEther VPN Project at University of Tsukuba. All Rights Reserved.
|
||||
// Comments: Tetsuo Sugiyama, Ph.D.
|
||||
//
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// version 2 as published by the Free Software Foundation.
|
||||
//
|
||||
// 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 version 2
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// THE LICENSE AGREEMENT IS ATTACHED ON THE SOURCE-CODE PACKAGE
|
||||
// AS "LICENSE.TXT" FILE. READ THE TEXT FILE IN ADVANCE TO USE THE SOFTWARE.
|
||||
//
|
||||
//
|
||||
// THIS SOFTWARE IS DEVELOPED IN JAPAN, AND DISTRIBUTED FROM JAPAN,
|
||||
// UNDER JAPANESE LAWS. YOU MUST AGREE IN ADVANCE TO USE, COPY, MODIFY,
|
||||
// MERGE, PUBLISH, DISTRIBUTE, SUBLICENSE, AND/OR SELL COPIES OF THIS
|
||||
// SOFTWARE, THAT ANY JURIDICAL DISPUTES WHICH ARE CONCERNED TO THIS
|
||||
// SOFTWARE OR ITS CONTENTS, AGAINST US (SOFTETHER PROJECT, SOFTETHER
|
||||
// CORPORATION, DAIYUU NOBORI OR OTHER SUPPLIERS), OR ANY JURIDICAL
|
||||
// DISPUTES AGAINST US WHICH ARE CAUSED BY ANY KIND OF USING, COPYING,
|
||||
// MODIFYING, MERGING, PUBLISHING, DISTRIBUTING, SUBLICENSING, AND/OR
|
||||
// SELLING COPIES OF THIS SOFTWARE SHALL BE REGARDED AS BE CONSTRUED AND
|
||||
// CONTROLLED BY JAPANESE LAWS, AND YOU MUST FURTHER CONSENT TO
|
||||
// EXCLUSIVE JURISDICTION AND VENUE IN THE COURTS SITTING IN TOKYO,
|
||||
// JAPAN. YOU MUST WAIVE ALL DEFENSES OF LACK OF PERSONAL JURISDICTION
|
||||
// AND FORUM NON CONVENIENS. PROCESS MAY BE SERVED ON EITHER PARTY IN
|
||||
// THE MANNER AUTHORIZED BY APPLICABLE LAW OR COURT RULE.
|
||||
//
|
||||
// USE ONLY IN JAPAN. DO NOT USE IT IN OTHER COUNTRIES. IMPORTING THIS
|
||||
// SOFTWARE INTO OTHER COUNTRIES IS AT YOUR OWN RISK. SOME COUNTRIES
|
||||
// PROHIBIT ENCRYPTED COMMUNICATIONS. USING THIS SOFTWARE IN OTHER
|
||||
// COUNTRIES MIGHT BE RESTRICTED.
|
||||
//
|
||||
//
|
||||
// DEAR SECURITY EXPERTS
|
||||
// ---------------------
|
||||
//
|
||||
// If you find a bug or a security vulnerability please kindly inform us
|
||||
// about the problem immediately so that we can fix the security problem
|
||||
// to protect a lot of users around the world as soon as possible.
|
||||
//
|
||||
// Our e-mail address for security reports is:
|
||||
// softether-vpn-security [at] softether.org
|
||||
//
|
||||
// Please note that the above e-mail address is not a technical support
|
||||
// inquiry address. If you need technical assistance, please visit
|
||||
// http://www.softether.org/ and ask your question on the users forum.
|
||||
//
|
||||
// Thank you for your cooperation.
|
||||
|
||||
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Data;
|
||||
using System.Data.Sql;
|
||||
using System.Data.SqlClient;
|
||||
using System.Data.SqlTypes;
|
||||
using System.Text;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Cryptography;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
using System.IO;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Diagnostics;
|
||||
using System.Web.Mail;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Net.NetworkInformation;
|
||||
using System.Net.Mail;
|
||||
using System.Net.Mime;
|
||||
using CoreUtil;
|
||||
|
||||
#pragma warning disable 0618
|
||||
|
||||
namespace CoreUtil
|
||||
{
|
||||
class WorkerQueuePrivate
|
||||
{
|
||||
object lockObj = new object();
|
||||
|
||||
List<ThreadObj> thread_list;
|
||||
ThreadProc thread_proc;
|
||||
int num_worker_threads;
|
||||
Queue<object> taskQueue = new Queue<object>();
|
||||
Exception raised_exception = null;
|
||||
|
||||
void worker_thread(object param)
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
object task = null;
|
||||
|
||||
lock (lockObj)
|
||||
{
|
||||
if (taskQueue.Count == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
task = taskQueue.Dequeue();
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
this.thread_proc(task);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (raised_exception == null)
|
||||
{
|
||||
raised_exception = ex;
|
||||
}
|
||||
|
||||
Console.WriteLine(ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public WorkerQueuePrivate(ThreadProc thread_proc, int num_worker_threads, object[] tasks)
|
||||
{
|
||||
thread_list = new List<ThreadObj>();
|
||||
int i;
|
||||
|
||||
this.thread_proc = thread_proc;
|
||||
this.num_worker_threads = num_worker_threads;
|
||||
|
||||
foreach (object task in tasks)
|
||||
{
|
||||
taskQueue.Enqueue(task);
|
||||
}
|
||||
|
||||
raised_exception = null;
|
||||
|
||||
for (i = 0; i < num_worker_threads; i++)
|
||||
{
|
||||
ThreadObj t = new ThreadObj(worker_thread);
|
||||
|
||||
thread_list.Add(t);
|
||||
}
|
||||
|
||||
foreach (ThreadObj t in thread_list)
|
||||
{
|
||||
t.WaitForEnd();
|
||||
}
|
||||
|
||||
if (raised_exception != null)
|
||||
{
|
||||
throw raised_exception;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class Tick64
|
||||
{
|
||||
static object lock_obj = new object();
|
||||
static uint last_value = 0;
|
||||
static bool is_first = true;
|
||||
static uint num_round = 0;
|
||||
|
||||
public static long Value
|
||||
{
|
||||
get
|
||||
{
|
||||
unchecked
|
||||
{
|
||||
lock (lock_obj)
|
||||
{
|
||||
uint current_value = (uint)(System.Environment.TickCount + 3864700935);
|
||||
|
||||
if (is_first)
|
||||
{
|
||||
last_value = current_value;
|
||||
is_first = false;
|
||||
}
|
||||
|
||||
if (last_value > current_value)
|
||||
{
|
||||
num_round++;
|
||||
}
|
||||
|
||||
last_value = current_value;
|
||||
|
||||
ulong ret = 4294967296UL * (ulong)num_round + current_value;
|
||||
|
||||
return (long)ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static uint ValueUInt32
|
||||
{
|
||||
get
|
||||
{
|
||||
unchecked
|
||||
{
|
||||
return (uint)((ulong)Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class Event
|
||||
{
|
||||
EventWaitHandle h;
|
||||
public const int Infinite = Timeout.Infinite;
|
||||
|
||||
public Event()
|
||||
{
|
||||
init(false);
|
||||
}
|
||||
|
||||
public Event(bool manualReset)
|
||||
{
|
||||
init(manualReset);
|
||||
}
|
||||
|
||||
void init(bool manualReset)
|
||||
{
|
||||
h = new EventWaitHandle(false, (manualReset ? EventResetMode.ManualReset : EventResetMode.AutoReset));
|
||||
}
|
||||
|
||||
public void Set()
|
||||
{
|
||||
h.Set();
|
||||
}
|
||||
|
||||
public bool Wait()
|
||||
{
|
||||
return Wait(Infinite);
|
||||
}
|
||||
public bool Wait(int millisecs)
|
||||
{
|
||||
return h.WaitOne(millisecs, false);
|
||||
}
|
||||
|
||||
static EventWaitHandle[] toArray(Event[] events)
|
||||
{
|
||||
List<EventWaitHandle> list = new List<EventWaitHandle>();
|
||||
|
||||
foreach (Event e in events)
|
||||
{
|
||||
list.Add(e.h);
|
||||
}
|
||||
|
||||
return list.ToArray();
|
||||
}
|
||||
|
||||
public static bool WaitAll(Event[] events)
|
||||
{
|
||||
return WaitAll(events, Infinite);
|
||||
}
|
||||
public static bool WaitAll(Event[] events, int millisecs)
|
||||
{
|
||||
if (events.Length <= 64)
|
||||
{
|
||||
return waitAllInner(events, millisecs);
|
||||
}
|
||||
else
|
||||
{
|
||||
return waitAllMulti(events, millisecs);
|
||||
}
|
||||
}
|
||||
|
||||
static bool waitAllMulti(Event[] events, int millisecs)
|
||||
{
|
||||
int numBlocks = (events.Length + 63) / 64;
|
||||
List<Event>[] list = new List<Event>[numBlocks];
|
||||
int i;
|
||||
for (i = 0; i < numBlocks; i++)
|
||||
{
|
||||
list[i] = new List<Event>();
|
||||
}
|
||||
for (i = 0; i < events.Length; i++)
|
||||
{
|
||||
list[i / 64].Add(events[i]);
|
||||
}
|
||||
|
||||
double start = Time.NowDouble;
|
||||
double giveup = start + (double)millisecs / 1000.0;
|
||||
foreach (List<Event> o in list)
|
||||
{
|
||||
double now = Time.NowDouble;
|
||||
if (now <= giveup || millisecs < 0)
|
||||
{
|
||||
int waitmsecs;
|
||||
if (millisecs >= 0)
|
||||
{
|
||||
waitmsecs = (int)((giveup - now) * 1000.0);
|
||||
}
|
||||
else
|
||||
{
|
||||
waitmsecs = Timeout.Infinite;
|
||||
}
|
||||
|
||||
bool ret = waitAllInner(o.ToArray(), waitmsecs);
|
||||
if (ret == false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool waitAllInner(Event[] events, int millisecs)
|
||||
{
|
||||
if (events.Length == 1)
|
||||
{
|
||||
return events[0].Wait(millisecs);
|
||||
}
|
||||
return EventWaitHandle.WaitAll(toArray(events), millisecs, false);
|
||||
}
|
||||
|
||||
public static bool WaitAny(Event[] events)
|
||||
{
|
||||
return WaitAny(events, Infinite);
|
||||
}
|
||||
public static bool WaitAny(Event[] events, int millisecs)
|
||||
{
|
||||
if (events.Length == 1)
|
||||
{
|
||||
return events[0].Wait(millisecs);
|
||||
}
|
||||
return ((WaitHandle.WaitTimeout == EventWaitHandle.WaitAny(toArray(events), millisecs, false)) ? false : true);
|
||||
}
|
||||
|
||||
public IntPtr Handle
|
||||
{
|
||||
get
|
||||
{
|
||||
return h.Handle;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class ThreadData
|
||||
{
|
||||
static LocalDataStoreSlot slot = Thread.AllocateDataSlot();
|
||||
|
||||
public readonly SortedDictionary<string, object> DataList = new SortedDictionary<string, object>();
|
||||
|
||||
public static ThreadData CurrentThreadData
|
||||
{
|
||||
get
|
||||
{
|
||||
return GetCurrentThreadData();
|
||||
}
|
||||
}
|
||||
|
||||
public static ThreadData GetCurrentThreadData()
|
||||
{
|
||||
ThreadData t;
|
||||
|
||||
try
|
||||
{
|
||||
t = (ThreadData)Thread.GetData(slot);
|
||||
}
|
||||
catch
|
||||
{
|
||||
t = null;
|
||||
}
|
||||
|
||||
if (t == null)
|
||||
{
|
||||
t = new ThreadData();
|
||||
|
||||
Thread.SetData(slot, t);
|
||||
}
|
||||
|
||||
return t;
|
||||
}
|
||||
}
|
||||
|
||||
public delegate void ThreadProc(object userObject);
|
||||
|
||||
public class ThreadObj
|
||||
{
|
||||
static int defaultStackSize = 100000;
|
||||
|
||||
static LocalDataStoreSlot currentObjSlot = Thread.AllocateDataSlot();
|
||||
|
||||
public const int Infinite = Timeout.Infinite;
|
||||
|
||||
ThreadProc proc;
|
||||
Thread thread;
|
||||
EventWaitHandle waitInit;
|
||||
EventWaitHandle waitEnd;
|
||||
EventWaitHandle waitInitForUser;
|
||||
public Thread Thread
|
||||
{
|
||||
get { return thread; }
|
||||
}
|
||||
object userObject;
|
||||
|
||||
public ThreadObj(ThreadProc threadProc)
|
||||
{
|
||||
init(threadProc, null, 0);
|
||||
}
|
||||
|
||||
public ThreadObj(ThreadProc threadProc, int stacksize)
|
||||
{
|
||||
init(threadProc, null, stacksize);
|
||||
}
|
||||
|
||||
public ThreadObj(ThreadProc threadProc, object userObject)
|
||||
{
|
||||
init(threadProc, userObject, 0);
|
||||
}
|
||||
|
||||
public ThreadObj(ThreadProc threadProc, object userObject, int stacksize)
|
||||
{
|
||||
init(threadProc, userObject, stacksize);
|
||||
}
|
||||
|
||||
void init(ThreadProc threadProc, object userObject, int stacksize)
|
||||
{
|
||||
if (stacksize == 0)
|
||||
{
|
||||
stacksize = defaultStackSize;
|
||||
}
|
||||
|
||||
this.proc = threadProc;
|
||||
this.userObject = userObject;
|
||||
waitInit = new EventWaitHandle(false, EventResetMode.AutoReset);
|
||||
waitEnd = new EventWaitHandle(false, EventResetMode.ManualReset);
|
||||
waitInitForUser = new EventWaitHandle(false, EventResetMode.ManualReset);
|
||||
this.thread = new Thread(new ParameterizedThreadStart(commonThreadProc), stacksize);
|
||||
this.thread.Start(this);
|
||||
waitInit.WaitOne();
|
||||
}
|
||||
|
||||
public static int DefaultStackSize
|
||||
{
|
||||
get
|
||||
{
|
||||
return defaultStackSize;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
defaultStackSize = value;
|
||||
}
|
||||
}
|
||||
|
||||
void commonThreadProc(object obj)
|
||||
{
|
||||
Thread.SetData(currentObjSlot, this);
|
||||
|
||||
waitInit.Set();
|
||||
|
||||
try
|
||||
{
|
||||
this.proc(this.userObject);
|
||||
}
|
||||
finally
|
||||
{
|
||||
waitEnd.Set();
|
||||
}
|
||||
}
|
||||
|
||||
public static ThreadObj GetCurrentThreadObj()
|
||||
{
|
||||
return (ThreadObj)Thread.GetData(currentObjSlot);
|
||||
}
|
||||
|
||||
public static void NoticeInited()
|
||||
{
|
||||
GetCurrentThreadObj().waitInitForUser.Set();
|
||||
}
|
||||
|
||||
public void WaitForInit()
|
||||
{
|
||||
waitInitForUser.WaitOne();
|
||||
}
|
||||
|
||||
public void WaitForEnd(int timeout)
|
||||
{
|
||||
waitEnd.WaitOne(timeout, false);
|
||||
}
|
||||
public void WaitForEnd()
|
||||
{
|
||||
waitEnd.WaitOne();
|
||||
}
|
||||
|
||||
public static void Sleep(int millisec)
|
||||
{
|
||||
if (millisec == 0x7fffffff)
|
||||
{
|
||||
millisec = ThreadObj.Infinite;
|
||||
}
|
||||
|
||||
Thread.Sleep(millisec);
|
||||
}
|
||||
|
||||
public static void Yield()
|
||||
{
|
||||
Thread.Sleep(0);
|
||||
}
|
||||
|
||||
public static void ProcessWorkQueue(ThreadProc thread_proc, int num_worker_threads, object[] tasks)
|
||||
{
|
||||
WorkerQueuePrivate q = new WorkerQueuePrivate(thread_proc, num_worker_threads, tasks);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
174
src/BuildUtil/CoreUtil/Time.cs
Normal file
174
src/BuildUtil/CoreUtil/Time.cs
Normal file
@ -0,0 +1,174 @@
|
||||
// CoreUtil
|
||||
//
|
||||
// Copyright (C) 2012-2014 Daiyuu Nobori. All Rights Reserved.
|
||||
// Copyright (C) 2012-2014 SoftEther VPN Project at University of Tsukuba. All Rights Reserved.
|
||||
// Comments: Tetsuo Sugiyama, Ph.D.
|
||||
//
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// version 2 as published by the Free Software Foundation.
|
||||
//
|
||||
// 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 version 2
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// THE LICENSE AGREEMENT IS ATTACHED ON THE SOURCE-CODE PACKAGE
|
||||
// AS "LICENSE.TXT" FILE. READ THE TEXT FILE IN ADVANCE TO USE THE SOFTWARE.
|
||||
//
|
||||
//
|
||||
// THIS SOFTWARE IS DEVELOPED IN JAPAN, AND DISTRIBUTED FROM JAPAN,
|
||||
// UNDER JAPANESE LAWS. YOU MUST AGREE IN ADVANCE TO USE, COPY, MODIFY,
|
||||
// MERGE, PUBLISH, DISTRIBUTE, SUBLICENSE, AND/OR SELL COPIES OF THIS
|
||||
// SOFTWARE, THAT ANY JURIDICAL DISPUTES WHICH ARE CONCERNED TO THIS
|
||||
// SOFTWARE OR ITS CONTENTS, AGAINST US (SOFTETHER PROJECT, SOFTETHER
|
||||
// CORPORATION, DAIYUU NOBORI OR OTHER SUPPLIERS), OR ANY JURIDICAL
|
||||
// DISPUTES AGAINST US WHICH ARE CAUSED BY ANY KIND OF USING, COPYING,
|
||||
// MODIFYING, MERGING, PUBLISHING, DISTRIBUTING, SUBLICENSING, AND/OR
|
||||
// SELLING COPIES OF THIS SOFTWARE SHALL BE REGARDED AS BE CONSTRUED AND
|
||||
// CONTROLLED BY JAPANESE LAWS, AND YOU MUST FURTHER CONSENT TO
|
||||
// EXCLUSIVE JURISDICTION AND VENUE IN THE COURTS SITTING IN TOKYO,
|
||||
// JAPAN. YOU MUST WAIVE ALL DEFENSES OF LACK OF PERSONAL JURISDICTION
|
||||
// AND FORUM NON CONVENIENS. PROCESS MAY BE SERVED ON EITHER PARTY IN
|
||||
// THE MANNER AUTHORIZED BY APPLICABLE LAW OR COURT RULE.
|
||||
//
|
||||
// USE ONLY IN JAPAN. DO NOT USE IT IN OTHER COUNTRIES. IMPORTING THIS
|
||||
// SOFTWARE INTO OTHER COUNTRIES IS AT YOUR OWN RISK. SOME COUNTRIES
|
||||
// PROHIBIT ENCRYPTED COMMUNICATIONS. USING THIS SOFTWARE IN OTHER
|
||||
// COUNTRIES MIGHT BE RESTRICTED.
|
||||
//
|
||||
//
|
||||
// DEAR SECURITY EXPERTS
|
||||
// ---------------------
|
||||
//
|
||||
// If you find a bug or a security vulnerability please kindly inform us
|
||||
// about the problem immediately so that we can fix the security problem
|
||||
// to protect a lot of users around the world as soon as possible.
|
||||
//
|
||||
// Our e-mail address for security reports is:
|
||||
// softether-vpn-security [at] softether.org
|
||||
//
|
||||
// Please note that the above e-mail address is not a technical support
|
||||
// inquiry address. If you need technical assistance, please visit
|
||||
// http://www.softether.org/ and ask your question on the users forum.
|
||||
//
|
||||
// Thank you for your cooperation.
|
||||
|
||||
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Data;
|
||||
using System.Data.Sql;
|
||||
using System.Data.SqlClient;
|
||||
using System.Data.SqlTypes;
|
||||
using System.Text;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Cryptography;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
using System.IO;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Diagnostics;
|
||||
using System.Web.Mail;
|
||||
|
||||
namespace CoreUtil
|
||||
{
|
||||
class TimeHelper
|
||||
{
|
||||
internal Stopwatch Sw;
|
||||
internal long Freq;
|
||||
internal DateTime FirstDateTime;
|
||||
|
||||
public TimeHelper()
|
||||
{
|
||||
FirstDateTime = DateTime.Now;
|
||||
Sw = new Stopwatch();
|
||||
Sw.Start();
|
||||
Freq = Stopwatch.Frequency;
|
||||
}
|
||||
|
||||
public DateTime GetDateTime()
|
||||
{
|
||||
return FirstDateTime + this.Sw.Elapsed;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Time
|
||||
{
|
||||
static TimeHelper h = new TimeHelper();
|
||||
static TimeSpan baseTimeSpan = new TimeSpan(0, 0, 1);
|
||||
|
||||
static public TimeSpan NowTimeSpan
|
||||
{
|
||||
get
|
||||
{
|
||||
return h.Sw.Elapsed.Add(baseTimeSpan);
|
||||
}
|
||||
}
|
||||
|
||||
static public long NowLong100Usecs
|
||||
{
|
||||
get
|
||||
{
|
||||
return NowTimeSpan.Ticks;
|
||||
}
|
||||
}
|
||||
|
||||
static public long NowLongMillisecs
|
||||
{
|
||||
get
|
||||
{
|
||||
return NowLong100Usecs / 10000;
|
||||
}
|
||||
}
|
||||
|
||||
static public long Tick64
|
||||
{
|
||||
get
|
||||
{
|
||||
return NowLongMillisecs;
|
||||
}
|
||||
}
|
||||
|
||||
static public double NowDouble
|
||||
{
|
||||
get
|
||||
{
|
||||
return (double)NowLong100Usecs / (double)10000000.0;
|
||||
}
|
||||
}
|
||||
|
||||
static public DateTime NowDateTime
|
||||
{
|
||||
get
|
||||
{
|
||||
return h.GetDateTime();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
1034
src/BuildUtil/CoreUtil/Util.cs
Normal file
1034
src/BuildUtil/CoreUtil/Util.cs
Normal file
File diff suppressed because it is too large
Load Diff
303
src/BuildUtil/CoreUtil/Win32.cs
Normal file
303
src/BuildUtil/CoreUtil/Win32.cs
Normal file
@ -0,0 +1,303 @@
|
||||
// CoreUtil
|
||||
//
|
||||
// Copyright (C) 2012-2014 Daiyuu Nobori. All Rights Reserved.
|
||||
// Copyright (C) 2012-2014 SoftEther VPN Project at University of Tsukuba. All Rights Reserved.
|
||||
// Comments: Tetsuo Sugiyama, Ph.D.
|
||||
//
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// version 2 as published by the Free Software Foundation.
|
||||
//
|
||||
// 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 version 2
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// THE LICENSE AGREEMENT IS ATTACHED ON THE SOURCE-CODE PACKAGE
|
||||
// AS "LICENSE.TXT" FILE. READ THE TEXT FILE IN ADVANCE TO USE THE SOFTWARE.
|
||||
//
|
||||
//
|
||||
// THIS SOFTWARE IS DEVELOPED IN JAPAN, AND DISTRIBUTED FROM JAPAN,
|
||||
// UNDER JAPANESE LAWS. YOU MUST AGREE IN ADVANCE TO USE, COPY, MODIFY,
|
||||
// MERGE, PUBLISH, DISTRIBUTE, SUBLICENSE, AND/OR SELL COPIES OF THIS
|
||||
// SOFTWARE, THAT ANY JURIDICAL DISPUTES WHICH ARE CONCERNED TO THIS
|
||||
// SOFTWARE OR ITS CONTENTS, AGAINST US (SOFTETHER PROJECT, SOFTETHER
|
||||
// CORPORATION, DAIYUU NOBORI OR OTHER SUPPLIERS), OR ANY JURIDICAL
|
||||
// DISPUTES AGAINST US WHICH ARE CAUSED BY ANY KIND OF USING, COPYING,
|
||||
// MODIFYING, MERGING, PUBLISHING, DISTRIBUTING, SUBLICENSING, AND/OR
|
||||
// SELLING COPIES OF THIS SOFTWARE SHALL BE REGARDED AS BE CONSTRUED AND
|
||||
// CONTROLLED BY JAPANESE LAWS, AND YOU MUST FURTHER CONSENT TO
|
||||
// EXCLUSIVE JURISDICTION AND VENUE IN THE COURTS SITTING IN TOKYO,
|
||||
// JAPAN. YOU MUST WAIVE ALL DEFENSES OF LACK OF PERSONAL JURISDICTION
|
||||
// AND FORUM NON CONVENIENS. PROCESS MAY BE SERVED ON EITHER PARTY IN
|
||||
// THE MANNER AUTHORIZED BY APPLICABLE LAW OR COURT RULE.
|
||||
//
|
||||
// USE ONLY IN JAPAN. DO NOT USE IT IN OTHER COUNTRIES. IMPORTING THIS
|
||||
// SOFTWARE INTO OTHER COUNTRIES IS AT YOUR OWN RISK. SOME COUNTRIES
|
||||
// PROHIBIT ENCRYPTED COMMUNICATIONS. USING THIS SOFTWARE IN OTHER
|
||||
// COUNTRIES MIGHT BE RESTRICTED.
|
||||
//
|
||||
//
|
||||
// DEAR SECURITY EXPERTS
|
||||
// ---------------------
|
||||
//
|
||||
// If you find a bug or a security vulnerability please kindly inform us
|
||||
// about the problem immediately so that we can fix the security problem
|
||||
// to protect a lot of users around the world as soon as possible.
|
||||
//
|
||||
// Our e-mail address for security reports is:
|
||||
// softether-vpn-security [at] softether.org
|
||||
//
|
||||
// Please note that the above e-mail address is not a technical support
|
||||
// inquiry address. If you need technical assistance, please visit
|
||||
// http://www.softether.org/ and ask your question on the users forum.
|
||||
//
|
||||
// Thank you for your cooperation.
|
||||
|
||||
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Data;
|
||||
using System.Data.Sql;
|
||||
using System.Data.SqlClient;
|
||||
using System.Data.SqlTypes;
|
||||
using System.Text;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Cryptography;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
using System.IO;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Web.Mail;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Xml.Serialization;
|
||||
using System.DirectoryServices;
|
||||
using CoreUtil;
|
||||
using CoreUtil.Internal;
|
||||
|
||||
namespace CoreUtil
|
||||
{
|
||||
public static class Win32
|
||||
{
|
||||
static Win32()
|
||||
{
|
||||
}
|
||||
|
||||
public static void CreateUser(string machineName, string userName, string password, string description)
|
||||
{
|
||||
Str.NormalizeString(ref userName);
|
||||
Str.NormalizeString(ref password);
|
||||
Str.NormalizeString(ref description);
|
||||
|
||||
using (DirectoryEntry sam = OpenSam(machineName))
|
||||
{
|
||||
using (DirectoryEntry newUser = sam.Children.Add(userName, "user"))
|
||||
{
|
||||
newUser.Invoke("SetPassword", new object[] { password });
|
||||
newUser.Invoke("Put", new object[] { "Description", description });
|
||||
newUser.CommitChanges();
|
||||
Console.WriteLine(newUser.Path);
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
AddUserToGroup(machineName, userName, "Users");
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public static void ChangeUserPassword(string machineName, string userName, string oldPassword, string newPassword)
|
||||
{
|
||||
Str.NormalizeString(ref userName);
|
||||
Str.NormalizeString(ref oldPassword);
|
||||
Str.NormalizeString(ref newPassword);
|
||||
|
||||
using (DirectoryEntry sam = OpenSam(machineName))
|
||||
{
|
||||
using (DirectoryEntry user = sam.Children.Find(userName, "user"))
|
||||
{
|
||||
user.Invoke("ChangePassword", oldPassword, newPassword);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void SetUserPassword(string machineName, string userName, string password)
|
||||
{
|
||||
Str.NormalizeString(ref userName);
|
||||
Str.NormalizeString(ref password);
|
||||
|
||||
using (DirectoryEntry sam = OpenSam(machineName))
|
||||
{
|
||||
using (DirectoryEntry user = sam.Children.Find(userName, "user"))
|
||||
{
|
||||
user.Invoke("SetPassword", password);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static string[] GetMembersOfGroup(string machineName, string groupName)
|
||||
{
|
||||
List<string> ret = new List<string>();
|
||||
|
||||
Str.NormalizeString(ref groupName);
|
||||
|
||||
using (DirectoryEntry sam = OpenSam(machineName))
|
||||
{
|
||||
using (DirectoryEntry g = sam.Children.Find(groupName, "group"))
|
||||
{
|
||||
object members = g.Invoke("Members", null);
|
||||
|
||||
foreach (object member in (IEnumerable)members)
|
||||
{
|
||||
using (DirectoryEntry e = new DirectoryEntry(member))
|
||||
{
|
||||
ret.Add(e.Name);
|
||||
}
|
||||
}
|
||||
|
||||
return ret.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsUserMemberOfGroup(string machineName, string userName, string groupName)
|
||||
{
|
||||
Str.NormalizeString(ref userName);
|
||||
Str.NormalizeString(ref groupName);
|
||||
|
||||
using (DirectoryEntry sam = OpenSam(machineName))
|
||||
{
|
||||
using (DirectoryEntry g = sam.Children.Find(groupName, "group"))
|
||||
{
|
||||
using (DirectoryEntry u = sam.Children.Find(userName, "user"))
|
||||
{
|
||||
return (bool)g.Invoke("IsMember", u.Path);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void DeleteUserFromGroup(string machineName, string userName, string groupName)
|
||||
{
|
||||
Str.NormalizeString(ref userName);
|
||||
Str.NormalizeString(ref groupName);
|
||||
|
||||
using (DirectoryEntry sam = OpenSam(machineName))
|
||||
{
|
||||
using (DirectoryEntry g = sam.Children.Find(groupName, "group"))
|
||||
{
|
||||
using (DirectoryEntry u = sam.Children.Find(userName, "user"))
|
||||
{
|
||||
g.Invoke("Remove", u.Path);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void AddUserToGroup(string machineName, string userName, string groupName)
|
||||
{
|
||||
Str.NormalizeString(ref userName);
|
||||
Str.NormalizeString(ref groupName);
|
||||
|
||||
using (DirectoryEntry sam = OpenSam(machineName))
|
||||
{
|
||||
using (DirectoryEntry g = sam.Children.Find(groupName, "group"))
|
||||
{
|
||||
using (DirectoryEntry u = sam.Children.Find(userName, "user"))
|
||||
{
|
||||
g.Invoke("Add", u.Path);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void DeleteUser(string machineName, string userName)
|
||||
{
|
||||
Str.NormalizeString(ref userName);
|
||||
|
||||
using (DirectoryEntry sam = OpenSam(machineName))
|
||||
{
|
||||
using (DirectoryEntry u = sam.Children.Find(userName, "user"))
|
||||
{
|
||||
sam.Children.Remove(u);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsUserExists(string machineName, string userName)
|
||||
{
|
||||
Str.NormalizeString(ref userName);
|
||||
|
||||
using (DirectoryEntry sam = OpenSam(machineName))
|
||||
{
|
||||
try
|
||||
{
|
||||
using (DirectoryEntry user = sam.Children.Find(userName, "user"))
|
||||
{
|
||||
if (user == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
catch (COMException ce)
|
||||
{
|
||||
if ((uint)ce.ErrorCode == 0x800708AD)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static DirectoryEntry OpenSam()
|
||||
{
|
||||
return OpenSam(null);
|
||||
}
|
||||
public static DirectoryEntry OpenSam(string machineName)
|
||||
{
|
||||
if (Str.IsEmptyStr(machineName))
|
||||
{
|
||||
machineName = Env.MachineName;
|
||||
}
|
||||
|
||||
return new DirectoryEntry(string.Format("WinNT://{0},computer",
|
||||
machineName));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
5609
src/BuildUtil/CoreUtil/ZLib.cs
Normal file
5609
src/BuildUtil/CoreUtil/ZLib.cs
Normal file
File diff suppressed because it is too large
Load Diff
482
src/BuildUtil/CoreUtil/Zip.cs
Normal file
482
src/BuildUtil/CoreUtil/Zip.cs
Normal file
@ -0,0 +1,482 @@
|
||||
// CoreUtil
|
||||
//
|
||||
// Copyright (C) 2012-2014 Daiyuu Nobori. All Rights Reserved.
|
||||
// Copyright (C) 2012-2014 SoftEther VPN Project at University of Tsukuba. All Rights Reserved.
|
||||
// Comments: Tetsuo Sugiyama, Ph.D.
|
||||
//
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// version 2 as published by the Free Software Foundation.
|
||||
//
|
||||
// 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 version 2
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// THE LICENSE AGREEMENT IS ATTACHED ON THE SOURCE-CODE PACKAGE
|
||||
// AS "LICENSE.TXT" FILE. READ THE TEXT FILE IN ADVANCE TO USE THE SOFTWARE.
|
||||
//
|
||||
//
|
||||
// THIS SOFTWARE IS DEVELOPED IN JAPAN, AND DISTRIBUTED FROM JAPAN,
|
||||
// UNDER JAPANESE LAWS. YOU MUST AGREE IN ADVANCE TO USE, COPY, MODIFY,
|
||||
// MERGE, PUBLISH, DISTRIBUTE, SUBLICENSE, AND/OR SELL COPIES OF THIS
|
||||
// SOFTWARE, THAT ANY JURIDICAL DISPUTES WHICH ARE CONCERNED TO THIS
|
||||
// SOFTWARE OR ITS CONTENTS, AGAINST US (SOFTETHER PROJECT, SOFTETHER
|
||||
// CORPORATION, DAIYUU NOBORI OR OTHER SUPPLIERS), OR ANY JURIDICAL
|
||||
// DISPUTES AGAINST US WHICH ARE CAUSED BY ANY KIND OF USING, COPYING,
|
||||
// MODIFYING, MERGING, PUBLISHING, DISTRIBUTING, SUBLICENSING, AND/OR
|
||||
// SELLING COPIES OF THIS SOFTWARE SHALL BE REGARDED AS BE CONSTRUED AND
|
||||
// CONTROLLED BY JAPANESE LAWS, AND YOU MUST FURTHER CONSENT TO
|
||||
// EXCLUSIVE JURISDICTION AND VENUE IN THE COURTS SITTING IN TOKYO,
|
||||
// JAPAN. YOU MUST WAIVE ALL DEFENSES OF LACK OF PERSONAL JURISDICTION
|
||||
// AND FORUM NON CONVENIENS. PROCESS MAY BE SERVED ON EITHER PARTY IN
|
||||
// THE MANNER AUTHORIZED BY APPLICABLE LAW OR COURT RULE.
|
||||
//
|
||||
// USE ONLY IN JAPAN. DO NOT USE IT IN OTHER COUNTRIES. IMPORTING THIS
|
||||
// SOFTWARE INTO OTHER COUNTRIES IS AT YOUR OWN RISK. SOME COUNTRIES
|
||||
// PROHIBIT ENCRYPTED COMMUNICATIONS. USING THIS SOFTWARE IN OTHER
|
||||
// COUNTRIES MIGHT BE RESTRICTED.
|
||||
//
|
||||
//
|
||||
// DEAR SECURITY EXPERTS
|
||||
// ---------------------
|
||||
//
|
||||
// If you find a bug or a security vulnerability please kindly inform us
|
||||
// about the problem immediately so that we can fix the security problem
|
||||
// to protect a lot of users around the world as soon as possible.
|
||||
//
|
||||
// Our e-mail address for security reports is:
|
||||
// softether-vpn-security [at] softether.org
|
||||
//
|
||||
// Please note that the above e-mail address is not a technical support
|
||||
// inquiry address. If you need technical assistance, please visit
|
||||
// http://www.softether.org/ and ask your question on the users forum.
|
||||
//
|
||||
// Thank you for your cooperation.
|
||||
|
||||
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Data;
|
||||
using System.Data.Sql;
|
||||
using System.Data.SqlClient;
|
||||
using System.Data.SqlTypes;
|
||||
using System.Text;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Cryptography;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
using System.IO;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace CoreUtil
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
public struct ZipDataHeader
|
||||
{
|
||||
public uint Signature;
|
||||
public ushort NeedVer;
|
||||
public ushort Option;
|
||||
public ushort CompType;
|
||||
public ushort FileTime;
|
||||
public ushort FileDate;
|
||||
public uint Crc32;
|
||||
public uint CompSize;
|
||||
public uint UncompSize;
|
||||
public ushort FileNameLen;
|
||||
public ushort ExtraLen;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
public struct ZipDataFooter
|
||||
{
|
||||
public uint Signature;
|
||||
public uint Crc32;
|
||||
public uint CompSize;
|
||||
public uint UncompSize;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
public struct ZipDirHeader
|
||||
{
|
||||
public uint Signature;
|
||||
public ushort MadeVer;
|
||||
public ushort NeedVer;
|
||||
public ushort Option;
|
||||
public ushort CompType;
|
||||
public ushort FileTime;
|
||||
public ushort FileDate;
|
||||
public uint Crc32;
|
||||
public uint CompSize;
|
||||
public uint UncompSize;
|
||||
public ushort FileNameLen;
|
||||
public ushort ExtraLen;
|
||||
public ushort CommentLen;
|
||||
public ushort DiskNum;
|
||||
public ushort InAttr;
|
||||
public uint OutAttr;
|
||||
public uint HeaderPos;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
public struct ZipEndHeader
|
||||
{
|
||||
public uint Signature;
|
||||
public ushort DiskNum;
|
||||
public ushort StartDiskNum;
|
||||
public ushort DiskDirEntry;
|
||||
public ushort DirEntry;
|
||||
public uint DirSize;
|
||||
public uint StartPos;
|
||||
public ushort CommentLen;
|
||||
}
|
||||
|
||||
public static class ZipUtil
|
||||
{
|
||||
static ZipUtil()
|
||||
{
|
||||
initCrc32();
|
||||
}
|
||||
|
||||
static uint[] table;
|
||||
const int crcTableSize = 256;
|
||||
|
||||
static void initCrc32()
|
||||
{
|
||||
table = new uint[crcTableSize];
|
||||
|
||||
uint poly = 0xEDB88320;
|
||||
uint u, i, j;
|
||||
|
||||
for (i = 0; i < 256; i++)
|
||||
{
|
||||
u = i;
|
||||
|
||||
for (j = 0; j < 8; j++)
|
||||
{
|
||||
if ((u & 0x1) != 0)
|
||||
{
|
||||
u = (u >> 1) ^ poly;
|
||||
}
|
||||
else
|
||||
{
|
||||
u >>= 1;
|
||||
}
|
||||
}
|
||||
|
||||
table[i] = u;
|
||||
}
|
||||
}
|
||||
|
||||
public static uint Crc32(byte[] buf)
|
||||
{
|
||||
return Crc32(buf, 0, buf.Length);
|
||||
}
|
||||
public static uint Crc32(byte[] buf, int pos, int len)
|
||||
{
|
||||
return Crc32Finish(Crc32First(buf, pos, len));
|
||||
}
|
||||
public static uint Crc32First(byte[] buf, int pos, int len)
|
||||
{
|
||||
return Crc32Next(buf, pos, len, 0xffffffff);
|
||||
}
|
||||
public static uint Crc32Next(byte[] buf, int pos, int len, uint lastCrc32)
|
||||
{
|
||||
uint ret = lastCrc32;
|
||||
for (uint i = 0; i < len; i++)
|
||||
{
|
||||
ret = (ret >> 8) ^ table[buf[pos + i] ^ (ret & 0xff)];
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
public static uint Crc32Finish(uint lastCrc32)
|
||||
{
|
||||
return ~lastCrc32;
|
||||
}
|
||||
}
|
||||
|
||||
public class ZipPacker
|
||||
{
|
||||
public const uint Signature = 0x04034B50;
|
||||
public const uint SignatureEnd = 0x06054B50;
|
||||
public const ushort Version = 10;
|
||||
public const ushort VersionWithCompress = 20;
|
||||
public Encoding Encoding = Str.ShiftJisEncoding;
|
||||
|
||||
class File
|
||||
{
|
||||
public string Name;
|
||||
public long Size;
|
||||
public DateTime DateTime;
|
||||
public FileAttributes Attributes;
|
||||
public long CurrentSize;
|
||||
public long CompressSize;
|
||||
public uint Crc32;
|
||||
public uint HeaderPos;
|
||||
public Encoding Encoding;
|
||||
public bool Compress;
|
||||
public CoreUtil.Internal.ZStream ZStream;
|
||||
|
||||
public void WriteZipDataHeader(ref ZipDataHeader h, bool writeSizes)
|
||||
{
|
||||
h.Signature = Signature;
|
||||
h.NeedVer = Version;
|
||||
h.CompType = 0;
|
||||
h.FileTime = Util.DateTimeToDosTime(this.DateTime);
|
||||
h.FileDate = Util.DateTimeToDosDate(this.DateTime);
|
||||
h.Option = 8;
|
||||
|
||||
if (writeSizes == false)
|
||||
{
|
||||
h.CompSize = h.UncompSize = 0;
|
||||
h.Crc32 = 0;
|
||||
|
||||
if (this.Compress)
|
||||
{
|
||||
h.NeedVer = VersionWithCompress;
|
||||
h.CompType = 8;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
h.CompSize = h.UncompSize = (uint)this.Size;
|
||||
if (this.Compress)
|
||||
{
|
||||
h.CompSize = (uint)this.CompressSize;
|
||||
h.CompType = 8;
|
||||
}
|
||||
h.Crc32 = this.Crc32;
|
||||
}
|
||||
|
||||
h.FileNameLen = (ushort)this.Encoding.GetByteCount(this.Name);
|
||||
h.ExtraLen = 0;
|
||||
}
|
||||
|
||||
public void WriteZipDataFooter(ref ZipDataFooter h)
|
||||
{
|
||||
h.Signature = 0x08074B50;
|
||||
|
||||
if (this.Compress == false)
|
||||
{
|
||||
h.CompSize = h.UncompSize = (uint)this.Size;
|
||||
}
|
||||
else
|
||||
{
|
||||
h.CompSize = (uint)this.CompressSize;
|
||||
h.UncompSize = (uint)this.Size;
|
||||
}
|
||||
h.Crc32 = this.Crc32;
|
||||
}
|
||||
}
|
||||
|
||||
Fifo fifo;
|
||||
List<File> fileList;
|
||||
|
||||
public Fifo GeneratedData
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.fifo;
|
||||
}
|
||||
}
|
||||
|
||||
public ZipPacker()
|
||||
{
|
||||
fifo = new Fifo();
|
||||
fileList = new List<File>();
|
||||
}
|
||||
|
||||
File currentFile = null;
|
||||
|
||||
public void AddFileSimple(string name, DateTime dt, FileAttributes attribute, byte[] data)
|
||||
{
|
||||
AddFileSimple(name, dt, attribute, data, false);
|
||||
}
|
||||
public void AddFileSimple(string name, DateTime dt, FileAttributes attribute, byte[] data, bool compress)
|
||||
{
|
||||
AddFileStart(name, data.Length, dt, attribute, compress);
|
||||
AddFileData(data, 0, data.Length);
|
||||
}
|
||||
|
||||
public void AddFileStart(string name, long size, DateTime dt, FileAttributes attribute)
|
||||
{
|
||||
AddFileStart(name, size, dt, attribute, false);
|
||||
}
|
||||
public void AddFileStart(string name, long size, DateTime dt, FileAttributes attribute, bool compress)
|
||||
{
|
||||
if (currentFile != null)
|
||||
{
|
||||
throw new ApplicationException("currentFile != null");
|
||||
}
|
||||
|
||||
name = name.Replace("/", "\\");
|
||||
|
||||
File f = new File();
|
||||
|
||||
f.Encoding = this.Encoding;
|
||||
f.Name = name;
|
||||
f.Size = size;
|
||||
f.DateTime = dt;
|
||||
f.Attributes = attribute;
|
||||
f.Compress = compress;
|
||||
|
||||
this.fileList.Add(f);
|
||||
|
||||
ZipDataHeader h = new ZipDataHeader();
|
||||
f.HeaderPos = (uint)fifo.TotalWriteSize;
|
||||
f.WriteZipDataHeader(ref h, false);
|
||||
fifo.Write(Util.StructToByte(h));
|
||||
fifo.Write(this.Encoding.GetBytes(f.Name));
|
||||
f.Crc32 = 0xffffffff;
|
||||
|
||||
if (compress)
|
||||
{
|
||||
f.ZStream = new CoreUtil.Internal.ZStream();
|
||||
f.ZStream.deflateInit(-1, -15);
|
||||
}
|
||||
|
||||
currentFile = f;
|
||||
}
|
||||
|
||||
public long AddFileData(byte[] data, int pos, int len)
|
||||
{
|
||||
long totalSize = currentFile.CurrentSize + len;
|
||||
|
||||
if (totalSize > currentFile.Size)
|
||||
{
|
||||
throw new ApplicationException("totalSize > currentFile.Size");
|
||||
}
|
||||
|
||||
if (currentFile.Compress == false)
|
||||
{
|
||||
fifo.Write(data, pos, len);
|
||||
}
|
||||
else
|
||||
{
|
||||
CoreUtil.Internal.ZStream zs = currentFile.ZStream;
|
||||
|
||||
byte[] srcData = Util.ExtractByteArray(data, pos, len);
|
||||
byte[] dstData = new byte[srcData.Length * 2 + 100];
|
||||
|
||||
zs.next_in = srcData;
|
||||
zs.avail_in = srcData.Length;
|
||||
zs.next_in_index = 0;
|
||||
|
||||
zs.next_out = dstData;
|
||||
zs.avail_out = dstData.Length;
|
||||
zs.next_out_index = 0;
|
||||
|
||||
if (currentFile.Size == (currentFile.CurrentSize + len))
|
||||
{
|
||||
zs.deflate(CoreUtil.Internal.zlibConst.Z_FINISH);
|
||||
}
|
||||
else
|
||||
{
|
||||
zs.deflate(CoreUtil.Internal.zlibConst.Z_SYNC_FLUSH);
|
||||
}
|
||||
|
||||
fifo.Write(dstData, 0, dstData.Length - zs.avail_out);
|
||||
|
||||
currentFile.CompressSize += dstData.Length - zs.avail_out;
|
||||
|
||||
Util.NoOP();
|
||||
}
|
||||
|
||||
currentFile.CurrentSize += len;
|
||||
|
||||
currentFile.Crc32 = ZipUtil.Crc32Next(data, pos, len, currentFile.Crc32);
|
||||
|
||||
long ret = currentFile.Size - currentFile.CurrentSize;
|
||||
|
||||
if (ret == 0)
|
||||
{
|
||||
currentFile.Crc32 = ~currentFile.Crc32;
|
||||
addFileFooter();
|
||||
|
||||
currentFile = null;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void addFileFooter()
|
||||
{
|
||||
ZipDataFooter f = new ZipDataFooter();
|
||||
currentFile.WriteZipDataFooter(ref f);
|
||||
fifo.Write(Util.StructToByte(f));
|
||||
}
|
||||
|
||||
public void Finish()
|
||||
{
|
||||
long posStart = fifo.TotalWriteSize;
|
||||
foreach (File f in this.fileList)
|
||||
{
|
||||
ZipDirHeader d = new ZipDirHeader();
|
||||
d.Signature = 0x02014B50;// ZipPacker.Signature;
|
||||
d.MadeVer = Version;
|
||||
ZipDataHeader dh = new ZipDataHeader();
|
||||
f.WriteZipDataHeader(ref dh, true);
|
||||
if (f.Compress)
|
||||
{
|
||||
dh.CompType = 8;
|
||||
dh.CompSize = (uint)f.CompressSize;
|
||||
dh.NeedVer = ZipPacker.VersionWithCompress;
|
||||
}
|
||||
d.NeedVer = dh.NeedVer;
|
||||
d.Option = dh.Option;
|
||||
d.CompType = dh.CompType;
|
||||
d.FileTime = dh.FileTime;
|
||||
d.FileDate = dh.FileDate;
|
||||
d.Crc32 = dh.Crc32;
|
||||
d.CompSize = dh.CompSize;
|
||||
d.UncompSize = dh.UncompSize;
|
||||
d.FileNameLen = dh.FileNameLen;
|
||||
d.ExtraLen = dh.ExtraLen;
|
||||
d.CommentLen = 0;
|
||||
d.DiskNum = 0;
|
||||
d.InAttr = 0;
|
||||
d.OutAttr = (ushort)f.Attributes;
|
||||
d.HeaderPos = f.HeaderPos;
|
||||
|
||||
fifo.Write(Util.StructToByte(d));
|
||||
fifo.Write(this.Encoding.GetBytes(f.Name));
|
||||
}
|
||||
long posEnd = fifo.TotalWriteSize;
|
||||
|
||||
ZipEndHeader e = new ZipEndHeader();
|
||||
e.Signature = ZipPacker.SignatureEnd;
|
||||
e.DiskNum = e.StartDiskNum = 0;
|
||||
e.DiskDirEntry = e.DirEntry = (ushort)this.fileList.Count;
|
||||
e.DirSize = (uint)(posEnd - posStart);
|
||||
e.StartPos = (uint)posStart;
|
||||
e.CommentLen = 0;
|
||||
fifo.Write(Util.StructToByte(e));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
1049
src/BuildUtil/Properties/Resources.Designer.cs
generated
Normal file
1049
src/BuildUtil/Properties/Resources.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
431
src/BuildUtil/Properties/Resources.resx
Normal file
431
src/BuildUtil/Properties/Resources.resx
Normal file
@ -0,0 +1,431 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="CDF_BUTTON_ADD" xml:space="preserve">
|
||||
<value>[j]追加[e]Add[/]</value>
|
||||
</data>
|
||||
<data name="CDF_BUTTON_CANCEL" xml:space="preserve">
|
||||
<value> [j]キャンセル[e]Cancel[/] </value>
|
||||
</data>
|
||||
<data name="CDF_BUTTON_COMPLETE" xml:space="preserve">
|
||||
<value> [j]完 了[e]Complete[/] </value>
|
||||
</data>
|
||||
<data name="CDF_BUTTON_DELETE" xml:space="preserve">
|
||||
<value>[j]削除[e]Delete[/]</value>
|
||||
</data>
|
||||
<data name="CDF_BUTTON_EDIT" xml:space="preserve">
|
||||
<value>[j]編集[e]Edit[/]</value>
|
||||
</data>
|
||||
<data name="CDF_BUTTON_MODIFY" xml:space="preserve">
|
||||
<value> [j]修正する[e]Modify[/] </value>
|
||||
</data>
|
||||
<data name="CDF_BUTTON_OK" xml:space="preserve">
|
||||
<value> O K </value>
|
||||
</data>
|
||||
<data name="CDF_BUTTON_SENDING" xml:space="preserve">
|
||||
<value> [j]処理中[e]Wait[/]...</value>
|
||||
</data>
|
||||
<data name="CDF_CANDIDATES" xml:space="preserve">
|
||||
<value> [j]最近の候補[e]Recent Candidates[/]: </value>
|
||||
</data>
|
||||
<data name="CDF_DATE_EMPTY" xml:space="preserve">
|
||||
<value>[j]日付が入力されていません。[e]Date field is empty.[/]</value>
|
||||
</data>
|
||||
<data name="CDF_DATE_MAX" xml:space="preserve">
|
||||
<value>[j]{0} 以前の日付を指定してください。[e]Please specify a date before {0}.[/]</value>
|
||||
</data>
|
||||
<data name="CDF_DATE_MIN" xml:space="preserve">
|
||||
<value>[j]{0} 以降の日付を指定してください。[e]Please specift a date since {0}.[/]</value>
|
||||
</data>
|
||||
<data name="CDF_DATE_NOTDATE" xml:space="preserve">
|
||||
<value>[j]日付として認識できない文字列が入力されています。[e]Can't recognize as a valid date.[/]</value>
|
||||
</data>
|
||||
<data name="CDF_DL_ALL" xml:space="preserve">
|
||||
<value>[j]全件表示 ({0} 件)[e]Total ({0} entities)[/]</value>
|
||||
</data>
|
||||
<data name="CDF_DOWNLOAD" xml:space="preserve">
|
||||
<value>[j]ダウンロード[e]Download[/]</value>
|
||||
</data>
|
||||
<data name="CDF_DT_EMPTY" xml:space="preserve">
|
||||
<value>[j]日時が入力されていません。[e]Date and Time are empty.[/]</value>
|
||||
</data>
|
||||
<data name="CDF_DT_MAX" xml:space="preserve">
|
||||
<value>[j]{0} 以前の日時を指定してください。[e]Please specify a date and a time before {0}.[/]</value>
|
||||
</data>
|
||||
<data name="CDF_DT_MIN" xml:space="preserve">
|
||||
<value>[j]{0} 以降の日時を指定してください。[e]Please specify a date and a time since {0}.[/]</value>
|
||||
</data>
|
||||
<data name="CDF_DT_NOTDT" xml:space="preserve">
|
||||
<value>[j]日時として認識できない文字列が入力されています。[e]Can't recognize as a valid date and a time.[/]</value>
|
||||
</data>
|
||||
<data name="CDF_EXAMPLE" xml:space="preserve">
|
||||
<value>[j]記入例[e]Example[/]</value>
|
||||
</data>
|
||||
<data name="CDF_GOTHIC" xml:space="preserve">
|
||||
<value>[j]MS ゴシック[e]MS Gothic[/]</value>
|
||||
</data>
|
||||
<data name="CDF_GRID_ERROR_1" xml:space="preserve">
|
||||
<value>[j]データ構造のフィールド数が 1 でありません。[e]The number of fields of data structures is not one.[/]</value>
|
||||
</data>
|
||||
<data name="CDF_GRID_ERROR_2" xml:space="preserve">
|
||||
<value>[j]データ構造がリストでありません。[e]The data structure is not a list.[/]</value>
|
||||
</data>
|
||||
<data name="CDF_INT_MAX" xml:space="preserve">
|
||||
<value>[j]数値は {0} 以下を指定してください。[e]The value must be {0} or less.[/]</value>
|
||||
</data>
|
||||
<data name="CDF_INT_MIN" xml:space="preserve">
|
||||
<value>[j]数値は {0} 以上を指定してください。[e]The value must be {0} or more.[/]</value>
|
||||
</data>
|
||||
<data name="CDF_INT_NOTINTEGER" xml:space="preserve">
|
||||
<value>[j]数値が正しく入力されていません。[e]The value can't be recognized as a formal figure.[/]</value>
|
||||
</data>
|
||||
<data name="CDF_INT_NOT_NUMBER_CHAR" xml:space="preserve">
|
||||
<value>[j]整数以外の文字が入力されています。[e]The value can't be recognized as an integer.[/]</value>
|
||||
</data>
|
||||
<data name="CDF_INVALID" xml:space="preserve">
|
||||
<value>[j]データ "{0}" はこのリストでは不正です。[e]The data "{0}" is invalid at this list.[/]</value>
|
||||
</data>
|
||||
<data name="CDF_INVALID_EMAIL" xml:space="preserve">
|
||||
<value>[j]メールアドレスが不正です。[e]The mail address is invalid.[/]</value>
|
||||
</data>
|
||||
<data name="CDF_LIST_FORMAT" xml:space="preserve">
|
||||
<value>[j]【 {0} 個目の項目 (合計 {1} 個中) - {2} 】[e]Item of piece {0} (Total: {1} entities) - {2}[/]</value>
|
||||
</data>
|
||||
<data name="CDF_NOITEM" xml:space="preserve">
|
||||
<value>[j]項目なし[e]No Entities[/]</value>
|
||||
</data>
|
||||
<data name="CDF_NOT_SELECTED" xml:space="preserve">
|
||||
<value>[j]項目が選択されていません。[e]You have to select an entity.[/]</value>
|
||||
</data>
|
||||
<data name="CDF_NOT_SELECTED_2" xml:space="preserve">
|
||||
<value>[j]正しく選択されていません。[e]You have to select correctly.[/]</value>
|
||||
</data>
|
||||
<data name="CDF_NO_CDFCLASS" xml:space="preserve">
|
||||
<value>CdfClass 属性が正しく指定されていないクラス %s が指定されました。</value>
|
||||
</data>
|
||||
<data name="CDF_NO_SINGLE_ATT" xml:space="preserve">
|
||||
<value>%s 項目に %s 属性が 1 つ指定されていません。</value>
|
||||
</data>
|
||||
<data name="CDF_NO_SINGLE_GENERIC_TYPE" xml:space="preserve">
|
||||
<value>%s 項目のジェネリック型が 1 つ指定されていません。</value>
|
||||
</data>
|
||||
<data name="CDF_PAGING_FORMAT_1" xml:space="preserve">
|
||||
<value>[j]ページ {0}[e]Page {0}[/]</value>
|
||||
</data>
|
||||
<data name="CDF_PAGING_FORMAT_2" xml:space="preserve">
|
||||
<value>[j]最新 {0} 件[e]Latest: {0} entities[/]</value>
|
||||
</data>
|
||||
<data name="CDF_PAGING_HELPSTR_FORMAT" xml:space="preserve">
|
||||
<value>[j] ({2}: {0} ~ {1})[e] ({2}: {0} - {1})[/]</value>
|
||||
</data>
|
||||
<data name="CDF_PLEASE_SELECT" xml:space="preserve">
|
||||
<value>[j]▼選択してください▼[e]- Please Select Here -[/]</value>
|
||||
</data>
|
||||
<data name="CDF_REMOVE" xml:space="preserve">
|
||||
<value>[j]削除[e]Delete[/]</value>
|
||||
</data>
|
||||
<data name="CDF_REMOVEMSG" xml:space="preserve">
|
||||
<value>[j]この項目を削除します。よろしいですか?[e]Do you want to delete this entity?[/]</value>
|
||||
</data>
|
||||
<data name="CDF_ROW_EMPTY" xml:space="preserve">
|
||||
<value>[j]項目が 1 件も見つかりませんでした。[e]No entity is found.[/]</value>
|
||||
</data>
|
||||
<data name="CDF_SELECTABLE" xml:space="preserve">
|
||||
<value>[j]▽選択可能[e]- Selectable -[/]</value>
|
||||
</data>
|
||||
<data name="CDF_SORT_1" xml:space="preserve">
|
||||
<value>[j]▲「{0}」でソート[e]Sort by "{0}" Ascending[/]</value>
|
||||
</data>
|
||||
<data name="CDF_SORT_2" xml:space="preserve">
|
||||
<value>[j]▼「{0}」で逆ソート[e]Sort by "{0}" Descending[/]</value>
|
||||
</data>
|
||||
<data name="CDF_SORT_DEF1" xml:space="preserve">
|
||||
<value>[j]▲標準のソート[e]Standard Ascending Sort[/]</value>
|
||||
</data>
|
||||
<data name="CDF_SORT_DEF2" xml:space="preserve">
|
||||
<value>[j]▼標準の逆ソート[e]Standard Descending Sort[/]</value>
|
||||
</data>
|
||||
<data name="CDF_STRING_INVALIDCHAR" xml:space="preserve">
|
||||
<value>[j]使用できない文字が含まれています。[e]There are some invalid characters which can't be used.[/]</value>
|
||||
</data>
|
||||
<data name="CDF_STRING_MAX" xml:space="preserve">
|
||||
<value>[j]文字数は {0} 以下にする必要があります。[e]The number of characters must be {0} or less.[/]</value>
|
||||
</data>
|
||||
<data name="CDF_STRING_MIN" xml:space="preserve">
|
||||
<value>[j]文字を {0} 文字以上入力する必要があります。[e]The number of characters must be {0} or more.[/]</value>
|
||||
</data>
|
||||
<data name="CDF_STRING_NOLINE" xml:space="preserve">
|
||||
<value>[j]改行文字を含めることはできません。[e]There must not be any New-Line characters in the string.[/]</value>
|
||||
</data>
|
||||
<data name="CDF_STRING_NONPRINTABLE" xml:space="preserve">
|
||||
<value>[j]表示不可能な文字コードが含まれています。[e]There must not be any Non-Printable characters in the string.[/]</value>
|
||||
</data>
|
||||
<data name="CDF_TEXT_CONFIRM" xml:space="preserve">
|
||||
<value>[j]入力いただいた内容を確認のため表示しています。内容をよくご確認ください。<BR>この内容で確定する場合は [OK] ボタンを、修正する場合は [修正する] ボタンをクリックしてください。[e]Please confirm the printed data which you input. Please read it carefully.<BR>If you want to commit with this data, click the "OK" button. Otherwise, click the "Modify" button.[/]</value>
|
||||
</data>
|
||||
<data name="CDF_TEXT_CONFIRM_ERROR" xml:space="preserve">
|
||||
<value>[j]エラーが発生しました。内容を見直してください。修正する場合は [修正する] ボタンをクリックしてください。[e]An error has been occurred. Please confirm the fields. To modify it, click the "Modify" button.[/]</value>
|
||||
</data>
|
||||
<data name="CDF_TEXT_OK" xml:space="preserve">
|
||||
<value>[j]入力が完了したら [OK] ボタンを、入力をキャンセルするには [キャンセル] ボタンをクリックしてください。[e]Please click the "OK" button after you complete filling all nessesary fields. To cancel inputting, click the "Cancel" button.[/]</value>
|
||||
</data>
|
||||
<data name="CDF_TIME_EMPTY" xml:space="preserve">
|
||||
<value>[j]時刻が入力されていません。[e]Time is empty.[/]</value>
|
||||
</data>
|
||||
<data name="CDF_TIME_MAX" xml:space="preserve">
|
||||
<value>[j]{0} 以前の時刻を指定してください。[e]Please specify a time before {0}.[/]</value>
|
||||
</data>
|
||||
<data name="CDF_TIME_MIN" xml:space="preserve">
|
||||
<value>[j]{0} 以降の時刻を指定してください。[e]Please specify a time after {0}.[/]</value>
|
||||
</data>
|
||||
<data name="CDF_TIME_NOTTIME" xml:space="preserve">
|
||||
<value>[j]時刻として認識できない文字列が入力されています。[e]Can't recognize as a valid time.[/]</value>
|
||||
</data>
|
||||
<data name="CDF_UNSUPPORTED" xml:space="preserve">
|
||||
<value>[j]フィールド %s の型 %s がサポートされていません。[e]In the field "%s", the type "%s" is not supported.[/]</value>
|
||||
</data>
|
||||
<data name="CMD_CT_STD_COLUMN_1" xml:space="preserve">
|
||||
<value>Item</value>
|
||||
</data>
|
||||
<data name="CMD_CT_STD_COLUMN_2" xml:space="preserve">
|
||||
<value>Value</value>
|
||||
</data>
|
||||
<data name="CMD_EVAL_DATE_TIME_FAILED" xml:space="preserve">
|
||||
<value>The date and time specification is invalid. \nThe date and time must be in the same format as "2005/10/08 19:30:00" where 6 integers are specified, representing year/month/day hour:minute:second separated by forward slashes, a space and then colons. Specify 4 digits for the year.</value>
|
||||
</data>
|
||||
<data name="CMD_EVAL_INT" xml:space="preserve">
|
||||
<value>You must specify an integer that is not less than 1.</value>
|
||||
</data>
|
||||
<data name="CMD_EVAL_MIN_MAX" xml:space="preserve">
|
||||
<value>You must specify an integer in the range from %u to %u for the value.</value>
|
||||
</data>
|
||||
<data name="CMD_EVAL_NOT_EMPTY" xml:space="preserve">
|
||||
<value>You cannot make a blank specification.</value>
|
||||
</data>
|
||||
<data name="CMD_EVAL_PORT" xml:space="preserve">
|
||||
<value>Port number is invalid. Specify a port number that is within the range of 1 to 65535.</value>
|
||||
</data>
|
||||
<data name="CMD_EVAL_SAFE" xml:space="preserve">
|
||||
<value>The string contains unusable characters.</value>
|
||||
</data>
|
||||
<data name="CMD_EXEC_MSG_NAME" xml:space="preserve">
|
||||
<value>%S command - %s</value>
|
||||
</data>
|
||||
<data name="CMD_FILE_NAME_EMPTY" xml:space="preserve">
|
||||
<value>The file name is not specified.</value>
|
||||
</data>
|
||||
<data name="CMD_FILE_NOT_FOUND" xml:space="preserve">
|
||||
<value>Cannot find specified file "%s".</value>
|
||||
</data>
|
||||
<data name="CMD_HELP_1" xml:space="preserve">
|
||||
<value>You can use the following %u commands:</value>
|
||||
</data>
|
||||
<data name="CMD_HELP_2" xml:space="preserve">
|
||||
<value>To reference the usage for each command, input "command name /?" to view a help.</value>
|
||||
</data>
|
||||
<data name="CMD_HELP_ARGS" xml:space="preserve">
|
||||
<value>Parameters:</value>
|
||||
</data>
|
||||
<data name="CMD_HELP_DESCRIPTION" xml:space="preserve">
|
||||
<value>Purpose:</value>
|
||||
</data>
|
||||
<data name="CMD_HELP_HELP" xml:space="preserve">
|
||||
<value>Description:</value>
|
||||
</data>
|
||||
<data name="CMD_HELP_TITLE" xml:space="preserve">
|
||||
<value>Help for command "%S"</value>
|
||||
</data>
|
||||
<data name="CMD_HELP_USAGE" xml:space="preserve">
|
||||
<value>Usage:</value>
|
||||
</data>
|
||||
<data name="CMD_PARSE_IP_SUBNET_ERROR_1" xml:space="preserve">
|
||||
<value>"IP アドレス/サブネットマスク" の形式で指定してください。
|
||||
IP アドレスは 192.168.0.1 のように 10 進数をドットで区切って指定します。サブネットマスクは 255.255.255.0 のように 10 進数をドットで区切って指定するか、24 のように先頭からのビット長を 10 進数で指定できます。
|
||||
単一のホストを指定するには、サブネットマスクを 255.255.255.255 または 32 として指定します。
|
||||
(例)
|
||||
192.168.0.1/24
|
||||
192.168.0.1/255.255.255.0
|
||||
192.168.0.5/255.255.255.255
|
||||
|
||||
</value>
|
||||
</data>
|
||||
<data name="CMD_PARSE_IP_SUBNET_ERROR_2" xml:space="preserve">
|
||||
<value>指定された IP アドレスはネットワークアドレスではありません。</value>
|
||||
</data>
|
||||
<data name="CMD_PROMPT" xml:space="preserve">
|
||||
<value>Enter a value: </value>
|
||||
</data>
|
||||
<data name="CMD_PROPMT_PORT" xml:space="preserve">
|
||||
<value>Input the port number: </value>
|
||||
</data>
|
||||
<data name="CMD_UNKNOWM" xml:space="preserve">
|
||||
<value>There is no description for this command.</value>
|
||||
</data>
|
||||
<data name="CMD_UNKNOWN_ARGS" xml:space="preserve">
|
||||
<value>There is no command execution example.</value>
|
||||
</data>
|
||||
<data name="CMD_UNKNOWN_HELP" xml:space="preserve">
|
||||
<value>There is no detailed description for this command. If you would like to know more detail about this command, please refer to the manual or online documentation.</value>
|
||||
</data>
|
||||
<data name="CMD_UNKNOWN_PARAM" xml:space="preserve">
|
||||
<value>There is no description for this parameter.</value>
|
||||
</data>
|
||||
<data name="CON_AMBIGIOUS_CMD" xml:space="preserve">
|
||||
<value>"%S": The command-name is ambiguous.</value>
|
||||
</data>
|
||||
<data name="CON_AMBIGIOUS_CMD_1" xml:space="preserve">
|
||||
<value>The specified command name matches the following multiple commands.</value>
|
||||
</data>
|
||||
<data name="CON_AMBIGIOUS_CMD_2" xml:space="preserve">
|
||||
<value>Please re-specify the command name more strictly.</value>
|
||||
</data>
|
||||
<data name="CON_AMBIGIOUS_PARAM" xml:space="preserve">
|
||||
<value>"%S": The parameter name is ambiguous.</value>
|
||||
</data>
|
||||
<data name="CON_AMBIGIOUS_PARAM_1" xml:space="preserve">
|
||||
<value>The specified parameter name matches with the following parameters that can be specified as a parameter of command "%S".</value>
|
||||
</data>
|
||||
<data name="CON_AMBIGIOUS_PARAM_2" xml:space="preserve">
|
||||
<value>Please re-specify the parameter name more strictly.</value>
|
||||
</data>
|
||||
<data name="CON_INFILE_ERROR" xml:space="preserve">
|
||||
<value>Error: Unable to open the specified input file "%s".</value>
|
||||
</data>
|
||||
<data name="CON_INFILE_START" xml:space="preserve">
|
||||
<value>The commands written in the file "%s" will be used instead of input from keyboard.</value>
|
||||
</data>
|
||||
<data name="CON_INVALID_PARAM" xml:space="preserve">
|
||||
<value>The parameter "/%S" has been specified. It is not possible to specify this parameter when using the command "%S". Input "%S /HELP" to see the list of what parameters can be used.</value>
|
||||
</data>
|
||||
<data name="CON_OUTFILE_ERROR" xml:space="preserve">
|
||||
<value>Error: Unable to create the specified output file "%s".</value>
|
||||
</data>
|
||||
<data name="CON_OUTFILE_START" xml:space="preserve">
|
||||
<value>The message output to the console will be saved in the file "%s".</value>
|
||||
</data>
|
||||
<data name="CON_UNKNOWN_CMD" xml:space="preserve">
|
||||
<value>"%S": Command not found. You can use the HELP command to view a list of the available commands.</value>
|
||||
</data>
|
||||
<data name="CON_USER_CANCEL" xml:space="preserve">
|
||||
<value>[EOF]</value>
|
||||
</data>
|
||||
<data name="CON_USER_CANCELED" xml:space="preserve">
|
||||
<value>The command was canceled.</value>
|
||||
</data>
|
||||
</root>
|
@ -484,6 +484,7 @@ namespace BuildUtil
|
||||
".sys",
|
||||
".inf",
|
||||
".wav",
|
||||
".cat",
|
||||
};
|
||||
|
||||
foreach (string ext in filesOnlyWin32)
|
||||
|
@ -108,7 +108,7 @@
|
||||
#define CEDAR_VER 403
|
||||
|
||||
// Build Number
|
||||
#define CEDAR_BUILD 9408
|
||||
#define CEDAR_BUILD 9411
|
||||
|
||||
// Beta number
|
||||
//#define BETA_NUMBER 3
|
||||
@ -129,10 +129,10 @@
|
||||
// Specifies the build date
|
||||
#define BUILD_DATE_Y 2014
|
||||
#define BUILD_DATE_M 1
|
||||
#define BUILD_DATE_D 4
|
||||
#define BUILD_DATE_HO 19
|
||||
#define BUILD_DATE_MI 10
|
||||
#define BUILD_DATE_SE 55
|
||||
#define BUILD_DATE_D 7
|
||||
#define BUILD_DATE_HO 4
|
||||
#define BUILD_DATE_MI 51
|
||||
#define BUILD_DATE_SE 30
|
||||
|
||||
// Tolerable time difference
|
||||
#define ALLOW_TIMESTAMP_DIFF (UINT64)(3 * 24 * 60 * 60 * 1000)
|
||||
|
@ -5449,47 +5449,6 @@ bool ServerDownloadSignature(CONNECTION *c, char **error_detail_str)
|
||||
|
||||
*error_detail_str = "HTTP_ROOT";
|
||||
|
||||
if (s != NULL && s->UseWebTimePage)
|
||||
{
|
||||
// Generate a page that shows the current time as the top page automatically
|
||||
BUF *b = ReadDump("|time.htm");
|
||||
|
||||
if (b != NULL)
|
||||
{
|
||||
char *src = ZeroMalloc(b->Size + 1);
|
||||
UINT dst_size = b->Size * 2 + 64;
|
||||
char *dst = ZeroMalloc(dst_size);
|
||||
char host[MAX_PATH];
|
||||
char portstr[64];
|
||||
char now_str[MAX_PATH];
|
||||
|
||||
GetDateTimeStr64(now_str, sizeof(now_str), LocalTime64());
|
||||
|
||||
GetMachineName(host, sizeof(host));
|
||||
ToStr(portstr, c->FirstSock->LocalPort);
|
||||
|
||||
Copy(src, b->Buf, b->Size);
|
||||
ReplaceStrEx(dst, dst_size, src,
|
||||
"$HOST$", host, false);
|
||||
ReplaceStrEx(dst, dst_size, dst,
|
||||
"$PORT$", portstr, false);
|
||||
ReplaceStrEx(dst, dst_size, dst,
|
||||
"$NOW$", now_str, false);
|
||||
|
||||
FreeHttpHeader(h);
|
||||
h = NewHttpHeader("HTTP/1.1", "202", "OK");
|
||||
AddHttpValue(h, NewHttpValue("Content-Type", HTTP_CONTENT_TYPE4));
|
||||
AddHttpValue(h, NewHttpValue("Connection", "Keep-Alive"));
|
||||
AddHttpValue(h, NewHttpValue("Keep-Alive", HTTP_KEEP_ALIVE));
|
||||
PostHttp(c->FirstSock, h, dst, StrLen(dst));
|
||||
|
||||
Free(src);
|
||||
Free(dst);
|
||||
|
||||
FreeBuf(b);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (is_free == false)
|
||||
{
|
||||
|
@ -2125,10 +2125,6 @@ bool ExecuteHamcoreExe(char *name)
|
||||
// Show the Easter Egg
|
||||
void ShowEasterEgg(HWND hWnd)
|
||||
{
|
||||
ExecuteHamcoreExe("|egg1.exe");
|
||||
ExecuteHamcoreExe("|egg2.exe");
|
||||
ExecuteHamcoreExe("|egg3.exe");
|
||||
ShellExecute(hWnd, "open", "http://www.softether.co.jp/jp/special/vpn3egg/", NULL, NULL, SW_SHOW);
|
||||
}
|
||||
|
||||
void KakushiThread(THREAD *thread, void *param)
|
||||
|
10
src/ChangeLog.txt
Normal file
10
src/ChangeLog.txt
Normal file
@ -0,0 +1,10 @@
|
||||
ChangeLog of SoftEther VPN
|
||||
--------------------------
|
||||
|
||||
The ChangeLog of SoftEther VPN is on our web site:
|
||||
http://www.softether.org/5-download/history
|
||||
|
||||
(In Japanese: http://ja.softether.org/5-download/history)
|
||||
|
||||
Enjoy it!
|
||||
|
@ -1,4 +1,4 @@
|
||||
BUILD_NUMBER 9408
|
||||
BUILD_NUMBER 9411
|
||||
VERSION 403
|
||||
BUILD_NAME rtm
|
||||
BUILD_DATE 20140104_191055
|
||||
BUILD_DATE 20140107_045130
|
||||
|
2350
src/LICENSE
2350
src/LICENSE
File diff suppressed because it is too large
Load Diff
2037
src/LICENSE.TXT
2037
src/LICENSE.TXT
File diff suppressed because it is too large
Load Diff
@ -747,6 +747,110 @@ bool GetDiskFreeW(wchar_t *path, UINT64 *free_size, UINT64 *used_size, UINT64 *t
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Enumeration of direction with all sub directories
|
||||
TOKEN_LIST *EnumDirWithSubDirs(char *dirname)
|
||||
{
|
||||
TOKEN_LIST *ret;
|
||||
UNI_TOKEN_LIST *ret2;
|
||||
wchar_t tmp[MAX_SIZE];
|
||||
// Validate arguments
|
||||
if (dirname == NULL)
|
||||
{
|
||||
dirname = "./";
|
||||
}
|
||||
|
||||
StrToUni(tmp, sizeof(tmp), dirname);
|
||||
|
||||
ret2 = EnumDirWithSubDirsW(tmp);
|
||||
|
||||
ret = UniTokenListToTokenList(ret2);
|
||||
|
||||
UniFreeToken(ret2);
|
||||
|
||||
return ret;
|
||||
}
|
||||
UNI_TOKEN_LIST *EnumDirWithSubDirsW(wchar_t *dirname)
|
||||
{
|
||||
ENUM_DIR_WITH_SUB_DATA d;
|
||||
UNI_TOKEN_LIST *ret;
|
||||
UINT i;
|
||||
// Validate arguments
|
||||
if (dirname == NULL)
|
||||
{
|
||||
dirname = L"./";
|
||||
}
|
||||
|
||||
Zero(&d, sizeof(d));
|
||||
|
||||
d.FileList = NewListFast(NULL);
|
||||
|
||||
EnumDirWithSubDirsMain(&d, dirname);
|
||||
|
||||
ret = ZeroMalloc(sizeof(UNI_TOKEN_LIST));
|
||||
|
||||
ret->NumTokens = LIST_NUM(d.FileList);
|
||||
ret->Token = ZeroMalloc(sizeof(wchar_t *) * ret->NumTokens);
|
||||
|
||||
for (i = 0;i < ret->NumTokens;i++)
|
||||
{
|
||||
wchar_t *s = LIST_DATA(d.FileList, i);
|
||||
|
||||
ret->Token[i] = UniCopyStr(s);
|
||||
}
|
||||
|
||||
FreeStrList(d.FileList);
|
||||
|
||||
return ret;
|
||||
}
|
||||
void EnumDirWithSubDirsMain(ENUM_DIR_WITH_SUB_DATA *d, wchar_t *dirname)
|
||||
{
|
||||
DIRLIST *dir;
|
||||
UINT i;
|
||||
// Validate arguments
|
||||
if (d == NULL || dirname == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
dir = EnumDirExW(dirname, NULL);
|
||||
if (dir == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Files
|
||||
for (i = 0;i < dir->NumFiles;i++)
|
||||
{
|
||||
DIRENT *e = dir->File[i];
|
||||
|
||||
if (e->Folder == false)
|
||||
{
|
||||
wchar_t tmp[MAX_SIZE];
|
||||
|
||||
ConbinePathW(tmp, sizeof(tmp), dirname, e->FileNameW);
|
||||
|
||||
Add(d->FileList, CopyUniStr(tmp));
|
||||
}
|
||||
}
|
||||
|
||||
// Sub directories
|
||||
for (i = 0;i < dir->NumFiles;i++)
|
||||
{
|
||||
DIRENT *e = dir->File[i];
|
||||
|
||||
if (e->Folder)
|
||||
{
|
||||
wchar_t tmp[MAX_SIZE];
|
||||
|
||||
ConbinePathW(tmp, sizeof(tmp), dirname, e->FileNameW);
|
||||
|
||||
EnumDirWithSubDirsMain(d, tmp);
|
||||
}
|
||||
}
|
||||
|
||||
FreeDir(dir);
|
||||
}
|
||||
|
||||
// Enumeration of directory
|
||||
DIRLIST *EnumDirEx(char *dirname, COMPARE *compare)
|
||||
{
|
||||
@ -1117,40 +1221,59 @@ void FreeHamcore()
|
||||
}
|
||||
|
||||
// Build a Hamcore file
|
||||
void BuildHamcore()
|
||||
void BuildHamcore(char *dst_filename, char *src_dir, bool unix_only)
|
||||
{
|
||||
BUF *b;
|
||||
char tmp[MAX_SIZE];
|
||||
char exe_dir[MAX_SIZE];
|
||||
char *s;
|
||||
bool ok = true;
|
||||
LIST *o;
|
||||
UINT i;
|
||||
TOKEN_LIST *src_file_list;
|
||||
|
||||
GetExeDir(exe_dir, sizeof(exe_dir));
|
||||
Format(tmp, sizeof(tmp), "%s/%s", exe_dir, HAMCORE_TEXT_NAME);
|
||||
|
||||
b = ReadDump(tmp);
|
||||
if (b == NULL)
|
||||
{
|
||||
Print("Failed to open %s.\n", tmp);
|
||||
return;
|
||||
}
|
||||
src_file_list = EnumDirWithSubDirs(src_dir);
|
||||
|
||||
o = NewListFast(CompareHamcore);
|
||||
|
||||
while ((s = CfgReadNextLine(b)) != NULL)
|
||||
for (i = 0;i < src_file_list->NumTokens;i++)
|
||||
{
|
||||
char tmp[MAX_SIZE];
|
||||
char rpath[MAX_SIZE];
|
||||
BUF *b;
|
||||
char s[MAX_SIZE];
|
||||
|
||||
StrCpy(s, sizeof(s), src_file_list->Token[i]);
|
||||
Trim(s);
|
||||
|
||||
Format(tmp, sizeof(tmp), "%s/%s/%s", exe_dir, HAMCORE_DIR_NAME, s);
|
||||
if (GetRelativePath(rpath, sizeof(rpath), s, src_dir) == false)
|
||||
{
|
||||
// Unknown error !
|
||||
}
|
||||
else
|
||||
{
|
||||
bool ok = true;
|
||||
|
||||
b = ReadDump(tmp);
|
||||
ReplaceStr(rpath, sizeof(rpath), rpath, "/", "\\");
|
||||
|
||||
if (unix_only)
|
||||
{
|
||||
// Exclude non-UNIX files
|
||||
if (EndWith(s, ".exe") ||
|
||||
EndWith(s, ".dll") ||
|
||||
EndWith(s, ".sys") ||
|
||||
EndWith(s, ".inf") ||
|
||||
EndWith(s, ".cat") ||
|
||||
EndWith(s, ".wav"))
|
||||
{
|
||||
ok = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (ok)
|
||||
{
|
||||
b = ReadDump(s);
|
||||
if (b == NULL)
|
||||
{
|
||||
Print("Failed to open %s.\n", s);
|
||||
Print("Failed to open '%s'.\n", s);
|
||||
ok = false;
|
||||
}
|
||||
else
|
||||
@ -1158,7 +1281,7 @@ void BuildHamcore()
|
||||
HC *c = ZeroMalloc(sizeof(HC));
|
||||
UINT tmp_size;
|
||||
void *tmp;
|
||||
c->FileName = CopyStr(s);
|
||||
c->FileName = CopyStr(rpath);
|
||||
c->Size = b->Size;
|
||||
tmp_size = CalcCompress(c->Size);
|
||||
tmp = Malloc(tmp_size);
|
||||
@ -1168,8 +1291,8 @@ void BuildHamcore()
|
||||
Print("%s: %u -> %u\n", s, c->Size, c->SizeCompressed);
|
||||
FreeBuf(b);
|
||||
}
|
||||
|
||||
Free(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ok)
|
||||
@ -1226,7 +1349,7 @@ void BuildHamcore()
|
||||
WriteBuf(b, c->Buffer, c->SizeCompressed);
|
||||
}
|
||||
// Writing
|
||||
Format(tmp, sizeof(tmp), "%s/%s", exe_dir, HAMCORE_FILE_NAME "__");
|
||||
StrCpy(tmp, sizeof(tmp), dst_filename);
|
||||
Print("Writing %s...\n", tmp);
|
||||
FileDelete(tmp);
|
||||
DumpBuf(b, tmp);
|
||||
@ -1243,7 +1366,7 @@ void BuildHamcore()
|
||||
|
||||
ReleaseList(o);
|
||||
|
||||
FreeBuf(b);
|
||||
FreeToken(src_file_list);
|
||||
}
|
||||
|
||||
// Comparison of the HCs
|
||||
@ -1842,6 +1965,67 @@ void GetCurrentDir(char *name, UINT size)
|
||||
UniToStr(name, size, name_w);
|
||||
}
|
||||
|
||||
// Get the relative path
|
||||
bool GetRelativePathW(wchar_t *dst, UINT size, wchar_t *fullpath, wchar_t *basepath)
|
||||
{
|
||||
wchar_t fullpath2[MAX_SIZE];
|
||||
wchar_t basepath2[MAX_SIZE];
|
||||
// Validate arguments
|
||||
if (dst == NULL || fullpath == NULL || basepath == NULL)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
ClearUniStr(dst, size);
|
||||
|
||||
NormalizePathW(fullpath2, sizeof(fullpath2), fullpath);
|
||||
NormalizePathW(basepath2, sizeof(basepath2), basepath);
|
||||
|
||||
#ifdef OS_WIN32
|
||||
UniStrCat(basepath2, sizeof(basepath2), L"\\");
|
||||
#else // OS_WIN32
|
||||
UniStrCat(basepath2, sizeof(basepath2), L"/");
|
||||
#endif // OS_WIN32
|
||||
|
||||
if (UniStrLen(fullpath2) <= UniStrLen(basepath2))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (UniStartWith(fullpath2, basepath2) == false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
UniStrCpy(dst, size, fullpath2 + UniStrLen(basepath2));
|
||||
|
||||
return true;
|
||||
}
|
||||
bool GetRelativePath(char *dst, UINT size, char *fullpath, char *basepath)
|
||||
{
|
||||
wchar_t dst_w[MAX_SIZE];
|
||||
wchar_t fullpath_w[MAX_SIZE];
|
||||
wchar_t basepath_w[MAX_SIZE];
|
||||
bool ret;
|
||||
// Validate arguments
|
||||
if (dst == NULL || fullpath == NULL || basepath == NULL)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
StrToUni(fullpath_w, sizeof(fullpath_w), fullpath);
|
||||
StrToUni(basepath_w, sizeof(basepath_w), basepath);
|
||||
|
||||
ret = GetRelativePathW(dst_w, sizeof(dst_w), fullpath_w, basepath_w);
|
||||
if (ret == false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
UniToStr(dst, size, dst_w);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Normalize the file path
|
||||
void NormalizePathW(wchar_t *dst, UINT size, wchar_t *src)
|
||||
{
|
||||
|
@ -224,6 +224,11 @@ struct ZIP_PACKER
|
||||
ZIP_FILE *CurrentFile;
|
||||
};
|
||||
|
||||
struct ENUM_DIR_WITH_SUB_DATA
|
||||
{
|
||||
LIST *FileList;
|
||||
};
|
||||
|
||||
void InitCrc32();
|
||||
UINT Crc32(void *buf, UINT pos, UINT len);
|
||||
UINT Crc32First(void *buf, UINT pos, UINT len);
|
||||
@ -287,6 +292,8 @@ bool FileRename(char *old_name, char *new_name);
|
||||
bool FileRenameW(wchar_t *old_name, wchar_t *new_name);
|
||||
void NormalizePath(char *dst, UINT size, char *src);
|
||||
void NormalizePathW(wchar_t *dst, UINT size, wchar_t *src);
|
||||
bool GetRelativePathW(wchar_t *dst, UINT size, wchar_t *fullpath, wchar_t *basepath);
|
||||
bool GetRelativePath(char *dst, UINT size, char *fullpath, char *basepath);
|
||||
TOKEN_LIST *ParseSplitedPath(char *path);
|
||||
UNI_TOKEN_LIST *ParseSplitedPathW(wchar_t *path);
|
||||
char *GetCurrentPathEnvStr();
|
||||
@ -312,7 +319,7 @@ void GetExeName(char *name, UINT size);
|
||||
void GetExeNameW(wchar_t *name, UINT size);
|
||||
void GetExeDir(char *name, UINT size);
|
||||
void GetExeDirW(wchar_t *name, UINT size);
|
||||
void BuildHamcore();
|
||||
void BuildHamcore(char *dst_filename, char *src_dir, bool unix_only);
|
||||
int CompareHamcore(void *p1, void *p2);
|
||||
void InitHamcore();
|
||||
void FreeHamcore();
|
||||
@ -325,6 +332,9 @@ DIRLIST *EnumDir(char *dirname);
|
||||
DIRLIST *EnumDirW(wchar_t *dirname);
|
||||
DIRLIST *EnumDirEx(char *dirname, COMPARE *compare);
|
||||
DIRLIST *EnumDirExW(wchar_t *dirname, COMPARE *compare);
|
||||
UNI_TOKEN_LIST *EnumDirWithSubDirsW(wchar_t *dirname);
|
||||
TOKEN_LIST *EnumDirWithSubDirs(char *dirname);
|
||||
void EnumDirWithSubDirsMain(ENUM_DIR_WITH_SUB_DATA *d, wchar_t *dirname);
|
||||
void FreeDir(DIRLIST *d);
|
||||
int CompareDirListByName(void *p1, void *p2);
|
||||
bool GetDiskFree(char *path, UINT64 *free_size, UINT64 *used_size, UINT64 *total_size);
|
||||
|
@ -502,6 +502,7 @@ typedef struct ZIP_DIR_HEADER ZIP_DIR_HEADER;
|
||||
typedef struct ZIP_END_HEADER ZIP_END_HEADER;
|
||||
typedef struct ZIP_FILE ZIP_FILE;
|
||||
typedef struct ZIP_PACKER ZIP_PACKER;
|
||||
typedef struct ENUM_DIR_WITH_SUB_DATA ENUM_DIR_WITH_SUB_DATA;
|
||||
|
||||
// TcpIp.h
|
||||
typedef struct MAC_HEADER MAC_HEADER;
|
||||
|
Binary file not shown.
189
src/README
189
src/README
@ -1,189 +0,0 @@
|
||||
SoftEther VPN - An Open-Source Cross-platform Multi-protocol VPN Program
|
||||
http://www.softether.org/
|
||||
|
||||
We use GitHub as the primary official SoftEther VPN repository:
|
||||
https://github.com/SoftEtherVPN/SoftEtherVPN/
|
||||
|
||||
Source code packages (.zip and .tar.gz) and binary files are also available:
|
||||
http://www.softether-download.com/
|
||||
|
||||
Copyright (c) 2012-2014 SoftEther Project at University of Tsukuba, Japan.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License version 2
|
||||
as published by the Free Software Foundation.
|
||||
|
||||
SoftEther VPN ("SoftEther" means "Software Ethernet") is one of the
|
||||
world's most powerful and easy-to-use multi-protocol VPN software.
|
||||
|
||||
SoftEther VPN runs on Windows, Linux, Mac, FreeBSD and Solaris.
|
||||
|
||||
SoftEther VPN supports most of widely-used VPN protocols
|
||||
including SSL-VPN, OpenVPN, IPsec, L2TP, MS-SSTP, L2TPv3 and EtherIP
|
||||
by the single SoftEther VPN Server program.
|
||||
|
||||
More details on http://www.softether.org/.
|
||||
|
||||
|
||||
SOFTETHER VPN ADVANTAGES
|
||||
------------------------
|
||||
|
||||
- Supporting all popular VPN protocols by the single VPN server:
|
||||
SSL-VPN (HTTPS)
|
||||
OpenVPN
|
||||
IPsec
|
||||
L2TP
|
||||
MS-SSTP
|
||||
L2TPv3
|
||||
EtherIP
|
||||
- Free and open-source software.
|
||||
- Easy to establish both remote-access and site-to-site VPN.
|
||||
- SSL-VPN Tunneling on HTTPS to pass through NATs and firewalls.
|
||||
- Revolutionary VPN over ICMP and VPN over DNS features.
|
||||
- Resistance to highly-restricted firewall.
|
||||
- Ethernet-bridging (L2) and IP-routing (L3) over VPN.
|
||||
- Embedded dynamic-DNS and NAT-traversal so that no static nor
|
||||
fixed IP address is required.
|
||||
- AES 256-bit and RSA 4096-bit encryptions.
|
||||
- Sufficient security features such as logging and firewall inner
|
||||
VPN tunnel.
|
||||
- 1Gbps-class high-speed throughput performance with low memory and
|
||||
CPU usage.
|
||||
- Windows, Linux, Mac, Android, iPhone, iPad and Windows Phone are
|
||||
supported.
|
||||
- The OpenVPN clone function supports legacy OpenVPN clients.
|
||||
- IPv4 / IPv6 dual-stack.
|
||||
- The VPN server runs on Windows, Linux, FreeBSD, Solaris and Mac OS X.
|
||||
- Configure All settings on GUI.
|
||||
- Multi-languages (English, Japanese and Simplified-Chinese).
|
||||
- More details at http://www.softether.org/.
|
||||
|
||||
|
||||
GETTING STARTED
|
||||
---------------
|
||||
|
||||
Visit the SoftEther VPN Project official web site at first:
|
||||
http://www.softether.org/
|
||||
|
||||
If you are not a developer, it is recommended to download the binary
|
||||
installers from:
|
||||
http://www.softether-download.com/
|
||||
|
||||
To build from the source,
|
||||
see "BUILD_UNIX.TXT" or "BUILD_WINDOWS.TXT" files.
|
||||
|
||||
|
||||
HOW TO DOWNLOAD THE LATEST SOURCE CODE PACKAGE
|
||||
----------------------------------------------
|
||||
|
||||
Go to http://www.softether-download.com/ and you can find the latest
|
||||
source-code package file in both .ZIP and .TAR.GZ format.
|
||||
|
||||
This is the easiest way to obtain the source code of SoftEther VPN.
|
||||
|
||||
|
||||
HOW TO GET THE LATEST SOURCE CODE TREE FOR DEVELOPERS
|
||||
-----------------------------------------------------
|
||||
|
||||
If you are an open-source developer, visit our GitHub repository:
|
||||
https://github.com/SoftEtherVPN/SoftEtherVPN/
|
||||
|
||||
You can download the up-to-date source-code tree of SoftEther VPN
|
||||
from GitHub. You may make your own fork project from our project.
|
||||
|
||||
The download and build instruction is following:
|
||||
|
||||
$ git clone https://github.com/SoftEtherVPN/SoftEtherVPN.git
|
||||
$ cd SoftEtherVPN
|
||||
$ make
|
||||
$ make install
|
||||
|
||||
|
||||
TO CIRCUMVENT YOUR GOVERNMENT'S FIREWALL RESTRICTION
|
||||
----------------------------------------------------
|
||||
|
||||
Because SoftEther VPN is overly strong tool to build a VPN tunnel,
|
||||
some censorship governments want to block your access to the source code
|
||||
of SoftEther VPN, by abusing their censorship firewalls.
|
||||
|
||||
To circumvent your censor's unjust restriction,
|
||||
SoftEther VPN Project distributes the up-to-date source-code
|
||||
on all the following open-source repositories:
|
||||
|
||||
- GitHub
|
||||
https://github.com/SoftEtherVPN/SoftEtherVPN/
|
||||
|
||||
- SourceForge
|
||||
https://sourceforge.net/projects/softethervpn/
|
||||
|
||||
- Google Code
|
||||
https://code.google.com/p/softether/
|
||||
|
||||
|
||||
To fetch the source code from GitHub:
|
||||
$ git clone https://github.com/SoftEtherVPN/SoftEtherVPN.git
|
||||
|
||||
To fetch the source code from SourceForge:
|
||||
$ git clone http://git.code.sf.net/p/softethervpn/code
|
||||
- or -
|
||||
$ git clone git://git.code.sf.net/p/softethervpn/code
|
||||
|
||||
To fetch the source code from Google Code:
|
||||
$ git clone https://code.google.com/p/softether/
|
||||
|
||||
We hope that you can reach one of the above URLs at least!
|
||||
|
||||
|
||||
DEAR SECURITY EXPERTS
|
||||
---------------------
|
||||
|
||||
If you find a bug or a security vulnerability please kindly inform us
|
||||
about the problem immediately so that we can fix the security problem
|
||||
to protect a lot of users around the world as soon as possible.
|
||||
|
||||
Our e-mail address for security reports is:
|
||||
softether-vpn-security [at] softether.org
|
||||
|
||||
Please note that the above e-mail address is not a technical support
|
||||
inquiry address. If you need technical assistance, please visit
|
||||
http://www.softether.org/ and ask your question on the users forum.
|
||||
|
||||
|
||||
DISCLAIMER
|
||||
----------
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
THIS SOFTWARE IS DEVELOPED IN JAPAN, AND DISTRIBUTED FROM JAPAN,
|
||||
UNDER JAPANESE LAWS. YOU MUST AGREE IN ADVANCE TO USE, COPY, MODIFY,
|
||||
MERGE, PUBLISH, DISTRIBUTE, SUBLICENSE, AND/OR SELL COPIES OF THIS
|
||||
SOFTWARE, THAT ANY JURIDICAL DISPUTES WHICH ARE CONCERNED TO THIS
|
||||
SOFTWARE OR ITS CONTENTS, AGAINST US (SOFTETHER PROJECT, SOFTETHER
|
||||
CORPORATION, DAIYUU NOBORI OR OTHER SUPPLIERS), OR ANY JURIDICAL
|
||||
DISPUTES AGAINST US WHICH ARE CAUSED BY ANY KIND OF USING, COPYING,
|
||||
MODIFYING, MERGING, PUBLISHING, DISTRIBUTING, SUBLICENSING, AND/OR
|
||||
SELLING COPIES OF THIS SOFTWARE SHALL BE REGARDED AS BE CONSTRUED AND
|
||||
CONTROLLED BY JAPANESE LAWS, AND YOU MUST FURTHER CONSENT TO
|
||||
EXCLUSIVE JURISDICTION AND VENUE IN THE COURTS SITTING IN TOKYO,
|
||||
JAPAN. YOU MUST WAIVE ALL DEFENSES OF LACK OF PERSONAL JURISDICTION
|
||||
AND FORUM NON CONVENIENS. PROCESS MAY BE SERVED ON EITHER PARTY IN
|
||||
THE MANNER AUTHORIZED BY APPLICABLE LAW OR COURT RULE.
|
||||
|
||||
USE ONLY IN JAPAN. DO NOT USE IT IN OTHER COUNTRIES. IMPORTING THIS
|
||||
SOFTWARE INTO OTHER COUNTRIES IS AT YOUR OWN RISK. SOME COUNTRIES
|
||||
PROHIBIT ENCRYPTED COMMUNICATIONS. USING THIS SOFTWARE IN OTHER
|
||||
COUNTRIES MIGHT BE RESTRICTED.
|
||||
|
||||
|
||||
ADVERTISEMENT
|
||||
-------------
|
||||
|
||||
SoftEther VPN is developed by SoftEther VPN Project at University of Tsukuba.
|
||||
Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
Join us: http://www.tsukuba.ac.jp/english/admission/
|
||||
|
@ -114,10 +114,10 @@ on all the following open-source repositories:
|
||||
https://github.com/SoftEtherVPN/SoftEtherVPN/
|
||||
|
||||
- SourceForge
|
||||
https://sourceforge.net/projects/softethervpn/
|
||||
https://sourceforge.net/p/softethervpn/code/ci/master/tree/
|
||||
|
||||
- Google Code
|
||||
https://code.google.com/p/softether/
|
||||
https://code.google.com/p/softether/source/browse/
|
||||
|
||||
|
||||
To fetch the source code from GitHub:
|
||||
@ -179,6 +179,9 @@ SOFTWARE INTO OTHER COUNTRIES IS AT YOUR OWN RISK. SOME COUNTRIES
|
||||
PROHIBIT ENCRYPTED COMMUNICATIONS. USING THIS SOFTWARE IN OTHER
|
||||
COUNTRIES MIGHT BE RESTRICTED.
|
||||
|
||||
READ AND UNDERSTAND THE 'WARNING.TXT' FILE BEFORE USING THIS SOFTWARE.
|
||||
SOME SOFTWARE PROGRAMS FROM THIRD PARTIES ARE INCLUDED ON THIS SOFTWARE WITH LICENSE CONDITIONS WHICH ARE DESCRIBED ON THE 'THIRD_PARTY.TXT' FILE.
|
||||
|
||||
|
||||
ADVERTISEMENT
|
||||
-------------
|
||||
|
757
src/THIRD_PARTY.TXT
Normal file
757
src/THIRD_PARTY.TXT
Normal file
@ -0,0 +1,757 @@
|
||||
BitVisor(R) VPN Client Module (IPsec Driver):
|
||||
Copyright (c) 2007, 2008 University of Tsukuba.
|
||||
Copyright (C) 2007, 2008 National Institute of Information and Communications
|
||||
Technology.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
3. Neither the name of the University of Tsukuba nor the names of its
|
||||
contributors may be used to endorse or promote products derived from this
|
||||
software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
-------------------
|
||||
|
||||
Microsoft(R) C Runtime Library:
|
||||
(c) 2007 Microsoft Corporation. All Rights Reserved.
|
||||
|
||||
-------------------
|
||||
|
||||
RSA Security Inc. PKCS #11 Cryptographic Token Interface (Cryptoki):
|
||||
|
||||
License to copy and use this software is granted provided that it is
|
||||
identified as "RSA Security Inc. PKCS #11 Cryptographic Token Interface
|
||||
(Cryptoki)" in all material mentioning or referencing this software.
|
||||
|
||||
License is also granted to make and use derivative works provided that such
|
||||
works are identified as "derived from the RSA Security Inc. PKCS #11
|
||||
Cryptographic Token Interface (Cryptoki)" in all material mentioning or
|
||||
referencing the derived work.
|
||||
|
||||
RSA Security Inc. makes no representations concerning either the
|
||||
merchantability of this software or the suitability of this software for any
|
||||
particular purpose. It is provided "as is" without express or implied warranty
|
||||
of any kind.
|
||||
|
||||
-------------------
|
||||
|
||||
WinPcap:
|
||||
Copyright (c) 2001 - 2003 NetGroup, Politecnico di Torino (Italy)
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
3. Neither the name of the Politecnico di Torino nor the names of its
|
||||
contributors may be used to endorse or promote products derived from this
|
||||
software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
-------------------
|
||||
|
||||
libedit:
|
||||
Copyright (c) 1992, 1993 The Regents of the University of California. All
|
||||
rights reserved.
|
||||
|
||||
This code is derived from software contributed to Berkeley by Christos Zoulas
|
||||
of Cornell University.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
3. Neither the name of the University nor the names of its contributors may be
|
||||
used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
-------------------
|
||||
|
||||
libiconv:
|
||||
|
||||
GNU LIBRARY GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1991 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
Everyone is permitted to copy and distribute verbatim copies of this license
|
||||
document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the library GPL. It is
|
||||
numbered 2 because it goes with version 2 of the ordinary GPL.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your freedom to
|
||||
share and change it. By contrast, the GNU General Public Licenses are intended
|
||||
to guarantee your freedom to share and change free software--to make sure the
|
||||
software is free for all its users.
|
||||
|
||||
This license, the Library General Public License, applies to some specially
|
||||
designated Free Software Foundation software, and to any other libraries whose
|
||||
authors decide to use it. You can use it for your libraries, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not price. Our
|
||||
General Public Licenses are designed to make sure that you have the freedom to
|
||||
distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new free
|
||||
programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid anyone to
|
||||
deny you these rights or to ask you to surrender the rights. These
|
||||
restrictions translate to certain responsibilities for you if you distribute
|
||||
copies of the library, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis or for
|
||||
a fee, you must give the recipients all the rights that we gave you. You must
|
||||
make sure that they, too, receive or can get the source
|
||||
code. If you link a program with the library, you must provide complete object
|
||||
files to the recipients so that they can relink them with the library, after
|
||||
making changes to the library and recompiling it. And you must show them these
|
||||
terms so they know their rights.
|
||||
|
||||
Our method of protecting your rights has two steps: (1) copyright the
|
||||
library, and (2) offer you this license which gives you legal permission to
|
||||
copy, distribute and/or modify the library.
|
||||
|
||||
Also, for each distributor's protection, we want to make certain that
|
||||
everyone understands that there is no warranty for this free library. If the
|
||||
library is modified by someone else and passed on, we want its recipients to
|
||||
know that what they have is not the original version, so that any problems
|
||||
introduced by others will not reflect on the original authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software patents. We
|
||||
wish to avoid the danger that companies distributing free software will
|
||||
individually obtain patent licenses, thus in effect transforming the program
|
||||
into proprietary software. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the ordinary GNU
|
||||
General Public License, which was designed for utility programs. This license,
|
||||
the GNU Library General Public License, applies to certain designated
|
||||
libraries. This license is quite different from the ordinary one; be sure to
|
||||
read it in full, and don't assume that anything in it is the same as in the
|
||||
ordinary license.
|
||||
|
||||
The reason we have a separate public license for some libraries is that they
|
||||
blur the distinction we usually make between modifying or adding to a program
|
||||
and simply using it. Linking a program with a library, without changing the
|
||||
library, is in some sense simply using the library, and is analogous to
|
||||
running a utility program or application program. However, in a textual and
|
||||
legal sense, the linked executable is a combined work, a derivative of the
|
||||
original library, and the ordinary General Public License treats it as such.
|
||||
|
||||
Because of this blurred distinction, using the ordinary General Public
|
||||
License for libraries did not effectively promote software sharing, because
|
||||
most developers did not use the libraries. We concluded that weaker conditions
|
||||
might promote sharing better.
|
||||
|
||||
However, unrestricted linking of non-free programs would deprive the users
|
||||
of those programs of all benefit from the free status of the libraries
|
||||
themselves. This Library General Public License is intended to
|
||||
permit developers of non-free programs to use free libraries, while preserving
|
||||
your freedom as a user of such programs to change the free libraries that are
|
||||
incorporated in them. (We have not seen how to achieve this as regards changes
|
||||
in header files, but we have achieved it as regards changes in the actual
|
||||
functions of the Library.) The hope is that this will lead to faster
|
||||
development of free libraries.
|
||||
|
||||
The precise terms and conditions for copying, distribution and modification
|
||||
follow. Pay close attention to the difference between a "work based on the
|
||||
library" and a "work that uses the library". The former contains code derived
|
||||
from the library, while the latter only works together with the library.
|
||||
|
||||
Note that it is possible for a library to be covered by the ordinary General
|
||||
Public License rather than by this special one.
|
||||
|
||||
GNU LIBRARY GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library which contains a
|
||||
notice placed by the copyright holder or other authorized party saying it may
|
||||
be distributed under the terms of this Library
|
||||
General Public License (also called "this License"). Each licensee is
|
||||
addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data prepared so
|
||||
as to be conveniently linked with application programs (which use some of
|
||||
those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work which has
|
||||
been distributed under these terms. A "work based on the Library" means either
|
||||
the Library or any derivative work under copyright law: that is to say, a work
|
||||
containing the Library or a portion of it, either verbatim or with
|
||||
modifications and/or translated straightforwardly into another language.
|
||||
(Hereinafter, translation is included without limitation in the term
|
||||
"modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for making
|
||||
modifications to it. For a library, complete source code means all the source
|
||||
code for all modules it contains, plus any associated interface definition
|
||||
files, plus the scripts used to control compilation and installation of the
|
||||
library.
|
||||
|
||||
Activities other than copying, distribution and modification are not covered
|
||||
by this License; they are outside its scope. The act of running a program
|
||||
using the Library is not restricted, and output from such a program is covered
|
||||
only if its contents constitute a work based on the Library (independent of
|
||||
the use of the Library in a tool for writing it). Whether that is true depends
|
||||
on what the Library does and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's complete
|
||||
source code as you receive it, in any medium, provided that you conspicuously
|
||||
and appropriately publish on each copy an appropriate copyright notice and
|
||||
disclaimer of warranty; keep intact all the notices that refer to this License
|
||||
and to the absence of any warranty; and distribute a copy of this License
|
||||
along with the Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and you
|
||||
may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion of it,
|
||||
thus forming a work based on the Library, and copy and distribute such
|
||||
modifications or work under the terms of Section 1 above, provided that you
|
||||
also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices stating
|
||||
that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no charge to all
|
||||
third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a table
|
||||
of data to be supplied by an application program that uses the facility, other
|
||||
than as an argument passed when the facility is invoked, then you must make a
|
||||
good faith effort to ensure that, in the event an application does not supply
|
||||
such function or table, the facility still operates, and performs whatever
|
||||
part of its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has a
|
||||
purpose that is entirely well-defined independent of the application.
|
||||
Therefore, Subsection 2d requires that any application-supplied function or
|
||||
table used by this function must be optional: if the application does not
|
||||
supply it, the square root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If identifiable
|
||||
sections of that work are not derived from the Library, and can be reasonably
|
||||
considered independent and separate works in themselves, then this License,
|
||||
and its terms, do not apply to those sections when you distribute them as
|
||||
separate works. But when you distribute the same sections as part of a whole
|
||||
which is a work based on the Library, the distribution of the whole must be on
|
||||
the terms of this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest your
|
||||
rights to work written entirely by you; rather, the intent is to exercise the
|
||||
right to control the distribution of derivative or collective works based on
|
||||
the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library with
|
||||
the Library (or with a work based on the Library) on a volume of a storage or
|
||||
distribution medium does not bring the other work under the scope of this
|
||||
License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do this,
|
||||
you must alter all the notices that refer to this License, so that they refer
|
||||
to the ordinary GNU General Public License, version 2, instead of to this
|
||||
License. (If a newer version than version 2 of the ordinary GNU General Public
|
||||
License has appeared, then you can specify that version instead if you wish.)
|
||||
Do not make any other change in these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for that copy,
|
||||
so the ordinary GNU General Public License applies to all subsequent copies
|
||||
and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of the Library
|
||||
into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or derivative of
|
||||
it, under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you accompany it with the complete
|
||||
corresponding machine-readable source code, which must be distributed under
|
||||
the terms of Sections 1 and 2 above on a medium customarily used for software
|
||||
interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy from a
|
||||
designated place, then offering equivalent access to copy the source code from
|
||||
the same place satisfies the requirement to distribute the source code, even
|
||||
though third parties are not compelled to copy the source along with the
|
||||
object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the Library, but
|
||||
is designed to work with the Library by being compiled or linked with it, is
|
||||
called a "work that uses the Library". Such a work, in isolation, is not a
|
||||
derivative work of the Library, and therefore falls outside the scope of this
|
||||
License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library creates an
|
||||
executable that is a derivative of the Library (because it contains portions
|
||||
of the Library), rather than a "work that uses the library". The executable is
|
||||
therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file that is
|
||||
part of the Library, the object code for the work may be a derivative work of
|
||||
the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be linked
|
||||
without the Library, or if the work is itself a library. The threshold for
|
||||
this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data structure
|
||||
layouts and accessors, and small macros and small inline functions (ten lines
|
||||
or less in length), then the use of the object file is unrestricted,
|
||||
regardless of whether it is legally a derivative work. (Executables containing
|
||||
this object code plus portions of the Library will still fall under Section
|
||||
6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may distribute
|
||||
the object code for the work under the terms of Section 6. Any executables
|
||||
containing that work also fall under Section 6, whether or not they are linked
|
||||
directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also compile or link a
|
||||
"work that uses the Library" with the Library to produce a work containing
|
||||
portions of the Library, and distribute that work under terms of your choice,
|
||||
provided that the terms permit modification of the work for the customer's own
|
||||
use and reverse engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the Library
|
||||
is used in it and that the Library and its use are covered by this License.
|
||||
You must supply a copy of this License. If the work during execution displays
|
||||
copyright notices, you must include the copyright notice for the Library among
|
||||
them, as well as a reference directing the user to the copy of this License.
|
||||
Also, you must do one of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding machine-readable
|
||||
source code for the Library including whatever changes were used in the work
|
||||
(which must be distributed under Sections 1 and 2 above) ; and, if the work is
|
||||
an executable linked with the Library, with the complete machine-readable
|
||||
"work that uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified executable
|
||||
containing the modified Library. (It is understood that the user who changes
|
||||
the contents of definitions files in the Library will not necessarily be able
|
||||
to recompile the application to use the modified definitions.)
|
||||
|
||||
b) Accompany the work with a written offer, valid for at least three
|
||||
years, to give the same user the materials specified in Subsection 6a, above,
|
||||
for a charge no more than the cost of performing this distribution.
|
||||
|
||||
c) If distribution of the work is made by offering access to copy from a
|
||||
designated place, offer equivalent access to copy the above specified
|
||||
materials from the same place.
|
||||
|
||||
d) Verify that the user has already received a copy of these materials or
|
||||
that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the Library"
|
||||
must include any data and utility programs needed for reproducing the
|
||||
executable from it. However, as a special exception, the source code
|
||||
distributed need not include anything that is normally distributed (in either
|
||||
source or binary form) with the major components (compiler, kernel, and so on)
|
||||
of the operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license restrictions of
|
||||
other proprietary libraries that do not normally accompany the operating
|
||||
system. Such a contradiction means you cannot use both them and the Library
|
||||
together in an executable that you distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the Library
|
||||
side-by-side in a single library together with other library facilities not
|
||||
covered by this License, and distribute such a combined library, provided that
|
||||
the separate distribution of the work based on the Library and of the other
|
||||
library facilities is otherwise permitted, and provided that you do these two
|
||||
things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work based on
|
||||
the Library, uncombined with any other library facilities. This must be
|
||||
distributed under the terms of the Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact that part
|
||||
of it is a work based on the Library, and explaining where to find the
|
||||
accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute the
|
||||
Library except as expressly provided under this License. Any attempt otherwise
|
||||
to copy, modify, sublicense, link with, or distribute the Library is void, and
|
||||
will automatically terminate your rights under this License. However, parties
|
||||
who have received copies, or rights, from you under this License will not have
|
||||
their licenses terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not signed
|
||||
it. However, nothing else grants you permission to modify or distribute the
|
||||
Library or its derivative works. These actions are prohibited by law if you do
|
||||
not accept this License. Therefore, by modifying or distributing the Library
|
||||
(or any work based on the Library), you indicate your acceptance of this
|
||||
License to do so, and all its terms and conditions for copying, distributing
|
||||
or modifying the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the original
|
||||
licensor to copy, distribute, link with or modify the Library subject to these
|
||||
terms and conditions. You may not impose any further restrictions on the
|
||||
recipients' exercise of the rights granted herein. You are not responsible for
|
||||
enforcing compliance by third parties to this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or otherwise)
|
||||
that contradict the conditions of this License, they do not excuse you from
|
||||
the conditions of this License. If you cannot distribute so as to satisfy
|
||||
simultaneously your obligations under this License and any other pertinent
|
||||
obligations, then as a consequence you may not distribute the Library at all.
|
||||
For example, if a patent license would not permit royalty-free redistribution
|
||||
of the Library by all those who receive copies directly or indirectly through
|
||||
you, then the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply, and
|
||||
the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any patents or
|
||||
other property right claims or to contest validity of any such claims; this
|
||||
section has the sole purpose of protecting the integrity of the free software
|
||||
distribution system which is implemented by public license practices. Many
|
||||
people have made generous contributions to the wide range of software
|
||||
distributed through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing to
|
||||
distribute software through any other system and a licensee cannot impose that
|
||||
choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to be a
|
||||
consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in certain
|
||||
countries either by patents or by copyrighted interfaces, the original
|
||||
copyright holder who places the Library under this License may add an explicit
|
||||
geographical distribution limitation excluding those countries, so that
|
||||
distribution is permitted only in or among countries not thus excluded. In
|
||||
such case, this License incorporates the limitation as if written in the body
|
||||
of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new versions of
|
||||
the Library General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and "any later
|
||||
version", you have the option of following the terms and conditions either of
|
||||
that version or of any later version published by the Free Software
|
||||
Foundation. If the Library does not specify a license version number, you may
|
||||
choose any version ever published by the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free programs
|
||||
whose distribution conditions are incompatible with these, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free Software
|
||||
Foundation, write to the Free Software Foundation; we sometimes make
|
||||
exceptions for this. Our decision will be guided by the two goals of
|
||||
preserving the free status of all derivatives of our free software and of
|
||||
promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR
|
||||
THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE
|
||||
STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE
|
||||
LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
|
||||
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
|
||||
PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE,
|
||||
YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO
|
||||
LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR
|
||||
THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
-------------------
|
||||
|
||||
ncurses:
|
||||
Copyright (c) 1998-2005,2006 Free Software Foundation, Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, distribute with
|
||||
modifications, sublicense, and/or sell copies of the Software, and to permit
|
||||
persons to whom the Software is furnished to do so, subject to the following
|
||||
conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
|
||||
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
Except as contained in this notice, the name(s) of the above copyright holders
|
||||
shall not be used in advertising or otherwise to promote the sale, use or
|
||||
other dealings in this Software without prior written authorization.
|
||||
|
||||
-------------------
|
||||
|
||||
OpenSSL:
|
||||
OpenSSL License
|
||||
Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. All advertising materials mentioning features or use of this software must
|
||||
display the following acknowledgment: "This product includes software
|
||||
developed by the OpenSSL Project for use in the OpenSSL Toolkit.
|
||||
(http://www.openssl.org/)"
|
||||
|
||||
4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||
endorse or promote products derived from this software without prior written
|
||||
permission. For written permission, please contact openssl-core@openssl.org.
|
||||
|
||||
5. Products derived from this software may not be called "OpenSSL" nor may
|
||||
"OpenSSL" appear in their names without prior written permission of the
|
||||
OpenSSL Project.
|
||||
|
||||
6. Redistributions of any form whatsoever must retain the following
|
||||
acknowledgment: "This product includes software developed by the OpenSSL
|
||||
Project for use in the OpenSSL Toolkit (http://www.openssl.org/)"
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY EXPRESSED
|
||||
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
EVENT SHALL THE OpenSSL PROJECT OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
This product includes cryptographic software written by Eric Young
|
||||
(eay@cryptsoft.com). This product includes software written by Tim Hudson
|
||||
(tjh@cryptsoft.com).
|
||||
|
||||
Original SSLeay License
|
||||
Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) All rights reserved.
|
||||
|
||||
This package is an SSL implementation written by Eric Young
|
||||
(eay@cryptsoft.com). The implementation was written so as to conform with
|
||||
Netscapes SSL.
|
||||
|
||||
This library is free for commercial and non-commercial use as long as the
|
||||
following conditions are aheared to. The following conditions apply to all
|
||||
code found in this distribution, be it the RC4, RSA, lhash, DES, etc., code;
|
||||
not just the SSL code. The SSL documentation included with this distribution
|
||||
is covered by the same copyright terms except that the holder is Tim Hudson
|
||||
(tjh@cryptsoft.com).
|
||||
|
||||
Copyright remains Eric Young's, and as such any Copyright notices in the code
|
||||
are not to be removed. If this package is used in a product, Eric Young should
|
||||
be given attribution as the author of the parts of the library used. This can
|
||||
be in the form of a textual message at program startup or in documentation
|
||||
(online or textual) provided with the package.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
1. Redistributions of source code must retain the copyright notice, this list
|
||||
of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
3. All advertising materials mentioning features or use of this software must
|
||||
display the following acknowledgement: "This product includes cryptographic
|
||||
software written by Eric Young (eay@cryptsoft.com)" The word 'cryptographic'
|
||||
can be left out if the rouines from the library being used are not
|
||||
cryptographic related :-).
|
||||
4. If you include any Windows specific code (or a derivative thereof) from the
|
||||
apps directory (application code) you must include an acknowledgement: "This
|
||||
product includes software written by Tim Hudson (tjh@cryptsoft.com)"
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
The licence and distribution terms for any publically available version or
|
||||
derivative of this code cannot be changed. i.e. this code cannot simply be
|
||||
copied and put under another distribution licence [including the GNU Public
|
||||
Licence.]
|
||||
|
||||
-------------------
|
||||
|
||||
zlib:
|
||||
Acknowledgments:
|
||||
The deflate format used by zlib was defined by Phil Katz. The deflate and
|
||||
zlib specifications were written by L. Peter Deutsch. Thanks to all the people
|
||||
who reported problems and suggested various improvements in zlib; they are too
|
||||
numerous to cite here.
|
||||
|
||||
Copyright notice:
|
||||
(C) 1995-2004 Jean-loup Gailly and Mark Adler
|
||||
|
||||
This software is provided 'as-is', without any express or implied warranty.
|
||||
In no event will the authors be held liable for any damages arising from the
|
||||
use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it freely,
|
||||
subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software in a
|
||||
product, an acknowledgment in the product documentation would be appreciated
|
||||
but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
Jean-loup Gailly Mark Adler
|
||||
jloup@gzip.org madler@alumni.caltech.edu
|
||||
|
||||
If you use the zlib library in a product, we would appreciate *not* receiving
|
||||
lengthy legal documents to sign. The sources are provided for free but without
|
||||
warranty of any kind. The library has been entirely written by Jean-loup
|
||||
Gailly and Mark Adler; it does not include third-party code.
|
||||
|
||||
If you redistribute modified sources, we would appreciate that you include in
|
||||
the file ChangeLog history information documenting your changes. Please read
|
||||
the FAQ for more information on the distribution of modified source versions.
|
||||
|
||||
-------------------
|
||||
|
||||
Intel AESNI Sample Library:
|
||||
|
||||
Copyright (c) 2010, Intel Corporation
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
Issue Date: Aug 6, 2010
|
||||
|
||||
-------------------
|
||||
|
||||
NOTES WRITTEN BY SOFTETHER CORPORATION
|
||||
|
||||
Note for users of non-Windows version of PacketiX VPN: The enumerated bundle
|
||||
of License Agreements above are copies of original License Agreements of each
|
||||
library programs which PacketiX VPN uses. PacketiX VPN is not a delivered work
|
||||
from these libraries. PacketiX VPN is a separated work from the libraries, but
|
||||
it may call functions of the libraries (whether or not PacketiX VPN calls such
|
||||
functions are depended on the user's intention to link them or not on user's
|
||||
side computer). While some libraries indicate GPL or LGPL as a condition to
|
||||
re-distribute, PacketiX VPN is not license under GPL nor LGPL. Therefore, we
|
||||
took special care not to make PacketiX VPN become delivered works of any GPL
|
||||
or LGPL libraries. In order to achieve that, both PacketiX VPN and GPL/LGPL
|
||||
libraries are distributed with isolated forms (means that any program files of
|
||||
PacketiX VPN are not bound nor linked to any GPL/LGPL libraries). If a user of
|
||||
PacketiX VPN wants to link GPL/LGPL libraries by their own decisions,
|
||||
operations and responsibilities, he may do that on his computer. However, if a
|
||||
delivered work under copyright law is created as a result of such an
|
||||
operation, such a delivered work must not re-distributed to other people,
|
||||
because it may violate GPL/LGPL libraries' conditions.
|
||||
|
||||
Note for users of Windows version of PacketiX VPN: For technical reason, the
|
||||
above texts are exactly same as a file which is also contained on the
|
||||
non-Windows version of PacketiX VPN. Actually, the Windows version of PacketiX
|
||||
VPN has no relations to any GPL/LGPL libraries enumerated above.
|
||||
|
||||
SoftEther Corporation provides source codes of some GPL/LGPL/other libraries
|
||||
listed above on its web server. Anyone can download, use and re-distribute
|
||||
them under individual licenses which are contained on each archive file,
|
||||
available from the following URL:
|
||||
http://uploader.softether.co.jp/src/
|
||||
|
523
src/WARNING.TXT
Normal file
523
src/WARNING.TXT
Normal file
@ -0,0 +1,523 @@
|
||||
THE IMPORTANT NOTICES ABOUT SOFTETHER VPN
|
||||
|
||||
FUNCTIONS OF VPN COMMUNICATIONS EMBEDDED ON THIS SOFTWARE ARE VERY POWERFUL
|
||||
THAN EVER. THIS STRONG VPN ABILITY WILL BRING YOU HUGE BENEFITS. HOWEVER, IF
|
||||
YOU MISUSE THIS SOFTWARE, IT MIGHT DAMAGES YOURSELF. IN ORDER TO AVOID SUCH
|
||||
RISKS, THIS DOCUMENT ACCOUNTS IMPORTANT NOTICES FOR CUSTOMERS WHO ARE WILLING
|
||||
TO USE THIS SOFTWARE. THE FOLLOWING INSTRUCTIONS ARE VERY IMPORTANT. READ AND
|
||||
UNDERSTAND IT CAREFULLY. ADDITIONALLY, IF YOU ARE PLANNING TO USE THE DYNAMIC
|
||||
DNS, THE NAT TRAVERSAL OR THE VPN AZURE FUNCTIONS, READ THE SECTION 3.5
|
||||
CAREFULLY. THESE FUNCTIONS ARE FREE SERVICES PROVIDED VIA THE INTERNET, ARE
|
||||
NOT GUARANTEED, AND ARE NOT INTENDED TO BE USED FOR BUSINESS OR COMMERCIAL
|
||||
USE. DO NOT USE THESE SERVICES FOR YOUR BUSINESS OR COMMERCIAL USE.
|
||||
|
||||
|
||||
1. VPN Communication Protocols
|
||||
1.1. SoftEther VPN Protocol
|
||||
SoftEther VPN can perform VPN communication. Unlike traditional VPN protocols,
|
||||
SoftEther VPN has an implementation of the newly-designed "SoftEther VPN
|
||||
Protocol (SE-VPN Protocol)" . SE-VPN protocol encapsulates any Ethernet
|
||||
packets into a HTTPS (HTTP over SSL) connection. Therefore SE-VPN protocol can
|
||||
communicate beyond firewalls even if the firewall is configured to block
|
||||
traditional VPN packets by network administrator. SE-VPN protocol is designed
|
||||
and implemented to comply TLS 1.0 (RFC 5246) and HTTPS (RFC 2818). However, it
|
||||
sometimes have different behavior to RFCs. If you are a network administrator
|
||||
and want to block SE-VPN protocols on the firewall, you can adopt a
|
||||
"white-list" policy on the firewall to filter any TCP or UDP packets on the
|
||||
border except explicitly allowed packets towards specific web sites and
|
||||
servers.
|
||||
|
||||
1.2. NAT Traversal Function
|
||||
Generally, if you use traditional VPN systems you have to request a network
|
||||
administrator to make the NAT or firewall to "open" or "relay" specific TCP or
|
||||
UDP ports. However, there are demands somehow to eliminate such working costs
|
||||
on network administrators. In order to satisfy such demands, SoftEther VPN has
|
||||
the newly-implemented "NAT Traversal" function. NAT Traversal is enabled by
|
||||
default. A SoftEther VPN Server running on the computer behind NAT or firewall
|
||||
can accept VPN connections from the Internet, without any special
|
||||
configurations on firewalls or NATs. If you want to disable the NAT Traversal
|
||||
function, modify the "DisableNatTraversal" to "true" on the configuration file
|
||||
of SoftEther VPN Server. In order to disable it on the client-side, append
|
||||
"/tcp" suffix on the destination hostname.
|
||||
|
||||
1.3. Dynamic DNS Function
|
||||
Traditional legacy VPN system requires a static global IP address on the VPN
|
||||
server. In consideration of shortage of global IP addresses, SoftEther
|
||||
Corporation implements the "Dynamic DNS Function" on SoftEther VPN Server.
|
||||
Dynamic DNS is enabled by default. Dynamic DNS function notify the current
|
||||
global IP address of the PC to the Dynamic DNS Servers which are operated by
|
||||
SoftEther Corporation. A globally-unique hostname (FQDN) such as
|
||||
"abc.softether.net" ( "abc" varies as unique per a user) will be assigned on
|
||||
the VPN Server. If you tell this unique hostname to a VPN user, the user can
|
||||
specify it as the destination VPN Sever hostname on the VPN Client and will be
|
||||
able to connect the VPN Server. No IP addresses are required to know
|
||||
beforehand. If the IP address of the VPN Server varies, the registered IP
|
||||
address related to the hostname of Dynamic DNS service will be changed
|
||||
automatically. By this mechanism, no longer need a static global IP address
|
||||
which costs monthly to ISPs. You can use consumer-level inexpensive Internet
|
||||
connection with dynamic IP address in order to operate an enterprise-level VPN
|
||||
system. If you want to disable Dynamic DNS, specify "true" on the "Disabled"
|
||||
items of the "DDnsClient" directive on the SoftEther VPN Server configuration
|
||||
file. * Note for residents in People's Republic of China: If your VPN Server
|
||||
is running on the People's Republic of China, the DNS suffix will be replaced
|
||||
to "sedns.cn" domain. The "sedns.cn" domain is the service possessed and
|
||||
operated by "Beijing Daiyuu SoftEther Technology Co., Ltd" which is a
|
||||
Chinese-local enterprise.
|
||||
|
||||
1.4. VPN over ICMP / VPN over DNS functions
|
||||
If you want to make a VPN connection between SoftEther VPN Client / Bridge and
|
||||
SoftEther VPN Server, but if TCP and UDP packets are prohibited by the
|
||||
firewall, then you can encapsulates payloads into "ICMP" (as known as Ping) or
|
||||
"DNS" packets. This function can realize a VPN connection by using ICMP or DNS
|
||||
even if the firewall or router blocks every TCP or UDP connections. VPN over
|
||||
ICMP / VPN over DNS functions are designed to comply standard ICMP and DNS
|
||||
specifications as possible, however it sometimes has a behavior not to fully
|
||||
comply them. Therefore, few poor-quality routers may be caused a
|
||||
memory-overflow or something troubles when a lot of ICMP or DNS packets are
|
||||
passed, and such routers sometimes freezes or reboots. It might affects other
|
||||
users on the same network. To avoid such risks, append the suffix "/tcp" on
|
||||
the destination hostname which is specified on the VPN-client side to disable
|
||||
VPN over ICMP / DNS functions.
|
||||
|
||||
1.5. VPN Azure Cloud Service
|
||||
If your SoftEther VPN Server is placed behind the NAT or firwall, and by some
|
||||
reason you cannot use NAT Traversal function, Dynamic DNS function or VPN over
|
||||
ICMP/DNS function, you can use VPN Azure Clouse Service. SoftEther Corporation
|
||||
operates VPN Azure Cloud on Internet. After the VPN Server makes a connection
|
||||
to the VPN Azure Cloud, the hostname "abc.vpnazure.net" ( "abc" is a unique
|
||||
hostname) can be specified to connect to the VPN Server via the VPN Azure
|
||||
Cloud. Practically, such a hostname is pointing a global IP address of one of
|
||||
cloud servers which are operated by SoftEther Corporation. If A VPN Client
|
||||
connects to such a VPN Azure host, then the VPN Azure host will relay all
|
||||
traffics between the VPN Client and the VPN Server. VPN Azure is disabled by
|
||||
default. You can activate it easily by using VPN Server Configuration Tool.
|
||||
|
||||
1.6. UDP Acceleration
|
||||
SoftEther VPN has the UDP Acceleration Function. If a VPN consists of two
|
||||
sites detects that UDP channel can be established, UDP will be automatically
|
||||
used. By this function, throughput of UDP increases. If direct UDP channel can
|
||||
be established, direct UDP packets will be used. However, if there is
|
||||
something obstacles such as firewalls or NATs, the "UDP Hole Punching"
|
||||
technology will be used, instead. The "UDP Hole Punching" uses the cloud
|
||||
servers which SoftEther Corporation operates on Internet. UDP Acceleration can
|
||||
be disabled anytime by setting up so on the VPN-client side.
|
||||
|
||||
|
||||
2. VPN Software
|
||||
2.1. SoftEther VPN Client
|
||||
If you use SoftEther VPN Client on Windows, the Virtual Network Adapter device
|
||||
driver will be installed on Windows. The Virtual Network Adapter is
|
||||
implemented as a kernel-mode driver for Windows. The driver is
|
||||
digitally-signed by a certificate issued by VeriSign, Inc. and also sub-signed
|
||||
by Symantec Corporation. A message to ask you want to sure install the driver
|
||||
might be popped up on the screen. SoftEther VPN Client may response the
|
||||
message if possible. SoftEther VPN Client also optimizes the configuration of
|
||||
MMCSS (Multimedia Class Scheduler Service) on Windows. You can undo the
|
||||
optimizations of MMCSS afterwards.
|
||||
|
||||
2.2. SoftEther VPN Server / Bridge
|
||||
If you use SoftEther VPN Server / Bridge on Windows with "Local Bridge"
|
||||
functions, you have to install the low-level Ethernet packet processing driver
|
||||
on the computer. The driver is digitally-signed by a certificate issued by
|
||||
VeriSign, Inc. and also sub-signed by Symantec Corporation. SoftEther VPN
|
||||
Server / Bridge may disable the TCP/IP offloading features on the physical
|
||||
network adapter for Local Bridge function. In Windows Vista / 2008 or greater
|
||||
version, VPN Server may inject a packet-filter driver which complies Windows
|
||||
Filter Platform (WPF) specification into the kernel in order to provide IPsec
|
||||
function. The packet-filter driver will be loaded available only if IPsec
|
||||
function is enabled. Once you enables IPsec function of SoftEther VPN Server,
|
||||
the built-in IPsec function of Windows will be disabled. After you disabled
|
||||
IPsec function of SoftEther VPN Server, then the built-in IPsec function of
|
||||
Windows will revive. In order to provide the Local Bridge function, SoftEther
|
||||
VPN Server / Bridge disables the TCP/IP offloading function on the operating
|
||||
system.
|
||||
|
||||
2.3. User-mode Installation
|
||||
You can install SoftEther VPN Server and SoftEther VPN Bridge as "User-mode"
|
||||
on Windows. In other words, even if you don't have Windows system
|
||||
administrator's privileges, you can install SoftEther VPN as a normal user.
|
||||
User-mode install will disable a few functions, however other most functions
|
||||
work well. Therefore, for example, an employee can install SoftEther VPN
|
||||
Server on the computer in the office network, and he will be able to connect
|
||||
to the server from his home. In order to realize such a system by user-self,
|
||||
no system administrative privileges are required in the view-point of
|
||||
technical. However, breaking rules of the company to install software on the
|
||||
computer without authority might be regarded as an unfavorable behavior. If
|
||||
you are an employee and belong to the company, and the company-policy
|
||||
prohibits installing software or making communications towards Internet
|
||||
without permission, you have to obtain a permission from the network
|
||||
administrator or the executive officer of your company in advance to install
|
||||
SoftEther VPN. If you install VPN Server / Bridge as User-mode, an icon will
|
||||
be appeared on the Windows task-tray. If you feel that the icon disturbs you,
|
||||
you can hide it by your operation. However, you must not exploit this hiding
|
||||
function to install VPN Server on other person's computer as a spyware. Such
|
||||
behavior might be an offence against the criminal law.
|
||||
|
||||
2.4. Keep Alive Function
|
||||
SoftEther VPN Server and SoftEther VPN Bridge has Keep Alive Function by
|
||||
default. The purpose of this function is to sustain the Internet line active.
|
||||
The function transmits UDP packets with a random-byte-array-payload
|
||||
periodically. This function is useful to avoid automatic disconnection on
|
||||
mobile or dial-up connections. You can disable Keep Alive Function anytime.
|
||||
|
||||
2.5. Uninstallation
|
||||
The uninstallation process of SoftEther VPN software will delete all program
|
||||
files. However, non-program files (such as files and data which are generated
|
||||
by running of programs) ) will not be deleted. For technical reason, the exe
|
||||
and resource files of uninstaller might remain. Such remaining files never
|
||||
affects to use the computer, however you can delete it manually. Kernel-mode
|
||||
drivers might not be deleted, however such drivers will not be loaded after
|
||||
the next boot of Windows. You can use "sc" command of Windows to delete
|
||||
kernel-mode drivers manually.
|
||||
|
||||
2.6. Security
|
||||
You should set the administrator's password on SoftEther VPN Server / Bridge
|
||||
after installation. If you neglect to do it, another person can access to
|
||||
SoftEther VPN Server / Bridge and can set the password without your
|
||||
permission. This caution might be also applied on SoftEther VPN Client for
|
||||
Linux.
|
||||
|
||||
2.7. Automatic Update Notification
|
||||
SoftEther VPN software for Windows has an automatic update notification
|
||||
function. It accesses to the SoftEther Update server periodically to check
|
||||
whether or not the latest version of software is released. If the latest
|
||||
version is released, the notification message will be popped up on the screen.
|
||||
In order to achieve this purpose, the version, language settings, the unique
|
||||
identifier, the IP address of your computer and the hostname of VPN Server
|
||||
which is connected to will be sent to the SoftEther Update server. No personal
|
||||
information will be sent. Automatic Update Notification is enabled by default,
|
||||
however you can disable it on the configuration screen. The setting whether
|
||||
turned on or turned off will be saved individually corresponding to each
|
||||
destination VPN server, by VPN Server Manager.
|
||||
|
||||
2.8. Virtual NAT Function
|
||||
A Virtual Hub on SoftEther VPN Server / Bridge has "Virtual NAT Function" .
|
||||
Virtual NAT Function can share a single IP address on the physical network by
|
||||
multiple private IP address of VPN Clients. There are two operation mode of
|
||||
Virtual NAT: User-mode and Kernel-mode. In the user-mode operation, Virtual
|
||||
NAT shares an IP address which is assigned on the host operating system.
|
||||
Unlike user-mode, the kernel-mode operation attempts to find DHCP servers on
|
||||
the physical network. If there are two or more physical networks, a DHCP
|
||||
server will be sought automatically for each segments serially. If a DHCP
|
||||
server found, and an IP address is acquired, the IP address will be used by
|
||||
the Virtual NAT. In this case, an IP entry as a DHCP client will be registered
|
||||
on the IP pool of the physical DHCP Server. The physical default gateway and
|
||||
the DNS server will be used by the Virtual NAT in order to communicate with
|
||||
hosts in Internet. In kernel-mode operation, a Virtual Hub has a virtual MAC
|
||||
address which is operating on the physical Ethernet segment. In order to check
|
||||
the connectivity to Internet, SoftEther VPN periodically sends DNS query
|
||||
packet to resolve the IP address of host "www.yahoo.com" or "www.baidu.com" ,
|
||||
and attempts to connect to the TCP port 80 of such a resulted IP address for
|
||||
connectivity check.
|
||||
|
||||
2.9. Unattended Installation of Kernel-mode Components
|
||||
When SoftEther VPN will detect a necessity to install the kernel-mode
|
||||
components on Windows, a confirmation message will be appeared by Windows
|
||||
system. In this occasion, SoftEther VPN software will switch to the Unattended
|
||||
Installation mode in order to respond "Yes" to Windows. This is a solution to
|
||||
prevent dead-locks when a remote-administration is performed from remote
|
||||
place.
|
||||
|
||||
2.10. Windows Firewall
|
||||
SoftEther VPN software will register itself as a safe-program. Such an entry
|
||||
will be remain after the uninstallation. You can remove it manually from the
|
||||
Control Panel of Windows.
|
||||
|
||||
|
||||
3. Internet Services
|
||||
3.1. Internet Services which are provided by SoftEther Corporation
|
||||
SoftEther Corporation provides Dynamic DNS, NAT Traversal and VPN Azure server
|
||||
services on the Internet. These services are free of charge. Customers can
|
||||
access to the services by using SoftEther VPN software, via Internet. These
|
||||
service will be planned to be available from Open-Source version of "SoftEther
|
||||
VPN" which will be released in the future.
|
||||
|
||||
3.2. Sent Information and Privacy Protection
|
||||
SoftEther VPN software may send an IP address, hostname, the version of VPN
|
||||
software on the customer's computer to the cloud service operated by SoftEther
|
||||
Corporation, in order to use the above services. These sending of information
|
||||
are minimal necessary to use the services. No personal information will be
|
||||
sent. SoftEther Corporation records log files of the cloud service servers for
|
||||
90 days at least with the received information. Such logs will be used for
|
||||
troubleshooting and other legitimate activities. SoftEther Corporation may
|
||||
provide logs to a public servant of Japanese government who are belonging to
|
||||
courts, police stations and the prosecutor's office, in order to comply such
|
||||
authorities' order. (Every Japanese public servants are liable by law to keep
|
||||
the information close.) Moreover, the IP addresses or other information will
|
||||
be processed statistically and provided to the public, not to expose the each
|
||||
concrete IP address, in order to release the release of research activities.
|
||||
|
||||
3.3. Communication Data via VPN Azure Service
|
||||
Regardless of the above 3.2 rule, if the customer sends or receives VPN
|
||||
packets using VPN Azure Cloud Service, the actual payloads will stored and
|
||||
forwarded via the volatile memory of the servers for very short period. Such a
|
||||
behavior is naturally needed to provide the "VPN relay service" . No payloads
|
||||
will be recorded on "fixed" storages such as hard-drives. However, the
|
||||
"Wiretapping for Criminals Procedures Act" (The 137th legislation ruled on
|
||||
August 18, 1999 in Japan) requires telecommunication companies to allow the
|
||||
Japanese government authority to conduct a wire-tapping on the line. VPN Azure
|
||||
Servers which are physically placed on Japan are subjects of this law.
|
||||
|
||||
3.4. Comply to Japanese Telecommunication Laws
|
||||
SoftEther Corporation complies with Japanese Telecommunication Laws as
|
||||
necessary to provide online services via Internet.
|
||||
|
||||
3.5. Free and Academic Experiment Services
|
||||
SoftEther provides Dynamic DNS, NAT Traversal and VPN Azure as academic
|
||||
experiment services. Therefore, there services can be used for free of charge.
|
||||
These services are not parts of "SoftEther VPN Software Products" . These
|
||||
services are provided without any warranty. The services may be suspended or
|
||||
discontinued by technical or operational matters. In such occasions, users
|
||||
will not be able to use the services. A user have to understand such risks,
|
||||
and to acknowledge that such risks are borne by a user-self. SoftEther will
|
||||
never be liable to results or damages of use or unable-to-use of the service.
|
||||
Even if the user has already paid the license-fee of the commercial version of
|
||||
SoftEther VPN, such paid fees don't include any fees of these services.
|
||||
Therefore, if the online services will stop or be discontinued, no refunds or
|
||||
recoveries of damages will be provided by SoftEther Corporation.
|
||||
|
||||
3.6. DNS Proxy Cloud Servers
|
||||
In some regions, when a user uses Internet, a DNS query sometimes broken or
|
||||
lost when it is passing through the ISP line. If SoftEther VPN Server, Client
|
||||
or Bridge detects a possibility that the accessing to the actual VPN server
|
||||
might be unstable, then DNS queries will be also transferred to the DNS proxy
|
||||
cloud servers which are operated by SoftEther Corporation. A DNS proxy cloud
|
||||
server will respond DNS queries with answering correct a IP address.
|
||||
|
||||
|
||||
4. General Cautions
|
||||
4.1. Needs an Approval from Network Administrator
|
||||
SoftEther VPN has powerful functions which don't require special settings by
|
||||
network administrators. For example, you need not to ask the administrator to
|
||||
configure the existing firewall in order to "open" a TCP/UDP port. Such
|
||||
characteristic features are for the purpose to eliminate working times and
|
||||
costs of network administrators, and avoid misconfiguration-risks around the
|
||||
tasks to open specific exception ports on the firewall. However, any employees
|
||||
belong to the company have to obtain an approval from the network
|
||||
administrator before installs SoftEther VPN. If your network administrator
|
||||
neglects to provide such an approval, you can consider to take an approval
|
||||
from an upper authority. (For example, executive officer of the company.) If
|
||||
you use SoftEther VPN without any approvals from the authority of your
|
||||
company, you might have disadvantage. SoftEther Corporation will be never
|
||||
liable for results or damages of using SoftEther VPN.
|
||||
|
||||
4.2. Observe Laws of Your Country
|
||||
If your country's law prohibits the use of encryption, you have to disable the
|
||||
encryption function of SoftEther VPN by yourself. Similarly, in some countries
|
||||
or regions, some functions of SoftEther VPN might be prohibited to use by
|
||||
laws. Other countries' laws are none of SoftEther Corporation's concern
|
||||
because SoftEther Corporation is an enterprise which is located and registered
|
||||
in Japan physically. For example, there might be a risk that a part of
|
||||
SoftEther VPN conflicts an existing patent which is valid only on the specific
|
||||
region. SoftEther Corporation has no interests in such specific region outside
|
||||
Japan's territory. Therefore, if you want to use SoftEther VPN in regions
|
||||
outside Japan, you have to be careful not to violate third-person's rights.
|
||||
You have to verify the legitimacy of the use of SoftEther VPN in the specific
|
||||
region before you actually use it in such region. By nature, there are almost
|
||||
200 countries in the World, and each country's law is different each other. It
|
||||
is practically impossible to verify every countries' laws and regulations and
|
||||
make the software comply with all countries' laws in advance to release the
|
||||
software. Therefore SoftEther Corporation has verified the legitimacy of
|
||||
SoftEther VPN against the laws and regulations of only Japan. If a user uses
|
||||
SoftEther VPN in a specific country, and damaged by public servants of the
|
||||
government authority, SoftEther Corporation will never be liable to recover or
|
||||
compensate such damages or criminal responsibilities.
|
||||
|
||||
|
||||
5. VPN Gate Academic Experiment Project
|
||||
(This chapter applies only on SoftEther VPN software package which contains
|
||||
the extension plug-in for VPN Gate Academic Experiment Project.)
|
||||
5.1. About VPN Gate Academic Experiment Project
|
||||
VPN Gate Academic Experiment Project is an online service operated for just
|
||||
the academic research purpose at the graduate school of University of Tsukuba,
|
||||
Japan. The purpose of this research is to expend our knowledge about the
|
||||
"Global Distributed Public VPN Relay Server" (GDPVRS) technology. For details,
|
||||
please visit http://www.vpngate.net/.
|
||||
|
||||
5.2. About VPN Gate Service
|
||||
SoftEther VPN Server and SoftEther VPN Client may contain "VPN Gate Service"
|
||||
program. However, VPN Gate Service is disabled by default.
|
||||
VPN Gate Service should be activated and enabled by the voluntary intention of
|
||||
the owner of the computer which SoftEther VPN Server or SoftEther VPN Client
|
||||
is installed on. After you activate VPN Gate Service, the computer will be
|
||||
start to serve as a part of the Global Distributed Public VPN Relay Servers.
|
||||
The IP address, hostname and related information of the computer will be sent
|
||||
and registered to the directory server of VPN Gate Academic Experiment
|
||||
Project, and they will be published and disclosed to the public. This
|
||||
mechanism will allow any VPN Gate Client software's user to connect to the VPN
|
||||
Gate Service running on your computer. While the VPN session between a VPN
|
||||
Gate Client and your VPN Gate Service is established, the VPN Gate Client's
|
||||
user can send/receive any IP packets towards the Internet via the VPN Gate
|
||||
Service. The global IP address of the VPN Gate Service's hosing computer will
|
||||
be used as the source IP address of such communications which a VPN Gate
|
||||
Client initiates.
|
||||
VPN Gate Service will send some information to the VPN Gate Academic
|
||||
Experiment Service Directory Server. The information includes the operator's
|
||||
information which described in section 5.5, logging settings, uptime,
|
||||
operating system version, type of protocol, port numbers, quality information,
|
||||
statistical information, VPN Gate clients' log history data (includes dates,
|
||||
IP addresses, version numbers and IDs) and the version of the software. These
|
||||
information will be exposed on the directory. VPN Gate Service also receives a
|
||||
key for encoding which is described on the chapter 5.9 from the directory
|
||||
server.
|
||||
|
||||
5.3. Details of VPN Gate Service's Behavior
|
||||
If you enable VPN Gate Service manually, which is disabled by default, the
|
||||
"VPNGATE" Virtual Hub will be created on the SoftEther VPN Server. If you are
|
||||
using SoftEther VPN Client and attempt to active VPN Gate Service on it, an
|
||||
equivalent program to SoftEther VPN Server will be invoked on the same process
|
||||
of SoftEther VPN Client, and the "VPNGATE" Virtual Hub will be created. The
|
||||
"VPNGATE" Virtual Hub contains a user named "VPN" by default which permits
|
||||
anyone on the Internet to make a VPN connection to the Virtual Hub. Once a VPN
|
||||
Client connects to the "VPNGATE" Virtual Hub, any communication between the
|
||||
user and the Internet will pass through the Virtual Hub, and
|
||||
transmitted/received using the physical network interface on the computer
|
||||
which SoftEther VPN Server (or SoftEther VPN Client) is running on. This will
|
||||
cause the result that a destination host specified by the VPN Client will
|
||||
identify that the source of the communication has initiated from the VPN Gate
|
||||
Service's hosting computer's IP address. However, for safety, any packets
|
||||
which destinations are within 192.168.0.0/255.255.0.0, 172.16.0.0/255.240.0.0
|
||||
or 10.0.0.0/255.0.0.0 will be blocked by the "VPNGATE" Virtual Hub in order to
|
||||
protect your local network. Therefore, if you run VPN Gate Service on your
|
||||
corporate network or private network, it is safe because anonymous VPN Client
|
||||
users will not be permitted to access such private networks. VPN Gate Service
|
||||
also serves as relay for accessing to the VPN Gate Directory Server.
|
||||
In order to make VPN Gate Service familiar with firewalls and NATs, it opens
|
||||
an UDP port by using the NAT Traversal function which is described on the
|
||||
section 1.2. It also opens and listens on some TCP ports, and some TCP and UDP
|
||||
ports will be specified as the target port of Universal Plug and Play (UPnP)
|
||||
Port Transfer entries which are requested to your local routers. UPnP request
|
||||
packets will be sent periodically. Some routers keep such an opened TCP/UDP
|
||||
port permanently on the device. If you wish to close them, do it manually.
|
||||
VPN Gate Service also provides the mirror-site function for www.vpngate.net.
|
||||
This is a mechanism that a copy of the latest contents from www.vpngate.net
|
||||
will be hosted by the mirror-site tiny HTTP server which is running on the VPN
|
||||
Gate Service program. It will register itself on the mirror-sites list in
|
||||
www.vpngate.net. However, it never relays any other communications which are
|
||||
not towards www.vpngate.net.
|
||||
|
||||
5.4. Communication between Internet via VPN Gate Service
|
||||
VPN Gate Service provides a routing between users and the Internet, by using
|
||||
the Virtual NAT Function which is described on the section 2.8. VPN Gate
|
||||
Service sends polling Ping packets to the server which is located on
|
||||
University of Tsukuba, and the Google Public DNS Server which is identified as
|
||||
8.8.8.8, in order to check the latest quality of your Internet line. VPN Gate
|
||||
Service also sends and receives a lot of random packets to/from the Speed Test
|
||||
Server on University of Tsukuba. These quality data will be reported to VPN
|
||||
Gate Directory Server, automatically and periodically. The result will be
|
||||
saved and disclosed to the public. These periodical polling communication are
|
||||
adjusted not to occupy the Internet line, however in some circumstances they
|
||||
might occupy the line.
|
||||
|
||||
5.5. Operator's Information of VPN Gate Service
|
||||
If you activate VPN Gate Service on your computer, the computer will be a part
|
||||
of the Global Distributed Public VPN Relay Servers. Therefore, the Operator's
|
||||
administrative information of your VPN Gate Service should be reported and
|
||||
registered on the VPN Gate Service Directory. Operator's information contains
|
||||
the name of the operator and the abuse-reporting contact e-mail address. These
|
||||
information can be inputted on the screen if the VPN Gate configuration.
|
||||
Inputted information will be transmitted to the VPN Gate Directory Server,
|
||||
stored and disclosed to the public. So you have to be careful to input
|
||||
information. By the way, until you specify something as the operator's
|
||||
information, the computer's hostname will be used automatically as the field
|
||||
of the name of the operator, by appending the "'s owner" string after the
|
||||
hostname.
|
||||
|
||||
5.6. Observe Laws to Operate VPN Gate Service
|
||||
In some countries or regions, a user who is planning to activate and operate
|
||||
VPN Gate Service, he are mandated to obtain a license or register a service
|
||||
from/to the government. If your region has such a regulation, you must fulfill
|
||||
mandated process before activating VPN Gate Service in advance. Neither the
|
||||
developers nor operators of the VPN Gate Academic Experiment Project will be
|
||||
liable for legal/criminal responsibilities or damages which are occurred from
|
||||
failure to comply your local laws.
|
||||
|
||||
5.7. Protect Privacy of Communication
|
||||
Most of countries have a law which requires communication service's operators,
|
||||
including VPN Gate Service operators, to protect the privacy of communication
|
||||
of third-persons. When you operate VPN Gate Service, you must always protect
|
||||
user's privacy.
|
||||
|
||||
5.8. Packet Logs
|
||||
The packet logging function is implemented on VPN Gate Service. It records
|
||||
essential headers of major TCP/IP packets which are transmitted via the
|
||||
Virtual Hub. This function will be helpful to investigate the "original IP
|
||||
address" of the initiator of communication who was a connected user of your
|
||||
VPN Gate Service, by checking the packet logs and the connection logs. The
|
||||
packet logs are recorded only for such legitimate investigates purpose. Do not
|
||||
peek nor leak packet logs except the rightful purpose. Such act will be
|
||||
violate the section 5.7.
|
||||
|
||||
5.9. Packet Logs Automatic Archiving and Encoding Function
|
||||
The VPN Gate Academic Experiment Service is operated and running under the
|
||||
Japanese constitution and laws. The Japanese constitution laws demand strictly
|
||||
protection over the privacy of communication. Because this service is under
|
||||
Japanese rules, the program of VPN Gate Service implements this "Automatic Log
|
||||
File Encoding" protection mechanism, and enabled by default.
|
||||
The VPN Gate Service is currently configured to encode packet log files which
|
||||
has passed two or more weeks automatically, by default. In order to protect
|
||||
privacy of communication, if a packet log file is once encoded, even the
|
||||
administrator of the local computer cannot censor the packet log file. This
|
||||
mechanism protects privacy of end-users of VPN Gate Service.
|
||||
You can change the VPN Gate Service setting to disable this automatic encoding
|
||||
function. Then packet log files will never be encoded even after two weeks
|
||||
passed. In such a configuration, all packet logs will remain as plain-text on
|
||||
the disk. Therefore you have to take care not to violate user's privacy.
|
||||
If you are liable to decode an encoded packet log files (for example: a VPN
|
||||
Gate Service's user illegally abused your VPN Gate Service and you have to
|
||||
decode the packet logs in order to comply the laws), contact the administrator
|
||||
of the VPN Gate Academic Experiment Service at Graduate School of University
|
||||
of Tsukuba, Japan. You can find the contact address at
|
||||
http://www.vpngate.net/. The administrator of VPN Gate Service will respond to
|
||||
decode the packet logs if there is an appropriate and legal request from court
|
||||
or other judicial authorities, according to laws.
|
||||
|
||||
5.10. Caution if You Operate VPN Gate Service in the Japan's Territories
|
||||
When a user operates VPN Gate Service in the Japan's territories, such an act
|
||||
may be regulated under the Japanese Telecommunication Laws if the operation is
|
||||
a subject to the law. However, in such a circumstance, according to the
|
||||
"Japanese Telecommunication Business Compete Manual [supplemental version]" ,
|
||||
non- profitable operations of communications are not identified as a
|
||||
"telecommunication business" . So usual operators of VPN Gate Service are not
|
||||
subjects to "telecommunication business operators" , and not be mandated to
|
||||
register to the government. Even so, legalities to protect the privacy of
|
||||
communication still imposed. As a conclusion, if you operate VPN Gate Service
|
||||
in the Japan's Territories, you must not leak the secrets of communications
|
||||
which are transmitted via your operating VPN Gate Service.
|
||||
|
||||
5.11. VPN Gate Client
|
||||
If SoftEther VPN Client contains the VPN Gate Client plug-in, you can use it
|
||||
to obtain the list of current operating VPN Gate Service servers in the
|
||||
Internet, and make a VPN connection to a specific server on the list.
|
||||
VPN Gate Client always keeps the latest list of the VPN Gate Services
|
||||
periodically. Be careful if you are using a pay-per-use Internet line.
|
||||
When you start the VPN Gate Client software, the screen which asks you
|
||||
activate or not VPN Gate Service will be appeared. For details of VPN Gate
|
||||
Service, read the above sections.
|
||||
|
||||
5.12. Caution before Joining or Exploiting VPN Gate Academic Experiment
|
||||
Project
|
||||
The VPN Gate Academic Experiment Service is operated as a research project at
|
||||
the graduate school on University of Tsukuba, Japan. The service is governed
|
||||
under the Japanese laws. Other countries' laws are none of our concerns nor
|
||||
responsibilities.
|
||||
By nature, there are almost 200 countries in the World, with different laws.
|
||||
It is impossible to verify every countries' laws and regulations and make the
|
||||
software comply with all countries' laws in advance to release the software.
|
||||
If a user uses VPN Gate service in a specific country, and damaged by public
|
||||
servants of the authority, the developer of either the service or software
|
||||
will never be liable to recover or compensate such damages or criminal
|
||||
responsibilities.
|
||||
By using this software and service, the user must observe all concerned laws
|
||||
and rules with user's own responsibility. The user will be completely liable
|
||||
to any damages and responsibilities which are results of using this software
|
||||
and service, regardless of either inside or outside of Japan's territory.
|
||||
If you don't agree nor understand the above warnings, do not use any of VPN
|
||||
Gate Academic Experiment Service functions.
|
||||
VPN Gate is a research project for just academic purpose only. VPN Gate was
|
||||
developed as a plug-in for SoftEther VPN and UT-VPN. However, all parts of VPN
|
||||
Gate were developed on this research project at University of Tsukuba. Any
|
||||
parts of VPN Gate are not developed by SoftEther Corporation. The VPN Gate
|
||||
Research Project is not a subject to be led, operated, promoted nor guaranteed
|
||||
by SoftEther Corporation.
|
||||
|
Binary file not shown.
117
src/bin/SOURCES_OF_BINARY_FILES.TXT
Normal file
117
src/bin/SOURCES_OF_BINARY_FILES.TXT
Normal file
@ -0,0 +1,117 @@
|
||||
All binary files on the 'hamcore' directory are free software under
|
||||
the GPLv2 license. (Except WinPcap binaries.)
|
||||
|
||||
Some geeks should be interested in how to rebuild .sys (driver) files on
|
||||
this directory. This text file helps such crazy geeks.
|
||||
|
||||
|
||||
How to rebuild these '.sys' files?
|
||||
----------------------------------
|
||||
|
||||
Windows Vista or later version of Windows requires all device drivers to be
|
||||
signed by Authenticode digital certificate. Therefore, SoftEther VPN Project
|
||||
publishes all necessary binary files in the 'hamcore' directory with
|
||||
'already-signed' format by the certificate of SoftEther VPN Project.
|
||||
|
||||
That is the reason why the all .sys files (device drivers) are already built
|
||||
and digitally signed by SoftEther VPN Project on the time of release of
|
||||
the source code.
|
||||
|
||||
However, the entire source code of all the .sys files are contained on the
|
||||
source code tree as follows:
|
||||
|
||||
- pxwfp_x86.sys and pxwfp_x64.sys
|
||||
You can build these files from the source code on the 'Wfp' directory.
|
||||
|
||||
- see.sys and see_x64.sys
|
||||
You can build these files from the source code on the 'See' directory.
|
||||
|
||||
- SeLow_x86.sys and SeLow_x64.sys
|
||||
You can build these files from the source code on the 'SeLow' directory.
|
||||
|
||||
- vpn_driver.sys, vpn_driver_x64.sys and vpn_driver_9x.sys
|
||||
You can build these files from the source code on the 'Neo' directory.
|
||||
|
||||
- vpn_driver6.sys and vpn_driver6_x64.sys
|
||||
You can build these files from the source code on the 'Neo6' directory.
|
||||
|
||||
It is recommended to build these files on the 'SEVPN.sln' Visual Studio 2008
|
||||
solution file.
|
||||
|
||||
Note that rebuilding these files require Windows Driver Kits.
|
||||
Loading the re-built .sys files requires your Authenticode certificate file
|
||||
if the operating system is Windows Vista or later.
|
||||
|
||||
|
||||
|
||||
How to rebuild these 'vpn16.exe' files?
|
||||
---------------------------------------
|
||||
|
||||
The vpn16.exe binary is the 16-bit Driver Install Utility for Windows 9x.
|
||||
You can build this file from the 'vpn16' directory. However, you need
|
||||
Visual C++ 16-bit edition and Windows 98 DDK to rebuild this 'vpn16.exe'.
|
||||
|
||||
|
||||
|
||||
How to rebuild the 'vpnweb.cab' and 'vpnweb.ocx' files?
|
||||
-------------------------------------------------------
|
||||
These files are ActiveX controls.
|
||||
The source code is in the 'vpnweb' directory.
|
||||
|
||||
|
||||
'winpcap_installer.exe' and 'winpcap_installer_win9x.exe'
|
||||
---------------------------------------------------------
|
||||
They are WinPcap binaries from http://www.winpcap.org/.
|
||||
The WinPcap license is at http://www.winpcap.org/misc/copyright.htm page.
|
||||
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License version 2 as published by the Free
|
||||
Software Foundation.
|
||||
|
||||
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 version 2
|
||||
along with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
Neither the name of SoftEther nor the names of its contributors may be used
|
||||
to endorse or promote products derived from this software without specific
|
||||
prior written permission.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
THIS SOFTWARE IS DEVELOPED IN JAPAN, AND DISTRIBUTED FROM JAPAN, UNDER
|
||||
JAPANESE LAWS. YOU MUST AGREE IN ADVANCE TO USE, COPY, MODIFY, MERGE, PUBLISH,
|
||||
DISTRIBUTE, SUBLICENSE, AND/OR SELL COPIES OF THIS SOFTWARE, THAT ANY JURIDICAL
|
||||
DISPUTES WHICH ARE CONCERNED TO THIS SOFTWARE OR ITS CONTENTS, AGAINST US
|
||||
(SOFTETHER PROJECT, SOFTETHER CORPORATION, DAIYUU NOBORI OR OTHER SUPPLIERS),
|
||||
OR ANY JURIDICAL DISPUTES AGAINST US WHICH ARE CAUSED BY ANY KIND OF USING,
|
||||
COPYING, MODIFYING, MERGING, PUBLISHING, DISTRIBUTING, SUBLICENSING, AND/OR
|
||||
SELLING COPIES OF THIS SOFTWARE SHALL BE REGARDED AS BE CONSTRUED AND
|
||||
CONTROLLED BY JAPANESE LAWS, AND YOU MUST FURTHER CONSENT TO EXCLUSIVE
|
||||
JURISDICTION AND VENUE IN THE COURTS SITTING IN TOKYO, JAPAN. YOU MUST WAIVE
|
||||
ALL DEFENSES OF LACK OF PERSONAL JURISDICTION AND FORUM NON CONVENIENS.
|
||||
PROCESS MAY BE SERVED ON EITHER PARTY IN THE MANNER AUTHORIZED BY APPLICABLE
|
||||
LAW OR COURT RULE.
|
||||
|
||||
USE ONLY IN JAPAN. DO NOT USE IT IN OTHER COUNTRIES. IMPORTING THIS SOFTWARE
|
||||
INTO OTHER COUNTRIES IS AT YOUR OWN RISK. SOME COUNTRIES PROHIBIT ENCRYPTED
|
||||
COMMUNICATIONS. USING THIS SOFTWARE IN OTHER COUNTRIES MIGHT BE RESTRICTED.
|
||||
|
||||
THE GPLV2 CONDITIONS APPLY ON ALL SOFTETHER VPN PROGRAMS WHICH ARE DEVELOPED
|
||||
BY SOFTETHER VPN PROJECT.
|
||||
|
117
src/bin/hamcore/SOURCES_OF_BINARY_FILES.TXT
Normal file
117
src/bin/hamcore/SOURCES_OF_BINARY_FILES.TXT
Normal file
@ -0,0 +1,117 @@
|
||||
All binary files on the 'hamcore' directory are free software under
|
||||
the GPLv2 license. (Except WinPcap binaries.)
|
||||
|
||||
Some geeks should be interested in how to rebuild .sys (driver) files on
|
||||
this directory. This text file helps such crazy geeks.
|
||||
|
||||
|
||||
How to rebuild these '.sys' files?
|
||||
----------------------------------
|
||||
|
||||
Windows Vista or later version of Windows requires all device drivers to be
|
||||
signed by Authenticode digital certificate. Therefore, SoftEther VPN Project
|
||||
publishes all necessary binary files in the 'hamcore' directory with
|
||||
'already-signed' format by the certificate of SoftEther VPN Project.
|
||||
|
||||
That is the reason why the all .sys files (device drivers) are already built
|
||||
and digitally signed by SoftEther VPN Project on the time of release of
|
||||
the source code.
|
||||
|
||||
However, the entire source code of all the .sys files are contained on the
|
||||
source code tree as follows:
|
||||
|
||||
- pxwfp_x86.sys and pxwfp_x64.sys
|
||||
You can build these files from the source code on the 'Wfp' directory.
|
||||
|
||||
- see.sys and see_x64.sys
|
||||
You can build these files from the source code on the 'See' directory.
|
||||
|
||||
- SeLow_x86.sys and SeLow_x64.sys
|
||||
You can build these files from the source code on the 'SeLow' directory.
|
||||
|
||||
- vpn_driver.sys, vpn_driver_x64.sys and vpn_driver_9x.sys
|
||||
You can build these files from the source code on the 'Neo' directory.
|
||||
|
||||
- vpn_driver6.sys and vpn_driver6_x64.sys
|
||||
You can build these files from the source code on the 'Neo6' directory.
|
||||
|
||||
It is recommended to build these files on the 'SEVPN.sln' Visual Studio 2008
|
||||
solution file.
|
||||
|
||||
Note that rebuilding these files require Windows Driver Kits.
|
||||
Loading the re-built .sys files requires your Authenticode certificate file
|
||||
if the operating system is Windows Vista or later.
|
||||
|
||||
|
||||
|
||||
How to rebuild these 'vpn16.exe' files?
|
||||
---------------------------------------
|
||||
|
||||
The vpn16.exe binary is the 16-bit Driver Install Utility for Windows 9x.
|
||||
You can build this file from the 'vpn16' directory. However, you need
|
||||
Visual C++ 16-bit edition and Windows 98 DDK to rebuild this 'vpn16.exe'.
|
||||
|
||||
|
||||
|
||||
How to rebuild the 'vpnweb.cab' and 'vpnweb.ocx' files?
|
||||
-------------------------------------------------------
|
||||
These files are ActiveX controls.
|
||||
The source code is in the 'vpnweb' directory.
|
||||
|
||||
|
||||
'winpcap_installer.exe' and 'winpcap_installer_win9x.exe'
|
||||
---------------------------------------------------------
|
||||
They are WinPcap binaries from http://www.winpcap.org/.
|
||||
The WinPcap license is at http://www.winpcap.org/misc/copyright.htm page.
|
||||
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License version 2 as published by the Free
|
||||
Software Foundation.
|
||||
|
||||
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 version 2
|
||||
along with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
Neither the name of SoftEther nor the names of its contributors may be used
|
||||
to endorse or promote products derived from this software without specific
|
||||
prior written permission.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
THIS SOFTWARE IS DEVELOPED IN JAPAN, AND DISTRIBUTED FROM JAPAN, UNDER
|
||||
JAPANESE LAWS. YOU MUST AGREE IN ADVANCE TO USE, COPY, MODIFY, MERGE, PUBLISH,
|
||||
DISTRIBUTE, SUBLICENSE, AND/OR SELL COPIES OF THIS SOFTWARE, THAT ANY JURIDICAL
|
||||
DISPUTES WHICH ARE CONCERNED TO THIS SOFTWARE OR ITS CONTENTS, AGAINST US
|
||||
(SOFTETHER PROJECT, SOFTETHER CORPORATION, DAIYUU NOBORI OR OTHER SUPPLIERS),
|
||||
OR ANY JURIDICAL DISPUTES AGAINST US WHICH ARE CAUSED BY ANY KIND OF USING,
|
||||
COPYING, MODIFYING, MERGING, PUBLISHING, DISTRIBUTING, SUBLICENSING, AND/OR
|
||||
SELLING COPIES OF THIS SOFTWARE SHALL BE REGARDED AS BE CONSTRUED AND
|
||||
CONTROLLED BY JAPANESE LAWS, AND YOU MUST FURTHER CONSENT TO EXCLUSIVE
|
||||
JURISDICTION AND VENUE IN THE COURTS SITTING IN TOKYO, JAPAN. YOU MUST WAIVE
|
||||
ALL DEFENSES OF LACK OF PERSONAL JURISDICTION AND FORUM NON CONVENIENS.
|
||||
PROCESS MAY BE SERVED ON EITHER PARTY IN THE MANNER AUTHORIZED BY APPLICABLE
|
||||
LAW OR COURT RULE.
|
||||
|
||||
USE ONLY IN JAPAN. DO NOT USE IT IN OTHER COUNTRIES. IMPORTING THIS SOFTWARE
|
||||
INTO OTHER COUNTRIES IS AT YOUR OWN RISK. SOME COUNTRIES PROHIBIT ENCRYPTED
|
||||
COMMUNICATIONS. USING THIS SOFTWARE IN OTHER COUNTRIES MIGHT BE RESTRICTED.
|
||||
|
||||
THE GPLV2 CONDITIONS APPLY ON ALL SOFTETHER VPN PROGRAMS WHICH ARE DEVELOPED
|
||||
BY SOFTETHER VPN PROJECT.
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -8,7 +8,7 @@ Signature = "$Windows NT$"
|
||||
Class = NetTrans
|
||||
ClassGUID = {4D36E975-E325-11CE-BFC1-08002BE10318}
|
||||
Provider = %CompanyName%
|
||||
DriverVer = 01/04/2014, 4.3.0.9407
|
||||
DriverVer = 01/07/2014, 4.3.0.9410
|
||||
|
||||
CatalogFile.NT = inf_selow.cat
|
||||
|
||||
@ -66,5 +66,5 @@ SeLow_Description = "A lightweight helper kernel-mode module for PacketiX VPN
|
||||
|
||||
|
||||
|
||||
; Auto Generated 20140104_181831.858
|
||||
; Auto Generated 20140107_041134.030
|
||||
|
||||
|
Binary file not shown.
@ -8,7 +8,7 @@ Signature = "$Windows NT$"
|
||||
Class = NetTrans
|
||||
ClassGUID = {4D36E975-E325-11CE-BFC1-08002BE10318}
|
||||
Provider = %CompanyName%
|
||||
DriverVer = 01/04/2014, 4.3.0.9407
|
||||
DriverVer = 01/07/2014, 4.3.0.9410
|
||||
|
||||
CatalogFile.NT = inf_selow.cat
|
||||
|
||||
@ -66,5 +66,5 @@ SeLow_Description = "A lightweight helper kernel-mode module for PacketiX VPN
|
||||
|
||||
|
||||
|
||||
; Auto Generated 20140104_181657.418
|
||||
; Auto Generated 20140107_040959.456
|
||||
|
||||
|
Binary file not shown.
@ -8,7 +8,7 @@ Signature = "$Windows NT$"
|
||||
Class = Net
|
||||
ClassGUID = {4D36E972-E325-11CE-BFC1-08002BE10318}
|
||||
Provider = %CompanyName%
|
||||
DriverVer = 01/04/2014, 4.3.0.9407
|
||||
DriverVer = 01/07/2014, 4.3.0.9410
|
||||
|
||||
CatalogFile.NT = inf_VPN.cat
|
||||
|
||||
|
@ -8,7 +8,7 @@ Signature = "$Windows NT$"
|
||||
Class = Net
|
||||
ClassGUID = {4D36E972-E325-11CE-BFC1-08002BE10318}
|
||||
Provider = %CompanyName%
|
||||
DriverVer = 01/04/2014, 4.3.0.9407
|
||||
DriverVer = 01/07/2014, 4.3.0.9410
|
||||
|
||||
CatalogFile.NT = inf_VPN10.cat
|
||||
|
||||
|
@ -8,7 +8,7 @@ Signature = "$Windows NT$"
|
||||
Class = Net
|
||||
ClassGUID = {4D36E972-E325-11CE-BFC1-08002BE10318}
|
||||
Provider = %CompanyName%
|
||||
DriverVer = 01/04/2014, 4.3.0.9407
|
||||
DriverVer = 01/07/2014, 4.3.0.9410
|
||||
|
||||
CatalogFile.NT = inf_VPN100.cat
|
||||
|
||||
|
@ -8,7 +8,7 @@ Signature = "$Windows NT$"
|
||||
Class = Net
|
||||
ClassGUID = {4D36E972-E325-11CE-BFC1-08002BE10318}
|
||||
Provider = %CompanyName%
|
||||
DriverVer = 01/04/2014, 4.3.0.9407
|
||||
DriverVer = 01/07/2014, 4.3.0.9410
|
||||
|
||||
CatalogFile.NT = inf_VPN101.cat
|
||||
|
||||
|
@ -8,7 +8,7 @@ Signature = "$Windows NT$"
|
||||
Class = Net
|
||||
ClassGUID = {4D36E972-E325-11CE-BFC1-08002BE10318}
|
||||
Provider = %CompanyName%
|
||||
DriverVer = 01/04/2014, 4.3.0.9407
|
||||
DriverVer = 01/07/2014, 4.3.0.9410
|
||||
|
||||
CatalogFile.NT = inf_VPN102.cat
|
||||
|
||||
|
@ -8,7 +8,7 @@ Signature = "$Windows NT$"
|
||||
Class = Net
|
||||
ClassGUID = {4D36E972-E325-11CE-BFC1-08002BE10318}
|
||||
Provider = %CompanyName%
|
||||
DriverVer = 01/04/2014, 4.3.0.9407
|
||||
DriverVer = 01/07/2014, 4.3.0.9410
|
||||
|
||||
CatalogFile.NT = inf_VPN103.cat
|
||||
|
||||
|
@ -8,7 +8,7 @@ Signature = "$Windows NT$"
|
||||
Class = Net
|
||||
ClassGUID = {4D36E972-E325-11CE-BFC1-08002BE10318}
|
||||
Provider = %CompanyName%
|
||||
DriverVer = 01/04/2014, 4.3.0.9407
|
||||
DriverVer = 01/07/2014, 4.3.0.9410
|
||||
|
||||
CatalogFile.NT = inf_VPN104.cat
|
||||
|
||||
|
@ -8,7 +8,7 @@ Signature = "$Windows NT$"
|
||||
Class = Net
|
||||
ClassGUID = {4D36E972-E325-11CE-BFC1-08002BE10318}
|
||||
Provider = %CompanyName%
|
||||
DriverVer = 01/04/2014, 4.3.0.9407
|
||||
DriverVer = 01/07/2014, 4.3.0.9410
|
||||
|
||||
CatalogFile.NT = inf_VPN105.cat
|
||||
|
||||
|
@ -8,7 +8,7 @@ Signature = "$Windows NT$"
|
||||
Class = Net
|
||||
ClassGUID = {4D36E972-E325-11CE-BFC1-08002BE10318}
|
||||
Provider = %CompanyName%
|
||||
DriverVer = 01/04/2014, 4.3.0.9407
|
||||
DriverVer = 01/07/2014, 4.3.0.9410
|
||||
|
||||
CatalogFile.NT = inf_VPN106.cat
|
||||
|
||||
|
@ -8,7 +8,7 @@ Signature = "$Windows NT$"
|
||||
Class = Net
|
||||
ClassGUID = {4D36E972-E325-11CE-BFC1-08002BE10318}
|
||||
Provider = %CompanyName%
|
||||
DriverVer = 01/04/2014, 4.3.0.9407
|
||||
DriverVer = 01/07/2014, 4.3.0.9410
|
||||
|
||||
CatalogFile.NT = inf_VPN107.cat
|
||||
|
||||
|
@ -8,7 +8,7 @@ Signature = "$Windows NT$"
|
||||
Class = Net
|
||||
ClassGUID = {4D36E972-E325-11CE-BFC1-08002BE10318}
|
||||
Provider = %CompanyName%
|
||||
DriverVer = 01/04/2014, 4.3.0.9407
|
||||
DriverVer = 01/07/2014, 4.3.0.9410
|
||||
|
||||
CatalogFile.NT = inf_VPN108.cat
|
||||
|
||||
|
@ -8,7 +8,7 @@ Signature = "$Windows NT$"
|
||||
Class = Net
|
||||
ClassGUID = {4D36E972-E325-11CE-BFC1-08002BE10318}
|
||||
Provider = %CompanyName%
|
||||
DriverVer = 01/04/2014, 4.3.0.9407
|
||||
DriverVer = 01/07/2014, 4.3.0.9410
|
||||
|
||||
CatalogFile.NT = inf_VPN109.cat
|
||||
|
||||
|
@ -8,7 +8,7 @@ Signature = "$Windows NT$"
|
||||
Class = Net
|
||||
ClassGUID = {4D36E972-E325-11CE-BFC1-08002BE10318}
|
||||
Provider = %CompanyName%
|
||||
DriverVer = 01/04/2014, 4.3.0.9407
|
||||
DriverVer = 01/07/2014, 4.3.0.9410
|
||||
|
||||
CatalogFile.NT = inf_VPN11.cat
|
||||
|
||||
|
@ -8,7 +8,7 @@ Signature = "$Windows NT$"
|
||||
Class = Net
|
||||
ClassGUID = {4D36E972-E325-11CE-BFC1-08002BE10318}
|
||||
Provider = %CompanyName%
|
||||
DriverVer = 01/04/2014, 4.3.0.9407
|
||||
DriverVer = 01/07/2014, 4.3.0.9410
|
||||
|
||||
CatalogFile.NT = inf_VPN110.cat
|
||||
|
||||
|
@ -8,7 +8,7 @@ Signature = "$Windows NT$"
|
||||
Class = Net
|
||||
ClassGUID = {4D36E972-E325-11CE-BFC1-08002BE10318}
|
||||
Provider = %CompanyName%
|
||||
DriverVer = 01/04/2014, 4.3.0.9407
|
||||
DriverVer = 01/07/2014, 4.3.0.9410
|
||||
|
||||
CatalogFile.NT = inf_VPN111.cat
|
||||
|
||||
|
@ -8,7 +8,7 @@ Signature = "$Windows NT$"
|
||||
Class = Net
|
||||
ClassGUID = {4D36E972-E325-11CE-BFC1-08002BE10318}
|
||||
Provider = %CompanyName%
|
||||
DriverVer = 01/04/2014, 4.3.0.9407
|
||||
DriverVer = 01/07/2014, 4.3.0.9410
|
||||
|
||||
CatalogFile.NT = inf_VPN112.cat
|
||||
|
||||
|
@ -8,7 +8,7 @@ Signature = "$Windows NT$"
|
||||
Class = Net
|
||||
ClassGUID = {4D36E972-E325-11CE-BFC1-08002BE10318}
|
||||
Provider = %CompanyName%
|
||||
DriverVer = 01/04/2014, 4.3.0.9407
|
||||
DriverVer = 01/07/2014, 4.3.0.9410
|
||||
|
||||
CatalogFile.NT = inf_VPN113.cat
|
||||
|
||||
|
@ -8,7 +8,7 @@ Signature = "$Windows NT$"
|
||||
Class = Net
|
||||
ClassGUID = {4D36E972-E325-11CE-BFC1-08002BE10318}
|
||||
Provider = %CompanyName%
|
||||
DriverVer = 01/04/2014, 4.3.0.9407
|
||||
DriverVer = 01/07/2014, 4.3.0.9410
|
||||
|
||||
CatalogFile.NT = inf_VPN114.cat
|
||||
|
||||
|
@ -8,7 +8,7 @@ Signature = "$Windows NT$"
|
||||
Class = Net
|
||||
ClassGUID = {4D36E972-E325-11CE-BFC1-08002BE10318}
|
||||
Provider = %CompanyName%
|
||||
DriverVer = 01/04/2014, 4.3.0.9407
|
||||
DriverVer = 01/07/2014, 4.3.0.9410
|
||||
|
||||
CatalogFile.NT = inf_VPN115.cat
|
||||
|
||||
|
@ -8,7 +8,7 @@ Signature = "$Windows NT$"
|
||||
Class = Net
|
||||
ClassGUID = {4D36E972-E325-11CE-BFC1-08002BE10318}
|
||||
Provider = %CompanyName%
|
||||
DriverVer = 01/04/2014, 4.3.0.9407
|
||||
DriverVer = 01/07/2014, 4.3.0.9410
|
||||
|
||||
CatalogFile.NT = inf_VPN116.cat
|
||||
|
||||
|
@ -8,7 +8,7 @@ Signature = "$Windows NT$"
|
||||
Class = Net
|
||||
ClassGUID = {4D36E972-E325-11CE-BFC1-08002BE10318}
|
||||
Provider = %CompanyName%
|
||||
DriverVer = 01/04/2014, 4.3.0.9407
|
||||
DriverVer = 01/07/2014, 4.3.0.9410
|
||||
|
||||
CatalogFile.NT = inf_VPN117.cat
|
||||
|
||||
|
@ -8,7 +8,7 @@ Signature = "$Windows NT$"
|
||||
Class = Net
|
||||
ClassGUID = {4D36E972-E325-11CE-BFC1-08002BE10318}
|
||||
Provider = %CompanyName%
|
||||
DriverVer = 01/04/2014, 4.3.0.9407
|
||||
DriverVer = 01/07/2014, 4.3.0.9410
|
||||
|
||||
CatalogFile.NT = inf_VPN118.cat
|
||||
|
||||
|
@ -8,7 +8,7 @@ Signature = "$Windows NT$"
|
||||
Class = Net
|
||||
ClassGUID = {4D36E972-E325-11CE-BFC1-08002BE10318}
|
||||
Provider = %CompanyName%
|
||||
DriverVer = 01/04/2014, 4.3.0.9407
|
||||
DriverVer = 01/07/2014, 4.3.0.9410
|
||||
|
||||
CatalogFile.NT = inf_VPN119.cat
|
||||
|
||||
|
@ -8,7 +8,7 @@ Signature = "$Windows NT$"
|
||||
Class = Net
|
||||
ClassGUID = {4D36E972-E325-11CE-BFC1-08002BE10318}
|
||||
Provider = %CompanyName%
|
||||
DriverVer = 01/04/2014, 4.3.0.9407
|
||||
DriverVer = 01/07/2014, 4.3.0.9410
|
||||
|
||||
CatalogFile.NT = inf_VPN12.cat
|
||||
|
||||
|
@ -8,7 +8,7 @@ Signature = "$Windows NT$"
|
||||
Class = Net
|
||||
ClassGUID = {4D36E972-E325-11CE-BFC1-08002BE10318}
|
||||
Provider = %CompanyName%
|
||||
DriverVer = 01/04/2014, 4.3.0.9407
|
||||
DriverVer = 01/07/2014, 4.3.0.9410
|
||||
|
||||
CatalogFile.NT = inf_VPN120.cat
|
||||
|
||||
|
@ -8,7 +8,7 @@ Signature = "$Windows NT$"
|
||||
Class = Net
|
||||
ClassGUID = {4D36E972-E325-11CE-BFC1-08002BE10318}
|
||||
Provider = %CompanyName%
|
||||
DriverVer = 01/04/2014, 4.3.0.9407
|
||||
DriverVer = 01/07/2014, 4.3.0.9410
|
||||
|
||||
CatalogFile.NT = inf_VPN121.cat
|
||||
|
||||
|
@ -8,7 +8,7 @@ Signature = "$Windows NT$"
|
||||
Class = Net
|
||||
ClassGUID = {4D36E972-E325-11CE-BFC1-08002BE10318}
|
||||
Provider = %CompanyName%
|
||||
DriverVer = 01/04/2014, 4.3.0.9407
|
||||
DriverVer = 01/07/2014, 4.3.0.9410
|
||||
|
||||
CatalogFile.NT = inf_VPN122.cat
|
||||
|
||||
|
@ -8,7 +8,7 @@ Signature = "$Windows NT$"
|
||||
Class = Net
|
||||
ClassGUID = {4D36E972-E325-11CE-BFC1-08002BE10318}
|
||||
Provider = %CompanyName%
|
||||
DriverVer = 01/04/2014, 4.3.0.9407
|
||||
DriverVer = 01/07/2014, 4.3.0.9410
|
||||
|
||||
CatalogFile.NT = inf_VPN123.cat
|
||||
|
||||
|
@ -8,7 +8,7 @@ Signature = "$Windows NT$"
|
||||
Class = Net
|
||||
ClassGUID = {4D36E972-E325-11CE-BFC1-08002BE10318}
|
||||
Provider = %CompanyName%
|
||||
DriverVer = 01/04/2014, 4.3.0.9407
|
||||
DriverVer = 01/07/2014, 4.3.0.9410
|
||||
|
||||
CatalogFile.NT = inf_VPN124.cat
|
||||
|
||||
|
@ -8,7 +8,7 @@ Signature = "$Windows NT$"
|
||||
Class = Net
|
||||
ClassGUID = {4D36E972-E325-11CE-BFC1-08002BE10318}
|
||||
Provider = %CompanyName%
|
||||
DriverVer = 01/04/2014, 4.3.0.9407
|
||||
DriverVer = 01/07/2014, 4.3.0.9410
|
||||
|
||||
CatalogFile.NT = inf_VPN125.cat
|
||||
|
||||
|
@ -8,7 +8,7 @@ Signature = "$Windows NT$"
|
||||
Class = Net
|
||||
ClassGUID = {4D36E972-E325-11CE-BFC1-08002BE10318}
|
||||
Provider = %CompanyName%
|
||||
DriverVer = 01/04/2014, 4.3.0.9407
|
||||
DriverVer = 01/07/2014, 4.3.0.9410
|
||||
|
||||
CatalogFile.NT = inf_VPN126.cat
|
||||
|
||||
|
@ -8,7 +8,7 @@ Signature = "$Windows NT$"
|
||||
Class = Net
|
||||
ClassGUID = {4D36E972-E325-11CE-BFC1-08002BE10318}
|
||||
Provider = %CompanyName%
|
||||
DriverVer = 01/04/2014, 4.3.0.9407
|
||||
DriverVer = 01/07/2014, 4.3.0.9410
|
||||
|
||||
CatalogFile.NT = inf_VPN127.cat
|
||||
|
||||
|
@ -8,7 +8,7 @@ Signature = "$Windows NT$"
|
||||
Class = Net
|
||||
ClassGUID = {4D36E972-E325-11CE-BFC1-08002BE10318}
|
||||
Provider = %CompanyName%
|
||||
DriverVer = 01/04/2014, 4.3.0.9407
|
||||
DriverVer = 01/07/2014, 4.3.0.9410
|
||||
|
||||
CatalogFile.NT = inf_VPN13.cat
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user