mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2024-11-25 02:49:52 +03:00
Change line endings to LF
This commit is contained in:
parent
f52730c724
commit
9997785812
280
AUTHORS.TXT
280
AUTHORS.TXT
@ -1,140 +1,140 @@
|
|||||||
SoftEther VPN is developed by SoftEther VPN Project at University of Tsukuba.
|
SoftEther VPN is developed by SoftEther VPN Project at University of Tsukuba.
|
||||||
https://www.softether.org/
|
https://www.softether.org/
|
||||||
|
|
||||||
AUTHORS OF SOFTETHER VPN
|
AUTHORS OF SOFTETHER VPN
|
||||||
------------------------
|
------------------------
|
||||||
|
|
||||||
CORE DEVELOPERS:
|
CORE DEVELOPERS:
|
||||||
|
|
||||||
- Daiyuu Nobori, Ph.D.
|
- Daiyuu Nobori, Ph.D.
|
||||||
Computer Science, Graduate School of University of Tsukuba
|
Computer Science, Graduate School of University of Tsukuba
|
||||||
SoftEther Corporation
|
SoftEther Corporation
|
||||||
E-mail: daiyuu-nobori [at] softether.org
|
E-mail: daiyuu-nobori [at] softether.org
|
||||||
|
|
||||||
- Tetsuo Sugiyama, Ph.D.
|
- Tetsuo Sugiyama, Ph.D.
|
||||||
SoftEther Corporation
|
SoftEther Corporation
|
||||||
|
|
||||||
- Junpei Kuwana, Ph.D.
|
- Junpei Kuwana, Ph.D.
|
||||||
Risk Engineering, Graduate School of University of Tsukuba
|
Risk Engineering, Graduate School of University of Tsukuba
|
||||||
SoftEther Corporation
|
SoftEther Corporation
|
||||||
|
|
||||||
- Takao Ito, Ph.D.
|
- Takao Ito, Ph.D.
|
||||||
Computer Science, Graduate School of University of Tsukuba
|
Computer Science, Graduate School of University of Tsukuba
|
||||||
SoftEther Corporation
|
SoftEther Corporation
|
||||||
|
|
||||||
- Mei Sharie Ann Yamaguchi, Ph.D.
|
- Mei Sharie Ann Yamaguchi, Ph.D.
|
||||||
Life and Environmental Sciences, Graduate School of University of Tsukuba
|
Life and Environmental Sciences, Graduate School of University of Tsukuba
|
||||||
|
|
||||||
- Christopher Smith
|
- Christopher Smith
|
||||||
College of Information Science, University of Tsukuba
|
College of Information Science, University of Tsukuba
|
||||||
|
|
||||||
|
|
||||||
WEB-SITE DESIGNER:
|
WEB-SITE DESIGNER:
|
||||||
|
|
||||||
- Genya Hatakeyama
|
- Genya Hatakeyama
|
||||||
College of Information Science, University of Tsukuba
|
College of Information Science, University of Tsukuba
|
||||||
|
|
||||||
|
|
||||||
DEVELOPMENT BOARD MEMBERS:
|
DEVELOPMENT BOARD MEMBERS:
|
||||||
|
|
||||||
- Moataz Elmasry
|
- Moataz Elmasry
|
||||||
https://github.com/moatazelmasry2
|
https://github.com/moatazelmasry2
|
||||||
|
|
||||||
- Zulyandri Zardi
|
- Zulyandri Zardi
|
||||||
https://github.com/zulzardi
|
https://github.com/zulzardi
|
||||||
|
|
||||||
- Alex Maslakov
|
- Alex Maslakov
|
||||||
https://github.com/GildedHonour
|
https://github.com/GildedHonour
|
||||||
|
|
||||||
- Davide Beatrici
|
- Davide Beatrici
|
||||||
https://github.com/davidebeatrici
|
https://github.com/davidebeatrici
|
||||||
|
|
||||||
- Ilya Shipitsin
|
- Ilya Shipitsin
|
||||||
https://github.com/chipitsine
|
https://github.com/chipitsine
|
||||||
|
|
||||||
|
|
||||||
SPECIAL CONTRIBUTORS:
|
SPECIAL CONTRIBUTORS:
|
||||||
|
|
||||||
- Guido Vranken
|
- Guido Vranken
|
||||||
https://github.com/guidovranken
|
https://github.com/guidovranken
|
||||||
|
|
||||||
|
|
||||||
CONTRIBUTORS:
|
CONTRIBUTORS:
|
||||||
|
|
||||||
- ajeecai <ajee.cai@gmail.com>
|
- ajeecai <ajee.cai@gmail.com>
|
||||||
- Alexandre De Oliveira <yodresh@gmail.com>
|
- Alexandre De Oliveira <yodresh@gmail.com>
|
||||||
- Alexey Kryuchkov <alexey.kruchkov@gmail.com>
|
- Alexey Kryuchkov <alexey.kruchkov@gmail.com>
|
||||||
- Allen Cui <allen_st_clair@msn.com>
|
- Allen Cui <allen_st_clair@msn.com>
|
||||||
- Andy Walsh <andy.walsh44+github@gmail.com>
|
- Andy Walsh <andy.walsh44+github@gmail.com>
|
||||||
- Bernhard Rosenkränzer <bero@lindev.ch>
|
- Bernhard Rosenkränzer <bero@lindev.ch>
|
||||||
- Bill Welliver <bill@welliver.org>
|
- Bill Welliver <bill@welliver.org>
|
||||||
- Charles Surett <surettcharles@gmail.com>
|
- Charles Surett <surettcharles@gmail.com>
|
||||||
- cm0x4d <cm0x4d@codemonkey.ch>
|
- cm0x4d <cm0x4d@codemonkey.ch>
|
||||||
- DDGo <Wiki13@hotmail.nl>
|
- DDGo <Wiki13@hotmail.nl>
|
||||||
- Denis Lesnov <den.lesnov@gmail.com>
|
- Denis Lesnov <den.lesnov@gmail.com>
|
||||||
- Den Lesnov <https://github.com/Leden>
|
- Den Lesnov <https://github.com/Leden>
|
||||||
- Dexter Ang <thepoch@gmail.com>
|
- Dexter Ang <thepoch@gmail.com>
|
||||||
- Dmitry Glushenok <dglushenok@yandex.ru>
|
- Dmitry Glushenok <dglushenok@yandex.ru>
|
||||||
- Dmitry Orlov <dorlov@undev.ru>
|
- Dmitry Orlov <dorlov@undev.ru>
|
||||||
- ELIN <elin@mikomoe.jp>
|
- ELIN <elin@mikomoe.jp>
|
||||||
- Guanzhong Chen <quantum2048@gmail.com>
|
- Guanzhong Chen <quantum2048@gmail.com>
|
||||||
- Hideki Saito <hideki@hidekisaito.com>
|
- Hideki Saito <hideki@hidekisaito.com>
|
||||||
- holoreimu <michael3707@gmail.com>
|
- holoreimu <michael3707@gmail.com>
|
||||||
- Holoreimu <michael3707@gmail.com>
|
- Holoreimu <michael3707@gmail.com>
|
||||||
- hoppler <https://github.com/hoppler>
|
- hoppler <https://github.com/hoppler>
|
||||||
- Igor Pikovets <igor@ahrefs.com>
|
- Igor Pikovets <igor@ahrefs.com>
|
||||||
- James Brink <brink.james@gmail.com>
|
- James Brink <brink.james@gmail.com>
|
||||||
- Jeff Tang <https://github.com/mrjefftang>
|
- Jeff Tang <https://github.com/mrjefftang>
|
||||||
- Jioh L. Jung <ziozzang@gmail.com>
|
- Jioh L. Jung <ziozzang@gmail.com>
|
||||||
- Johan de Vries <devries@wivion.nl>
|
- Johan de Vries <devries@wivion.nl>
|
||||||
- Josh Soref <https://github.com/jsoref>
|
- Josh Soref <https://github.com/jsoref>
|
||||||
- Joshua Perry <josh@6bit.com>
|
- Joshua Perry <josh@6bit.com>
|
||||||
- Koichiro Iwao <meta@FreeBSD.org>
|
- Koichiro Iwao <meta@FreeBSD.org>
|
||||||
- Luiz Eduardo Gava <luiz.gava@procempa.com.br>
|
- Luiz Eduardo Gava <luiz.gava@procempa.com.br>
|
||||||
- macvk <tutumbul@gmail.com>
|
- macvk <tutumbul@gmail.com>
|
||||||
- Maks Naumov <maksqwe1@ukr.net>
|
- Maks Naumov <maksqwe1@ukr.net>
|
||||||
- Matt Lewandowsky <lewellyn@foxmail.com>
|
- Matt Lewandowsky <lewellyn@foxmail.com>
|
||||||
- Max Miroshnikov <mogikanin.tir@gmail.com>
|
- Max Miroshnikov <mogikanin.tir@gmail.com>
|
||||||
- Melvyn <yaurthek@gmail.com>
|
- Melvyn <yaurthek@gmail.com>
|
||||||
- Michael B <https://github.com/DownWithUp>
|
- Michael B <https://github.com/DownWithUp>
|
||||||
- Michael Clausen <cm0x4d@codemonkey.ch>
|
- Michael Clausen <cm0x4d@codemonkey.ch>
|
||||||
- Michael Clausen <michael.clausen@hevs.ch>
|
- Michael Clausen <michael.clausen@hevs.ch>
|
||||||
- Mike Selivanov <mikes777@gmail.com>
|
- Mike Selivanov <mikes777@gmail.com>
|
||||||
- Mikhail Pridushchenko <mikhail.pridushchenko@dsr-company.com>
|
- Mikhail Pridushchenko <mikhail.pridushchenko@dsr-company.com>
|
||||||
- mogikanin <mogikanin.tir@gmail.com>
|
- mogikanin <mogikanin.tir@gmail.com>
|
||||||
- Mykhaylo Yehorov <yehorov@gmail.com>
|
- Mykhaylo Yehorov <yehorov@gmail.com>
|
||||||
- nattoheaven <nattoheaven@gmail.com>
|
- nattoheaven <nattoheaven@gmail.com>
|
||||||
- Nguyễn Hồng Quân <ng.hong.quan@gmail.com>
|
- Nguyễn Hồng Quân <ng.hong.quan@gmail.com>
|
||||||
- Noah O'Donoghue <https://github.com/NoahO>
|
- Noah O'Donoghue <https://github.com/NoahO>
|
||||||
- NOKUBI Takatsugu <knok@daionet.gr.jp>
|
- NOKUBI Takatsugu <knok@daionet.gr.jp>
|
||||||
- NoNameA 774 <nonamea774@gmail.com>
|
- NoNameA 774 <nonamea774@gmail.com>
|
||||||
- Norbert Preining <norbert@preining.info>
|
- Norbert Preining <norbert@preining.info>
|
||||||
- NV <nvsofts@gmail.com>
|
- NV <nvsofts@gmail.com>
|
||||||
- Olimjon <olim98@bk.ru>
|
- Olimjon <olim98@bk.ru>
|
||||||
- parly <https://github.com/parly>
|
- parly <https://github.com/parly>
|
||||||
- PeTeeR <tom2pet@gmail.com>
|
- PeTeeR <tom2pet@gmail.com>
|
||||||
- Quantum <quantum2048@gmail.com>
|
- Quantum <quantum2048@gmail.com>
|
||||||
- Quintin <quintin@last.za.net>
|
- Quintin <quintin@last.za.net>
|
||||||
- Raymond Tau <raymondtau@gmail.com>
|
- Raymond Tau <raymondtau@gmail.com>
|
||||||
- rel22 <rel22@inbox.ru>
|
- rel22 <rel22@inbox.ru>
|
||||||
- Renaud Allard <renaud@allard.it>
|
- Renaud Allard <renaud@allard.it>
|
||||||
- root <root@vpn.sjbcom.com>
|
- root <root@vpn.sjbcom.com>
|
||||||
- Sacha J Bernstein <sacha@sjbcom.com>
|
- Sacha J Bernstein <sacha@sjbcom.com>
|
||||||
- Sahal Ansari <github@sahal.info>
|
- Sahal Ansari <github@sahal.info>
|
||||||
- Shadus Black <blackholefoxdev@gmail.com>
|
- Shadus Black <blackholefoxdev@gmail.com>
|
||||||
- thepyper <thepyper@gmail.com>
|
- thepyper <thepyper@gmail.com>
|
||||||
- Tim Schneider <schneider0tim@gmail.com>
|
- Tim Schneider <schneider0tim@gmail.com>
|
||||||
- tonychung00 <tonychung00@gmail.com>
|
- tonychung00 <tonychung00@gmail.com>
|
||||||
- Victor Salgado <vms@pinhaotec.com.br>
|
- Victor Salgado <vms@pinhaotec.com.br>
|
||||||
- William Welliver <william@welliver.org>
|
- William Welliver <william@welliver.org>
|
||||||
- YF <yfdyh000@gmail.com>
|
- YF <yfdyh000@gmail.com>
|
||||||
|
|
||||||
|
|
||||||
JOIN THE SOFTETHER VPN DEVELOPMENT
|
JOIN THE SOFTETHER VPN DEVELOPMENT
|
||||||
----------------------------------
|
----------------------------------
|
||||||
|
|
||||||
Want to become a contributor? Please send us a patch.
|
Want to become a contributor? Please send us a patch.
|
||||||
|
|
||||||
See also: SoftEther VPN Patch Acceptance Policy
|
See also: SoftEther VPN Patch Acceptance Policy
|
||||||
https://www.softether.org/5-download/src/9.patch
|
https://www.softether.org/5-download/src/9.patch
|
||||||
|
|
||||||
|
484
LICENSE
484
LICENSE
@ -1,242 +1,242 @@
|
|||||||
Apache License
|
Apache License
|
||||||
Version 2.0, January 2004
|
Version 2.0, January 2004
|
||||||
http://www.apache.org/licenses/
|
http://www.apache.org/licenses/
|
||||||
|
|
||||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||||
|
|
||||||
1. Definitions.
|
1. Definitions.
|
||||||
|
|
||||||
"License" shall mean the terms and conditions for use, reproduction,
|
"License" shall mean the terms and conditions for use, reproduction,
|
||||||
and distribution as defined by Sections 1 through 9 of this document.
|
and distribution as defined by Sections 1 through 9 of this document.
|
||||||
|
|
||||||
"Licensor" shall mean the copyright owner or entity authorized by
|
"Licensor" shall mean the copyright owner or entity authorized by
|
||||||
the copyright owner that is granting the License.
|
the copyright owner that is granting the License.
|
||||||
|
|
||||||
"Legal Entity" shall mean the union of the acting entity and all
|
"Legal Entity" shall mean the union of the acting entity and all
|
||||||
other entities that control, are controlled by, or are under common
|
other entities that control, are controlled by, or are under common
|
||||||
control with that entity. For the purposes of this definition,
|
control with that entity. For the purposes of this definition,
|
||||||
"control" means (i) the power, direct or indirect, to cause the
|
"control" means (i) the power, direct or indirect, to cause the
|
||||||
direction or management of such entity, whether by contract or
|
direction or management of such entity, whether by contract or
|
||||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||||
|
|
||||||
"You" (or "Your") shall mean an individual or Legal Entity
|
"You" (or "Your") shall mean an individual or Legal Entity
|
||||||
exercising permissions granted by this License.
|
exercising permissions granted by this License.
|
||||||
|
|
||||||
"Source" form shall mean the preferred form for making modifications,
|
"Source" form shall mean the preferred form for making modifications,
|
||||||
including but not limited to software source code, documentation
|
including but not limited to software source code, documentation
|
||||||
source, and configuration files.
|
source, and configuration files.
|
||||||
|
|
||||||
"Object" form shall mean any form resulting from mechanical
|
"Object" form shall mean any form resulting from mechanical
|
||||||
transformation or translation of a Source form, including but
|
transformation or translation of a Source form, including but
|
||||||
not limited to compiled object code, generated documentation,
|
not limited to compiled object code, generated documentation,
|
||||||
and conversions to other media types.
|
and conversions to other media types.
|
||||||
|
|
||||||
"Work" shall mean the work of authorship, whether in Source or
|
"Work" shall mean the work of authorship, whether in Source or
|
||||||
Object form, made available under the License, as indicated by a
|
Object form, made available under the License, as indicated by a
|
||||||
copyright notice that is included in or attached to the work
|
copyright notice that is included in or attached to the work
|
||||||
(an example is provided in the Appendix below).
|
(an example is provided in the Appendix below).
|
||||||
|
|
||||||
"Derivative Works" shall mean any work, whether in Source or Object
|
"Derivative Works" shall mean any work, whether in Source or Object
|
||||||
form, that is based on (or derived from) the Work and for which the
|
form, that is based on (or derived from) the Work and for which the
|
||||||
editorial revisions, annotations, elaborations, or other modifications
|
editorial revisions, annotations, elaborations, or other modifications
|
||||||
represent, as a whole, an original work of authorship. For the purposes
|
represent, as a whole, an original work of authorship. For the purposes
|
||||||
of this License, Derivative Works shall not include works that remain
|
of this License, Derivative Works shall not include works that remain
|
||||||
separable from, or merely link (or bind by name) to the interfaces of,
|
separable from, or merely link (or bind by name) to the interfaces of,
|
||||||
the Work and Derivative Works thereof.
|
the Work and Derivative Works thereof.
|
||||||
|
|
||||||
"Contribution" shall mean any work of authorship, including
|
"Contribution" shall mean any work of authorship, including
|
||||||
the original version of the Work and any modifications or additions
|
the original version of the Work and any modifications or additions
|
||||||
to that Work or Derivative Works thereof, that is intentionally
|
to that Work or Derivative Works thereof, that is intentionally
|
||||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||||
or by an individual or Legal Entity authorized to submit on behalf of
|
or by an individual or Legal Entity authorized to submit on behalf of
|
||||||
the copyright owner. For the purposes of this definition, "submitted"
|
the copyright owner. For the purposes of this definition, "submitted"
|
||||||
means any form of electronic, verbal, or written communication sent
|
means any form of electronic, verbal, or written communication sent
|
||||||
to the Licensor or its representatives, including but not limited to
|
to the Licensor or its representatives, including but not limited to
|
||||||
communication on electronic mailing lists, source code control systems,
|
communication on electronic mailing lists, source code control systems,
|
||||||
and issue tracking systems that are managed by, or on behalf of, the
|
and issue tracking systems that are managed by, or on behalf of, the
|
||||||
Licensor for the purpose of discussing and improving the Work, but
|
Licensor for the purpose of discussing and improving the Work, but
|
||||||
excluding communication that is conspicuously marked or otherwise
|
excluding communication that is conspicuously marked or otherwise
|
||||||
designated in writing by the copyright owner as "Not a Contribution."
|
designated in writing by the copyright owner as "Not a Contribution."
|
||||||
|
|
||||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||||
on behalf of whom a Contribution has been received by Licensor and
|
on behalf of whom a Contribution has been received by Licensor and
|
||||||
subsequently incorporated within the Work.
|
subsequently incorporated within the Work.
|
||||||
|
|
||||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
copyright license to reproduce, prepare Derivative Works of,
|
copyright license to reproduce, prepare Derivative Works of,
|
||||||
publicly display, publicly perform, sublicense, and distribute the
|
publicly display, publicly perform, sublicense, and distribute the
|
||||||
Work and such Derivative Works in Source or Object form.
|
Work and such Derivative Works in Source or Object form.
|
||||||
|
|
||||||
3. Grant of Patent License. Subject to the terms and conditions of
|
3. Grant of Patent License. Subject to the terms and conditions of
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
(except as stated in this section) patent license to make, have made,
|
(except as stated in this section) patent license to make, have made,
|
||||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||||
where such license applies only to those patent claims licensable
|
where such license applies only to those patent claims licensable
|
||||||
by such Contributor that are necessarily infringed by their
|
by such Contributor that are necessarily infringed by their
|
||||||
Contribution(s) alone or by combination of their Contribution(s)
|
Contribution(s) alone or by combination of their Contribution(s)
|
||||||
with the Work to which such Contribution(s) was submitted. If You
|
with the Work to which such Contribution(s) was submitted. If You
|
||||||
institute patent litigation against any entity (including a
|
institute patent litigation against any entity (including a
|
||||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||||
or a Contribution incorporated within the Work constitutes direct
|
or a Contribution incorporated within the Work constitutes direct
|
||||||
or contributory patent infringement, then any patent licenses
|
or contributory patent infringement, then any patent licenses
|
||||||
granted to You under this License for that Work shall terminate
|
granted to You under this License for that Work shall terminate
|
||||||
as of the date such litigation is filed.
|
as of the date such litigation is filed.
|
||||||
|
|
||||||
4. Redistribution. You may reproduce and distribute copies of the
|
4. Redistribution. You may reproduce and distribute copies of the
|
||||||
Work or Derivative Works thereof in any medium, with or without
|
Work or Derivative Works thereof in any medium, with or without
|
||||||
modifications, and in Source or Object form, provided that You
|
modifications, and in Source or Object form, provided that You
|
||||||
meet the following conditions:
|
meet the following conditions:
|
||||||
|
|
||||||
(a) You must give any other recipients of the Work or
|
(a) You must give any other recipients of the Work or
|
||||||
Derivative Works a copy of this License; and
|
Derivative Works a copy of this License; and
|
||||||
|
|
||||||
(b) You must cause any modified files to carry prominent notices
|
(b) You must cause any modified files to carry prominent notices
|
||||||
stating that You changed the files; and
|
stating that You changed the files; and
|
||||||
|
|
||||||
(c) You must retain, in the Source form of any Derivative Works
|
(c) You must retain, in the Source form of any Derivative Works
|
||||||
that You distribute, all copyright, patent, trademark, and
|
that You distribute, all copyright, patent, trademark, and
|
||||||
attribution notices from the Source form of the Work,
|
attribution notices from the Source form of the Work,
|
||||||
excluding those notices that do not pertain to any part of
|
excluding those notices that do not pertain to any part of
|
||||||
the Derivative Works; and
|
the Derivative Works; and
|
||||||
|
|
||||||
(d) If the Work includes a "NOTICE" text file as part of its
|
(d) If the Work includes a "NOTICE" text file as part of its
|
||||||
distribution, then any Derivative Works that You distribute must
|
distribution, then any Derivative Works that You distribute must
|
||||||
include a readable copy of the attribution notices contained
|
include a readable copy of the attribution notices contained
|
||||||
within such NOTICE file, excluding those notices that do not
|
within such NOTICE file, excluding those notices that do not
|
||||||
pertain to any part of the Derivative Works, in at least one
|
pertain to any part of the Derivative Works, in at least one
|
||||||
of the following places: within a NOTICE text file distributed
|
of the following places: within a NOTICE text file distributed
|
||||||
as part of the Derivative Works; within the Source form or
|
as part of the Derivative Works; within the Source form or
|
||||||
documentation, if provided along with the Derivative Works; or,
|
documentation, if provided along with the Derivative Works; or,
|
||||||
within a display generated by the Derivative Works, if and
|
within a display generated by the Derivative Works, if and
|
||||||
wherever such third-party notices normally appear. The contents
|
wherever such third-party notices normally appear. The contents
|
||||||
of the NOTICE file are for informational purposes only and
|
of the NOTICE file are for informational purposes only and
|
||||||
do not modify the License. You may add Your own attribution
|
do not modify the License. You may add Your own attribution
|
||||||
notices within Derivative Works that You distribute, alongside
|
notices within Derivative Works that You distribute, alongside
|
||||||
or as an addendum to the NOTICE text from the Work, provided
|
or as an addendum to the NOTICE text from the Work, provided
|
||||||
that such additional attribution notices cannot be construed
|
that such additional attribution notices cannot be construed
|
||||||
as modifying the License.
|
as modifying the License.
|
||||||
|
|
||||||
You may add Your own copyright statement to Your modifications and
|
You may add Your own copyright statement to Your modifications and
|
||||||
may provide additional or different license terms and conditions
|
may provide additional or different license terms and conditions
|
||||||
for use, reproduction, or distribution of Your modifications, or
|
for use, reproduction, or distribution of Your modifications, or
|
||||||
for any such Derivative Works as a whole, provided Your use,
|
for any such Derivative Works as a whole, provided Your use,
|
||||||
reproduction, and distribution of the Work otherwise complies with
|
reproduction, and distribution of the Work otherwise complies with
|
||||||
the conditions stated in this License.
|
the conditions stated in this License.
|
||||||
|
|
||||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||||
any Contribution intentionally submitted for inclusion in the Work
|
any Contribution intentionally submitted for inclusion in the Work
|
||||||
by You to the Licensor shall be under the terms and conditions of
|
by You to the Licensor shall be under the terms and conditions of
|
||||||
this License, without any additional terms or conditions.
|
this License, without any additional terms or conditions.
|
||||||
Notwithstanding the above, nothing herein shall supersede or modify
|
Notwithstanding the above, nothing herein shall supersede or modify
|
||||||
the terms of any separate license agreement you may have executed
|
the terms of any separate license agreement you may have executed
|
||||||
with Licensor regarding such Contributions.
|
with Licensor regarding such Contributions.
|
||||||
|
|
||||||
6. Trademarks. This License does not grant permission to use the trade
|
6. Trademarks. This License does not grant permission to use the trade
|
||||||
names, trademarks, service marks, or product names of the Licensor,
|
names, trademarks, service marks, or product names of the Licensor,
|
||||||
except as required for reasonable and customary use in describing the
|
except as required for reasonable and customary use in describing the
|
||||||
origin of the Work and reproducing the content of the NOTICE file.
|
origin of the Work and reproducing the content of the NOTICE file.
|
||||||
|
|
||||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||||
agreed to in writing, Licensor provides the Work (and each
|
agreed to in writing, Licensor provides the Work (and each
|
||||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||||
implied, including, without limitation, any warranties or conditions
|
implied, including, without limitation, any warranties or conditions
|
||||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||||
appropriateness of using or redistributing the Work and assume any
|
appropriateness of using or redistributing the Work and assume any
|
||||||
risks associated with Your exercise of permissions under this License.
|
risks associated with Your exercise of permissions under this License.
|
||||||
|
|
||||||
8. Limitation of Liability. In no event and under no legal theory,
|
8. Limitation of Liability. In no event and under no legal theory,
|
||||||
whether in tort (including negligence), contract, or otherwise,
|
whether in tort (including negligence), contract, or otherwise,
|
||||||
unless required by applicable law (such as deliberate and grossly
|
unless required by applicable law (such as deliberate and grossly
|
||||||
negligent acts) or agreed to in writing, shall any Contributor be
|
negligent acts) or agreed to in writing, shall any Contributor be
|
||||||
liable to You for damages, including any direct, indirect, special,
|
liable to You for damages, including any direct, indirect, special,
|
||||||
incidental, or consequential damages of any character arising as a
|
incidental, or consequential damages of any character arising as a
|
||||||
result of this License or out of the use or inability to use the
|
result of this License or out of the use or inability to use the
|
||||||
Work (including but not limited to damages for loss of goodwill,
|
Work (including but not limited to damages for loss of goodwill,
|
||||||
work stoppage, computer failure or malfunction, or any and all
|
work stoppage, computer failure or malfunction, or any and all
|
||||||
other commercial damages or losses), even if such Contributor
|
other commercial damages or losses), even if such Contributor
|
||||||
has been advised of the possibility of such damages.
|
has been advised of the possibility of such damages.
|
||||||
|
|
||||||
9. Accepting Warranty or Additional Liability. While redistributing
|
9. Accepting Warranty or Additional Liability. While redistributing
|
||||||
the Work or Derivative Works thereof, You may choose to offer,
|
the Work or Derivative Works thereof, You may choose to offer,
|
||||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||||
or other liability obligations and/or rights consistent with this
|
or other liability obligations and/or rights consistent with this
|
||||||
License. However, in accepting such obligations, You may act only
|
License. However, in accepting such obligations, You may act only
|
||||||
on Your own behalf and on Your sole responsibility, not on behalf
|
on Your own behalf and on Your sole responsibility, not on behalf
|
||||||
of any other Contributor, and only if You agree to indemnify,
|
of any other Contributor, and only if You agree to indemnify,
|
||||||
defend, and hold each Contributor harmless for any liability
|
defend, and hold each Contributor harmless for any liability
|
||||||
incurred by, or claims asserted against, such Contributor by reason
|
incurred by, or claims asserted against, such Contributor by reason
|
||||||
of your accepting any such warranty or additional liability.
|
of your accepting any such warranty or additional liability.
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
|
||||||
Copyright (c) all contributors on SoftEther VPN project in GitHub.
|
Copyright (c) all contributors on SoftEther VPN project in GitHub.
|
||||||
Copyright (c) Daiyuu Nobori, SoftEther Project at University of Tsukuba, and SoftEther Corporation.
|
Copyright (c) Daiyuu Nobori, SoftEther Project at University of Tsukuba, and SoftEther Corporation.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
Unless required by applicable law or agreed to in writing, software
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
DISCLAIMER
|
DISCLAIMER
|
||||||
==========
|
==========
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
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
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
SOFTWARE.
|
SOFTWARE.
|
||||||
|
|
||||||
THIS SOFTWARE IS DEVELOPED IN JAPAN, AND DISTRIBUTED FROM JAPAN, UNDER
|
THIS SOFTWARE IS DEVELOPED IN JAPAN, AND DISTRIBUTED FROM JAPAN, UNDER
|
||||||
JAPANESE LAWS. YOU MUST AGREE IN ADVANCE TO USE, COPY, MODIFY, MERGE, PUBLISH,
|
JAPANESE LAWS. YOU MUST AGREE IN ADVANCE TO USE, COPY, MODIFY, MERGE, PUBLISH,
|
||||||
DISTRIBUTE, SUBLICENSE, AND/OR SELL COPIES OF THIS SOFTWARE, THAT ANY
|
DISTRIBUTE, SUBLICENSE, AND/OR SELL COPIES OF THIS SOFTWARE, THAT ANY
|
||||||
JURIDICAL DISPUTES WHICH ARE CONCERNED TO THIS SOFTWARE OR ITS CONTENTS,
|
JURIDICAL DISPUTES WHICH ARE CONCERNED TO THIS SOFTWARE OR ITS CONTENTS,
|
||||||
AGAINST US (SOFTETHER PROJECT, SOFTETHER CORPORATION, DAIYUU NOBORI OR OTHER
|
AGAINST US (SOFTETHER PROJECT, SOFTETHER CORPORATION, DAIYUU NOBORI OR OTHER
|
||||||
SUPPLIERS), OR ANY JURIDICAL DISPUTES AGAINST US WHICH ARE CAUSED BY ANY KIND
|
SUPPLIERS), OR ANY JURIDICAL DISPUTES AGAINST US WHICH ARE CAUSED BY ANY KIND
|
||||||
OF USING, COPYING, MODIFYING, MERGING, PUBLISHING, DISTRIBUTING, SUBLICENSING,
|
OF USING, COPYING, MODIFYING, MERGING, PUBLISHING, DISTRIBUTING, SUBLICENSING,
|
||||||
AND/OR SELLING COPIES OF THIS SOFTWARE SHALL BE REGARDED AS BE CONSTRUED AND
|
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
|
CONTROLLED BY JAPANESE LAWS, AND YOU MUST FURTHER CONSENT TO EXCLUSIVE
|
||||||
JURISDICTION AND VENUE IN THE COURTS SITTING IN TOKYO, JAPAN. YOU MUST WAIVE
|
JURISDICTION AND VENUE IN THE COURTS SITTING IN TOKYO, JAPAN. YOU MUST WAIVE
|
||||||
ALL DEFENSES OF LACK OF PERSONAL JURISDICTION AND FORUM NON CONVENIENS.
|
ALL DEFENSES OF LACK OF PERSONAL JURISDICTION AND FORUM NON CONVENIENS.
|
||||||
PROCESS MAY BE SERVED ON EITHER PARTY IN THE MANNER AUTHORIZED BY APPLICABLE
|
PROCESS MAY BE SERVED ON EITHER PARTY IN THE MANNER AUTHORIZED BY APPLICABLE
|
||||||
LAW OR COURT RULE.
|
LAW OR COURT RULE.
|
||||||
|
|
||||||
USE ONLY IN JAPAN. DO NOT USE THIS SOFTWARE IN ANOTHER COUNTRY UNLESS YOU HAVE
|
USE ONLY IN JAPAN. DO NOT USE THIS SOFTWARE IN ANOTHER COUNTRY UNLESS YOU HAVE
|
||||||
A CONFIRMATION THAT THIS SOFTWARE DOES NOT VIOLATE ANY CRIMINAL LAWS OR CIVIL
|
A CONFIRMATION THAT THIS SOFTWARE DOES NOT VIOLATE ANY CRIMINAL LAWS OR CIVIL
|
||||||
RIGHTS IN THAT PARTICULAR COUNTRY. USING THIS SOFTWARE IN OTHER COUNTRIES IS
|
RIGHTS IN THAT PARTICULAR COUNTRY. USING THIS SOFTWARE IN OTHER COUNTRIES IS
|
||||||
COMPLETELY AT YOUR OWN RISK. THE SOFTETHER VPN PROJECT HAS DEVELOPED AND
|
COMPLETELY AT YOUR OWN RISK. THE SOFTETHER VPN PROJECT HAS DEVELOPED AND
|
||||||
DISTRIBUTED THIS SOFTWARE TO COMPLY ONLY WITH THE JAPANESE LAWS AND EXISTING
|
DISTRIBUTED THIS SOFTWARE TO COMPLY ONLY WITH THE JAPANESE LAWS AND EXISTING
|
||||||
CIVIL RIGHTS INCLUDING PATENTS WHICH ARE SUBJECTS APPLY IN JAPAN. OTHER
|
CIVIL RIGHTS INCLUDING PATENTS WHICH ARE SUBJECTS APPLY IN JAPAN. OTHER
|
||||||
COUNTRIES' LAWS OR CIVIL RIGHTS ARE NONE OF OUR CONCERNS NOR RESPONSIBILITIES.
|
COUNTRIES' LAWS OR CIVIL RIGHTS ARE NONE OF OUR CONCERNS NOR RESPONSIBILITIES.
|
||||||
WE HAVE NEVER INVESTIGATED ANY CRIMINAL REGULATIONS, CIVIL LAWS OR
|
WE HAVE NEVER INVESTIGATED ANY CRIMINAL REGULATIONS, CIVIL LAWS OR
|
||||||
INTELLECTUAL PROPERTY RIGHTS INCLUDING PATENTS IN ANY OF OTHER 200+ COUNTRIES
|
INTELLECTUAL PROPERTY RIGHTS INCLUDING PATENTS IN ANY OF OTHER 200+ COUNTRIES
|
||||||
AND TERRITORIES. BY NATURE, THERE ARE 200+ REGIONS IN THE WORLD, WITH
|
AND TERRITORIES. BY NATURE, THERE ARE 200+ REGIONS IN THE WORLD, WITH
|
||||||
DIFFERENT LAWS. IT IS IMPOSSIBLE TO VERIFY EVERY COUNTRIES' LAWS, REGULATIONS
|
DIFFERENT LAWS. IT IS IMPOSSIBLE TO VERIFY EVERY COUNTRIES' LAWS, REGULATIONS
|
||||||
AND CIVIL RIGHTS TO MAKE THE SOFTWARE COMPLY WITH ALL COUNTRIES' LAWS BY THE
|
AND CIVIL RIGHTS TO MAKE THE SOFTWARE COMPLY WITH ALL COUNTRIES' LAWS BY THE
|
||||||
PROJECT. EVEN IF YOU WILL BE SUED BY A PRIVATE ENTITY OR BE DAMAGED BY A
|
PROJECT. EVEN IF YOU WILL BE SUED BY A PRIVATE ENTITY OR BE DAMAGED BY A
|
||||||
PUBLIC SERVANT IN YOUR COUNTRY, THE DEVELOPERS OF THIS SOFTWARE WILL NEVER BE
|
PUBLIC SERVANT IN YOUR COUNTRY, THE DEVELOPERS OF THIS SOFTWARE WILL NEVER BE
|
||||||
LIABLE TO RECOVER OR COMPENSATE SUCH DAMAGES, CRIMINAL OR CIVIL
|
LIABLE TO RECOVER OR COMPENSATE SUCH DAMAGES, CRIMINAL OR CIVIL
|
||||||
RESPONSIBILITIES. NOTE THAT THIS LINE IS NOT LICENSE RESTRICTION BUT JUST A
|
RESPONSIBILITIES. NOTE THAT THIS LINE IS NOT LICENSE RESTRICTION BUT JUST A
|
||||||
STATEMENT FOR WARNING AND DISCLAIMER.
|
STATEMENT FOR WARNING AND DISCLAIMER.
|
||||||
|
|
||||||
READ AND UNDERSTAND THE 'src/WARNING.TXT' FILE BEFORE USING THIS SOFTWARE.
|
READ AND UNDERSTAND THE 'src/WARNING.TXT' FILE BEFORE USING THIS SOFTWARE.
|
||||||
SOME SOFTWARE PROGRAMS FROM THIRD PARTIES ARE INCLUDED ON THIS SOFTWARE WITH
|
SOME SOFTWARE PROGRAMS FROM THIRD PARTIES ARE INCLUDED ON THIS SOFTWARE WITH
|
||||||
LICENSE CONDITIONS WHICH ARE DESCRIBED ON THE 'src/THIRD_PARTY.TXT' FILE.
|
LICENSE CONDITIONS WHICH ARE DESCRIBED ON THE 'src/THIRD_PARTY.TXT' FILE.
|
||||||
|
|
||||||
|
546
README.md
546
README.md
@ -1,273 +1,273 @@
|
|||||||
# SoftEther VPN
|
# SoftEther VPN
|
||||||
|
|
||||||
||Badges|
|
||Badges|
|
||||||
|---|---|
|
|---|---|
|
||||||
|AppVeyor|[![AppVeyor build status](https://ci.appveyor.com/api/projects/status/github/softethervpn/softethervpn?branch=master&svg=true)](https://ci.appveyor.com/project/softethervpn/softethervpn) |
|
|AppVeyor|[![AppVeyor build status](https://ci.appveyor.com/api/projects/status/github/softethervpn/softethervpn?branch=master&svg=true)](https://ci.appveyor.com/project/softethervpn/softethervpn) |
|
||||||
|Travis CI|[![Travis CI build status](https://travis-ci.org/SoftEtherVPN/SoftEtherVPN.svg?branch=master)](https://travis-ci.org/SoftEtherVPN/SoftEtherVPN) |
|
|Travis CI|[![Travis CI build status](https://travis-ci.org/SoftEtherVPN/SoftEtherVPN.svg?branch=master)](https://travis-ci.org/SoftEtherVPN/SoftEtherVPN) |
|
||||||
|GitLab CI|[![GitLab CI build status](https://gitlab.com/SoftEther/SoftEtherVPN/badges/master/pipeline.svg)](https://gitlab.com/SoftEther/SoftEtherVPN/pipelines)|
|
|GitLab CI|[![GitLab CI build status](https://gitlab.com/SoftEther/SoftEtherVPN/badges/master/pipeline.svg)](https://gitlab.com/SoftEther/SoftEtherVPN/pipelines)|
|
||||||
|Coverity Scan|[![Coverity Scan build status](https://scan.coverity.com/projects/16304/badge.svg)](https://scan.coverity.com/projects/softethervpn-softethervpn)|
|
|Coverity Scan|[![Coverity Scan build status](https://scan.coverity.com/projects/16304/badge.svg)](https://scan.coverity.com/projects/softethervpn-softethervpn)|
|
||||||
|Azure Pipelines|[![Azure Pipelines build status for Nightly](https://dev.azure.com/SoftEther-VPN/SoftEther%20VPN/_apis/build/status/6?api-version=6.0-preview.1)](https://dev.azure.com/SoftEther-VPN/SoftEther%20VPN/_build?definitionId=6)|
|
|Azure Pipelines|[![Azure Pipelines build status for Nightly](https://dev.azure.com/SoftEther-VPN/SoftEther%20VPN/_apis/build/status/6?api-version=6.0-preview.1)](https://dev.azure.com/SoftEther-VPN/SoftEther%20VPN/_build?definitionId=6)|
|
||||||
|Cirrus CI|[![Cirrus CI build status](https://api.cirrus-ci.com/github/SoftEtherVPN/SoftEtherVPN.svg)](https://cirrus-ci.com/github/SoftEtherVPN/SoftEtherVPN)|
|
|Cirrus CI|[![Cirrus CI build status](https://api.cirrus-ci.com/github/SoftEtherVPN/SoftEtherVPN.svg)](https://cirrus-ci.com/github/SoftEtherVPN/SoftEtherVPN)|
|
||||||
|
|
||||||
- [SoftEther VPN](#softether-vpn)
|
- [SoftEther VPN](#softether-vpn)
|
||||||
- [BOARD MEMBERS OF THIS REPOSITORY](#board-members-of-this-repository)
|
- [BOARD MEMBERS OF THIS REPOSITORY](#board-members-of-this-repository)
|
||||||
- [SOFTETHER VPN ADVANTAGES](#softether-vpn-advantages)
|
- [SOFTETHER VPN ADVANTAGES](#softether-vpn-advantages)
|
||||||
- [Installation](#installation)
|
- [Installation](#installation)
|
||||||
* [For Ubuntu](#for-ubuntu)
|
* [For Ubuntu](#for-ubuntu)
|
||||||
* [For FreeBSD](#for-freebsd)
|
* [For FreeBSD](#for-freebsd)
|
||||||
* [From binary installers:](#from-binary-installers)
|
* [From binary installers:](#from-binary-installers)
|
||||||
* [Build from Source code](#build-from-source-code)
|
* [Build from Source code](#build-from-source-code)
|
||||||
- [About HTML5-based Modern Admin Console and JSON-RPC API Suite](#about-html5-based-modern-admin-console-and-json-rpc-api-suite)
|
- [About HTML5-based Modern Admin Console and JSON-RPC API Suite](#about-html5-based-modern-admin-console-and-json-rpc-api-suite)
|
||||||
* [Built-in SoftEther VPN Server HTML5 Ajax-based Web Administration Console](#built-in-softether-vpn-server-html5-ajax-based-web-administration-console)
|
* [Built-in SoftEther VPN Server HTML5 Ajax-based Web Administration Console](#built-in-softether-vpn-server-html5-ajax-based-web-administration-console)
|
||||||
* [Built-in SoftEther Server VPN JSON-RPC API Suite](#built-in-softether-server-vpn-json-rpc-api-suite)
|
* [Built-in SoftEther Server VPN JSON-RPC API Suite](#built-in-softether-server-vpn-json-rpc-api-suite)
|
||||||
- [TO CIRCUMVENT YOUR GOVERNMENT'S FIREWALL RESTRICTION](#to-circumvent-your-governments-firewall-restriction)
|
- [TO CIRCUMVENT YOUR GOVERNMENT'S FIREWALL RESTRICTION](#to-circumvent-your-governments-firewall-restriction)
|
||||||
- [SOURCE CODE CONTRIBUTION](#source-code-contribution)
|
- [SOURCE CODE CONTRIBUTION](#source-code-contribution)
|
||||||
- [DEAR SECURITY EXPERTS](#dear-security-experts)
|
- [DEAR SECURITY EXPERTS](#dear-security-experts)
|
||||||
|
|
||||||
SoftEther VPN (Developer Edition Master Repository)
|
SoftEther VPN (Developer Edition Master Repository)
|
||||||
- An Open-Source Cross-platform Multi-protocol VPN Program
|
- An Open-Source Cross-platform Multi-protocol VPN Program
|
||||||
https://www.softether.org/
|
https://www.softether.org/
|
||||||
|
|
||||||
|
|
||||||
This repository has experimental codes. Pull requests are welcome.
|
This repository has experimental codes. Pull requests are welcome.
|
||||||
|
|
||||||
Stable Edition is available on
|
Stable Edition is available on
|
||||||
https://github.com/SoftEtherVPN/SoftEtherVPN_Stable
|
https://github.com/SoftEtherVPN/SoftEtherVPN_Stable
|
||||||
which the non-developer user can stable use.
|
which the non-developer user can stable use.
|
||||||
|
|
||||||
Source code packages (.zip and .tar.gz) and binary files of Stable Edition are also available:
|
Source code packages (.zip and .tar.gz) and binary files of Stable Edition are also available:
|
||||||
https://www.softether-download.com/
|
https://www.softether-download.com/
|
||||||
|
|
||||||
Copyright (c) all contributors on SoftEther VPN project in GitHub.
|
Copyright (c) all contributors on SoftEther VPN project in GitHub.
|
||||||
Copyright (c) Daiyuu Nobori, SoftEther Project at University of Tsukuba, and SoftEther Corporation.
|
Copyright (c) Daiyuu Nobori, SoftEther Project at University of Tsukuba, and SoftEther Corporation.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
The development of SoftEther VPN was supported by the MITOH Project,
|
The development of SoftEther VPN was supported by the MITOH Project,
|
||||||
a research and development project by Japanese Government,
|
a research and development project by Japanese Government,
|
||||||
subsidized by Ministry of Economy, Trade and Industry of Japan,
|
subsidized by Ministry of Economy, Trade and Industry of Japan,
|
||||||
administrated by Information Promotion Agency.
|
administrated by Information Promotion Agency.
|
||||||
https://www.ipa.go.jp/english/humandev/
|
https://www.ipa.go.jp/english/humandev/
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
![https://icons8.com](resources/icons8.png "Icons8")
|
![https://icons8.com](resources/icons8.png "Icons8")
|
||||||
|
|
||||||
[Icons8](https://icons8.com) kindly supported the project by gifting a license which allows to edit and redistribute their icons.
|
[Icons8](https://icons8.com) kindly supported the project by gifting a license which allows to edit and redistribute their icons.
|
||||||
|
|
||||||
Please note that you are not allowed to redistribute those icons outside of this repository.
|
Please note that you are not allowed to redistribute those icons outside of this repository.
|
||||||
|
|
||||||
The developers of SoftEther VPN love Icons8's work and kindly ask the users to support them as much as possible.
|
The developers of SoftEther VPN love Icons8's work and kindly ask the users to support them as much as possible.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
SoftEther VPN ("SoftEther" means "Software Ethernet") is one of the
|
SoftEther VPN ("SoftEther" means "Software Ethernet") is one of the
|
||||||
world's most powerful and easy-to-use multi-protocol VPN software.
|
world's most powerful and easy-to-use multi-protocol VPN software.
|
||||||
|
|
||||||
SoftEther VPN runs on Windows, Linux, Mac, FreeBSD and Solaris.
|
SoftEther VPN runs on Windows, Linux, Mac, FreeBSD and Solaris.
|
||||||
|
|
||||||
SoftEther VPN supports most of widely-used VPN protocols
|
SoftEther VPN supports most of widely-used VPN protocols
|
||||||
including SSL-VPN, OpenVPN, IPsec, L2TP, MS-SSTP, L2TPv3 and EtherIP
|
including SSL-VPN, OpenVPN, IPsec, L2TP, MS-SSTP, L2TPv3 and EtherIP
|
||||||
by the single SoftEther VPN Server program.
|
by the single SoftEther VPN Server program.
|
||||||
|
|
||||||
More details on https://www.softether.org/.
|
More details on https://www.softether.org/.
|
||||||
|
|
||||||
|
|
||||||
# BOARD MEMBERS OF THIS REPOSITORY
|
# BOARD MEMBERS OF THIS REPOSITORY
|
||||||
|
|
||||||
|
|
||||||
Daiyuu Nobori (Since Jan 2, 2014)
|
Daiyuu Nobori (Since Jan 2, 2014)
|
||||||
https://github.com/dnobori
|
https://github.com/dnobori
|
||||||
|
|
||||||
Moataz Elmasry (Since Nov 6, 2017)
|
Moataz Elmasry (Since Nov 6, 2017)
|
||||||
https://github.com/moatazelmasry2
|
https://github.com/moatazelmasry2
|
||||||
|
|
||||||
Zulyandri Zardi (Since Nov 6, 2017)
|
Zulyandri Zardi (Since Nov 6, 2017)
|
||||||
https://github.com/zulzardi
|
https://github.com/zulzardi
|
||||||
|
|
||||||
Alex Maslakov (Since Nov 6, 2017)
|
Alex Maslakov (Since Nov 6, 2017)
|
||||||
https://github.com/GildedHonour
|
https://github.com/GildedHonour
|
||||||
|
|
||||||
Davide Beatrici (Since Jul 21, 2018)
|
Davide Beatrici (Since Jul 21, 2018)
|
||||||
https://github.com/davidebeatrici
|
https://github.com/davidebeatrici
|
||||||
|
|
||||||
Ilya Shipitsin (Since Jul 21, 2018)
|
Ilya Shipitsin (Since Jul 21, 2018)
|
||||||
https://github.com/chipitsine
|
https://github.com/chipitsine
|
||||||
|
|
||||||
|
|
||||||
# SOFTETHER VPN ADVANTAGES
|
# SOFTETHER VPN ADVANTAGES
|
||||||
|
|
||||||
|
|
||||||
- Supporting all popular VPN protocols by the single VPN server:
|
- Supporting all popular VPN protocols by the single VPN server:
|
||||||
SSL-VPN (HTTPS)
|
SSL-VPN (HTTPS)
|
||||||
OpenVPN
|
OpenVPN
|
||||||
IPsec
|
IPsec
|
||||||
L2TP
|
L2TP
|
||||||
MS-SSTP
|
MS-SSTP
|
||||||
L2TPv3
|
L2TPv3
|
||||||
EtherIP
|
EtherIP
|
||||||
- Free and open-source software.
|
- Free and open-source software.
|
||||||
- Easy to establish both remote-access and site-to-site VPN.
|
- Easy to establish both remote-access and site-to-site VPN.
|
||||||
- SSL-VPN Tunneling on HTTPS to pass through NATs and firewalls.
|
- SSL-VPN Tunneling on HTTPS to pass through NATs and firewalls.
|
||||||
- Revolutionary VPN over ICMP and VPN over DNS features.
|
- Revolutionary VPN over ICMP and VPN over DNS features.
|
||||||
- Resistance to highly-restricted firewall.
|
- Resistance to highly-restricted firewall.
|
||||||
- Ethernet-bridging (L2) and IP-routing (L3) over VPN.
|
- Ethernet-bridging (L2) and IP-routing (L3) over VPN.
|
||||||
- Embedded dynamic-DNS and NAT-traversal so that no static nor
|
- Embedded dynamic-DNS and NAT-traversal so that no static nor
|
||||||
fixed IP address is required.
|
fixed IP address is required.
|
||||||
- AES 256-bit and RSA 4096-bit encryptions.
|
- AES 256-bit and RSA 4096-bit encryptions.
|
||||||
- Sufficient security features such as logging and firewall inner
|
- Sufficient security features such as logging and firewall inner
|
||||||
VPN tunnel.
|
VPN tunnel.
|
||||||
- User authentication with RADIUS and NT domain controllers.
|
- User authentication with RADIUS and NT domain controllers.
|
||||||
- User authentication with X.509 client certificate.
|
- User authentication with X.509 client certificate.
|
||||||
- Packet logging.
|
- Packet logging.
|
||||||
- 1Gbps-class high-speed throughput performance with low memory and
|
- 1Gbps-class high-speed throughput performance with low memory and
|
||||||
CPU usage.
|
CPU usage.
|
||||||
- Windows, Linux, Mac, Android, iPhone, iPad and Windows Phone are
|
- Windows, Linux, Mac, Android, iPhone, iPad and Windows Phone are
|
||||||
supported.
|
supported.
|
||||||
- The OpenVPN clone function supports legacy OpenVPN clients.
|
- The OpenVPN clone function supports legacy OpenVPN clients.
|
||||||
- IPv4 / IPv6 dual-stack.
|
- IPv4 / IPv6 dual-stack.
|
||||||
- The VPN server runs on Windows, Linux, FreeBSD, Solaris and Mac OS X.
|
- The VPN server runs on Windows, Linux, FreeBSD, Solaris and Mac OS X.
|
||||||
- Configure All settings on GUI.
|
- Configure All settings on GUI.
|
||||||
- Multi-languages (English, Japanese and Simplified-Chinese).
|
- Multi-languages (English, Japanese and Simplified-Chinese).
|
||||||
- No memory leaks. High quality stable codes, intended for long-term runs.
|
- No memory leaks. High quality stable codes, intended for long-term runs.
|
||||||
We always verify that there are no memory or resource leaks before
|
We always verify that there are no memory or resource leaks before
|
||||||
releasing the build.
|
releasing the build.
|
||||||
- More details at https://www.softether.org/.
|
- More details at https://www.softether.org/.
|
||||||
|
|
||||||
|
|
||||||
# Installation
|
# Installation
|
||||||
|
|
||||||
## For Ubuntu
|
## For Ubuntu
|
||||||
|
|
||||||
Launchpad PPA maintained by [Dmitry Verkhoturov](https://github.com/paskal):
|
Launchpad PPA maintained by [Dmitry Verkhoturov](https://github.com/paskal):
|
||||||
|
|
||||||
[Daily builds](https://code.launchpad.net/~paskal-07/+archive/ubuntu/softethervpn) (latest released tag)
|
[Daily builds](https://code.launchpad.net/~paskal-07/+archive/ubuntu/softethervpn) (latest released tag)
|
||||||
|
|
||||||
[Nightly builds](https://code.launchpad.net/~paskal-07/+archive/ubuntu/softethervpn-nightly)
|
[Nightly builds](https://code.launchpad.net/~paskal-07/+archive/ubuntu/softethervpn-nightly)
|
||||||
|
|
||||||
## For FreeBSD
|
## For FreeBSD
|
||||||
|
|
||||||
SoftEther VPN in FreeBSD Ports Collection is maintained by
|
SoftEther VPN in FreeBSD Ports Collection is maintained by
|
||||||
[Koichiro Iwao](https://people.FreeBSD.org/~meta/) ([@metalefty](https://github.com/metalefty)).
|
[Koichiro Iwao](https://people.FreeBSD.org/~meta/) ([@metalefty](https://github.com/metalefty)).
|
||||||
|
|
||||||
Binary package can be installed by pkg:
|
Binary package can be installed by pkg:
|
||||||
```
|
```
|
||||||
pkg install softether5
|
pkg install softether5
|
||||||
```
|
```
|
||||||
|
|
||||||
Alternatively, it can be built & installed by ports:
|
Alternatively, it can be built & installed by ports:
|
||||||
```
|
```
|
||||||
make install -C /usr/ports/security/softether5
|
make install -C /usr/ports/security/softether5
|
||||||
```
|
```
|
||||||
|
|
||||||
To run SoftEther VPN Server:
|
To run SoftEther VPN Server:
|
||||||
```
|
```
|
||||||
service softether_server start
|
service softether_server start
|
||||||
```
|
```
|
||||||
|
|
||||||
To configure SoftEther VPN Server startup on boot:
|
To configure SoftEther VPN Server startup on boot:
|
||||||
```
|
```
|
||||||
sysrc softether_server_enable=yes
|
sysrc softether_server_enable=yes
|
||||||
```
|
```
|
||||||
|
|
||||||
Also SoftEther VPN [Stable Edition](https://www.freshports.org/security/softether-devel/) and
|
Also SoftEther VPN [Stable Edition](https://www.freshports.org/security/softether-devel/) and
|
||||||
[RTM version](https://www.freshports.org/security/softether/) are available on FreeBSD.
|
[RTM version](https://www.freshports.org/security/softether/) are available on FreeBSD.
|
||||||
|
|
||||||
## From binary installers:
|
## From binary installers:
|
||||||
|
|
||||||
Those can be found under https://www.softether-download.com/
|
Those can be found under https://www.softether-download.com/
|
||||||
There you can also find SoftEtherVPN source code in zip and tar formats.
|
There you can also find SoftEtherVPN source code in zip and tar formats.
|
||||||
|
|
||||||
## Build from Source code
|
## Build from Source code
|
||||||
|
|
||||||
see [BUILD_UNIX](src/BUILD_UNIX.md) or [BUILD_WINDOWS](src/BUILD_WINDOWS.md)
|
see [BUILD_UNIX](src/BUILD_UNIX.md) or [BUILD_WINDOWS](src/BUILD_WINDOWS.md)
|
||||||
|
|
||||||
There are two flavours of SoftEtherVPN source code:
|
There are two flavours of SoftEtherVPN source code:
|
||||||
|
|
||||||
1. Unstable. Found under https://github.com/SoftEtherVPN/SoftEtherVPN
|
1. Unstable. Found under https://github.com/SoftEtherVPN/SoftEtherVPN
|
||||||
2. Stable. Found under https://github.com/SoftEtherVPN/SoftEtherVPN_Stable
|
2. Stable. Found under https://github.com/SoftEtherVPN/SoftEtherVPN_Stable
|
||||||
|
|
||||||
|
|
||||||
# About HTML5-based Modern Admin Console and JSON-RPC API Suite
|
# About HTML5-based Modern Admin Console and JSON-RPC API Suite
|
||||||
|
|
||||||
## Built-in SoftEther VPN Server HTML5 Ajax-based Web Administration Console
|
## Built-in SoftEther VPN Server HTML5 Ajax-based Web Administration Console
|
||||||
We are developing the HTML5 Ajax-based Web Administration Console (currently very limited, under construction) in the embedded HTTPS server on the SoftEther VPN Server.
|
We are developing the HTML5 Ajax-based Web Administration Console (currently very limited, under construction) in the embedded HTTPS server on the SoftEther VPN Server.
|
||||||
|
|
||||||
Access to the following URL from your favorite web browser.
|
Access to the following URL from your favorite web browser.
|
||||||
|
|
||||||
```
|
```
|
||||||
https://<vpn_server_hostname>:<port>/admin/
|
https://<vpn_server_hostname>:<port>/admin/
|
||||||
```
|
```
|
||||||
|
|
||||||
For example if your VPN Server is running as the port 5555 on the host at 192.168.0.1, you can access to the web console by:
|
For example if your VPN Server is running as the port 5555 on the host at 192.168.0.1, you can access to the web console by:
|
||||||
|
|
||||||
```
|
```
|
||||||
https://192.168.0.1:5555/admin/
|
https://192.168.0.1:5555/admin/
|
||||||
```
|
```
|
||||||
|
|
||||||
Note: Your HTML5 development contribution is very appreciated. The current HTML5 pages are written by Daiyuu Nobori (the core developer of SoftEther VPN). He is obviously lack of HTML5 development ability. Please kindly consider to contribute for SoftEther VPN's development on GitHub. Your code will help every people running SoftEther VPN Server.
|
Note: Your HTML5 development contribution is very appreciated. The current HTML5 pages are written by Daiyuu Nobori (the core developer of SoftEther VPN). He is obviously lack of HTML5 development ability. Please kindly consider to contribute for SoftEther VPN's development on GitHub. Your code will help every people running SoftEther VPN Server.
|
||||||
|
|
||||||
|
|
||||||
## Built-in SoftEther Server VPN JSON-RPC API Suite
|
## Built-in SoftEther Server VPN JSON-RPC API Suite
|
||||||
The API Suite allows you to easily develop your original SoftEther VPN Server management application to control the VPN Server (e.g. creating users, adding Virtual Hubs, disconnecting a specified VPN sessions).
|
The API Suite allows you to easily develop your original SoftEther VPN Server management application to control the VPN Server (e.g. creating users, adding Virtual Hubs, disconnecting a specified VPN sessions).
|
||||||
|
|
||||||
You can access to the [latest SoftEther VPN Server JSON-RPC Document on GitHub.](https://github.com/SoftEtherVPN/SoftEtherVPN/tree/master/developer_tools/vpnserver-jsonrpc-clients/)
|
You can access to the [latest SoftEther VPN Server JSON-RPC Document on GitHub.](https://github.com/SoftEtherVPN/SoftEtherVPN/tree/master/developer_tools/vpnserver-jsonrpc-clients/)
|
||||||
|
|
||||||
- Almost all control APIs, which the VPN Server provides, are available as JSON-RPC API.
|
- Almost all control APIs, which the VPN Server provides, are available as JSON-RPC API.
|
||||||
You can write your own VPN Server management application in your favorite languages (JavaScript, TypeScript, Java, Python, Ruby, C#, ... etc.)
|
You can write your own VPN Server management application in your favorite languages (JavaScript, TypeScript, Java, Python, Ruby, C#, ... etc.)
|
||||||
- If you are planning to develop your own VPN cloud service, the JSON-RPC API is the best choice to realize the automated operations for the VPN Server.
|
- If you are planning to develop your own VPN cloud service, the JSON-RPC API is the best choice to realize the automated operations for the VPN Server.
|
||||||
- No need to use any specific API client library since all APIs are provided on the JSON-RPC 2.0 Specification. You can use your favorite JSON and HTTPS client library to call any of all APIs in your pure runtime environment.
|
- No need to use any specific API client library since all APIs are provided on the JSON-RPC 2.0 Specification. You can use your favorite JSON and HTTPS client library to call any of all APIs in your pure runtime environment.
|
||||||
- Also, the SoftEther VPN Project provides high-quality JSON-RPC client stub libraries which define all of the API client stub codes. These libraries are written in C#, JavaScript and TypeScript. The Node.js Client Library for VPN Server RPC (vpnrpc) package is also available.
|
- Also, the SoftEther VPN Project provides high-quality JSON-RPC client stub libraries which define all of the API client stub codes. These libraries are written in C#, JavaScript and TypeScript. The Node.js Client Library for VPN Server RPC (vpnrpc) package is also available.
|
||||||
|
|
||||||
|
|
||||||
# TO CIRCUMVENT YOUR GOVERNMENT'S FIREWALL RESTRICTION
|
# TO CIRCUMVENT YOUR GOVERNMENT'S FIREWALL RESTRICTION
|
||||||
|
|
||||||
Because SoftEther VPN is overly strong tool to build a VPN tunnel,
|
Because SoftEther VPN is overly strong tool to build a VPN tunnel,
|
||||||
some censorship governments want to block your access to the source code
|
some censorship governments want to block your access to the source code
|
||||||
of SoftEther VPN, by abusing their censorship firewalls.
|
of SoftEther VPN, by abusing their censorship firewalls.
|
||||||
|
|
||||||
To circumvent your censor's unjust restriction,
|
To circumvent your censor's unjust restriction,
|
||||||
SoftEther VPN Project distributes the up-to-date source-code
|
SoftEther VPN Project distributes the up-to-date source-code
|
||||||
on all the following open-source repositories:
|
on all the following open-source repositories:
|
||||||
|
|
||||||
- GitHub
|
- GitHub
|
||||||
https://github.com/SoftEtherVPN/SoftEtherVPN/
|
https://github.com/SoftEtherVPN/SoftEtherVPN/
|
||||||
|
|
||||||
```
|
```
|
||||||
$ git clone https://github.com/SoftEtherVPN/SoftEtherVPN.git
|
$ git clone https://github.com/SoftEtherVPN/SoftEtherVPN.git
|
||||||
```
|
```
|
||||||
|
|
||||||
- GitLab (mirrored from GitHub)
|
- GitLab (mirrored from GitHub)
|
||||||
https://gitlab.com/SoftEther/SoftEtherVPN/
|
https://gitlab.com/SoftEther/SoftEtherVPN/
|
||||||
|
|
||||||
```
|
```
|
||||||
$ git clone https://gitlab.com/SoftEther/SoftEtherVPN.git
|
$ git clone https://gitlab.com/SoftEther/SoftEtherVPN.git
|
||||||
```
|
```
|
||||||
|
|
||||||
We hope that you can reach one of the above URLs at least!
|
We hope that you can reach one of the above URLs at least!
|
||||||
|
|
||||||
|
|
||||||
# SOURCE CODE CONTRIBUTION
|
# SOURCE CODE CONTRIBUTION
|
||||||
|
|
||||||
Your contribution to SoftEther VPN Project is much appreciated.
|
Your contribution to SoftEther VPN Project is much appreciated.
|
||||||
Please send patches to us through GitHub.
|
Please send patches to us through GitHub.
|
||||||
|
|
||||||
|
|
||||||
# DEAR SECURITY EXPERTS
|
# DEAR SECURITY EXPERTS
|
||||||
|
|
||||||
If you find a bug or a security vulnerability please kindly inform us
|
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
|
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.
|
to protect a lot of users around the world as soon as possible.
|
||||||
|
|
||||||
Our e-mail address for security reports is:
|
Our e-mail address for security reports is:
|
||||||
**softether-vpn-security at softether.org**
|
**softether-vpn-security at softether.org**
|
||||||
|
|
||||||
Please note that the above e-mail address is not a technical support
|
Please note that the above e-mail address is not a technical support
|
||||||
inquiry address. If you need technical assistance, please visit
|
inquiry address. If you need technical assistance, please visit
|
||||||
https://www.softether.org/ and ask your question on the users forum.
|
https://www.softether.org/ and ask your question on the users forum.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
||||||
public class Program
|
public class Program
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Security.Cryptography;
|
using System.Security.Cryptography;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
# Visual Studio 15
|
# Visual Studio 15
|
||||||
VisualStudioVersion = 15.0.28010.2026
|
VisualStudioVersion = 15.0.28010.2026
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# SoftEther VPN Server JSON-RPC API Suite Document
|
# SoftEther VPN Server JSON-RPC API Suite Document
|
||||||
This reference describes all JSON-RPC functions available on SoftEther VPN Server.
|
This reference describes all JSON-RPC functions available on SoftEther VPN Server.
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// SoftEther VPN Server JSON-RPC Stub code for C#
|
// SoftEther VPN Server JSON-RPC Stub code for C#
|
||||||
//
|
//
|
||||||
// JsonRpc.cs - JSON-RPC Client Utility Functions
|
// JsonRpc.cs - JSON-RPC Client Utility Functions
|
||||||
//
|
//
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// SoftEther VPN Server JSON-RPC Stub code for C#
|
// SoftEther VPN Server JSON-RPC Stub code for C#
|
||||||
//
|
//
|
||||||
// VPNServerRpc.cs - SoftEther VPN Server's JSON-RPC Stubs
|
// VPNServerRpc.cs - SoftEther VPN Server's JSON-RPC Stubs
|
||||||
//
|
//
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// SoftEther VPN Server JSON-RPC Stub code for C#
|
// SoftEther VPN Server JSON-RPC Stub code for C#
|
||||||
//
|
//
|
||||||
// VPNServerRpcTypes.cs - Data Type Definition for SoftEther VPN Server JSON-RPC Stubs
|
// VPNServerRpcTypes.cs - Data Type Definition for SoftEther VPN Server JSON-RPC Stubs
|
||||||
//
|
//
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// SoftEther VPN Server JSON-RPC Stub code for C#
|
// SoftEther VPN Server JSON-RPC Stub code for C#
|
||||||
//
|
//
|
||||||
// Program.cs - The Main() entry point
|
// Program.cs - The Main() entry point
|
||||||
//
|
//
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// SoftEther VPN Server JSON-RPC Stub code for C#
|
// SoftEther VPN Server JSON-RPC Stub code for C#
|
||||||
//
|
//
|
||||||
// VpnServerRpcTest.cs - Test sample code for SoftEther VPN Server JSON-RPC Stub
|
// VpnServerRpcTest.cs - Test sample code for SoftEther VPN Server JSON-RPC Stub
|
||||||
//
|
//
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
# Visual Studio 15
|
# Visual Studio 15
|
||||||
VisualStudioVersion = 15.0.28010.2041
|
VisualStudioVersion = 15.0.28010.2041
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Test sample code for SoftEther VPN Server JSON-RPC Stub
|
// Test sample code for SoftEther VPN Server JSON-RPC Stub
|
||||||
// Runs on both web browsers and Node.js
|
// Runs on both web browsers and Node.js
|
||||||
//
|
//
|
||||||
// sample.ts
|
// sample.ts
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// SoftEther VPN Server JSON-RPC Stub code for TypeScript
|
// SoftEther VPN Server JSON-RPC Stub code for TypeScript
|
||||||
//
|
//
|
||||||
// vpnrpc.ts
|
// vpnrpc.ts
|
||||||
// Automatically generated at 2019-07-10 14:36:11 by vpnserver-jsonrpc-codegen
|
// Automatically generated at 2019-07-10 14:36:11 by vpnserver-jsonrpc-codegen
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Test sample code for SoftEther VPN Server JSON-RPC Stub
|
// Test sample code for SoftEther VPN Server JSON-RPC Stub
|
||||||
// Runs on both web browsers and Node.js
|
// Runs on both web browsers and Node.js
|
||||||
//
|
//
|
||||||
// sample.ts
|
// sample.ts
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// SoftEther VPN Server JSON-RPC Stub code for TypeScript
|
// SoftEther VPN Server JSON-RPC Stub code for TypeScript
|
||||||
//
|
//
|
||||||
// vpnrpc.ts
|
// vpnrpc.ts
|
||||||
// Automatically generated at 2019-07-10 14:36:11 by vpnserver-jsonrpc-codegen
|
// Automatically generated at 2019-07-10 14:36:11 by vpnserver-jsonrpc-codegen
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
using Microsoft.CodeAnalysis;
|
using Microsoft.CodeAnalysis;
|
||||||
using Microsoft.CodeAnalysis.CSharp;
|
using Microsoft.CodeAnalysis.CSharp;
|
||||||
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||||
using System;
|
using System;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// SoftEther VPN Server JSON-RPC Stub code for C#
|
// SoftEther VPN Server JSON-RPC Stub code for C#
|
||||||
//
|
//
|
||||||
// Program.cs - The Main() entry point
|
// Program.cs - The Main() entry point
|
||||||
//
|
//
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# SoftEther VPN Server JSON-RPC API Suite Document
|
# SoftEther VPN Server JSON-RPC API Suite Document
|
||||||
This reference describes all JSON-RPC functions available on SoftEther VPN Server.
|
This reference describes all JSON-RPC functions available on SoftEther VPN Server.
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// SoftEther VPN Server JSON-RPC Stub code for TypeScript
|
// SoftEther VPN Server JSON-RPC Stub code for TypeScript
|
||||||
//
|
//
|
||||||
// vpnrpc.ts
|
// vpnrpc.ts
|
||||||
// Automatically generated at __TIMESTAMP__ by vpnserver-jsonrpc-codegen
|
// Automatically generated at __TIMESTAMP__ by vpnserver-jsonrpc-codegen
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Test sample code for SoftEther VPN Server JSON-RPC Stub
|
// Test sample code for SoftEther VPN Server JSON-RPC Stub
|
||||||
// Runs on both web browsers and Node.js
|
// Runs on both web browsers and Node.js
|
||||||
//
|
//
|
||||||
// sample.ts
|
// sample.ts
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// SoftEther VPN Server JSON-RPC Stub code for C#
|
// SoftEther VPN Server JSON-RPC Stub code for C#
|
||||||
//
|
//
|
||||||
// JsonRpc.cs - JSON-RPC Client Utility Functions
|
// JsonRpc.cs - JSON-RPC Client Utility Functions
|
||||||
//
|
//
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// SoftEther VPN Server JSON-RPC Stub code for C#
|
// SoftEther VPN Server JSON-RPC Stub code for C#
|
||||||
//
|
//
|
||||||
// VPNServerRpc.cs - SoftEther VPN Server's JSON-RPC Stubs
|
// VPNServerRpc.cs - SoftEther VPN Server's JSON-RPC Stubs
|
||||||
//
|
//
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// SoftEther VPN Server JSON-RPC Stub code for C#
|
// SoftEther VPN Server JSON-RPC Stub code for C#
|
||||||
//
|
//
|
||||||
// VPNServerRpcTypes.cs - Data Type Definition for SoftEther VPN Server JSON-RPC Stubs
|
// VPNServerRpcTypes.cs - Data Type Definition for SoftEther VPN Server JSON-RPC Stubs
|
||||||
//
|
//
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// SoftEther VPN Server JSON-RPC Stub code for C#
|
// SoftEther VPN Server JSON-RPC Stub code for C#
|
||||||
//
|
//
|
||||||
// VpnServerRpcTest.cs - Test sample code for SoftEther VPN Server JSON-RPC Stub
|
// VpnServerRpcTest.cs - Test sample code for SoftEther VPN Server JSON-RPC Stub
|
||||||
//
|
//
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
# Visual Studio 15
|
# Visual Studio 15
|
||||||
VisualStudioVersion = 15.0.28010.2041
|
VisualStudioVersion = 15.0.28010.2041
|
||||||
|
@ -1,236 +1,236 @@
|
|||||||
This document describes how to build SoftEtherVPN for UNIX based Operating systems
|
This document describes how to build SoftEtherVPN for UNIX based Operating systems
|
||||||
|
|
||||||
- [Requirements](#requirements)
|
- [Requirements](#requirements)
|
||||||
* [Install requirements on Centos/RedHat](#install-requirements-on-centosredhat)
|
* [Install requirements on Centos/RedHat](#install-requirements-on-centosredhat)
|
||||||
* [Install Requirements on Debian/Ubuntu](#install-requirements-on-debianubuntu)
|
* [Install Requirements on Debian/Ubuntu](#install-requirements-on-debianubuntu)
|
||||||
* [Install Requirements on macOS](#install-requirements-on-macos)
|
* [Install Requirements on macOS](#install-requirements-on-macos)
|
||||||
- [Build from source code and install](#build-from-source-code-and-install)
|
- [Build from source code and install](#build-from-source-code-and-install)
|
||||||
- [Additional Build Options](#additional-build-options)
|
- [Additional Build Options](#additional-build-options)
|
||||||
- [How to Run SoftEther](#how-to-run-softether)
|
- [How to Run SoftEther](#how-to-run-softether)
|
||||||
* [Start/Stop SoftEther VPN Server](#startstop-softether-vpn-server)
|
* [Start/Stop SoftEther VPN Server](#startstop-softether-vpn-server)
|
||||||
* [Start/Stop SoftEther VPN Bridge](#startstop-softether-vpn-bridge)
|
* [Start/Stop SoftEther VPN Bridge](#startstop-softether-vpn-bridge)
|
||||||
* [Start/Stop SoftEther VPN Client](#startstop-softether-vpn-client)
|
* [Start/Stop SoftEther VPN Client](#startstop-softether-vpn-client)
|
||||||
- [About HTML5-based Modern Admin Console and JSON-RPC API Suite](#about-html5-based-modern-admin-console-and-json-rpc-api-suite)
|
- [About HTML5-based Modern Admin Console and JSON-RPC API Suite](#about-html5-based-modern-admin-console-and-json-rpc-api-suite)
|
||||||
* [Built-in SoftEther VPN Server HTML5 Ajax-based Web Administration Console](#built-in-softether-vpn-server-html5-ajax-based-web-administration-console)
|
* [Built-in SoftEther VPN Server HTML5 Ajax-based Web Administration Console](#built-in-softether-vpn-server-html5-ajax-based-web-administration-console)
|
||||||
* [Built-in SoftEther Server VPN JSON-RPC API Suite](#built-in-softether-server-vpn-json-rpc-api-suite)
|
* [Built-in SoftEther Server VPN JSON-RPC API Suite](#built-in-softether-server-vpn-json-rpc-api-suite)
|
||||||
- [Using SoftEther without installation.](#using-softether-without-installation)
|
- [Using SoftEther without installation.](#using-softether-without-installation)
|
||||||
|
|
||||||
# Requirements
|
# Requirements
|
||||||
|
|
||||||
You need to install the following software to build SoftEther VPN for UNIX.
|
You need to install the following software to build SoftEther VPN for UNIX.
|
||||||
|
|
||||||
- [CMake](https://cmake.org)
|
- [CMake](https://cmake.org)
|
||||||
- C compiler (GCC, Clang, etc)
|
- C compiler (GCC, Clang, etc)
|
||||||
- C Library (BSD libc, GNU libc, musl libc, etc)
|
- C Library (BSD libc, GNU libc, musl libc, etc)
|
||||||
- POSIX threads library (pthread)
|
- POSIX threads library (pthread)
|
||||||
- OpenSSL or LibreSSL (crypto, ssl)
|
- OpenSSL or LibreSSL (crypto, ssl)
|
||||||
- make (GNU make, BSD make, etc)
|
- make (GNU make, BSD make, etc)
|
||||||
- libiconv
|
- libiconv
|
||||||
- readline
|
- readline
|
||||||
- ncurses
|
- ncurses
|
||||||
|
|
||||||
## Install requirements on Centos/RedHat
|
## Install requirements on Centos/RedHat
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo yum -y groupinstall "Development Tools"
|
sudo yum -y groupinstall "Development Tools"
|
||||||
sudo yum -y install cmake ncurses-devel openssl-devel readline-devel zlib-devel
|
sudo yum -y install cmake ncurses-devel openssl-devel readline-devel zlib-devel
|
||||||
```
|
```
|
||||||
|
|
||||||
## Install requirements on Debian/Ubuntu
|
## Install requirements on Debian/Ubuntu
|
||||||
```bash
|
```bash
|
||||||
sudo apt -y install cmake gcc g++ libncurses5-dev libreadline-dev libssl-dev make zlib1g-dev
|
sudo apt -y install cmake gcc g++ libncurses5-dev libreadline-dev libssl-dev make zlib1g-dev
|
||||||
```
|
```
|
||||||
|
|
||||||
## Install requirements on macOS
|
## Install requirements on macOS
|
||||||
```bash
|
```bash
|
||||||
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
|
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
|
||||||
brew install cmake openssl readline
|
brew install cmake openssl readline
|
||||||
```
|
```
|
||||||
|
|
||||||
# Build from source code and install
|
# Build from source code and install
|
||||||
|
|
||||||
To build the programs from the source code, run the following commands:
|
To build the programs from the source code, run the following commands:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone https://github.com/SoftEtherVPN/SoftEtherVPN.git
|
git clone https://github.com/SoftEtherVPN/SoftEtherVPN.git
|
||||||
cd SoftEtherVPN
|
cd SoftEtherVPN
|
||||||
git submodule init && git submodule update
|
git submodule init && git submodule update
|
||||||
./configure
|
./configure
|
||||||
make -C build
|
make -C build
|
||||||
make -C build install
|
make -C build install
|
||||||
```
|
```
|
||||||
|
|
||||||
This will compile and install SoftEther VPN Server, Bridge and Client binaries under your executable path.
|
This will compile and install SoftEther VPN Server, Bridge and Client binaries under your executable path.
|
||||||
|
|
||||||
If any error occurs, please check the above requirements.
|
If any error occurs, please check the above requirements.
|
||||||
|
|
||||||
# Build on musl-based linux
|
# Build on musl-based linux
|
||||||
|
|
||||||
To build the programs from the source code when using musl as libc, run the following commands:
|
To build the programs from the source code when using musl as libc, run the following commands:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
export USE_MUSL=YES
|
export USE_MUSL=YES
|
||||||
git clone https://github.com/SoftEtherVPN/SoftEtherVPN.git
|
git clone https://github.com/SoftEtherVPN/SoftEtherVPN.git
|
||||||
cd SoftEtherVPN
|
cd SoftEtherVPN
|
||||||
git submodule init && git submodule update
|
git submodule init && git submodule update
|
||||||
./configure
|
./configure
|
||||||
make -C build
|
make -C build
|
||||||
make -C build install
|
make -C build install
|
||||||
```
|
```
|
||||||
|
|
||||||
Building without USE_MUSL environment variable set compiles, but produced executables exhibit bad run-time behaviour.
|
Building without USE_MUSL environment variable set compiles, but produced executables exhibit bad run-time behaviour.
|
||||||
|
|
||||||
# Additional Build Options
|
# Additional Build Options
|
||||||
|
|
||||||
There are some additional build options useful if you're a distro package maintainer and creating a package of SoftEther VPN. It is recommended that you only specify these options when you understand what happens.
|
There are some additional build options useful if you're a distro package maintainer and creating a package of SoftEther VPN. It is recommended that you only specify these options when you understand what happens.
|
||||||
|
|
||||||
## Specify log, config, PID directories
|
## Specify log, config, PID directories
|
||||||
|
|
||||||
By default, SoftEther VPN writes out all files such as logs, config files, PID files under the same directory as `vpnserver`, `vpnbridge`, `vpnclient` executables. This behaviour is suitable when [using SoftEther without installation](#using-softether-without-installation) however not appropriate using with installation.
|
By default, SoftEther VPN writes out all files such as logs, config files, PID files under the same directory as `vpnserver`, `vpnbridge`, `vpnclient` executables. This behaviour is suitable when [using SoftEther without installation](#using-softether-without-installation) however not appropriate using with installation.
|
||||||
Usually PID files are to put in `/var/run` or `/run`. Logs are `/var/log`. Other variable state information files including config files are `/var/lib` or `/var/db`.
|
Usually PID files are to put in `/var/run` or `/run`. Logs are `/var/log`. Other variable state information files including config files are `/var/lib` or `/var/db`.
|
||||||
|
|
||||||
These directories can be changed at compile-time by specifying via CMake variables.
|
These directories can be changed at compile-time by specifying via CMake variables.
|
||||||
* `SE_PIDDIR` - PID directory
|
* `SE_PIDDIR` - PID directory
|
||||||
* `SE_LOGDIR` - root log directory
|
* `SE_LOGDIR` - root log directory
|
||||||
* `SE_DBDIR` - config files and variable state directory
|
* `SE_DBDIR` - config files and variable state directory
|
||||||
|
|
||||||
To specify directories, perform `./configure` like below.
|
To specify directories, perform `./configure` like below.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
CMAKE_FLAGS="-DSE_PIDDIR=/run/softether -DSE_LOGDIR=/var/log/softether -DSE_DBDIR=/var/lib/softether" ./configure
|
CMAKE_FLAGS="-DSE_PIDDIR=/run/softether -DSE_LOGDIR=/var/log/softether -DSE_DBDIR=/var/lib/softether" ./configure
|
||||||
```
|
```
|
||||||
|
|
||||||
Please note that these directories are not created automatically after installation. Make sure to create these directories before starting SoftEther VPN Server, Bridge or Client.
|
Please note that these directories are not created automatically after installation. Make sure to create these directories before starting SoftEther VPN Server, Bridge or Client.
|
||||||
|
|
||||||
## Build without [cpu_features](https://github.com/google/cpu_features)
|
## Build without [cpu_features](https://github.com/google/cpu_features)
|
||||||
|
|
||||||
SoftEther VPN uses cpu_features library to retrieve CPU features such as available processor instructions. However, cpu_features is not available on some architectures. Whether to build with cpu_features is auto detected but autodetection is not so smart.
|
SoftEther VPN uses cpu_features library to retrieve CPU features such as available processor instructions. However, cpu_features is not available on some architectures. Whether to build with cpu_features is auto detected but autodetection is not so smart.
|
||||||
|
|
||||||
If you want to build without cpu_features explicitly, perform `./configure` like below.
|
If you want to build without cpu_features explicitly, perform `./configure` like below.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
CMAKE_FLAGS="-DSKIP_CPU_FEATURES" ./configure
|
CMAKE_FLAGS="-DSKIP_CPU_FEATURES" ./configure
|
||||||
```
|
```
|
||||||
|
|
||||||
# How to Run SoftEther
|
# How to Run SoftEther
|
||||||
|
|
||||||
## Start/Stop SoftEther VPN Server
|
## Start/Stop SoftEther VPN Server
|
||||||
|
|
||||||
To start the SoftEther VPN Server background service, run the following:
|
To start the SoftEther VPN Server background service, run the following:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
vpnserver start
|
vpnserver start
|
||||||
```
|
```
|
||||||
|
|
||||||
To stop the service, run the following:
|
To stop the service, run the following:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
vpnserver stop
|
vpnserver stop
|
||||||
```
|
```
|
||||||
|
|
||||||
To configure the running SoftEther VPN Server service,
|
To configure the running SoftEther VPN Server service,
|
||||||
you can use SoftEther VPN Command Line Management Utility as following:
|
you can use SoftEther VPN Command Line Management Utility as following:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
vpncmd
|
vpncmd
|
||||||
```
|
```
|
||||||
|
|
||||||
Or you can also use VPN Server Manager GUI Tool on other Windows PC to
|
Or you can also use VPN Server Manager GUI Tool on other Windows PC to
|
||||||
connect to the VPN Server remotely. You can download the GUI Tool
|
connect to the VPN Server remotely. You can download the GUI Tool
|
||||||
from https://www.softether-download.com/.
|
from https://www.softether-download.com/.
|
||||||
|
|
||||||
|
|
||||||
## Start/Stop SoftEther VPN Bridge
|
## Start/Stop SoftEther VPN Bridge
|
||||||
|
|
||||||
To start the SoftEther VPN Bridge background service, run the following:
|
To start the SoftEther VPN Bridge background service, run the following:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
vpnbridge start
|
vpnbridge start
|
||||||
```
|
```
|
||||||
|
|
||||||
To stop the service, run the following:
|
To stop the service, run the following:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
vpnbridge stop
|
vpnbridge stop
|
||||||
```
|
```
|
||||||
|
|
||||||
To configure the running SoftEther VPN Bridge service,
|
To configure the running SoftEther VPN Bridge service,
|
||||||
you can use SoftEther VPN Command Line Management Utility as following:
|
you can use SoftEther VPN Command Line Management Utility as following:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
vpncmd
|
vpncmd
|
||||||
```
|
```
|
||||||
|
|
||||||
Or you can also use VPN Server Manager GUI Tool on other Windows PC to
|
Or you can also use VPN Server Manager GUI Tool on other Windows PC to
|
||||||
connect to the VPN Bridge remotely. You can download the GUI Tool
|
connect to the VPN Bridge remotely. You can download the GUI Tool
|
||||||
from https://www.softether-download.com/.
|
from https://www.softether-download.com/.
|
||||||
|
|
||||||
|
|
||||||
## Start/Stop SoftEther VPN Client
|
## Start/Stop SoftEther VPN Client
|
||||||
|
|
||||||
To start the SoftEther VPN Client background service, run the following:
|
To start the SoftEther VPN Client background service, run the following:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
vpnclient start
|
vpnclient start
|
||||||
```
|
```
|
||||||
|
|
||||||
To stop the service, run the following:
|
To stop the service, run the following:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
vpnclient stop
|
vpnclient stop
|
||||||
```
|
```
|
||||||
|
|
||||||
To configure the running SoftEther VPN Client service,
|
To configure the running SoftEther VPN Client service,
|
||||||
you can use SoftEther VPN Command Line Management Utility as following:
|
you can use SoftEther VPN Command Line Management Utility as following:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
vpncmd
|
vpncmd
|
||||||
```
|
```
|
||||||
|
|
||||||
Or you can also use VPN Client Manager GUI Tool on other Windows PC to
|
Or you can also use VPN Client Manager GUI Tool on other Windows PC to
|
||||||
connect to the VPN Client remotely. You can download the GUI Tool
|
connect to the VPN Client remotely. You can download the GUI Tool
|
||||||
from https://www.softether-download.com/.
|
from https://www.softether-download.com/.
|
||||||
|
|
||||||
|
|
||||||
# About HTML5-based Modern Admin Console and JSON-RPC API Suite
|
# About HTML5-based Modern Admin Console and JSON-RPC API Suite
|
||||||
|
|
||||||
## Built-in SoftEther VPN Server HTML5 Ajax-based Web Administration Console
|
## Built-in SoftEther VPN Server HTML5 Ajax-based Web Administration Console
|
||||||
We are developing the HTML5 Ajax-based Web Administration Console (currently very limited, under construction) in the embedded HTTPS server on the SoftEther VPN Server.
|
We are developing the HTML5 Ajax-based Web Administration Console (currently very limited, under construction) in the embedded HTTPS server on the SoftEther VPN Server.
|
||||||
|
|
||||||
Access to the following URL from your favorite web browser.
|
Access to the following URL from your favorite web browser.
|
||||||
|
|
||||||
```
|
```
|
||||||
https://<vpn_server_hostname>:<port>/admin/
|
https://<vpn_server_hostname>:<port>/admin/
|
||||||
```
|
```
|
||||||
|
|
||||||
For example if your VPN Server is running as the port 5555 on the host at 192.168.0.1, you can access to the web console by:
|
For example if your VPN Server is running as the port 5555 on the host at 192.168.0.1, you can access to the web console by:
|
||||||
|
|
||||||
```
|
```
|
||||||
https://192.168.0.1:5555/admin/
|
https://192.168.0.1:5555/admin/
|
||||||
```
|
```
|
||||||
|
|
||||||
Note: Your HTML5 development contribution is very appreciated. The current HTML5 pages are written by Daiyuu Nobori (the core developer of SoftEther VPN). He is obviously lack of HTML5 development ability. Please kindly consider to contribute for SoftEther VPN's development on GitHub. Your code will help every people running SoftEther VPN Server.
|
Note: Your HTML5 development contribution is very appreciated. The current HTML5 pages are written by Daiyuu Nobori (the core developer of SoftEther VPN). He is obviously lack of HTML5 development ability. Please kindly consider to contribute for SoftEther VPN's development on GitHub. Your code will help every people running SoftEther VPN Server.
|
||||||
|
|
||||||
|
|
||||||
## Built-in SoftEther Server VPN JSON-RPC API Suite
|
## Built-in SoftEther Server VPN JSON-RPC API Suite
|
||||||
The API Suite allows you to easily develop your original SoftEther VPN Server management application to control the VPN Server (e.g. creating users, adding Virtual Hubs, disconnecting a specified VPN sessions).
|
The API Suite allows you to easily develop your original SoftEther VPN Server management application to control the VPN Server (e.g. creating users, adding Virtual Hubs, disconnecting a specified VPN sessions).
|
||||||
|
|
||||||
You can access to the [latest SoftEther VPN Server JSON-RPC Document on GitHub.](https://github.com/SoftEtherVPN/SoftEtherVPN/tree/master/developer_tools/vpnserver-jsonrpc-clients/)
|
You can access to the [latest SoftEther VPN Server JSON-RPC Document on GitHub.](https://github.com/SoftEtherVPN/SoftEtherVPN/tree/master/developer_tools/vpnserver-jsonrpc-clients/)
|
||||||
|
|
||||||
- Almost all control APIs, which the VPN Server provides, are available as JSON-RPC API.
|
- Almost all control APIs, which the VPN Server provides, are available as JSON-RPC API.
|
||||||
You can write your own VPN Server management application in your favorite languages (JavaScript, TypeScript, Java, Python, Ruby, C#, ... etc.)
|
You can write your own VPN Server management application in your favorite languages (JavaScript, TypeScript, Java, Python, Ruby, C#, ... etc.)
|
||||||
- If you are planning to develop your own VPN cloud service, the JSON-RPC API is the best choice to realize the automated operations for the VPN Server.
|
- If you are planning to develop your own VPN cloud service, the JSON-RPC API is the best choice to realize the automated operations for the VPN Server.
|
||||||
- No need to use any specific API client library since all APIs are provided on the JSON-RPC 2.0 Specification. You can use your favorite JSON and HTTPS client library to call any of all APIs in your pure runtime environment.
|
- No need to use any specific API client library since all APIs are provided on the JSON-RPC 2.0 Specification. You can use your favorite JSON and HTTPS client library to call any of all APIs in your pure runtime environment.
|
||||||
- Also, the SoftEther VPN Project provides high-quality JSON-RPC client stub libraries which define all of the API client stub codes. These libraries are written in C#, JavaScript and TypeScript. The Node.js Client Library for VPN Server RPC (vpnrpc) package is also available.
|
- Also, the SoftEther VPN Project provides high-quality JSON-RPC client stub libraries which define all of the API client stub codes. These libraries are written in C#, JavaScript and TypeScript. The Node.js Client Library for VPN Server RPC (vpnrpc) package is also available.
|
||||||
|
|
||||||
|
|
||||||
# Using SoftEther without installation
|
# Using SoftEther without installation
|
||||||
|
|
||||||
You can use any SoftEtherVPN component (server, client, bridge) without installing it, if you wish so.
|
You can use any SoftEtherVPN component (server, client, bridge) without installing it, if you wish so.
|
||||||
|
|
||||||
In this case please do not run the `make install` command after compiling the source code, and head directly to the **bin/** directory. There you will find the generated binaries for SoftEtherVPN and those could be used without installing SoftEtherVPN.
|
In this case please do not run the `make install` command after compiling the source code, and head directly to the **bin/** directory. There you will find the generated binaries for SoftEtherVPN and those could be used without installing SoftEtherVPN.
|
||||||
|
|
||||||
************************************
|
************************************
|
||||||
Thank You Using SoftEther VPN !
|
Thank You Using SoftEther VPN !
|
||||||
By SoftEther VPN Open-Source Project
|
By SoftEther VPN Open-Source Project
|
||||||
https://www.softether.org/
|
https://www.softether.org/
|
||||||
|
@ -1,29 +1,29 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
|
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
|
||||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
|
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||||
<security>
|
<security>
|
||||||
<requestedPrivileges>
|
<requestedPrivileges>
|
||||||
<requestedExecutionLevel level="requireAdministrator" uiAccess="false"></requestedExecutionLevel>
|
<requestedExecutionLevel level="requireAdministrator" uiAccess="false"></requestedExecutionLevel>
|
||||||
</requestedPrivileges>
|
</requestedPrivileges>
|
||||||
</security>
|
</security>
|
||||||
</trustInfo>
|
</trustInfo>
|
||||||
<dependency>
|
<dependency>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="amd64" publicKeyToken="6595b64144ccf1df" language="*"></assemblyIdentity>
|
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="amd64" publicKeyToken="6595b64144ccf1df" language="*"></assemblyIdentity>
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
</dependency>
|
</dependency>
|
||||||
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
||||||
<application>
|
<application>
|
||||||
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"></supportedOS>
|
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"></supportedOS>
|
||||||
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"></supportedOS>
|
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"></supportedOS>
|
||||||
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"></supportedOS>
|
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"></supportedOS>
|
||||||
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"></supportedOS>
|
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"></supportedOS>
|
||||||
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"></supportedOS>
|
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"></supportedOS>
|
||||||
</application>
|
</application>
|
||||||
</compatibility>
|
</compatibility>
|
||||||
<asmv3:application>
|
<asmv3:application>
|
||||||
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
|
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
|
||||||
<dpiAware>true</dpiAware>
|
<dpiAware>true</dpiAware>
|
||||||
</asmv3:windowsSettings>
|
</asmv3:windowsSettings>
|
||||||
</asmv3:application>
|
</asmv3:application>
|
||||||
</assembly>
|
</assembly>
|
||||||
|
@ -1,29 +1,29 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
|
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
|
||||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
|
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||||
<security>
|
<security>
|
||||||
<requestedPrivileges>
|
<requestedPrivileges>
|
||||||
<requestedExecutionLevel level="asInvoker" uiAccess="false"></requestedExecutionLevel>
|
<requestedExecutionLevel level="asInvoker" uiAccess="false"></requestedExecutionLevel>
|
||||||
</requestedPrivileges>
|
</requestedPrivileges>
|
||||||
</security>
|
</security>
|
||||||
</trustInfo>
|
</trustInfo>
|
||||||
<dependency>
|
<dependency>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="amd64" publicKeyToken="6595b64144ccf1df" language="*"></assemblyIdentity>
|
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="amd64" publicKeyToken="6595b64144ccf1df" language="*"></assemblyIdentity>
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
</dependency>
|
</dependency>
|
||||||
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
||||||
<application>
|
<application>
|
||||||
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"></supportedOS>
|
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"></supportedOS>
|
||||||
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"></supportedOS>
|
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"></supportedOS>
|
||||||
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"></supportedOS>
|
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"></supportedOS>
|
||||||
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"></supportedOS>
|
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"></supportedOS>
|
||||||
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"></supportedOS>
|
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"></supportedOS>
|
||||||
</application>
|
</application>
|
||||||
</compatibility>
|
</compatibility>
|
||||||
<asmv3:application>
|
<asmv3:application>
|
||||||
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
|
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
|
||||||
<dpiAware>true</dpiAware>
|
<dpiAware>true</dpiAware>
|
||||||
</asmv3:windowsSettings>
|
</asmv3:windowsSettings>
|
||||||
</asmv3:application>
|
</asmv3:application>
|
||||||
</assembly>
|
</assembly>
|
||||||
|
@ -1,29 +1,29 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
|
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
|
||||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
|
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||||
<security>
|
<security>
|
||||||
<requestedPrivileges>
|
<requestedPrivileges>
|
||||||
<requestedExecutionLevel level="requireAdministrator" uiAccess="false"></requestedExecutionLevel>
|
<requestedExecutionLevel level="requireAdministrator" uiAccess="false"></requestedExecutionLevel>
|
||||||
</requestedPrivileges>
|
</requestedPrivileges>
|
||||||
</security>
|
</security>
|
||||||
</trustInfo>
|
</trustInfo>
|
||||||
<dependency>
|
<dependency>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="x86" publicKeyToken="6595b64144ccf1df" language="*"></assemblyIdentity>
|
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="x86" publicKeyToken="6595b64144ccf1df" language="*"></assemblyIdentity>
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
</dependency>
|
</dependency>
|
||||||
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
||||||
<application>
|
<application>
|
||||||
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"></supportedOS>
|
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"></supportedOS>
|
||||||
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"></supportedOS>
|
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"></supportedOS>
|
||||||
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"></supportedOS>
|
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"></supportedOS>
|
||||||
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"></supportedOS>
|
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"></supportedOS>
|
||||||
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"></supportedOS>
|
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"></supportedOS>
|
||||||
</application>
|
</application>
|
||||||
</compatibility>
|
</compatibility>
|
||||||
<asmv3:application>
|
<asmv3:application>
|
||||||
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
|
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
|
||||||
<dpiAware>true</dpiAware>
|
<dpiAware>true</dpiAware>
|
||||||
</asmv3:windowsSettings>
|
</asmv3:windowsSettings>
|
||||||
</asmv3:application>
|
</asmv3:application>
|
||||||
</assembly>
|
</assembly>
|
||||||
|
@ -1,29 +1,29 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
|
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
|
||||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
|
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||||
<security>
|
<security>
|
||||||
<requestedPrivileges>
|
<requestedPrivileges>
|
||||||
<requestedExecutionLevel level="asInvoker" uiAccess="false"></requestedExecutionLevel>
|
<requestedExecutionLevel level="asInvoker" uiAccess="false"></requestedExecutionLevel>
|
||||||
</requestedPrivileges>
|
</requestedPrivileges>
|
||||||
</security>
|
</security>
|
||||||
</trustInfo>
|
</trustInfo>
|
||||||
<dependency>
|
<dependency>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="x86" publicKeyToken="6595b64144ccf1df" language="*"></assemblyIdentity>
|
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="x86" publicKeyToken="6595b64144ccf1df" language="*"></assemblyIdentity>
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
</dependency>
|
</dependency>
|
||||||
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
||||||
<application>
|
<application>
|
||||||
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"></supportedOS>
|
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"></supportedOS>
|
||||||
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"></supportedOS>
|
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"></supportedOS>
|
||||||
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"></supportedOS>
|
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"></supportedOS>
|
||||||
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"></supportedOS>
|
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"></supportedOS>
|
||||||
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"></supportedOS>
|
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"></supportedOS>
|
||||||
</application>
|
</application>
|
||||||
</compatibility>
|
</compatibility>
|
||||||
<asmv3:application>
|
<asmv3:application>
|
||||||
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
|
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
|
||||||
<dpiAware>true</dpiAware>
|
<dpiAware>true</dpiAware>
|
||||||
</asmv3:windowsSettings>
|
</asmv3:windowsSettings>
|
||||||
</asmv3:application>
|
</asmv3:application>
|
||||||
</assembly>
|
</assembly>
|
||||||
|
@ -1,18 +1,18 @@
|
|||||||
; VPN Client Web Installer Inf File
|
; VPN Client Web Installer Inf File
|
||||||
;
|
;
|
||||||
; Copyright (c) SoftEther Project at University of Tsukuba, Japan.
|
; Copyright (c) SoftEther Project at University of Tsukuba, Japan.
|
||||||
; All Rights Reserved.
|
; All Rights Reserved.
|
||||||
|
|
||||||
[version]
|
[version]
|
||||||
signature="$CHICAGO$"
|
signature="$CHICAGO$"
|
||||||
AdvancedINF=2.0
|
AdvancedINF=2.0
|
||||||
|
|
||||||
[Add.Code]
|
[Add.Code]
|
||||||
vpnweb.ocx=vpnweb.ocx
|
vpnweb.ocx=vpnweb.ocx
|
||||||
|
|
||||||
[vpnweb.ocx]
|
[vpnweb.ocx]
|
||||||
file-win32-x86=thiscab
|
file-win32-x86=thiscab
|
||||||
clsid={64F1A16B-C3EE-484C-B551-35338A9BB6D2}
|
clsid={64F1A16B-C3EE-484C-B551-35338A9BB6D2}
|
||||||
FileVersion=$CAB_VERSION$
|
FileVersion=$CAB_VERSION$
|
||||||
RegisterServer=yes
|
RegisterServer=yes
|
||||||
|
|
||||||
|
@ -1,74 +1,74 @@
|
|||||||
|
|
||||||
MICROSOFT CABINET SOFTWARE DEVELOPMENT KIT
|
MICROSOFT CABINET SOFTWARE DEVELOPMENT KIT
|
||||||
|
|
||||||
END-USER LICENSE AGREEMENT FOR MICROSOFT SOFTWARE
|
END-USER LICENSE AGREEMENT FOR MICROSOFT SOFTWARE
|
||||||
|
|
||||||
IMPORTANT-READ CAREFULLY: This Microsoft End-User License Agreement ("EULA") is a legal agreement between you (either an individual or a single entity) and Microsoft Corporation for the Microsoft software product identified above, which includes computer software and associated media and printed materials, and may include "online" or electronic documentation ("SOFTWARE PRODUCT" or "SOFTWARE"). By installing, copying, or otherwise using the SOFTWARE PRODUCT, you agree to be bound by the terms of this EULA. If you do not agree to the terms of this EULA; promptly return the unused SOFTWARE PRODUCT to the place from which you obtained it for a full refund; or if you received the SOFTWARE PRODUCT as part of a subscription or other service from Microsoft, you may cancel the subscription and receive a pro rata portion of the subscription price.
|
IMPORTANT-READ CAREFULLY: This Microsoft End-User License Agreement ("EULA") is a legal agreement between you (either an individual or a single entity) and Microsoft Corporation for the Microsoft software product identified above, which includes computer software and associated media and printed materials, and may include "online" or electronic documentation ("SOFTWARE PRODUCT" or "SOFTWARE"). By installing, copying, or otherwise using the SOFTWARE PRODUCT, you agree to be bound by the terms of this EULA. If you do not agree to the terms of this EULA; promptly return the unused SOFTWARE PRODUCT to the place from which you obtained it for a full refund; or if you received the SOFTWARE PRODUCT as part of a subscription or other service from Microsoft, you may cancel the subscription and receive a pro rata portion of the subscription price.
|
||||||
|
|
||||||
SOFTWARE PRODUCT LICENSE
|
SOFTWARE PRODUCT LICENSE
|
||||||
|
|
||||||
The SOFTWARE PRODUCT is protected by copyright laws and international copyright treaties, as well as other intellectual property laws and treaties. The SOFTWARE PRODUCT is licensed, not sold.
|
The SOFTWARE PRODUCT is protected by copyright laws and international copyright treaties, as well as other intellectual property laws and treaties. The SOFTWARE PRODUCT is licensed, not sold.
|
||||||
|
|
||||||
1. GRANT OF LICENSE. This EULA grants you the following limited, non-exclusive rights:
|
1. GRANT OF LICENSE. This EULA grants you the following limited, non-exclusive rights:
|
||||||
|
|
||||||
Software Product. You may install and use the SOFTWARE PRODUCT on a single computer solely for the purpose of developing applications which create, extract or manipulate files that are compatible with Microsoft CAB file format ("Application"). You may not use the SOFTWARE PRODUCT to create files which are not compatible with the Microsoft CAB file format.
|
Software Product. You may install and use the SOFTWARE PRODUCT on a single computer solely for the purpose of developing applications which create, extract or manipulate files that are compatible with Microsoft CAB file format ("Application"). You may not use the SOFTWARE PRODUCT to create files which are not compatible with the Microsoft CAB file format.
|
||||||
|
|
||||||
Microsoft Developer Network Subscriber. If you acquired the SOFTWARE PRODUCT through a subscription to the Microsoft Developer Network, and you are either an individual developer or an individual designated within a single entity, you are granted the following additional rights with respect to the SOFTWARE PRODUCT: (a) you may make and use copies of the SOFTWARE PRODUCT on up to ten (10) separate computers, provided that you are the only individual using the SOFTWARE PRODUCT on each such computer, and (b) if you are a single entity, you may designate one individual within your organization to have the right to use the SOFTWARE PRODUCT in the manner described herein.
|
Microsoft Developer Network Subscriber. If you acquired the SOFTWARE PRODUCT through a subscription to the Microsoft Developer Network, and you are either an individual developer or an individual designated within a single entity, you are granted the following additional rights with respect to the SOFTWARE PRODUCT: (a) you may make and use copies of the SOFTWARE PRODUCT on up to ten (10) separate computers, provided that you are the only individual using the SOFTWARE PRODUCT on each such computer, and (b) if you are a single entity, you may designate one individual within your organization to have the right to use the SOFTWARE PRODUCT in the manner described herein.
|
||||||
|
|
||||||
Sample Code. You may modify the sample source code located in the SOFTWARE PRODUCT's "SAMPLES" directory ("Sample Code") to design, develop, and test your Application. You may also reproduce and distribute the Sample Code in object code form along with any modifications you make to the Sample Code, provided that the modifications do not create files which are not compatible with Microsoft CAB file format and that you comply with the Distribution Requirements described below. For purposes of this section, "modifications" shall mean changes to the functionality of the Sample Code.
|
Sample Code. You may modify the sample source code located in the SOFTWARE PRODUCT's "SAMPLES" directory ("Sample Code") to design, develop, and test your Application. You may also reproduce and distribute the Sample Code in object code form along with any modifications you make to the Sample Code, provided that the modifications do not create files which are not compatible with Microsoft CAB file format and that you comply with the Distribution Requirements described below. For purposes of this section, "modifications" shall mean changes to the functionality of the Sample Code.
|
||||||
|
|
||||||
Redistributable Code. Portions of the SOFTWARE PRODUCT in the "BIN" and "LIB" directories are designated as "Redistributable Code." You may reproduce and distribute the Redistributable Code provided you comply with the Distribution Requirements described below.
|
Redistributable Code. Portions of the SOFTWARE PRODUCT in the "BIN" and "LIB" directories are designated as "Redistributable Code." You may reproduce and distribute the Redistributable Code provided you comply with the Distribution Requirements described below.
|
||||||
|
|
||||||
Distribution Requirements. You may copy and redistribute the Sample Code and/or Redistributable Code (collectively "REDISTRIBUTABLE COMPONENTS") as described above, provided that (a) you distribute the REDISTRIBUTABLE COMPONENTS only in conjunction with, and as a part of, your Application; (b) your Application adds significant and primary functionality to the REDISTRIBUTABLE COMPONENTS; (c) the Application does not allow the use of the REDISTRIBUTABLE COMPONENTS for files which are not compatible with the Microsoft CAB files; (d) the executable code in the BIN directory may be redistributed unmodified in conjunction with your Application provided that your Application adds significant and primary functionality to the REDISTRIBUTABLE COMPONENTS; (e) the library code in the LIB directory may only be redistributed when linked into your Application; (f) you do not use Microsoft's name, logo, or trademarks to market your Application; (g) you include a valid copyright notice on your Application; and (h) you agree to indemnify, hold harmless, and defend Microsoft from and against any claims or lawsuits, including attorneys' fees, that arise or result from the use or distribution of your Application. Contact Microsoft for the applicable royalties due and other licensing terms for all other uses and/or distribution of the REDISTRIBUTABLE COMPONENTS.
|
Distribution Requirements. You may copy and redistribute the Sample Code and/or Redistributable Code (collectively "REDISTRIBUTABLE COMPONENTS") as described above, provided that (a) you distribute the REDISTRIBUTABLE COMPONENTS only in conjunction with, and as a part of, your Application; (b) your Application adds significant and primary functionality to the REDISTRIBUTABLE COMPONENTS; (c) the Application does not allow the use of the REDISTRIBUTABLE COMPONENTS for files which are not compatible with the Microsoft CAB files; (d) the executable code in the BIN directory may be redistributed unmodified in conjunction with your Application provided that your Application adds significant and primary functionality to the REDISTRIBUTABLE COMPONENTS; (e) the library code in the LIB directory may only be redistributed when linked into your Application; (f) you do not use Microsoft's name, logo, or trademarks to market your Application; (g) you include a valid copyright notice on your Application; and (h) you agree to indemnify, hold harmless, and defend Microsoft from and against any claims or lawsuits, including attorneys' fees, that arise or result from the use or distribution of your Application. Contact Microsoft for the applicable royalties due and other licensing terms for all other uses and/or distribution of the REDISTRIBUTABLE COMPONENTS.
|
||||||
|
|
||||||
Microsoft reserves all rights not expressly granted to you.
|
Microsoft reserves all rights not expressly granted to you.
|
||||||
|
|
||||||
2. COPYRIGHT. All rights, title, and copyrights in and to the SOFTWARE PRODUCT (including, but not limited to, any images, photographs, animations, video, audio, music, text, and "applets" incorporated into the SOFTWARE PRODUCT) and any copies of the SOFTWARE PRODUCT are owned by Microsoft or its suppliers. The SOFTWARE PRODUCT is protected by copyright laws and international treaty provisions. Therefore, you must treat the SOFTWARE PRODUCT like any other copyrighted material, except that you may either (a) make one copy of the SOFTWARE PRODUCT solely for backup or archival purposes, or (b) install the SOFTWARE PRODUCT on a single computer, provided you keep the original solely for backup or archival purposes. You may not copy the printed materials accompanying the SOFTWARE PRODUCT.
|
2. COPYRIGHT. All rights, title, and copyrights in and to the SOFTWARE PRODUCT (including, but not limited to, any images, photographs, animations, video, audio, music, text, and "applets" incorporated into the SOFTWARE PRODUCT) and any copies of the SOFTWARE PRODUCT are owned by Microsoft or its suppliers. The SOFTWARE PRODUCT is protected by copyright laws and international treaty provisions. Therefore, you must treat the SOFTWARE PRODUCT like any other copyrighted material, except that you may either (a) make one copy of the SOFTWARE PRODUCT solely for backup or archival purposes, or (b) install the SOFTWARE PRODUCT on a single computer, provided you keep the original solely for backup or archival purposes. You may not copy the printed materials accompanying the SOFTWARE PRODUCT.
|
||||||
|
|
||||||
3. PRERELEASE CODE. The SOFTWARE PRODUCT may contain PRERELEASE CODE that is not at the level of performance and compatibility of the final, generally available, product offering. These portions of the SOFTWARE PRODUCT may not operate correctly and may be substantially modified prior to first commercial shipment. Microsoft is not obligated to make this or any later version of the SOFTWARE PRODUCT commercially available. Microsoft grants you the right to distribute test versions of your Application created using the PRERELEASE CODE provided you comply with the Distribution Requirements described in Section 1 and the following additional provisions: (a) you must mark the test version of your Application "BETA" and (b) you are solely responsible for updating your customers with versions of your Application that operate satisfactorily with the final commercial release of the PRERELEASE CODE.
|
3. PRERELEASE CODE. The SOFTWARE PRODUCT may contain PRERELEASE CODE that is not at the level of performance and compatibility of the final, generally available, product offering. These portions of the SOFTWARE PRODUCT may not operate correctly and may be substantially modified prior to first commercial shipment. Microsoft is not obligated to make this or any later version of the SOFTWARE PRODUCT commercially available. Microsoft grants you the right to distribute test versions of your Application created using the PRERELEASE CODE provided you comply with the Distribution Requirements described in Section 1 and the following additional provisions: (a) you must mark the test version of your Application "BETA" and (b) you are solely responsible for updating your customers with versions of your Application that operate satisfactorily with the final commercial release of the PRERELEASE CODE.
|
||||||
|
|
||||||
4. DESCRIPTION OF OTHER RIGHTS AND LIMITATIONS.
|
4. DESCRIPTION OF OTHER RIGHTS AND LIMITATIONS.
|
||||||
|
|
||||||
Limitations on Reverse-Engineering, Decompilation, and Disassembly. You may not reverse- engineer, decompile, or disassemble the SOFTWARE PRODUCT, except and only to the extent that such activity is expressly permitted by applicable law notwithstanding this limitation.
|
Limitations on Reverse-Engineering, Decompilation, and Disassembly. You may not reverse- engineer, decompile, or disassemble the SOFTWARE PRODUCT, except and only to the extent that such activity is expressly permitted by applicable law notwithstanding this limitation.
|
||||||
|
|
||||||
Rental. You may not rent or lease the SOFTWARE PRODUCT.
|
Rental. You may not rent or lease the SOFTWARE PRODUCT.
|
||||||
|
|
||||||
Software Transfer. You may permanently transfer all of your rights under this EULA, provided you retain no copies, you transfer all of the SOFTWARE PRODUCT (including all component parts, the media and printed materials, any upgrades, this EULA, and, if applicable, the Certificate of Authenticity), and the recipient agrees to the terms of this EULA. If the SOFTWARE PRODUCT is an upgrade, any transfer must include all prior versions of the SOFTWARE PRODUCT.
|
Software Transfer. You may permanently transfer all of your rights under this EULA, provided you retain no copies, you transfer all of the SOFTWARE PRODUCT (including all component parts, the media and printed materials, any upgrades, this EULA, and, if applicable, the Certificate of Authenticity), and the recipient agrees to the terms of this EULA. If the SOFTWARE PRODUCT is an upgrade, any transfer must include all prior versions of the SOFTWARE PRODUCT.
|
||||||
|
|
||||||
Termination. Without prejudice to any other rights, Microsoft may terminate this EULA if you fail to comply with the terms and conditions of this EULA. In such event, you must destroy all copies of the SOFTWARE PRODUCT and all of its component parts.
|
Termination. Without prejudice to any other rights, Microsoft may terminate this EULA if you fail to comply with the terms and conditions of this EULA. In such event, you must destroy all copies of the SOFTWARE PRODUCT and all of its component parts.
|
||||||
|
|
||||||
5. EXPORT RESTRICTIONS. You agree that neither you nor your customers intend to or will, directly or indirectly, export or transmit (a) the SOFTWARE PRODUCT or related documentation and technical data, or (b) your Application as described in Section 1 of this EULA (or any part thereof), or process, or service that is the direct product of the SOFTWARE PRODUCT to any country to which such export or transmission is restricted by any applicable U.S. regulation or statute, without the prior written consent, if required, of the Bureau of Export Administration of the U.S. Department of Commerce, or such other governmental entity as may have jurisdiction over such export or transmission.
|
5. EXPORT RESTRICTIONS. You agree that neither you nor your customers intend to or will, directly or indirectly, export or transmit (a) the SOFTWARE PRODUCT or related documentation and technical data, or (b) your Application as described in Section 1 of this EULA (or any part thereof), or process, or service that is the direct product of the SOFTWARE PRODUCT to any country to which such export or transmission is restricted by any applicable U.S. regulation or statute, without the prior written consent, if required, of the Bureau of Export Administration of the U.S. Department of Commerce, or such other governmental entity as may have jurisdiction over such export or transmission.
|
||||||
|
|
||||||
6. U.S. GOVERNMENT RESTRICTED RIGHTS. The SOFTWARE PRODUCT and documentation are provided with RESTRICTED RIGHTS. Use, duplication, or disclosure by the Government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of The Rights in Technical Data and Computer Software clause at DFARS 252.227-7013 or subparagraphs (c)(1) and (2) of the Commercial Computer Software - Restricted Rights at 48 CFR 52.227-19, as applicable. Manufacturer is Microsoft Corporation/One Microsoft Way/Redmond, WA 98052-6399.
|
6. U.S. GOVERNMENT RESTRICTED RIGHTS. The SOFTWARE PRODUCT and documentation are provided with RESTRICTED RIGHTS. Use, duplication, or disclosure by the Government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of The Rights in Technical Data and Computer Software clause at DFARS 252.227-7013 or subparagraphs (c)(1) and (2) of the Commercial Computer Software - Restricted Rights at 48 CFR 52.227-19, as applicable. Manufacturer is Microsoft Corporation/One Microsoft Way/Redmond, WA 98052-6399.
|
||||||
|
|
||||||
MISCELLANEOUS
|
MISCELLANEOUS
|
||||||
|
|
||||||
If you acquired this product in the United States, this EULA is governed by the laws of the State of Washington.
|
If you acquired this product in the United States, this EULA is governed by the laws of the State of Washington.
|
||||||
|
|
||||||
If you acquired this product in Canada, this EULA is governed by the laws of the Province of Ontario, Canada. Each of the parties hereto irrevocably attorns to the jurisdiction of the courts of the Province of Ontario and further agrees to commence any litigation that may arise hereunder in the courts located in the Judicial District of York, Province of Ontario.
|
If you acquired this product in Canada, this EULA is governed by the laws of the Province of Ontario, Canada. Each of the parties hereto irrevocably attorns to the jurisdiction of the courts of the Province of Ontario and further agrees to commence any litigation that may arise hereunder in the courts located in the Judicial District of York, Province of Ontario.
|
||||||
|
|
||||||
If this product was acquired outside the United States, local law may apply.
|
If this product was acquired outside the United States, local law may apply.
|
||||||
|
|
||||||
Should you have any questions concerning this EULA, or if you desire to contact Microsoft for any reason, please contact the Microsoft subsidiary serving your country, or write: Microsoft Customer Sales and Service/One Microsoft Way/Redmond, WA 98052-6399.
|
Should you have any questions concerning this EULA, or if you desire to contact Microsoft for any reason, please contact the Microsoft subsidiary serving your country, or write: Microsoft Customer Sales and Service/One Microsoft Way/Redmond, WA 98052-6399.
|
||||||
|
|
||||||
NO WARRANTIES. To the maximum extent permitted by applicable law, Microsoft expressly disclaims any warranty for the SOFTWARE PRODUCT. The SOFTWARE PRODUCT and any related documentation are provided "as is" without warranty of any kind, either express or implied, including, without limitation, the implied warranties of merchantability or fitness for a particular purpose. The entire risk arising out of use or performance of the SOFTWARE PRODUCT remains with you.
|
NO WARRANTIES. To the maximum extent permitted by applicable law, Microsoft expressly disclaims any warranty for the SOFTWARE PRODUCT. The SOFTWARE PRODUCT and any related documentation are provided "as is" without warranty of any kind, either express or implied, including, without limitation, the implied warranties of merchantability or fitness for a particular purpose. The entire risk arising out of use or performance of the SOFTWARE PRODUCT remains with you.
|
||||||
|
|
||||||
LIMITATION OF LIABILITY. Microsoft's entire liability and your exclusive remedy under this EULA shall not exceed five dollars (US$5.00).
|
LIMITATION OF LIABILITY. Microsoft's entire liability and your exclusive remedy under this EULA shall not exceed five dollars (US$5.00).
|
||||||
|
|
||||||
NO LIABILITY FOR CONSEQUENTIAL DAMAGES. To the maximum extent permitted by applicable law, in no event shall Microsoft or its suppliers be liable for any damages whatsoever (including, without limitation, damages for loss of business profit, business interruption, loss of business information, or any other pecuniary loss) arising out of the use of, or inability to use, this Microsoft product, even if Microsoft has been advised of the possibility of such damages. Because some states/jurisdictions do not allow the exclusion or limitation of liability for consequential or incidental damages, the above limitation may not apply to you.
|
NO LIABILITY FOR CONSEQUENTIAL DAMAGES. To the maximum extent permitted by applicable law, in no event shall Microsoft or its suppliers be liable for any damages whatsoever (including, without limitation, damages for loss of business profit, business interruption, loss of business information, or any other pecuniary loss) arising out of the use of, or inability to use, this Microsoft product, even if Microsoft has been advised of the possibility of such damages. Because some states/jurisdictions do not allow the exclusion or limitation of liability for consequential or incidental damages, the above limitation may not apply to you.
|
||||||
|
|
||||||
|
|
||||||
Si vous avez acquis votre produit Microsoft au CANADA, la garantie limitée suivante vous concerne:
|
Si vous avez acquis votre produit Microsoft au CANADA, la garantie limitée suivante vous concerne:
|
||||||
|
|
||||||
GARANTIE LIMITÉE
|
GARANTIE LIMITÉE
|
||||||
|
|
||||||
EXCLUSION DE GARANTIES. Microsoft renonce entièrement à toute garantie pour le LOGICIEL. Le LOGICIEL et toute autre documentation s'y rapportant sont fournis « comme tels » sans aucune garantie quelle qu'elle soit, expresse ou implicite, y compris, mais ne se limitant pas aux garanties implicites de la qualité marchande ou un usage particulier. Le risque total découlant de l'utilisation ou de la performance du LOGICIEL est entre vos mains.
|
EXCLUSION DE GARANTIES. Microsoft renonce entièrement à toute garantie pour le LOGICIEL. Le LOGICIEL et toute autre documentation s'y rapportant sont fournis « comme tels » sans aucune garantie quelle qu'elle soit, expresse ou implicite, y compris, mais ne se limitant pas aux garanties implicites de la qualité marchande ou un usage particulier. Le risque total découlant de l'utilisation ou de la performance du LOGICIEL est entre vos mains.
|
||||||
|
|
||||||
RESPONSABILITÉ LIMITÉE. La seule obligation de Microsoft et votre recours exclusif concernant ce contrat n'excèderont pas cinq dollars (US$5.00).
|
RESPONSABILITÉ LIMITÉE. La seule obligation de Microsoft et votre recours exclusif concernant ce contrat n'excèderont pas cinq dollars (US$5.00).
|
||||||
|
|
||||||
ABSENCE DE RESPONSABILITÉ POUR LES DOMMAGES INDIRECTS. Microsoft ou ses
|
ABSENCE DE RESPONSABILITÉ POUR LES DOMMAGES INDIRECTS. Microsoft ou ses
|
||||||
fournisseurs ne pourront être tenus responsables en aucune circonstance de tout dommage quel qu'il soit (y compris mais non de façon limitative les dommages directs ou indirects causés par la perte de bénéfices commerciaux, l'interruption des affaires, la perte d'information commerciale ou toute autre perte pécuniaire) résultant de l'utilisation ou de l'impossibilité d'utilisation de ce produit, et ce, même si la société Microsoft a été avisée de l'éventualité de tels dommages. Certains états/juridictions ne permettent pas l'exclusion ou la limitation de responsabilité relative aux dommages indirects ou consécutifs, et la limitation ci-dessus peut ne pas s'appliquer à votre égard.
|
fournisseurs ne pourront être tenus responsables en aucune circonstance de tout dommage quel qu'il soit (y compris mais non de façon limitative les dommages directs ou indirects causés par la perte de bénéfices commerciaux, l'interruption des affaires, la perte d'information commerciale ou toute autre perte pécuniaire) résultant de l'utilisation ou de l'impossibilité d'utilisation de ce produit, et ce, même si la société Microsoft a été avisée de l'éventualité de tels dommages. Certains états/juridictions ne permettent pas l'exclusion ou la limitation de responsabilité relative aux dommages indirects ou consécutifs, et la limitation ci-dessus peut ne pas s'appliquer à votre égard.
|
||||||
La présente Convention est régie par les lois de la province d'Ontario, Canada. Chacune des parties à la Convention reconnaît irrévocablement la compétence des tribunaux de la province d'Ontario et consent à instituer tout litige qui pourrait découler de la Convention auprès des tribunaux situés dans le district judiciaire de York, province d'Ontario.
|
La présente Convention est régie par les lois de la province d'Ontario, Canada. Chacune des parties à la Convention reconnaît irrévocablement la compétence des tribunaux de la province d'Ontario et consent à instituer tout litige qui pourrait découler de la Convention auprès des tribunaux situés dans le district judiciaire de York, province d'Ontario.
|
||||||
Au cas où vous auriez des questions concernant cette licence ou que vous désiriez vous mettre en rapport avec Microsoft pour quelque raison que ce soit, veuillez contacter la succursale Microsoft desservant votre pays, dont l'adresse est fournie dans ce produit, ou écrire à: Microsoft Customer Sales and Service, One Microsoft Way, Redmond, Washington 98052-6399.
|
Au cas où vous auriez des questions concernant cette licence ou que vous désiriez vous mettre en rapport avec Microsoft pour quelque raison que ce soit, veuillez contacter la succursale Microsoft desservant votre pays, dont l'adresse est fournie dans ce produit, ou écrire à: Microsoft Customer Sales and Service, One Microsoft Way, Redmond, Washington 98052-6399.
|
||||||
|
|
||||||
3/27/97 10:39 AM 970860004
|
3/27/97 10:39 AM 970860004
|
@ -1,30 +1,30 @@
|
|||||||
#pragma code_page(932)
|
#pragma code_page(932)
|
||||||
|
|
||||||
1 VERSIONINFO
|
1 VERSIONINFO
|
||||||
FILEVERSION ${PROJECT_VERSION_MAJOR},${PROJECT_VERSION_MINOR},0,${PROJECT_VERSION_PATCH}
|
FILEVERSION ${PROJECT_VERSION_MAJOR},${PROJECT_VERSION_MINOR},0,${PROJECT_VERSION_PATCH}
|
||||||
PRODUCTVERSION ${PROJECT_VERSION_MAJOR},${PROJECT_VERSION_MINOR},0,${PROJECT_VERSION_PATCH}
|
PRODUCTVERSION ${PROJECT_VERSION_MAJOR},${PROJECT_VERSION_MINOR},0,${PROJECT_VERSION_PATCH}
|
||||||
FILEFLAGSMASK 0x17L
|
FILEFLAGSMASK 0x17L
|
||||||
FILEOS 0x4L
|
FILEOS 0x4L
|
||||||
FILETYPE 0x1L
|
FILETYPE 0x1L
|
||||||
FILESUBTYPE 0x0L
|
FILESUBTYPE 0x0L
|
||||||
BEGIN
|
BEGIN
|
||||||
BLOCK "StringFileInfo"
|
BLOCK "StringFileInfo"
|
||||||
BEGIN
|
BEGIN
|
||||||
BLOCK "041104b0"
|
BLOCK "041104b0"
|
||||||
BEGIN
|
BEGIN
|
||||||
VALUE "CompanyName", "SoftEther VPN Project at University of Tsukuba, Japan."
|
VALUE "CompanyName", "SoftEther VPN Project at University of Tsukuba, Japan."
|
||||||
VALUE "FileDescription", "${PROJECT_NAME} ${COMPONENT_NAME} (Developer Edition)"
|
VALUE "FileDescription", "${PROJECT_NAME} ${COMPONENT_NAME} (Developer Edition)"
|
||||||
VALUE "FileVersion", "${PROJECT_VERSION_MAJOR}, ${PROJECT_VERSION_MINOR}, 0, ${PROJECT_VERSION_PATCH}"
|
VALUE "FileVersion", "${PROJECT_VERSION_MAJOR}, ${PROJECT_VERSION_MINOR}, 0, ${PROJECT_VERSION_PATCH}"
|
||||||
VALUE "InternalName", "${COMPONENT_INTERNAL_NAME}"
|
VALUE "InternalName", "${COMPONENT_INTERNAL_NAME}"
|
||||||
VALUE "LegalCopyright", "Copyright (c) 2012-${DATE_YEAR} all contributors on SoftEther VPN project in GitHub. Copyright (C) 2004-${DATE_YEAR} Daiyuu Nobori, SoftEther Project at University of Tsukuba, and SoftEther Corporation. All Rights Reserved."
|
VALUE "LegalCopyright", "Copyright (c) 2012-${DATE_YEAR} all contributors on SoftEther VPN project in GitHub. Copyright (C) 2004-${DATE_YEAR} Daiyuu Nobori, SoftEther Project at University of Tsukuba, and SoftEther Corporation. All Rights Reserved."
|
||||||
VALUE "LegalTrademarks", "SoftEther(R) is a registered trademark of SoftEther Corporation in Japan, United States and People's Republic of China. SoftEther Corporation is a company founded at University of Tsukuba, Japan."
|
VALUE "LegalTrademarks", "SoftEther(R) is a registered trademark of SoftEther Corporation in Japan, United States and People's Republic of China. SoftEther Corporation is a company founded at University of Tsukuba, Japan."
|
||||||
VALUE "OriginalFilename", "${COMPONENT_FILE_NAME}"
|
VALUE "OriginalFilename", "${COMPONENT_FILE_NAME}"
|
||||||
VALUE "ProductName", "${PROJECT_NAME} ${COMPONENT_NAME}"
|
VALUE "ProductName", "${PROJECT_NAME} ${COMPONENT_NAME}"
|
||||||
VALUE "ProductVersion", "${PROJECT_VERSION_MAJOR}, ${PROJECT_VERSION_MINOR}, 0, ${PROJECT_VERSION_PATCH}"
|
VALUE "ProductVersion", "${PROJECT_VERSION_MAJOR}, ${PROJECT_VERSION_MINOR}, 0, ${PROJECT_VERSION_PATCH}"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
BLOCK "VarFileInfo"
|
BLOCK "VarFileInfo"
|
||||||
BEGIN
|
BEGIN
|
||||||
VALUE "Translation", 0x411, 1200
|
VALUE "Translation", 0x411, 1200
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
|
@ -1,30 +1,30 @@
|
|||||||
#pragma code_page(932)
|
#pragma code_page(932)
|
||||||
|
|
||||||
1 VERSIONINFO
|
1 VERSIONINFO
|
||||||
FILEVERSION $VER_MAJOR$,$VER_MINOR$,0,$VER_BUILD$
|
FILEVERSION $VER_MAJOR$,$VER_MINOR$,0,$VER_BUILD$
|
||||||
PRODUCTVERSION $VER_MAJOR$,$VER_MINOR$,0,$VER_BUILD$
|
PRODUCTVERSION $VER_MAJOR$,$VER_MINOR$,0,$VER_BUILD$
|
||||||
FILEFLAGSMASK 0x17L
|
FILEFLAGSMASK 0x17L
|
||||||
FILEOS 0x4L
|
FILEOS 0x4L
|
||||||
FILETYPE 0x1L
|
FILETYPE 0x1L
|
||||||
FILESUBTYPE 0x0L
|
FILESUBTYPE 0x0L
|
||||||
BEGIN
|
BEGIN
|
||||||
BLOCK "StringFileInfo"
|
BLOCK "StringFileInfo"
|
||||||
BEGIN
|
BEGIN
|
||||||
BLOCK "041104b0"
|
BLOCK "041104b0"
|
||||||
BEGIN
|
BEGIN
|
||||||
VALUE "CompanyName", "University of Tsukuba"
|
VALUE "CompanyName", "University of Tsukuba"
|
||||||
VALUE "FileDescription", "VPN Gate Plug-in DLL for SoftEther VPN"
|
VALUE "FileDescription", "VPN Gate Plug-in DLL for SoftEther VPN"
|
||||||
VALUE "FileVersion", "$VER_MAJOR$, $VER_MINOR$, 0, $VER_BUILD$"
|
VALUE "FileVersion", "$VER_MAJOR$, $VER_MINOR$, 0, $VER_BUILD$"
|
||||||
VALUE "InternalName", "$INTERNALNAME$"
|
VALUE "InternalName", "$INTERNALNAME$"
|
||||||
VALUE "LegalCopyright", "Copyright (C) 2012-$YEAR$ VPN Gate Project at University of Tsukuba. All Rights Reserved."
|
VALUE "LegalCopyright", "Copyright (C) 2012-$YEAR$ VPN Gate Project at University of Tsukuba. All Rights Reserved."
|
||||||
VALUE "LegalTrademarks", ""
|
VALUE "LegalTrademarks", ""
|
||||||
VALUE "OriginalFilename", "$FILENAME$"
|
VALUE "OriginalFilename", "$FILENAME$"
|
||||||
VALUE "ProductName", "VPN Gate Software"
|
VALUE "ProductName", "VPN Gate Software"
|
||||||
VALUE "ProductVersion", "$VER_MAJOR$, $VER_MINOR$, 0, $VER_BUILD$"
|
VALUE "ProductVersion", "$VER_MAJOR$, $VER_MINOR$, 0, $VER_BUILD$"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
BLOCK "VarFileInfo"
|
BLOCK "VarFileInfo"
|
||||||
BEGIN
|
BEGIN
|
||||||
VALUE "Translation", 0x411, 1200
|
VALUE "Translation", 0x411, 1200
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
|
2714
src/Cedar/Account.c
2714
src/Cedar/Account.c
File diff suppressed because it is too large
Load Diff
@ -1,211 +1,211 @@
|
|||||||
// SoftEther VPN Source Code - Developer Edition Master Branch
|
// SoftEther VPN Source Code - Developer Edition Master Branch
|
||||||
// Cedar Communication Module
|
// Cedar Communication Module
|
||||||
|
|
||||||
|
|
||||||
// Account.h
|
// Account.h
|
||||||
// Header of Account.c
|
// Header of Account.c
|
||||||
|
|
||||||
#ifndef ACCOUNT_H
|
#ifndef ACCOUNT_H
|
||||||
#define ACCOUNT_H
|
#define ACCOUNT_H
|
||||||
|
|
||||||
#define USER_MAC_STR_PREFIX L"MAC:"
|
#define USER_MAC_STR_PREFIX L"MAC:"
|
||||||
#define USER_IPV4_STR_PREFIX L"IPv4:"
|
#define USER_IPV4_STR_PREFIX L"IPv4:"
|
||||||
|
|
||||||
// Policy item
|
// Policy item
|
||||||
struct POLICY_ITEM
|
struct POLICY_ITEM
|
||||||
{
|
{
|
||||||
UINT Index;
|
UINT Index;
|
||||||
bool TypeInt;
|
bool TypeInt;
|
||||||
bool AllowZero;
|
bool AllowZero;
|
||||||
UINT MinValue;
|
UINT MinValue;
|
||||||
UINT MaxValue;
|
UINT MaxValue;
|
||||||
UINT DefaultValue;
|
UINT DefaultValue;
|
||||||
char *FormatStr;
|
char *FormatStr;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Policy
|
// Policy
|
||||||
struct POLICY
|
struct POLICY
|
||||||
{
|
{
|
||||||
// For Ver 2.0
|
// For Ver 2.0
|
||||||
bool Access; // Grant access
|
bool Access; // Grant access
|
||||||
bool DHCPFilter; // Filter DHCP packets (IPv4)
|
bool DHCPFilter; // Filter DHCP packets (IPv4)
|
||||||
bool DHCPNoServer; // Prohibit the behavior of the DHCP server (IPv4)
|
bool DHCPNoServer; // Prohibit the behavior of the DHCP server (IPv4)
|
||||||
bool DHCPForce; // Force DHCP-assigned IP address (IPv4)
|
bool DHCPForce; // Force DHCP-assigned IP address (IPv4)
|
||||||
bool NoBridge; // Prohibit the bridge behavior
|
bool NoBridge; // Prohibit the bridge behavior
|
||||||
bool NoRouting; // Prohibit the router behavior (IPv4)
|
bool NoRouting; // Prohibit the router behavior (IPv4)
|
||||||
bool CheckMac; // Prohibit the duplicate MAC address
|
bool CheckMac; // Prohibit the duplicate MAC address
|
||||||
bool CheckIP; // Prohibit a duplicate IP address (IPv4)
|
bool CheckIP; // Prohibit a duplicate IP address (IPv4)
|
||||||
bool ArpDhcpOnly; // Prohibit the broadcast other than ARP, DHCP, ICMPv6
|
bool ArpDhcpOnly; // Prohibit the broadcast other than ARP, DHCP, ICMPv6
|
||||||
bool PrivacyFilter; // Privacy filter mode
|
bool PrivacyFilter; // Privacy filter mode
|
||||||
bool NoServer; // Prohibit to operate as a TCP/IP server (IPv4)
|
bool NoServer; // Prohibit to operate as a TCP/IP server (IPv4)
|
||||||
bool NoBroadcastLimiter; // Not to limit the number of broadcast
|
bool NoBroadcastLimiter; // Not to limit the number of broadcast
|
||||||
bool MonitorPort; // Allow monitoring mode
|
bool MonitorPort; // Allow monitoring mode
|
||||||
UINT MaxConnection; // Maximum number of TCP connections
|
UINT MaxConnection; // Maximum number of TCP connections
|
||||||
UINT TimeOut; // Communication time-out period
|
UINT TimeOut; // Communication time-out period
|
||||||
UINT MaxMac; // Maximum number of MAC address
|
UINT MaxMac; // Maximum number of MAC address
|
||||||
UINT MaxIP; // Maximum number of IP address (IPv4)
|
UINT MaxIP; // Maximum number of IP address (IPv4)
|
||||||
UINT MaxUpload; // Upload bandwidth
|
UINT MaxUpload; // Upload bandwidth
|
||||||
UINT MaxDownload; // Download bandwidth
|
UINT MaxDownload; // Download bandwidth
|
||||||
bool FixPassword; // User can not change password
|
bool FixPassword; // User can not change password
|
||||||
UINT MultiLogins; // Multiple logins limit
|
UINT MultiLogins; // Multiple logins limit
|
||||||
bool NoQoS; // Prohibit the use of VoIP / QoS features
|
bool NoQoS; // Prohibit the use of VoIP / QoS features
|
||||||
|
|
||||||
// For Ver 3.0
|
// For Ver 3.0
|
||||||
bool RSandRAFilter; // Filter the Router Solicitation / Advertising packet (IPv6)
|
bool RSandRAFilter; // Filter the Router Solicitation / Advertising packet (IPv6)
|
||||||
bool RAFilter; // Filter the router advertisement packet (IPv6)
|
bool RAFilter; // Filter the router advertisement packet (IPv6)
|
||||||
bool DHCPv6Filter; // Filter DHCP packets (IPv6)
|
bool DHCPv6Filter; // Filter DHCP packets (IPv6)
|
||||||
bool DHCPv6NoServer; // Prohibit the behavior of the DHCP server (IPv6)
|
bool DHCPv6NoServer; // Prohibit the behavior of the DHCP server (IPv6)
|
||||||
bool NoRoutingV6; // Prohibit the router behavior (IPv6)
|
bool NoRoutingV6; // Prohibit the router behavior (IPv6)
|
||||||
bool CheckIPv6; // Prohibit the duplicate IP address (IPv6)
|
bool CheckIPv6; // Prohibit the duplicate IP address (IPv6)
|
||||||
bool NoServerV6; // Prohibit to operate as a TCP/IP server (IPv6)
|
bool NoServerV6; // Prohibit to operate as a TCP/IP server (IPv6)
|
||||||
UINT MaxIPv6; // Maximum number of IP address (IPv6)
|
UINT MaxIPv6; // Maximum number of IP address (IPv6)
|
||||||
bool NoSavePassword; // Prohibit to save the password in the VPN Client
|
bool NoSavePassword; // Prohibit to save the password in the VPN Client
|
||||||
UINT AutoDisconnect; // Disconnect the VPN Client automatically at a certain period of time
|
UINT AutoDisconnect; // Disconnect the VPN Client automatically at a certain period of time
|
||||||
bool FilterIPv4; // Filter all IPv4 packets
|
bool FilterIPv4; // Filter all IPv4 packets
|
||||||
bool FilterIPv6; // Filter all IPv6 packets
|
bool FilterIPv6; // Filter all IPv6 packets
|
||||||
bool FilterNonIP; // Filter all non-IP packets
|
bool FilterNonIP; // Filter all non-IP packets
|
||||||
bool NoIPv6DefaultRouterInRA; // Delete the default router specification from the IPv6 router advertisement
|
bool NoIPv6DefaultRouterInRA; // Delete the default router specification from the IPv6 router advertisement
|
||||||
bool NoIPv6DefaultRouterInRAWhenIPv6; // Delete the default router specification from the IPv6 router advertisement (Enable IPv6 connection)
|
bool NoIPv6DefaultRouterInRAWhenIPv6; // Delete the default router specification from the IPv6 router advertisement (Enable IPv6 connection)
|
||||||
UINT VLanId; // Specify the VLAN ID
|
UINT VLanId; // Specify the VLAN ID
|
||||||
|
|
||||||
bool Ver3; // Whether version 3.0
|
bool Ver3; // Whether version 3.0
|
||||||
};
|
};
|
||||||
|
|
||||||
// Group
|
// Group
|
||||||
struct USERGROUP
|
struct USERGROUP
|
||||||
{
|
{
|
||||||
LOCK *lock; // Lock
|
LOCK *lock; // Lock
|
||||||
REF *ref; // Reference counter
|
REF *ref; // Reference counter
|
||||||
char *Name; // Group name
|
char *Name; // Group name
|
||||||
wchar_t *RealName; // Display name
|
wchar_t *RealName; // Display name
|
||||||
wchar_t *Note; // Note
|
wchar_t *Note; // Note
|
||||||
POLICY *Policy; // Policy
|
POLICY *Policy; // Policy
|
||||||
TRAFFIC *Traffic; // Traffic data
|
TRAFFIC *Traffic; // Traffic data
|
||||||
};
|
};
|
||||||
|
|
||||||
// User
|
// User
|
||||||
struct USER
|
struct USER
|
||||||
{
|
{
|
||||||
LOCK *lock; // Lock
|
LOCK *lock; // Lock
|
||||||
REF *ref; // Reference counter
|
REF *ref; // Reference counter
|
||||||
char *Name; // User name
|
char *Name; // User name
|
||||||
wchar_t *RealName; // Real name
|
wchar_t *RealName; // Real name
|
||||||
wchar_t *Note; // Note
|
wchar_t *Note; // Note
|
||||||
char *GroupName; // Group name
|
char *GroupName; // Group name
|
||||||
USERGROUP *Group; // Group
|
USERGROUP *Group; // Group
|
||||||
UINT AuthType; // Authentication type
|
UINT AuthType; // Authentication type
|
||||||
void *AuthData; // Authentication data
|
void *AuthData; // Authentication data
|
||||||
UINT64 CreatedTime; // Creation date and time
|
UINT64 CreatedTime; // Creation date and time
|
||||||
UINT64 UpdatedTime; // Updating date
|
UINT64 UpdatedTime; // Updating date
|
||||||
UINT64 ExpireTime; // Expiration date
|
UINT64 ExpireTime; // Expiration date
|
||||||
UINT64 LastLoginTime; // Last login time
|
UINT64 LastLoginTime; // Last login time
|
||||||
UINT NumLogin; // Total number of logins
|
UINT NumLogin; // Total number of logins
|
||||||
POLICY *Policy; // Policy
|
POLICY *Policy; // Policy
|
||||||
TRAFFIC *Traffic; // Traffic data
|
TRAFFIC *Traffic; // Traffic data
|
||||||
};
|
};
|
||||||
|
|
||||||
// Password authentication data
|
// Password authentication data
|
||||||
struct AUTHPASSWORD
|
struct AUTHPASSWORD
|
||||||
{
|
{
|
||||||
UCHAR HashedKey[SHA1_SIZE]; // Hashed passwords
|
UCHAR HashedKey[SHA1_SIZE]; // Hashed passwords
|
||||||
UCHAR NtLmSecureHash[MD5_SIZE]; // Encrypted password for the NTLM
|
UCHAR NtLmSecureHash[MD5_SIZE]; // Encrypted password for the NTLM
|
||||||
};
|
};
|
||||||
|
|
||||||
// User certificate authentication data
|
// User certificate authentication data
|
||||||
struct AUTHUSERCERT
|
struct AUTHUSERCERT
|
||||||
{
|
{
|
||||||
X *UserX; // X509 certificate for the user
|
X *UserX; // X509 certificate for the user
|
||||||
};
|
};
|
||||||
|
|
||||||
// Root certification authority authentication data
|
// Root certification authority authentication data
|
||||||
struct AUTHROOTCERT
|
struct AUTHROOTCERT
|
||||||
{
|
{
|
||||||
X_SERIAL *Serial; // Serial number
|
X_SERIAL *Serial; // Serial number
|
||||||
wchar_t *CommonName; // CommonName
|
wchar_t *CommonName; // CommonName
|
||||||
};
|
};
|
||||||
|
|
||||||
// Radius authentication data
|
// Radius authentication data
|
||||||
struct AUTHRADIUS
|
struct AUTHRADIUS
|
||||||
{
|
{
|
||||||
wchar_t *RadiusUsername; // User name in the Radius
|
wchar_t *RadiusUsername; // User name in the Radius
|
||||||
};
|
};
|
||||||
|
|
||||||
// Windows NT authentication data
|
// Windows NT authentication data
|
||||||
struct AUTHNT
|
struct AUTHNT
|
||||||
{
|
{
|
||||||
wchar_t *NtUsername; // User name on NT
|
wchar_t *NtUsername; // User name on NT
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Macro
|
// Macro
|
||||||
#define POLICY_CURRENT_VERSION 3
|
#define POLICY_CURRENT_VERSION 3
|
||||||
#define NUM_POLICY_ITEM ((sizeof(POLICY) / sizeof(UINT)) - 1)
|
#define NUM_POLICY_ITEM ((sizeof(POLICY) / sizeof(UINT)) - 1)
|
||||||
#define NUM_POLICY_ITEM_FOR_VER2 22
|
#define NUM_POLICY_ITEM_FOR_VER2 22
|
||||||
#define NUM_POLICY_ITEM_FOR_VER3 38
|
#define NUM_POLICY_ITEM_FOR_VER3 38
|
||||||
|
|
||||||
#define IS_POLICY_FOR_VER2(index) (((index) >= 0) && ((index) < NUM_POLICY_ITEM_FOR_VER2))
|
#define IS_POLICY_FOR_VER2(index) (((index) >= 0) && ((index) < NUM_POLICY_ITEM_FOR_VER2))
|
||||||
#define IS_POLICY_FOR_VER3(index) (((index) >= 0) && ((index) < NUM_POLICY_ITEM_FOR_VER3))
|
#define IS_POLICY_FOR_VER3(index) (((index) >= 0) && ((index) < NUM_POLICY_ITEM_FOR_VER3))
|
||||||
|
|
||||||
#define IS_POLICY_FOR_CURRENT_VER(index, ver) ((ver) >= 3 ? IS_POLICY_FOR_VER3(index) : IS_POLICY_FOR_VER2(index))
|
#define IS_POLICY_FOR_CURRENT_VER(index, ver) ((ver) >= 3 ? IS_POLICY_FOR_VER3(index) : IS_POLICY_FOR_VER2(index))
|
||||||
|
|
||||||
#define POLICY_BOOL(p, i) (((bool *)(p))[(i)])
|
#define POLICY_BOOL(p, i) (((bool *)(p))[(i)])
|
||||||
#define POLICY_INT(p, i) (((UINT *)(p))[(i)])
|
#define POLICY_INT(p, i) (((UINT *)(p))[(i)])
|
||||||
|
|
||||||
extern POLICY_ITEM policy_item[];
|
extern POLICY_ITEM policy_item[];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Function prototype
|
// Function prototype
|
||||||
int CompareUserName(void *p1, void *p2);
|
int CompareUserName(void *p1, void *p2);
|
||||||
int CompareGroupName(void *p1, void *p2);
|
int CompareGroupName(void *p1, void *p2);
|
||||||
void AcLock(HUB *h);
|
void AcLock(HUB *h);
|
||||||
void AcUnlock(HUB *h);
|
void AcUnlock(HUB *h);
|
||||||
USERGROUP *NewGroup(char *name, wchar_t *realname, wchar_t *note);
|
USERGROUP *NewGroup(char *name, wchar_t *realname, wchar_t *note);
|
||||||
void ReleaseGroup(USERGROUP *g);
|
void ReleaseGroup(USERGROUP *g);
|
||||||
void CleanupGroup(USERGROUP *g);
|
void CleanupGroup(USERGROUP *g);
|
||||||
USER *NewUser(char *name, wchar_t *realname, wchar_t *note, UINT authtype, void *authdata);
|
USER *NewUser(char *name, wchar_t *realname, wchar_t *note, UINT authtype, void *authdata);
|
||||||
void ReleaseUser(USER *u);
|
void ReleaseUser(USER *u);
|
||||||
void CleanupUser(USER *u);
|
void CleanupUser(USER *u);
|
||||||
void FreeAuthData(UINT authtype, void *authdata);
|
void FreeAuthData(UINT authtype, void *authdata);
|
||||||
bool AcAddUser(HUB *h, USER *u);
|
bool AcAddUser(HUB *h, USER *u);
|
||||||
bool AcAddGroup(HUB *h, USERGROUP *g);
|
bool AcAddGroup(HUB *h, USERGROUP *g);
|
||||||
USER *AcGetUser(HUB *h, char *name);
|
USER *AcGetUser(HUB *h, char *name);
|
||||||
USERGROUP *AcGetGroup(HUB *h, char *name);
|
USERGROUP *AcGetGroup(HUB *h, char *name);
|
||||||
bool AcIsUser(HUB *h, char *name);
|
bool AcIsUser(HUB *h, char *name);
|
||||||
bool AcIsGroup(HUB *h, char *name);
|
bool AcIsGroup(HUB *h, char *name);
|
||||||
bool AcDeleteUser(HUB *h, char *name);
|
bool AcDeleteUser(HUB *h, char *name);
|
||||||
bool AcDeleteGroup(HUB *h, char *name);
|
bool AcDeleteGroup(HUB *h, char *name);
|
||||||
void JoinUserToGroup(USER *u, USERGROUP *g);
|
void JoinUserToGroup(USER *u, USERGROUP *g);
|
||||||
void SetUserTraffic(USER *u, TRAFFIC *t);
|
void SetUserTraffic(USER *u, TRAFFIC *t);
|
||||||
void SetGroupTraffic(USERGROUP *g, TRAFFIC *t);
|
void SetGroupTraffic(USERGROUP *g, TRAFFIC *t);
|
||||||
void SetUserAuthData(USER *u, UINT authtype, void *authdata);
|
void SetUserAuthData(USER *u, UINT authtype, void *authdata);
|
||||||
void *NewPasswordAuthData(char *username, char *password);
|
void *NewPasswordAuthData(char *username, char *password);
|
||||||
void *NewPasswordAuthDataRaw(UCHAR *hashed_password, UCHAR *ntlm_secure_hash);
|
void *NewPasswordAuthDataRaw(UCHAR *hashed_password, UCHAR *ntlm_secure_hash);
|
||||||
void *NewUserCertAuthData(X *x);
|
void *NewUserCertAuthData(X *x);
|
||||||
void *NewRootCertAuthData(X_SERIAL *serial, wchar_t *common_name);
|
void *NewRootCertAuthData(X_SERIAL *serial, wchar_t *common_name);
|
||||||
void *NewRadiusAuthData(wchar_t *username);
|
void *NewRadiusAuthData(wchar_t *username);
|
||||||
void *NewNTAuthData(wchar_t *username);
|
void *NewNTAuthData(wchar_t *username);
|
||||||
void HashPassword(void *dst, char *username, char *password);
|
void HashPassword(void *dst, char *username, char *password);
|
||||||
POLICY *GetDefaultPolicy();
|
POLICY *GetDefaultPolicy();
|
||||||
POLICY *ClonePolicy(POLICY *policy);
|
POLICY *ClonePolicy(POLICY *policy);
|
||||||
void SetUserPolicy(USER *u, POLICY *policy);
|
void SetUserPolicy(USER *u, POLICY *policy);
|
||||||
void OverwritePolicy(POLICY **target, POLICY *p);
|
void OverwritePolicy(POLICY **target, POLICY *p);
|
||||||
void SetGroupPolicy(USERGROUP *g, POLICY *policy);
|
void SetGroupPolicy(USERGROUP *g, POLICY *policy);
|
||||||
POLICY *GetGroupPolicy(USERGROUP *g);
|
POLICY *GetGroupPolicy(USERGROUP *g);
|
||||||
wchar_t *GetPolicyTitle(UINT id);
|
wchar_t *GetPolicyTitle(UINT id);
|
||||||
wchar_t *GetPolicyDescription(UINT id);
|
wchar_t *GetPolicyDescription(UINT id);
|
||||||
bool IsUserName(char *name);
|
bool IsUserName(char *name);
|
||||||
void *CopyAuthData(void *authdata, UINT authtype);
|
void *CopyAuthData(void *authdata, UINT authtype);
|
||||||
UINT PolicyNum();
|
UINT PolicyNum();
|
||||||
bool PolicyIsSupportedForCascade(UINT i);
|
bool PolicyIsSupportedForCascade(UINT i);
|
||||||
UINT PolicyStrToId(char *name);
|
UINT PolicyStrToId(char *name);
|
||||||
char *PolicyIdToStr(UINT i);
|
char *PolicyIdToStr(UINT i);
|
||||||
POLICY_ITEM *GetPolicyItem(UINT id);
|
POLICY_ITEM *GetPolicyItem(UINT id);
|
||||||
void GetPolicyValueRangeStr(wchar_t *str, UINT size, UINT id);
|
void GetPolicyValueRangeStr(wchar_t *str, UINT size, UINT id);
|
||||||
void FormatPolicyValue(wchar_t *str, UINT size, UINT id, UINT value);
|
void FormatPolicyValue(wchar_t *str, UINT size, UINT id, UINT value);
|
||||||
bool GetUserMacAddressFromUserNote(UCHAR *mac, wchar_t *note);
|
bool GetUserMacAddressFromUserNote(UCHAR *mac, wchar_t *note);
|
||||||
UINT GetUserIPv4AddressFromUserNote32(wchar_t *note);
|
UINT GetUserIPv4AddressFromUserNote32(wchar_t *note);
|
||||||
|
|
||||||
#endif // ACCOUNT_H
|
#endif // ACCOUNT_H
|
||||||
|
31010
src/Cedar/Admin.c
31010
src/Cedar/Admin.c
File diff suppressed because it is too large
Load Diff
2984
src/Cedar/Admin.h
2984
src/Cedar/Admin.h
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,68 +1,68 @@
|
|||||||
// SoftEther VPN Source Code - Developer Edition Master Branch
|
// SoftEther VPN Source Code - Developer Edition Master Branch
|
||||||
// Cedar Communication Module
|
// Cedar Communication Module
|
||||||
|
|
||||||
|
|
||||||
// AzureClient.h
|
// AzureClient.h
|
||||||
// Header of AzureClient.c
|
// Header of AzureClient.c
|
||||||
|
|
||||||
#ifndef AZURE_CLIENT_H
|
#ifndef AZURE_CLIENT_H
|
||||||
#define AZURE_CLIENT_H
|
#define AZURE_CLIENT_H
|
||||||
|
|
||||||
// Constants
|
// Constants
|
||||||
#define AZURE_SERVER_PORT 443
|
#define AZURE_SERVER_PORT 443
|
||||||
#define AZURE_PROTOCOL_CONTROL_SIGNATURE "ACTL"
|
#define AZURE_PROTOCOL_CONTROL_SIGNATURE "ACTL"
|
||||||
#define AZURE_PROTOCOL_DATA_SIANGTURE "AZURE_CONNECT_SIGNATURE!"
|
#define AZURE_PROTOCOL_DATA_SIANGTURE "AZURE_CONNECT_SIGNATURE!"
|
||||||
#define AZURE_PROTOCOL_CONTROL_TIMEOUT_DEFAULT (5 * 1000) // Default timeout
|
#define AZURE_PROTOCOL_CONTROL_TIMEOUT_DEFAULT (5 * 1000) // Default timeout
|
||||||
#define AZURE_CONNECT_INITIAL_RETRY_INTERVAL (1 * 1000) // Initial re-connection interval (15 * 1000)
|
#define AZURE_CONNECT_INITIAL_RETRY_INTERVAL (1 * 1000) // Initial re-connection interval (15 * 1000)
|
||||||
#define AZURE_CONNECT_MAX_RETRY_INTERVAL (60 * 60 * 1000) // Maximum re-connection interval
|
#define AZURE_CONNECT_MAX_RETRY_INTERVAL (60 * 60 * 1000) // Maximum re-connection interval
|
||||||
|
|
||||||
#define AZURE_DOMAIN_SUFFIX ".vpnazure.net"
|
#define AZURE_DOMAIN_SUFFIX ".vpnazure.net"
|
||||||
|
|
||||||
#define AZURE_SERVER_MAX_KEEPALIVE (5 * 60 * 1000)
|
#define AZURE_SERVER_MAX_KEEPALIVE (5 * 60 * 1000)
|
||||||
#define AZURE_SERVER_MAX_TIMEOUT (10 * 60 * 1000)
|
#define AZURE_SERVER_MAX_TIMEOUT (10 * 60 * 1000)
|
||||||
|
|
||||||
#define AZURE_VIA_PROXY_TIMEOUT 5000
|
#define AZURE_VIA_PROXY_TIMEOUT 5000
|
||||||
|
|
||||||
|
|
||||||
// Communications parameter
|
// Communications parameter
|
||||||
struct AZURE_PARAM
|
struct AZURE_PARAM
|
||||||
{
|
{
|
||||||
UINT ControlKeepAlive;
|
UINT ControlKeepAlive;
|
||||||
UINT ControlTimeout;
|
UINT ControlTimeout;
|
||||||
UINT DataTimeout;
|
UINT DataTimeout;
|
||||||
UINT SslTimeout;
|
UINT SslTimeout;
|
||||||
};
|
};
|
||||||
|
|
||||||
// VPN Azure Client
|
// VPN Azure Client
|
||||||
struct AZURE_CLIENT
|
struct AZURE_CLIENT
|
||||||
{
|
{
|
||||||
CEDAR *Cedar;
|
CEDAR *Cedar;
|
||||||
SERVER *Server;
|
SERVER *Server;
|
||||||
LOCK *Lock;
|
LOCK *Lock;
|
||||||
DDNS_CLIENT_STATUS DDnsStatus;
|
DDNS_CLIENT_STATUS DDnsStatus;
|
||||||
volatile bool IsEnabled;
|
volatile bool IsEnabled;
|
||||||
EVENT *Event;
|
EVENT *Event;
|
||||||
volatile bool Halt;
|
volatile bool Halt;
|
||||||
THREAD *MainThread;
|
THREAD *MainThread;
|
||||||
volatile UINT IpStatusRevision;
|
volatile UINT IpStatusRevision;
|
||||||
DDNS_CLIENT_STATUS DDnsStatusCopy;
|
DDNS_CLIENT_STATUS DDnsStatusCopy;
|
||||||
SOCK *CurrentSock;
|
SOCK *CurrentSock;
|
||||||
char ConnectingAzureIp[MAX_SIZE];
|
char ConnectingAzureIp[MAX_SIZE];
|
||||||
AZURE_PARAM AzureParam;
|
AZURE_PARAM AzureParam;
|
||||||
volatile UINT DDnsTriggerInt;
|
volatile UINT DDnsTriggerInt;
|
||||||
volatile bool IsConnected;
|
volatile bool IsConnected;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// Function prototype
|
// Function prototype
|
||||||
AZURE_CLIENT *NewAzureClient(CEDAR *cedar, SERVER *server);
|
AZURE_CLIENT *NewAzureClient(CEDAR *cedar, SERVER *server);
|
||||||
void FreeAzureClient(AZURE_CLIENT *ac);
|
void FreeAzureClient(AZURE_CLIENT *ac);
|
||||||
void AcApplyCurrentConfig(AZURE_CLIENT *ac, DDNS_CLIENT_STATUS *ddns_status);
|
void AcApplyCurrentConfig(AZURE_CLIENT *ac, DDNS_CLIENT_STATUS *ddns_status);
|
||||||
void AcMainThread(THREAD *thread, void *param);
|
void AcMainThread(THREAD *thread, void *param);
|
||||||
void AcSetEnable(AZURE_CLIENT *ac, bool enabled);
|
void AcSetEnable(AZURE_CLIENT *ac, bool enabled);
|
||||||
void AcWaitForRequest(AZURE_CLIENT *ac, SOCK *s, AZURE_PARAM *param);
|
void AcWaitForRequest(AZURE_CLIENT *ac, SOCK *s, AZURE_PARAM *param);
|
||||||
|
|
||||||
|
|
||||||
#endif // AZURE_CLIENT_H
|
#endif // AZURE_CLIENT_H
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
// SoftEther VPN Source Code - Developer Edition Master Branch
|
// SoftEther VPN Source Code - Developer Edition Master Branch
|
||||||
// Cedar Communication Module
|
// Cedar Communication Module
|
||||||
|
|
||||||
|
|
||||||
// AzureServer.c
|
// AzureServer.c
|
||||||
// VPN Azure Server
|
// VPN Azure Server
|
||||||
|
|
||||||
#include "CedarPch.h"
|
#include "CedarPch.h"
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
// SoftEther VPN Source Code - Developer Edition Master Branch
|
// SoftEther VPN Source Code - Developer Edition Master Branch
|
||||||
// Cedar Communication Module
|
// Cedar Communication Module
|
||||||
|
|
||||||
|
|
||||||
// AzureServer.h
|
// AzureServer.h
|
||||||
// Header of AzureServer.c
|
// Header of AzureServer.c
|
||||||
|
|
||||||
#ifndef AZURE_SERVER_H
|
#ifndef AZURE_SERVER_H
|
||||||
#define AZURE_SERVER_H
|
#define AZURE_SERVER_H
|
||||||
|
|
||||||
|
|
||||||
#endif // AZURE_SERVER_H
|
#endif // AZURE_SERVER_H
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,466 +1,466 @@
|
|||||||
// SoftEther VPN Source Code - Developer Edition Master Branch
|
// SoftEther VPN Source Code - Developer Edition Master Branch
|
||||||
// Cedar Communication Module
|
// Cedar Communication Module
|
||||||
|
|
||||||
|
|
||||||
// Bridge.c
|
// Bridge.c
|
||||||
// Ethernet Bridge Program (Local Bridge)
|
// Ethernet Bridge Program (Local Bridge)
|
||||||
|
|
||||||
#include <GlobalConst.h>
|
#include <GlobalConst.h>
|
||||||
|
|
||||||
#define BRIDGE_C
|
#define BRIDGE_C
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#define OS_WIN32
|
#define OS_WIN32
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef OS_WIN32
|
#ifdef OS_WIN32
|
||||||
|
|
||||||
// Win32
|
// Win32
|
||||||
#include "BridgeWin32.c"
|
#include "BridgeWin32.c"
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
// Unix
|
// Unix
|
||||||
#include "BridgeUnix.c"
|
#include "BridgeUnix.c"
|
||||||
|
|
||||||
#endif // OS_WIN32
|
#endif // OS_WIN32
|
||||||
|
|
||||||
// Hash the list of current Ethernet devices
|
// Hash the list of current Ethernet devices
|
||||||
UINT GetEthDeviceHash()
|
UINT GetEthDeviceHash()
|
||||||
{
|
{
|
||||||
#ifdef OS_UNIX
|
#ifdef OS_UNIX
|
||||||
// UNIX
|
// UNIX
|
||||||
UINT num = 0;
|
UINT num = 0;
|
||||||
UINT i;
|
UINT i;
|
||||||
char tmp[4096];
|
char tmp[4096];
|
||||||
UCHAR hash[SHA1_SIZE];
|
UCHAR hash[SHA1_SIZE];
|
||||||
TOKEN_LIST *t = GetEthList();
|
TOKEN_LIST *t = GetEthList();
|
||||||
|
|
||||||
tmp[0] = 0;
|
tmp[0] = 0;
|
||||||
|
|
||||||
if (t != NULL)
|
if (t != NULL)
|
||||||
{
|
{
|
||||||
num = t->NumTokens;
|
num = t->NumTokens;
|
||||||
for (i = 0; i < t->NumTokens; i++)
|
for (i = 0; i < t->NumTokens; i++)
|
||||||
{
|
{
|
||||||
StrCat(tmp, sizeof(tmp), t->Token[i]);
|
StrCat(tmp, sizeof(tmp), t->Token[i]);
|
||||||
}
|
}
|
||||||
FreeToken(t);
|
FreeToken(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
Sha0(hash, tmp, StrLen(tmp));
|
Sha0(hash, tmp, StrLen(tmp));
|
||||||
|
|
||||||
Copy(&num, hash, sizeof(UINT));
|
Copy(&num, hash, sizeof(UINT));
|
||||||
|
|
||||||
return num;
|
return num;
|
||||||
#else // OS_UNIX
|
#else // OS_UNIX
|
||||||
// Win32
|
// Win32
|
||||||
UINT ret = 0;
|
UINT ret = 0;
|
||||||
MS_ADAPTER_LIST *a = MsCreateAdapterListEx(true);
|
MS_ADAPTER_LIST *a = MsCreateAdapterListEx(true);
|
||||||
UINT num;
|
UINT num;
|
||||||
UINT i;
|
UINT i;
|
||||||
char tmp[4096];
|
char tmp[4096];
|
||||||
UCHAR hash[SHA1_SIZE];
|
UCHAR hash[SHA1_SIZE];
|
||||||
|
|
||||||
tmp[0] = 0;
|
tmp[0] = 0;
|
||||||
if (a != NULL)
|
if (a != NULL)
|
||||||
{
|
{
|
||||||
for (i = 0;i < a->Num;i++)
|
for (i = 0;i < a->Num;i++)
|
||||||
{
|
{
|
||||||
StrCat(tmp, sizeof(tmp), a->Adapters[i]->Title);
|
StrCat(tmp, sizeof(tmp), a->Adapters[i]->Title);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MsFreeAdapterList(a);
|
MsFreeAdapterList(a);
|
||||||
|
|
||||||
Sha0(hash, tmp, StrLen(tmp));
|
Sha0(hash, tmp, StrLen(tmp));
|
||||||
|
|
||||||
Copy(&num, hash, sizeof(UINT));
|
Copy(&num, hash, sizeof(UINT));
|
||||||
|
|
||||||
return num;
|
return num;
|
||||||
#endif // OS_UNIX
|
#endif // OS_UNIX
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get whether WinPcap is needed
|
// Get whether WinPcap is needed
|
||||||
bool IsNeedWinPcap()
|
bool IsNeedWinPcap()
|
||||||
{
|
{
|
||||||
if (IsBridgeSupported() == false)
|
if (IsBridgeSupported() == false)
|
||||||
{
|
{
|
||||||
// Not in Windows
|
// Not in Windows
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Windows
|
// Windows
|
||||||
if (IsEthSupported())
|
if (IsEthSupported())
|
||||||
{
|
{
|
||||||
// Already success to access the Ethernet device
|
// Already success to access the Ethernet device
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Failed to access the Ethernet device
|
// Failed to access the Ethernet device
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get whether the local-bridging is supported by current OS
|
// Get whether the local-bridging is supported by current OS
|
||||||
bool IsBridgeSupported()
|
bool IsBridgeSupported()
|
||||||
{
|
{
|
||||||
UINT type = GetOsInfo()->OsType;
|
UINT type = GetOsInfo()->OsType;
|
||||||
|
|
||||||
if (OS_IS_WINDOWS(type))
|
if (OS_IS_WINDOWS(type))
|
||||||
{
|
{
|
||||||
if (IsEthSupported())
|
if (IsEthSupported())
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
|
|
||||||
#ifdef OS_WIN32
|
#ifdef OS_WIN32
|
||||||
ret = MsIsAdmin();
|
ret = MsIsAdmin();
|
||||||
#endif // OS_WIN32
|
#endif // OS_WIN32
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return IsEthSupported();
|
return IsEthSupported();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delete a local-bridge
|
// Delete a local-bridge
|
||||||
bool DeleteLocalBridge(CEDAR *c, char *hubname, char *devicename)
|
bool DeleteLocalBridge(CEDAR *c, char *hubname, char *devicename)
|
||||||
{
|
{
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
// Validate arguments
|
// Validate arguments
|
||||||
if (c == NULL || hubname == NULL || devicename == NULL)
|
if (c == NULL || hubname == NULL || devicename == NULL)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
LockList(c->HubList);
|
LockList(c->HubList);
|
||||||
{
|
{
|
||||||
LockList(c->LocalBridgeList);
|
LockList(c->LocalBridgeList);
|
||||||
{
|
{
|
||||||
UINT i;
|
UINT i;
|
||||||
|
|
||||||
for (i = 0;i < LIST_NUM(c->LocalBridgeList);i++)
|
for (i = 0;i < LIST_NUM(c->LocalBridgeList);i++)
|
||||||
{
|
{
|
||||||
LOCALBRIDGE *br = LIST_DATA(c->LocalBridgeList, i);
|
LOCALBRIDGE *br = LIST_DATA(c->LocalBridgeList, i);
|
||||||
|
|
||||||
if (StrCmpi(br->HubName, hubname) == 0)
|
if (StrCmpi(br->HubName, hubname) == 0)
|
||||||
{
|
{
|
||||||
if (StrCmpi(br->DeviceName, devicename) == 0)
|
if (StrCmpi(br->DeviceName, devicename) == 0)
|
||||||
{
|
{
|
||||||
if (br->Bridge != NULL)
|
if (br->Bridge != NULL)
|
||||||
{
|
{
|
||||||
BrFreeBridge(br->Bridge);
|
BrFreeBridge(br->Bridge);
|
||||||
br->Bridge = NULL;
|
br->Bridge = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
Delete(c->LocalBridgeList, br);
|
Delete(c->LocalBridgeList, br);
|
||||||
Free(br);
|
Free(br);
|
||||||
|
|
||||||
ret = true;
|
ret = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
UnlockList(c->LocalBridgeList);
|
UnlockList(c->LocalBridgeList);
|
||||||
}
|
}
|
||||||
UnlockList(c->HubList);
|
UnlockList(c->HubList);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add a local-bridge
|
// Add a local-bridge
|
||||||
void AddLocalBridge(CEDAR *c, char *hubname, char *devicename, bool local, bool monitor, bool tapmode, char *tapaddr, bool limit_broadcast)
|
void AddLocalBridge(CEDAR *c, char *hubname, char *devicename, bool local, bool monitor, bool tapmode, char *tapaddr, bool limit_broadcast)
|
||||||
{
|
{
|
||||||
UINT i;
|
UINT i;
|
||||||
HUB *h = NULL;
|
HUB *h = NULL;
|
||||||
LOCALBRIDGE *br = NULL;
|
LOCALBRIDGE *br = NULL;
|
||||||
// Validate arguments
|
// Validate arguments
|
||||||
if (c == NULL || hubname == NULL || devicename == NULL)
|
if (c == NULL || hubname == NULL || devicename == NULL)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (OS_IS_UNIX(GetOsInfo()->OsType) == false)
|
if (OS_IS_UNIX(GetOsInfo()->OsType) == false)
|
||||||
{
|
{
|
||||||
tapmode = false;
|
tapmode = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
LockList(c->HubList);
|
LockList(c->HubList);
|
||||||
{
|
{
|
||||||
LockList(c->LocalBridgeList);
|
LockList(c->LocalBridgeList);
|
||||||
{
|
{
|
||||||
bool exists = false;
|
bool exists = false;
|
||||||
|
|
||||||
// Ensure that the same configuration local-bridge doesn't exist already
|
// Ensure that the same configuration local-bridge doesn't exist already
|
||||||
for (i = 0;i < LIST_NUM(c->LocalBridgeList);i++)
|
for (i = 0;i < LIST_NUM(c->LocalBridgeList);i++)
|
||||||
{
|
{
|
||||||
LOCALBRIDGE *br = LIST_DATA(c->LocalBridgeList, i);
|
LOCALBRIDGE *br = LIST_DATA(c->LocalBridgeList, i);
|
||||||
if (StrCmpi(br->DeviceName, devicename) == 0)
|
if (StrCmpi(br->DeviceName, devicename) == 0)
|
||||||
{
|
{
|
||||||
if (StrCmpi(br->HubName, hubname) == 0)
|
if (StrCmpi(br->HubName, hubname) == 0)
|
||||||
{
|
{
|
||||||
if (br->TapMode == tapmode)
|
if (br->TapMode == tapmode)
|
||||||
{
|
{
|
||||||
exists = true;
|
exists = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (exists == false)
|
if (exists == false)
|
||||||
{
|
{
|
||||||
// Add configuration
|
// Add configuration
|
||||||
br = ZeroMalloc(sizeof(LOCALBRIDGE));
|
br = ZeroMalloc(sizeof(LOCALBRIDGE));
|
||||||
StrCpy(br->HubName, sizeof(br->HubName), hubname);
|
StrCpy(br->HubName, sizeof(br->HubName), hubname);
|
||||||
StrCpy(br->DeviceName, sizeof(br->DeviceName), devicename);
|
StrCpy(br->DeviceName, sizeof(br->DeviceName), devicename);
|
||||||
br->Bridge = NULL;
|
br->Bridge = NULL;
|
||||||
br->Local = local;
|
br->Local = local;
|
||||||
br->TapMode = tapmode;
|
br->TapMode = tapmode;
|
||||||
br->LimitBroadcast = limit_broadcast;
|
br->LimitBroadcast = limit_broadcast;
|
||||||
br->Monitor = monitor;
|
br->Monitor = monitor;
|
||||||
if (br->TapMode)
|
if (br->TapMode)
|
||||||
{
|
{
|
||||||
if (tapaddr != NULL && IsZero(tapaddr, 6) == false)
|
if (tapaddr != NULL && IsZero(tapaddr, 6) == false)
|
||||||
{
|
{
|
||||||
Copy(br->TapMacAddress, tapaddr, 6);
|
Copy(br->TapMacAddress, tapaddr, 6);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GenMacAddress(br->TapMacAddress);
|
GenMacAddress(br->TapMacAddress);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Add(c->LocalBridgeList, br);
|
Add(c->LocalBridgeList, br);
|
||||||
|
|
||||||
// Find the hub
|
// Find the hub
|
||||||
for (i = 0;i < LIST_NUM(c->HubList);i++)
|
for (i = 0;i < LIST_NUM(c->HubList);i++)
|
||||||
{
|
{
|
||||||
HUB *hub = LIST_DATA(c->HubList, i);
|
HUB *hub = LIST_DATA(c->HubList, i);
|
||||||
if (StrCmpi(hub->Name, br->HubName) == 0)
|
if (StrCmpi(hub->Name, br->HubName) == 0)
|
||||||
{
|
{
|
||||||
h = hub;
|
h = hub;
|
||||||
AddRef(h->ref);
|
AddRef(h->ref);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
UnlockList(c->LocalBridgeList);
|
UnlockList(c->LocalBridgeList);
|
||||||
}
|
}
|
||||||
UnlockList(c->HubList);
|
UnlockList(c->HubList);
|
||||||
|
|
||||||
// Start the local-bridge immediately
|
// Start the local-bridge immediately
|
||||||
if (h != NULL && br != NULL && h->Type != HUB_TYPE_FARM_DYNAMIC)
|
if (h != NULL && br != NULL && h->Type != HUB_TYPE_FARM_DYNAMIC)
|
||||||
{
|
{
|
||||||
Lock(h->lock_online);
|
Lock(h->lock_online);
|
||||||
{
|
{
|
||||||
if (h->Offline == false)
|
if (h->Offline == false)
|
||||||
{
|
{
|
||||||
LockList(c->LocalBridgeList);
|
LockList(c->LocalBridgeList);
|
||||||
{
|
{
|
||||||
if (IsInList(c->LocalBridgeList, br))
|
if (IsInList(c->LocalBridgeList, br))
|
||||||
{
|
{
|
||||||
if (br->Bridge == NULL)
|
if (br->Bridge == NULL)
|
||||||
{
|
{
|
||||||
br->Bridge = BrNewBridge(h, br->DeviceName, NULL, br->Local, br->Monitor, br->TapMode, br->TapMacAddress, br->LimitBroadcast, br);
|
br->Bridge = BrNewBridge(h, br->DeviceName, NULL, br->Local, br->Monitor, br->TapMode, br->TapMacAddress, br->LimitBroadcast, br);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
UnlockList(c->LocalBridgeList);
|
UnlockList(c->LocalBridgeList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Unlock(h->lock_online);
|
Unlock(h->lock_online);
|
||||||
}
|
}
|
||||||
|
|
||||||
ReleaseHub(h);
|
ReleaseHub(h);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialize the local-bridge list
|
// Initialize the local-bridge list
|
||||||
void InitLocalBridgeList(CEDAR *c)
|
void InitLocalBridgeList(CEDAR *c)
|
||||||
{
|
{
|
||||||
// Validate arguments
|
// Validate arguments
|
||||||
if (c == NULL)
|
if (c == NULL)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
c->LocalBridgeList = NewList(NULL);
|
c->LocalBridgeList = NewList(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Free the local-bridge list
|
// Free the local-bridge list
|
||||||
void FreeLocalBridgeList(CEDAR *c)
|
void FreeLocalBridgeList(CEDAR *c)
|
||||||
{
|
{
|
||||||
UINT i;
|
UINT i;
|
||||||
// Validate arguments
|
// Validate arguments
|
||||||
if (c == NULL)
|
if (c == NULL)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0;i < LIST_NUM(c->LocalBridgeList);i++)
|
for (i = 0;i < LIST_NUM(c->LocalBridgeList);i++)
|
||||||
{
|
{
|
||||||
LOCALBRIDGE *br = LIST_DATA(c->LocalBridgeList, i);
|
LOCALBRIDGE *br = LIST_DATA(c->LocalBridgeList, i);
|
||||||
Free(br);
|
Free(br);
|
||||||
}
|
}
|
||||||
|
|
||||||
ReleaseList(c->LocalBridgeList);
|
ReleaseList(c->LocalBridgeList);
|
||||||
c->LocalBridgeList = NULL;
|
c->LocalBridgeList = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bridging thread
|
// Bridging thread
|
||||||
void BrBridgeThread(THREAD *thread, void *param)
|
void BrBridgeThread(THREAD *thread, void *param)
|
||||||
{
|
{
|
||||||
BRIDGE *b;
|
BRIDGE *b;
|
||||||
CONNECTION *c;
|
CONNECTION *c;
|
||||||
SESSION *s;
|
SESSION *s;
|
||||||
HUB *h;
|
HUB *h;
|
||||||
char name[MAX_SIZE];
|
char name[MAX_SIZE];
|
||||||
// Validate arguments
|
// Validate arguments
|
||||||
if (thread == NULL || param == NULL)
|
if (thread == NULL || param == NULL)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
b = (BRIDGE *)param;
|
b = (BRIDGE *)param;
|
||||||
|
|
||||||
// Create a connection object
|
// Create a connection object
|
||||||
c = NewServerConnection(b->Cedar, NULL, thread);
|
c = NewServerConnection(b->Cedar, NULL, thread);
|
||||||
c->Protocol = CONNECTION_HUB_BRIDGE;
|
c->Protocol = CONNECTION_HUB_BRIDGE;
|
||||||
|
|
||||||
// Create a session object
|
// Create a session object
|
||||||
s = NewServerSession(b->Cedar, c, b->Hub, BRIDGE_USER_NAME, b->Policy);
|
s = NewServerSession(b->Cedar, c, b->Hub, BRIDGE_USER_NAME, b->Policy);
|
||||||
HLog(b->Hub, "LH_START_BRIDGE", b->Name, s->Name);
|
HLog(b->Hub, "LH_START_BRIDGE", b->Name, s->Name);
|
||||||
StrCpy(name, sizeof(name), b->Name);
|
StrCpy(name, sizeof(name), b->Name);
|
||||||
h = b->Hub;
|
h = b->Hub;
|
||||||
AddRef(h->ref);
|
AddRef(h->ref);
|
||||||
s->BridgeMode = true;
|
s->BridgeMode = true;
|
||||||
s->Bridge = b;
|
s->Bridge = b;
|
||||||
c->Session = s;
|
c->Session = s;
|
||||||
ReleaseConnection(c);
|
ReleaseConnection(c);
|
||||||
|
|
||||||
// Dummy user name for local-bridge
|
// Dummy user name for local-bridge
|
||||||
s->Username = CopyStr(BRIDGE_USER_NAME_PRINT);
|
s->Username = CopyStr(BRIDGE_USER_NAME_PRINT);
|
||||||
|
|
||||||
b->Session = s;
|
b->Session = s;
|
||||||
AddRef(s->ref);
|
AddRef(s->ref);
|
||||||
|
|
||||||
// Notify completion
|
// Notify completion
|
||||||
NoticeThreadInit(thread);
|
NoticeThreadInit(thread);
|
||||||
|
|
||||||
// Main procedure of the session
|
// Main procedure of the session
|
||||||
Debug("Bridge %s Start.\n", b->Name);
|
Debug("Bridge %s Start.\n", b->Name);
|
||||||
SessionMain(s);
|
SessionMain(s);
|
||||||
Debug("Bridge %s Stop.\n", b->Name);
|
Debug("Bridge %s Stop.\n", b->Name);
|
||||||
|
|
||||||
HLog(h, "LH_STOP_BRIDGE", name);
|
HLog(h, "LH_STOP_BRIDGE", name);
|
||||||
|
|
||||||
ReleaseHub(h);
|
ReleaseHub(h);
|
||||||
|
|
||||||
ReleaseSession(s);
|
ReleaseSession(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Free the local-bridge object
|
// Free the local-bridge object
|
||||||
void BrFreeBridge(BRIDGE *b)
|
void BrFreeBridge(BRIDGE *b)
|
||||||
{
|
{
|
||||||
// Validate arguments
|
// Validate arguments
|
||||||
if (b == NULL)
|
if (b == NULL)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (b->ParentLocalBridge != NULL)
|
if (b->ParentLocalBridge != NULL)
|
||||||
{
|
{
|
||||||
b->ParentLocalBridge = NULL;
|
b->ParentLocalBridge = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stop session thread
|
// Stop session thread
|
||||||
StopSession(b->Session);
|
StopSession(b->Session);
|
||||||
ReleaseSession(b->Session);
|
ReleaseSession(b->Session);
|
||||||
|
|
||||||
Free(b);
|
Free(b);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create new local-bridge
|
// Create new local-bridge
|
||||||
BRIDGE *BrNewBridge(HUB *h, char *name, POLICY *p, bool local, bool monitor, bool tapmode, char *tapaddr, bool limit_broadcast, LOCALBRIDGE *parent_local_bridge)
|
BRIDGE *BrNewBridge(HUB *h, char *name, POLICY *p, bool local, bool monitor, bool tapmode, char *tapaddr, bool limit_broadcast, LOCALBRIDGE *parent_local_bridge)
|
||||||
{
|
{
|
||||||
BRIDGE *b;
|
BRIDGE *b;
|
||||||
POLICY *policy;
|
POLICY *policy;
|
||||||
THREAD *t;
|
THREAD *t;
|
||||||
// Validate arguments
|
// Validate arguments
|
||||||
if (h == NULL || name == NULL || parent_local_bridge == NULL)
|
if (h == NULL || name == NULL || parent_local_bridge == NULL)
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p == NULL)
|
if (p == NULL)
|
||||||
{
|
{
|
||||||
policy = ClonePolicy(GetDefaultPolicy());
|
policy = ClonePolicy(GetDefaultPolicy());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
policy = ClonePolicy(p);
|
policy = ClonePolicy(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
b = ZeroMalloc(sizeof(BRIDGE));
|
b = ZeroMalloc(sizeof(BRIDGE));
|
||||||
b->Cedar = h->Cedar;
|
b->Cedar = h->Cedar;
|
||||||
b->Hub = h;
|
b->Hub = h;
|
||||||
StrCpy(b->Name, sizeof(b->Name), name);
|
StrCpy(b->Name, sizeof(b->Name), name);
|
||||||
b->Policy = policy;
|
b->Policy = policy;
|
||||||
b->Local = local;
|
b->Local = local;
|
||||||
b->Monitor = monitor;
|
b->Monitor = monitor;
|
||||||
b->TapMode = tapmode;
|
b->TapMode = tapmode;
|
||||||
b->LimitBroadcast = limit_broadcast;
|
b->LimitBroadcast = limit_broadcast;
|
||||||
b->ParentLocalBridge = parent_local_bridge;
|
b->ParentLocalBridge = parent_local_bridge;
|
||||||
|
|
||||||
if (b->TapMode)
|
if (b->TapMode)
|
||||||
{
|
{
|
||||||
if (tapaddr != NULL && IsZero(tapaddr, 6) == false)
|
if (tapaddr != NULL && IsZero(tapaddr, 6) == false)
|
||||||
{
|
{
|
||||||
Copy(b->TapMacAddress, tapaddr, 6);
|
Copy(b->TapMacAddress, tapaddr, 6);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GenMacAddress(b->TapMacAddress);
|
GenMacAddress(b->TapMacAddress);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (monitor)
|
if (monitor)
|
||||||
{
|
{
|
||||||
// Enabling monitoring mode
|
// Enabling monitoring mode
|
||||||
policy->MonitorPort = true;
|
policy->MonitorPort = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (b->LimitBroadcast == false)
|
if (b->LimitBroadcast == false)
|
||||||
{
|
{
|
||||||
// Disable broadcast limiter
|
// Disable broadcast limiter
|
||||||
policy->NoBroadcastLimiter = true;
|
policy->NoBroadcastLimiter = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start thread
|
// Start thread
|
||||||
t = NewThread(BrBridgeThread, b);
|
t = NewThread(BrBridgeThread, b);
|
||||||
WaitThreadInit(t);
|
WaitThreadInit(t);
|
||||||
ReleaseThread(t);
|
ReleaseThread(t);
|
||||||
|
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Raw IP bridge is supported only on Linux
|
// Raw IP bridge is supported only on Linux
|
||||||
bool IsRawIpBridgeSupported()
|
bool IsRawIpBridgeSupported()
|
||||||
{
|
{
|
||||||
#ifdef UNIX_LINUX
|
#ifdef UNIX_LINUX
|
||||||
return true;
|
return true;
|
||||||
#else // UNIX_LINUX
|
#else // UNIX_LINUX
|
||||||
return false;
|
return false;
|
||||||
#endif // UNIX_LINUX
|
#endif // UNIX_LINUX
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,76 +1,76 @@
|
|||||||
// SoftEther VPN Source Code - Developer Edition Master Branch
|
// SoftEther VPN Source Code - Developer Edition Master Branch
|
||||||
// Cedar Communication Module
|
// Cedar Communication Module
|
||||||
|
|
||||||
|
|
||||||
// Bridge.h
|
// Bridge.h
|
||||||
// Header of Bridge.c
|
// Header of Bridge.c
|
||||||
|
|
||||||
#ifndef BRIDGE_H
|
#ifndef BRIDGE_H
|
||||||
#define BRIDGE_H
|
#define BRIDGE_H
|
||||||
|
|
||||||
#ifdef OS_WIN32
|
#ifdef OS_WIN32
|
||||||
|
|
||||||
// For Win32
|
// For Win32
|
||||||
#include <Cedar/BridgeWin32.h>
|
#include <Cedar/BridgeWin32.h>
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
// For Unix
|
// For Unix
|
||||||
#include <Cedar/BridgeUnix.h>
|
#include <Cedar/BridgeUnix.h>
|
||||||
|
|
||||||
#endif // OS_WIN32
|
#endif // OS_WIN32
|
||||||
|
|
||||||
// Constants
|
// Constants
|
||||||
#define BRIDGE_SPECIAL_IPRAW_NAME "ipv4_rawsocket_virtual_router"
|
#define BRIDGE_SPECIAL_IPRAW_NAME "ipv4_rawsocket_virtual_router"
|
||||||
|
|
||||||
// Bridge
|
// Bridge
|
||||||
struct BRIDGE
|
struct BRIDGE
|
||||||
{
|
{
|
||||||
bool Active; // Status
|
bool Active; // Status
|
||||||
CEDAR *Cedar; // Cedar
|
CEDAR *Cedar; // Cedar
|
||||||
HUB *Hub; // HUB
|
HUB *Hub; // HUB
|
||||||
SESSION *Session; // Session
|
SESSION *Session; // Session
|
||||||
POLICY *Policy; // Policy
|
POLICY *Policy; // Policy
|
||||||
ETH *Eth; // Ethernet
|
ETH *Eth; // Ethernet
|
||||||
char Name[MAX_SIZE]; // Device name
|
char Name[MAX_SIZE]; // Device name
|
||||||
UINT64 LastBridgeTry; // Time to try to bridge at last
|
UINT64 LastBridgeTry; // Time to try to bridge at last
|
||||||
bool Local; // Local mode
|
bool Local; // Local mode
|
||||||
bool Monitor; // Monitor mode
|
bool Monitor; // Monitor mode
|
||||||
bool TapMode; // Tap mode
|
bool TapMode; // Tap mode
|
||||||
bool LimitBroadcast; // Broadcasts limiting mode
|
bool LimitBroadcast; // Broadcasts limiting mode
|
||||||
UCHAR TapMacAddress[6]; // MAC address of the tap
|
UCHAR TapMacAddress[6]; // MAC address of the tap
|
||||||
UINT LastNumDevice; // Number of device (Number of last checked)
|
UINT LastNumDevice; // Number of device (Number of last checked)
|
||||||
UINT64 LastNumDeviceCheck; // Time at which to check the number of devices at last
|
UINT64 LastNumDeviceCheck; // Time at which to check the number of devices at last
|
||||||
UINT64 LastChangeMtuError; // Time that recorded the error to change the MTU at last
|
UINT64 LastChangeMtuError; // Time that recorded the error to change the MTU at last
|
||||||
LOCALBRIDGE *ParentLocalBridge; // Parent Local Bridge
|
LOCALBRIDGE *ParentLocalBridge; // Parent Local Bridge
|
||||||
};
|
};
|
||||||
|
|
||||||
// Local bridge
|
// Local bridge
|
||||||
struct LOCALBRIDGE
|
struct LOCALBRIDGE
|
||||||
{
|
{
|
||||||
char HubName[MAX_HUBNAME_LEN + 1]; // Virtual HUB name
|
char HubName[MAX_HUBNAME_LEN + 1]; // Virtual HUB name
|
||||||
char DeviceName[MAX_SIZE]; // Device name
|
char DeviceName[MAX_SIZE]; // Device name
|
||||||
bool Local; // Local mode
|
bool Local; // Local mode
|
||||||
bool Monitor; // Monitor mode
|
bool Monitor; // Monitor mode
|
||||||
bool TapMode; // Tap mode
|
bool TapMode; // Tap mode
|
||||||
bool LimitBroadcast; // Broadcast packets limiting mode
|
bool LimitBroadcast; // Broadcast packets limiting mode
|
||||||
UCHAR TapMacAddress[6]; // MAC address of the tap
|
UCHAR TapMacAddress[6]; // MAC address of the tap
|
||||||
BRIDGE *Bridge; // Bridge
|
BRIDGE *Bridge; // Bridge
|
||||||
};
|
};
|
||||||
|
|
||||||
BRIDGE *BrNewBridge(HUB *h, char *name, POLICY *p, bool local, bool monitor, bool tapmode, char *tapaddr, bool limit_broadcast, LOCALBRIDGE *parent_local_bridge);
|
BRIDGE *BrNewBridge(HUB *h, char *name, POLICY *p, bool local, bool monitor, bool tapmode, char *tapaddr, bool limit_broadcast, LOCALBRIDGE *parent_local_bridge);
|
||||||
void BrBridgeThread(THREAD *thread, void *param);
|
void BrBridgeThread(THREAD *thread, void *param);
|
||||||
void BrFreeBridge(BRIDGE *b);
|
void BrFreeBridge(BRIDGE *b);
|
||||||
void InitLocalBridgeList(CEDAR *c);
|
void InitLocalBridgeList(CEDAR *c);
|
||||||
void FreeLocalBridgeList(CEDAR *c);
|
void FreeLocalBridgeList(CEDAR *c);
|
||||||
void AddLocalBridge(CEDAR *c, char *hubname, char *devicename, bool local, bool monitor, bool tapmode, char *tapaddr, bool limit_broadcast);
|
void AddLocalBridge(CEDAR *c, char *hubname, char *devicename, bool local, bool monitor, bool tapmode, char *tapaddr, bool limit_broadcast);
|
||||||
bool DeleteLocalBridge(CEDAR *c, char *hubname, char *devicename);
|
bool DeleteLocalBridge(CEDAR *c, char *hubname, char *devicename);
|
||||||
bool IsBridgeSupported();
|
bool IsBridgeSupported();
|
||||||
bool IsNeedWinPcap();
|
bool IsNeedWinPcap();
|
||||||
UINT GetEthDeviceHash();
|
UINT GetEthDeviceHash();
|
||||||
bool IsRawIpBridgeSupported();
|
bool IsRawIpBridgeSupported();
|
||||||
|
|
||||||
#endif // BRIDGE_H
|
#endif // BRIDGE_H
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,133 +1,133 @@
|
|||||||
// SoftEther VPN Source Code - Developer Edition Master Branch
|
// SoftEther VPN Source Code - Developer Edition Master Branch
|
||||||
// Cedar Communication Module
|
// Cedar Communication Module
|
||||||
|
|
||||||
|
|
||||||
// BridgeUnix.h
|
// BridgeUnix.h
|
||||||
// Header of BridgeUnix.c
|
// Header of BridgeUnix.c
|
||||||
|
|
||||||
#ifndef BRIDGEUNIX_H
|
#ifndef BRIDGEUNIX_H
|
||||||
#define BRIDGEUNIX_H
|
#define BRIDGEUNIX_H
|
||||||
|
|
||||||
// Macro
|
// Macro
|
||||||
#ifndef SOL_PACKET
|
#ifndef SOL_PACKET
|
||||||
#define SOL_PACKET 263
|
#define SOL_PACKET 263
|
||||||
#endif
|
#endif
|
||||||
#ifndef ifr_newname
|
#ifndef ifr_newname
|
||||||
#define ifr_newname ifr_ifru.ifru_slave
|
#define ifr_newname ifr_ifru.ifru_slave
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Constants
|
// Constants
|
||||||
#define UNIX_ETH_TMP_BUFFER_SIZE (2000)
|
#define UNIX_ETH_TMP_BUFFER_SIZE (2000)
|
||||||
#define SOLARIS_MAXDLBUF (32768)
|
#define SOLARIS_MAXDLBUF (32768)
|
||||||
#define BRIDGE_MAX_QUEUE_SIZE (4096*1500)
|
#define BRIDGE_MAX_QUEUE_SIZE (4096*1500)
|
||||||
|
|
||||||
// ETH structure
|
// ETH structure
|
||||||
struct ETH
|
struct ETH
|
||||||
{
|
{
|
||||||
char *Name; // Adapter name
|
char *Name; // Adapter name
|
||||||
char *Title; // Adapter title
|
char *Title; // Adapter title
|
||||||
CANCEL *Cancel; // Cancel object
|
CANCEL *Cancel; // Cancel object
|
||||||
int IfIndex; // Index
|
int IfIndex; // Index
|
||||||
int Socket; // Socket
|
int Socket; // Socket
|
||||||
UINT InitialMtu; // Initial MTU value
|
UINT InitialMtu; // Initial MTU value
|
||||||
UINT CurrentMtu; // Current MTU value
|
UINT CurrentMtu; // Current MTU value
|
||||||
int SocketBsdIf; // BSD interface operation socket
|
int SocketBsdIf; // BSD interface operation socket
|
||||||
UCHAR MacAddress[6]; // MAC address
|
UCHAR MacAddress[6]; // MAC address
|
||||||
|
|
||||||
#ifdef BRIDGE_PCAP
|
#ifdef BRIDGE_PCAP
|
||||||
void *Pcap; // Pcap descriptor
|
void *Pcap; // Pcap descriptor
|
||||||
QUEUE *Queue; // Queue of the relay thread
|
QUEUE *Queue; // Queue of the relay thread
|
||||||
UINT QueueSize; // Number of bytes in Queue
|
UINT QueueSize; // Number of bytes in Queue
|
||||||
THREAD *CaptureThread; // Pcap relay thread
|
THREAD *CaptureThread; // Pcap relay thread
|
||||||
#endif // BRIDGE_PCAP
|
#endif // BRIDGE_PCAP
|
||||||
|
|
||||||
#ifdef BRIDGE_BPF
|
#ifdef BRIDGE_BPF
|
||||||
UINT BufSize; // Buffer size to read the BPF (error for other)
|
UINT BufSize; // Buffer size to read the BPF (error for other)
|
||||||
#ifdef BRIDGE_BPF_THREAD
|
#ifdef BRIDGE_BPF_THREAD
|
||||||
QUEUE *Queue; // Queue of the relay thread
|
QUEUE *Queue; // Queue of the relay thread
|
||||||
UINT QueueSize; // Number of bytes in Queue
|
UINT QueueSize; // Number of bytes in Queue
|
||||||
THREAD *CaptureThread; // BPF relay thread
|
THREAD *CaptureThread; // BPF relay thread
|
||||||
#else // BRIDGE_BPF_THREAD
|
#else // BRIDGE_BPF_THREAD
|
||||||
UCHAR *Buffer; // Buffer to read the BPF
|
UCHAR *Buffer; // Buffer to read the BPF
|
||||||
UCHAR *Next;
|
UCHAR *Next;
|
||||||
int Rest;
|
int Rest;
|
||||||
#endif // BRIDGE_BPF_THREAD
|
#endif // BRIDGE_BPF_THREAD
|
||||||
#endif // BRIDGE_BPF
|
#endif // BRIDGE_BPF
|
||||||
|
|
||||||
VLAN *Tap; // tap
|
VLAN *Tap; // tap
|
||||||
bool Linux_IsAuxDataSupported; // Is PACKET_AUXDATA supported
|
bool Linux_IsAuxDataSupported; // Is PACKET_AUXDATA supported
|
||||||
|
|
||||||
bool IsRawIpMode; // RAW IP mode
|
bool IsRawIpMode; // RAW IP mode
|
||||||
SOCK *RawTcp, *RawUdp, *RawIcmp; // RAW sockets
|
SOCK *RawTcp, *RawUdp, *RawIcmp; // RAW sockets
|
||||||
bool RawIp_HasError;
|
bool RawIp_HasError;
|
||||||
UCHAR RawIpMyMacAddr[6];
|
UCHAR RawIpMyMacAddr[6];
|
||||||
UCHAR RawIpYourMacAddr[6];
|
UCHAR RawIpYourMacAddr[6];
|
||||||
IP MyIP;
|
IP MyIP;
|
||||||
IP YourIP;
|
IP YourIP;
|
||||||
QUEUE *RawIpSendQueue;
|
QUEUE *RawIpSendQueue;
|
||||||
IP MyPhysicalIP;
|
IP MyPhysicalIP;
|
||||||
IP MyPhysicalIPForce;
|
IP MyPhysicalIPForce;
|
||||||
UCHAR *RawIP_TmpBuffer;
|
UCHAR *RawIP_TmpBuffer;
|
||||||
UINT RawIP_TmpBufferSize;
|
UINT RawIP_TmpBufferSize;
|
||||||
};
|
};
|
||||||
|
|
||||||
#if defined( BRIDGE_BPF ) || defined( BRIDGE_PCAP )
|
#if defined( BRIDGE_BPF ) || defined( BRIDGE_PCAP )
|
||||||
struct CAPTUREBLOCK{
|
struct CAPTUREBLOCK{
|
||||||
UINT Size;
|
UINT Size;
|
||||||
UCHAR *Buf;
|
UCHAR *Buf;
|
||||||
};
|
};
|
||||||
#endif // BRIDGE_BPF
|
#endif // BRIDGE_BPF
|
||||||
|
|
||||||
|
|
||||||
// Function prototype
|
// Function prototype
|
||||||
void InitEth();
|
void InitEth();
|
||||||
void FreeEth();
|
void FreeEth();
|
||||||
bool IsEthSupported();
|
bool IsEthSupported();
|
||||||
bool IsEthSupportedLinux();
|
bool IsEthSupportedLinux();
|
||||||
bool IsEthSupportedSolaris();
|
bool IsEthSupportedSolaris();
|
||||||
bool IsEthSupportedPcap();
|
bool IsEthSupportedPcap();
|
||||||
TOKEN_LIST *GetEthList();
|
TOKEN_LIST *GetEthList();
|
||||||
TOKEN_LIST *GetEthListEx(UINT *total_num_including_hidden, bool enum_normal, bool enum_rawip);
|
TOKEN_LIST *GetEthListEx(UINT *total_num_including_hidden, bool enum_normal, bool enum_rawip);
|
||||||
TOKEN_LIST *GetEthListLinux(bool enum_normal, bool enum_rawip);
|
TOKEN_LIST *GetEthListLinux(bool enum_normal, bool enum_rawip);
|
||||||
TOKEN_LIST *GetEthListSolaris();
|
TOKEN_LIST *GetEthListSolaris();
|
||||||
TOKEN_LIST *GetEthListPcap();
|
TOKEN_LIST *GetEthListPcap();
|
||||||
ETH *OpenEth(char *name, bool local, bool tapmode, char *tapaddr);
|
ETH *OpenEth(char *name, bool local, bool tapmode, char *tapaddr);
|
||||||
ETH *OpenEthLinux(char *name, bool local, bool tapmode, char *tapaddr);
|
ETH *OpenEthLinux(char *name, bool local, bool tapmode, char *tapaddr);
|
||||||
ETH *OpenEthSolaris(char *name, bool local, bool tapmode, char *tapaddr);
|
ETH *OpenEthSolaris(char *name, bool local, bool tapmode, char *tapaddr);
|
||||||
ETH *OpenEthPcap(char *name, bool local, bool tapmode, char *tapaddr);
|
ETH *OpenEthPcap(char *name, bool local, bool tapmode, char *tapaddr);
|
||||||
bool ParseUnixEthDeviceName(char *dst_devname, UINT dst_devname_size, char *src_name);
|
bool ParseUnixEthDeviceName(char *dst_devname, UINT dst_devname_size, char *src_name);
|
||||||
void CloseEth(ETH *e);
|
void CloseEth(ETH *e);
|
||||||
CANCEL *EthGetCancel(ETH *e);
|
CANCEL *EthGetCancel(ETH *e);
|
||||||
UINT EthGetPacket(ETH *e, void **data);
|
UINT EthGetPacket(ETH *e, void **data);
|
||||||
UINT EthGetPacketLinux(ETH *e, void **data);
|
UINT EthGetPacketLinux(ETH *e, void **data);
|
||||||
UINT EthGetPacketSolaris(ETH *e, void **data);
|
UINT EthGetPacketSolaris(ETH *e, void **data);
|
||||||
UINT EthGetPacketPcap(ETH *e, void **data);
|
UINT EthGetPacketPcap(ETH *e, void **data);
|
||||||
UINT EthGetPacketBpf(ETH *e, void **data);
|
UINT EthGetPacketBpf(ETH *e, void **data);
|
||||||
void EthPutPacket(ETH *e, void *data, UINT size);
|
void EthPutPacket(ETH *e, void *data, UINT size);
|
||||||
void EthPutPackets(ETH *e, UINT num, void **datas, UINT *sizes);
|
void EthPutPackets(ETH *e, UINT num, void **datas, UINT *sizes);
|
||||||
UINT EthGetMtu(ETH *e);
|
UINT EthGetMtu(ETH *e);
|
||||||
bool EthSetMtu(ETH *e, UINT mtu);
|
bool EthSetMtu(ETH *e, UINT mtu);
|
||||||
bool EthIsChangeMtuSupported(ETH *e);
|
bool EthIsChangeMtuSupported(ETH *e);
|
||||||
bool EthGetInterfaceDescriptionUnix(char *name, char *str, UINT size);
|
bool EthGetInterfaceDescriptionUnix(char *name, char *str, UINT size);
|
||||||
bool EthIsInterfaceDescriptionSupportedUnix();
|
bool EthIsInterfaceDescriptionSupportedUnix();
|
||||||
|
|
||||||
ETH *OpenEthLinuxIpRaw();
|
ETH *OpenEthLinuxIpRaw();
|
||||||
void CloseEthLinuxIpRaw(ETH *e);
|
void CloseEthLinuxIpRaw(ETH *e);
|
||||||
UINT EthGetPacketLinuxIpRaw(ETH *e, void **data);
|
UINT EthGetPacketLinuxIpRaw(ETH *e, void **data);
|
||||||
UINT EthGetPacketLinuxIpRawForSock(ETH *e, void **data, SOCK *s, UINT proto);
|
UINT EthGetPacketLinuxIpRawForSock(ETH *e, void **data, SOCK *s, UINT proto);
|
||||||
void EthPutPacketLinuxIpRaw(ETH *e, void *data, UINT size);
|
void EthPutPacketLinuxIpRaw(ETH *e, void *data, UINT size);
|
||||||
bool EthProcessIpPacketInnerIpRaw(ETH *e, PKT *p);
|
bool EthProcessIpPacketInnerIpRaw(ETH *e, PKT *p);
|
||||||
void EthSendIpPacketInnerIpRaw(ETH *e, void *data, UINT size, USHORT protocol);
|
void EthSendIpPacketInnerIpRaw(ETH *e, void *data, UINT size, USHORT protocol);
|
||||||
|
|
||||||
#ifdef UNIX_SOLARIS
|
#ifdef UNIX_SOLARIS
|
||||||
// Function prototype for Solaris
|
// Function prototype for Solaris
|
||||||
bool DlipReceiveAck(int fd);
|
bool DlipReceiveAck(int fd);
|
||||||
bool DlipPromiscuous(int fd, UINT level);
|
bool DlipPromiscuous(int fd, UINT level);
|
||||||
bool DlipBindRequest(int fd);
|
bool DlipBindRequest(int fd);
|
||||||
#endif // OS_SOLARIS
|
#endif // OS_SOLARIS
|
||||||
|
|
||||||
int UnixEthOpenRawSocket();
|
int UnixEthOpenRawSocket();
|
||||||
|
|
||||||
#endif // BRIDGEUNIX_H
|
#endif // BRIDGEUNIX_H
|
||||||
|
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,162 +1,162 @@
|
|||||||
// SoftEther VPN Source Code - Developer Edition Master Branch
|
// SoftEther VPN Source Code - Developer Edition Master Branch
|
||||||
// Cedar Communication Module
|
// Cedar Communication Module
|
||||||
|
|
||||||
|
|
||||||
// BridgeWin32.h
|
// BridgeWin32.h
|
||||||
// Header of BridgeWin32.c
|
// Header of BridgeWin32.c
|
||||||
|
|
||||||
#ifndef BRIDGEWIN32_H
|
#ifndef BRIDGEWIN32_H
|
||||||
#define BRIDGEWIN32_H
|
#define BRIDGEWIN32_H
|
||||||
|
|
||||||
#define BRIDGE_WIN32_PACKET_DLL "Packet.dll"
|
#define BRIDGE_WIN32_PACKET_DLL "Packet.dll"
|
||||||
#define BRIDGE_WIN32_PCD_DLL "|see.dll"
|
#define BRIDGE_WIN32_PCD_DLL "|see.dll"
|
||||||
#define BRIDGE_WIN32_PCD_SYS "|DriverPackages\\See\\x86\\See_x86.sys"
|
#define BRIDGE_WIN32_PCD_SYS "|DriverPackages\\See\\x86\\See_x86.sys"
|
||||||
#define BRIDGE_WIN32_PCD_DLL_X64 "|see_x64.dll"
|
#define BRIDGE_WIN32_PCD_DLL_X64 "|see_x64.dll"
|
||||||
#define BRIDGE_WIN32_PCD_SYS_X64 "|DriverPackages\\See\\x64\\See_x64.sys"
|
#define BRIDGE_WIN32_PCD_SYS_X64 "|DriverPackages\\See\\x64\\See_x64.sys"
|
||||||
#define BRIDGE_WIN32_PCD_REGKEY "SYSTEM\\CurrentControlSet\\services\\SEE"
|
#define BRIDGE_WIN32_PCD_REGKEY "SYSTEM\\CurrentControlSet\\services\\SEE"
|
||||||
#define BRIDGE_WIN32_PCD_BUILDVALUE "CurrentInstalledBuild"
|
#define BRIDGE_WIN32_PCD_BUILDVALUE "CurrentInstalledBuild"
|
||||||
|
|
||||||
#define BRIDGE_WIN32_ETH_BUFFER (1048576)
|
#define BRIDGE_WIN32_ETH_BUFFER (1048576)
|
||||||
|
|
||||||
|
|
||||||
typedef void *HANDLE;
|
typedef void *HANDLE;
|
||||||
|
|
||||||
#ifdef BRIDGE_C
|
#ifdef BRIDGE_C
|
||||||
|
|
||||||
// Header for Internal function (for BridgeWin32.c)
|
// Header for Internal function (for BridgeWin32.c)
|
||||||
typedef struct WP
|
typedef struct WP
|
||||||
{
|
{
|
||||||
bool Inited;
|
bool Inited;
|
||||||
HINSTANCE hPacketDll;
|
HINSTANCE hPacketDll;
|
||||||
PCHAR (*PacketGetVersion)();
|
PCHAR (*PacketGetVersion)();
|
||||||
PCHAR (*PacketGetDriverVersion)();
|
PCHAR (*PacketGetDriverVersion)();
|
||||||
BOOLEAN (*PacketSetMinToCopy)(LPADAPTER AdapterObject,int nbytes);
|
BOOLEAN (*PacketSetMinToCopy)(LPADAPTER AdapterObject,int nbytes);
|
||||||
BOOLEAN (*PacketSetNumWrites)(LPADAPTER AdapterObject,int nwrites);
|
BOOLEAN (*PacketSetNumWrites)(LPADAPTER AdapterObject,int nwrites);
|
||||||
BOOLEAN (*PacketSetMode)(LPADAPTER AdapterObject,int mode);
|
BOOLEAN (*PacketSetMode)(LPADAPTER AdapterObject,int mode);
|
||||||
BOOLEAN (*PacketSetReadTimeout)(LPADAPTER AdapterObject,int timeout);
|
BOOLEAN (*PacketSetReadTimeout)(LPADAPTER AdapterObject,int timeout);
|
||||||
BOOLEAN (*PacketSetBpf)(LPADAPTER AdapterObject,struct bpf_program *fp);
|
BOOLEAN (*PacketSetBpf)(LPADAPTER AdapterObject,struct bpf_program *fp);
|
||||||
INT (*PacketSetSnapLen)(LPADAPTER AdapterObject,int snaplen);
|
INT (*PacketSetSnapLen)(LPADAPTER AdapterObject,int snaplen);
|
||||||
BOOLEAN (*PacketGetStats)(LPADAPTER AdapterObject,struct bpf_stat *s);
|
BOOLEAN (*PacketGetStats)(LPADAPTER AdapterObject,struct bpf_stat *s);
|
||||||
BOOLEAN (*PacketGetStatsEx)(LPADAPTER AdapterObject,struct bpf_stat *s);
|
BOOLEAN (*PacketGetStatsEx)(LPADAPTER AdapterObject,struct bpf_stat *s);
|
||||||
BOOLEAN (*PacketSetBuff)(LPADAPTER AdapterObject,int dim);
|
BOOLEAN (*PacketSetBuff)(LPADAPTER AdapterObject,int dim);
|
||||||
BOOLEAN (*PacketGetNetType)(LPADAPTER AdapterObject,NetType *type);
|
BOOLEAN (*PacketGetNetType)(LPADAPTER AdapterObject,NetType *type);
|
||||||
LPADAPTER (*PacketOpenAdapter)(PCHAR AdapterName);
|
LPADAPTER (*PacketOpenAdapter)(PCHAR AdapterName);
|
||||||
BOOLEAN (*PacketSendPacket)(LPADAPTER AdapterObject,LPPACKET pPacket,BOOLEAN Sync);
|
BOOLEAN (*PacketSendPacket)(LPADAPTER AdapterObject,LPPACKET pPacket,BOOLEAN Sync);
|
||||||
INT (*PacketSendPackets)(LPADAPTER AdapterObject,PVOID PacketBuff,ULONG Size, BOOLEAN Sync);
|
INT (*PacketSendPackets)(LPADAPTER AdapterObject,PVOID PacketBuff,ULONG Size, BOOLEAN Sync);
|
||||||
LPPACKET (*PacketAllocatePacket)(void);
|
LPPACKET (*PacketAllocatePacket)(void);
|
||||||
VOID (*PacketInitPacket)(LPPACKET lpPacket,PVOID Buffer,UINT Length);
|
VOID (*PacketInitPacket)(LPPACKET lpPacket,PVOID Buffer,UINT Length);
|
||||||
VOID (*PacketFreePacket)(LPPACKET lpPacket);
|
VOID (*PacketFreePacket)(LPPACKET lpPacket);
|
||||||
BOOLEAN (*PacketReceivePacket)(LPADAPTER AdapterObject,LPPACKET lpPacket,BOOLEAN Sync);
|
BOOLEAN (*PacketReceivePacket)(LPADAPTER AdapterObject,LPPACKET lpPacket,BOOLEAN Sync);
|
||||||
BOOLEAN (*PacketSetHwFilter)(LPADAPTER AdapterObject,ULONG Filter);
|
BOOLEAN (*PacketSetHwFilter)(LPADAPTER AdapterObject,ULONG Filter);
|
||||||
BOOLEAN (*PacketGetAdapterNames)(PTSTR pStr,PULONG BufferSize);
|
BOOLEAN (*PacketGetAdapterNames)(PTSTR pStr,PULONG BufferSize);
|
||||||
BOOLEAN (*PacketGetNetInfoEx)(PCHAR AdapterName, npf_if_addr* buffer, PLONG NEntries);
|
BOOLEAN (*PacketGetNetInfoEx)(PCHAR AdapterName, npf_if_addr* buffer, PLONG NEntries);
|
||||||
BOOLEAN (*PacketRequest)(LPADAPTER AdapterObject,BOOLEAN Set,PPACKET_OID_DATA OidData);
|
BOOLEAN (*PacketRequest)(LPADAPTER AdapterObject,BOOLEAN Set,PPACKET_OID_DATA OidData);
|
||||||
HANDLE (*PacketGetReadEvent)(LPADAPTER AdapterObject);
|
HANDLE (*PacketGetReadEvent)(LPADAPTER AdapterObject);
|
||||||
BOOLEAN (*PacketSetDumpName)(LPADAPTER AdapterObject, void *name, int len);
|
BOOLEAN (*PacketSetDumpName)(LPADAPTER AdapterObject, void *name, int len);
|
||||||
BOOLEAN (*PacketSetDumpLimits)(LPADAPTER AdapterObject, UINT maxfilesize, UINT maxnpacks);
|
BOOLEAN (*PacketSetDumpLimits)(LPADAPTER AdapterObject, UINT maxfilesize, UINT maxnpacks);
|
||||||
BOOLEAN (*PacketIsDumpEnded)(LPADAPTER AdapterObject, BOOLEAN sync);
|
BOOLEAN (*PacketIsDumpEnded)(LPADAPTER AdapterObject, BOOLEAN sync);
|
||||||
BOOL (*PacketStopDriver)();
|
BOOL (*PacketStopDriver)();
|
||||||
VOID (*PacketCloseAdapter)(LPADAPTER lpAdapter);
|
VOID (*PacketCloseAdapter)(LPADAPTER lpAdapter);
|
||||||
BOOLEAN (*PacketSetLoopbackBehavior)(LPADAPTER AdapterObject, UINT LoopbackBehavior);
|
BOOLEAN (*PacketSetLoopbackBehavior)(LPADAPTER AdapterObject, UINT LoopbackBehavior);
|
||||||
} WP;
|
} WP;
|
||||||
|
|
||||||
// Adapter list
|
// Adapter list
|
||||||
typedef struct WP_ADAPTER
|
typedef struct WP_ADAPTER
|
||||||
{
|
{
|
||||||
char Name[MAX_SIZE];
|
char Name[MAX_SIZE];
|
||||||
char Title[MAX_SIZE];
|
char Title[MAX_SIZE];
|
||||||
char Guid[MAX_SIZE];
|
char Guid[MAX_SIZE];
|
||||||
UINT Id;
|
UINT Id;
|
||||||
} WP_ADAPTER;
|
} WP_ADAPTER;
|
||||||
|
|
||||||
// Internal function prototype
|
// Internal function prototype
|
||||||
void InitEthAdaptersList();
|
void InitEthAdaptersList();
|
||||||
void FreeEthAdaptersList();
|
void FreeEthAdaptersList();
|
||||||
int CompareWpAdapter(void *p1, void *p2);
|
int CompareWpAdapter(void *p1, void *p2);
|
||||||
LIST *GetEthAdapterList();
|
LIST *GetEthAdapterList();
|
||||||
LIST *GetEthAdapterListInternal();
|
LIST *GetEthAdapterListInternal();
|
||||||
bool InitWpWithLoadLibrary(WP *wp, HINSTANCE h);
|
bool InitWpWithLoadLibrary(WP *wp, HINSTANCE h);
|
||||||
bool IsPcdSupported();
|
bool IsPcdSupported();
|
||||||
HINSTANCE InstallPcdDriver();
|
HINSTANCE InstallPcdDriver();
|
||||||
HINSTANCE InstallPcdDriverInternal();
|
HINSTANCE InstallPcdDriverInternal();
|
||||||
UINT LoadPcdDriverBuild();
|
UINT LoadPcdDriverBuild();
|
||||||
void SavePcdDriverBuild(UINT build);
|
void SavePcdDriverBuild(UINT build);
|
||||||
|
|
||||||
#endif // BRIDGE_C
|
#endif // BRIDGE_C
|
||||||
|
|
||||||
typedef struct _ADAPTER ADAPTER;
|
typedef struct _ADAPTER ADAPTER;
|
||||||
typedef struct _PACKET PACKET;
|
typedef struct _PACKET PACKET;
|
||||||
|
|
||||||
// ETH structure
|
// ETH structure
|
||||||
struct ETH
|
struct ETH
|
||||||
{
|
{
|
||||||
char *Name; // Adapter name
|
char *Name; // Adapter name
|
||||||
char *Title; // Adapter title
|
char *Title; // Adapter title
|
||||||
ADAPTER *Adapter; // Adapter
|
ADAPTER *Adapter; // Adapter
|
||||||
CANCEL *Cancel; // Cancel object
|
CANCEL *Cancel; // Cancel object
|
||||||
UCHAR *Buffer; // Buffer
|
UCHAR *Buffer; // Buffer
|
||||||
UINT BufferSize; // Buffer size
|
UINT BufferSize; // Buffer size
|
||||||
PACKET *Packet; // Packet
|
PACKET *Packet; // Packet
|
||||||
PACKET *PutPacket; // Write packet
|
PACKET *PutPacket; // Write packet
|
||||||
QUEUE *PacketQueue; // Packet queue
|
QUEUE *PacketQueue; // Packet queue
|
||||||
UINT64 LastSetSingleCpu; // Date and time set to a single CPU to last
|
UINT64 LastSetSingleCpu; // Date and time set to a single CPU to last
|
||||||
bool LoopbackBlock; // Whether to block the loop back packet
|
bool LoopbackBlock; // Whether to block the loop back packet
|
||||||
bool Empty; // It is empty
|
bool Empty; // It is empty
|
||||||
UCHAR MacAddress[6]; // MAC address
|
UCHAR MacAddress[6]; // MAC address
|
||||||
bool HasFatalError; // A fatal error occurred on the transmission side
|
bool HasFatalError; // A fatal error occurred on the transmission side
|
||||||
|
|
||||||
SU *Su; // SeLow handle
|
SU *Su; // SeLow handle
|
||||||
SU_ADAPTER *SuAdapter; // SeLow adapter handle
|
SU_ADAPTER *SuAdapter; // SeLow adapter handle
|
||||||
|
|
||||||
// Unused
|
// Unused
|
||||||
bool IsRawIpMode; // RAW IP mode
|
bool IsRawIpMode; // RAW IP mode
|
||||||
UCHAR RawIpMyMacAddr[6];
|
UCHAR RawIpMyMacAddr[6];
|
||||||
UCHAR RawIpYourMacAddr[6];
|
UCHAR RawIpYourMacAddr[6];
|
||||||
IP MyPhysicalIPForce;
|
IP MyPhysicalIPForce;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Function prototype
|
// Function prototype
|
||||||
void InitEth();
|
void InitEth();
|
||||||
void FreeEth();
|
void FreeEth();
|
||||||
bool IsEthSupported();
|
bool IsEthSupported();
|
||||||
bool IsEthSupportedInner();
|
bool IsEthSupportedInner();
|
||||||
TOKEN_LIST *GetEthList();
|
TOKEN_LIST *GetEthList();
|
||||||
TOKEN_LIST *GetEthListEx(UINT *total_num_including_hidden, bool enum_normal, bool enum_rawip);
|
TOKEN_LIST *GetEthListEx(UINT *total_num_including_hidden, bool enum_normal, bool enum_rawip);
|
||||||
ETH *OpenEth(char *name, bool local, bool tapmode, char *tapaddr);
|
ETH *OpenEth(char *name, bool local, bool tapmode, char *tapaddr);
|
||||||
ETH *OpenEthInternal(char *name, bool local, bool tapmode, char *tapaddr);
|
ETH *OpenEthInternal(char *name, bool local, bool tapmode, char *tapaddr);
|
||||||
void CloseEth(ETH *e);
|
void CloseEth(ETH *e);
|
||||||
CANCEL *EthGetCancel(ETH *e);
|
CANCEL *EthGetCancel(ETH *e);
|
||||||
UINT EthGetPacket(ETH *e, void **data);
|
UINT EthGetPacket(ETH *e, void **data);
|
||||||
void EthPutPacket(ETH *e, void *data, UINT size);
|
void EthPutPacket(ETH *e, void *data, UINT size);
|
||||||
void EthPutPackets(ETH *e, UINT num, void **datas, UINT *sizes);
|
void EthPutPackets(ETH *e, UINT num, void **datas, UINT *sizes);
|
||||||
void GetEthNetworkConnectionName(wchar_t *dst, UINT size, char *device_name);
|
void GetEthNetworkConnectionName(wchar_t *dst, UINT size, char *device_name);
|
||||||
bool IsWin32BridgeWithSee();
|
bool IsWin32BridgeWithSee();
|
||||||
UINT EthGetMtu(ETH *e);
|
UINT EthGetMtu(ETH *e);
|
||||||
bool EthSetMtu(ETH *e, UINT mtu);
|
bool EthSetMtu(ETH *e, UINT mtu);
|
||||||
bool EthIsChangeMtuSupported(ETH *e);
|
bool EthIsChangeMtuSupported(ETH *e);
|
||||||
|
|
||||||
bool Win32EthIsSuSupported();
|
bool Win32EthIsSuSupported();
|
||||||
|
|
||||||
void Win32EthSetShowAllIf(bool b);
|
void Win32EthSetShowAllIf(bool b);
|
||||||
bool Win32EthGetShowAllIf();
|
bool Win32EthGetShowAllIf();
|
||||||
|
|
||||||
bool EnumEthVLanWin32(RPC_ENUM_ETH_VLAN *t);
|
bool EnumEthVLanWin32(RPC_ENUM_ETH_VLAN *t);
|
||||||
bool GetClassRegKeyWin32(char *key, UINT key_size, char *short_key, UINT short_key_size, char *guid);
|
bool GetClassRegKeyWin32(char *key, UINT key_size, char *short_key, UINT short_key_size, char *guid);
|
||||||
int CmpRpcEnumEthVLan(void *p1, void *p2);
|
int CmpRpcEnumEthVLan(void *p1, void *p2);
|
||||||
void GetVLanSupportStatus(RPC_ENUM_ETH_VLAN_ITEM *e);
|
void GetVLanSupportStatus(RPC_ENUM_ETH_VLAN_ITEM *e);
|
||||||
void GetVLanEnableStatus(RPC_ENUM_ETH_VLAN_ITEM *e);
|
void GetVLanEnableStatus(RPC_ENUM_ETH_VLAN_ITEM *e);
|
||||||
bool SetVLanEnableStatus(char *title, bool enable);
|
bool SetVLanEnableStatus(char *title, bool enable);
|
||||||
RPC_ENUM_ETH_VLAN_ITEM *FindEthVLanItem(RPC_ENUM_ETH_VLAN *t, char *name);
|
RPC_ENUM_ETH_VLAN_ITEM *FindEthVLanItem(RPC_ENUM_ETH_VLAN *t, char *name);
|
||||||
char *SearchDeviceInstanceIdFromShortKey(char *short_key);
|
char *SearchDeviceInstanceIdFromShortKey(char *short_key);
|
||||||
void Win32EthMakeCombinedName(char *dst, UINT dst_size, char *nicname, char *guid);
|
void Win32EthMakeCombinedName(char *dst, UINT dst_size, char *nicname, char *guid);
|
||||||
UINT Win32EthGenIdFromGuid(char *guid);
|
UINT Win32EthGenIdFromGuid(char *guid);
|
||||||
UINT Win32EthGetNameAndIdFromCombinedName(char *name, UINT name_size, char *str);
|
UINT Win32EthGetNameAndIdFromCombinedName(char *name, UINT name_size, char *str);
|
||||||
|
|
||||||
struct WP_ADAPTER *Win32EthSearch(char *name);
|
struct WP_ADAPTER *Win32EthSearch(char *name);
|
||||||
bool Win32IsUsingSeLow();
|
bool Win32IsUsingSeLow();
|
||||||
void Win32SetEnableSeLow(bool b);
|
void Win32SetEnableSeLow(bool b);
|
||||||
bool Win32GetEnableSeLow();
|
bool Win32GetEnableSeLow();
|
||||||
|
|
||||||
#endif // BRIDGEWIN32_H
|
#endif // BRIDGEWIN32_H
|
||||||
|
|
||||||
|
|
||||||
|
25440
src/Cedar/CM.c
25440
src/Cedar/CM.c
File diff suppressed because it is too large
Load Diff
104
src/Cedar/CM.h
104
src/Cedar/CM.h
@ -1,52 +1,52 @@
|
|||||||
// SoftEther VPN Source Code - Developer Edition Master Branch
|
// SoftEther VPN Source Code - Developer Edition Master Branch
|
||||||
// Cedar Communication Module
|
// Cedar Communication Module
|
||||||
|
|
||||||
|
|
||||||
// CM.h
|
// CM.h
|
||||||
// Header of CM.c
|
// Header of CM.c
|
||||||
|
|
||||||
#ifndef CM_H
|
#ifndef CM_H
|
||||||
#define CM_H
|
#define CM_H
|
||||||
|
|
||||||
// Constants
|
// Constants
|
||||||
#define CM_REG_KEY "Software\\" GC_REG_COMPANY_NAME "\\" CEDAR_PRODUCT_STR " VPN\\Client Manager"
|
#define CM_REG_KEY "Software\\" GC_REG_COMPANY_NAME "\\" CEDAR_PRODUCT_STR " VPN\\Client Manager"
|
||||||
#define SECURE_MANAGER_KEY "Software\\" GC_REG_COMPANY_NAME "\\" CEDAR_PRODUCT_STR " VPN\\SmartCard Manager"
|
#define SECURE_MANAGER_KEY "Software\\" GC_REG_COMPANY_NAME "\\" CEDAR_PRODUCT_STR " VPN\\SmartCard Manager"
|
||||||
#define CM_TRAFFIC_REG_KEY "Software\\" GC_REG_COMPANY_NAME "\\" CEDAR_PRODUCT_STR " VPN\\Traffic Test Tool"
|
#define CM_TRAFFIC_REG_KEY "Software\\" GC_REG_COMPANY_NAME "\\" CEDAR_PRODUCT_STR " VPN\\Traffic Test Tool"
|
||||||
#define CM_VGC_REG_KEY "Software\\University of Tsukuba\\VPN Gate Client Plugin"
|
#define CM_VGC_REG_KEY "Software\\University of Tsukuba\\VPN Gate Client Plugin"
|
||||||
|
|
||||||
|
|
||||||
#define CM_TRY_EXEC_UI_HELPER_INTERVAL 5000
|
#define CM_TRY_EXEC_UI_HELPER_INTERVAL 5000
|
||||||
|
|
||||||
#define CM_DEFAULT_WIDTH 800
|
#define CM_DEFAULT_WIDTH 800
|
||||||
#define CM_DEFAULT_HEIGHT 600
|
#define CM_DEFAULT_HEIGHT 600
|
||||||
|
|
||||||
#define WM_CM_NOTIFY (WM_APP + 999)
|
#define WM_CM_NOTIFY (WM_APP + 999)
|
||||||
|
|
||||||
#define CM_IMPORT_FILENAME_MSG 1267
|
#define CM_IMPORT_FILENAME_MSG 1267
|
||||||
#define CM_IMPORT_FILENAME_MSG_OVERWRITE 1268
|
#define CM_IMPORT_FILENAME_MSG_OVERWRITE 1268
|
||||||
|
|
||||||
#define CM_NUM_RECENT 8
|
#define CM_NUM_RECENT 8
|
||||||
|
|
||||||
#define PUBLIC_SERVER_HTML "http://www.softether.com/jp/special/se2hub.aspx"
|
#define PUBLIC_SERVER_HTML "http://www.softether.com/jp/special/se2hub.aspx"
|
||||||
#define PUBLIC_SERVER_HTML_EN "http://www.softether.com/jp/special/se2hub_en.aspx"
|
#define PUBLIC_SERVER_HTML_EN "http://www.softether.com/jp/special/se2hub_en.aspx"
|
||||||
#define PUBLIC_SERVER_TAG L"help:no; status:no; DialogWidth:600px; dialogHeight=700px"
|
#define PUBLIC_SERVER_TAG L"help:no; status:no; DialogWidth:600px; dialogHeight=700px"
|
||||||
#define PUBLIC_SERVER_NAME "public.softether.com"
|
#define PUBLIC_SERVER_NAME "public.softether.com"
|
||||||
|
|
||||||
#define VOICE_SSK 0 // ssk
|
#define VOICE_SSK 0 // ssk
|
||||||
#define VOICE_AHO 1 // aho
|
#define VOICE_AHO 1 // aho
|
||||||
|
|
||||||
// The code for external export
|
// The code for external export
|
||||||
|
|
||||||
// Structure
|
// Structure
|
||||||
|
|
||||||
// Function prototype
|
// Function prototype
|
||||||
void CMExec();
|
void CMExec();
|
||||||
void CmTraffic(HWND hWnd);
|
void CmTraffic(HWND hWnd);
|
||||||
void *CmStartUacHelper();
|
void *CmStartUacHelper();
|
||||||
void CmStopUacHelper(void *p);
|
void CmStopUacHelper(void *p);
|
||||||
void *CmExecUiHelperMain();
|
void *CmExecUiHelperMain();
|
||||||
UINT CmGetSecureBitmapId(char *dest_hostname);
|
UINT CmGetSecureBitmapId(char *dest_hostname);
|
||||||
|
|
||||||
#endif // CM_H
|
#endif // CM_H
|
||||||
|
|
||||||
|
|
||||||
|
1090
src/Cedar/CMInner.h
1090
src/Cedar/CMInner.h
File diff suppressed because it is too large
Load Diff
3236
src/Cedar/Cedar.c
3236
src/Cedar/Cedar.c
File diff suppressed because it is too large
Load Diff
2372
src/Cedar/Cedar.h
2372
src/Cedar/Cedar.h
File diff suppressed because it is too large
Load Diff
@ -1,9 +1,9 @@
|
|||||||
// SoftEther VPN Source Code - Developer Edition Master Branch
|
// SoftEther VPN Source Code - Developer Edition Master Branch
|
||||||
// Cedar Communication Module
|
// Cedar Communication Module
|
||||||
|
|
||||||
|
|
||||||
// CedarPch.c
|
// CedarPch.c
|
||||||
// Cedar Pre-compile Header Generating Code
|
// Cedar Pre-compile Header Generating Code
|
||||||
|
|
||||||
#include "CedarPch.h"
|
#include "CedarPch.h"
|
||||||
|
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
// SoftEther VPN Source Code - Developer Edition Master Branch
|
// SoftEther VPN Source Code - Developer Edition Master Branch
|
||||||
// Cedar Communication Module
|
// Cedar Communication Module
|
||||||
|
|
||||||
|
|
||||||
// CedarPch.h
|
// CedarPch.h
|
||||||
// Header file for grecompile header generation for Cedar
|
// Header file for grecompile header generation for Cedar
|
||||||
|
|
||||||
#include <GlobalConst.h>
|
#include <GlobalConst.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <wchar.h>
|
#include <wchar.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#include <Mayaqua/Mayaqua.h>
|
#include <Mayaqua/Mayaqua.h>
|
||||||
#include <Cedar/Cedar.h>
|
#include <Cedar/Cedar.h>
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
21644
src/Cedar/Client.c
21644
src/Cedar/Client.c
File diff suppressed because it is too large
Load Diff
1520
src/Cedar/Client.h
1520
src/Cedar/Client.h
File diff suppressed because it is too large
Load Diff
49140
src/Cedar/Command.c
49140
src/Cedar/Command.c
File diff suppressed because it is too large
Load Diff
1198
src/Cedar/Command.h
1198
src/Cedar/Command.h
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,273 +1,273 @@
|
|||||||
// SoftEther VPN Source Code - Developer Edition Master Branch
|
// SoftEther VPN Source Code - Developer Edition Master Branch
|
||||||
// Cedar Communication Module
|
// Cedar Communication Module
|
||||||
// © 2020 Nokia
|
// © 2020 Nokia
|
||||||
|
|
||||||
// Connection.h
|
// Connection.h
|
||||||
// Header of Connection.c
|
// Header of Connection.c
|
||||||
|
|
||||||
#ifndef CONNECTION_H
|
#ifndef CONNECTION_H
|
||||||
#define CONNECTION_H
|
#define CONNECTION_H
|
||||||
|
|
||||||
// Magic number indicating that the packet is compressed
|
// Magic number indicating that the packet is compressed
|
||||||
#define CONNECTION_BULK_COMPRESS_SIGNATURE 0xDEADBEEFCAFEFACEULL
|
#define CONNECTION_BULK_COMPRESS_SIGNATURE 0xDEADBEEFCAFEFACEULL
|
||||||
|
|
||||||
#define KEEP_ALIVE_STRING "Internet Connection Keep Alive Packet"
|
#define KEEP_ALIVE_STRING "Internet Connection Keep Alive Packet"
|
||||||
|
|
||||||
#define UPDATE_LAST_COMM_TIME(v, n) {if ((v) <= (n)) { v = (n); } }
|
#define UPDATE_LAST_COMM_TIME(v, n) {if ((v) <= (n)) { v = (n); } }
|
||||||
|
|
||||||
// KEEP CONNECT structure
|
// KEEP CONNECT structure
|
||||||
struct KEEP
|
struct KEEP
|
||||||
{
|
{
|
||||||
LOCK *lock; // Lock
|
LOCK *lock; // Lock
|
||||||
bool Server; // Server mode
|
bool Server; // Server mode
|
||||||
volatile bool Halt; // Stop flag
|
volatile bool Halt; // Stop flag
|
||||||
bool Enable; // Enable flag
|
bool Enable; // Enable flag
|
||||||
char ServerName[MAX_HOST_NAME_LEN + 1]; // Server name
|
char ServerName[MAX_HOST_NAME_LEN + 1]; // Server name
|
||||||
UINT ServerPort; // Server port number
|
UINT ServerPort; // Server port number
|
||||||
bool UdpMode; // UDP mode
|
bool UdpMode; // UDP mode
|
||||||
UINT Interval; // Packet transmission interval
|
UINT Interval; // Packet transmission interval
|
||||||
THREAD *Thread; // Connection thread
|
THREAD *Thread; // Connection thread
|
||||||
EVENT *HaltEvent; // Stop event
|
EVENT *HaltEvent; // Stop event
|
||||||
CANCEL *Cancel; // Cancel
|
CANCEL *Cancel; // Cancel
|
||||||
};
|
};
|
||||||
|
|
||||||
// SECURE_SIGN Structure
|
// SECURE_SIGN Structure
|
||||||
struct SECURE_SIGN
|
struct SECURE_SIGN
|
||||||
{
|
{
|
||||||
char SecurePublicCertName[MAX_SECURE_DEVICE_FILE_LEN + 1]; // Secure device certificate name
|
char SecurePublicCertName[MAX_SECURE_DEVICE_FILE_LEN + 1]; // Secure device certificate name
|
||||||
char SecurePrivateKeyName[MAX_SECURE_DEVICE_FILE_LEN + 1]; // Secure device secret key name
|
char SecurePrivateKeyName[MAX_SECURE_DEVICE_FILE_LEN + 1]; // Secure device secret key name
|
||||||
X *ClientCert; // Client certificate
|
X *ClientCert; // Client certificate
|
||||||
UCHAR Random[SHA1_SIZE]; // Random value for signature
|
UCHAR Random[SHA1_SIZE]; // Random value for signature
|
||||||
UCHAR Signature[4096 / 8]; // Signed data
|
UCHAR Signature[4096 / 8]; // Signed data
|
||||||
UINT UseSecureDeviceId;
|
UINT UseSecureDeviceId;
|
||||||
UINT BitmapId; // Bitmap ID
|
UINT BitmapId; // Bitmap ID
|
||||||
};
|
};
|
||||||
|
|
||||||
// Function type declaration
|
// Function type declaration
|
||||||
typedef bool (CHECK_CERT_PROC)(SESSION *s, CONNECTION *c, X *server_x, bool *expired);
|
typedef bool (CHECK_CERT_PROC)(SESSION *s, CONNECTION *c, X *server_x, bool *expired);
|
||||||
typedef bool (SECURE_SIGN_PROC)(SESSION *s, CONNECTION *c, SECURE_SIGN *sign);
|
typedef bool (SECURE_SIGN_PROC)(SESSION *s, CONNECTION *c, SECURE_SIGN *sign);
|
||||||
|
|
||||||
// RC4 key pair
|
// RC4 key pair
|
||||||
struct RC4_KEY_PAIR
|
struct RC4_KEY_PAIR
|
||||||
{
|
{
|
||||||
UCHAR ServerToClientKey[16];
|
UCHAR ServerToClientKey[16];
|
||||||
UCHAR ClientToServerKey[16];
|
UCHAR ClientToServerKey[16];
|
||||||
};
|
};
|
||||||
|
|
||||||
// Client Options
|
// Client Options
|
||||||
struct CLIENT_OPTION
|
struct CLIENT_OPTION
|
||||||
{
|
{
|
||||||
wchar_t AccountName[MAX_ACCOUNT_NAME_LEN + 1]; // Connection setting name
|
wchar_t AccountName[MAX_ACCOUNT_NAME_LEN + 1]; // Connection setting name
|
||||||
char Hostname[MAX_HOST_NAME_LEN + 1]; // Host name
|
char Hostname[MAX_HOST_NAME_LEN + 1]; // Host name
|
||||||
UINT Port; // Port number
|
UINT Port; // Port number
|
||||||
UINT PortUDP; // UDP port number (0: Use only TCP)
|
UINT PortUDP; // UDP port number (0: Use only TCP)
|
||||||
UINT ProxyType; // Type of proxy
|
UINT ProxyType; // Type of proxy
|
||||||
char ProxyName[MAX_HOST_NAME_LEN + 1]; // Proxy server name
|
char ProxyName[MAX_HOST_NAME_LEN + 1]; // Proxy server name
|
||||||
UINT ProxyPort; // Port number of the proxy server
|
UINT ProxyPort; // Port number of the proxy server
|
||||||
char ProxyUsername[PROXY_MAX_USERNAME_LEN + 1]; // Maximum user name length
|
char ProxyUsername[PROXY_MAX_USERNAME_LEN + 1]; // Maximum user name length
|
||||||
char ProxyPassword[PROXY_MAX_PASSWORD_LEN + 1]; // Maximum password length
|
char ProxyPassword[PROXY_MAX_PASSWORD_LEN + 1]; // Maximum password length
|
||||||
char CustomHttpHeader[HTTP_CUSTOM_HEADER_MAX_SIZE + 1]; // Custom HTTP proxy header
|
char CustomHttpHeader[HTTP_CUSTOM_HEADER_MAX_SIZE + 1]; // Custom HTTP proxy header
|
||||||
UINT NumRetry; // Automatic retries
|
UINT NumRetry; // Automatic retries
|
||||||
UINT RetryInterval; // Retry interval
|
UINT RetryInterval; // Retry interval
|
||||||
char HubName[MAX_HUBNAME_LEN + 1]; // HUB name
|
char HubName[MAX_HUBNAME_LEN + 1]; // HUB name
|
||||||
UINT MaxConnection; // Maximum number of concurrent TCP connections
|
UINT MaxConnection; // Maximum number of concurrent TCP connections
|
||||||
bool UseEncrypt; // Use encrypted communication
|
bool UseEncrypt; // Use encrypted communication
|
||||||
bool UseCompress; // Use data compression
|
bool UseCompress; // Use data compression
|
||||||
bool HalfConnection; // Use half connection in TCP
|
bool HalfConnection; // Use half connection in TCP
|
||||||
bool NoRoutingTracking; // Disable the routing tracking
|
bool NoRoutingTracking; // Disable the routing tracking
|
||||||
char DeviceName[MAX_DEVICE_NAME_LEN + 1]; // VLAN device name
|
char DeviceName[MAX_DEVICE_NAME_LEN + 1]; // VLAN device name
|
||||||
UINT AdditionalConnectionInterval; // Connection attempt interval when additional connection establish
|
UINT AdditionalConnectionInterval; // Connection attempt interval when additional connection establish
|
||||||
UINT ConnectionDisconnectSpan; // Disconnection interval
|
UINT ConnectionDisconnectSpan; // Disconnection interval
|
||||||
bool HideStatusWindow; // Hide the status window
|
bool HideStatusWindow; // Hide the status window
|
||||||
bool HideNicInfoWindow; // Hide the NIC status window
|
bool HideNicInfoWindow; // Hide the NIC status window
|
||||||
bool RequireMonitorMode; // Monitor port mode
|
bool RequireMonitorMode; // Monitor port mode
|
||||||
bool RequireBridgeRoutingMode; // Bridge or routing mode
|
bool RequireBridgeRoutingMode; // Bridge or routing mode
|
||||||
bool DisableQoS; // Disable the VoIP / QoS function
|
bool DisableQoS; // Disable the VoIP / QoS function
|
||||||
bool FromAdminPack; // For Administration Pack
|
bool FromAdminPack; // For Administration Pack
|
||||||
bool NoUdpAcceleration; // Do not use UDP acceleration mode
|
bool NoUdpAcceleration; // Do not use UDP acceleration mode
|
||||||
UCHAR HostUniqueKey[SHA1_SIZE]; // Host unique key
|
UCHAR HostUniqueKey[SHA1_SIZE]; // Host unique key
|
||||||
};
|
};
|
||||||
|
|
||||||
// Client authentication data
|
// Client authentication data
|
||||||
struct CLIENT_AUTH
|
struct CLIENT_AUTH
|
||||||
{
|
{
|
||||||
UINT AuthType; // Authentication type
|
UINT AuthType; // Authentication type
|
||||||
char Username[MAX_USERNAME_LEN + 1]; // User name
|
char Username[MAX_USERNAME_LEN + 1]; // User name
|
||||||
UCHAR HashedPassword[SHA1_SIZE]; // Hashed passwords
|
UCHAR HashedPassword[SHA1_SIZE]; // Hashed passwords
|
||||||
char PlainPassword[MAX_PASSWORD_LEN + 1]; // Password
|
char PlainPassword[MAX_PASSWORD_LEN + 1]; // Password
|
||||||
X *ClientX; // Client certificate
|
X *ClientX; // Client certificate
|
||||||
K *ClientK; // Client private key
|
K *ClientK; // Client private key
|
||||||
char SecurePublicCertName[MAX_SECURE_DEVICE_FILE_LEN + 1]; // Secure device certificate name
|
char SecurePublicCertName[MAX_SECURE_DEVICE_FILE_LEN + 1]; // Secure device certificate name
|
||||||
char SecurePrivateKeyName[MAX_SECURE_DEVICE_FILE_LEN + 1]; // Secure device secret key name
|
char SecurePrivateKeyName[MAX_SECURE_DEVICE_FILE_LEN + 1]; // Secure device secret key name
|
||||||
char OpensslEnginePrivateKeyName[MAX_SECURE_DEVICE_FILE_LEN + 1]; // Secure device secret key name
|
char OpensslEnginePrivateKeyName[MAX_SECURE_DEVICE_FILE_LEN + 1]; // Secure device secret key name
|
||||||
char OpensslEngineName[MAX_SECURE_DEVICE_FILE_LEN + 1]; // Secure device secret key name
|
char OpensslEngineName[MAX_SECURE_DEVICE_FILE_LEN + 1]; // Secure device secret key name
|
||||||
CHECK_CERT_PROC *CheckCertProc; // Server certificate confirmation procedure
|
CHECK_CERT_PROC *CheckCertProc; // Server certificate confirmation procedure
|
||||||
SECURE_SIGN_PROC *SecureSignProc; // Security signing procedure
|
SECURE_SIGN_PROC *SecureSignProc; // Security signing procedure
|
||||||
};
|
};
|
||||||
|
|
||||||
// TCP socket data structure
|
// TCP socket data structure
|
||||||
struct TCPSOCK
|
struct TCPSOCK
|
||||||
{
|
{
|
||||||
SOCK *Sock; // Socket
|
SOCK *Sock; // Socket
|
||||||
FIFO *RecvFifo; // Reception buffer
|
FIFO *RecvFifo; // Reception buffer
|
||||||
FIFO *SendFifo; // Transmission buffer
|
FIFO *SendFifo; // Transmission buffer
|
||||||
UINT Mode; // Read mode
|
UINT Mode; // Read mode
|
||||||
UINT WantSize; // Requested data size
|
UINT WantSize; // Requested data size
|
||||||
UINT NextBlockNum; // Total number of blocks that can be read next
|
UINT NextBlockNum; // Total number of blocks that can be read next
|
||||||
UINT NextBlockSize; // Block size that is planned to read next
|
UINT NextBlockSize; // Block size that is planned to read next
|
||||||
UINT CurrentPacketNum; // Current packet number
|
UINT CurrentPacketNum; // Current packet number
|
||||||
UINT64 LastCommTime; // Last communicated time
|
UINT64 LastCommTime; // Last communicated time
|
||||||
UINT64 LastRecvTime; // Time the last data received
|
UINT64 LastRecvTime; // Time the last data received
|
||||||
UINT LateCount; // The number of delay occurences
|
UINT LateCount; // The number of delay occurences
|
||||||
UINT Direction; // Direction
|
UINT Direction; // Direction
|
||||||
UINT64 NextKeepAliveTime; // Next time to send a KeepAlive packet
|
UINT64 NextKeepAliveTime; // Next time to send a KeepAlive packet
|
||||||
RC4_KEY_PAIR Rc4KeyPair; // RC4 key pair
|
RC4_KEY_PAIR Rc4KeyPair; // RC4 key pair
|
||||||
CRYPT *SendKey; // Transmission key
|
CRYPT *SendKey; // Transmission key
|
||||||
CRYPT *RecvKey; // Reception key
|
CRYPT *RecvKey; // Reception key
|
||||||
UINT64 DisconnectTick; // Time to disconnect this connection
|
UINT64 DisconnectTick; // Time to disconnect this connection
|
||||||
UINT64 EstablishedTick; // Establishment time
|
UINT64 EstablishedTick; // Establishment time
|
||||||
};
|
};
|
||||||
|
|
||||||
// TCP communication data structure
|
// TCP communication data structure
|
||||||
struct TCP
|
struct TCP
|
||||||
{
|
{
|
||||||
LIST *TcpSockList; // TCP socket list
|
LIST *TcpSockList; // TCP socket list
|
||||||
};
|
};
|
||||||
|
|
||||||
// UDP communication data structure
|
// UDP communication data structure
|
||||||
struct UDP
|
struct UDP
|
||||||
{
|
{
|
||||||
SOCK *s; // UDP socket (for transmission)
|
SOCK *s; // UDP socket (for transmission)
|
||||||
IP ip; // Destination IP address
|
IP ip; // Destination IP address
|
||||||
UINT port; // Destination port number
|
UINT port; // Destination port number
|
||||||
UINT64 NextKeepAliveTime; // Next time to send a KeepAlive packet
|
UINT64 NextKeepAliveTime; // Next time to send a KeepAlive packet
|
||||||
UINT64 Seq; // Packet sequence number
|
UINT64 Seq; // Packet sequence number
|
||||||
UINT64 RecvSeq;
|
UINT64 RecvSeq;
|
||||||
QUEUE *BufferQueue; // Queue of buffer to be sent
|
QUEUE *BufferQueue; // Queue of buffer to be sent
|
||||||
};
|
};
|
||||||
|
|
||||||
// Data block
|
// Data block
|
||||||
struct BLOCK
|
struct BLOCK
|
||||||
{
|
{
|
||||||
BOOL Compressed; // Compression flag
|
BOOL Compressed; // Compression flag
|
||||||
UINT Size; // Block size
|
UINT Size; // Block size
|
||||||
UINT SizeofData; // Data size
|
UINT SizeofData; // Data size
|
||||||
UCHAR *Buf; // Buffer
|
UCHAR *Buf; // Buffer
|
||||||
bool PriorityQoS; // Priority packet for VoIP / QoS function
|
bool PriorityQoS; // Priority packet for VoIP / QoS function
|
||||||
UINT Ttl; // TTL value (Used only in ICMP NAT of Virtual.c)
|
UINT Ttl; // TTL value (Used only in ICMP NAT of Virtual.c)
|
||||||
UINT Param1; // Parameter 1
|
UINT Param1; // Parameter 1
|
||||||
bool IsFlooding; // Is flooding packet
|
bool IsFlooding; // Is flooding packet
|
||||||
UCHAR RawFlagRetUdpAccel; // Raw flag returned by UDP accel
|
UCHAR RawFlagRetUdpAccel; // Raw flag returned by UDP accel
|
||||||
};
|
};
|
||||||
|
|
||||||
// Connection structure
|
// Connection structure
|
||||||
struct CONNECTION
|
struct CONNECTION
|
||||||
{
|
{
|
||||||
LOCK *lock; // Lock
|
LOCK *lock; // Lock
|
||||||
REF *ref; // Reference counter
|
REF *ref; // Reference counter
|
||||||
CEDAR *Cedar; // Cedar
|
CEDAR *Cedar; // Cedar
|
||||||
struct SESSION *Session; // Session
|
struct SESSION *Session; // Session
|
||||||
UINT Protocol; // Protocol
|
UINT Protocol; // Protocol
|
||||||
SOCK *FirstSock; // Socket for negotiation
|
SOCK *FirstSock; // Socket for negotiation
|
||||||
SOCK *TubeSock; // Socket for in-process communication
|
SOCK *TubeSock; // Socket for in-process communication
|
||||||
TCP *Tcp; // TCP communication data structure
|
TCP *Tcp; // TCP communication data structure
|
||||||
UDP *Udp; // UDP communication data structure
|
UDP *Udp; // UDP communication data structure
|
||||||
bool ServerMode; // Server mode
|
bool ServerMode; // Server mode
|
||||||
UINT Status; // Status
|
UINT Status; // Status
|
||||||
char *Name; // Connection name
|
char *Name; // Connection name
|
||||||
THREAD *Thread; // Thread
|
THREAD *Thread; // Thread
|
||||||
volatile bool Halt; // Stop flag
|
volatile bool Halt; // Stop flag
|
||||||
UCHAR Random[SHA1_SIZE]; // Random number for Authentication
|
UCHAR Random[SHA1_SIZE]; // Random number for Authentication
|
||||||
UINT ServerVer; // Server version
|
UINT ServerVer; // Server version
|
||||||
UINT ServerBuild; // Server build number
|
UINT ServerBuild; // Server build number
|
||||||
UINT ClientVer; // Client version
|
UINT ClientVer; // Client version
|
||||||
UINT ClientBuild; // Client build number
|
UINT ClientBuild; // Client build number
|
||||||
char ServerStr[MAX_SERVER_STR_LEN + 1]; // Server string
|
char ServerStr[MAX_SERVER_STR_LEN + 1]; // Server string
|
||||||
char ClientStr[MAX_CLIENT_STR_LEN + 1]; // Client string
|
char ClientStr[MAX_CLIENT_STR_LEN + 1]; // Client string
|
||||||
UINT Err; // Error value
|
UINT Err; // Error value
|
||||||
bool ClientConnectError_NoSavePassword; // Don't save the password for the specified user name
|
bool ClientConnectError_NoSavePassword; // Don't save the password for the specified user name
|
||||||
QUEUE *ReceivedBlocks; // Block queue that is received
|
QUEUE *ReceivedBlocks; // Block queue that is received
|
||||||
QUEUE *SendBlocks; // Block queue planned to be sent
|
QUEUE *SendBlocks; // Block queue planned to be sent
|
||||||
QUEUE *SendBlocks2; // Send queue (high priority)
|
QUEUE *SendBlocks2; // Send queue (high priority)
|
||||||
COUNTER *CurrentNumConnection; // Counter of the number of current connections
|
COUNTER *CurrentNumConnection; // Counter of the number of current connections
|
||||||
LIST *ConnectingThreads; // List of connected threads
|
LIST *ConnectingThreads; // List of connected threads
|
||||||
LIST *ConnectingSocks; // List of the connected sockets
|
LIST *ConnectingSocks; // List of the connected sockets
|
||||||
bool flag1; // Flag 1
|
bool flag1; // Flag 1
|
||||||
UCHAR *RecvBuf; // Receive buffer
|
UCHAR *RecvBuf; // Receive buffer
|
||||||
char ServerName[MAX_HOST_NAME_LEN + 1]; // Server name
|
char ServerName[MAX_HOST_NAME_LEN + 1]; // Server name
|
||||||
UINT ServerPort; // Port number
|
UINT ServerPort; // Port number
|
||||||
bool RestoreServerNameAndPort; // Flag to restore the server name and port number to original
|
bool RestoreServerNameAndPort; // Flag to restore the server name and port number to original
|
||||||
bool UseTicket; // Ticket using flag
|
bool UseTicket; // Ticket using flag
|
||||||
UCHAR Ticket[SHA1_SIZE]; // Ticket
|
UCHAR Ticket[SHA1_SIZE]; // Ticket
|
||||||
UINT CurrentSendQueueSize; // Total size of the transmission queue
|
UINT CurrentSendQueueSize; // Total size of the transmission queue
|
||||||
X *ServerX; // Server certificate
|
X *ServerX; // Server certificate
|
||||||
X *ClientX; // Client certificate
|
X *ClientX; // Client certificate
|
||||||
char *CipherName; // Encryption algorithm name
|
char *CipherName; // Encryption algorithm name
|
||||||
UINT64 ConnectedTick; // Time it is connected
|
UINT64 ConnectedTick; // Time it is connected
|
||||||
IP ClientIp; // Client IP address
|
IP ClientIp; // Client IP address
|
||||||
char ClientHostname[MAX_HOST_NAME_LEN + 1]; // Client host name
|
char ClientHostname[MAX_HOST_NAME_LEN + 1]; // Client host name
|
||||||
UINT Type; // Type
|
UINT Type; // Type
|
||||||
void *hWndForUI; // Parent window
|
void *hWndForUI; // Parent window
|
||||||
bool IsInProc; // In-process
|
bool IsInProc; // In-process
|
||||||
char InProcPrefix[64]; // Prefix
|
char InProcPrefix[64]; // Prefix
|
||||||
UINT InProcLayer; // InProc layer
|
UINT InProcLayer; // InProc layer
|
||||||
UINT AdditionalConnectionFailedCounter; // Additional connection failure counter
|
UINT AdditionalConnectionFailedCounter; // Additional connection failure counter
|
||||||
UINT64 LastCounterResetTick; // Time the counter was reset finally
|
UINT64 LastCounterResetTick; // Time the counter was reset finally
|
||||||
bool WasSstp; // Processed the SSTP
|
bool WasSstp; // Processed the SSTP
|
||||||
bool WasDatProxy; // DAT proxy processed
|
bool WasDatProxy; // DAT proxy processed
|
||||||
UCHAR CToken_Hash[SHA1_SIZE]; // CTOKEN_HASH
|
UCHAR CToken_Hash[SHA1_SIZE]; // CTOKEN_HASH
|
||||||
UINT LastTcpQueueSize; // The last queue size of TCP sockets
|
UINT LastTcpQueueSize; // The last queue size of TCP sockets
|
||||||
UINT LastPacketQueueSize; // The last queue size of packets
|
UINT LastPacketQueueSize; // The last queue size of packets
|
||||||
UINT LastRecvFifoTotalSize; // The last RecvFifo total size
|
UINT LastRecvFifoTotalSize; // The last RecvFifo total size
|
||||||
UINT LastRecvBlocksNum; // The last ReceivedBlocks num
|
UINT LastRecvBlocksNum; // The last ReceivedBlocks num
|
||||||
bool IsJsonRpc; // Is JSON-RPC
|
bool IsJsonRpc; // Is JSON-RPC
|
||||||
bool JsonRpcAuthed; // JSON-RPC Authed
|
bool JsonRpcAuthed; // JSON-RPC Authed
|
||||||
LISTENER *Listener; // Listener ref
|
LISTENER *Listener; // Listener ref
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Function prototypes
|
// Function prototypes
|
||||||
|
|
||||||
CONNECTION *NewClientConnection(SESSION *s);
|
CONNECTION *NewClientConnection(SESSION *s);
|
||||||
CONNECTION *NewClientConnectionEx(SESSION *s, char *client_str, UINT client_ver, UINT client_build);
|
CONNECTION *NewClientConnectionEx(SESSION *s, char *client_str, UINT client_ver, UINT client_build);
|
||||||
CONNECTION *NewServerConnection(CEDAR *cedar, SOCK *s, THREAD *t);
|
CONNECTION *NewServerConnection(CEDAR *cedar, SOCK *s, THREAD *t);
|
||||||
void ReleaseConnection(CONNECTION *c);
|
void ReleaseConnection(CONNECTION *c);
|
||||||
void CleanupConnection(CONNECTION *c);
|
void CleanupConnection(CONNECTION *c);
|
||||||
int CompareConnection(void *p1, void *p2);
|
int CompareConnection(void *p1, void *p2);
|
||||||
void StopConnection(CONNECTION *c, bool no_wait);
|
void StopConnection(CONNECTION *c, bool no_wait);
|
||||||
void ConnectionAccept(CONNECTION *c);
|
void ConnectionAccept(CONNECTION *c);
|
||||||
void StartTunnelingMode(CONNECTION *c);
|
void StartTunnelingMode(CONNECTION *c);
|
||||||
void EndTunnelingMode(CONNECTION *c);
|
void EndTunnelingMode(CONNECTION *c);
|
||||||
void DisconnectTcpSockets(CONNECTION *c);
|
void DisconnectTcpSockets(CONNECTION *c);
|
||||||
void ConnectionReceive(CONNECTION *c, CANCEL *c1, CANCEL *c2);
|
void ConnectionReceive(CONNECTION *c, CANCEL *c1, CANCEL *c2);
|
||||||
void ConnectionSend(CONNECTION *c, UINT64 now);
|
void ConnectionSend(CONNECTION *c, UINT64 now);
|
||||||
TCPSOCK *NewTcpSock(SOCK *s);
|
TCPSOCK *NewTcpSock(SOCK *s);
|
||||||
void FreeTcpSock(TCPSOCK *ts);
|
void FreeTcpSock(TCPSOCK *ts);
|
||||||
BLOCK *NewBlock(void *data, UINT size, int compress);
|
BLOCK *NewBlock(void *data, UINT size, int compress);
|
||||||
void FreeBlock(BLOCK *b);
|
void FreeBlock(BLOCK *b);
|
||||||
void StopAllAdditionalConnectThread(CONNECTION *c);
|
void StopAllAdditionalConnectThread(CONNECTION *c);
|
||||||
UINT GenNextKeepAliveSpan(CONNECTION *c);
|
UINT GenNextKeepAliveSpan(CONNECTION *c);
|
||||||
void SendKeepAlive(CONNECTION *c, TCPSOCK *ts);
|
void SendKeepAlive(CONNECTION *c, TCPSOCK *ts);
|
||||||
void DisconnectUDPSockets(CONNECTION *c);
|
void DisconnectUDPSockets(CONNECTION *c);
|
||||||
void PutUDPPacketData(CONNECTION *c, void *data, UINT size);
|
void PutUDPPacketData(CONNECTION *c, void *data, UINT size);
|
||||||
void SendDataWithUDP(SOCK *s, CONNECTION *c);
|
void SendDataWithUDP(SOCK *s, CONNECTION *c);
|
||||||
void InsertReceivedBlockToQueue(CONNECTION *c, BLOCK *block, bool no_lock);
|
void InsertReceivedBlockToQueue(CONNECTION *c, BLOCK *block, bool no_lock);
|
||||||
UINT TcpSockRecv(SESSION *s, TCPSOCK *ts, void *data, UINT size);
|
UINT TcpSockRecv(SESSION *s, TCPSOCK *ts, void *data, UINT size);
|
||||||
UINT TcpSockSend(SESSION *s, TCPSOCK *ts, void *data, UINT size);
|
UINT TcpSockSend(SESSION *s, TCPSOCK *ts, void *data, UINT size);
|
||||||
void WriteSendFifo(SESSION *s, TCPSOCK *ts, void *data, UINT size);
|
void WriteSendFifo(SESSION *s, TCPSOCK *ts, void *data, UINT size);
|
||||||
void WriteRecvFifo(SESSION *s, TCPSOCK *ts, void *data, UINT size);
|
void WriteRecvFifo(SESSION *s, TCPSOCK *ts, void *data, UINT size);
|
||||||
CLIENT_AUTH *CopyClientAuth(CLIENT_AUTH *a);
|
CLIENT_AUTH *CopyClientAuth(CLIENT_AUTH *a);
|
||||||
BUF *NewKeepPacket(bool server_mode);
|
BUF *NewKeepPacket(bool server_mode);
|
||||||
void KeepThread(THREAD *thread, void *param);
|
void KeepThread(THREAD *thread, void *param);
|
||||||
KEEP *StartKeep();
|
KEEP *StartKeep();
|
||||||
void StopKeep(KEEP *k);
|
void StopKeep(KEEP *k);
|
||||||
void InRpcSecureSign(SECURE_SIGN *t, PACK *p);
|
void InRpcSecureSign(SECURE_SIGN *t, PACK *p);
|
||||||
void OutRpcSecureSign(PACK *p, SECURE_SIGN *t);
|
void OutRpcSecureSign(PACK *p, SECURE_SIGN *t);
|
||||||
void FreeRpcSecureSign(SECURE_SIGN *t);
|
void FreeRpcSecureSign(SECURE_SIGN *t);
|
||||||
void NormalizeEthMtu(BRIDGE *b, CONNECTION *c, UINT packet_size);
|
void NormalizeEthMtu(BRIDGE *b, CONNECTION *c, UINT packet_size);
|
||||||
UINT GetMachineRand();
|
UINT GetMachineRand();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif // CONNECTION_H
|
#endif // CONNECTION_H
|
||||||
|
4922
src/Cedar/Console.c
4922
src/Cedar/Console.c
File diff suppressed because it is too large
Load Diff
@ -1,144 +1,144 @@
|
|||||||
// SoftEther VPN Source Code - Developer Edition Master Branch
|
// SoftEther VPN Source Code - Developer Edition Master Branch
|
||||||
// Cedar Communication Module
|
// Cedar Communication Module
|
||||||
|
|
||||||
|
|
||||||
// Console.h
|
// Console.h
|
||||||
// Header of Console.c
|
// Header of Console.c
|
||||||
|
|
||||||
#ifndef CONSOLE_H
|
#ifndef CONSOLE_H
|
||||||
#define CONSOLE_H
|
#define CONSOLE_H
|
||||||
|
|
||||||
// Constant
|
// Constant
|
||||||
#define MAX_PROMPT_STRSIZE 65536
|
#define MAX_PROMPT_STRSIZE 65536
|
||||||
#define WIN32_DEFAULT_CONSOLE_WIDTH 100
|
#define WIN32_DEFAULT_CONSOLE_WIDTH 100
|
||||||
|
|
||||||
// Types of console
|
// Types of console
|
||||||
#define CONSOLE_LOCAL 0 // Local console
|
#define CONSOLE_LOCAL 0 // Local console
|
||||||
#define CONSOLE_CSV 1 // CSV output mode
|
#define CONSOLE_CSV 1 // CSV output mode
|
||||||
|
|
||||||
// Parameters completion prompt function
|
// Parameters completion prompt function
|
||||||
typedef wchar_t *(PROMPT_PROC)(CONSOLE *c, void *param);
|
typedef wchar_t *(PROMPT_PROC)(CONSOLE *c, void *param);
|
||||||
|
|
||||||
// Parameter validation prompt function
|
// Parameter validation prompt function
|
||||||
typedef bool (EVAL_PROC)(CONSOLE *c, wchar_t *str, void *param);
|
typedef bool (EVAL_PROC)(CONSOLE *c, wchar_t *str, void *param);
|
||||||
|
|
||||||
// Definition of the parameter item
|
// Definition of the parameter item
|
||||||
struct PARAM
|
struct PARAM
|
||||||
{
|
{
|
||||||
char *Name; // Parameter name
|
char *Name; // Parameter name
|
||||||
PROMPT_PROC *PromptProc; // Prompt function that automatically invoked if the parameter is not specified
|
PROMPT_PROC *PromptProc; // Prompt function that automatically invoked if the parameter is not specified
|
||||||
// (This is not called in the case of NULL)
|
// (This is not called in the case of NULL)
|
||||||
void *PromptProcParam; // Any pointers to pass to the prompt function
|
void *PromptProcParam; // Any pointers to pass to the prompt function
|
||||||
EVAL_PROC *EvalProc; // Parameter string validation function
|
EVAL_PROC *EvalProc; // Parameter string validation function
|
||||||
void *EvalProcParam; // Any pointers to be passed to the validation function
|
void *EvalProcParam; // Any pointers to be passed to the validation function
|
||||||
char *Tmp; // Temporary variable
|
char *Tmp; // Temporary variable
|
||||||
};
|
};
|
||||||
|
|
||||||
// Parameter value of the internal data
|
// Parameter value of the internal data
|
||||||
struct PARAM_VALUE
|
struct PARAM_VALUE
|
||||||
{
|
{
|
||||||
char *Name; // Name
|
char *Name; // Name
|
||||||
char *StrValue; // String value
|
char *StrValue; // String value
|
||||||
wchar_t *UniStrValue; // Unicode string value
|
wchar_t *UniStrValue; // Unicode string value
|
||||||
UINT IntValue; // Integer value
|
UINT IntValue; // Integer value
|
||||||
};
|
};
|
||||||
|
|
||||||
// Console service structure
|
// Console service structure
|
||||||
struct CONSOLE
|
struct CONSOLE
|
||||||
{
|
{
|
||||||
UINT ConsoleType; // Type of console
|
UINT ConsoleType; // Type of console
|
||||||
UINT RetCode; // The last exit code
|
UINT RetCode; // The last exit code
|
||||||
void *Param; // Data of any
|
void *Param; // Data of any
|
||||||
void (*Free)(CONSOLE *c); // Release function
|
void (*Free)(CONSOLE *c); // Release function
|
||||||
wchar_t *(*ReadLine)(CONSOLE *c, wchar_t *prompt, bool nofile); // Function to read one line
|
wchar_t *(*ReadLine)(CONSOLE *c, wchar_t *prompt, bool nofile); // Function to read one line
|
||||||
char *(*ReadPassword)(CONSOLE *c, wchar_t *prompt); // Function to read the password
|
char *(*ReadPassword)(CONSOLE *c, wchar_t *prompt); // Function to read the password
|
||||||
bool (*Write)(CONSOLE *c, wchar_t *str); // Function to write a string
|
bool (*Write)(CONSOLE *c, wchar_t *str); // Function to write a string
|
||||||
UINT (*GetWidth)(CONSOLE *c); // Get the width of the screen
|
UINT (*GetWidth)(CONSOLE *c); // Get the width of the screen
|
||||||
bool ProgrammingMode; // Programming Mode
|
bool ProgrammingMode; // Programming Mode
|
||||||
LOCK *OutputLock; // Output Lock
|
LOCK *OutputLock; // Output Lock
|
||||||
};
|
};
|
||||||
|
|
||||||
// Local console parameters
|
// Local console parameters
|
||||||
struct LOCAL_CONSOLE_PARAM
|
struct LOCAL_CONSOLE_PARAM
|
||||||
{
|
{
|
||||||
IO *InFile; // Input file
|
IO *InFile; // Input file
|
||||||
BUF *InBuf; // Input buffer
|
BUF *InBuf; // Input buffer
|
||||||
IO *OutFile; // Output file
|
IO *OutFile; // Output file
|
||||||
UINT Win32_OldConsoleWidth; // Previous console size
|
UINT Win32_OldConsoleWidth; // Previous console size
|
||||||
};
|
};
|
||||||
|
|
||||||
// Command procedure
|
// Command procedure
|
||||||
typedef UINT (COMMAND_PROC)(CONSOLE *c, char *cmd_name, wchar_t *str, void *param);
|
typedef UINT (COMMAND_PROC)(CONSOLE *c, char *cmd_name, wchar_t *str, void *param);
|
||||||
|
|
||||||
// Definition of command
|
// Definition of command
|
||||||
struct CMD
|
struct CMD
|
||||||
{
|
{
|
||||||
char *Name; // Command name
|
char *Name; // Command name
|
||||||
COMMAND_PROC *Proc; // Procedure function
|
COMMAND_PROC *Proc; // Procedure function
|
||||||
};
|
};
|
||||||
|
|
||||||
// Evaluate the minimum / maximum value of the parameter
|
// Evaluate the minimum / maximum value of the parameter
|
||||||
struct CMD_EVAL_MIN_MAX
|
struct CMD_EVAL_MIN_MAX
|
||||||
{
|
{
|
||||||
char *StrName;
|
char *StrName;
|
||||||
UINT MinValue, MaxValue;
|
UINT MinValue, MaxValue;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// Function prototype
|
// Function prototype
|
||||||
wchar_t *Prompt(wchar_t *prompt_str);
|
wchar_t *Prompt(wchar_t *prompt_str);
|
||||||
char *PromptA(wchar_t *prompt_str);
|
char *PromptA(wchar_t *prompt_str);
|
||||||
bool PasswordPrompt(char *password, UINT size);
|
bool PasswordPrompt(char *password, UINT size);
|
||||||
void *SetConsoleRaw();
|
void *SetConsoleRaw();
|
||||||
void RestoreConsole(void *p);
|
void RestoreConsole(void *p);
|
||||||
wchar_t *ParseCommandEx(wchar_t *str, wchar_t *name, TOKEN_LIST **param_list);
|
wchar_t *ParseCommandEx(wchar_t *str, wchar_t *name, TOKEN_LIST **param_list);
|
||||||
wchar_t *ParseCommand(wchar_t *str, wchar_t *name);
|
wchar_t *ParseCommand(wchar_t *str, wchar_t *name);
|
||||||
TOKEN_LIST *GetCommandNameList(wchar_t *str);
|
TOKEN_LIST *GetCommandNameList(wchar_t *str);
|
||||||
char *ParseCommandA(wchar_t *str, char *name);
|
char *ParseCommandA(wchar_t *str, char *name);
|
||||||
LIST *NewParamValueList();
|
LIST *NewParamValueList();
|
||||||
int CmpParamValue(void *p1, void *p2);
|
int CmpParamValue(void *p1, void *p2);
|
||||||
void FreeParamValueList(LIST *o);
|
void FreeParamValueList(LIST *o);
|
||||||
PARAM_VALUE *FindParamValue(LIST *o, char *name);
|
PARAM_VALUE *FindParamValue(LIST *o, char *name);
|
||||||
char *GetParamStr(LIST *o, char *name);
|
char *GetParamStr(LIST *o, char *name);
|
||||||
wchar_t *GetParamUniStr(LIST *o, char *name);
|
wchar_t *GetParamUniStr(LIST *o, char *name);
|
||||||
UINT GetParamInt(LIST *o, char *name);
|
UINT GetParamInt(LIST *o, char *name);
|
||||||
bool GetParamYes(LIST *o, char *name);
|
bool GetParamYes(LIST *o, char *name);
|
||||||
LIST *ParseCommandList(CONSOLE *c, char *cmd_name, wchar_t *command, PARAM param[], UINT num_param);
|
LIST *ParseCommandList(CONSOLE *c, char *cmd_name, wchar_t *command, PARAM param[], UINT num_param);
|
||||||
bool IsNameInRealName(char *input_name, char *real_name);
|
bool IsNameInRealName(char *input_name, char *real_name);
|
||||||
void GetOmissionName(char *dst, UINT size, char *src);
|
void GetOmissionName(char *dst, UINT size, char *src);
|
||||||
bool IsOmissionName(char *input_name, char *real_name);
|
bool IsOmissionName(char *input_name, char *real_name);
|
||||||
TOKEN_LIST *GetRealnameCandidate(char *input_name, TOKEN_LIST *real_name_list);
|
TOKEN_LIST *GetRealnameCandidate(char *input_name, TOKEN_LIST *real_name_list);
|
||||||
bool SeparateCommandAndParam(wchar_t *src, char **cmd, wchar_t **param);
|
bool SeparateCommandAndParam(wchar_t *src, char **cmd, wchar_t **param);
|
||||||
UINT GetConsoleWidth(CONSOLE *c);
|
UINT GetConsoleWidth(CONSOLE *c);
|
||||||
bool DispatchNextCmd(CONSOLE *c, char *prompt, CMD cmd[], UINT num_cmd, void *param);
|
bool DispatchNextCmd(CONSOLE *c, char *prompt, CMD cmd[], UINT num_cmd, void *param);
|
||||||
bool DispatchNextCmdEx(CONSOLE *c, wchar_t *exec_command, char *prompt, CMD cmd[], UINT num_cmd, void *param);
|
bool DispatchNextCmdEx(CONSOLE *c, wchar_t *exec_command, char *prompt, CMD cmd[], UINT num_cmd, void *param);
|
||||||
void PrintCandidateHelp(CONSOLE *c, char *cmd_name, TOKEN_LIST *candidate_list, UINT left_space);
|
void PrintCandidateHelp(CONSOLE *c, char *cmd_name, TOKEN_LIST *candidate_list, UINT left_space);
|
||||||
UNI_TOKEN_LIST *SeparateStringByWidth(wchar_t *str, UINT width);
|
UNI_TOKEN_LIST *SeparateStringByWidth(wchar_t *str, UINT width);
|
||||||
UINT GetNextWordWidth(wchar_t *str);
|
UINT GetNextWordWidth(wchar_t *str);
|
||||||
bool IsWordChar(wchar_t c);
|
bool IsWordChar(wchar_t c);
|
||||||
void GetCommandHelpStr(char *command_name, wchar_t **description, wchar_t **args, wchar_t **help);
|
void GetCommandHelpStr(char *command_name, wchar_t **description, wchar_t **args, wchar_t **help);
|
||||||
void GetCommandParamHelpStr(char *command_name, char *param_name, wchar_t **description);
|
void GetCommandParamHelpStr(char *command_name, char *param_name, wchar_t **description);
|
||||||
bool CmdEvalMinMax(CONSOLE *c, wchar_t *str, void *param);
|
bool CmdEvalMinMax(CONSOLE *c, wchar_t *str, void *param);
|
||||||
wchar_t *CmdPrompt(CONSOLE *c, void *param);
|
wchar_t *CmdPrompt(CONSOLE *c, void *param);
|
||||||
bool CmdEvalNotEmpty(CONSOLE *c, wchar_t *str, void *param);
|
bool CmdEvalNotEmpty(CONSOLE *c, wchar_t *str, void *param);
|
||||||
bool CmdEvalInt1(CONSOLE *c, wchar_t *str, void *param);
|
bool CmdEvalInt1(CONSOLE *c, wchar_t *str, void *param);
|
||||||
bool CmdEvalIsFile(CONSOLE *c, wchar_t *str, void *param);
|
bool CmdEvalIsFile(CONSOLE *c, wchar_t *str, void *param);
|
||||||
bool CmdEvalSafe(CONSOLE *c, wchar_t *str, void *param);
|
bool CmdEvalSafe(CONSOLE *c, wchar_t *str, void *param);
|
||||||
void PrintCmdHelp(CONSOLE *c, char *cmd_name, TOKEN_LIST *param_list);
|
void PrintCmdHelp(CONSOLE *c, char *cmd_name, TOKEN_LIST *param_list);
|
||||||
int CompareCandidateStr(void *p1, void *p2);
|
int CompareCandidateStr(void *p1, void *p2);
|
||||||
bool IsHelpStr(char *str);
|
bool IsHelpStr(char *str);
|
||||||
|
|
||||||
CONSOLE *NewLocalConsole(wchar_t *infile, wchar_t *outfile);
|
CONSOLE *NewLocalConsole(wchar_t *infile, wchar_t *outfile);
|
||||||
void ConsoleLocalFree(CONSOLE *c);
|
void ConsoleLocalFree(CONSOLE *c);
|
||||||
wchar_t *ConsoleLocalReadLine(CONSOLE *c, wchar_t *prompt, bool nofile);
|
wchar_t *ConsoleLocalReadLine(CONSOLE *c, wchar_t *prompt, bool nofile);
|
||||||
char *ConsoleLocalReadPassword(CONSOLE *c, wchar_t *prompt);
|
char *ConsoleLocalReadPassword(CONSOLE *c, wchar_t *prompt);
|
||||||
bool ConsoleLocalWrite(CONSOLE *c, wchar_t *str);
|
bool ConsoleLocalWrite(CONSOLE *c, wchar_t *str);
|
||||||
void ConsoleWriteOutFile(CONSOLE *c, wchar_t *str, bool add_last_crlf);
|
void ConsoleWriteOutFile(CONSOLE *c, wchar_t *str, bool add_last_crlf);
|
||||||
wchar_t *ConsoleReadNextFromInFile(CONSOLE *c);
|
wchar_t *ConsoleReadNextFromInFile(CONSOLE *c);
|
||||||
UINT ConsoleLocalGetWidth(CONSOLE *c);
|
UINT ConsoleLocalGetWidth(CONSOLE *c);
|
||||||
|
|
||||||
|
|
||||||
#endif // CONSOLE_H
|
#endif // CONSOLE_H
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
1822
src/Cedar/DDNS.c
1822
src/Cedar/DDNS.c
File diff suppressed because it is too large
Load Diff
290
src/Cedar/DDNS.h
290
src/Cedar/DDNS.h
@ -1,145 +1,145 @@
|
|||||||
// SoftEther VPN Source Code - Developer Edition Master Branch
|
// SoftEther VPN Source Code - Developer Edition Master Branch
|
||||||
// Cedar Communication Module
|
// Cedar Communication Module
|
||||||
|
|
||||||
|
|
||||||
// DDNS.h
|
// DDNS.h
|
||||||
// Header of DDNS.c
|
// Header of DDNS.c
|
||||||
|
|
||||||
#ifndef DDNS_H
|
#ifndef DDNS_H
|
||||||
#define DDNS_H
|
#define DDNS_H
|
||||||
|
|
||||||
// Certificate hash
|
// Certificate hash
|
||||||
#define DDNS_CERT_HASH "78BF0499A99396907C9F49DD13571C81FE26E6F5" \
|
#define DDNS_CERT_HASH "78BF0499A99396907C9F49DD13571C81FE26E6F5" \
|
||||||
"439BAFA75A6EE5671FC9F9A02D34FF29881761A0" \
|
"439BAFA75A6EE5671FC9F9A02D34FF29881761A0" \
|
||||||
"EFAC5FA0CDD14E0F864EED58A73C35D7E33B62F3" \
|
"EFAC5FA0CDD14E0F864EED58A73C35D7E33B62F3" \
|
||||||
"74DF99D4B1B5F0488A388B50D347D26013DC67A5" \
|
"74DF99D4B1B5F0488A388B50D347D26013DC67A5" \
|
||||||
"6EBB39AFCA8C900635CFC11218CF293A612457E4"
|
"6EBB39AFCA8C900635CFC11218CF293A612457E4"
|
||||||
|
|
||||||
#define DDNS_SNI_VER_STRING "DDNS"
|
#define DDNS_SNI_VER_STRING "DDNS"
|
||||||
|
|
||||||
|
|
||||||
// Destination URL
|
// Destination URL
|
||||||
#define DDNS_URL_V4_GLOBAL "https://x%c.x%c.dev.servers.ddns.softether-network.net/ddns/ddns.aspx"
|
#define DDNS_URL_V4_GLOBAL "https://x%c.x%c.dev.servers.ddns.softether-network.net/ddns/ddns.aspx"
|
||||||
#define DDNS_URL_V6_GLOBAL "https://x%c.x%c.dev.servers-v6.ddns.softether-network.net/ddns/ddns.aspx"
|
#define DDNS_URL_V6_GLOBAL "https://x%c.x%c.dev.servers-v6.ddns.softether-network.net/ddns/ddns.aspx"
|
||||||
#define DDNS_URL2_V4_GLOBAL "http://get-my-ip.ddns.softether-network.net/ddns/getmyip.ashx"
|
#define DDNS_URL2_V4_GLOBAL "http://get-my-ip.ddns.softether-network.net/ddns/getmyip.ashx"
|
||||||
#define DDNS_URL2_V6_GLOBAL "http://get-my-ip-v6.ddns.softether-network.net/ddns/getmyip.ashx"
|
#define DDNS_URL2_V6_GLOBAL "http://get-my-ip-v6.ddns.softether-network.net/ddns/getmyip.ashx"
|
||||||
|
|
||||||
#define DDNS_REPLACE_URL_FOR_EAST_BFLETS "https://senet-flets.v6.softether.co.jp/ddns/ddns.aspx"
|
#define DDNS_REPLACE_URL_FOR_EAST_BFLETS "https://senet-flets.v6.softether.co.jp/ddns/ddns.aspx"
|
||||||
#define DDNS_REPLACE_URL_FOR_EAST_NGN "https://senet.aoi.flets-east.jp/ddns/ddns.aspx"
|
#define DDNS_REPLACE_URL_FOR_EAST_NGN "https://senet.aoi.flets-east.jp/ddns/ddns.aspx"
|
||||||
#define DDNS_REPLACE_URL_FOR_WEST_NGN "https://senet.p-ns.flets-west.jp/ddns/ddns.aspx"
|
#define DDNS_REPLACE_URL_FOR_WEST_NGN "https://senet.p-ns.flets-west.jp/ddns/ddns.aspx"
|
||||||
|
|
||||||
#define DDNS_REPLACE_URL2_FOR_EAST_BFLETS "http://senet-flets.v6.softether.co.jp/ddns/getmyip.ashx"
|
#define DDNS_REPLACE_URL2_FOR_EAST_BFLETS "http://senet-flets.v6.softether.co.jp/ddns/getmyip.ashx"
|
||||||
#define DDNS_REPLACE_URL2_FOR_EAST_NGN "http://senet.aoi.flets-east.jp/ddns/getmyip.ashx"
|
#define DDNS_REPLACE_URL2_FOR_EAST_NGN "http://senet.aoi.flets-east.jp/ddns/getmyip.ashx"
|
||||||
#define DDNS_REPLACE_URL2_FOR_WEST_NGN "http://senet.p-ns.flets-west.jp/ddns/getmyip.ashx"
|
#define DDNS_REPLACE_URL2_FOR_WEST_NGN "http://senet.p-ns.flets-west.jp/ddns/getmyip.ashx"
|
||||||
|
|
||||||
// For China: Free version
|
// For China: Free version
|
||||||
#define DDNS_URL_V4_ALT "https://x%c.x%c.dev.servers.ddns.uxcom.jp/ddns/ddns.aspx"
|
#define DDNS_URL_V4_ALT "https://x%c.x%c.dev.servers.ddns.uxcom.jp/ddns/ddns.aspx"
|
||||||
#define DDNS_URL_V6_ALT "https://x%c.x%c.dev.servers-v6.ddns.uxcom.jp/ddns/ddns.aspx"
|
#define DDNS_URL_V6_ALT "https://x%c.x%c.dev.servers-v6.ddns.uxcom.jp/ddns/ddns.aspx"
|
||||||
#define DDNS_URL2_V4_ALT "http://get-my-ip.ddns.uxcom.jp/ddns/getmyip.ashx"
|
#define DDNS_URL2_V4_ALT "http://get-my-ip.ddns.uxcom.jp/ddns/getmyip.ashx"
|
||||||
#define DDNS_URL2_V6_ALT "http://get-my-ip-v6.ddns.uxcom.jp/ddns/getmyip.ashx"
|
#define DDNS_URL2_V6_ALT "http://get-my-ip-v6.ddns.uxcom.jp/ddns/getmyip.ashx"
|
||||||
|
|
||||||
#define DDNS_RPC_MAX_RECV_SIZE DYN32(DDNS_RPC_MAX_RECV_SIZE, (128 * 1024 * 1024))
|
#define DDNS_RPC_MAX_RECV_SIZE DYN32(DDNS_RPC_MAX_RECV_SIZE, (128 * 1024 * 1024))
|
||||||
|
|
||||||
// Connection Timeout
|
// Connection Timeout
|
||||||
#define DDNS_CONNECT_TIMEOUT DYN32(DDNS_CONNECT_TIMEOUT, (15 * 1000))
|
#define DDNS_CONNECT_TIMEOUT DYN32(DDNS_CONNECT_TIMEOUT, (15 * 1000))
|
||||||
|
|
||||||
// Communication time-out
|
// Communication time-out
|
||||||
#define DDNS_COMM_TIMEOUT DYN32(DDNS_COMM_TIMEOUT, (60 * 1000))
|
#define DDNS_COMM_TIMEOUT DYN32(DDNS_COMM_TIMEOUT, (60 * 1000))
|
||||||
|
|
||||||
// Maximum length of the host name
|
// Maximum length of the host name
|
||||||
#define DDNS_MAX_HOSTNAME 31
|
#define DDNS_MAX_HOSTNAME 31
|
||||||
|
|
||||||
// DDNS Version
|
// DDNS Version
|
||||||
#define DDNS_VERSION 1
|
#define DDNS_VERSION 1
|
||||||
|
|
||||||
// Period until the next registration in case of success
|
// Period until the next registration in case of success
|
||||||
#define DDNS_REGISTER_INTERVAL_OK_MIN DYN32(DDNS_REGISTER_INTERVAL_OK_MIN, (1 * 60 * 60 * 1000))
|
#define DDNS_REGISTER_INTERVAL_OK_MIN DYN32(DDNS_REGISTER_INTERVAL_OK_MIN, (1 * 60 * 60 * 1000))
|
||||||
#define DDNS_REGISTER_INTERVAL_OK_MAX DYN32(DDNS_REGISTER_INTERVAL_OK_MAX, (2 * 60 * 60 * 1000))
|
#define DDNS_REGISTER_INTERVAL_OK_MAX DYN32(DDNS_REGISTER_INTERVAL_OK_MAX, (2 * 60 * 60 * 1000))
|
||||||
|
|
||||||
// Period until the next registration in case of failure
|
// Period until the next registration in case of failure
|
||||||
#define DDNS_REGISTER_INTERVAL_NG_MIN DYN32(DDNS_REGISTER_INTERVAL_NG_MIN, (1 * 60 * 1000))
|
#define DDNS_REGISTER_INTERVAL_NG_MIN DYN32(DDNS_REGISTER_INTERVAL_NG_MIN, (1 * 60 * 1000))
|
||||||
#define DDNS_REGISTER_INTERVAL_NG_MAX DYN32(DDNS_REGISTER_INTERVAL_NG_MAX, (5 * 60 * 1000))
|
#define DDNS_REGISTER_INTERVAL_NG_MAX DYN32(DDNS_REGISTER_INTERVAL_NG_MAX, (5 * 60 * 1000))
|
||||||
|
|
||||||
// The self IP address acquisition interval (If last trial succeeded)
|
// The self IP address acquisition interval (If last trial succeeded)
|
||||||
#define DDNS_GETMYIP_INTERVAL_OK_MIN DYN32(DDNS_GETMYIP_INTERVAL_OK_MIN, (10 * 60 * 1000))
|
#define DDNS_GETMYIP_INTERVAL_OK_MIN DYN32(DDNS_GETMYIP_INTERVAL_OK_MIN, (10 * 60 * 1000))
|
||||||
#define DDNS_GETMYIP_INTERVAL_OK_MAX DYN32(DDNS_GETMYIP_INTERVAL_OK_MAX, (20 * 60 * 1000))
|
#define DDNS_GETMYIP_INTERVAL_OK_MAX DYN32(DDNS_GETMYIP_INTERVAL_OK_MAX, (20 * 60 * 1000))
|
||||||
|
|
||||||
// The self IP address acquisition interval (If last trial failed)
|
// The self IP address acquisition interval (If last trial failed)
|
||||||
#define DDNS_GETMYIP_INTERVAL_NG_MIN DYN32(DDNS_GETMYIP_INTERVAL_NG_MIN, (1 * 60 * 1000))
|
#define DDNS_GETMYIP_INTERVAL_NG_MIN DYN32(DDNS_GETMYIP_INTERVAL_NG_MIN, (1 * 60 * 1000))
|
||||||
#define DDNS_GETMYIP_INTERVAL_NG_MAX DYN32(DDNS_GETMYIP_INTERVAL_NG_MAX, (5 * 60 * 1000))
|
#define DDNS_GETMYIP_INTERVAL_NG_MAX DYN32(DDNS_GETMYIP_INTERVAL_NG_MAX, (5 * 60 * 1000))
|
||||||
|
|
||||||
// Time difference to communicate with the DDNS server after a predetermined time has elapsed since the VPN Azure is disconnected
|
// Time difference to communicate with the DDNS server after a predetermined time has elapsed since the VPN Azure is disconnected
|
||||||
#define DDNS_VPN_AZURE_CONNECT_ERROR_DDNS_RETRY_TIME_DIFF DYN32(DDNS_VPN_AZURE_CONNECT_ERROR_DDNS_RETRY_TIME_DIFF, (120 * 1000))
|
#define DDNS_VPN_AZURE_CONNECT_ERROR_DDNS_RETRY_TIME_DIFF DYN32(DDNS_VPN_AZURE_CONNECT_ERROR_DDNS_RETRY_TIME_DIFF, (120 * 1000))
|
||||||
#define DDNS_VPN_AZURE_CONNECT_ERROR_DDNS_RETRY_TIME_DIFF_MAX DYN32(DDNS_VPN_AZURE_CONNECT_ERROR_DDNS_RETRY_TIME_DIFF_MAX, (10 * 60 * 1000))
|
#define DDNS_VPN_AZURE_CONNECT_ERROR_DDNS_RETRY_TIME_DIFF_MAX DYN32(DDNS_VPN_AZURE_CONNECT_ERROR_DDNS_RETRY_TIME_DIFF_MAX, (10 * 60 * 1000))
|
||||||
|
|
||||||
// DDNS Client
|
// DDNS Client
|
||||||
struct DDNS_CLIENT
|
struct DDNS_CLIENT
|
||||||
{
|
{
|
||||||
CEDAR *Cedar; // Cedar
|
CEDAR *Cedar; // Cedar
|
||||||
THREAD *Thread; // Thread
|
THREAD *Thread; // Thread
|
||||||
UCHAR Key[SHA1_SIZE]; // Key
|
UCHAR Key[SHA1_SIZE]; // Key
|
||||||
LOCK *Lock; // Lock
|
LOCK *Lock; // Lock
|
||||||
volatile bool Halt; // Halt flag
|
volatile bool Halt; // Halt flag
|
||||||
EVENT *Event; // Halt event
|
EVENT *Event; // Halt event
|
||||||
char CurrentHostName[DDNS_MAX_HOSTNAME + 1]; // Current host name
|
char CurrentHostName[DDNS_MAX_HOSTNAME + 1]; // Current host name
|
||||||
char CurrentFqdn[MAX_SIZE]; // Current FQDN
|
char CurrentFqdn[MAX_SIZE]; // Current FQDN
|
||||||
char DnsSuffix[MAX_SIZE]; // DNS suffix
|
char DnsSuffix[MAX_SIZE]; // DNS suffix
|
||||||
char CurrentIPv4[MAX_SIZE]; // Current IPv4 address
|
char CurrentIPv4[MAX_SIZE]; // Current IPv4 address
|
||||||
char CurrentIPv6[MAX_SIZE]; // Current IPv6 address
|
char CurrentIPv6[MAX_SIZE]; // Current IPv6 address
|
||||||
UINT Err_IPv4, Err_IPv6; // Last error
|
UINT Err_IPv4, Err_IPv6; // Last error
|
||||||
UINT Err_IPv4_GetMyIp, Err_IPv6_GetMyIp; // Last error (obtaining self IP address)
|
UINT Err_IPv4_GetMyIp, Err_IPv6_GetMyIp; // Last error (obtaining self IP address)
|
||||||
bool KeyChanged; // Flag to indicate that the key has been changed
|
bool KeyChanged; // Flag to indicate that the key has been changed
|
||||||
char LastMyIPv4[MAX_SIZE]; // Self IPv4 address that were acquired on last
|
char LastMyIPv4[MAX_SIZE]; // Self IPv4 address that were acquired on last
|
||||||
char LastMyIPv6[MAX_SIZE]; // Self IPv6 address that were acquired on last
|
char LastMyIPv6[MAX_SIZE]; // Self IPv6 address that were acquired on last
|
||||||
char CurrentAzureIp[MAX_SIZE]; // IP address of Azure Server to be used
|
char CurrentAzureIp[MAX_SIZE]; // IP address of Azure Server to be used
|
||||||
UINT64 CurrentAzureTimestamp; // Time stamp to be presented to the Azure Server
|
UINT64 CurrentAzureTimestamp; // Time stamp to be presented to the Azure Server
|
||||||
char CurrentAzureSignature[MAX_SIZE]; // Signature to be presented to the Azure Server
|
char CurrentAzureSignature[MAX_SIZE]; // Signature to be presented to the Azure Server
|
||||||
char AzureCertHash[MAX_SIZE]; // Azure Server certificate hash
|
char AzureCertHash[MAX_SIZE]; // Azure Server certificate hash
|
||||||
INTERNET_SETTING InternetSetting; // Internet connection settings
|
INTERNET_SETTING InternetSetting; // Internet connection settings
|
||||||
|
|
||||||
UINT64 NextRegisterTick_IPv4, NextRegisterTick_IPv6; // Next register time
|
UINT64 NextRegisterTick_IPv4, NextRegisterTick_IPv6; // Next register time
|
||||||
UINT64 NextGetMyIpTick_IPv4, NextGetMyIpTick_IPv6; // Next self IP acquisition time
|
UINT64 NextGetMyIpTick_IPv4, NextGetMyIpTick_IPv6; // Next self IP acquisition time
|
||||||
};
|
};
|
||||||
|
|
||||||
// DDNS Register Param
|
// DDNS Register Param
|
||||||
struct DDNS_REGISTER_PARAM
|
struct DDNS_REGISTER_PARAM
|
||||||
{
|
{
|
||||||
char NewHostname[DDNS_MAX_HOSTNAME + 1]; // Host name after the change
|
char NewHostname[DDNS_MAX_HOSTNAME + 1]; // Host name after the change
|
||||||
};
|
};
|
||||||
|
|
||||||
// The current status of the DDNS
|
// The current status of the DDNS
|
||||||
struct DDNS_CLIENT_STATUS
|
struct DDNS_CLIENT_STATUS
|
||||||
{
|
{
|
||||||
UINT Err_IPv4, Err_IPv6; // Last error
|
UINT Err_IPv4, Err_IPv6; // Last error
|
||||||
wchar_t ErrStr_IPv4[MAX_SIZE];
|
wchar_t ErrStr_IPv4[MAX_SIZE];
|
||||||
wchar_t ErrStr_IPv6[MAX_SIZE];
|
wchar_t ErrStr_IPv6[MAX_SIZE];
|
||||||
char CurrentHostName[DDNS_MAX_HOSTNAME + 1]; // Current host name
|
char CurrentHostName[DDNS_MAX_HOSTNAME + 1]; // Current host name
|
||||||
char CurrentFqdn[MAX_SIZE]; // Current FQDN
|
char CurrentFqdn[MAX_SIZE]; // Current FQDN
|
||||||
char DnsSuffix[MAX_SIZE]; // DNS suffix
|
char DnsSuffix[MAX_SIZE]; // DNS suffix
|
||||||
char CurrentIPv4[MAX_SIZE]; // Current IPv4 address
|
char CurrentIPv4[MAX_SIZE]; // Current IPv4 address
|
||||||
char CurrentIPv6[MAX_SIZE]; // Current IPv6 address
|
char CurrentIPv6[MAX_SIZE]; // Current IPv6 address
|
||||||
char CurrentAzureIp[MAX_SIZE]; // IP address of Azure Server to be used
|
char CurrentAzureIp[MAX_SIZE]; // IP address of Azure Server to be used
|
||||||
UINT64 CurrentAzureTimestamp; // Time stamp to be presented to the Azure Server
|
UINT64 CurrentAzureTimestamp; // Time stamp to be presented to the Azure Server
|
||||||
char CurrentAzureSignature[MAX_SIZE]; // Signature to be presented to the Azure Server
|
char CurrentAzureSignature[MAX_SIZE]; // Signature to be presented to the Azure Server
|
||||||
char AzureCertHash[MAX_SIZE]; // Azure Server certificate hash
|
char AzureCertHash[MAX_SIZE]; // Azure Server certificate hash
|
||||||
INTERNET_SETTING InternetSetting; // Internet settings
|
INTERNET_SETTING InternetSetting; // Internet settings
|
||||||
};
|
};
|
||||||
|
|
||||||
// Function prototype
|
// Function prototype
|
||||||
DDNS_CLIENT *NewDDNSClient(CEDAR *cedar, UCHAR *key, INTERNET_SETTING *t);
|
DDNS_CLIENT *NewDDNSClient(CEDAR *cedar, UCHAR *key, INTERNET_SETTING *t);
|
||||||
void FreeDDNSClient(DDNS_CLIENT *c);
|
void FreeDDNSClient(DDNS_CLIENT *c);
|
||||||
void DCGenNewKey(UCHAR *key);
|
void DCGenNewKey(UCHAR *key);
|
||||||
void DCThread(THREAD *thread, void *param);
|
void DCThread(THREAD *thread, void *param);
|
||||||
UINT DCRegister(DDNS_CLIENT *c, bool ipv6, DDNS_REGISTER_PARAM *p, char *replace_v6);
|
UINT DCRegister(DDNS_CLIENT *c, bool ipv6, DDNS_REGISTER_PARAM *p, char *replace_v6);
|
||||||
UINT DCGetMyIpMain(DDNS_CLIENT *c, bool ipv6, char *dst, UINT dst_size, bool use_ssl, char *replace_v6);
|
UINT DCGetMyIpMain(DDNS_CLIENT *c, bool ipv6, char *dst, UINT dst_size, bool use_ssl, char *replace_v6);
|
||||||
UINT DCGetMyIp(DDNS_CLIENT *c, bool ipv6, char *dst, UINT dst_size, char *replace_v6);
|
UINT DCGetMyIp(DDNS_CLIENT *c, bool ipv6, char *dst, UINT dst_size, char *replace_v6);
|
||||||
void DCGetStatus(DDNS_CLIENT *c, DDNS_CLIENT_STATUS *st);
|
void DCGetStatus(DDNS_CLIENT *c, DDNS_CLIENT_STATUS *st);
|
||||||
UINT DCChangeHostName(DDNS_CLIENT *c, char *hostname);
|
UINT DCChangeHostName(DDNS_CLIENT *c, char *hostname);
|
||||||
void DCSetInternetSetting(DDNS_CLIENT *c, INTERNET_SETTING *t);
|
void DCSetInternetSetting(DDNS_CLIENT *c, INTERNET_SETTING *t);
|
||||||
void DCGetInternetSetting(DDNS_CLIENT *c, INTERNET_SETTING *t);
|
void DCGetInternetSetting(DDNS_CLIENT *c, INTERNET_SETTING *t);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif // DDNS_H
|
#endif // DDNS_H
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,159 +1,159 @@
|
|||||||
// SoftEther VPN Source Code - Developer Edition Master Branch
|
// SoftEther VPN Source Code - Developer Edition Master Branch
|
||||||
// Cedar Communication Module
|
// Cedar Communication Module
|
||||||
|
|
||||||
|
|
||||||
// Database.c
|
// Database.c
|
||||||
// License database
|
// License database
|
||||||
|
|
||||||
#include "CedarPch.h"
|
#include "CedarPch.h"
|
||||||
|
|
||||||
// Get the License status string
|
// Get the License status string
|
||||||
wchar_t *LiGetLicenseStatusStr(UINT i)
|
wchar_t *LiGetLicenseStatusStr(UINT i)
|
||||||
{
|
{
|
||||||
wchar_t *ret = _UU("LICENSE_STATUS_OTHERERROR");
|
wchar_t *ret = _UU("LICENSE_STATUS_OTHERERROR");
|
||||||
|
|
||||||
switch (i)
|
switch (i)
|
||||||
{
|
{
|
||||||
case LICENSE_STATUS_OK:
|
case LICENSE_STATUS_OK:
|
||||||
ret = _UU("LICENSE_STATUS_OK");
|
ret = _UU("LICENSE_STATUS_OK");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LICENSE_STATUS_EXPIRED:
|
case LICENSE_STATUS_EXPIRED:
|
||||||
ret = _UU("LICENSE_STATUS_EXPIRED");
|
ret = _UU("LICENSE_STATUS_EXPIRED");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LICENSE_STATUS_ID_DIFF:
|
case LICENSE_STATUS_ID_DIFF:
|
||||||
ret = _UU("LICENSE_STATUS_ID_DIFF");
|
ret = _UU("LICENSE_STATUS_ID_DIFF");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LICENSE_STATUS_DUP:
|
case LICENSE_STATUS_DUP:
|
||||||
ret = _UU("LICENSE_STATUS_DUP");
|
ret = _UU("LICENSE_STATUS_DUP");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LICENSE_STATUS_INSUFFICIENT:
|
case LICENSE_STATUS_INSUFFICIENT:
|
||||||
ret = _UU("LICENSE_STATUS_INSUFFICIENT");
|
ret = _UU("LICENSE_STATUS_INSUFFICIENT");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LICENSE_STATUS_COMPETITION:
|
case LICENSE_STATUS_COMPETITION:
|
||||||
ret = _UU("LICENSE_STATUS_COMPETITION");
|
ret = _UU("LICENSE_STATUS_COMPETITION");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LICENSE_STATUS_NONSENSE:
|
case LICENSE_STATUS_NONSENSE:
|
||||||
ret = _UU("LICENSE_STATUS_NONSENSE");
|
ret = _UU("LICENSE_STATUS_NONSENSE");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LICENSE_STATUS_CPU:
|
case LICENSE_STATUS_CPU:
|
||||||
ret = _UU("LICENSE_STATUS_CPU");
|
ret = _UU("LICENSE_STATUS_CPU");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *li_keybit_chars = "ABCDEFGHJKLMNPQRSTUVWXYZ12345678";
|
static char *li_keybit_chars = "ABCDEFGHJKLMNPQRSTUVWXYZ12345678";
|
||||||
|
|
||||||
// Convert the string to a key bit
|
// Convert the string to a key bit
|
||||||
bool LiStrToKeyBit(UCHAR *keybit, char *keystr)
|
bool LiStrToKeyBit(UCHAR *keybit, char *keystr)
|
||||||
{
|
{
|
||||||
UINT x[36];
|
UINT x[36];
|
||||||
UINT i, wp;
|
UINT i, wp;
|
||||||
char *str;
|
char *str;
|
||||||
// Validate arguments
|
// Validate arguments
|
||||||
if (keybit == NULL || keystr == NULL)
|
if (keybit == NULL || keystr == NULL)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
str = CopyStr(keystr);
|
str = CopyStr(keystr);
|
||||||
Trim(str);
|
Trim(str);
|
||||||
|
|
||||||
wp = 0;
|
wp = 0;
|
||||||
if (StrLen(str) != 41)
|
if (StrLen(str) != 41)
|
||||||
{
|
{
|
||||||
Free(str);
|
Free(str);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0;i < 36;i++)
|
for (i = 0;i < 36;i++)
|
||||||
{
|
{
|
||||||
char c = str[wp++];
|
char c = str[wp++];
|
||||||
UINT j;
|
UINT j;
|
||||||
|
|
||||||
if (((i % 6) == 5) && (i != 35))
|
if (((i % 6) == 5) && (i != 35))
|
||||||
{
|
{
|
||||||
if (str[wp++] != '-')
|
if (str[wp++] != '-')
|
||||||
{
|
{
|
||||||
Free(str);
|
Free(str);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
x[i] = INFINITE;
|
x[i] = INFINITE;
|
||||||
for (j = 0;j < 32;j++)
|
for (j = 0;j < 32;j++)
|
||||||
{
|
{
|
||||||
if (ToUpper(c) == li_keybit_chars[j])
|
if (ToUpper(c) == li_keybit_chars[j])
|
||||||
{
|
{
|
||||||
x[i] = j;
|
x[i] = j;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (x[i] == INFINITE)
|
if (x[i] == INFINITE)
|
||||||
{
|
{
|
||||||
Free(str);
|
Free(str);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Zero(keybit, 23);
|
Zero(keybit, 23);
|
||||||
|
|
||||||
keybit[0] = x[0] << 1 | x[1] >> 4;
|
keybit[0] = x[0] << 1 | x[1] >> 4;
|
||||||
keybit[1] = x[1] << 4 | x[2] >> 1;
|
keybit[1] = x[1] << 4 | x[2] >> 1;
|
||||||
keybit[2] = x[2] << 7 | x[3] << 2 | x[4] >> 3;
|
keybit[2] = x[2] << 7 | x[3] << 2 | x[4] >> 3;
|
||||||
keybit[3] = x[4] << 5 | x[5];
|
keybit[3] = x[4] << 5 | x[5];
|
||||||
|
|
||||||
keybit[4] = x[6] << 3 | x[7] >> 2;
|
keybit[4] = x[6] << 3 | x[7] >> 2;
|
||||||
keybit[5] = x[7] << 6 | x[8] << 1 | x[9] >> 4;
|
keybit[5] = x[7] << 6 | x[8] << 1 | x[9] >> 4;
|
||||||
keybit[6] = x[9] << 4 | x[10] >> 1;
|
keybit[6] = x[9] << 4 | x[10] >> 1;
|
||||||
keybit[7] = x[10] << 7 | x[11] << 2 | x[12] >> 3;
|
keybit[7] = x[10] << 7 | x[11] << 2 | x[12] >> 3;
|
||||||
keybit[8] = x[12] << 5 | x[13];
|
keybit[8] = x[12] << 5 | x[13];
|
||||||
|
|
||||||
keybit[9] = x[14] << 3 | x[15] >> 2;
|
keybit[9] = x[14] << 3 | x[15] >> 2;
|
||||||
keybit[10] = x[15] << 6 | x[16] << 1 | x[17] >> 4;
|
keybit[10] = x[15] << 6 | x[16] << 1 | x[17] >> 4;
|
||||||
keybit[11] = x[17] << 4 | x[18] >> 1;
|
keybit[11] = x[17] << 4 | x[18] >> 1;
|
||||||
keybit[12] = x[18] << 7 | x[19] << 2 | x[20] >> 3;
|
keybit[12] = x[18] << 7 | x[19] << 2 | x[20] >> 3;
|
||||||
keybit[13] = x[20] << 5 | x[21];
|
keybit[13] = x[20] << 5 | x[21];
|
||||||
|
|
||||||
keybit[14] = x[22] << 3 | x[23] >> 2;
|
keybit[14] = x[22] << 3 | x[23] >> 2;
|
||||||
keybit[15] = x[23] << 6 | x[24] << 1 | x[25] >> 4;
|
keybit[15] = x[23] << 6 | x[24] << 1 | x[25] >> 4;
|
||||||
keybit[16] = x[25] << 4 | x[26] >> 1;
|
keybit[16] = x[25] << 4 | x[26] >> 1;
|
||||||
keybit[17] = x[26] << 7 | x[27] << 2 | x[28] >> 3;
|
keybit[17] = x[26] << 7 | x[27] << 2 | x[28] >> 3;
|
||||||
keybit[18] = x[28] << 5 | x[29];
|
keybit[18] = x[28] << 5 | x[29];
|
||||||
|
|
||||||
keybit[19] = x[30] << 3 | x[31] >> 2;
|
keybit[19] = x[30] << 3 | x[31] >> 2;
|
||||||
keybit[20] = x[31] << 6 | x[32] << 1 | x[33] >> 4;
|
keybit[20] = x[31] << 6 | x[32] << 1 | x[33] >> 4;
|
||||||
keybit[21] = x[33] << 4 | x[34] >> 1;
|
keybit[21] = x[33] << 4 | x[34] >> 1;
|
||||||
keybit[22] = x[34] << 7 | x[35] << 2;
|
keybit[22] = x[34] << 7 | x[35] << 2;
|
||||||
|
|
||||||
Free(str);
|
Free(str);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Determine whether the string is a license key
|
// Determine whether the string is a license key
|
||||||
bool LiIsLicenseKey(char *str)
|
bool LiIsLicenseKey(char *str)
|
||||||
{
|
{
|
||||||
UCHAR keybit[23];
|
UCHAR keybit[23];
|
||||||
// Validate arguments
|
// Validate arguments
|
||||||
if (str == NULL)
|
if (str == NULL)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (LiStrToKeyBit(keybit, str) == false)
|
if (LiStrToKeyBit(keybit, str) == false)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,18 +1,18 @@
|
|||||||
// SoftEther VPN Source Code - Developer Edition Master Branch
|
// SoftEther VPN Source Code - Developer Edition Master Branch
|
||||||
// Cedar Communication Module
|
// Cedar Communication Module
|
||||||
|
|
||||||
|
|
||||||
// Database.h
|
// Database.h
|
||||||
// Header of Database.c
|
// Header of Database.c
|
||||||
|
|
||||||
#ifndef DATABASE_H
|
#ifndef DATABASE_H
|
||||||
#define DATABASE_H
|
#define DATABASE_H
|
||||||
|
|
||||||
wchar_t *LiGetLicenseStatusStr(UINT i);
|
wchar_t *LiGetLicenseStatusStr(UINT i);
|
||||||
bool LiIsLicenseKey(char *str);
|
bool LiIsLicenseKey(char *str);
|
||||||
bool LiStrToKeyBit(UCHAR *keybit, char *keystr);
|
bool LiStrToKeyBit(UCHAR *keybit, char *keystr);
|
||||||
|
|
||||||
|
|
||||||
#endif // DATABASE_H
|
#endif // DATABASE_H
|
||||||
|
|
||||||
|
|
||||||
|
2792
src/Cedar/EM.c
2792
src/Cedar/EM.c
File diff suppressed because it is too large
Load Diff
@ -1,16 +1,16 @@
|
|||||||
// SoftEther VPN Source Code - Developer Edition Master Branch
|
// SoftEther VPN Source Code - Developer Edition Master Branch
|
||||||
// Cedar Communication Module
|
// Cedar Communication Module
|
||||||
|
|
||||||
|
|
||||||
// EM.h
|
// EM.h
|
||||||
// Header of EM.c
|
// Header of EM.c
|
||||||
|
|
||||||
#ifndef EM_H
|
#ifndef EM_H
|
||||||
#define EM_H
|
#define EM_H
|
||||||
|
|
||||||
// Public function
|
// Public function
|
||||||
void EMExec();
|
void EMExec();
|
||||||
|
|
||||||
#endif // EM_H
|
#endif // EM_H
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,43 +1,43 @@
|
|||||||
// SoftEther VPN Source Code - Developer Edition Master Branch
|
// SoftEther VPN Source Code - Developer Edition Master Branch
|
||||||
// Cedar Communication Module
|
// Cedar Communication Module
|
||||||
|
|
||||||
|
|
||||||
// EMInner.h
|
// EMInner.h
|
||||||
// Inner header of EM.c
|
// Inner header of EM.c
|
||||||
|
|
||||||
// Constants
|
// Constants
|
||||||
#define EM_REG_KEY "Software\\" GC_REG_COMPANY_NAME "\\EtherLogger\\Manager"
|
#define EM_REG_KEY "Software\\" GC_REG_COMPANY_NAME "\\EtherLogger\\Manager"
|
||||||
|
|
||||||
// Inner structure
|
// Inner structure
|
||||||
typedef struct EM_ADD
|
typedef struct EM_ADD
|
||||||
{
|
{
|
||||||
RPC *Rpc;
|
RPC *Rpc;
|
||||||
bool NewMode;
|
bool NewMode;
|
||||||
char DeviceName[MAX_SIZE];
|
char DeviceName[MAX_SIZE];
|
||||||
} EM_ADD;
|
} EM_ADD;
|
||||||
|
|
||||||
// Inner functions
|
// Inner functions
|
||||||
void EMMain(RPC *r);
|
void EMMain(RPC *r);
|
||||||
UINT EmMainDlg(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, void *param);
|
UINT EmMainDlg(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, void *param);
|
||||||
void EmMainInit(HWND hWnd, RPC *r);
|
void EmMainInit(HWND hWnd, RPC *r);
|
||||||
void EmMainUpdate(HWND hWnd, RPC *r);
|
void EmMainUpdate(HWND hWnd, RPC *r);
|
||||||
void EmMainRefresh(HWND hWnd, RPC *r);
|
void EmMainRefresh(HWND hWnd, RPC *r);
|
||||||
void EmAdd(HWND hWnd, RPC *r, char *device_name);
|
void EmAdd(HWND hWnd, RPC *r, char *device_name);
|
||||||
UINT EmAddDlg(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, void *param);
|
UINT EmAddDlg(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, void *param);
|
||||||
void EmAddInit(HWND hWnd, EM_ADD *p);
|
void EmAddInit(HWND hWnd, EM_ADD *p);
|
||||||
void EmDlgToHubLog(HWND hWnd, HUB_LOG *g);
|
void EmDlgToHubLog(HWND hWnd, HUB_LOG *g);
|
||||||
void EmHubLogToDlg(HWND hWnd, HUB_LOG *g);
|
void EmHubLogToDlg(HWND hWnd, HUB_LOG *g);
|
||||||
void EmAddOk(HWND hWnd, EM_ADD *p);
|
void EmAddOk(HWND hWnd, EM_ADD *p);
|
||||||
void EmAddUpdate(HWND hWnd, EM_ADD *p);
|
void EmAddUpdate(HWND hWnd, EM_ADD *p);
|
||||||
UINT EmPasswordDlg(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, void *param);
|
UINT EmPasswordDlg(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, void *param);
|
||||||
UINT EmLicenseDlg(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, void *param);
|
UINT EmLicenseDlg(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, void *param);
|
||||||
void EmLicenseDlgInit(HWND hWnd, RPC *s);
|
void EmLicenseDlgInit(HWND hWnd, RPC *s);
|
||||||
void EmLicenseDlgRefresh(HWND hWnd, RPC *s);
|
void EmLicenseDlgRefresh(HWND hWnd, RPC *s);
|
||||||
void EmLicenseDlgUpdate(HWND hWnd, RPC *s);
|
void EmLicenseDlgUpdate(HWND hWnd, RPC *s);
|
||||||
bool EmLicenseAdd(HWND hWnd, RPC *s);
|
bool EmLicenseAdd(HWND hWnd, RPC *s);
|
||||||
UINT EmLicenseAddDlg(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, void *param);
|
UINT EmLicenseAddDlg(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, void *param);
|
||||||
void EmLicenseAddDlgInit(HWND hWnd, RPC *s);
|
void EmLicenseAddDlgInit(HWND hWnd, RPC *s);
|
||||||
void EmLicenseAddDlgUpdate(HWND hWnd, RPC *s);
|
void EmLicenseAddDlgUpdate(HWND hWnd, RPC *s);
|
||||||
void EmLicenseAddDlgShiftTextItem(HWND hWnd, UINT id1, UINT id2, UINT *next_focus);
|
void EmLicenseAddDlgShiftTextItem(HWND hWnd, UINT id1, UINT id2, UINT *next_focus);
|
||||||
void EmLicenseAddDlgGetText(HWND hWnd, char *str, UINT size);
|
void EmLicenseAddDlgGetText(HWND hWnd, char *str, UINT size);
|
||||||
void EmLicenseAddDlgOnOk(HWND hWnd, RPC *s);
|
void EmLicenseAddDlgOnOk(HWND hWnd, RPC *s);
|
||||||
|
2516
src/Cedar/EtherLog.c
2516
src/Cedar/EtherLog.c
File diff suppressed because it is too large
Load Diff
@ -1,171 +1,171 @@
|
|||||||
// SoftEther VPN Source Code - Developer Edition Master Branch
|
// SoftEther VPN Source Code - Developer Edition Master Branch
|
||||||
// Cedar Communication Module
|
// Cedar Communication Module
|
||||||
|
|
||||||
|
|
||||||
// EtherLog.h
|
// EtherLog.h
|
||||||
// Header of EtherLog.c
|
// Header of EtherLog.c
|
||||||
|
|
||||||
#ifndef ETHERLOG_H
|
#ifndef ETHERLOG_H
|
||||||
#define ETHERLOG_H
|
#define ETHERLOG_H
|
||||||
|
|
||||||
// Whether this is a beta version
|
// Whether this is a beta version
|
||||||
#define ELOG_IS_BETA true
|
#define ELOG_IS_BETA true
|
||||||
|
|
||||||
// Beta expiration date
|
// Beta expiration date
|
||||||
#define ELOG_BETA_EXPIRES_YEAR 2008
|
#define ELOG_BETA_EXPIRES_YEAR 2008
|
||||||
#define ELOG_BETA_EXPIRES_MONTH 12
|
#define ELOG_BETA_EXPIRES_MONTH 12
|
||||||
#define ELOG_BETA_EXPIRES_DAY 2
|
#define ELOG_BETA_EXPIRES_DAY 2
|
||||||
|
|
||||||
// Version information
|
// Version information
|
||||||
//#define EL_VER 201
|
//#define EL_VER 201
|
||||||
//#define EL_BUILD 1600
|
//#define EL_BUILD 1600
|
||||||
//#define EL_BETA 1
|
//#define EL_BETA 1
|
||||||
#define MAX_LOGGING_QUEUE_LEN 100000
|
#define MAX_LOGGING_QUEUE_LEN 100000
|
||||||
|
|
||||||
// RPC related
|
// RPC related
|
||||||
struct RPC_ADD_DEVICE
|
struct RPC_ADD_DEVICE
|
||||||
{
|
{
|
||||||
char DeviceName[MAX_SIZE]; // Device name
|
char DeviceName[MAX_SIZE]; // Device name
|
||||||
HUB_LOG LogSetting; // Log settings
|
HUB_LOG LogSetting; // Log settings
|
||||||
bool NoPromiscuous; // Without promiscuous mode
|
bool NoPromiscuous; // Without promiscuous mode
|
||||||
};
|
};
|
||||||
|
|
||||||
struct RPC_DELETE_DEVICE
|
struct RPC_DELETE_DEVICE
|
||||||
{
|
{
|
||||||
char DeviceName[MAX_SIZE]; // Device name
|
char DeviceName[MAX_SIZE]; // Device name
|
||||||
};
|
};
|
||||||
|
|
||||||
struct RPC_ENUM_DEVICE_ITEM
|
struct RPC_ENUM_DEVICE_ITEM
|
||||||
{
|
{
|
||||||
char DeviceName[MAX_SIZE]; // Device name
|
char DeviceName[MAX_SIZE]; // Device name
|
||||||
bool Active; // Running flag
|
bool Active; // Running flag
|
||||||
};
|
};
|
||||||
|
|
||||||
struct RPC_ENUM_DEVICE
|
struct RPC_ENUM_DEVICE
|
||||||
{
|
{
|
||||||
UINT NumItem; // Number of items
|
UINT NumItem; // Number of items
|
||||||
RPC_ENUM_DEVICE_ITEM *Items; // Items
|
RPC_ENUM_DEVICE_ITEM *Items; // Items
|
||||||
bool IsLicenseSupported; // Whether the license system is supported
|
bool IsLicenseSupported; // Whether the license system is supported
|
||||||
};
|
};
|
||||||
|
|
||||||
// License status of the service
|
// License status of the service
|
||||||
struct RPC_EL_LICENSE_STATUS
|
struct RPC_EL_LICENSE_STATUS
|
||||||
{
|
{
|
||||||
BOOL Valid; // Enable flag
|
BOOL Valid; // Enable flag
|
||||||
UINT64 SystemId; // System ID
|
UINT64 SystemId; // System ID
|
||||||
UINT64 SystemExpires; // System expiration date
|
UINT64 SystemExpires; // System expiration date
|
||||||
};
|
};
|
||||||
|
|
||||||
// Device
|
// Device
|
||||||
struct EL_DEVICE
|
struct EL_DEVICE
|
||||||
{
|
{
|
||||||
EL *el; // EL
|
EL *el; // EL
|
||||||
char DeviceName[MAX_SIZE]; // Device name
|
char DeviceName[MAX_SIZE]; // Device name
|
||||||
HUB_LOG LogSetting; // Log settings
|
HUB_LOG LogSetting; // Log settings
|
||||||
THREAD *Thread; // Thread
|
THREAD *Thread; // Thread
|
||||||
CANCEL *Cancel1; // Cancel 1
|
CANCEL *Cancel1; // Cancel 1
|
||||||
CANCEL *Cancel2; // Cancel 2
|
CANCEL *Cancel2; // Cancel 2
|
||||||
volatile bool Halt; // Halting flag
|
volatile bool Halt; // Halting flag
|
||||||
bool Active; // Running flag
|
bool Active; // Running flag
|
||||||
bool NoPromiscuous; // Without promiscuous mode
|
bool NoPromiscuous; // Without promiscuous mode
|
||||||
LOG *Logger; // Logger
|
LOG *Logger; // Logger
|
||||||
};
|
};
|
||||||
|
|
||||||
// License status
|
// License status
|
||||||
struct EL_LICENSE_STATUS
|
struct EL_LICENSE_STATUS
|
||||||
{
|
{
|
||||||
BOOL Valid; // Enable flag
|
BOOL Valid; // Enable flag
|
||||||
UINT64 SystemId; // System ID
|
UINT64 SystemId; // System ID
|
||||||
UINT64 Expires; // Expiration date
|
UINT64 Expires; // Expiration date
|
||||||
};
|
};
|
||||||
|
|
||||||
// EtherLogger
|
// EtherLogger
|
||||||
struct EL
|
struct EL
|
||||||
{
|
{
|
||||||
LOCK *lock; // Lock
|
LOCK *lock; // Lock
|
||||||
REF *ref; // Reference counter
|
REF *ref; // Reference counter
|
||||||
CEDAR *Cedar; // Cedar
|
CEDAR *Cedar; // Cedar
|
||||||
LIST *DeviceList; // Device list
|
LIST *DeviceList; // Device list
|
||||||
CFG_RW *CfgRw; // Config R/W
|
CFG_RW *CfgRw; // Config R/W
|
||||||
UINT Port; // Port number
|
UINT Port; // Port number
|
||||||
LISTENER *Listener; // Listener
|
LISTENER *Listener; // Listener
|
||||||
UCHAR HashedPassword[SHA1_SIZE]; // Password
|
UCHAR HashedPassword[SHA1_SIZE]; // Password
|
||||||
LIST *AdminThreadList; // Management thread list
|
LIST *AdminThreadList; // Management thread list
|
||||||
LIST *AdminSockList; // Management socket list
|
LIST *AdminSockList; // Management socket list
|
||||||
LICENSE_SYSTEM *LicenseSystem; // License system
|
LICENSE_SYSTEM *LicenseSystem; // License system
|
||||||
EL_LICENSE_STATUS *LicenseStatus; // License status
|
EL_LICENSE_STATUS *LicenseStatus; // License status
|
||||||
UINT64 AutoDeleteCheckDiskFreeSpaceMin; // Minimum free disk space
|
UINT64 AutoDeleteCheckDiskFreeSpaceMin; // Minimum free disk space
|
||||||
ERASER *Eraser; // Eraser
|
ERASER *Eraser; // Eraser
|
||||||
};
|
};
|
||||||
|
|
||||||
// Function prototype
|
// Function prototype
|
||||||
void ElStart();
|
void ElStart();
|
||||||
void ElStop();
|
void ElStop();
|
||||||
EL *NewEl();
|
EL *NewEl();
|
||||||
void ReleaseEl(EL *e);
|
void ReleaseEl(EL *e);
|
||||||
void CleanupEl(EL *e);
|
void CleanupEl(EL *e);
|
||||||
void ElInitConfig(EL *e);
|
void ElInitConfig(EL *e);
|
||||||
void ElFreeConfig(EL *e);
|
void ElFreeConfig(EL *e);
|
||||||
bool ElLoadConfig(EL *e);
|
bool ElLoadConfig(EL *e);
|
||||||
void ElLoadConfigFromFolder(EL *e, FOLDER *root);
|
void ElLoadConfigFromFolder(EL *e, FOLDER *root);
|
||||||
void ElSaveConfig(EL *e);
|
void ElSaveConfig(EL *e);
|
||||||
void ElSaveConfigToFolder(EL *e, FOLDER *root);
|
void ElSaveConfigToFolder(EL *e, FOLDER *root);
|
||||||
int ElCompareDevice(void *p1, void *p2);
|
int ElCompareDevice(void *p1, void *p2);
|
||||||
bool ElAddCaptureDevice(EL *e, char *name, HUB_LOG *log, bool no_promiscuous);
|
bool ElAddCaptureDevice(EL *e, char *name, HUB_LOG *log, bool no_promiscuous);
|
||||||
bool ElDeleteCaptureDevice(EL *e, char *name);
|
bool ElDeleteCaptureDevice(EL *e, char *name);
|
||||||
bool ElSetCaptureDeviceLogSetting(EL *e, char *name, HUB_LOG *log);
|
bool ElSetCaptureDeviceLogSetting(EL *e, char *name, HUB_LOG *log);
|
||||||
void ElCaptureThread(THREAD *thread, void *param);
|
void ElCaptureThread(THREAD *thread, void *param);
|
||||||
void ElStartListener(EL *e);
|
void ElStartListener(EL *e);
|
||||||
void ElStopListener(EL *e);
|
void ElStopListener(EL *e);
|
||||||
void ElListenerProc(THREAD *thread, void *param);
|
void ElListenerProc(THREAD *thread, void *param);
|
||||||
PACK *ElRpcServer(RPC *r, char *name, PACK *p);
|
PACK *ElRpcServer(RPC *r, char *name, PACK *p);
|
||||||
void ElParseCurrentLicenseStatus(LICENSE_SYSTEM *s, EL_LICENSE_STATUS *st);
|
void ElParseCurrentLicenseStatus(LICENSE_SYSTEM *s, EL_LICENSE_STATUS *st);
|
||||||
bool ElIsBetaExpired();
|
bool ElIsBetaExpired();
|
||||||
|
|
||||||
|
|
||||||
UINT EtAddDevice(EL *e, RPC_ADD_DEVICE *t);
|
UINT EtAddDevice(EL *e, RPC_ADD_DEVICE *t);
|
||||||
UINT EtDelDevice(EL *e, RPC_DELETE_DEVICE *t);
|
UINT EtDelDevice(EL *e, RPC_DELETE_DEVICE *t);
|
||||||
UINT EtSetDevice(EL *e, RPC_ADD_DEVICE *t);
|
UINT EtSetDevice(EL *e, RPC_ADD_DEVICE *t);
|
||||||
UINT EtGetDevice(EL *e, RPC_ADD_DEVICE *t);
|
UINT EtGetDevice(EL *e, RPC_ADD_DEVICE *t);
|
||||||
UINT EtEnumDevice(EL *e, RPC_ENUM_DEVICE *t);
|
UINT EtEnumDevice(EL *e, RPC_ENUM_DEVICE *t);
|
||||||
UINT EtEnumAllDevice(EL *e, RPC_ENUM_DEVICE *t);
|
UINT EtEnumAllDevice(EL *e, RPC_ENUM_DEVICE *t);
|
||||||
UINT EtSetPassword(EL *e, RPC_SET_PASSWORD *t);
|
UINT EtSetPassword(EL *e, RPC_SET_PASSWORD *t);
|
||||||
UINT EtAddLicenseKey(EL *a, RPC_TEST *t);
|
UINT EtAddLicenseKey(EL *a, RPC_TEST *t);
|
||||||
UINT EtDelLicenseKey(EL *a, RPC_TEST *t);
|
UINT EtDelLicenseKey(EL *a, RPC_TEST *t);
|
||||||
UINT EtEnumLicenseKey(EL *a, RPC_ENUM_LICENSE_KEY *t);
|
UINT EtEnumLicenseKey(EL *a, RPC_ENUM_LICENSE_KEY *t);
|
||||||
UINT EtGetLicenseStatus(EL *a, RPC_EL_LICENSE_STATUS *t);
|
UINT EtGetLicenseStatus(EL *a, RPC_EL_LICENSE_STATUS *t);
|
||||||
UINT EtGetBridgeSupport(EL *a, RPC_BRIDGE_SUPPORT *t);
|
UINT EtGetBridgeSupport(EL *a, RPC_BRIDGE_SUPPORT *t);
|
||||||
UINT EtRebootServer(EL *a, RPC_TEST *t);
|
UINT EtRebootServer(EL *a, RPC_TEST *t);
|
||||||
|
|
||||||
UINT EcAddDevice(RPC *r, RPC_ADD_DEVICE *t);
|
UINT EcAddDevice(RPC *r, RPC_ADD_DEVICE *t);
|
||||||
UINT EcDelDevice(RPC *r, RPC_DELETE_DEVICE *t);
|
UINT EcDelDevice(RPC *r, RPC_DELETE_DEVICE *t);
|
||||||
UINT EcSetDevice(RPC *r, RPC_ADD_DEVICE *t);
|
UINT EcSetDevice(RPC *r, RPC_ADD_DEVICE *t);
|
||||||
UINT EcGetDevice(RPC *r, RPC_ADD_DEVICE *t);
|
UINT EcGetDevice(RPC *r, RPC_ADD_DEVICE *t);
|
||||||
UINT EcEnumDevice(RPC *r, RPC_ENUM_DEVICE *t);
|
UINT EcEnumDevice(RPC *r, RPC_ENUM_DEVICE *t);
|
||||||
UINT EcEnumAllDevice(RPC *r, RPC_ENUM_DEVICE *t);
|
UINT EcEnumAllDevice(RPC *r, RPC_ENUM_DEVICE *t);
|
||||||
UINT EcSetPassword(RPC *r, RPC_SET_PASSWORD *t);
|
UINT EcSetPassword(RPC *r, RPC_SET_PASSWORD *t);
|
||||||
UINT EcDelLicenseKey(RPC *r, RPC_TEST *t);
|
UINT EcDelLicenseKey(RPC *r, RPC_TEST *t);
|
||||||
UINT EcEnumLicenseKey(RPC *r, RPC_ENUM_LICENSE_KEY *t);
|
UINT EcEnumLicenseKey(RPC *r, RPC_ENUM_LICENSE_KEY *t);
|
||||||
UINT EcGetLicenseStatus(RPC *r, RPC_EL_LICENSE_STATUS *t);
|
UINT EcGetLicenseStatus(RPC *r, RPC_EL_LICENSE_STATUS *t);
|
||||||
UINT EcGetBridgeSupport(RPC *r, RPC_BRIDGE_SUPPORT *t);
|
UINT EcGetBridgeSupport(RPC *r, RPC_BRIDGE_SUPPORT *t);
|
||||||
UINT EcRebootServer(RPC *r, RPC_TEST *t);
|
UINT EcRebootServer(RPC *r, RPC_TEST *t);
|
||||||
|
|
||||||
UINT EcConnect(char *host, UINT port, char *password, RPC **rpc);
|
UINT EcConnect(char *host, UINT port, char *password, RPC **rpc);
|
||||||
void EcDisconnect(RPC *rpc);
|
void EcDisconnect(RPC *rpc);
|
||||||
|
|
||||||
void InRpcAddDevice(RPC_ADD_DEVICE *t, PACK *p);
|
void InRpcAddDevice(RPC_ADD_DEVICE *t, PACK *p);
|
||||||
void OutRpcAddDevice(PACK *p, RPC_ADD_DEVICE *t);
|
void OutRpcAddDevice(PACK *p, RPC_ADD_DEVICE *t);
|
||||||
void InRpcDeleteDevice(RPC_DELETE_DEVICE *t, PACK *p);
|
void InRpcDeleteDevice(RPC_DELETE_DEVICE *t, PACK *p);
|
||||||
void OutRpcDeleteDevice(PACK *p, RPC_DELETE_DEVICE *t);
|
void OutRpcDeleteDevice(PACK *p, RPC_DELETE_DEVICE *t);
|
||||||
void InRpcEnumDevice(RPC_ENUM_DEVICE *t, PACK *p);
|
void InRpcEnumDevice(RPC_ENUM_DEVICE *t, PACK *p);
|
||||||
void OutRpcEnumDevice(PACK *p, RPC_ENUM_DEVICE *t);
|
void OutRpcEnumDevice(PACK *p, RPC_ENUM_DEVICE *t);
|
||||||
void FreeRpcEnumDevice(RPC_ENUM_DEVICE *t);
|
void FreeRpcEnumDevice(RPC_ENUM_DEVICE *t);
|
||||||
void InRpcEnumLicenseKey(RPC_ENUM_LICENSE_KEY *t, PACK *p);
|
void InRpcEnumLicenseKey(RPC_ENUM_LICENSE_KEY *t, PACK *p);
|
||||||
void OutRpcEnumLicenseKey(PACK *p, RPC_ENUM_LICENSE_KEY *t);
|
void OutRpcEnumLicenseKey(PACK *p, RPC_ENUM_LICENSE_KEY *t);
|
||||||
void FreeRpcEnumLicenseKey(RPC_ENUM_LICENSE_KEY *t);
|
void FreeRpcEnumLicenseKey(RPC_ENUM_LICENSE_KEY *t);
|
||||||
void InRpcElLicenseStatus(RPC_EL_LICENSE_STATUS *t, PACK *p);
|
void InRpcElLicenseStatus(RPC_EL_LICENSE_STATUS *t, PACK *p);
|
||||||
void OutRpcElLicenseStatus(PACK *p, RPC_EL_LICENSE_STATUS *t);
|
void OutRpcElLicenseStatus(PACK *p, RPC_EL_LICENSE_STATUS *t);
|
||||||
|
|
||||||
#endif // ETHERLOG_H
|
#endif // ETHERLOG_H
|
||||||
|
|
||||||
|
|
||||||
|
14428
src/Cedar/Hub.c
14428
src/Cedar/Hub.c
File diff suppressed because it is too large
Load Diff
1078
src/Cedar/Hub.h
1078
src/Cedar/Hub.h
File diff suppressed because it is too large
Load Diff
5226
src/Cedar/IPC.c
5226
src/Cedar/IPC.c
File diff suppressed because it is too large
Load Diff
482
src/Cedar/IPC.h
482
src/Cedar/IPC.h
@ -1,241 +1,241 @@
|
|||||||
// SoftEther VPN Source Code - Developer Edition Master Branch
|
// SoftEther VPN Source Code - Developer Edition Master Branch
|
||||||
// Cedar Communication Module
|
// Cedar Communication Module
|
||||||
|
|
||||||
|
|
||||||
// IPC.h
|
// IPC.h
|
||||||
// Header of IPC.c
|
// Header of IPC.c
|
||||||
|
|
||||||
#ifndef IPC_H
|
#ifndef IPC_H
|
||||||
#define IPC_H
|
#define IPC_H
|
||||||
|
|
||||||
// Constants
|
// Constants
|
||||||
#define IPC_ARP_LIFETIME (3 * 60 * 1000)
|
#define IPC_ARP_LIFETIME (3 * 60 * 1000)
|
||||||
#define IPC_ARP_GIVEUPTIME (1 * 1000)
|
#define IPC_ARP_GIVEUPTIME (1 * 1000)
|
||||||
#define IPC_DHCP_TIMEOUT (5 * 1000)
|
#define IPC_DHCP_TIMEOUT (5 * 1000)
|
||||||
#define IPC_DHCP_MIN_LEASE 5
|
#define IPC_DHCP_MIN_LEASE 5
|
||||||
#define IPC_DHCP_DEFAULT_LEASE 3600
|
#define IPC_DHCP_DEFAULT_LEASE 3600
|
||||||
|
|
||||||
#define IPC_MAX_PACKET_QUEUE_LEN 10000
|
#define IPC_MAX_PACKET_QUEUE_LEN 10000
|
||||||
|
|
||||||
#define IPC_DHCP_VENDOR_ID "MSFT 5.0"
|
#define IPC_DHCP_VENDOR_ID "MSFT 5.0"
|
||||||
|
|
||||||
#define IPC_PASSWORD_MSCHAPV2_TAG "xH7DiNlurDhcYV4a:"
|
#define IPC_PASSWORD_MSCHAPV2_TAG "xH7DiNlurDhcYV4a:"
|
||||||
|
|
||||||
#define IPC_LAYER_2 2
|
#define IPC_LAYER_2 2
|
||||||
#define IPC_LAYER_3 3
|
#define IPC_LAYER_3 3
|
||||||
|
|
||||||
// IPv6 constants
|
// IPv6 constants
|
||||||
#define IPC_IPV6_NDT_LIFETIME (30 * 1000) // as per REACHABLE_TIME constant of RFC4861
|
#define IPC_IPV6_NDT_LIFETIME (30 * 1000) // as per REACHABLE_TIME constant of RFC4861
|
||||||
#define IPC_IPV6_NDT_GIVEUPTIME (3 * 1000) // as per MAX_MULTICAST_SOLICIT * RETRANS_TIMER constants of RFC4861
|
#define IPC_IPV6_NDT_GIVEUPTIME (3 * 1000) // as per MAX_MULTICAST_SOLICIT * RETRANS_TIMER constants of RFC4861
|
||||||
#define IPC_IPV6_RA_INTERVAL (2 * 1000) // Windows gets stuck if it is bigger
|
#define IPC_IPV6_RA_INTERVAL (2 * 1000) // Windows gets stuck if it is bigger
|
||||||
#define IPC_IPV6_RA_MAX_RETRIES 2 // Windows seems to be stuck when it doesn't receive an answer in due time
|
#define IPC_IPV6_RA_MAX_RETRIES 2 // Windows seems to be stuck when it doesn't receive an answer in due time
|
||||||
|
|
||||||
// Protocol status
|
// Protocol status
|
||||||
#define IPC_PROTO_STATUS_CLOSED 0x0
|
#define IPC_PROTO_STATUS_CLOSED 0x0
|
||||||
#define IPC_PROTO_STATUS_CONFIG 0x1
|
#define IPC_PROTO_STATUS_CONFIG 0x1
|
||||||
#define IPC_PROTO_STATUS_CONFIG_WAIT 0x2
|
#define IPC_PROTO_STATUS_CONFIG_WAIT 0x2
|
||||||
#define IPC_PROTO_STATUS_OPENED 0x10
|
#define IPC_PROTO_STATUS_OPENED 0x10
|
||||||
#define IPC_PROTO_STATUS_REJECTED 0x100
|
#define IPC_PROTO_STATUS_REJECTED 0x100
|
||||||
|
|
||||||
#define IPC_PROTO_SET_STATUS(ipc, proto, value) ((ipc) != NULL ? ((ipc->proto) = (value)) : 0)
|
#define IPC_PROTO_SET_STATUS(ipc, proto, value) ((ipc) != NULL ? ((ipc->proto) = (value)) : 0)
|
||||||
#define IPC_PROTO_GET_STATUS(ipc, proto) ((ipc) != NULL ? (ipc->proto) : IPC_PROTO_STATUS_REJECTED)
|
#define IPC_PROTO_GET_STATUS(ipc, proto) ((ipc) != NULL ? (ipc->proto) : IPC_PROTO_STATUS_REJECTED)
|
||||||
|
|
||||||
// ARP table entry
|
// ARP table entry
|
||||||
struct IPC_ARP
|
struct IPC_ARP
|
||||||
{
|
{
|
||||||
IP Ip; // IP address
|
IP Ip; // IP address
|
||||||
bool Resolved; // Whether the MAC address have been resolved
|
bool Resolved; // Whether the MAC address have been resolved
|
||||||
UCHAR MacAddress[6]; // MAC address
|
UCHAR MacAddress[6]; // MAC address
|
||||||
UINT64 GiveupTime; // Time to give up (in the case of unresolved)
|
UINT64 GiveupTime; // Time to give up (in the case of unresolved)
|
||||||
UINT64 ExpireTime; // Expiration date (If resolved)
|
UINT64 ExpireTime; // Expiration date (If resolved)
|
||||||
QUEUE *PacketQueue; // Transmission packet queue
|
QUEUE *PacketQueue; // Transmission packet queue
|
||||||
};
|
};
|
||||||
|
|
||||||
// DHCP release queue
|
// DHCP release queue
|
||||||
struct IPC_DHCP_RELEASE_QUEUE
|
struct IPC_DHCP_RELEASE_QUEUE
|
||||||
{
|
{
|
||||||
DHCP_OPTION_LIST Req;
|
DHCP_OPTION_LIST Req;
|
||||||
UINT TranId;
|
UINT TranId;
|
||||||
UCHAR MacAddress[6];
|
UCHAR MacAddress[6];
|
||||||
};
|
};
|
||||||
|
|
||||||
// IPC_SESSION_SHARED_BUFFER_DATA
|
// IPC_SESSION_SHARED_BUFFER_DATA
|
||||||
struct IPC_SESSION_SHARED_BUFFER_DATA
|
struct IPC_SESSION_SHARED_BUFFER_DATA
|
||||||
{
|
{
|
||||||
char ProtocolDetails[256];
|
char ProtocolDetails[256];
|
||||||
bool EnableUdpAccel;
|
bool EnableUdpAccel;
|
||||||
bool UsingUdpAccel;
|
bool UsingUdpAccel;
|
||||||
};
|
};
|
||||||
|
|
||||||
// IPC_PARAM
|
// IPC_PARAM
|
||||||
struct IPC_PARAM
|
struct IPC_PARAM
|
||||||
{
|
{
|
||||||
char ClientName[MAX_SIZE];
|
char ClientName[MAX_SIZE];
|
||||||
char Postfix[MAX_SIZE];
|
char Postfix[MAX_SIZE];
|
||||||
char HubName[MAX_HUBNAME_LEN + 1];
|
char HubName[MAX_HUBNAME_LEN + 1];
|
||||||
char UserName[MAX_USERNAME_LEN + 1];
|
char UserName[MAX_USERNAME_LEN + 1];
|
||||||
char Password[MAX_PASSWORD_LEN + 1];
|
char Password[MAX_PASSWORD_LEN + 1];
|
||||||
IP ClientIp;
|
IP ClientIp;
|
||||||
UINT ClientPort;
|
UINT ClientPort;
|
||||||
IP ServerIp;
|
IP ServerIp;
|
||||||
UINT ServerPort;
|
UINT ServerPort;
|
||||||
char ClientHostname[MAX_SIZE];
|
char ClientHostname[MAX_SIZE];
|
||||||
char CryptName[MAX_SIZE];
|
char CryptName[MAX_SIZE];
|
||||||
bool BridgeMode;
|
bool BridgeMode;
|
||||||
UINT Mss;
|
UINT Mss;
|
||||||
bool IsL3Mode;
|
bool IsL3Mode;
|
||||||
X *ClientCertificate;
|
X *ClientCertificate;
|
||||||
UINT Layer;
|
UINT Layer;
|
||||||
};
|
};
|
||||||
|
|
||||||
// DHCPv4 response awaiter
|
// DHCPv4 response awaiter
|
||||||
struct IPC_DHCPV4_AWAIT
|
struct IPC_DHCPV4_AWAIT
|
||||||
{
|
{
|
||||||
bool IsAwaiting;
|
bool IsAwaiting;
|
||||||
DHCPV4_DATA *DhcpData;
|
DHCPV4_DATA *DhcpData;
|
||||||
UINT TransCode;
|
UINT TransCode;
|
||||||
UINT OpCode;
|
UINT OpCode;
|
||||||
};
|
};
|
||||||
|
|
||||||
// IPC_ASYNC object
|
// IPC_ASYNC object
|
||||||
struct IPC_ASYNC
|
struct IPC_ASYNC
|
||||||
{
|
{
|
||||||
CEDAR *Cedar; // Cedar
|
CEDAR *Cedar; // Cedar
|
||||||
IPC_PARAM Param; // Parameters for creating IPC
|
IPC_PARAM Param; // Parameters for creating IPC
|
||||||
THREAD *Thread; // Thread
|
THREAD *Thread; // Thread
|
||||||
SOCK_EVENT *SockEvent; // Socket events that is set when the connection is completed
|
SOCK_EVENT *SockEvent; // Socket events that is set when the connection is completed
|
||||||
bool Done; // Processing completion flag
|
bool Done; // Processing completion flag
|
||||||
IPC *Ipc; // IPC object (if it fails to connect, the value is NULL)
|
IPC *Ipc; // IPC object (if it fails to connect, the value is NULL)
|
||||||
TUBE *TubeForDisconnect; // Tube for disconnection notification
|
TUBE *TubeForDisconnect; // Tube for disconnection notification
|
||||||
UINT ErrorCode; // Error code in the case of failing to connect
|
UINT ErrorCode; // Error code in the case of failing to connect
|
||||||
DHCP_OPTION_LIST L3ClientAddressOption; // Client IP address option (Only in the case of L3 mode)
|
DHCP_OPTION_LIST L3ClientAddressOption; // Client IP address option (Only in the case of L3 mode)
|
||||||
UINT64 L3DhcpRenewInterval; // DHCP update interval
|
UINT64 L3DhcpRenewInterval; // DHCP update interval
|
||||||
UINT64 L3NextDhcpRenewTick; // DHCP renewal time of the next
|
UINT64 L3NextDhcpRenewTick; // DHCP renewal time of the next
|
||||||
bool DhcpAllocFailed; // Failed to get IP address from the DHCP server
|
bool DhcpAllocFailed; // Failed to get IP address from the DHCP server
|
||||||
};
|
};
|
||||||
|
|
||||||
// IPC object
|
// IPC object
|
||||||
struct IPC
|
struct IPC
|
||||||
{
|
{
|
||||||
CEDAR *Cedar;
|
CEDAR *Cedar;
|
||||||
char HubName[MAX_HUBNAME_LEN + 1];
|
char HubName[MAX_HUBNAME_LEN + 1];
|
||||||
char UserName[MAX_USERNAME_LEN + 1];
|
char UserName[MAX_USERNAME_LEN + 1];
|
||||||
char Password[MAX_PASSWORD_LEN + 1];
|
char Password[MAX_PASSWORD_LEN + 1];
|
||||||
char ClientHostname[MAX_SIZE];
|
char ClientHostname[MAX_SIZE];
|
||||||
UCHAR random[SHA1_SIZE];
|
UCHAR random[SHA1_SIZE];
|
||||||
char SessionName[MAX_SESSION_NAME_LEN + 1];
|
char SessionName[MAX_SESSION_NAME_LEN + 1];
|
||||||
char ConnectionName[MAX_CONNECTION_NAME_LEN + 1];
|
char ConnectionName[MAX_CONNECTION_NAME_LEN + 1];
|
||||||
POLICY *Policy;
|
POLICY *Policy;
|
||||||
SOCK *Sock;
|
SOCK *Sock;
|
||||||
INTERRUPT_MANAGER *Interrupt; // Interrupt manager
|
INTERRUPT_MANAGER *Interrupt; // Interrupt manager
|
||||||
IP ClientIPAddress; // IP address of the client
|
IP ClientIPAddress; // IP address of the client
|
||||||
IP SubnetMask; // Subnet mask of the client
|
IP SubnetMask; // Subnet mask of the client
|
||||||
IP DefaultGateway; // Default gateway address
|
IP DefaultGateway; // Default gateway address
|
||||||
IP BroadcastAddress; // Broadcast address
|
IP BroadcastAddress; // Broadcast address
|
||||||
UCHAR MacAddress[6]; // MAC address
|
UCHAR MacAddress[6]; // MAC address
|
||||||
UCHAR Padding[2];
|
UCHAR Padding[2];
|
||||||
LIST *ArpTable; // ARP table
|
LIST *ArpTable; // ARP table
|
||||||
QUEUE *IPv4ReceivedQueue; // IPv4 reception queue
|
QUEUE *IPv4ReceivedQueue; // IPv4 reception queue
|
||||||
UINT IPv4State;
|
UINT IPv4State;
|
||||||
IPC_DHCPV4_AWAIT DHCPv4Awaiter;
|
IPC_DHCPV4_AWAIT DHCPv4Awaiter;
|
||||||
TUBE_FLUSH_LIST *FlushList; // Tube Flush List
|
TUBE_FLUSH_LIST *FlushList; // Tube Flush List
|
||||||
UCHAR MsChapV2_ServerResponse[20]; // Server response
|
UCHAR MsChapV2_ServerResponse[20]; // Server response
|
||||||
DHCP_CLASSLESS_ROUTE_TABLE ClasslessRoute; // Classless routing table
|
DHCP_CLASSLESS_ROUTE_TABLE ClasslessRoute; // Classless routing table
|
||||||
SHARED_BUFFER *IpcSessionSharedBuffer; // A shared buffer between IPC and Session
|
SHARED_BUFFER *IpcSessionSharedBuffer; // A shared buffer between IPC and Session
|
||||||
IPC_SESSION_SHARED_BUFFER_DATA *IpcSessionShared; // Shared data between IPC and Session
|
IPC_SESSION_SHARED_BUFFER_DATA *IpcSessionShared; // Shared data between IPC and Session
|
||||||
UINT Layer;
|
UINT Layer;
|
||||||
|
|
||||||
// IPv6 stuff
|
// IPv6 stuff
|
||||||
QUEUE *IPv6ReceivedQueue; // IPv6 reception queue
|
QUEUE *IPv6ReceivedQueue; // IPv6 reception queue
|
||||||
UINT IPv6State;
|
UINT IPv6State;
|
||||||
LIST *IPv6NeighborTable; // Neighbor Discovery Table
|
LIST *IPv6NeighborTable; // Neighbor Discovery Table
|
||||||
LIST *IPv6RouterAdvs; // Router offered prefixes
|
LIST *IPv6RouterAdvs; // Router offered prefixes
|
||||||
UINT64 IPv6ClientEUI; // The EUI of the client (for the SLAAC autoconf)
|
UINT64 IPv6ClientEUI; // The EUI of the client (for the SLAAC autoconf)
|
||||||
UINT64 IPv6ServerEUI; // The EUI of the server (from the RA discovery)
|
UINT64 IPv6ServerEUI; // The EUI of the server (from the RA discovery)
|
||||||
};
|
};
|
||||||
|
|
||||||
// MS-CHAPv2 authentication information
|
// MS-CHAPv2 authentication information
|
||||||
struct IPC_MSCHAP_V2_AUTHINFO
|
struct IPC_MSCHAP_V2_AUTHINFO
|
||||||
{
|
{
|
||||||
char MsChapV2_PPPUsername[MAX_SIZE]; // MS-CHAPv2 Username
|
char MsChapV2_PPPUsername[MAX_SIZE]; // MS-CHAPv2 Username
|
||||||
UCHAR MsChapV2_ServerChallenge[16]; // MS-CHAPv2 Server Challenge
|
UCHAR MsChapV2_ServerChallenge[16]; // MS-CHAPv2 Server Challenge
|
||||||
UCHAR MsChapV2_ClientChallenge[16]; // MS-CHAPv2 Client Challenge
|
UCHAR MsChapV2_ClientChallenge[16]; // MS-CHAPv2 Client Challenge
|
||||||
UCHAR MsChapV2_ClientResponse[24]; // MS-CHAPv2 Client Response
|
UCHAR MsChapV2_ClientResponse[24]; // MS-CHAPv2 Client Response
|
||||||
EAP_CLIENT *MsChapV2_EapClient; // EAP client
|
EAP_CLIENT *MsChapV2_EapClient; // EAP client
|
||||||
};
|
};
|
||||||
|
|
||||||
struct IPC_IPV6_ROUTER_ADVERTISEMENT
|
struct IPC_IPV6_ROUTER_ADVERTISEMENT
|
||||||
{
|
{
|
||||||
IP RoutedPrefix;
|
IP RoutedPrefix;
|
||||||
IP RoutedMask;
|
IP RoutedMask;
|
||||||
IP RouterAddress;
|
IP RouterAddress;
|
||||||
UCHAR RouterMacAddress[6];
|
UCHAR RouterMacAddress[6];
|
||||||
UCHAR RouterLinkLayerAddress[6];
|
UCHAR RouterLinkLayerAddress[6];
|
||||||
};
|
};
|
||||||
|
|
||||||
IPC *NewIPC(CEDAR *cedar, char *client_name, char *postfix, char *hubname, char *username, char *password,
|
IPC *NewIPC(CEDAR *cedar, char *client_name, char *postfix, char *hubname, char *username, char *password,
|
||||||
UINT *error_code, IP *client_ip, UINT client_port, IP *server_ip, UINT server_port,
|
UINT *error_code, IP *client_ip, UINT client_port, IP *server_ip, UINT server_port,
|
||||||
char *client_hostname, char *crypt_name,
|
char *client_hostname, char *crypt_name,
|
||||||
bool bridge_mode, UINT mss, EAP_CLIENT *eap_client, X *client_certificate,
|
bool bridge_mode, UINT mss, EAP_CLIENT *eap_client, X *client_certificate,
|
||||||
UINT layer);
|
UINT layer);
|
||||||
IPC *NewIPCByParam(CEDAR *cedar, IPC_PARAM *param, UINT *error_code);
|
IPC *NewIPCByParam(CEDAR *cedar, IPC_PARAM *param, UINT *error_code);
|
||||||
IPC *NewIPCBySock(CEDAR *cedar, SOCK *s, void *mac_address);
|
IPC *NewIPCBySock(CEDAR *cedar, SOCK *s, void *mac_address);
|
||||||
void FreeIPC(IPC *ipc);
|
void FreeIPC(IPC *ipc);
|
||||||
bool IsIPCConnected(IPC *ipc);
|
bool IsIPCConnected(IPC *ipc);
|
||||||
void IPCSetSockEventWhenRecvL2Packet(IPC *ipc, SOCK_EVENT *e);
|
void IPCSetSockEventWhenRecvL2Packet(IPC *ipc, SOCK_EVENT *e);
|
||||||
void IPCSendL2(IPC *ipc, void *data, UINT size);
|
void IPCSendL2(IPC *ipc, void *data, UINT size);
|
||||||
void IPCSendIPv4(IPC *ipc, void *data, UINT size);
|
void IPCSendIPv4(IPC *ipc, void *data, UINT size);
|
||||||
BLOCK *IPCRecvL2(IPC *ipc);
|
BLOCK *IPCRecvL2(IPC *ipc);
|
||||||
BLOCK *IPCRecvIPv4(IPC *ipc);
|
BLOCK *IPCRecvIPv4(IPC *ipc);
|
||||||
void IPCProcessInterrupts(IPC *ipc);
|
void IPCProcessInterrupts(IPC *ipc);
|
||||||
void IPCProcessL3EventsIPv4Only(IPC *ipc);
|
void IPCProcessL3EventsIPv4Only(IPC *ipc);
|
||||||
void IPCProcessL3Events(IPC *ipc);
|
void IPCProcessL3Events(IPC *ipc);
|
||||||
void IPCProcessL3EventsEx(IPC *ipc, UINT64 now);
|
void IPCProcessL3EventsEx(IPC *ipc, UINT64 now);
|
||||||
bool IPCSetIPv4Parameters(IPC *ipc, IP *ip, IP *subnet, IP *gw, DHCP_CLASSLESS_ROUTE_TABLE *rt);
|
bool IPCSetIPv4Parameters(IPC *ipc, IP *ip, IP *subnet, IP *gw, DHCP_CLASSLESS_ROUTE_TABLE *rt);
|
||||||
IPC_ARP *IPCNewARP(IP *ip, UCHAR *mac_address);
|
IPC_ARP *IPCNewARP(IP *ip, UCHAR *mac_address);
|
||||||
void IPCFreeARP(IPC_ARP *a);
|
void IPCFreeARP(IPC_ARP *a);
|
||||||
int IPCCmpArpTable(void *p1, void *p2);
|
int IPCCmpArpTable(void *p1, void *p2);
|
||||||
void IPCSendIPv4Unicast(IPC *ipc, void *data, UINT size, IP *next_ip);
|
void IPCSendIPv4Unicast(IPC *ipc, void *data, UINT size, IP *next_ip);
|
||||||
IPC_ARP *IPCSearchArpTable(LIST *arpTable, IP *ip);
|
IPC_ARP *IPCSearchArpTable(LIST *arpTable, IP *ip);
|
||||||
void IPCSendIPv4WithDestMacAddr(IPC *ipc, void *data, UINT size, UCHAR *dest_mac_addr);
|
void IPCSendIPv4WithDestMacAddr(IPC *ipc, void *data, UINT size, UCHAR *dest_mac_addr);
|
||||||
void IPCFlushArpTable(IPC *ipc);
|
void IPCFlushArpTable(IPC *ipc);
|
||||||
void IPCFlushArpTableEx(IPC *ipc, UINT64 now);
|
void IPCFlushArpTableEx(IPC *ipc, UINT64 now);
|
||||||
void IPCProcessArp(IPC *ipc, BLOCK *b);
|
void IPCProcessArp(IPC *ipc, BLOCK *b);
|
||||||
void IPCAssociateOnArpTable(IPC *ipc, IP *ip, UCHAR *mac_address);
|
void IPCAssociateOnArpTable(IPC *ipc, IP *ip, UCHAR *mac_address);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
DHCPV4_DATA *IPCSendDhcpRequest(IPC *ipc, IP *dest_ip, UINT tran_id, DHCP_OPTION_LIST *opt, UINT expecting_code, UINT timeout, TUBE *discon_poll_tube);
|
DHCPV4_DATA *IPCSendDhcpRequest(IPC *ipc, IP *dest_ip, UINT tran_id, DHCP_OPTION_LIST *opt, UINT expecting_code, UINT timeout, TUBE *discon_poll_tube);
|
||||||
BUF *IPCBuildDhcpRequest(IPC *ipc, IP *dest_ip, UINT tran_id, DHCP_OPTION_LIST *opt);
|
BUF *IPCBuildDhcpRequest(IPC *ipc, IP *dest_ip, UINT tran_id, DHCP_OPTION_LIST *opt);
|
||||||
BUF *IPCBuildDhcpRequestOptions(IPC *ipc, DHCP_OPTION_LIST *opt);
|
BUF *IPCBuildDhcpRequestOptions(IPC *ipc, DHCP_OPTION_LIST *opt);
|
||||||
bool IPCDhcpAllocateIP(IPC *ipc, DHCP_OPTION_LIST *opt, TUBE *discon_poll_tube);
|
bool IPCDhcpAllocateIP(IPC *ipc, DHCP_OPTION_LIST *opt, TUBE *discon_poll_tube);
|
||||||
bool IPCDhcpRequestInformIP(IPC *ipc, DHCP_OPTION_LIST *opt, TUBE *discon_poll_tube, IP *client_ip);
|
bool IPCDhcpRequestInformIP(IPC *ipc, DHCP_OPTION_LIST *opt, TUBE *discon_poll_tube, IP *client_ip);
|
||||||
void IPCDhcpRenewIP(IPC *ipc, IP *dhcp_server);
|
void IPCDhcpRenewIP(IPC *ipc, IP *dhcp_server);
|
||||||
void IPCDhcpFreeIP(IPC *ipc, IP *dhcp_server);
|
void IPCDhcpFreeIP(IPC *ipc, IP *dhcp_server);
|
||||||
IPC_ASYNC *NewIPCAsync(CEDAR *cedar, IPC_PARAM *param, SOCK_EVENT *sock_event);
|
IPC_ASYNC *NewIPCAsync(CEDAR *cedar, IPC_PARAM *param, SOCK_EVENT *sock_event);
|
||||||
void IPCAsyncThreadProc(THREAD *thread, void *param);
|
void IPCAsyncThreadProc(THREAD *thread, void *param);
|
||||||
void FreeIPCAsync(IPC_ASYNC *a);
|
void FreeIPCAsync(IPC_ASYNC *a);
|
||||||
|
|
||||||
// IPv6 stuff
|
// IPv6 stuff
|
||||||
// Memory management
|
// Memory management
|
||||||
void IPCIPv6Init(IPC *ipc);
|
void IPCIPv6Init(IPC *ipc);
|
||||||
void IPCIPv6Free(IPC *ipc);
|
void IPCIPv6Free(IPC *ipc);
|
||||||
// NDT
|
// NDT
|
||||||
void IPCIPv6AssociateOnNDT(IPC *ipc, IP *ip, UCHAR *mac_address);
|
void IPCIPv6AssociateOnNDT(IPC *ipc, IP *ip, UCHAR *mac_address);
|
||||||
void IPCIPv6AssociateOnNDTEx(IPC *ipc, IP *ip, UCHAR *mac_address, bool isNeighborAdv);
|
void IPCIPv6AssociateOnNDTEx(IPC *ipc, IP *ip, UCHAR *mac_address, bool isNeighborAdv);
|
||||||
void IPCIPv6FlushNDT(IPC *ipc);
|
void IPCIPv6FlushNDT(IPC *ipc);
|
||||||
void IPCIPv6FlushNDTEx(IPC *ipc, UINT64 now);
|
void IPCIPv6FlushNDTEx(IPC *ipc, UINT64 now);
|
||||||
bool IPCIPv6CheckExistingLinkLocal(IPC *ipc, UINT64 eui);
|
bool IPCIPv6CheckExistingLinkLocal(IPC *ipc, UINT64 eui);
|
||||||
// RA
|
// RA
|
||||||
void IPCIPv6AddRouterPrefixes(IPC *ipc, ICMPV6_OPTION_LIST *recvPrefix, UCHAR *macAddress, IP *ip);
|
void IPCIPv6AddRouterPrefixes(IPC *ipc, ICMPV6_OPTION_LIST *recvPrefix, UCHAR *macAddress, IP *ip);
|
||||||
bool IPCIPv6CheckUnicastFromRouterPrefix(IPC *ipc, IP *ip, IPC_IPV6_ROUTER_ADVERTISEMENT *matchedRA);
|
bool IPCIPv6CheckUnicastFromRouterPrefix(IPC *ipc, IP *ip, IPC_IPV6_ROUTER_ADVERTISEMENT *matchedRA);
|
||||||
UINT64 IPCIPv6GetServerEui(IPC *ipc);
|
UINT64 IPCIPv6GetServerEui(IPC *ipc);
|
||||||
// Data flow
|
// Data flow
|
||||||
BLOCK *IPCIPv6Recv(IPC *ipc);
|
BLOCK *IPCIPv6Recv(IPC *ipc);
|
||||||
void IPCIPv6Send(IPC *ipc, void *data, UINT size);
|
void IPCIPv6Send(IPC *ipc, void *data, UINT size);
|
||||||
void IPCIPv6SendWithDestMacAddr(IPC *ipc, void *data, UINT size, UCHAR *dest_mac_addr);
|
void IPCIPv6SendWithDestMacAddr(IPC *ipc, void *data, UINT size, UCHAR *dest_mac_addr);
|
||||||
void IPCIPv6SendUnicast(IPC *ipc, void *data, UINT size, IP *next_ip);
|
void IPCIPv6SendUnicast(IPC *ipc, void *data, UINT size, IP *next_ip);
|
||||||
|
|
||||||
bool ParseAndExtractMsChapV2InfoFromPassword(IPC_MSCHAP_V2_AUTHINFO *d, char *password);
|
bool ParseAndExtractMsChapV2InfoFromPassword(IPC_MSCHAP_V2_AUTHINFO *d, char *password);
|
||||||
|
|
||||||
#endif // IPC_H
|
#endif // IPC_H
|
||||||
|
4198
src/Cedar/Layer3.c
4198
src/Cedar/Layer3.c
File diff suppressed because it is too large
Load Diff
@ -1,149 +1,149 @@
|
|||||||
// SoftEther VPN Source Code - Developer Edition Master Branch
|
// SoftEther VPN Source Code - Developer Edition Master Branch
|
||||||
// Cedar Communication Module
|
// Cedar Communication Module
|
||||||
|
|
||||||
|
|
||||||
// Layer3.h
|
// Layer3.h
|
||||||
// Header of Layer3.c
|
// Header of Layer3.c
|
||||||
|
|
||||||
#ifndef LAYER3_H
|
#ifndef LAYER3_H
|
||||||
#define LAYER3_H
|
#define LAYER3_H
|
||||||
|
|
||||||
// Constants
|
// Constants
|
||||||
#define L3_USERNAME "L3SW_"
|
#define L3_USERNAME "L3SW_"
|
||||||
|
|
||||||
|
|
||||||
// L3 ARP table entry
|
// L3 ARP table entry
|
||||||
struct L3ARPENTRY
|
struct L3ARPENTRY
|
||||||
{
|
{
|
||||||
UINT IpAddress; // IP address
|
UINT IpAddress; // IP address
|
||||||
UCHAR MacAddress[6]; // MAC address
|
UCHAR MacAddress[6]; // MAC address
|
||||||
UCHAR Padding[2];
|
UCHAR Padding[2];
|
||||||
UINT64 Expire; // Expiration date
|
UINT64 Expire; // Expiration date
|
||||||
};
|
};
|
||||||
|
|
||||||
// L3 ARP resolution waiting list entry
|
// L3 ARP resolution waiting list entry
|
||||||
struct L3ARPWAIT
|
struct L3ARPWAIT
|
||||||
{
|
{
|
||||||
UINT IpAddress; // IP address
|
UINT IpAddress; // IP address
|
||||||
UINT64 LastSentTime; // Time which the data has been sent last
|
UINT64 LastSentTime; // Time which the data has been sent last
|
||||||
UINT64 Expire; // Expiration date
|
UINT64 Expire; // Expiration date
|
||||||
};
|
};
|
||||||
|
|
||||||
// L3 IP packet table
|
// L3 IP packet table
|
||||||
struct L3PACKET
|
struct L3PACKET
|
||||||
{
|
{
|
||||||
PKT *Packet; // Packet data body
|
PKT *Packet; // Packet data body
|
||||||
UINT64 Expire; // Expiration date
|
UINT64 Expire; // Expiration date
|
||||||
UINT NextHopIp; // Local delivery destination IP address
|
UINT NextHopIp; // Local delivery destination IP address
|
||||||
};
|
};
|
||||||
|
|
||||||
// L3 routing table definition
|
// L3 routing table definition
|
||||||
struct L3TABLE
|
struct L3TABLE
|
||||||
{
|
{
|
||||||
UINT NetworkAddress; // Network address
|
UINT NetworkAddress; // Network address
|
||||||
UINT SubnetMask; // Subnet mask
|
UINT SubnetMask; // Subnet mask
|
||||||
UINT GatewayAddress; // Gateway address
|
UINT GatewayAddress; // Gateway address
|
||||||
UINT Metric; // Metric
|
UINT Metric; // Metric
|
||||||
};
|
};
|
||||||
|
|
||||||
// L3 interface definition
|
// L3 interface definition
|
||||||
struct L3IF
|
struct L3IF
|
||||||
{
|
{
|
||||||
L3SW *Switch; // Layer-3 switch
|
L3SW *Switch; // Layer-3 switch
|
||||||
char HubName[MAX_HUBNAME_LEN + 1]; // Virtual HUB name
|
char HubName[MAX_HUBNAME_LEN + 1]; // Virtual HUB name
|
||||||
UINT IpAddress; // IP address
|
UINT IpAddress; // IP address
|
||||||
UINT SubnetMask; // Subnet mask
|
UINT SubnetMask; // Subnet mask
|
||||||
|
|
||||||
HUB *Hub; // Virtual HUB
|
HUB *Hub; // Virtual HUB
|
||||||
SESSION *Session; // Session
|
SESSION *Session; // Session
|
||||||
LIST *ArpTable; // ARP table
|
LIST *ArpTable; // ARP table
|
||||||
LIST *ArpWaitTable; // ARP waiting table
|
LIST *ArpWaitTable; // ARP waiting table
|
||||||
QUEUE *IpPacketQueue; // IP packet queue (for reception from other interfaces)
|
QUEUE *IpPacketQueue; // IP packet queue (for reception from other interfaces)
|
||||||
LIST *IpWaitList; // IP waiting list
|
LIST *IpWaitList; // IP waiting list
|
||||||
QUEUE *SendQueue; // Transmission queue
|
QUEUE *SendQueue; // Transmission queue
|
||||||
UCHAR MacAddress[6]; // MAC address
|
UCHAR MacAddress[6]; // MAC address
|
||||||
UCHAR Padding[2];
|
UCHAR Padding[2];
|
||||||
UINT64 LastDeleteOldArpTable; // Time that old ARP table entries are cleared
|
UINT64 LastDeleteOldArpTable; // Time that old ARP table entries are cleared
|
||||||
LIST *CancelList; // Cancellation list
|
LIST *CancelList; // Cancellation list
|
||||||
UINT64 LastBeaconSent; // Time which the beacon has been sent last
|
UINT64 LastBeaconSent; // Time which the beacon has been sent last
|
||||||
};
|
};
|
||||||
|
|
||||||
// L3 switch definition
|
// L3 switch definition
|
||||||
struct L3SW
|
struct L3SW
|
||||||
{
|
{
|
||||||
char Name[MAX_HUBNAME_LEN + 1]; // Name
|
char Name[MAX_HUBNAME_LEN + 1]; // Name
|
||||||
LOCK *lock; // Lock
|
LOCK *lock; // Lock
|
||||||
REF *ref; // Reference counter
|
REF *ref; // Reference counter
|
||||||
CEDAR *Cedar; // Cedar
|
CEDAR *Cedar; // Cedar
|
||||||
bool Active; // During operation flag
|
bool Active; // During operation flag
|
||||||
bool Online; // Online flag
|
bool Online; // Online flag
|
||||||
volatile bool Halt; // Halting flag
|
volatile bool Halt; // Halting flag
|
||||||
LIST *IfList; // Interface list
|
LIST *IfList; // Interface list
|
||||||
LIST *TableList; // Routing table list
|
LIST *TableList; // Routing table list
|
||||||
THREAD *Thread; // Thread
|
THREAD *Thread; // Thread
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Function prototype
|
// Function prototype
|
||||||
int CmpL3Sw(void *p1, void *p2);
|
int CmpL3Sw(void *p1, void *p2);
|
||||||
int CmpL3ArpEntry(void *p1, void *p2);
|
int CmpL3ArpEntry(void *p1, void *p2);
|
||||||
int CmpL3ArpWaitTable(void *p1, void *p2);
|
int CmpL3ArpWaitTable(void *p1, void *p2);
|
||||||
int CmpL3Table(void *p1, void *p2);
|
int CmpL3Table(void *p1, void *p2);
|
||||||
int CmpL3If(void *p1, void *p2);
|
int CmpL3If(void *p1, void *p2);
|
||||||
void InitCedarLayer3(CEDAR *c);
|
void InitCedarLayer3(CEDAR *c);
|
||||||
void FreeCedarLayer3(CEDAR *c);
|
void FreeCedarLayer3(CEDAR *c);
|
||||||
L3SW *NewL3Sw(CEDAR *c, char *name);
|
L3SW *NewL3Sw(CEDAR *c, char *name);
|
||||||
void ReleaseL3Sw(L3SW *s);
|
void ReleaseL3Sw(L3SW *s);
|
||||||
void CleanupL3Sw(L3SW *s);
|
void CleanupL3Sw(L3SW *s);
|
||||||
bool L3AddIf(L3SW *s, char *hubname, UINT ip, UINT subnet);
|
bool L3AddIf(L3SW *s, char *hubname, UINT ip, UINT subnet);
|
||||||
bool L3DelIf(L3SW *s, char *hubname);
|
bool L3DelIf(L3SW *s, char *hubname);
|
||||||
bool L3AddTable(L3SW *s, L3TABLE *tbl);
|
bool L3AddTable(L3SW *s, L3TABLE *tbl);
|
||||||
bool L3DelTable(L3SW *s, L3TABLE *tbl);
|
bool L3DelTable(L3SW *s, L3TABLE *tbl);
|
||||||
L3IF *L3SearchIf(L3SW *s, char *hubname);
|
L3IF *L3SearchIf(L3SW *s, char *hubname);
|
||||||
L3SW *L3GetSw(CEDAR *c, char *name);
|
L3SW *L3GetSw(CEDAR *c, char *name);
|
||||||
L3SW *L3AddSw(CEDAR *c, char *name);
|
L3SW *L3AddSw(CEDAR *c, char *name);
|
||||||
bool L3DelSw(CEDAR *c, char *name);
|
bool L3DelSw(CEDAR *c, char *name);
|
||||||
void L3FreeAllSw(CEDAR *c);
|
void L3FreeAllSw(CEDAR *c);
|
||||||
void L3SwStart(L3SW *s);
|
void L3SwStart(L3SW *s);
|
||||||
void L3SwStop(L3SW *s);
|
void L3SwStop(L3SW *s);
|
||||||
void L3SwThread(THREAD *t, void *param);
|
void L3SwThread(THREAD *t, void *param);
|
||||||
void L3Test(SERVER *s);
|
void L3Test(SERVER *s);
|
||||||
void L3InitAllInterfaces(L3SW *s);
|
void L3InitAllInterfaces(L3SW *s);
|
||||||
void L3FreeAllInterfaces(L3SW *s);
|
void L3FreeAllInterfaces(L3SW *s);
|
||||||
void L3IfThread(THREAD *t, void *param);
|
void L3IfThread(THREAD *t, void *param);
|
||||||
void L3InitInterface(L3IF *f);
|
void L3InitInterface(L3IF *f);
|
||||||
void L3FreeInterface(L3IF *f);
|
void L3FreeInterface(L3IF *f);
|
||||||
L3IF *L3GetNextIf(L3SW *s, UINT ip, UINT *next_hop);
|
L3IF *L3GetNextIf(L3SW *s, UINT ip, UINT *next_hop);
|
||||||
L3TABLE *L3GetBestRoute(L3SW *s, UINT ip);
|
L3TABLE *L3GetBestRoute(L3SW *s, UINT ip);
|
||||||
UINT L3GetNextPacket(L3IF *f, void **data);
|
UINT L3GetNextPacket(L3IF *f, void **data);
|
||||||
void L3Polling(L3IF *f);
|
void L3Polling(L3IF *f);
|
||||||
void L3PollingBeacon(L3IF *f);
|
void L3PollingBeacon(L3IF *f);
|
||||||
void L3DeleteOldArpTable(L3IF *f);
|
void L3DeleteOldArpTable(L3IF *f);
|
||||||
void L3DeleteOldIpWaitList(L3IF *f);
|
void L3DeleteOldIpWaitList(L3IF *f);
|
||||||
void L3PollingArpWaitTable(L3IF *f);
|
void L3PollingArpWaitTable(L3IF *f);
|
||||||
void L3SendL2Now(L3IF *f, UCHAR *dest_mac, UCHAR *src_mac, USHORT protocol, void *data, UINT size);
|
void L3SendL2Now(L3IF *f, UCHAR *dest_mac, UCHAR *src_mac, USHORT protocol, void *data, UINT size);
|
||||||
void L3SendArpRequestNow(L3IF *f, UINT dest_ip);
|
void L3SendArpRequestNow(L3IF *f, UINT dest_ip);
|
||||||
void L3SendArpResponseNow(L3IF *f, UCHAR *dest_mac, UINT dest_ip, UINT src_ip);
|
void L3SendArpResponseNow(L3IF *f, UCHAR *dest_mac, UINT dest_ip, UINT src_ip);
|
||||||
void L3GenerateMacAddress(L3IF *f);
|
void L3GenerateMacAddress(L3IF *f);
|
||||||
L3ARPENTRY *L3SearchArpTable(L3IF *f, UINT ip);
|
L3ARPENTRY *L3SearchArpTable(L3IF *f, UINT ip);
|
||||||
void L3SendIpNow(L3IF *f, L3ARPENTRY *a, L3PACKET *p);
|
void L3SendIpNow(L3IF *f, L3ARPENTRY *a, L3PACKET *p);
|
||||||
void L3SendIp(L3IF *f, L3PACKET *p);
|
void L3SendIp(L3IF *f, L3PACKET *p);
|
||||||
void L3RecvArp(L3IF *f, PKT *p);
|
void L3RecvArp(L3IF *f, PKT *p);
|
||||||
void L3RecvArpRequest(L3IF *f, PKT *p);
|
void L3RecvArpRequest(L3IF *f, PKT *p);
|
||||||
void L3RecvArpResponse(L3IF *f, PKT *p);
|
void L3RecvArpResponse(L3IF *f, PKT *p);
|
||||||
void L3KnownArp(L3IF *f, UINT ip, UCHAR *mac);
|
void L3KnownArp(L3IF *f, UINT ip, UCHAR *mac);
|
||||||
void L3SendArp(L3IF *f, UINT ip);
|
void L3SendArp(L3IF *f, UINT ip);
|
||||||
void L3InsertArpTable(L3IF *f, UINT ip, UCHAR *mac);
|
void L3InsertArpTable(L3IF *f, UINT ip, UCHAR *mac);
|
||||||
void L3SendWaitingIp(L3IF *f, UCHAR *mac, UINT ip, L3ARPENTRY *a);
|
void L3SendWaitingIp(L3IF *f, UCHAR *mac, UINT ip, L3ARPENTRY *a);
|
||||||
void L3PutPacket(L3IF *f, void *data, UINT size);
|
void L3PutPacket(L3IF *f, void *data, UINT size);
|
||||||
void L3RecvL2(L3IF *f, PKT *p);
|
void L3RecvL2(L3IF *f, PKT *p);
|
||||||
void L3StoreIpPacketToIf(L3IF *src_if, L3IF *dst_if, L3PACKET *p);
|
void L3StoreIpPacketToIf(L3IF *src_if, L3IF *dst_if, L3PACKET *p);
|
||||||
void L3RecvIp(L3IF *f, PKT *p, bool self);
|
void L3RecvIp(L3IF *f, PKT *p, bool self);
|
||||||
void L3PollingIpQueue(L3IF *f);
|
void L3PollingIpQueue(L3IF *f);
|
||||||
|
|
||||||
|
|
||||||
#endif // LAYER3_H
|
#endif // LAYER3_H
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
1356
src/Cedar/Link.c
1356
src/Cedar/Link.c
File diff suppressed because it is too large
Load Diff
130
src/Cedar/Link.h
130
src/Cedar/Link.h
@ -1,65 +1,65 @@
|
|||||||
// SoftEther VPN Source Code - Developer Edition Master Branch
|
// SoftEther VPN Source Code - Developer Edition Master Branch
|
||||||
// Cedar Communication Module
|
// Cedar Communication Module
|
||||||
|
|
||||||
|
|
||||||
// Link.h
|
// Link.h
|
||||||
// Header of Link.c
|
// Header of Link.c
|
||||||
|
|
||||||
#ifndef LINK_H
|
#ifndef LINK_H
|
||||||
#define LINK_H
|
#define LINK_H
|
||||||
|
|
||||||
struct LINK
|
struct LINK
|
||||||
{
|
{
|
||||||
bool Started; // Running flag
|
bool Started; // Running flag
|
||||||
volatile bool Halting; // Halting flag
|
volatile bool Halting; // Halting flag
|
||||||
bool Offline; // Offline
|
bool Offline; // Offline
|
||||||
bool NoOnline; // Do not set to online flag
|
bool NoOnline; // Do not set to online flag
|
||||||
REF *ref; // Reference counter
|
REF *ref; // Reference counter
|
||||||
LOCK *lock; // Lock
|
LOCK *lock; // Lock
|
||||||
CEDAR *Cedar; // Cedar
|
CEDAR *Cedar; // Cedar
|
||||||
HUB *Hub; // HUB
|
HUB *Hub; // HUB
|
||||||
SESSION *ClientSession; // Client session
|
SESSION *ClientSession; // Client session
|
||||||
SESSION *ServerSession; // Server session
|
SESSION *ServerSession; // Server session
|
||||||
CLIENT_OPTION *Option; // Client Option
|
CLIENT_OPTION *Option; // Client Option
|
||||||
CLIENT_AUTH *Auth; // Authentication data
|
CLIENT_AUTH *Auth; // Authentication data
|
||||||
POLICY *Policy; // Policy
|
POLICY *Policy; // Policy
|
||||||
QUEUE *SendPacketQueue; // Transmission packet queue
|
QUEUE *SendPacketQueue; // Transmission packet queue
|
||||||
UINT CurrentSendPacketQueueSize; // Current send packet queue size
|
UINT CurrentSendPacketQueueSize; // Current send packet queue size
|
||||||
UINT LastError; // Last error
|
UINT LastError; // Last error
|
||||||
bool CheckServerCert; // To check the server certificate
|
bool CheckServerCert; // To check the server certificate
|
||||||
X *ServerCert; // Server certificate
|
X *ServerCert; // Server certificate
|
||||||
bool LockFlag; // Lock flag
|
bool LockFlag; // Lock flag
|
||||||
bool *StopAllLinkFlag; // Stop all link flag
|
bool *StopAllLinkFlag; // Stop all link flag
|
||||||
UINT LastServerConnectionReceivedBlocksNum; // Last server connection recv queue num
|
UINT LastServerConnectionReceivedBlocksNum; // Last server connection recv queue num
|
||||||
UINT Flag1;
|
UINT Flag1;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
PACKET_ADAPTER *LinkGetPacketAdapter();
|
PACKET_ADAPTER *LinkGetPacketAdapter();
|
||||||
bool LinkPaInit(SESSION *s);
|
bool LinkPaInit(SESSION *s);
|
||||||
CANCEL *LinkPaGetCancel(SESSION *s);
|
CANCEL *LinkPaGetCancel(SESSION *s);
|
||||||
UINT LinkPaGetNextPacket(SESSION *s, void **data);
|
UINT LinkPaGetNextPacket(SESSION *s, void **data);
|
||||||
bool LinkPaPutPacket(SESSION *s, void *data, UINT size);
|
bool LinkPaPutPacket(SESSION *s, void *data, UINT size);
|
||||||
void LinkPaFree(SESSION *s);
|
void LinkPaFree(SESSION *s);
|
||||||
|
|
||||||
void LinkServerSessionThread(THREAD *t, void *param);
|
void LinkServerSessionThread(THREAD *t, void *param);
|
||||||
LINK *NewLink(CEDAR *cedar, HUB *hub, CLIENT_OPTION *option, CLIENT_AUTH *auth, POLICY *policy);
|
LINK *NewLink(CEDAR *cedar, HUB *hub, CLIENT_OPTION *option, CLIENT_AUTH *auth, POLICY *policy);
|
||||||
void StartLink(LINK *k);
|
void StartLink(LINK *k);
|
||||||
void StopLink(LINK *k);
|
void StopLink(LINK *k);
|
||||||
void DelLink(HUB *hub, LINK *k);
|
void DelLink(HUB *hub, LINK *k);
|
||||||
void LockLink(LINK *k);
|
void LockLink(LINK *k);
|
||||||
void UnlockLink(LINK *k);
|
void UnlockLink(LINK *k);
|
||||||
void StopAllLink(HUB *h);
|
void StopAllLink(HUB *h);
|
||||||
void StartAllLink(HUB *h);
|
void StartAllLink(HUB *h);
|
||||||
void SetLinkOnline(LINK *k);
|
void SetLinkOnline(LINK *k);
|
||||||
void SetLinkOffline(LINK *k);
|
void SetLinkOffline(LINK *k);
|
||||||
void ReleaseLink(LINK *k);
|
void ReleaseLink(LINK *k);
|
||||||
void CleanupLink(LINK *k);
|
void CleanupLink(LINK *k);
|
||||||
void ReleaseAllLink(HUB *h);
|
void ReleaseAllLink(HUB *h);
|
||||||
void NormalizeLinkPolicy(POLICY *p);
|
void NormalizeLinkPolicy(POLICY *p);
|
||||||
|
|
||||||
#endif // LINK_H
|
#endif // LINK_H
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
2022
src/Cedar/Listener.c
2022
src/Cedar/Listener.c
File diff suppressed because it is too large
Load Diff
@ -1,108 +1,108 @@
|
|||||||
// SoftEther VPN Source Code - Developer Edition Master Branch
|
// SoftEther VPN Source Code - Developer Edition Master Branch
|
||||||
// Cedar Communication Module
|
// Cedar Communication Module
|
||||||
|
|
||||||
|
|
||||||
// Listener.h
|
// Listener.h
|
||||||
// Header of Listener.c
|
// Header of Listener.c
|
||||||
|
|
||||||
#ifndef LISTENER_H
|
#ifndef LISTENER_H
|
||||||
#define LISTENER_H
|
#define LISTENER_H
|
||||||
|
|
||||||
|
|
||||||
// Function to call when receiving a new connection
|
// Function to call when receiving a new connection
|
||||||
typedef void (NEW_CONNECTION_PROC)(CONNECTION *c);
|
typedef void (NEW_CONNECTION_PROC)(CONNECTION *c);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Listener structure
|
// Listener structure
|
||||||
struct LISTENER
|
struct LISTENER
|
||||||
{
|
{
|
||||||
LOCK *lock; // Lock
|
LOCK *lock; // Lock
|
||||||
REF *ref; // Reference counter
|
REF *ref; // Reference counter
|
||||||
CEDAR *Cedar; // Cedar
|
CEDAR *Cedar; // Cedar
|
||||||
UINT Protocol; // Protocol
|
UINT Protocol; // Protocol
|
||||||
UINT Port; // Port number
|
UINT Port; // Port number
|
||||||
THREAD *Thread; // Operating thread
|
THREAD *Thread; // Operating thread
|
||||||
SOCK *Sock; // Socket
|
SOCK *Sock; // Socket
|
||||||
EVENT *Event; // Event
|
EVENT *Event; // Event
|
||||||
volatile bool Halt; // Halting flag
|
volatile bool Halt; // Halting flag
|
||||||
UINT Status; // State
|
UINT Status; // State
|
||||||
|
|
||||||
|
|
||||||
THREAD_PROC *ThreadProc; // Thread procedure
|
THREAD_PROC *ThreadProc; // Thread procedure
|
||||||
void *ThreadParam; // Thread parameters
|
void *ThreadParam; // Thread parameters
|
||||||
bool LocalOnly; // Can be connected only from localhost
|
bool LocalOnly; // Can be connected only from localhost
|
||||||
bool ShadowIPv6; // Flag indicating that the shadow IPv6 listener
|
bool ShadowIPv6; // Flag indicating that the shadow IPv6 listener
|
||||||
LISTENER *ShadowListener; // Reference to managing shadow IPv6 listener
|
LISTENER *ShadowListener; // Reference to managing shadow IPv6 listener
|
||||||
bool DisableDos; // Disable the DoS attack detection
|
bool DisableDos; // Disable the DoS attack detection
|
||||||
volatile UINT *NatTGlobalUdpPort; // NAT-T global UDP port number
|
volatile UINT *NatTGlobalUdpPort; // NAT-T global UDP port number
|
||||||
UCHAR RandPortId; // NAT-T UDP random port ID
|
UCHAR RandPortId; // NAT-T UDP random port ID
|
||||||
bool EnableConditionalAccept; // The flag of whether to enable the Conditional Accept
|
bool EnableConditionalAccept; // The flag of whether to enable the Conditional Accept
|
||||||
};
|
};
|
||||||
|
|
||||||
// Parameters of TCPAcceptedThread
|
// Parameters of TCPAcceptedThread
|
||||||
struct TCP_ACCEPTED_PARAM
|
struct TCP_ACCEPTED_PARAM
|
||||||
{
|
{
|
||||||
LISTENER *r;
|
LISTENER *r;
|
||||||
SOCK *s;
|
SOCK *s;
|
||||||
};
|
};
|
||||||
|
|
||||||
// UDP entry
|
// UDP entry
|
||||||
struct UDP_ENTRY
|
struct UDP_ENTRY
|
||||||
{
|
{
|
||||||
UINT SessionKey32; // 32bit session key
|
UINT SessionKey32; // 32bit session key
|
||||||
SESSION *Session; // Reference to the session
|
SESSION *Session; // Reference to the session
|
||||||
};
|
};
|
||||||
|
|
||||||
// Dynamic listener
|
// Dynamic listener
|
||||||
struct DYNAMIC_LISTENER
|
struct DYNAMIC_LISTENER
|
||||||
{
|
{
|
||||||
UINT Protocol; // Protocol
|
UINT Protocol; // Protocol
|
||||||
UINT Port; // Port
|
UINT Port; // Port
|
||||||
LOCK *Lock; // Lock
|
LOCK *Lock; // Lock
|
||||||
CEDAR *Cedar; // Cedar
|
CEDAR *Cedar; // Cedar
|
||||||
bool *EnablePtr; // A pointer to the flag of the valid / invalid state
|
bool *EnablePtr; // A pointer to the flag of the valid / invalid state
|
||||||
LISTENER *Listener; // Listener
|
LISTENER *Listener; // Listener
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// Function prototype
|
// Function prototype
|
||||||
LISTENER *NewListener(CEDAR *cedar, UINT proto, UINT port);
|
LISTENER *NewListener(CEDAR *cedar, UINT proto, UINT port);
|
||||||
LISTENER *NewListenerEx(CEDAR *cedar, UINT proto, UINT port, THREAD_PROC *proc, void *thread_param);
|
LISTENER *NewListenerEx(CEDAR *cedar, UINT proto, UINT port, THREAD_PROC *proc, void *thread_param);
|
||||||
LISTENER *NewListenerEx2(CEDAR *cedar, UINT proto, UINT port, THREAD_PROC *proc, void *thread_param, bool local_only);
|
LISTENER *NewListenerEx2(CEDAR *cedar, UINT proto, UINT port, THREAD_PROC *proc, void *thread_param, bool local_only);
|
||||||
LISTENER *NewListenerEx3(CEDAR *cedar, UINT proto, UINT port, THREAD_PROC *proc, void *thread_param, bool local_only, bool shadow_ipv6);
|
LISTENER *NewListenerEx3(CEDAR *cedar, UINT proto, UINT port, THREAD_PROC *proc, void *thread_param, bool local_only, bool shadow_ipv6);
|
||||||
LISTENER *NewListenerEx4(CEDAR *cedar, UINT proto, UINT port, THREAD_PROC *proc, void *thread_param, bool local_only, bool shadow_ipv6,
|
LISTENER *NewListenerEx4(CEDAR *cedar, UINT proto, UINT port, THREAD_PROC *proc, void *thread_param, bool local_only, bool shadow_ipv6,
|
||||||
volatile UINT *natt_global_udp_port, UCHAR rand_port_id);
|
volatile UINT *natt_global_udp_port, UCHAR rand_port_id);
|
||||||
LISTENER *NewListenerEx5(CEDAR *cedar, UINT proto, UINT port, THREAD_PROC *proc, void *thread_param, bool local_only, bool shadow_ipv6,
|
LISTENER *NewListenerEx5(CEDAR *cedar, UINT proto, UINT port, THREAD_PROC *proc, void *thread_param, bool local_only, bool shadow_ipv6,
|
||||||
volatile UINT *natt_global_udp_port, UCHAR rand_port_id, bool enable_ca);
|
volatile UINT *natt_global_udp_port, UCHAR rand_port_id, bool enable_ca);
|
||||||
void ReleaseListener(LISTENER *r);
|
void ReleaseListener(LISTENER *r);
|
||||||
void CleanupListener(LISTENER *r);
|
void CleanupListener(LISTENER *r);
|
||||||
void ListenerThread(THREAD *thread, void *param);
|
void ListenerThread(THREAD *thread, void *param);
|
||||||
void ListenerTCPMainLoop(LISTENER *r);
|
void ListenerTCPMainLoop(LISTENER *r);
|
||||||
void StopListener(LISTENER *r);
|
void StopListener(LISTENER *r);
|
||||||
int CompareListener(void *p1, void *p2);
|
int CompareListener(void *p1, void *p2);
|
||||||
void TCPAccepted(LISTENER *r, SOCK *s);
|
void TCPAccepted(LISTENER *r, SOCK *s);
|
||||||
void EnableDosProtect();
|
void EnableDosProtect();
|
||||||
void DisableDosProtect();
|
void DisableDosProtect();
|
||||||
void TCPAcceptedThread(THREAD *t, void *param);
|
void TCPAcceptedThread(THREAD *t, void *param);
|
||||||
void ListenerUDPMainLoop(LISTENER *r);
|
void ListenerUDPMainLoop(LISTENER *r);
|
||||||
void UDPReceivedPacket(CEDAR *cedar, SOCK *s, IP *ip, UINT port, void *data, UINT size);
|
void UDPReceivedPacket(CEDAR *cedar, SOCK *s, IP *ip, UINT port, void *data, UINT size);
|
||||||
int CompareUDPEntry(void *p1, void *p2);
|
int CompareUDPEntry(void *p1, void *p2);
|
||||||
void CleanupUDPEntry(CEDAR *cedar);
|
void CleanupUDPEntry(CEDAR *cedar);
|
||||||
void AddUDPEntry(CEDAR *cedar, SESSION *session);
|
void AddUDPEntry(CEDAR *cedar, SESSION *session);
|
||||||
void DelUDPEntry(CEDAR *cedar, SESSION *session);
|
void DelUDPEntry(CEDAR *cedar, SESSION *session);
|
||||||
SESSION *GetSessionFromUDPEntry(CEDAR *cedar, UINT key32);
|
SESSION *GetSessionFromUDPEntry(CEDAR *cedar, UINT key32);
|
||||||
UINT GetMaxConnectionsPerIp();
|
UINT GetMaxConnectionsPerIp();
|
||||||
void SetMaxConnectionsPerIp(UINT num);
|
void SetMaxConnectionsPerIp(UINT num);
|
||||||
UINT GetMaxUnestablishedConnections();
|
UINT GetMaxUnestablishedConnections();
|
||||||
void SetMaxUnestablishedConnections(UINT num);
|
void SetMaxUnestablishedConnections(UINT num);
|
||||||
DYNAMIC_LISTENER *NewDynamicListener(CEDAR *c, bool *enable_ptr, UINT protocol, UINT port);
|
DYNAMIC_LISTENER *NewDynamicListener(CEDAR *c, bool *enable_ptr, UINT protocol, UINT port);
|
||||||
void ApplyDynamicListener(DYNAMIC_LISTENER *d);
|
void ApplyDynamicListener(DYNAMIC_LISTENER *d);
|
||||||
void FreeDynamicListener(DYNAMIC_LISTENER *d);
|
void FreeDynamicListener(DYNAMIC_LISTENER *d);
|
||||||
bool ListenerRUDPRpcRecvProc(RUDP_STACK *r, UDPPACKET *p);
|
bool ListenerRUDPRpcRecvProc(RUDP_STACK *r, UDPPACKET *p);
|
||||||
void ListenerSetProcRecvRpcEnable(bool b);
|
void ListenerSetProcRecvRpcEnable(bool b);
|
||||||
|
|
||||||
|
|
||||||
#endif // LISTENER_H
|
#endif // LISTENER_H
|
||||||
|
|
||||||
|
|
||||||
|
5656
src/Cedar/Logging.c
5656
src/Cedar/Logging.c
File diff suppressed because it is too large
Load Diff
@ -1,165 +1,165 @@
|
|||||||
// SoftEther VPN Source Code - Developer Edition Master Branch
|
// SoftEther VPN Source Code - Developer Edition Master Branch
|
||||||
// Cedar Communication Module
|
// Cedar Communication Module
|
||||||
|
|
||||||
|
|
||||||
// Logging.h
|
// Logging.h
|
||||||
// Header of Logging.c
|
// Header of Logging.c
|
||||||
|
|
||||||
#ifndef LOGGING_H
|
#ifndef LOGGING_H
|
||||||
#define LOGGING_H
|
#define LOGGING_H
|
||||||
|
|
||||||
|
|
||||||
// Port number for HTTP monitoring
|
// Port number for HTTP monitoring
|
||||||
#define LOG_HTTP_PORT 80
|
#define LOG_HTTP_PORT 80
|
||||||
|
|
||||||
|
|
||||||
#define MAX_LOG_SIZE_DEFAULT 1073741823ULL
|
#define MAX_LOG_SIZE_DEFAULT 1073741823ULL
|
||||||
|
|
||||||
typedef char *(RECORD_PARSE_PROC)(RECORD *rec);
|
typedef char *(RECORD_PARSE_PROC)(RECORD *rec);
|
||||||
|
|
||||||
// Packet log structure
|
// Packet log structure
|
||||||
struct PACKET_LOG
|
struct PACKET_LOG
|
||||||
{
|
{
|
||||||
CEDAR *Cedar;
|
CEDAR *Cedar;
|
||||||
struct PKT *Packet;
|
struct PKT *Packet;
|
||||||
char *SrcSessionName;
|
char *SrcSessionName;
|
||||||
char *DestSessionName;
|
char *DestSessionName;
|
||||||
bool WritePhysicalIP;
|
bool WritePhysicalIP;
|
||||||
char SrcPhysicalIP[64];
|
char SrcPhysicalIP[64];
|
||||||
char DestPhysicalIP[64];
|
char DestPhysicalIP[64];
|
||||||
bool PurePacket; // Packet not cloned
|
bool PurePacket; // Packet not cloned
|
||||||
bool PurePacketNoPayload; // Packet not cloned (without payload)
|
bool PurePacketNoPayload; // Packet not cloned (without payload)
|
||||||
SESSION *SrcSession;
|
SESSION *SrcSession;
|
||||||
bool NoLog; // Not to write a log
|
bool NoLog; // Not to write a log
|
||||||
};
|
};
|
||||||
|
|
||||||
// Log save options of the HUB
|
// Log save options of the HUB
|
||||||
struct HUB_LOG
|
struct HUB_LOG
|
||||||
{
|
{
|
||||||
bool SaveSecurityLog; // To save the security log
|
bool SaveSecurityLog; // To save the security log
|
||||||
UINT SecurityLogSwitchType; // Switching type of security log
|
UINT SecurityLogSwitchType; // Switching type of security log
|
||||||
bool SavePacketLog; // To save the packet log
|
bool SavePacketLog; // To save the packet log
|
||||||
UINT PacketLogSwitchType; // Switching type of packet log
|
UINT PacketLogSwitchType; // Switching type of packet log
|
||||||
UINT PacketLogConfig[NUM_PACKET_LOG]; // Packet log settings
|
UINT PacketLogConfig[NUM_PACKET_LOG]; // Packet log settings
|
||||||
};
|
};
|
||||||
|
|
||||||
// Record
|
// Record
|
||||||
struct RECORD
|
struct RECORD
|
||||||
{
|
{
|
||||||
UINT64 Tick; // Time
|
UINT64 Tick; // Time
|
||||||
RECORD_PARSE_PROC *ParseProc; // Parsing procedure
|
RECORD_PARSE_PROC *ParseProc; // Parsing procedure
|
||||||
void *Data; // Data
|
void *Data; // Data
|
||||||
};
|
};
|
||||||
|
|
||||||
// LOG object
|
// LOG object
|
||||||
struct LOG
|
struct LOG
|
||||||
{
|
{
|
||||||
LOCK *lock; // Lock
|
LOCK *lock; // Lock
|
||||||
THREAD *Thread; // Thread
|
THREAD *Thread; // Thread
|
||||||
char *DirName; // Destination directory name
|
char *DirName; // Destination directory name
|
||||||
char *Prefix; // File name
|
char *Prefix; // File name
|
||||||
UINT SwitchType; // Switching type of log file
|
UINT SwitchType; // Switching type of log file
|
||||||
QUEUE *RecordQueue; // Record queue
|
QUEUE *RecordQueue; // Record queue
|
||||||
volatile bool Halt; // Halting flag
|
volatile bool Halt; // Halting flag
|
||||||
EVENT *Event; // Event for Log
|
EVENT *Event; // Event for Log
|
||||||
EVENT *FlushEvent; // Flash completion event
|
EVENT *FlushEvent; // Flash completion event
|
||||||
bool CacheFlag;
|
bool CacheFlag;
|
||||||
UINT64 LastTick;
|
UINT64 LastTick;
|
||||||
UINT LastSwitchType;
|
UINT LastSwitchType;
|
||||||
char LastStr[MAX_SIZE];
|
char LastStr[MAX_SIZE];
|
||||||
UINT64 CurrentFilePointer; // The current file pointer
|
UINT64 CurrentFilePointer; // The current file pointer
|
||||||
UINT CurrentLogNumber; // Log file number of the current
|
UINT CurrentLogNumber; // Log file number of the current
|
||||||
bool log_number_incremented;
|
bool log_number_incremented;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// ERASER object
|
// ERASER object
|
||||||
struct ERASER
|
struct ERASER
|
||||||
{
|
{
|
||||||
LOG *Log; // Logger
|
LOG *Log; // Logger
|
||||||
UINT64 MinFreeSpace; // Disk space to start deleting files
|
UINT64 MinFreeSpace; // Disk space to start deleting files
|
||||||
char *DirName; // Directory name
|
char *DirName; // Directory name
|
||||||
volatile bool Halt; // Halting flag
|
volatile bool Halt; // Halting flag
|
||||||
THREAD *Thread; // Thread
|
THREAD *Thread; // Thread
|
||||||
bool LastFailed; // Whether deletion of the file failed at the end
|
bool LastFailed; // Whether deletion of the file failed at the end
|
||||||
EVENT *HaltEvent; // Halting event
|
EVENT *HaltEvent; // Halting event
|
||||||
};
|
};
|
||||||
|
|
||||||
// List of files that can be deleted
|
// List of files that can be deleted
|
||||||
typedef struct ERASE_FILE
|
typedef struct ERASE_FILE
|
||||||
{
|
{
|
||||||
char *FullPath; // Full path
|
char *FullPath; // Full path
|
||||||
UINT64 UpdateTime; // Updating date
|
UINT64 UpdateTime; // Updating date
|
||||||
} ERASE_FILE;
|
} ERASE_FILE;
|
||||||
|
|
||||||
// SYSLOG object
|
// SYSLOG object
|
||||||
struct SLOG
|
struct SLOG
|
||||||
{
|
{
|
||||||
LOCK *lock; // Lock
|
LOCK *lock; // Lock
|
||||||
SOCK *Udp; // UDP socket
|
SOCK *Udp; // UDP socket
|
||||||
IP DestIp; // Destination IP address
|
IP DestIp; // Destination IP address
|
||||||
UINT DestPort; // Destination port number
|
UINT DestPort; // Destination port number
|
||||||
char HostName[MAX_HOST_NAME_LEN + 1]; // Host name
|
char HostName[MAX_HOST_NAME_LEN + 1]; // Host name
|
||||||
UINT64 NextPollIp; // Time of examination of the IP address at the end
|
UINT64 NextPollIp; // Time of examination of the IP address at the end
|
||||||
};
|
};
|
||||||
|
|
||||||
// Function prototype
|
// Function prototype
|
||||||
LOG *NewLog(char *dir, char *prefix, UINT switch_type);
|
LOG *NewLog(char *dir, char *prefix, UINT switch_type);
|
||||||
void FreeLog(LOG *g);
|
void FreeLog(LOG *g);
|
||||||
void LogThread(THREAD *thread, void *param);
|
void LogThread(THREAD *thread, void *param);
|
||||||
void WaitLogFlush(LOG *g);
|
void WaitLogFlush(LOG *g);
|
||||||
void LockLog(LOG *g);
|
void LockLog(LOG *g);
|
||||||
void UnlockLog(LOG *g);
|
void UnlockLog(LOG *g);
|
||||||
void InsertRecord(LOG *g, void *data, RECORD_PARSE_PROC *proc);
|
void InsertRecord(LOG *g, void *data, RECORD_PARSE_PROC *proc);
|
||||||
void InsertStringRecord(LOG *g, char *str);
|
void InsertStringRecord(LOG *g, char *str);
|
||||||
void InsertUnicodeRecord(LOG *g, wchar_t *unistr);
|
void InsertUnicodeRecord(LOG *g, wchar_t *unistr);
|
||||||
char *StringRecordParseProc(RECORD *rec);
|
char *StringRecordParseProc(RECORD *rec);
|
||||||
bool MakeLogFileName(LOG *g, char *name, UINT size, char *dir, char *prefix, UINT64 tick, UINT switch_type, UINT num, char *old_datestr);
|
bool MakeLogFileName(LOG *g, char *name, UINT size, char *dir, char *prefix, UINT64 tick, UINT switch_type, UINT num, char *old_datestr);
|
||||||
void MakeLogFileNameStringFromTick(LOG *g, char *str, UINT size, UINT64 tick, UINT switch_type);
|
void MakeLogFileNameStringFromTick(LOG *g, char *str, UINT size, UINT64 tick, UINT switch_type);
|
||||||
void WriteRecordToBuffer(BUF *b, RECORD *r);
|
void WriteRecordToBuffer(BUF *b, RECORD *r);
|
||||||
void SetLogSwitchType(LOG *g, UINT switch_type);
|
void SetLogSwitchType(LOG *g, UINT switch_type);
|
||||||
bool PacketLog(HUB *hub, SESSION *src_session, SESSION *dest_session, PKT *packet, UINT64 now);
|
bool PacketLog(HUB *hub, SESSION *src_session, SESSION *dest_session, PKT *packet, UINT64 now);
|
||||||
char *PacketLogParseProc(RECORD *rec);
|
char *PacketLogParseProc(RECORD *rec);
|
||||||
UINT CalcPacketLoggingLevel(HUB *hub, PKT *packet);
|
UINT CalcPacketLoggingLevel(HUB *hub, PKT *packet);
|
||||||
UINT CalcPacketLoggingLevelEx(HUB_LOG *g, PKT *packet);
|
UINT CalcPacketLoggingLevelEx(HUB_LOG *g, PKT *packet);
|
||||||
char *GenCsvLine(TOKEN_LIST *t);
|
char *GenCsvLine(TOKEN_LIST *t);
|
||||||
void ReplaceForCsv(char *str);
|
void ReplaceForCsv(char *str);
|
||||||
char *PortStr(CEDAR *cedar, UINT port, bool udp);
|
char *PortStr(CEDAR *cedar, UINT port, bool udp);
|
||||||
char *TcpFlagStr(UCHAR flag);
|
char *TcpFlagStr(UCHAR flag);
|
||||||
void SiSetDefaultLogSetting(HUB_LOG *g);
|
void SiSetDefaultLogSetting(HUB_LOG *g);
|
||||||
void DebugLog(CEDAR *c, char *fmt, ...);
|
void DebugLog(CEDAR *c, char *fmt, ...);
|
||||||
void SLog(CEDAR *c, char *name, ...);
|
void SLog(CEDAR *c, char *name, ...);
|
||||||
void WriteHubLog(HUB *h, wchar_t *str);
|
void WriteHubLog(HUB *h, wchar_t *str);
|
||||||
void HLog(HUB *h, char *name, ...);
|
void HLog(HUB *h, char *name, ...);
|
||||||
void NLog(VH *v, char *name, ...);
|
void NLog(VH *v, char *name, ...);
|
||||||
void PPPLog(PPP_SESSION *p, char *name, ...);
|
void PPPLog(PPP_SESSION *p, char *name, ...);
|
||||||
void IPsecLog(IKE_SERVER *ike, IKE_CLIENT *c, IKE_SA *ike_sa, IPSECSA *ipsec_sa, char *name, ...);
|
void IPsecLog(IKE_SERVER *ike, IKE_CLIENT *c, IKE_SA *ike_sa, IPSECSA *ipsec_sa, char *name, ...);
|
||||||
void EtherIPLog(ETHERIP_SERVER *s, char *name, ...);
|
void EtherIPLog(ETHERIP_SERVER *s, char *name, ...);
|
||||||
void WriteServerLog(CEDAR *c, wchar_t *str);
|
void WriteServerLog(CEDAR *c, wchar_t *str);
|
||||||
void ALog(ADMIN *a, HUB *h, char *name, ...);
|
void ALog(ADMIN *a, HUB *h, char *name, ...);
|
||||||
void CLog(CLIENT *c, char *name, ...);
|
void CLog(CLIENT *c, char *name, ...);
|
||||||
void WriteClientLog(CLIENT *c, wchar_t *str);
|
void WriteClientLog(CLIENT *c, wchar_t *str);
|
||||||
ERASER *NewEraser(LOG *log, UINT64 min_size);
|
ERASER *NewEraser(LOG *log, UINT64 min_size);
|
||||||
void FreeEraser(ERASER *e);
|
void FreeEraser(ERASER *e);
|
||||||
void ELog(ERASER *e, char *name, ...);
|
void ELog(ERASER *e, char *name, ...);
|
||||||
void EraserThread(THREAD *t, void *p);
|
void EraserThread(THREAD *t, void *p);
|
||||||
void EraserMain(ERASER *e);
|
void EraserMain(ERASER *e);
|
||||||
bool CheckEraserDiskFreeSpace(ERASER *e);
|
bool CheckEraserDiskFreeSpace(ERASER *e);
|
||||||
int CompareEraseFile(void *p1, void *p2);
|
int CompareEraseFile(void *p1, void *p2);
|
||||||
LIST *GenerateEraseFileList(ERASER *e);
|
LIST *GenerateEraseFileList(ERASER *e);
|
||||||
void FreeEraseFileList(LIST *o);
|
void FreeEraseFileList(LIST *o);
|
||||||
void EnumEraseFile(LIST *o, char *dirname);
|
void EnumEraseFile(LIST *o, char *dirname);
|
||||||
SLOG *NewSysLog(char *hostname, UINT port, IP *ip);
|
SLOG *NewSysLog(char *hostname, UINT port, IP *ip);
|
||||||
void SetSysLog(SLOG *g, char *hostname, UINT port);
|
void SetSysLog(SLOG *g, char *hostname, UINT port);
|
||||||
void FreeSysLog(SLOG *g);
|
void FreeSysLog(SLOG *g);
|
||||||
void SendSysLog(SLOG *g, wchar_t *str);
|
void SendSysLog(SLOG *g, wchar_t *str);
|
||||||
char *BuildHttpLogStr(HTTPLOG *h);
|
char *BuildHttpLogStr(HTTPLOG *h);
|
||||||
void MakeSafeLogStr(char *str);
|
void MakeSafeLogStr(char *str);
|
||||||
void AddLogBufToStr(BUF *b, char *name, char *value);
|
void AddLogBufToStr(BUF *b, char *name, char *value);
|
||||||
void SetEraserCheckInterval(UINT interval);
|
void SetEraserCheckInterval(UINT interval);
|
||||||
UINT GetEraserCheckInterval();
|
UINT GetEraserCheckInterval();
|
||||||
void SetMaxLogSize(UINT64 size);
|
void SetMaxLogSize(UINT64 size);
|
||||||
UINT64 GetMaxLogSize();
|
UINT64 GetMaxLogSize();
|
||||||
|
|
||||||
#endif // LOGGING_G
|
#endif // LOGGING_G
|
||||||
|
|
||||||
|
3074
src/Cedar/NM.c
3074
src/Cedar/NM.c
File diff suppressed because it is too large
Load Diff
@ -1,16 +1,16 @@
|
|||||||
// SoftEther VPN Source Code - Developer Edition Master Branch
|
// SoftEther VPN Source Code - Developer Edition Master Branch
|
||||||
// Cedar Communication Module
|
// Cedar Communication Module
|
||||||
|
|
||||||
|
|
||||||
// NM.h
|
// NM.h
|
||||||
// Header of NM.c
|
// Header of NM.c
|
||||||
|
|
||||||
#ifndef NM_H
|
#ifndef NM_H
|
||||||
#define NM_H
|
#define NM_H
|
||||||
|
|
||||||
// External function
|
// External function
|
||||||
void NMExec();
|
void NMExec();
|
||||||
|
|
||||||
#endif // NM_H
|
#endif // NM_H
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,72 +1,72 @@
|
|||||||
// SoftEther VPN Source Code - Developer Edition Master Branch
|
// SoftEther VPN Source Code - Developer Edition Master Branch
|
||||||
// Cedar Communication Module
|
// Cedar Communication Module
|
||||||
|
|
||||||
|
|
||||||
// NMInner.h
|
// NMInner.h
|
||||||
// The internal header of NM.c
|
// The internal header of NM.c
|
||||||
|
|
||||||
|
|
||||||
// Constants
|
// Constants
|
||||||
#define NM_REG_KEY "Software\\" GC_REG_COMPANY_NAME "\\PacketiX VPN\\User-mode Router Manager"
|
#define NM_REG_KEY "Software\\" GC_REG_COMPANY_NAME "\\PacketiX VPN\\User-mode Router Manager"
|
||||||
#define NM_SETTING_REG_KEY "Software\\" GC_REG_COMPANY_NAME "\\PacketiX VPN\\User-mode Router Manager\\Settings"
|
#define NM_SETTING_REG_KEY "Software\\" GC_REG_COMPANY_NAME "\\PacketiX VPN\\User-mode Router Manager\\Settings"
|
||||||
|
|
||||||
#define NM_REFRESH_TIME 1000
|
#define NM_REFRESH_TIME 1000
|
||||||
#define NM_NAT_REFRESH_TIME 1000
|
#define NM_NAT_REFRESH_TIME 1000
|
||||||
#define NM_DHCP_REFRESH_TIME 1000
|
#define NM_DHCP_REFRESH_TIME 1000
|
||||||
|
|
||||||
// Nat Admin structure
|
// Nat Admin structure
|
||||||
typedef struct NM
|
typedef struct NM
|
||||||
{
|
{
|
||||||
CEDAR *Cedar; // Cedar
|
CEDAR *Cedar; // Cedar
|
||||||
} NM;
|
} NM;
|
||||||
|
|
||||||
// Connection structure
|
// Connection structure
|
||||||
typedef struct NM_CONNECT
|
typedef struct NM_CONNECT
|
||||||
{
|
{
|
||||||
RPC *Rpc; // RPC
|
RPC *Rpc; // RPC
|
||||||
char *Hostname;
|
char *Hostname;
|
||||||
UINT Port;
|
UINT Port;
|
||||||
} NM_CONNECT;
|
} NM_CONNECT;
|
||||||
|
|
||||||
// Login
|
// Login
|
||||||
typedef struct NM_LOGIN
|
typedef struct NM_LOGIN
|
||||||
{
|
{
|
||||||
char *Hostname;
|
char *Hostname;
|
||||||
UINT Port;
|
UINT Port;
|
||||||
UCHAR hashed_password[SHA1_SIZE];
|
UCHAR hashed_password[SHA1_SIZE];
|
||||||
} NM_LOGIN;
|
} NM_LOGIN;
|
||||||
|
|
||||||
// Internal function
|
// Internal function
|
||||||
void InitNM();
|
void InitNM();
|
||||||
void FreeNM();
|
void FreeNM();
|
||||||
void MainNM();
|
void MainNM();
|
||||||
RPC *NmConnect(char *hostname, UINT port);
|
RPC *NmConnect(char *hostname, UINT port);
|
||||||
UINT NmConnectDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, void *param);
|
UINT NmConnectDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, void *param);
|
||||||
UINT NmLogin(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, void *param);
|
UINT NmLogin(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, void *param);
|
||||||
void NmMainDlg(RPC *r);
|
void NmMainDlg(RPC *r);
|
||||||
UINT NmMainDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, void *param);
|
UINT NmMainDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, void *param);
|
||||||
void NmMainDlgInit(HWND hWnd, RPC *r);
|
void NmMainDlgInit(HWND hWnd, RPC *r);
|
||||||
void NmMainDlgRefresh(HWND hWnd, RPC *r);
|
void NmMainDlgRefresh(HWND hWnd, RPC *r);
|
||||||
void NmEditClientConfig(HWND hWnd, RPC *r);
|
void NmEditClientConfig(HWND hWnd, RPC *r);
|
||||||
void NmEditVhOption(HWND hWnd, SM_HUB *r);
|
void NmEditVhOption(HWND hWnd, SM_HUB *r);
|
||||||
UINT NmEditVhOptionProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, void *param);
|
UINT NmEditVhOptionProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, void *param);
|
||||||
void NmEditVhOptionInit(HWND hWnd, SM_HUB *r);
|
void NmEditVhOptionInit(HWND hWnd, SM_HUB *r);
|
||||||
void NmEditVhOptionUpdate(HWND hWnd, SM_HUB *r);
|
void NmEditVhOptionUpdate(HWND hWnd, SM_HUB *r);
|
||||||
void NmEditVhOptionOnOk(HWND hWnd, SM_HUB *r);
|
void NmEditVhOptionOnOk(HWND hWnd, SM_HUB *r);
|
||||||
void NmEditVhOptionFormToVH(HWND hWnd, VH_OPTION *t);
|
void NmEditVhOptionFormToVH(HWND hWnd, VH_OPTION *t);
|
||||||
bool NmStatus(HWND hWnd, SM_SERVER *s, void *param);
|
bool NmStatus(HWND hWnd, SM_SERVER *s, void *param);
|
||||||
bool NmInfo(HWND hWnd, SM_SERVER *s, void *param);
|
bool NmInfo(HWND hWnd, SM_SERVER *s, void *param);
|
||||||
void NmNat(HWND hWnd, SM_HUB *r);
|
void NmNat(HWND hWnd, SM_HUB *r);
|
||||||
UINT NmNatProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, void *param);
|
UINT NmNatProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, void *param);
|
||||||
void NmNatInit(HWND hWnd, SM_HUB *r);
|
void NmNatInit(HWND hWnd, SM_HUB *r);
|
||||||
void NmNatRefresh(HWND hWnd, SM_HUB *r);
|
void NmNatRefresh(HWND hWnd, SM_HUB *r);
|
||||||
void NmDhcp(HWND hWnd, SM_HUB *r);
|
void NmDhcp(HWND hWnd, SM_HUB *r);
|
||||||
UINT NmDhcpProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, void *param);
|
UINT NmDhcpProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, void *param);
|
||||||
void NmDhcpRefresh(HWND hWnd, SM_HUB *r);
|
void NmDhcpRefresh(HWND hWnd, SM_HUB *r);
|
||||||
void NmDhcpInit(HWND hWnd, SM_HUB *r);
|
void NmDhcpInit(HWND hWnd, SM_HUB *r);
|
||||||
void NmChangePassword(HWND hWnd, RPC *r);
|
void NmChangePassword(HWND hWnd, RPC *r);
|
||||||
UINT NmChangePasswordProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, void *param);
|
UINT NmChangePasswordProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, void *param);
|
||||||
bool NmEditPushRoute(HWND hWnd, SM_HUB *r);
|
bool NmEditPushRoute(HWND hWnd, SM_HUB *r);
|
||||||
UINT NmEditPushRouteProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, void *param);
|
UINT NmEditPushRouteProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, void *param);
|
||||||
|
|
||||||
|
|
||||||
|
3636
src/Cedar/Nat.c
3636
src/Cedar/Nat.c
File diff suppressed because it is too large
Load Diff
424
src/Cedar/Nat.h
424
src/Cedar/Nat.h
@ -1,212 +1,212 @@
|
|||||||
// SoftEther VPN Source Code - Developer Edition Master Branch
|
// SoftEther VPN Source Code - Developer Edition Master Branch
|
||||||
// Cedar Communication Module
|
// Cedar Communication Module
|
||||||
|
|
||||||
|
|
||||||
// Nat.h
|
// Nat.h
|
||||||
// Header of Nat.c
|
// Header of Nat.c
|
||||||
|
|
||||||
#ifndef NAT_H
|
#ifndef NAT_H
|
||||||
#define NAT_H
|
#define NAT_H
|
||||||
|
|
||||||
// Constants
|
// Constants
|
||||||
#define NAT_CONFIG_FILE_NAME "$vpn_router.config" // NAT configuration file
|
#define NAT_CONFIG_FILE_NAME "$vpn_router.config" // NAT configuration file
|
||||||
#define DEFAULT_NAT_ADMIN_PORT 2828 // Default port number for management
|
#define DEFAULT_NAT_ADMIN_PORT 2828 // Default port number for management
|
||||||
#define NAT_ADMIN_PORT_LISTEN_INTERVAL 1000 // Interval for trying to open a port for management
|
#define NAT_ADMIN_PORT_LISTEN_INTERVAL 1000 // Interval for trying to open a port for management
|
||||||
#define NAT_FILE_SAVE_INTERVAL (30 * 1000) // Interval to save
|
#define NAT_FILE_SAVE_INTERVAL (30 * 1000) // Interval to save
|
||||||
|
|
||||||
|
|
||||||
// NAT object
|
// NAT object
|
||||||
struct NAT
|
struct NAT
|
||||||
{
|
{
|
||||||
LOCK *lock; // Lock
|
LOCK *lock; // Lock
|
||||||
UCHAR HashedPassword[SHA1_SIZE]; // Administrative password
|
UCHAR HashedPassword[SHA1_SIZE]; // Administrative password
|
||||||
VH_OPTION Option; // Option
|
VH_OPTION Option; // Option
|
||||||
CEDAR *Cedar; // Cedar
|
CEDAR *Cedar; // Cedar
|
||||||
UINT AdminPort; // Management port number
|
UINT AdminPort; // Management port number
|
||||||
bool Online; // Online flag
|
bool Online; // Online flag
|
||||||
VH *Virtual; // Virtual host object
|
VH *Virtual; // Virtual host object
|
||||||
CLIENT_OPTION *ClientOption; // Client Option
|
CLIENT_OPTION *ClientOption; // Client Option
|
||||||
CLIENT_AUTH *ClientAuth; // Client authentication data
|
CLIENT_AUTH *ClientAuth; // Client authentication data
|
||||||
CFG_RW *CfgRw; // Config file R/W
|
CFG_RW *CfgRw; // Config file R/W
|
||||||
THREAD *AdminAcceptThread; // Management connection reception thread
|
THREAD *AdminAcceptThread; // Management connection reception thread
|
||||||
SOCK *AdminListenSock; // Management port socket
|
SOCK *AdminListenSock; // Management port socket
|
||||||
EVENT *HaltEvent; // Halting event
|
EVENT *HaltEvent; // Halting event
|
||||||
volatile bool Halt; // Halting flag
|
volatile bool Halt; // Halting flag
|
||||||
LIST *AdminList; // Management thread list
|
LIST *AdminList; // Management thread list
|
||||||
X *AdminX; // Server certificate for management
|
X *AdminX; // Server certificate for management
|
||||||
K *AdminK; // Server private key for management
|
K *AdminK; // Server private key for management
|
||||||
SNAT *SecureNAT; // SecureNAT object
|
SNAT *SecureNAT; // SecureNAT object
|
||||||
};
|
};
|
||||||
|
|
||||||
// NAT management connection
|
// NAT management connection
|
||||||
struct NAT_ADMIN
|
struct NAT_ADMIN
|
||||||
{
|
{
|
||||||
NAT *Nat; // NAT
|
NAT *Nat; // NAT
|
||||||
SOCK *Sock; // Socket
|
SOCK *Sock; // Socket
|
||||||
THREAD *Thread; // Thread
|
THREAD *Thread; // Thread
|
||||||
};
|
};
|
||||||
|
|
||||||
// RPC_DUMMY
|
// RPC_DUMMY
|
||||||
struct RPC_DUMMY
|
struct RPC_DUMMY
|
||||||
{
|
{
|
||||||
UINT DummyValue;
|
UINT DummyValue;
|
||||||
};
|
};
|
||||||
|
|
||||||
// RPC_NAT_STATUS
|
// RPC_NAT_STATUS
|
||||||
struct RPC_NAT_STATUS
|
struct RPC_NAT_STATUS
|
||||||
{
|
{
|
||||||
char HubName[MAX_HUBNAME_LEN + 1]; // HUB name
|
char HubName[MAX_HUBNAME_LEN + 1]; // HUB name
|
||||||
UINT NumTcpSessions; // Number of TCP sessions
|
UINT NumTcpSessions; // Number of TCP sessions
|
||||||
UINT NumUdpSessions; // Ntmber of UDP sessions
|
UINT NumUdpSessions; // Ntmber of UDP sessions
|
||||||
UINT NumIcmpSessions; // Number of ICMP sessions
|
UINT NumIcmpSessions; // Number of ICMP sessions
|
||||||
UINT NumDnsSessions; // Number of DNS sessions
|
UINT NumDnsSessions; // Number of DNS sessions
|
||||||
UINT NumDhcpClients; // Number of DHCP clients
|
UINT NumDhcpClients; // Number of DHCP clients
|
||||||
bool IsKernelMode; // Whether kernel mode
|
bool IsKernelMode; // Whether kernel mode
|
||||||
bool IsRawIpMode; // Whether raw IP mode
|
bool IsRawIpMode; // Whether raw IP mode
|
||||||
};
|
};
|
||||||
|
|
||||||
// RPC_NAT_INFO *
|
// RPC_NAT_INFO *
|
||||||
struct RPC_NAT_INFO
|
struct RPC_NAT_INFO
|
||||||
{
|
{
|
||||||
char NatProductName[128]; // Server product name
|
char NatProductName[128]; // Server product name
|
||||||
char NatVersionString[128]; // Server version string
|
char NatVersionString[128]; // Server version string
|
||||||
char NatBuildInfoString[128]; // Server build information string
|
char NatBuildInfoString[128]; // Server build information string
|
||||||
UINT NatVerInt; // Server version integer value
|
UINT NatVerInt; // Server version integer value
|
||||||
UINT NatBuildInt; // Server build number integer value
|
UINT NatBuildInt; // Server build number integer value
|
||||||
char NatHostName[MAX_HOST_NAME_LEN + 1]; // Server host name
|
char NatHostName[MAX_HOST_NAME_LEN + 1]; // Server host name
|
||||||
OS_INFO OsInfo; // OS information
|
OS_INFO OsInfo; // OS information
|
||||||
MEMINFO MemInfo; // Memory information
|
MEMINFO MemInfo; // Memory information
|
||||||
};
|
};
|
||||||
|
|
||||||
// RPC_ENUM_NAT_ITEM
|
// RPC_ENUM_NAT_ITEM
|
||||||
struct RPC_ENUM_NAT_ITEM
|
struct RPC_ENUM_NAT_ITEM
|
||||||
{
|
{
|
||||||
UINT Id; // ID
|
UINT Id; // ID
|
||||||
UINT Protocol; // Protocol
|
UINT Protocol; // Protocol
|
||||||
UINT SrcIp; // Source IP address
|
UINT SrcIp; // Source IP address
|
||||||
char SrcHost[MAX_HOST_NAME_LEN + 1]; // Source host name
|
char SrcHost[MAX_HOST_NAME_LEN + 1]; // Source host name
|
||||||
UINT SrcPort; // Source port number
|
UINT SrcPort; // Source port number
|
||||||
UINT DestIp; // Destination IP address
|
UINT DestIp; // Destination IP address
|
||||||
char DestHost[MAX_HOST_NAME_LEN + 1]; // Destination host name
|
char DestHost[MAX_HOST_NAME_LEN + 1]; // Destination host name
|
||||||
UINT DestPort; // Destination port number
|
UINT DestPort; // Destination port number
|
||||||
UINT64 CreatedTime; // Connection time
|
UINT64 CreatedTime; // Connection time
|
||||||
UINT64 LastCommTime; // Last communication time
|
UINT64 LastCommTime; // Last communication time
|
||||||
UINT64 SendSize; // Transmission size
|
UINT64 SendSize; // Transmission size
|
||||||
UINT64 RecvSize; // Receive size
|
UINT64 RecvSize; // Receive size
|
||||||
UINT TcpStatus; // TCP state
|
UINT TcpStatus; // TCP state
|
||||||
};
|
};
|
||||||
|
|
||||||
// RPC_ENUM_NAT *
|
// RPC_ENUM_NAT *
|
||||||
struct RPC_ENUM_NAT
|
struct RPC_ENUM_NAT
|
||||||
{
|
{
|
||||||
char HubName[MAX_HUBNAME_LEN + 1]; // HUB name
|
char HubName[MAX_HUBNAME_LEN + 1]; // HUB name
|
||||||
UINT NumItem; // Number of items
|
UINT NumItem; // Number of items
|
||||||
RPC_ENUM_NAT_ITEM *Items; // Item
|
RPC_ENUM_NAT_ITEM *Items; // Item
|
||||||
};
|
};
|
||||||
|
|
||||||
// RPC_ENUM_DHCP_ITEM
|
// RPC_ENUM_DHCP_ITEM
|
||||||
struct RPC_ENUM_DHCP_ITEM
|
struct RPC_ENUM_DHCP_ITEM
|
||||||
{
|
{
|
||||||
UINT Id; // ID
|
UINT Id; // ID
|
||||||
UINT64 LeasedTime; // Lease time
|
UINT64 LeasedTime; // Lease time
|
||||||
UINT64 ExpireTime; // Expiration date
|
UINT64 ExpireTime; // Expiration date
|
||||||
UCHAR MacAddress[6]; // MAC address
|
UCHAR MacAddress[6]; // MAC address
|
||||||
UCHAR Padding[2]; // Padding
|
UCHAR Padding[2]; // Padding
|
||||||
UINT IpAddress; // IP address
|
UINT IpAddress; // IP address
|
||||||
UINT Mask; // Subnet mask
|
UINT Mask; // Subnet mask
|
||||||
char Hostname[MAX_HOST_NAME_LEN + 1]; // Host name
|
char Hostname[MAX_HOST_NAME_LEN + 1]; // Host name
|
||||||
};
|
};
|
||||||
|
|
||||||
// RPC_ENUM_DHCP *
|
// RPC_ENUM_DHCP *
|
||||||
struct RPC_ENUM_DHCP
|
struct RPC_ENUM_DHCP
|
||||||
{
|
{
|
||||||
char HubName[MAX_HUBNAME_LEN + 1]; // HUB name
|
char HubName[MAX_HUBNAME_LEN + 1]; // HUB name
|
||||||
UINT NumItem; // Number of items
|
UINT NumItem; // Number of items
|
||||||
RPC_ENUM_DHCP_ITEM *Items; // Item
|
RPC_ENUM_DHCP_ITEM *Items; // Item
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// Function prototype
|
// Function prototype
|
||||||
NAT *NiNewNat();
|
NAT *NiNewNat();
|
||||||
NAT *NiNewNatEx(SNAT *snat, VH_OPTION *o);
|
NAT *NiNewNatEx(SNAT *snat, VH_OPTION *o);
|
||||||
void NiFreeNat(NAT *n);
|
void NiFreeNat(NAT *n);
|
||||||
void NiInitConfig(NAT *n);
|
void NiInitConfig(NAT *n);
|
||||||
void NiFreeConfig(NAT *n);
|
void NiFreeConfig(NAT *n);
|
||||||
void NiInitDefaultConfig(NAT *n);
|
void NiInitDefaultConfig(NAT *n);
|
||||||
void NiSetDefaultVhOption(NAT *n, VH_OPTION *o);
|
void NiSetDefaultVhOption(NAT *n, VH_OPTION *o);
|
||||||
void NiClearUnsupportedVhOptionForDynamicHub(VH_OPTION *o, bool initial);
|
void NiClearUnsupportedVhOptionForDynamicHub(VH_OPTION *o, bool initial);
|
||||||
void NiWriteConfig(NAT *n);
|
void NiWriteConfig(NAT *n);
|
||||||
void NiWriteVhOption(NAT *n, FOLDER *root);
|
void NiWriteVhOption(NAT *n, FOLDER *root);
|
||||||
void NiWriteVhOptionEx(VH_OPTION *o, FOLDER *root);
|
void NiWriteVhOptionEx(VH_OPTION *o, FOLDER *root);
|
||||||
void NiWriteClientData(NAT *n, FOLDER *root);
|
void NiWriteClientData(NAT *n, FOLDER *root);
|
||||||
void NiLoadVhOption(NAT *n, FOLDER *root);
|
void NiLoadVhOption(NAT *n, FOLDER *root);
|
||||||
void NiLoadVhOptionEx(VH_OPTION *o, FOLDER *root);
|
void NiLoadVhOptionEx(VH_OPTION *o, FOLDER *root);
|
||||||
bool NiLoadConfig(NAT *n, FOLDER *root);
|
bool NiLoadConfig(NAT *n, FOLDER *root);
|
||||||
void NiLoadClientData(NAT *n, FOLDER *root);
|
void NiLoadClientData(NAT *n, FOLDER *root);
|
||||||
void NiInitAdminAccept(NAT *n);
|
void NiInitAdminAccept(NAT *n);
|
||||||
void NiFreeAdminAccept(NAT *n);
|
void NiFreeAdminAccept(NAT *n);
|
||||||
void NiListenThread(THREAD *thread, void *param);
|
void NiListenThread(THREAD *thread, void *param);
|
||||||
void NiAdminThread(THREAD *thread, void *param);
|
void NiAdminThread(THREAD *thread, void *param);
|
||||||
void NiAdminMain(NAT *n, SOCK *s);
|
void NiAdminMain(NAT *n, SOCK *s);
|
||||||
PACK *NiRpcServer(RPC *r, char *name, PACK *p);
|
PACK *NiRpcServer(RPC *r, char *name, PACK *p);
|
||||||
|
|
||||||
RPC *NatAdminConnect(CEDAR *cedar, char *hostname, UINT port, void *hashed_password, UINT *err);
|
RPC *NatAdminConnect(CEDAR *cedar, char *hostname, UINT port, void *hashed_password, UINT *err);
|
||||||
void NatAdminDisconnect(RPC *r);
|
void NatAdminDisconnect(RPC *r);
|
||||||
|
|
||||||
void NtStartNat();
|
void NtStartNat();
|
||||||
void NtStopNat();
|
void NtStopNat();
|
||||||
void NtInit();
|
void NtInit();
|
||||||
void NtFree();
|
void NtFree();
|
||||||
|
|
||||||
|
|
||||||
UINT NtOnline(NAT *n, RPC_DUMMY *t);
|
UINT NtOnline(NAT *n, RPC_DUMMY *t);
|
||||||
UINT NtOffline(NAT *n, RPC_DUMMY *t);
|
UINT NtOffline(NAT *n, RPC_DUMMY *t);
|
||||||
UINT NtSetHostOption(NAT *n, VH_OPTION *t);
|
UINT NtSetHostOption(NAT *n, VH_OPTION *t);
|
||||||
UINT NtGetHostOption(NAT *n, VH_OPTION *t);
|
UINT NtGetHostOption(NAT *n, VH_OPTION *t);
|
||||||
UINT NtSetClientConfig(NAT *n, RPC_CREATE_LINK *t);
|
UINT NtSetClientConfig(NAT *n, RPC_CREATE_LINK *t);
|
||||||
UINT NtGetClientConfig(NAT *n, RPC_CREATE_LINK *t);
|
UINT NtGetClientConfig(NAT *n, RPC_CREATE_LINK *t);
|
||||||
UINT NtGetStatus(NAT *n, RPC_NAT_STATUS *t);
|
UINT NtGetStatus(NAT *n, RPC_NAT_STATUS *t);
|
||||||
UINT NtGetInfo(NAT *n, RPC_NAT_INFO *t);
|
UINT NtGetInfo(NAT *n, RPC_NAT_INFO *t);
|
||||||
UINT NtEnumNatList(NAT *n, RPC_ENUM_NAT *t);
|
UINT NtEnumNatList(NAT *n, RPC_ENUM_NAT *t);
|
||||||
UINT NtEnumDhcpList(NAT *n, RPC_ENUM_DHCP *t);
|
UINT NtEnumDhcpList(NAT *n, RPC_ENUM_DHCP *t);
|
||||||
UINT NtSetPassword(NAT *n, RPC_SET_PASSWORD *t);
|
UINT NtSetPassword(NAT *n, RPC_SET_PASSWORD *t);
|
||||||
|
|
||||||
|
|
||||||
UINT NcOnline(RPC *r, RPC_DUMMY *t);
|
UINT NcOnline(RPC *r, RPC_DUMMY *t);
|
||||||
UINT NcOffline(RPC *r, RPC_DUMMY *t);
|
UINT NcOffline(RPC *r, RPC_DUMMY *t);
|
||||||
UINT NcSetHostOption(RPC *r, VH_OPTION *t);
|
UINT NcSetHostOption(RPC *r, VH_OPTION *t);
|
||||||
UINT NcGetHostOption(RPC *r, VH_OPTION *t);
|
UINT NcGetHostOption(RPC *r, VH_OPTION *t);
|
||||||
UINT NcSetClientConfig(RPC *r, RPC_CREATE_LINK *t);
|
UINT NcSetClientConfig(RPC *r, RPC_CREATE_LINK *t);
|
||||||
UINT NcGetClientConfig(RPC *r, RPC_CREATE_LINK *t);
|
UINT NcGetClientConfig(RPC *r, RPC_CREATE_LINK *t);
|
||||||
UINT NcGetStatus(RPC *r, RPC_NAT_STATUS *t);
|
UINT NcGetStatus(RPC *r, RPC_NAT_STATUS *t);
|
||||||
UINT NcGetInfo(RPC *r, RPC_NAT_INFO *t);
|
UINT NcGetInfo(RPC *r, RPC_NAT_INFO *t);
|
||||||
UINT NcEnumNatList(RPC *r, RPC_ENUM_NAT *t);
|
UINT NcEnumNatList(RPC *r, RPC_ENUM_NAT *t);
|
||||||
UINT NcEnumDhcpList(RPC *r, RPC_ENUM_DHCP *t);
|
UINT NcEnumDhcpList(RPC *r, RPC_ENUM_DHCP *t);
|
||||||
UINT NcSetPassword(RPC *r, RPC_SET_PASSWORD *t);
|
UINT NcSetPassword(RPC *r, RPC_SET_PASSWORD *t);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void InRpcEnumDhcp(RPC_ENUM_DHCP *t, PACK *p);
|
void InRpcEnumDhcp(RPC_ENUM_DHCP *t, PACK *p);
|
||||||
void OutRpcEnumDhcp(PACK *p, RPC_ENUM_DHCP *t);
|
void OutRpcEnumDhcp(PACK *p, RPC_ENUM_DHCP *t);
|
||||||
void FreeRpcEnumDhcp(RPC_ENUM_DHCP *t);
|
void FreeRpcEnumDhcp(RPC_ENUM_DHCP *t);
|
||||||
void InRpcEnumNat(RPC_ENUM_NAT *t, PACK *p);
|
void InRpcEnumNat(RPC_ENUM_NAT *t, PACK *p);
|
||||||
void OutRpcEnumNat(PACK *p, RPC_ENUM_NAT *t);
|
void OutRpcEnumNat(PACK *p, RPC_ENUM_NAT *t);
|
||||||
void FreeRpcEnumNat(RPC_ENUM_NAT *t);
|
void FreeRpcEnumNat(RPC_ENUM_NAT *t);
|
||||||
void InRpcNatInfo(RPC_NAT_INFO *t, PACK *p);
|
void InRpcNatInfo(RPC_NAT_INFO *t, PACK *p);
|
||||||
void OutRpcNatInfo(PACK *p, RPC_NAT_INFO *t);
|
void OutRpcNatInfo(PACK *p, RPC_NAT_INFO *t);
|
||||||
void FreeRpcNatInfo(RPC_NAT_INFO *t);
|
void FreeRpcNatInfo(RPC_NAT_INFO *t);
|
||||||
void InRpcNatStatus(RPC_NAT_STATUS *t, PACK *p);
|
void InRpcNatStatus(RPC_NAT_STATUS *t, PACK *p);
|
||||||
void OutRpcNatStatus(PACK *p, RPC_NAT_STATUS *t);
|
void OutRpcNatStatus(PACK *p, RPC_NAT_STATUS *t);
|
||||||
void FreeRpcNatStatus(RPC_NAT_STATUS *t);
|
void FreeRpcNatStatus(RPC_NAT_STATUS *t);
|
||||||
void InVhOption(VH_OPTION *t, PACK *p);
|
void InVhOption(VH_OPTION *t, PACK *p);
|
||||||
void OutVhOption(PACK *p, VH_OPTION *t);
|
void OutVhOption(PACK *p, VH_OPTION *t);
|
||||||
void InRpcDummy(RPC_DUMMY *t, PACK *p);
|
void InRpcDummy(RPC_DUMMY *t, PACK *p);
|
||||||
void OutRpcDummy(PACK *p, RPC_DUMMY *t);
|
void OutRpcDummy(PACK *p, RPC_DUMMY *t);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif // NAT_H
|
#endif // NAT_H
|
||||||
|
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user