├── CppWinRT
├── TestVpnPluginApp
│ ├── test
│ ├── Class.cpp
│ ├── pch.cpp
│ ├── App.idl
│ ├── Assets
│ │ ├── StoreLogo.png
│ │ ├── SplashScreen.scale-200.png
│ │ ├── LockScreenLogo.scale-200.png
│ │ ├── Square44x44Logo.scale-200.png
│ │ ├── Wide310x150Logo.scale-200.png
│ │ ├── Square150x150Logo.scale-200.png
│ │ └── Square44x44Logo.targetsize-24_altform-unplated.png
│ ├── packages.config
│ ├── MainPage.idl
│ ├── App.xaml
│ ├── App.h
│ ├── PropertySheet.props
│ ├── pch.h
│ ├── MainPage.h
│ ├── readme.txt
│ ├── TestVpnPluginApp.vcxproj.filters
│ ├── MainPage.xaml
│ ├── MainPage.cpp
│ ├── Package.appxmanifest
│ ├── App.cpp
│ └── TestVpnPluginApp.vcxproj
├── TestVpnPluginAppBg
│ ├── pch.cpp
│ ├── PacketUtils.cpp
│ ├── TestVpnPluginAppBg.def
│ ├── packages.config
│ ├── Utils.h
│ ├── TestVpnPluginAppBgTask.idl
│ ├── VPNConfiguration.h
│ ├── PropertySheet.props
│ ├── Utils.cpp
│ ├── TestVpnPluginAppBgTask.h
│ ├── readme.txt
│ ├── BackgroundPacketWorker.h
│ ├── pch.h
│ ├── NativeBuffer.h
│ ├── TestVpnPluginAppBg.vcxproj.filters
│ ├── VpnPlugInImpl.h
│ ├── TestVpnPluginAppBgTask.cpp
│ ├── CustomConfiguration.h
│ ├── PacketUtils.h
│ └── TestVpnPluginAppBg.vcxproj
└── TestVpnPluginApp.sln
├── CSharp
├── TestVpnPluginApp
│ ├── Assets
│ │ ├── Logo.png
│ │ ├── Badge.png
│ │ ├── Logo-Main.png
│ │ ├── SmallLogo.png
│ │ ├── SmallLogo-44.png
│ │ ├── SplashScreen.png
│ │ ├── Logo.scale-100.png
│ │ ├── Logo.scale-125.png
│ │ ├── Logo.scale-150.png
│ │ ├── Logo.scale-200.png
│ │ ├── Logo.scale-400.png
│ │ ├── StoreLogo.backup.png
│ │ ├── LargeTile.scale-100.png
│ │ ├── LargeTile.scale-125.png
│ │ ├── LargeTile.scale-150.png
│ │ ├── LargeTile.scale-200.png
│ │ ├── LargeTile.scale-400.png
│ │ ├── SmallLogo.scale-100.png
│ │ ├── SmallLogo.scale-125.png
│ │ ├── SmallLogo.scale-150.png
│ │ ├── SmallLogo.scale-200.png
│ │ ├── SmallLogo.scale-400.png
│ │ ├── SmallTile.scale-100.png
│ │ ├── SmallTile.scale-125.png
│ │ ├── SmallTile.scale-150.png
│ │ ├── SmallTile.scale-200.png
│ │ ├── SmallTile.scale-400.png
│ │ ├── StoreLogo.scale-100.png
│ │ ├── StoreLogo.scale-125.png
│ │ ├── StoreLogo.scale-150.png
│ │ ├── StoreLogo.scale-200.png
│ │ ├── StoreLogo.scale-400.png
│ │ ├── WideTile.scale-100.png
│ │ ├── WideTile.scale-125.png
│ │ ├── WideTile.scale-150.png
│ │ ├── WideTile.scale-200.png
│ │ ├── WideTile.scale-400.png
│ │ ├── SmallLogo-44.scale-100.png
│ │ ├── SmallLogo-44.scale-125.png
│ │ ├── SmallLogo-44.scale-150.png
│ │ ├── SmallLogo-44.scale-200.png
│ │ ├── SmallLogo-44.scale-400.png
│ │ ├── SplashScreen.scale-100.png
│ │ ├── SplashScreen.scale-125.png
│ │ ├── SplashScreen.scale-150.png
│ │ ├── SplashScreen.scale-200.png
│ │ ├── SplashScreen.scale-400.png
│ │ ├── LockScreenLogo.scale-200.png
│ │ ├── SmallLogo.targetsize-16.png
│ │ ├── SmallLogo.targetsize-24.png
│ │ ├── SmallLogo.targetsize-256.png
│ │ ├── SmallLogo.targetsize-32.png
│ │ ├── SmallLogo.targetsize-48.png
│ │ ├── SmallLogo-44.targetsize-16.png
│ │ ├── SmallLogo-44.targetsize-24.png
│ │ ├── SmallLogo-44.targetsize-256.png
│ │ ├── SmallLogo-44.targetsize-32.png
│ │ ├── SmallLogo-44.targetsize-48.png
│ │ ├── Square150x150Logo.scale-200.png
│ │ ├── Square44x44Logo.scale-100.png
│ │ ├── Square44x44Logo.scale-200.png
│ │ ├── Wide310x150Logo.scale-200.png
│ │ ├── SmallLogo.altform-unplated_targetsize-16.png
│ │ ├── SmallLogo.altform-unplated_targetsize-24.png
│ │ ├── SmallLogo.altform-unplated_targetsize-256.png
│ │ ├── SmallLogo.altform-unplated_targetsize-32.png
│ │ ├── SmallLogo.altform-unplated_targetsize-48.png
│ │ ├── SmallLogo-44.altform-unplated_targetsize-16.png
│ │ ├── SmallLogo-44.altform-unplated_targetsize-24.png
│ │ ├── SmallLogo-44.altform-unplated_targetsize-256.png
│ │ ├── SmallLogo-44.altform-unplated_targetsize-32.png
│ │ ├── SmallLogo-44.altform-unplated_targetsize-48.png
│ │ ├── SmallLogo.altform-lightunplated_targetsize-16.png
│ │ ├── SmallLogo.altform-lightunplated_targetsize-24.png
│ │ ├── SmallLogo.altform-lightunplated_targetsize-256.png
│ │ ├── SmallLogo.altform-lightunplated_targetsize-32.png
│ │ ├── SmallLogo.altform-lightunplated_targetsize-48.png
│ │ ├── Square44x44Logo.targetsize-24_altform-unplated.png
│ │ ├── SmallLogo-44.altform-lightunplated_targetsize-16.png
│ │ ├── SmallLogo-44.altform-lightunplated_targetsize-24.png
│ │ ├── SmallLogo-44.altform-lightunplated_targetsize-256.png
│ │ ├── SmallLogo-44.altform-lightunplated_targetsize-32.png
│ │ └── SmallLogo-44.altform-lightunplated_targetsize-48.png
│ ├── App.xaml
│ ├── CredentialsDialog.xaml
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ └── Default.rd.xml
│ ├── CredentialsDialog.xaml.cs
│ ├── Common
│ │ ├── RelayCommand.cs
│ │ └── ObservableDictionary.cs
│ ├── Package.appxmanifest
│ ├── MainPage.xaml
│ ├── App.xaml.cs
│ └── TestVpnPluginApp.csproj
├── TestVpnPluginAppBg
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── Logger.cs
│ ├── TestVpnPluginAppBg.csproj
│ ├── TestVpnPluginAppBgTask.cs
│ └── PacketUtils.cs
└── TestVpnPluginApp.sln
├── SimpleVpnServer
├── SimpleVpnServer
│ ├── Properties
│ │ └── launchSettings.json
│ ├── SimpleVpnServer.csproj
│ ├── Logger.cs
│ └── Client.cs
└── SimpleVpnServer.sln
├── SimpleUDPListener
├── SimpleUDPListener
│ ├── SimpleUDPListener.csproj
│ └── Client.cs
└── SimpleUDPLIstener.sln
├── CODE_OF_CONDUCT.md
├── SUPPORT.md
├── LICENSE
├── SECURITY.md
├── README.md
└── .gitignore
/CppWinRT/TestVpnPluginApp/test:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/CppWinRT/TestVpnPluginApp/Class.cpp:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/CppWinRT/TestVpnPluginApp/pch.cpp:
--------------------------------------------------------------------------------
1 | #include "pch.h"
2 |
--------------------------------------------------------------------------------
/CppWinRT/TestVpnPluginAppBg/pch.cpp:
--------------------------------------------------------------------------------
1 | #include "pch.h"
2 |
--------------------------------------------------------------------------------
/CppWinRT/TestVpnPluginApp/App.idl:
--------------------------------------------------------------------------------
1 | namespace TestVpnPluginApp
2 | {
3 | }
4 |
--------------------------------------------------------------------------------
/CppWinRT/TestVpnPluginAppBg/PacketUtils.cpp:
--------------------------------------------------------------------------------
1 | #include "pch.h"
2 | #include "PacketUtils.h"
3 |
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/Logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/Logo.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/Badge.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/Badge.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/Logo-Main.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/Logo-Main.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/SmallLogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/SmallLogo.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/SmallLogo-44.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/SmallLogo-44.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/SplashScreen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/SplashScreen.png
--------------------------------------------------------------------------------
/CppWinRT/TestVpnPluginApp/Assets/StoreLogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CppWinRT/TestVpnPluginApp/Assets/StoreLogo.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/Logo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/Logo.scale-100.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/Logo.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/Logo.scale-125.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/Logo.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/Logo.scale-150.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/Logo.scale-200.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/Logo.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/Logo.scale-400.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/StoreLogo.backup.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/StoreLogo.backup.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/LargeTile.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/LargeTile.scale-100.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/LargeTile.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/LargeTile.scale-125.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/LargeTile.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/LargeTile.scale-150.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/LargeTile.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/LargeTile.scale-200.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/LargeTile.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/LargeTile.scale-400.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/SmallLogo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/SmallLogo.scale-100.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/SmallLogo.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/SmallLogo.scale-125.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/SmallLogo.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/SmallLogo.scale-150.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/SmallLogo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/SmallLogo.scale-200.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/SmallLogo.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/SmallLogo.scale-400.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/SmallTile.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/SmallTile.scale-100.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/SmallTile.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/SmallTile.scale-125.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/SmallTile.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/SmallTile.scale-150.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/SmallTile.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/SmallTile.scale-200.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/SmallTile.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/SmallTile.scale-400.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/StoreLogo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/StoreLogo.scale-100.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/StoreLogo.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/StoreLogo.scale-125.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/StoreLogo.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/StoreLogo.scale-150.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/StoreLogo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/StoreLogo.scale-200.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/StoreLogo.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/StoreLogo.scale-400.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/WideTile.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/WideTile.scale-100.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/WideTile.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/WideTile.scale-125.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/WideTile.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/WideTile.scale-150.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/WideTile.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/WideTile.scale-200.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/WideTile.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/WideTile.scale-400.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/SmallLogo-44.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/SmallLogo-44.scale-100.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/SmallLogo-44.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/SmallLogo-44.scale-125.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/SmallLogo-44.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/SmallLogo-44.scale-150.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/SmallLogo-44.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/SmallLogo-44.scale-200.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/SmallLogo-44.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/SmallLogo-44.scale-400.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/SplashScreen.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/SplashScreen.scale-100.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/SplashScreen.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/SplashScreen.scale-125.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/SplashScreen.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/SplashScreen.scale-150.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/SplashScreen.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/SplashScreen.scale-200.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/SplashScreen.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/SplashScreen.scale-400.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/LockScreenLogo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/LockScreenLogo.scale-200.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/SmallLogo.targetsize-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/SmallLogo.targetsize-16.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/SmallLogo.targetsize-24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/SmallLogo.targetsize-24.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/SmallLogo.targetsize-256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/SmallLogo.targetsize-256.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/SmallLogo.targetsize-32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/SmallLogo.targetsize-32.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/SmallLogo.targetsize-48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/SmallLogo.targetsize-48.png
--------------------------------------------------------------------------------
/CppWinRT/TestVpnPluginApp/Assets/SplashScreen.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CppWinRT/TestVpnPluginApp/Assets/SplashScreen.scale-200.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/SmallLogo-44.targetsize-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/SmallLogo-44.targetsize-16.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/SmallLogo-44.targetsize-24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/SmallLogo-44.targetsize-24.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/SmallLogo-44.targetsize-256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/SmallLogo-44.targetsize-256.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/SmallLogo-44.targetsize-32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/SmallLogo-44.targetsize-32.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/SmallLogo-44.targetsize-48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/SmallLogo-44.targetsize-48.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/Square150x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/Square150x150Logo.scale-200.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/Square44x44Logo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/Square44x44Logo.scale-100.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/Square44x44Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/Square44x44Logo.scale-200.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/Wide310x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/Wide310x150Logo.scale-200.png
--------------------------------------------------------------------------------
/CppWinRT/TestVpnPluginApp/Assets/LockScreenLogo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CppWinRT/TestVpnPluginApp/Assets/LockScreenLogo.scale-200.png
--------------------------------------------------------------------------------
/CppWinRT/TestVpnPluginApp/Assets/Square44x44Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CppWinRT/TestVpnPluginApp/Assets/Square44x44Logo.scale-200.png
--------------------------------------------------------------------------------
/CppWinRT/TestVpnPluginApp/Assets/Wide310x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CppWinRT/TestVpnPluginApp/Assets/Wide310x150Logo.scale-200.png
--------------------------------------------------------------------------------
/CppWinRT/TestVpnPluginApp/Assets/Square150x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CppWinRT/TestVpnPluginApp/Assets/Square150x150Logo.scale-200.png
--------------------------------------------------------------------------------
/CppWinRT/TestVpnPluginAppBg/TestVpnPluginAppBg.def:
--------------------------------------------------------------------------------
1 | EXPORTS
2 | DllCanUnloadNow = WINRT_CanUnloadNow PRIVATE
3 | DllGetActivationFactory = WINRT_GetActivationFactory PRIVATE
4 |
--------------------------------------------------------------------------------
/CppWinRT/TestVpnPluginApp/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/CppWinRT/TestVpnPluginAppBg/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/SmallLogo.altform-unplated_targetsize-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/SmallLogo.altform-unplated_targetsize-16.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/SmallLogo.altform-unplated_targetsize-24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/SmallLogo.altform-unplated_targetsize-24.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/SmallLogo.altform-unplated_targetsize-256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/SmallLogo.altform-unplated_targetsize-256.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/SmallLogo.altform-unplated_targetsize-32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/SmallLogo.altform-unplated_targetsize-32.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/SmallLogo.altform-unplated_targetsize-48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/SmallLogo.altform-unplated_targetsize-48.png
--------------------------------------------------------------------------------
/CppWinRT/TestVpnPluginApp/MainPage.idl:
--------------------------------------------------------------------------------
1 | namespace TestVpnPluginApp
2 | {
3 | [default_interface]
4 | runtimeclass MainPage : Windows.UI.Xaml.Controls.Page
5 | {
6 | MainPage();
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/SmallLogo-44.altform-unplated_targetsize-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/SmallLogo-44.altform-unplated_targetsize-16.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/SmallLogo-44.altform-unplated_targetsize-24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/SmallLogo-44.altform-unplated_targetsize-24.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/SmallLogo-44.altform-unplated_targetsize-256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/SmallLogo-44.altform-unplated_targetsize-256.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/SmallLogo-44.altform-unplated_targetsize-32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/SmallLogo-44.altform-unplated_targetsize-32.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/SmallLogo-44.altform-unplated_targetsize-48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/SmallLogo-44.altform-unplated_targetsize-48.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/SmallLogo.altform-lightunplated_targetsize-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/SmallLogo.altform-lightunplated_targetsize-16.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/SmallLogo.altform-lightunplated_targetsize-24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/SmallLogo.altform-lightunplated_targetsize-24.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/SmallLogo.altform-lightunplated_targetsize-256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/SmallLogo.altform-lightunplated_targetsize-256.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/SmallLogo.altform-lightunplated_targetsize-32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/SmallLogo.altform-lightunplated_targetsize-32.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/SmallLogo.altform-lightunplated_targetsize-48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/SmallLogo.altform-lightunplated_targetsize-48.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/SmallLogo-44.altform-lightunplated_targetsize-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/SmallLogo-44.altform-lightunplated_targetsize-16.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/SmallLogo-44.altform-lightunplated_targetsize-24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/SmallLogo-44.altform-lightunplated_targetsize-24.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/SmallLogo-44.altform-lightunplated_targetsize-256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/SmallLogo-44.altform-lightunplated_targetsize-256.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/SmallLogo-44.altform-lightunplated_targetsize-32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/SmallLogo-44.altform-lightunplated_targetsize-32.png
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Assets/SmallLogo-44.altform-lightunplated_targetsize-48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CSharp/TestVpnPluginApp/Assets/SmallLogo-44.altform-lightunplated_targetsize-48.png
--------------------------------------------------------------------------------
/CppWinRT/TestVpnPluginApp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UwpVpnPluginSample/HEAD/CppWinRT/TestVpnPluginApp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png
--------------------------------------------------------------------------------
/SimpleVpnServer/SimpleVpnServer/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "profiles": {
3 | "SimpleVpnServer": {
4 | "commandName": "Project",
5 | "commandLineArgs": "/Start /Port 444 /Forward /PacketCounter"
6 | }
7 | }
8 | }
--------------------------------------------------------------------------------
/SimpleVpnServer/SimpleVpnServer/SimpleVpnServer.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | netcoreapp3.1
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/SimpleUDPListener/SimpleUDPListener/SimpleUDPListener.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | netcoreapp3.1
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/CppWinRT/TestVpnPluginApp/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/CppWinRT/TestVpnPluginAppBg/Utils.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | using namespace winrt::Windows::Storage::Streams;
4 | class Utils
5 | {
6 | public:
7 | static std::wstring GetLowerString(winrt::hstring const& input);
8 | static std::wstring GetLowerString(std::wstring& val);
9 | static winrt::hstring GetLowerHString(winrt::hstring const& input);
10 | };
11 |
12 |
--------------------------------------------------------------------------------
/CppWinRT/TestVpnPluginAppBg/TestVpnPluginAppBgTask.idl:
--------------------------------------------------------------------------------
1 | namespace TestVpnPluginAppBg
2 | {
3 | [default_interface]
4 | runtimeclass TestVpnPluginAppBgTask : Windows.ApplicationModel.Background.IBackgroundTask
5 | {
6 | TestVpnPluginAppBgTask();
7 | }
8 |
9 | [default_interface]
10 | runtimeclass VpnPlugInImpl : Windows.Networking.Vpn.IVpnPlugIn
11 | {
12 | VpnPlugInImpl();
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Microsoft Open Source Code of Conduct
2 |
3 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
4 |
5 | Resources:
6 |
7 | - [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/)
8 | - [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
9 | - Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns
10 |
--------------------------------------------------------------------------------
/CppWinRT/TestVpnPluginApp/App.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "App.xaml.g.h"
3 |
4 | namespace winrt::TestVpnPluginApp::implementation
5 | {
6 | struct App : AppT
7 | {
8 | App();
9 |
10 | void OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs const&);
11 | void OnSuspending(IInspectable const&, Windows::ApplicationModel::SuspendingEventArgs const&);
12 | void OnNavigationFailed(IInspectable const&, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs const&);
13 | };
14 | }
15 |
--------------------------------------------------------------------------------
/SUPPORT.md:
--------------------------------------------------------------------------------
1 | # Support
2 |
3 | ## How to file issues and get help
4 |
5 | This project uses GitHub Issues to track bugs and feature requests. Please search the existing
6 | issues before filing new issues to avoid duplicates. For new issues, file your bug or
7 | feature request as a new Issue.
8 |
9 | For help and questions about using this project, please use the [Windows Q&A forums](https://docs.microsoft.com/en-us/answers/topics/46321/windows-uwp.html), marking your question as a "windows-uwp" question.
10 |
11 | ## Microsoft Support Policy
12 |
13 | Support for this **PROJECT or PRODUCT** is limited to the resources listed above.
14 |
--------------------------------------------------------------------------------
/CppWinRT/TestVpnPluginAppBg/VPNConfiguration.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "pch.h"
3 |
4 | using namespace winrt::Windows::Networking::Vpn;
5 |
6 | struct VPN_AUTHENTICATION
7 | {
8 | VpnCredentialType authType;
9 | std::wstring expectedUser;
10 | std::wstring expectedPass;
11 | std::wstring expectedPin;
12 | std::wstring expectedNewPass;
13 | std::wstring certSubject;
14 | bool useSingleSignOn;
15 | };
16 |
17 | enum class VPN_PLUGIN_TYPE
18 | {
19 | VPN_PLUGIN_TRANSPORT_TYPE_TCP,
20 | VPN_PLUGIN_TRANSPORT_TYPE_UDP,
21 | VPN_PLUGIN_TRANSPORT_TYPE_DUAL,
22 | VPN_PLUGIN_TRANSPORT_TYPE_MAX
23 | };
24 |
25 |
26 | class VpnConfiguration
27 | {
28 | };
29 |
30 |
--------------------------------------------------------------------------------
/CppWinRT/TestVpnPluginApp/PropertySheet.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/CppWinRT/TestVpnPluginAppBg/PropertySheet.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/CppWinRT/TestVpnPluginApp/pch.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include
3 | #include
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include
10 | #include
11 | #include
12 | #include
13 | #include
14 | #include
15 | #include
16 |
17 | #include
18 | #include
19 |
--------------------------------------------------------------------------------
/CppWinRT/TestVpnPluginAppBg/Utils.cpp:
--------------------------------------------------------------------------------
1 | #include "pch.h"
2 | #include "Utils.h"
3 |
4 | using namespace winrt::Windows::Foundation;
5 | using namespace winrt::Windows::Security::Cryptography::Core;
6 | using namespace winrt::Windows::Storage::Streams;
7 |
8 | std::wstring Utils::GetLowerString(winrt::hstring const& input)
9 | {
10 | auto val = std::wstring{ input };
11 | return GetLowerString(val);
12 | }
13 |
14 | std::wstring Utils::GetLowerString(std::wstring& val)
15 | {
16 | std::transform(
17 | val.begin(), val.end(),
18 | val.begin(),
19 | towlower);
20 | return val;
21 | }
22 |
23 | winrt::hstring Utils::GetLowerHString(winrt::hstring const& input)
24 | {
25 | auto val = winrt::hstring{ GetLowerString(input) };
26 | return val;
27 | }
28 |
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/CredentialsDialog.xaml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/CppWinRT/TestVpnPluginAppBg/TestVpnPluginAppBgTask.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "TestVpnPluginAppBgTask.g.h"
3 |
4 | using namespace winrt;
5 | using namespace winrt::Windows::Networking::Vpn;
6 | using namespace winrt::Windows::ApplicationModel;
7 | using namespace Background;
8 | using namespace Core;
9 | using namespace winrt::Windows::Foundation;
10 | using namespace winrt::Windows::System;
11 | using namespace winrt::Windows::UI::Core;
12 |
13 |
14 | namespace winrt::TestVpnPluginAppBg::implementation
15 | {
16 | struct TestVpnPluginAppBgTask : TestVpnPluginAppBgTaskT
17 | {
18 | TestVpnPluginAppBgTask() = default;
19 |
20 | void Run(Windows::ApplicationModel::Background::IBackgroundTaskInstance const& taskInstance);
21 | };
22 | }
23 | namespace winrt::TestVpnPluginAppBg::factory_implementation
24 | {
25 | struct TestVpnPluginAppBgTask : TestVpnPluginAppBgTaskT
26 | {
27 | };
28 | }
--------------------------------------------------------------------------------
/CppWinRT/TestVpnPluginApp/MainPage.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "MainPage.g.h"
4 |
5 | namespace winrt::TestVpnPluginApp::implementation
6 | {
7 | struct MainPage : MainPageT
8 | {
9 | MainPage();
10 | hstring PROFILE_NAME = L"CPP Test VPN Plugin Autoprofile";
11 |
12 | winrt::Windows::Networking::Vpn::VpnManagementAgent VpnAgent() const
13 | {
14 | return m_VpnAgent;
15 | }
16 |
17 | Windows::Foundation::IAsyncAction CreateAppProfileOnClick(IInspectable, winrt::Windows::UI::Xaml::RoutedEventArgs);
18 | Windows::Foundation::IAsyncAction CreateProfileHandler();
19 | Windows::Foundation::IAsyncAction MainPage::DeleteExistingProfile(hstring profileName);
20 |
21 | private:
22 | winrt::Windows::Networking::Vpn::VpnManagementAgent m_VpnAgent;
23 | };
24 | }
25 |
26 | namespace winrt::TestVpnPluginApp::factory_implementation
27 | {
28 | struct MainPage : MainPageT
29 | {
30 | };
31 | }
32 |
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // General Information about an assembly is controlled through the following
5 | // set of attributes. Change these attribute values to modify the information
6 | // associated with an assembly.
7 | [assembly: AssemblyTitle("TestVpnPluginApp")]
8 | [assembly: AssemblyDescription("")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("TestVpnPluginApp")]
12 | [assembly: AssemblyCopyright("Copyright © 2015")]
13 | [assembly: AssemblyTrademark("")]
14 | [assembly: AssemblyCulture("")]
15 |
16 | // Version information for an assembly consists of the following four values:
17 | //
18 | // Major Version
19 | // Minor Version
20 | // Build Number
21 | // Revision
22 | //
23 | // You can specify all the values or you can default the Build and Revision Numbers
24 | // by using the '*' as shown below:
25 | // [assembly: AssemblyVersion("1.0.*")]
26 | [assembly: AssemblyVersion("1.0.0.0")]
27 | [assembly: AssemblyFileVersion("1.0.0.0")]
28 | [assembly: ComVisible(false)]
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginAppBg/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("TestVpnPluginAppBg")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("TestVpnPluginAppBg")]
13 | [assembly: AssemblyCopyright("Copyright © 2015")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Version information for an assembly consists of the following four values:
18 | //
19 | // Major Version
20 | // Minor Version
21 | // Build Number
22 | // Revision
23 | //
24 | // You can specify all the values or you can default the Build and Revision Numbers
25 | // by using the '*' as shown below:
26 | // [assembly: AssemblyVersion("1.0.*")]
27 | [assembly: AssemblyVersion("1.0.0.0")]
28 | [assembly: AssemblyFileVersion("1.0.0.0")]
29 | [assembly: ComVisible(false)]
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) Microsoft Corporation.
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE
22 |
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/CredentialsDialog.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Runtime.InteropServices.WindowsRuntime;
6 | using Windows.Foundation;
7 | using Windows.Foundation.Collections;
8 | using Windows.UI.Xaml;
9 | using Windows.UI.Xaml.Controls;
10 | using Windows.UI.Xaml.Controls.Primitives;
11 | using Windows.UI.Xaml.Data;
12 | using Windows.UI.Xaml.Input;
13 | using Windows.UI.Xaml.Media;
14 | using Windows.UI.Xaml.Navigation;
15 |
16 | // The Content Dialog item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
17 |
18 | namespace TestVpnPluginApp
19 | {
20 | public sealed partial class CredentialsDialog : ContentDialog
21 | {
22 | public ValueSet valueSet;
23 | public CredentialsDialog()
24 | {
25 | this.InitializeComponent();
26 | valueSet = new ValueSet();
27 | }
28 |
29 |
30 | private void Submit_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
31 | {
32 | valueSet.Add("Username", Username.Text);
33 | valueSet.Add("Password", Password.Password);
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/SimpleVpnServer/SimpleVpnServer.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.30907.101
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleVpnServer", "SimpleVpnServer\SimpleVpnServer.csproj", "{13E7361B-E866-498E-9970-61E69946C470}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {13E7361B-E866-498E-9970-61E69946C470}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {13E7361B-E866-498E-9970-61E69946C470}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {13E7361B-E866-498E-9970-61E69946C470}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {13E7361B-E866-498E-9970-61E69946C470}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {E621FD01-E19F-4899-8548-B48A46B2746A}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/CppWinRT/TestVpnPluginApp/readme.txt:
--------------------------------------------------------------------------------
1 | ========================================================================
2 | C++/WinRT TestVpnPluginApp Project Overview
3 | ========================================================================
4 |
5 | This project demonstrates how to get started writing XAML apps directly
6 | with standard C++, using the C++/WinRT SDK component and XAML compiler
7 | support to generate implementation headers from interface (IDL) files.
8 | These headers can then be used to implement the local Windows Runtime
9 | classes referenced in the app's XAML pages.
10 |
11 | Steps:
12 | 1. Create an interface (IDL) file to define any local Windows Runtime
13 | classes referenced in the app's XAML pages.
14 | 2. Build the project once to generate implementation templates under
15 | the "Generated Files" folder, as well as skeleton class definitions
16 | under "Generated Files\sources".
17 | 3. Use the skeleton class definitions for reference to implement your
18 | Windows Runtime classes.
19 |
20 | ========================================================================
21 | Learn more about C++/WinRT here:
22 | http://aka.ms/cppwinrt/
23 | ========================================================================
24 |
--------------------------------------------------------------------------------
/SimpleUDPListener/SimpleUDPLIstener.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.30804.86
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SimpleUDPListener", "SimpleUDPListener\SimpleUDPListener.csproj", "{3B5B11A4-198F-4226-A21A-6630E566DB27}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {3B5B11A4-198F-4226-A21A-6630E566DB27}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {3B5B11A4-198F-4226-A21A-6630E566DB27}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {3B5B11A4-198F-4226-A21A-6630E566DB27}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {3B5B11A4-198F-4226-A21A-6630E566DB27}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {8865CAEB-3C12-4B81-A420-F2293F8DFF28}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/CppWinRT/TestVpnPluginAppBg/readme.txt:
--------------------------------------------------------------------------------
1 | ========================================================================
2 | C++/WinRT TestVpnPluginAppBg Project Overview
3 | ========================================================================
4 |
5 | This project demonstrates how to get started authoring Windows Runtime
6 | classes directly with standard C++, using the C++/WinRT SDK component
7 | to generate implementation headers from interface (IDL) files. The
8 | generated Windows Runtime component binary and WinMD files should then
9 | be bundled with the Universal Windows Platform (UWP) app consuming them.
10 |
11 | Steps:
12 | 1. Create an interface (IDL) file to define your Windows Runtime class,
13 | its default interface, and any other interfaces it implements.
14 | 2. Build the project once to generate module.g.cpp, module.h.cpp, and
15 | implementation templates under the "Generated Files" folder, as
16 | well as skeleton class definitions under "Generated Files\sources".
17 | 3. Use the skeleton class definitions for reference to implement your
18 | Windows Runtime classes.
19 |
20 | ========================================================================
21 | Learn more about C++/WinRT here:
22 | http://aka.ms/cppwinrt/
23 | ========================================================================
24 |
--------------------------------------------------------------------------------
/CppWinRT/TestVpnPluginAppBg/BackgroundPacketWorker.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include
3 |
4 | using namespace std;
5 | using namespace winrt::Windows::Networking;
6 | using namespace winrt::Windows::Networking::Vpn;
7 | using namespace winrt::Windows::Networking::Sockets;
8 |
9 | using namespace winrt::Windows::Storage::Streams;
10 |
11 |
12 | struct VPN_PLUGIN_DECAP_STATE
13 | {
14 | uint8_t* currentPartialPacket;
15 | uint16_t packetHostOrderTotalLength;
16 | uint32_t currentSize;
17 | bool isV6;
18 | };
19 |
20 | static void FinishWithCurrentPacket(winrt::Windows::Networking::Vpn::VpnChannel const& channel, VPN_PLUGIN_DECAP_STATE& state, uint8_t* buffer);
21 |
22 | static void ProcessPacketVersion(uint8_t* buffer, uint32_t length, VPN_PLUGIN_DECAP_STATE& state);
23 | static bool IsV6Packet(uint8_t* buffer);
24 |
25 | static VPN_CONTROL GetAndHandleControlByte(uint8_t* buffer);
26 |
27 |
28 | class BackgroundPacketWorker
29 | {
30 | public:
31 | std::queue q;
32 | std::shared_mutex m;
33 | bool isWorking;
34 | VPN_PLUGIN_DECAP_STATE gDecapState;
35 |
36 | void AddPacket(VpnPacketBuffer buff);
37 | void EncapPacketLambda(winrt::Windows::Networking::Vpn::VpnChannel const& channel);
38 | void TryStartConsumePacketsThread(bool encap, winrt::Windows::Networking::Vpn::VpnChannel const& channel);
39 | };
40 |
41 |
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Properties/Default.rd.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/CppWinRT/TestVpnPluginAppBg/pch.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include
3 | #include
4 | #include
5 |
6 | #include
7 | #include
8 | #include
9 | #include
10 | #include
11 | #include
12 | #include
13 | #include
14 |
15 | #include
16 | #include
17 |
18 | #include
19 |
20 | #include
21 | #include
22 |
23 | #include
24 | #include
25 |
26 | #include
27 | #include
28 | #include
29 |
30 | #include
31 | #include
32 | #include
33 | #include
34 | #include
35 |
36 | #include
37 | #include
38 |
39 | #include
40 | #include
41 | #include
42 | #include
43 |
44 | #include
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/SimpleUDPListener/SimpleUDPListener/Client.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Net;
3 | using System.Net.Sockets;
4 | using System.Text;
5 |
6 | namespace SampleServerClient
7 | {
8 | class Client
9 | {
10 | static void Main(string[] args)
11 | {
12 | bool done = false;
13 | int listenPort = 55600;
14 | using (UdpClient listener = new UdpClient(listenPort))
15 | {
16 | IPEndPoint listenEndPoint = new IPEndPoint(IPAddress.Any, listenPort);
17 | while (!done)
18 | {
19 | byte[] receivedData = listener.Receive(ref listenEndPoint);
20 | string decodedData = Encoding.ASCII.GetString(receivedData);
21 |
22 | Console.WriteLine("Received broadcast message from client {0}", listenEndPoint.ToString());
23 |
24 | Console.WriteLine("Decoded data is:");
25 | Console.WriteLine(decodedData);
26 |
27 | if (decodedData.ToLower().Contains("done"))
28 | {
29 | done = true;
30 | receivedData = Encoding.ASCII.GetBytes("Closing socket: received payload containing done");
31 | }
32 |
33 | //now we reply
34 |
35 | listener.Send(receivedData, receivedData.Length, listenEndPoint);
36 | Console.Write("Sent response to: {0}", listenEndPoint.ToString());
37 | }
38 | }
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/CppWinRT/TestVpnPluginAppBg/NativeBuffer.h:
--------------------------------------------------------------------------------
1 | /*++
2 |
3 | Copyright (c) 2019 Microsoft Corporation
4 |
5 | Module Name:
6 |
7 | NativeBuffer.h
8 |
9 | Abstract:
10 |
11 | Native buffer that's implements IBuffer and does not perform an alloc.
12 |
13 | --*/
14 |
15 | #include "pch.h"
16 |
17 | using namespace winrt::Windows::Storage::Streams;
18 |
19 | namespace winrt::TestVpnPluginAppBg::implementation
20 | {
21 | struct __declspec(uuid("905a0fef-bc53-11df-8c49-001e4fc686da")) IBufferByteAccess : ::IUnknown
22 | {
23 | virtual HRESULT __stdcall Buffer(void** value) = 0;
24 | };
25 |
26 | struct NativeBuffer : implements
27 | {
28 | unsigned char* m_pointer;
29 | uint32_t m_length{};
30 | uint32_t m_capacity{};
31 |
32 | NativeBuffer(unsigned char* pointer, uint32_t capacity) :
33 | m_pointer(pointer), m_capacity(capacity)
34 | {
35 | }
36 |
37 | uint32_t Capacity() const
38 | {
39 | return m_capacity;
40 | }
41 |
42 | uint32_t Length() const
43 | {
44 | return m_length;
45 | }
46 |
47 | void Length(uint32_t value)
48 | {
49 | if (value > m_capacity)
50 | {
51 | throw hresult_invalid_argument();
52 | }
53 |
54 | m_length = value;
55 | }
56 |
57 | HRESULT __stdcall Buffer(void** value) final
58 | {
59 | *value = m_pointer;
60 | return S_OK;
61 | }
62 | };
63 | }
64 |
--------------------------------------------------------------------------------
/CppWinRT/TestVpnPluginAppBg/TestVpnPluginAppBg.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | accd3aa8-1ba0-4223-9bbe-0c431709210b
6 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tga;tiff;tif;png;wav;mfcribbon-ms
7 |
8 |
9 | {926ab91d-31b4-48c3-b9a4-e681349f27f0}
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.30711.63
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestVpnPluginApp", "TestVpnPluginApp\TestVpnPluginApp.csproj", "{67E7B63A-9255-431F-8B33-1703069E2C39}"
7 | ProjectSection(ProjectDependencies) = postProject
8 | {78E031DB-E1B6-4F11-816F-E43C24B01BD4} = {78E031DB-E1B6-4F11-816F-E43C24B01BD4}
9 | EndProjectSection
10 | EndProject
11 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestVpnPluginAppBg", "TestVpnPluginAppBg\TestVpnPluginAppBg.csproj", "{78E031DB-E1B6-4F11-816F-E43C24B01BD4}"
12 | EndProject
13 | Global
14 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
15 | Debug|x64 = Debug|x64
16 | Release|x64 = Release|x64
17 | EndGlobalSection
18 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
19 | {67E7B63A-9255-431F-8B33-1703069E2C39}.Debug|x64.ActiveCfg = Debug|x64
20 | {67E7B63A-9255-431F-8B33-1703069E2C39}.Debug|x64.Build.0 = Debug|x64
21 | {67E7B63A-9255-431F-8B33-1703069E2C39}.Debug|x64.Deploy.0 = Debug|x64
22 | {67E7B63A-9255-431F-8B33-1703069E2C39}.Release|x64.ActiveCfg = Release|x64
23 | {67E7B63A-9255-431F-8B33-1703069E2C39}.Release|x64.Build.0 = Release|x64
24 | {67E7B63A-9255-431F-8B33-1703069E2C39}.Release|x64.Deploy.0 = Release|x64
25 | {78E031DB-E1B6-4F11-816F-E43C24B01BD4}.Debug|x64.ActiveCfg = Debug|x64
26 | {78E031DB-E1B6-4F11-816F-E43C24B01BD4}.Debug|x64.Build.0 = Debug|x64
27 | {78E031DB-E1B6-4F11-816F-E43C24B01BD4}.Release|x64.ActiveCfg = Release|x64
28 | {78E031DB-E1B6-4F11-816F-E43C24B01BD4}.Release|x64.Build.0 = Release|x64
29 | EndGlobalSection
30 | GlobalSection(SolutionProperties) = preSolution
31 | HideSolutionNode = FALSE
32 | EndGlobalSection
33 | GlobalSection(ExtensibilityGlobals) = postSolution
34 | SolutionGuid = {883210F9-51D2-4BEC-A671-DB8BD9B60111}
35 | EndGlobalSection
36 | EndGlobal
37 |
--------------------------------------------------------------------------------
/CppWinRT/TestVpnPluginApp/TestVpnPluginApp.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | Assets
25 |
26 |
27 | Assets
28 |
29 |
30 | Assets
31 |
32 |
33 | Assets
34 |
35 |
36 | Assets
37 |
38 |
39 | Assets
40 |
41 |
42 | Assets
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 | {e48dc53e-40b1-40cb-970a-f89935452892}
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/CppWinRT/TestVpnPluginApp/MainPage.xaml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
15 | Vpn Test Plugin
16 |
17 |
18 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
42 |
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/CppWinRT/TestVpnPluginAppBg/VpnPlugInImpl.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "VpnPlugInImpl.g.h"
3 | #include "CustomConfiguration.h"
4 | #include "Utils.h"
5 | #include "BackgroundPacketWorker.h"
6 |
7 | using namespace winrt::Windows::Networking;
8 | using namespace winrt::Windows::Networking::Vpn;
9 | using namespace winrt::Windows::Networking::Sockets;
10 | using namespace winrt::Windows::Security::Cryptography::Core;
11 |
12 | namespace winrt::TestVpnPluginAppBg::implementation
13 | {
14 | struct VpnPlugInImpl : VpnPlugInImplT
15 | {
16 | VpnPlugInImpl() = default;
17 | bool isReconnect;
18 | StreamSocket tcpSocket{ nullptr };
19 | DatagramSocket udpSocket{ nullptr };
20 |
21 | bool connectedTcp;
22 | bool connectedUdp;
23 | IVector vecIpv4{ winrt::single_threaded_vector() };
24 | IVector vecIpv6{ winrt::single_threaded_vector() };
25 |
26 | BackgroundPacketWorker encapWorker;
27 | BackgroundPacketWorker decapWorker;
28 |
29 | void Connect(Windows::Networking::Vpn::VpnChannel const& channel);
30 | void Disconnect(Windows::Networking::Vpn::VpnChannel const& channel);
31 | void GetKeepAlivePayload(Windows::Networking::Vpn::VpnChannel const& channel, Windows::Networking::Vpn::VpnPacketBuffer& keepAlivePacket);
32 | void Encapsulate(Windows::Networking::Vpn::VpnChannel const& channel, Windows::Networking::Vpn::VpnPacketBufferList const& packets, Windows::Networking::Vpn::VpnPacketBufferList const& encapulatedPackets);
33 | void Decapsulate(Windows::Networking::Vpn::VpnChannel const& channel, Windows::Networking::Vpn::VpnPacketBuffer const& encapBuffer, Windows::Networking::Vpn::VpnPacketBufferList const& decapsulatedPackets, Windows::Networking::Vpn::VpnPacketBufferList const& controlPacketsToSend);
34 |
35 | void AttemptAuthentication(VpnChannel const& channel, CustomConfiguration config);
36 | bool GetCertificateForAuth(VpnChannel const& channel, std::wstring subject, bool onlySmartCardCert, Certificate theCert);
37 | bool SignDataUsingCert(VpnChannel const& channel, Certificate theCert);
38 | };
39 | }
40 | namespace winrt::TestVpnPluginAppBg::factory_implementation
41 | {
42 | struct VpnPlugInImpl : VpnPlugInImplT
43 | {
44 | };
45 | }
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginAppBg/Logger.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Windows.Networking.Vpn;
3 |
4 | namespace TestVpnPluginAppBg
5 | {
6 | #region Enums
7 |
8 | ///
9 | /// Used to control the logging level of the plug-in
10 | ///
11 | public enum VPN_PLUGIN_LOG_LEVEL
12 | {
13 | VPN_PLUGIN_LOG_LEVEL_LOW = 0x1,
14 | VPN_PLUGIN_LOG_LEVEL_MEDIUM,
15 | VPN_PLUGIN_LOG_LEVEL_HIGH
16 | };
17 |
18 | ///
19 | /// logLevel
20 | /// Determines how detailed logs are, can be either low, medium or high. The higher it is, the more logs.
21 | ///
22 | /// packetCapture
23 | /// This is used to specify whether the plug-in should output packet information during encapsulation
24 | /// and decapsulation (for debugging purposes). The packets are output via the standard platform
25 | /// logging API (so they will appear alongside other plug-in logs in ETW). This feature is useful
26 | /// for seeing what type of traffic is flowing through the plug-in (e.g. TCP/UDP/ICMP etc)
27 | ///
28 | /// bufferCapture
29 | /// This is used to specify whether the plug-in should output raw packet buffers during encapsulation
30 | /// and decapsulation (for debugging purposes). The buffer bytes are output via the standard platform
31 | /// logging API (so they will appear alongside other plug-in logs in ETW). This is useful for debugging
32 | /// full packets byte by byte, but not recommended for large packets as the logging message may become
33 | /// too long to be successfully output
34 | ///
35 | public struct LoggingSettings
36 | {
37 | public VPN_PLUGIN_LOG_LEVEL logLevel;
38 | public bool packetCapture;
39 | public bool bufferCapture;
40 | };
41 |
42 | #endregion
43 | public sealed class Logger
44 | {
45 | private static readonly Lazy lazy = new Lazy (() => new Logger());
46 |
47 | public static Logger Instance { get { return lazy.Value; } }
48 |
49 | internal LoggingSettings loggingSettings;
50 |
51 | private Logger()
52 | {
53 | loggingSettings = new LoggingSettings();
54 | loggingSettings.logLevel = VPN_PLUGIN_LOG_LEVEL.VPN_PLUGIN_LOG_LEVEL_MEDIUM;
55 | }
56 |
57 | public void LogMessage(VpnChannel channel, VPN_PLUGIN_LOG_LEVEL level, string message)
58 | {
59 | if (level <= loggingSettings.logLevel)
60 | {
61 | channel.LogDiagnosticMessage(message);
62 | }
63 | }
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/CppWinRT/TestVpnPluginAppBg/TestVpnPluginAppBgTask.cpp:
--------------------------------------------------------------------------------
1 | #include "pch.h"
2 | #include "TestVpnPluginAppBgTask.h"
3 | #include "TestVpnPluginAppBgTask.g.cpp"
4 | #include "VpnPlugInImpl.h"
5 |
6 |
7 | namespace winrt::TestVpnPluginAppBg::implementation
8 | {
9 | void TestVpnPluginAppBgTask::Run(Windows::ApplicationModel::Background::IBackgroundTaskInstance const& taskInstance)
10 | {
11 | // Deferral is used within the background task to keep the host process from being suspended or terminated while the task is running
12 | BackgroundTaskDeferral deferralObj(nullptr);
13 | static const winrt::hstring PluginName = L"TestVpnPlugin";
14 |
15 | try
16 | {
17 | // To keep the host process from being suspended or terminated while the background task is running
18 | deferralObj = taskInstance.GetDeferral();
19 | IVpnPlugIn plugin;
20 | const auto appProperties = CoreApplication::Properties();
21 |
22 | // First we need to look in the property bag to see if we already have an instantiated plug-in object from a previous invocation
23 | // of this task. It's important to ensure that we use the same instance of our plug-in each time this background task is
24 | // invoked, as the plug-in may have some internal state that needs to be maintained (e.g. partially decapsulated packets)
25 | if (appProperties.HasKey(PluginName))
26 | {
27 | //
28 | // We already have a plug-in instance (instantiated during a previous call to this Run method) so we can retrieve it
29 | //
30 | auto pluginResult = (appProperties.Lookup(PluginName));
31 | plugin = pluginResult.as();
32 | }
33 | else
34 | {
35 | //
36 | // It looks like we don't have a plug-in instance yet, so we need to create a new plug-in instance and store it in
37 | // the property bag so that it can be retrieved by any future calls to this Run method
38 | //
39 | plugin = make();
40 |
41 | if (appProperties.Insert(PluginName, plugin) == TRUE)
42 | {
43 | throw winrt::hresult_error(E_UNEXPECTED, L"Reinsertion of store App Name");
44 | }
45 | }
46 |
47 | VpnChannel::ProcessEventAsync(plugin, taskInstance.TriggerDetails());
48 | }
49 | catch (hresult_error const&)
50 | {
51 | //
52 | // We catch the exception and output it for debugging, but we do not re-throw. The important thing is to make sure that we
53 | // complete the deferral so that the process will not get stuck in a 'Running' state.
54 | //
55 | }
56 |
57 | if (deferralObj != nullptr)
58 | {
59 | deferralObj.Complete();
60 | }
61 | }
62 | }
--------------------------------------------------------------------------------
/CppWinRT/TestVpnPluginApp/MainPage.cpp:
--------------------------------------------------------------------------------
1 | #include "pch.h"
2 | #include "MainPage.h"
3 | #include "MainPage.g.cpp"
4 |
5 | using namespace winrt;
6 | using namespace winrt::Windows::Networking;
7 | using namespace winrt::Windows::Networking::Vpn;
8 | using namespace Windows::UI::Xaml;
9 | using namespace winrt::Windows::Foundation;
10 |
11 | using namespace winrt::Windows::ApplicationModel;
12 |
13 | namespace winrt::TestVpnPluginApp::implementation
14 | {
15 | MainPage::MainPage()
16 | {
17 | InitializeComponent();
18 | }
19 |
20 | Windows::Foundation::IAsyncAction MainPage::CreateAppProfileOnClick(IInspectable, RoutedEventArgs)
21 | {
22 | co_await CreateProfileHandler();
23 | }
24 |
25 | Windows::Foundation::IAsyncAction MainPage::DeleteExistingProfile(hstring profileName)
26 | {
27 | ::IVpnProfile profile{ nullptr };
28 | auto vpnProfiles = co_await VpnAgent().GetProfilesAsync();
29 | bool connected = false;
30 | for (auto const& vpnProfile : vpnProfiles)
31 | {
32 | auto pluginProfile = vpnProfile.try_as();
33 | if ((pluginProfile != nullptr) &&
34 | (pluginProfile.ProfileName() == profileName))
35 | {
36 | connected = (pluginProfile.ConnectionStatus() == VpnManagementConnectionStatus::Connected) || (pluginProfile.ConnectionStatus() == VpnManagementConnectionStatus::Connecting);
37 | profile = vpnProfile;
38 | break;
39 | }
40 | }
41 |
42 | if (connected)
43 | {
44 | co_await VpnAgent().DisconnectProfileAsync(profile);
45 | }
46 | co_await VpnAgent().DeleteProfileAsync(profile);
47 | }
48 |
49 | Windows::Foundation::IAsyncAction MainPage::CreateProfileHandler()
50 | {
51 | co_await DeleteExistingProfile(PROFILE_NAME);
52 | VpnPlugInProfile profile;
53 | profile.ProfileName(PROFILE_NAME);
54 | profile.RequireVpnClientAppUI(true);
55 | profile.VpnPluginPackageFamilyName(Package::Current().Id().FamilyName());
56 | auto uri = Uri(L"http://192.168.1.217");
57 | profile.ServerUris().Append(uri);
58 | profile.CustomConfiguration(L"44410.0.1.2tcphightruetrue192.168.21.024");
59 |
60 | auto returnedStatus = co_await VpnAgent().AddProfileFromObjectAsync(profile);
61 | if (returnedStatus == VpnManagementErrorStatus::Ok)
62 | {
63 | //Log("Created new profile {PROFILE_NAME}");
64 | }
65 | else
66 | {
67 | //Log("Error: unable to create new profile. Reason code is {returnedStatus}");
68 | }
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/CppWinRT/TestVpnPluginApp/Package.appxmanifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
9 | TestVpnPluginApp
10 | mitschmi
11 | Assets\StoreLogo.png
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Common/RelayCommand.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Input;
3 |
4 | namespace TestVpnPluginApp.Common
5 | {
6 | ///
7 | /// A command whose sole purpose is to relay its functionality
8 | /// to other objects by invoking delegates.
9 | /// The default return value for the CanExecute method is 'true'.
10 | /// needs to be called whenever
11 | /// is expected to return a different value.
12 | ///
13 | public class RelayCommand : ICommand
14 | {
15 | private readonly Action _execute;
16 | private readonly Func _canExecute;
17 |
18 | ///
19 | /// Raised when RaiseCanExecuteChanged is called.
20 | ///
21 | public event EventHandler CanExecuteChanged;
22 |
23 | ///
24 | /// Creates a new command that can always execute.
25 | ///
26 | /// The execution logic.
27 | public RelayCommand(Action execute)
28 | : this(execute, null)
29 | {
30 | }
31 |
32 | ///
33 | /// Creates a new command.
34 | ///
35 | /// The execution logic.
36 | /// The execution status logic.
37 | public RelayCommand(Action execute, Func canExecute)
38 | {
39 | if (execute == null)
40 | throw new ArgumentNullException("execute");
41 | _execute = execute;
42 | _canExecute = canExecute;
43 | }
44 |
45 | ///
46 | /// Determines whether this can execute in its current state.
47 | ///
48 | ///
49 | /// Data used by the command. If the command does not require data to be passed, this object can be set to null.
50 | ///
51 | /// true if this command can be executed; otherwise, false.
52 | public bool CanExecute(object parameter)
53 | {
54 | return _canExecute == null ? true : _canExecute();
55 | }
56 |
57 | ///
58 | /// Executes the on the current command target.
59 | ///
60 | ///
61 | /// Data used by the command. If the command does not require data to be passed, this object can be set to null.
62 | ///
63 | public void Execute(object parameter)
64 | {
65 | _execute();
66 | }
67 |
68 | ///
69 | /// Method used to raise the event
70 | /// to indicate that the return value of the
71 | /// method has changed.
72 | ///
73 | public void RaiseCanExecuteChanged()
74 | {
75 | var handler = CanExecuteChanged;
76 | if (handler != null)
77 | {
78 | handler(this, EventArgs.Empty);
79 | }
80 | }
81 | }
82 | }
--------------------------------------------------------------------------------
/SECURITY.md:
--------------------------------------------------------------------------------
1 | ## Important Security Note ##
2 |
3 | The VPN example protocol used in this sample is designed to be easily understood in the context of writing a VPN client. When you create a VPN client, you should use a properly secure protocol with modern encryption and modern authentication of users. The VPN Server code is similar: it's designed so that debugging the VPN connection and packets is easy.
4 |
5 |
6 |
7 | ## Security
8 |
9 | Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).
10 |
11 | If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)), please report it to us as described below.
12 |
13 | ## Reporting Security Issues
14 |
15 | **Please do not report security vulnerabilities through public GitHub issues.**
16 |
17 | Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report).
18 |
19 | If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc).
20 |
21 | You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc).
22 |
23 | Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
24 |
25 | * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
26 | * Full paths of source file(s) related to the manifestation of the issue
27 | * The location of the affected source code (tag/branch/commit or direct URL)
28 | * Any special configuration required to reproduce the issue
29 | * Step-by-step instructions to reproduce the issue
30 | * Proof-of-concept or exploit code (if possible)
31 | * Impact of the issue, including how an attacker might exploit the issue
32 |
33 | This information will help us triage your report more quickly.
34 |
35 | If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs.
36 |
37 | ## Preferred Languages
38 |
39 | We prefer all communications to be in English.
40 |
41 | ## Policy
42 |
43 | Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd).
44 |
45 |
46 |
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Package.appxmanifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | TestVpnPluginApp-SL
10 | VPNDHCP
11 | Assets\StoreLogo.png
12 |
13 |
14 |
15 |
16 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 | CLRHost.dll
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/CppWinRT/TestVpnPluginAppBg/CustomConfiguration.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "Utils.h"
3 |
4 | using namespace winrt::Windows::Networking::Vpn;
5 | using namespace winrt::Windows::Networking::Sockets;
6 |
7 | using namespace winrt::Windows::Foundation::Collections;
8 | using namespace winrt::Windows::Security::Cryptography::Certificates;
9 |
10 | using namespace winrt::Windows::Data::Xml;
11 | using namespace winrt::Windows::Data::Xml::Dom;
12 |
13 |
14 | struct VPN_AUTHENTICATION
15 | {
16 | VpnCredentialType authType;
17 | std::wstring expectedUser;
18 | std::wstring expectedPass;
19 | std::wstring expectedPin;
20 | std::wstring expectedNewPass;
21 | std::wstring certSubject;
22 | bool useSingleSignOn;
23 | };
24 |
25 | enum class VPN_PLUGIN_TRANSPORT_TYPE
26 | {
27 | VPN_PLUGIN_TRANSPORT_TYPE_TCP,
28 | VPN_PLUGIN_TRANSPORT_TYPE_UDP,
29 | VPN_PLUGIN_TRANSPORT_TYPE_DUAL,
30 | VPN_PLUGIN_TRANSPORT_TYPE_MAX
31 | };
32 |
33 | class CustomConfiguration
34 | {
35 |
36 | public:
37 | bool IsV2;
38 | VpnTrafficFilterAssignment trafficFilterAssignment;
39 | std::vector authentications;
40 | std::vector> preAuthCustomPrompts;
41 | std::vector> postAuthCustomPrompts;
42 |
43 | VPN_PLUGIN_TRANSPORT_TYPE transportType = VPN_PLUGIN_TRANSPORT_TYPE::VPN_PLUGIN_TRANSPORT_TYPE_TCP;
44 | bool connectedTcp;
45 | bool connectedUdp;
46 |
47 | std::wstring clientIpV4;
48 | std::wstring clientIpV6;
49 | std::wstring clientIpReconnectV4;
50 | std::wstring clientIpReconnectV6;
51 | std::wstring portServiceName;
52 |
53 | SocketProtectionLevel protectionLevel = SocketProtectionLevel::PlainSocket;
54 | VpnRouteAssignment routeAssignment;
55 | IVector ipv4InclusionRoutes{ winrt::single_threaded_vector() };
56 | IVector ipv4ExclusionRoutes{ winrt::single_threaded_vector() };
57 | IVector ipv6InclusionRoutes{ winrt::single_threaded_vector() };
58 | IVector ipv6ExclusionRoutes{ winrt::single_threaded_vector() };
59 | bool excludeLocalSubnets;
60 |
61 | VpnNamespaceAssignment namespaceAssignment;
62 | IVector namespaceList{ winrt::single_threaded_vector() };
63 |
64 | //v2 Addition
65 | VpnDomainNameAssignment domainnameAssignment;
66 | std::vector domainnameList;
67 |
68 | //
69 | // Default frame size to use. This is only used if no other frame size is specified via custom
70 | // configuration XML.
71 | //
72 | std::uint32_t maxFrameSize = 1501;
73 |
74 | //
75 | // Default port to use when connecting to the VPN server. This is only used if no other port was
76 | // specified via custom configuration XML.
77 | //
78 | std::wstring defaultPort = L"443";
79 |
80 | //
81 | // This member is used to keep track of whether we are being asked to connect for the first time
82 | // or whether we are reconnecting. Depending on the plug-in configuration, we may want to do
83 | // different things during reconnect, so after the first connection we will set this to true
84 | //
85 | bool IsReconnect;
86 |
87 | bool packetCapture;
88 |
89 | bool bufferCapture;
90 |
91 | void ParseConfiguration(const WCHAR* configXml, bool isReconnect, VpnChannel const& channel);
92 |
93 | bool ConvertXmlToCustomPrompt(IXmlNode promptXml, IVector& customPrompt);
94 | bool ConvertXmlToRoute(IXmlNode routeXml, VpnRoute& route);
95 | int GenerateRandomInt(int min, int max);
96 | };
97 |
98 |
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginAppBg/TestVpnPluginAppBg.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {78E031DB-E1B6-4F11-816F-E43C24B01BD4}
8 | winmdobj
9 | Properties
10 | TestVpnPluginAppBg
11 | TestVpnPluginAppBg
12 | en-US
13 | UAP
14 | 10.0.22000.0
15 | 10.0.19041.0
16 | 14
17 | 512
18 | {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
19 | false
20 | win10-arm;win10-arm-aot;win10-x86;win10-x86-aot;win10-x64;win10-x64-aot
21 |
22 |
23 | x64
24 | true
25 | bin\x64\Debug\
26 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP
27 | ;2008
28 | full
29 | x64
30 | false
31 | prompt
32 | true
33 |
34 |
35 | x64
36 | bin\x64\Release\
37 | TRACE;NETFX_CORE;WINDOWS_UWP
38 | true
39 | ;2008
40 | pdbonly
41 | x64
42 | false
43 | prompt
44 | true
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 | 6.2.12
57 |
58 |
59 |
60 | 14.0
61 |
62 |
63 |
70 |
--------------------------------------------------------------------------------
/CppWinRT/TestVpnPluginApp.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.31005.135
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestVpnPluginApp", "TestVpnPluginApp\TestVpnPluginApp.vcxproj", "{2B8422EC-4967-47CA-A41B-B4C0CA12BCC0}"
7 | EndProject
8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestVpnPluginAppBg", "TestVpnPluginAppBg\TestVpnPluginAppBg.vcxproj", "{E12AE3AA-57B6-4AE5-8F46-680E1FABE5C8}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Debug|ARM = Debug|ARM
13 | Debug|ARM64 = Debug|ARM64
14 | Debug|x64 = Debug|x64
15 | Debug|x86 = Debug|x86
16 | Release|ARM = Release|ARM
17 | Release|ARM64 = Release|ARM64
18 | Release|x64 = Release|x64
19 | Release|x86 = Release|x86
20 | EndGlobalSection
21 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
22 | {2B8422EC-4967-47CA-A41B-B4C0CA12BCC0}.Debug|ARM.ActiveCfg = Debug|ARM
23 | {2B8422EC-4967-47CA-A41B-B4C0CA12BCC0}.Debug|ARM.Build.0 = Debug|ARM
24 | {2B8422EC-4967-47CA-A41B-B4C0CA12BCC0}.Debug|ARM.Deploy.0 = Debug|ARM
25 | {2B8422EC-4967-47CA-A41B-B4C0CA12BCC0}.Debug|ARM64.ActiveCfg = Debug|ARM64
26 | {2B8422EC-4967-47CA-A41B-B4C0CA12BCC0}.Debug|ARM64.Build.0 = Debug|ARM64
27 | {2B8422EC-4967-47CA-A41B-B4C0CA12BCC0}.Debug|ARM64.Deploy.0 = Debug|ARM64
28 | {2B8422EC-4967-47CA-A41B-B4C0CA12BCC0}.Debug|x64.ActiveCfg = Debug|x64
29 | {2B8422EC-4967-47CA-A41B-B4C0CA12BCC0}.Debug|x64.Build.0 = Debug|x64
30 | {2B8422EC-4967-47CA-A41B-B4C0CA12BCC0}.Debug|x64.Deploy.0 = Debug|x64
31 | {2B8422EC-4967-47CA-A41B-B4C0CA12BCC0}.Debug|x86.ActiveCfg = Debug|Win32
32 | {2B8422EC-4967-47CA-A41B-B4C0CA12BCC0}.Debug|x86.Build.0 = Debug|Win32
33 | {2B8422EC-4967-47CA-A41B-B4C0CA12BCC0}.Debug|x86.Deploy.0 = Debug|Win32
34 | {2B8422EC-4967-47CA-A41B-B4C0CA12BCC0}.Release|ARM.ActiveCfg = Release|ARM
35 | {2B8422EC-4967-47CA-A41B-B4C0CA12BCC0}.Release|ARM.Build.0 = Release|ARM
36 | {2B8422EC-4967-47CA-A41B-B4C0CA12BCC0}.Release|ARM.Deploy.0 = Release|ARM
37 | {2B8422EC-4967-47CA-A41B-B4C0CA12BCC0}.Release|ARM64.ActiveCfg = Release|ARM64
38 | {2B8422EC-4967-47CA-A41B-B4C0CA12BCC0}.Release|ARM64.Build.0 = Release|ARM64
39 | {2B8422EC-4967-47CA-A41B-B4C0CA12BCC0}.Release|ARM64.Deploy.0 = Release|ARM64
40 | {2B8422EC-4967-47CA-A41B-B4C0CA12BCC0}.Release|x64.ActiveCfg = Release|x64
41 | {2B8422EC-4967-47CA-A41B-B4C0CA12BCC0}.Release|x64.Build.0 = Release|x64
42 | {2B8422EC-4967-47CA-A41B-B4C0CA12BCC0}.Release|x64.Deploy.0 = Release|x64
43 | {2B8422EC-4967-47CA-A41B-B4C0CA12BCC0}.Release|x86.ActiveCfg = Release|Win32
44 | {2B8422EC-4967-47CA-A41B-B4C0CA12BCC0}.Release|x86.Build.0 = Release|Win32
45 | {2B8422EC-4967-47CA-A41B-B4C0CA12BCC0}.Release|x86.Deploy.0 = Release|Win32
46 | {E12AE3AA-57B6-4AE5-8F46-680E1FABE5C8}.Debug|ARM.ActiveCfg = Debug|ARM
47 | {E12AE3AA-57B6-4AE5-8F46-680E1FABE5C8}.Debug|ARM.Build.0 = Debug|ARM
48 | {E12AE3AA-57B6-4AE5-8F46-680E1FABE5C8}.Debug|ARM64.ActiveCfg = Debug|ARM64
49 | {E12AE3AA-57B6-4AE5-8F46-680E1FABE5C8}.Debug|ARM64.Build.0 = Debug|ARM64
50 | {E12AE3AA-57B6-4AE5-8F46-680E1FABE5C8}.Debug|x64.ActiveCfg = Debug|x64
51 | {E12AE3AA-57B6-4AE5-8F46-680E1FABE5C8}.Debug|x64.Build.0 = Debug|x64
52 | {E12AE3AA-57B6-4AE5-8F46-680E1FABE5C8}.Debug|x86.ActiveCfg = Debug|Win32
53 | {E12AE3AA-57B6-4AE5-8F46-680E1FABE5C8}.Debug|x86.Build.0 = Debug|Win32
54 | {E12AE3AA-57B6-4AE5-8F46-680E1FABE5C8}.Release|ARM.ActiveCfg = Release|ARM
55 | {E12AE3AA-57B6-4AE5-8F46-680E1FABE5C8}.Release|ARM.Build.0 = Release|ARM
56 | {E12AE3AA-57B6-4AE5-8F46-680E1FABE5C8}.Release|ARM64.ActiveCfg = Release|ARM64
57 | {E12AE3AA-57B6-4AE5-8F46-680E1FABE5C8}.Release|ARM64.Build.0 = Release|ARM64
58 | {E12AE3AA-57B6-4AE5-8F46-680E1FABE5C8}.Release|x64.ActiveCfg = Release|x64
59 | {E12AE3AA-57B6-4AE5-8F46-680E1FABE5C8}.Release|x64.Build.0 = Release|x64
60 | {E12AE3AA-57B6-4AE5-8F46-680E1FABE5C8}.Release|x86.ActiveCfg = Release|Win32
61 | {E12AE3AA-57B6-4AE5-8F46-680E1FABE5C8}.Release|x86.Build.0 = Release|Win32
62 | EndGlobalSection
63 | GlobalSection(SolutionProperties) = preSolution
64 | HideSolutionNode = FALSE
65 | EndGlobalSection
66 | GlobalSection(ExtensibilityGlobals) = postSolution
67 | SolutionGuid = {54046CE3-1681-4AB8-9DE7-6745626BF855}
68 | EndGlobalSection
69 | EndGlobal
70 |
--------------------------------------------------------------------------------
/CppWinRT/TestVpnPluginApp/App.cpp:
--------------------------------------------------------------------------------
1 | #include "pch.h"
2 |
3 | #include "App.h"
4 | #include "MainPage.h"
5 |
6 | using namespace winrt;
7 | using namespace Windows::ApplicationModel;
8 | using namespace Windows::ApplicationModel::Activation;
9 | using namespace Windows::Foundation;
10 | using namespace Windows::UI::Xaml;
11 | using namespace Windows::UI::Xaml::Controls;
12 | using namespace Windows::UI::Xaml::Navigation;
13 | using namespace TestVpnPluginApp;
14 | using namespace TestVpnPluginApp::implementation;
15 |
16 | ///
17 | /// Initializes the singleton application object. This is the first line of authored code
18 | /// executed, and as such is the logical equivalent of main() or WinMain().
19 | ///
20 | App::App()
21 | {
22 | InitializeComponent();
23 | Suspending({ this, &App::OnSuspending });
24 |
25 | #if defined _DEBUG && !defined DISABLE_XAML_GENERATED_BREAK_ON_UNHANDLED_EXCEPTION
26 | UnhandledException([this](IInspectable const&, UnhandledExceptionEventArgs const& e)
27 | {
28 | if (IsDebuggerPresent())
29 | {
30 | auto errorMessage = e.Message();
31 | __debugbreak();
32 | }
33 | });
34 | #endif
35 | }
36 |
37 | ///
38 | /// Invoked when the application is launched normally by the end user. Other entry points
39 | /// will be used such as when the application is launched to open a specific file.
40 | ///
41 | /// Details about the launch request and process.
42 | void App::OnLaunched(LaunchActivatedEventArgs const& e)
43 | {
44 | Frame rootFrame{ nullptr };
45 | auto content = Window::Current().Content();
46 | if (content)
47 | {
48 | rootFrame = content.try_as();
49 | }
50 |
51 | // Do not repeat app initialization when the Window already has content,
52 | // just ensure that the window is active
53 | if (rootFrame == nullptr)
54 | {
55 | // Create a Frame to act as the navigation context and associate it with
56 | // a SuspensionManager key
57 | rootFrame = Frame();
58 |
59 | rootFrame.NavigationFailed({ this, &App::OnNavigationFailed });
60 |
61 | if (e.PreviousExecutionState() == ApplicationExecutionState::Terminated)
62 | {
63 | // Restore the saved session state only when appropriate, scheduling the
64 | // final launch steps after the restore is complete
65 | }
66 |
67 | if (e.PrelaunchActivated() == false)
68 | {
69 | if (rootFrame.Content() == nullptr)
70 | {
71 | // When the navigation stack isn't restored navigate to the first page,
72 | // configuring the new page by passing required information as a navigation
73 | // parameter
74 | rootFrame.Navigate(xaml_typename(), box_value(e.Arguments()));
75 | }
76 | // Place the frame in the current Window
77 | Window::Current().Content(rootFrame);
78 | // Ensure the current window is active
79 | Window::Current().Activate();
80 | }
81 | }
82 | else
83 | {
84 | if (e.PrelaunchActivated() == false)
85 | {
86 | if (rootFrame.Content() == nullptr)
87 | {
88 | // When the navigation stack isn't restored navigate to the first page,
89 | // configuring the new page by passing required information as a navigation
90 | // parameter
91 | rootFrame.Navigate(xaml_typename(), box_value(e.Arguments()));
92 | }
93 | // Ensure the current window is active
94 | Window::Current().Activate();
95 | }
96 | }
97 | }
98 |
99 | ///
100 | /// Invoked when application execution is being suspended. Application state is saved
101 | /// without knowing whether the application will be terminated or resumed with the contents
102 | /// of memory still intact.
103 | ///
104 | /// The source of the suspend request.
105 | /// Details about the suspend request.
106 | void App::OnSuspending([[maybe_unused]] IInspectable const& sender, [[maybe_unused]] SuspendingEventArgs const& e)
107 | {
108 | // Save application state and stop any background activity
109 | }
110 |
111 | ///
112 | /// Invoked when Navigation to a certain page fails
113 | ///
114 | /// The Frame which failed navigation
115 | /// Details about the navigation failure
116 | void App::OnNavigationFailed(IInspectable const&, NavigationFailedEventArgs const& e)
117 | {
118 | throw hresult_error(E_FAIL, hstring(L"Failed to load Page ") + e.SourcePageType().Name);
119 | }
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/MainPage.xaml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
15 | Vpn Test Plugin
16 |
20 |
21 |
22 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 | TotalPacketsSent:
61 |
62 | TotalUDPSent:
63 |
64 | TotalControlSent:
65 |
66 | TotalKeepAliveSent:
67 |
68 | TotalBytesSent:
69 |
70 |
71 | TotalPacketsReceived:
72 |
73 | TotalControlReceived:
74 |
75 | TotalBytesReceived:
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
--------------------------------------------------------------------------------
/CSharp/TestVpnPluginApp/Common/ObservableDictionary.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using Windows.Foundation.Collections;
5 |
6 | namespace TestVpnPluginApp.Common
7 | {
8 | ///
9 | /// Implementation of IObservableMap that supports reentrancy for use as a default view
10 | /// model.
11 | ///
12 | public class ObservableDictionary : IObservableMap
13 | {
14 | private class ObservableDictionaryChangedEventArgs : IMapChangedEventArgs
15 | {
16 | public ObservableDictionaryChangedEventArgs(CollectionChange change, string key)
17 | {
18 | this.CollectionChange = change;
19 | this.Key = key;
20 | }
21 |
22 | public CollectionChange CollectionChange { get; private set; }
23 | public string Key { get; private set; }
24 | }
25 |
26 | private Dictionary _dictionary = new Dictionary();
27 | public event MapChangedEventHandler MapChanged;
28 |
29 | private void InvokeMapChanged(CollectionChange change, string key)
30 | {
31 | var eventHandler = MapChanged;
32 | if (eventHandler != null)
33 | {
34 | eventHandler(this, new ObservableDictionaryChangedEventArgs(change, key));
35 | }
36 | }
37 |
38 | public void Add(string key, object value)
39 | {
40 | this._dictionary.Add(key, value);
41 | this.InvokeMapChanged(CollectionChange.ItemInserted, key);
42 | }
43 |
44 | public void Add(KeyValuePair item)
45 | {
46 | this.Add(item.Key, item.Value);
47 | }
48 |
49 | public bool Remove(string key)
50 | {
51 | if (this._dictionary.Remove(key))
52 | {
53 | this.InvokeMapChanged(CollectionChange.ItemRemoved, key);
54 | return true;
55 | }
56 | return false;
57 | }
58 |
59 | public bool Remove(KeyValuePair item)
60 | {
61 | object currentValue;
62 | if (this._dictionary.TryGetValue(item.Key, out currentValue) &&
63 | Object.Equals(item.Value, currentValue) && this._dictionary.Remove(item.Key))
64 | {
65 | this.InvokeMapChanged(CollectionChange.ItemRemoved, item.Key);
66 | return true;
67 | }
68 | return false;
69 | }
70 |
71 | public object this[string key]
72 | {
73 | get
74 | {
75 | return this._dictionary[key];
76 | }
77 | set
78 | {
79 | this._dictionary[key] = value;
80 | this.InvokeMapChanged(CollectionChange.ItemChanged, key);
81 | }
82 | }
83 |
84 | public void Clear()
85 | {
86 | var priorKeys = this._dictionary.Keys.ToArray();
87 | this._dictionary.Clear();
88 | foreach (var key in priorKeys)
89 | {
90 | this.InvokeMapChanged(CollectionChange.ItemRemoved, key);
91 | }
92 | }
93 |
94 | public ICollection Keys
95 | {
96 | get { return this._dictionary.Keys; }
97 | }
98 |
99 | public bool ContainsKey(string key)
100 | {
101 | return this._dictionary.ContainsKey(key);
102 | }
103 |
104 | public bool TryGetValue(string key, out object value)
105 | {
106 | return this._dictionary.TryGetValue(key, out value);
107 | }
108 |
109 | public ICollection