├── .gitignore ├── Default.CSharp.props ├── Default.targets ├── LICENSE ├── LICENSE.spdx ├── appveyor.yml ├── eduOpenVPN.Tests ├── .gitignore ├── ConfigurationTests.cs ├── Properties │ └── AssemblyInfo.cs ├── eduOpenVPN.Tests.csproj └── packages.config ├── eduOpenVPN.sln └── eduOpenVPN ├── .gitignore ├── AuthRetryType.cs ├── Configuration.cs ├── Extensions.cs ├── InteractiveService ├── InteractiveServiceException.cs ├── Session.cs ├── Status.cs ├── StatusError.cs └── StatusProcessId.cs ├── Management ├── AuthenticationEventArgs.cs ├── AuthenticationTokenReportedEventArgs.cs ├── ByteCountClientReportedEventArgs.cs ├── ByteCountReportedEventArgs.cs ├── CertificateRequestedEventArgs.cs ├── CommandException.cs ├── EchoReceivedEventArgs.cs ├── HoldReportedEventArgs.cs ├── LogMessageFlags.cs ├── LogReportedEventArgs.cs ├── MessageReportedEventArgs.cs ├── MonitorConnectionException.cs ├── MonitorTerminatedException.cs ├── PasswordAuthenticationRequestedEventArgs.cs ├── ProtocolException.cs ├── RemoteAcceptAction.cs ├── RemoteAction.cs ├── RemoteModAction.cs ├── RemoteReportedEventArgs.cs ├── RemoteSkipAction.cs ├── Session.cs ├── SessionStateException.cs ├── SignRequestedEventArgs.cs ├── StateReportedEventArgs.cs ├── TimestampedEventArgs.cs ├── UnexpectedReplyException.cs └── UsernamePasswordAuthenticationRequestedEventArgs.cs ├── OpenVPNStateType.cs ├── ParameterValueAttribute.cs ├── Properties └── AssemblyInfo.cs ├── ProtoType.cs ├── Resources ├── Strings.Designer.cs ├── Strings.ar.resx ├── Strings.de.resx ├── Strings.es-ES.resx ├── Strings.es.resx ├── Strings.fr.resx ├── Strings.nb.resx ├── Strings.nl.resx ├── Strings.pt-PT.resx ├── Strings.resx ├── Strings.sl.resx ├── Strings.tr.resx └── Strings.uk.resx ├── SignAlgorithmType.cs ├── SignalType.cs └── eduOpenVPN.csproj /.gitignore: -------------------------------------------------------------------------------- 1 | /.vs 2 | /bin 3 | /packages 4 | /TestResults 5 | -------------------------------------------------------------------------------- /Default.CSharp.props: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 13 | 14 | $(SolutionDir)bin\$(Configuration)\$(Platform)\ 15 | 4 16 | prompt 17 | TRACE;PLATFORM_$(Platform);$(DefineConstants) 18 | false 19 | true 20 | full 21 | $(Platform) 22 | 23 | 24 | 27 | 28 | false 29 | DEBUG;$(DefineConstants) 30 | 31 | 32 | true 33 | 34 | 35 | 38 | 39 | $(SolutionDir)bin\$(Configuration)\ 40 | 41 | 42 | v4.8.1 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /Default.targets: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | $(TargetFrameworkSDKToolsDirectory)$(PlatformTarget)\ 11 | 12 | 13 | -------------------------------------------------------------------------------- /LICENSE.spdx: -------------------------------------------------------------------------------- 1 | SPDXVersion: SPDX-2.1 2 | DataLicense: CC0-1.0 3 | PackageName: eduOpenVPN 4 | DataFormat: SPDXRef-1 5 | PackageSupplier: Organization: The Commons Conservancy 6 | PackageHomePage: https://github.com/Amebis/eduOpenVPN 7 | PackageLicenseDeclared: GPL-3.0+ 8 | PackageCopyrightText: 2017-2023 The Commons Conservancy 9 | PackageSummary: OpenVPN Management Library for eduVPN (and beyond) 10 | PackageComment: The package includes the following libraries; see 11 | Relationship information. 12 | Created: 2017-06-06T09:00:00Z 13 | PackageDownloadLocation: git://github.com/Amebis/eduOpenVPN 14 | PackageDownloadLocation: git+https://github.com/Amebis/eduOpenVPN.git 15 | PackageDownloadLocation: git+ssh://github.com/Amebis/eduOpenVPN.git 16 | Creator: Person: Simon Rozman (simon.rozman@amebis.si) 17 | Creator: Organization: Amebis 18 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | version: 1.14.{build} 2 | image: Visual Studio 2022 3 | before_build: 4 | - git clone -q --branch=master https://github.com/Amebis/eduEx.git ..\eduEx 5 | - nuget restore -Verbosity quiet 6 | configuration: 7 | - Debug 8 | - Release 9 | platform: 10 | - Any CPU 11 | - x86 12 | - x64 13 | - ARM64 14 | build: 15 | project: eduOpenVPN.sln 16 | parallel: true 17 | verbosity: minimal 18 | artifacts: 19 | - path: bin\$(configuration)\$(platform) 20 | -------------------------------------------------------------------------------- /eduOpenVPN.Tests/.gitignore: -------------------------------------------------------------------------------- 1 | /obj 2 | -------------------------------------------------------------------------------- /eduOpenVPN.Tests/ConfigurationTests.cs: -------------------------------------------------------------------------------- 1 | /* 2 | eduOpenVPN - OpenVPN Management Library for eduVPN (and beyond) 3 | 4 | Copyright: 2017 The Commons Conservancy 5 | SPDX-License-Identifier: GPL-3.0+ 6 | */ 7 | 8 | using Microsoft.VisualStudio.TestTools.UnitTesting; 9 | using System; 10 | using System.Collections.Generic; 11 | 12 | namespace eduOpenVPN.Tests 13 | { 14 | [TestClass()] 15 | public class ConfigurationTests 16 | { 17 | [TestMethod()] 18 | public void EscapeParamValueTest() 19 | { 20 | Assert.AreEqual("0", Configuration.EscapeParamValue("0")); 21 | Assert.AreEqual("1", Configuration.EscapeParamValue("1")); 22 | Assert.AreEqual("123", Configuration.EscapeParamValue("123")); 23 | Assert.AreEqual("string", Configuration.EscapeParamValue("string")); 24 | Assert.AreEqual("ca.pem", Configuration.EscapeParamValue("ca.pem")); 25 | 26 | Assert.AreEqual(@"""C:\\Program Files\\OpenVPN\\config""", Configuration.EscapeParamValue(@"C:\Program Files\OpenVPN\config")); 27 | Assert.AreEqual(@"""THUMB:00 11 22 33 44 55 66 77 88 99 aa bb cc dd ee ff""", Configuration.EscapeParamValue(@"THUMB:00 11 22 33 44 55 66 77 88 99 aa bb cc dd ee ff")); 28 | } 29 | 30 | [TestMethod()] 31 | public void ParseParamsTest() 32 | { 33 | CollectionAssert.AreEqual(new List(), Configuration.ParseParams("")); 34 | CollectionAssert.AreEqual(new List(), Configuration.ParseParams("# Comment 1")); 35 | CollectionAssert.AreEqual(new List(), Configuration.ParseParams("; Comment 2")); 36 | CollectionAssert.AreEqual(new List() { "param" }, Configuration.ParseParams("param")); 37 | CollectionAssert.AreEqual(new List() { "param1", "param 2", "param 3", "param 4", @"C:\test.txt" }, Configuration.ParseParams(" param1 param\\ 2 \"param 3\" 'param 4' C:\\\\test.txt ")); 38 | 39 | Assert.ThrowsException(() => Configuration.ParseParams(@"C:\certificate.pem")); 40 | Assert.ThrowsException(() => Configuration.ParseParams("\"open param")); 41 | Assert.ThrowsException(() => Configuration.ParseParams("'open param")); 42 | } 43 | } 44 | } -------------------------------------------------------------------------------- /eduOpenVPN.Tests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | /* 2 | eduOpenVPN - OpenVPN Management Library for eduVPN (and beyond) 3 | 4 | Copyright: 2017-2023 The Commons Conservancy 5 | SPDX-License-Identifier: GPL-3.0+ 6 | */ 7 | 8 | using System.Reflection; 9 | using System.Runtime.InteropServices; 10 | 11 | // General Information about an assembly is controlled through the following 12 | // set of attributes. Change these attribute values to modify the information 13 | // associated with an assembly. 14 | [assembly: AssemblyTitle("eduOpenVPN Tests")] 15 | [assembly: AssemblyCompany("SURF")] 16 | [assembly: AssemblyProduct("eduOpenVPN")] 17 | [assembly: AssemblyCopyright("Copyright © 2017-2023 The Commons Conservancy")] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | // The following GUID is for the identifier of the typelib if this project is exposed to COM 25 | [assembly: Guid("08f55aa7-91a7-4ba1-9b62-79053f9ea30d")] 26 | 27 | // Version information for an assembly consists of the following four values: 28 | // 29 | // Major Version 30 | // Minor Version 31 | // Build Number 32 | // Revision 33 | [assembly: AssemblyVersion("1.14.*")] 34 | -------------------------------------------------------------------------------- /eduOpenVPN.Tests/eduOpenVPN.Tests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | 10 | 11 | Debug 12 | AnyCPU 13 | {EC9E752D-3228-47B1-AB68-9FCF0FAA3B8A} 14 | Library 15 | Properties 16 | eduOpenVPN.Tests 17 | eduOpenVPN.Tests 18 | v4.8 19 | 512 20 | {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 21 | 10.0 22 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) 23 | $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages 24 | False 25 | UnitTest 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | $(SolutionDir)packages\MSTest.TestFramework.2.2.8\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll 40 | 41 | 42 | $(SolutionDir)packages\MSTest.TestFramework.2.2.8\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | {DDF40A25-1180-40B1-9BF1-8D3D66D734AD} 62 | eduOpenVPN 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 84 | 85 | 86 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /eduOpenVPN.Tests/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /eduOpenVPN.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.7.34202.233 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "eduOpenVPN", "eduOpenVPN\eduOpenVPN.csproj", "{DDF40A25-1180-40B1-9BF1-8D3D66D734AD}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{2C0E7B6B-CD2D-4E84-8115-5C21EAD53286}" 9 | ProjectSection(SolutionItems) = preProject 10 | LICENSE = LICENSE 11 | LICENSE.spdx = LICENSE.spdx 12 | EndProjectSection 13 | EndProject 14 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "eduOpenVPN.Tests", "eduOpenVPN.Tests\eduOpenVPN.Tests.csproj", "{EC9E752D-3228-47B1-AB68-9FCF0FAA3B8A}" 15 | EndProject 16 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "eduEx", "..\eduEx\eduEx\eduEx.csproj", "{0E2C74AC-C81C-4CC6-B88D-81192623A66D}" 17 | EndProject 18 | Global 19 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 20 | Debug|Any CPU = Debug|Any CPU 21 | Debug|ARM64 = Debug|ARM64 22 | Debug|x64 = Debug|x64 23 | Debug|x86 = Debug|x86 24 | Release|Any CPU = Release|Any CPU 25 | Release|ARM64 = Release|ARM64 26 | Release|x64 = Release|x64 27 | Release|x86 = Release|x86 28 | EndGlobalSection 29 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 30 | {DDF40A25-1180-40B1-9BF1-8D3D66D734AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 31 | {DDF40A25-1180-40B1-9BF1-8D3D66D734AD}.Debug|Any CPU.Build.0 = Debug|Any CPU 32 | {DDF40A25-1180-40B1-9BF1-8D3D66D734AD}.Debug|ARM64.ActiveCfg = Debug|ARM64 33 | {DDF40A25-1180-40B1-9BF1-8D3D66D734AD}.Debug|ARM64.Build.0 = Debug|ARM64 34 | {DDF40A25-1180-40B1-9BF1-8D3D66D734AD}.Debug|x64.ActiveCfg = Debug|x64 35 | {DDF40A25-1180-40B1-9BF1-8D3D66D734AD}.Debug|x64.Build.0 = Debug|x64 36 | {DDF40A25-1180-40B1-9BF1-8D3D66D734AD}.Debug|x86.ActiveCfg = Debug|x86 37 | {DDF40A25-1180-40B1-9BF1-8D3D66D734AD}.Debug|x86.Build.0 = Debug|x86 38 | {DDF40A25-1180-40B1-9BF1-8D3D66D734AD}.Release|Any CPU.ActiveCfg = Release|Any CPU 39 | {DDF40A25-1180-40B1-9BF1-8D3D66D734AD}.Release|Any CPU.Build.0 = Release|Any CPU 40 | {DDF40A25-1180-40B1-9BF1-8D3D66D734AD}.Release|ARM64.ActiveCfg = Release|ARM64 41 | {DDF40A25-1180-40B1-9BF1-8D3D66D734AD}.Release|ARM64.Build.0 = Release|ARM64 42 | {DDF40A25-1180-40B1-9BF1-8D3D66D734AD}.Release|x64.ActiveCfg = Release|x64 43 | {DDF40A25-1180-40B1-9BF1-8D3D66D734AD}.Release|x64.Build.0 = Release|x64 44 | {DDF40A25-1180-40B1-9BF1-8D3D66D734AD}.Release|x86.ActiveCfg = Release|x86 45 | {DDF40A25-1180-40B1-9BF1-8D3D66D734AD}.Release|x86.Build.0 = Release|x86 46 | {EC9E752D-3228-47B1-AB68-9FCF0FAA3B8A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 47 | {EC9E752D-3228-47B1-AB68-9FCF0FAA3B8A}.Debug|Any CPU.Build.0 = Debug|Any CPU 48 | {EC9E752D-3228-47B1-AB68-9FCF0FAA3B8A}.Debug|ARM64.ActiveCfg = Debug|ARM64 49 | {EC9E752D-3228-47B1-AB68-9FCF0FAA3B8A}.Debug|ARM64.Build.0 = Debug|ARM64 50 | {EC9E752D-3228-47B1-AB68-9FCF0FAA3B8A}.Debug|x64.ActiveCfg = Debug|x64 51 | {EC9E752D-3228-47B1-AB68-9FCF0FAA3B8A}.Debug|x64.Build.0 = Debug|x64 52 | {EC9E752D-3228-47B1-AB68-9FCF0FAA3B8A}.Debug|x86.ActiveCfg = Debug|x86 53 | {EC9E752D-3228-47B1-AB68-9FCF0FAA3B8A}.Debug|x86.Build.0 = Debug|x86 54 | {EC9E752D-3228-47B1-AB68-9FCF0FAA3B8A}.Release|Any CPU.ActiveCfg = Release|Any CPU 55 | {EC9E752D-3228-47B1-AB68-9FCF0FAA3B8A}.Release|Any CPU.Build.0 = Release|Any CPU 56 | {EC9E752D-3228-47B1-AB68-9FCF0FAA3B8A}.Release|ARM64.ActiveCfg = Release|ARM64 57 | {EC9E752D-3228-47B1-AB68-9FCF0FAA3B8A}.Release|ARM64.Build.0 = Release|ARM64 58 | {EC9E752D-3228-47B1-AB68-9FCF0FAA3B8A}.Release|x64.ActiveCfg = Release|x64 59 | {EC9E752D-3228-47B1-AB68-9FCF0FAA3B8A}.Release|x64.Build.0 = Release|x64 60 | {EC9E752D-3228-47B1-AB68-9FCF0FAA3B8A}.Release|x86.ActiveCfg = Release|x86 61 | {EC9E752D-3228-47B1-AB68-9FCF0FAA3B8A}.Release|x86.Build.0 = Release|x86 62 | {0E2C74AC-C81C-4CC6-B88D-81192623A66D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 63 | {0E2C74AC-C81C-4CC6-B88D-81192623A66D}.Debug|Any CPU.Build.0 = Debug|Any CPU 64 | {0E2C74AC-C81C-4CC6-B88D-81192623A66D}.Debug|ARM64.ActiveCfg = Debug|ARM64 65 | {0E2C74AC-C81C-4CC6-B88D-81192623A66D}.Debug|ARM64.Build.0 = Debug|ARM64 66 | {0E2C74AC-C81C-4CC6-B88D-81192623A66D}.Debug|x64.ActiveCfg = Debug|x64 67 | {0E2C74AC-C81C-4CC6-B88D-81192623A66D}.Debug|x64.Build.0 = Debug|x64 68 | {0E2C74AC-C81C-4CC6-B88D-81192623A66D}.Debug|x86.ActiveCfg = Debug|x86 69 | {0E2C74AC-C81C-4CC6-B88D-81192623A66D}.Debug|x86.Build.0 = Debug|x86 70 | {0E2C74AC-C81C-4CC6-B88D-81192623A66D}.Release|Any CPU.ActiveCfg = Release|Any CPU 71 | {0E2C74AC-C81C-4CC6-B88D-81192623A66D}.Release|Any CPU.Build.0 = Release|Any CPU 72 | {0E2C74AC-C81C-4CC6-B88D-81192623A66D}.Release|ARM64.ActiveCfg = Release|ARM64 73 | {0E2C74AC-C81C-4CC6-B88D-81192623A66D}.Release|ARM64.Build.0 = Release|ARM64 74 | {0E2C74AC-C81C-4CC6-B88D-81192623A66D}.Release|x64.ActiveCfg = Release|x64 75 | {0E2C74AC-C81C-4CC6-B88D-81192623A66D}.Release|x64.Build.0 = Release|x64 76 | {0E2C74AC-C81C-4CC6-B88D-81192623A66D}.Release|x86.ActiveCfg = Release|x86 77 | {0E2C74AC-C81C-4CC6-B88D-81192623A66D}.Release|x86.Build.0 = Release|x86 78 | EndGlobalSection 79 | GlobalSection(SolutionProperties) = preSolution 80 | HideSolutionNode = FALSE 81 | EndGlobalSection 82 | GlobalSection(ExtensibilityGlobals) = postSolution 83 | SolutionGuid = {5923DFD6-43E6-4DCC-A7C0-6E0D662A7F22} 84 | EndGlobalSection 85 | EndGlobal 86 | -------------------------------------------------------------------------------- /eduOpenVPN/.gitignore: -------------------------------------------------------------------------------- 1 | /obj 2 | -------------------------------------------------------------------------------- /eduOpenVPN/AuthRetryType.cs: -------------------------------------------------------------------------------- 1 | /* 2 | eduOpenVPN - OpenVPN Management Library for eduVPN (and beyond) 3 | 4 | Copyright: 2017-2023 The Commons Conservancy 5 | SPDX-License-Identifier: GPL-3.0+ 6 | */ 7 | 8 | namespace eduOpenVPN 9 | { 10 | /// 11 | /// OpenVPN authentication retry policy 12 | /// 13 | public enum AuthRetryType 14 | { 15 | /// 16 | /// Client will exit with a fatal error (this is the default) 17 | /// 18 | [ParameterValue("none")] 19 | None = 0, 20 | 21 | /// 22 | /// Client will retry the connection without requerying for an --auth-user-pass username/password. Use this option for unattended clients. 23 | /// 24 | [ParameterValue("nointeract")] 25 | NoInteract, 26 | 27 | /// 28 | /// Client will requery for an --auth-user-pass username/password and/or private key password before attempting a reconnection. 29 | /// 30 | [ParameterValue("interact")] 31 | Interact, 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /eduOpenVPN/Configuration.cs: -------------------------------------------------------------------------------- 1 | /* 2 | eduOpenVPN - OpenVPN Management Library for eduVPN (and beyond) 3 | 4 | Copyright: 2017-2023 The Commons Conservancy 5 | SPDX-License-Identifier: GPL-3.0+ 6 | */ 7 | 8 | using System; 9 | using System.Collections.Generic; 10 | 11 | namespace eduOpenVPN 12 | { 13 | /// 14 | /// OpenVPN configuration management helper class 15 | /// 16 | public static class Configuration 17 | { 18 | /// 19 | /// Escapes value string to be used as a parameter in OpenVPN configuration file (.ovpn) 20 | /// 21 | /// Parameter value 22 | /// Force quote 23 | /// Quoted and escaped when escaping required; otherwise 24 | public static string EscapeParamValue(string value, bool force = false) 25 | { 26 | return value.Length > 0 ? 27 | force || value.IndexOfAny(new char[] { '\\', ' ', '"', '\'' }) >= 0 ? 28 | "\"" + value.Replace("\\", "\\\\").Replace("\"", "\\\"") + "\"" : // Escape backslash and double quotes, and add surrounding quotes 29 | value : // No need to escape 30 | "\"\""; // Empty string 31 | } 32 | 33 | /// 34 | /// Parses OpenVPN command line 35 | /// 36 | /// Command line to parse 37 | /// List of string parameters 38 | /// Command line parsing failed 39 | /// This method is OpenVPN v2.5 parse_line() function ported to C#. 40 | public static List ParseParams(string commandLine) 41 | { 42 | var ret = new List(); 43 | int offset = 0, endOffset = commandLine.Length; 44 | var state = ParseParamsState.Initial; 45 | var backslash = false; 46 | char inChar, outChar; 47 | var parm = ""; 48 | 49 | do 50 | { 51 | inChar = offset < endOffset ? commandLine[offset] : default; 52 | outChar = default; 53 | 54 | if (!backslash && inChar == '\\' && state != ParseParamsState.ReadingSingleQuotedParam) 55 | backslash = true; 56 | else 57 | { 58 | if (state == ParseParamsState.Initial) 59 | { 60 | if (!IsZeroOrWhiteChar(inChar)) 61 | { 62 | if (inChar == ';' || inChar == '#') // comment 63 | break; 64 | if (!backslash && inChar == '\"') 65 | state = ParseParamsState.ReadingQuotedParam; 66 | else if (!backslash && inChar == '\'') 67 | state = ParseParamsState.ReadingSingleQuotedParam; 68 | else 69 | { 70 | outChar = inChar; 71 | state = ParseParamsState.ReadingUnquotedParam; 72 | } 73 | } 74 | } 75 | else if (state == ParseParamsState.ReadingUnquotedParam) 76 | { 77 | if (!backslash && IsZeroOrWhiteChar(inChar)) 78 | state = ParseParamsState.Done; 79 | else 80 | outChar = inChar; 81 | } 82 | else if (state == ParseParamsState.ReadingQuotedParam) 83 | { 84 | if (!backslash && inChar == '\"') 85 | state = ParseParamsState.Done; 86 | else 87 | outChar = inChar; 88 | } 89 | else if (state == ParseParamsState.ReadingSingleQuotedParam) 90 | { 91 | if (inChar == '\'') 92 | state = ParseParamsState.Done; 93 | else 94 | outChar = inChar; 95 | } 96 | 97 | if (state == ParseParamsState.Done) 98 | { 99 | ret.Add(parm); 100 | state = ParseParamsState.Initial; 101 | parm = ""; 102 | } 103 | 104 | if (backslash && outChar != default) 105 | { 106 | if (!(outChar == '\\' || outChar == '\"' || IsZeroOrWhiteChar(outChar))) 107 | throw new ArgumentException(Resources.Strings.ErrorBadBackslash, nameof(commandLine)); 108 | } 109 | backslash = false; 110 | } 111 | 112 | // Store parameter character. 113 | if (outChar != default) 114 | parm += outChar; 115 | } 116 | while (offset++ < endOffset); 117 | 118 | switch (state) 119 | { 120 | case ParseParamsState.Initial: break; 121 | case ParseParamsState.ReadingQuotedParam: throw new ArgumentException(Resources.Strings.ErrorNoClosingQuotation, nameof(commandLine)); 122 | case ParseParamsState.ReadingSingleQuotedParam: throw new ArgumentException(Resources.Strings.ErrorNoClosingSingleQuotation, nameof(commandLine)); 123 | default: throw new ArgumentException(string.Format(Resources.Strings.ErrorResidualParseState, state), nameof(commandLine)); 124 | } 125 | 126 | return ret; 127 | } 128 | 129 | /// 130 | /// internal state 131 | /// 132 | private enum ParseParamsState 133 | { 134 | Initial = 0, 135 | ReadingQuotedParam, 136 | ReadingUnquotedParam, 137 | Done, 138 | ReadingSingleQuotedParam, 139 | }; 140 | 141 | /// 142 | /// Indicates whether a Unicode character is zero or categorized as white space. 143 | /// 144 | /// The Unicode character to evaluate 145 | /// true if is zero or white space; falseotherwise 146 | private static bool IsZeroOrWhiteChar(char c) 147 | { 148 | return c == default || char.IsWhiteSpace(c); 149 | } 150 | } 151 | } 152 | -------------------------------------------------------------------------------- /eduOpenVPN/Extensions.cs: -------------------------------------------------------------------------------- 1 | /* 2 | eduOpenVPN - OpenVPN Management Library for eduVPN (and beyond) 3 | 4 | Copyright: 2017-2023 The Commons Conservancy 5 | SPDX-License-Identifier: GPL-3.0+ 6 | */ 7 | 8 | using System; 9 | using System.Diagnostics; 10 | using System.Linq; 11 | 12 | namespace eduOpenVPN 13 | { 14 | public static class Extensions 15 | { 16 | /// 17 | /// Returns attribute value 18 | /// 19 | /// Enum 20 | /// String with attribute value or stringized 21 | [DebuggerStepThrough] 22 | public static string GetParameterValue(this Enum value) 23 | { 24 | if (value == null) 25 | throw new ArgumentNullException(nameof(value)); 26 | 27 | var valueStr = value.ToString(); 28 | var fieldInfo = value.GetType().GetField(valueStr); 29 | return fieldInfo.GetCustomAttributes(typeof(ParameterValueAttribute), false).SingleOrDefault() is ParameterValueAttribute attribute ? attribute.Value : valueStr; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /eduOpenVPN/InteractiveService/InteractiveServiceException.cs: -------------------------------------------------------------------------------- 1 | /* 2 | eduOpenVPN - OpenVPN Management Library for eduVPN (and beyond) 3 | 4 | Copyright: 2017-2023 The Commons Conservancy 5 | SPDX-License-Identifier: GPL-3.0+ 6 | */ 7 | 8 | using System; 9 | using System.Runtime.Serialization; 10 | using System.Security.Permissions; 11 | 12 | namespace eduOpenVPN.InteractiveService 13 | { 14 | /// 15 | /// OpenVPN Interactive Service returned an error. 16 | /// 17 | [Serializable] 18 | public class InteractiveServiceException : Exception 19 | { 20 | #region Properties 21 | 22 | /// 23 | public override string Message 24 | { 25 | get 26 | { 27 | var msg = string.Format(Resources.Strings.ErrorInteractiveService, string.Format("0x{0:X}", ErrorNumber), Function); 28 | return Description != null ? string.Format("{0}\n{1}", msg, Description) : msg; 29 | } 30 | } 31 | 32 | /// 33 | /// Error number 34 | /// 35 | public uint ErrorNumber { get; } 36 | 37 | /// 38 | /// The function that failed 39 | /// 40 | public string Function { get; } 41 | 42 | /// 43 | /// Additional error description (optional) 44 | /// 45 | public string Description { get; } 46 | 47 | #endregion 48 | 49 | #region Constructors 50 | 51 | /// 52 | /// Creates an exception 53 | /// 54 | /// Error number 55 | /// The function that failed 56 | /// Human-readable text providing additional information 57 | public InteractiveServiceException(uint errorNum, string function, string errorDescription) : 58 | base() 59 | { 60 | ErrorNumber = errorNum; 61 | Function = function; 62 | Description = errorDescription; 63 | } 64 | 65 | #endregion 66 | 67 | #region ISerializable Support 68 | 69 | /// 70 | /// Deserialize object. 71 | /// 72 | /// The populated with data. 73 | /// The source of this deserialization. 74 | protected InteractiveServiceException(SerializationInfo info, StreamingContext context) 75 | : base(info, context) 76 | { 77 | ErrorNumber = (uint)info.GetValue("ErrorNumber", typeof(uint)); 78 | Function = (string)info.GetValue("Function", typeof(string)); 79 | Description = (string)info.GetValue("Description", typeof(string)); 80 | } 81 | 82 | /// 83 | [SecurityPermission(SecurityAction.Demand, SerializationFormatter = true)] 84 | public override void GetObjectData(SerializationInfo info, StreamingContext context) 85 | { 86 | base.GetObjectData(info, context); 87 | info.AddValue("ErrorNumber", ErrorNumber); 88 | info.AddValue("Function", Function); 89 | info.AddValue("Description", Description); 90 | } 91 | 92 | #endregion 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /eduOpenVPN/InteractiveService/Session.cs: -------------------------------------------------------------------------------- 1 | /* 2 | eduOpenVPN - OpenVPN Management Library for eduVPN (and beyond) 3 | 4 | Copyright: 2017-2023 The Commons Conservancy 5 | SPDX-License-Identifier: GPL-3.0+ 6 | */ 7 | 8 | using eduEx.Async; 9 | using System; 10 | using System.Diagnostics; 11 | using System.IO; 12 | using System.IO.Pipes; 13 | using System.Linq; 14 | using System.Text; 15 | using System.Threading; 16 | using System.Threading.Tasks; 17 | 18 | namespace eduOpenVPN.InteractiveService 19 | { 20 | /// 21 | /// OpenVPN Interactive Service session 22 | /// 23 | public class Session : IDisposable 24 | { 25 | #region Properties 26 | 27 | /// 28 | /// Named pipe stream to OpenVPN Interactive Service 29 | /// 30 | public NamedPipeClientStream Stream { get; private set; } 31 | 32 | /// 33 | /// openvpn.exe process identifier 34 | /// 35 | public int ProcessId { get; private set; } 36 | 37 | #endregion 38 | 39 | #region Methods 40 | 41 | /// 42 | /// Connects to OpenVPN Interactive Service and sends a command to start openvpn.exe 43 | /// 44 | /// Pipe name to connect to (e.g. "openvpn\\service") 45 | /// openvpn.exe process working folder to start in 46 | /// openvpn.exe command line parameters 47 | /// Text to send to openvpn.exe on start via stdin 48 | /// The number of milliseconds to wait for the server to respond before the connection times out. 49 | /// The token to monitor for cancellation requests 50 | public void Connect(string pipeName, string workingFolder, string[] arguments, string stdin, int timeout = 3000, CancellationToken ct = default) 51 | { 52 | try 53 | { 54 | // Connect to OpenVPN Interactive Service via named pipe. 55 | Trace.TraceInformation("Connecting to OpenVPN interactive service"); 56 | Stream = new NamedPipeClientStream(".", pipeName); 57 | Stream.Connect(timeout); 58 | Stream.ReadMode = PipeTransmissionMode.Message; 59 | } 60 | catch (Exception ex) { throw new AggregateException(string.Format(Resources.Strings.ErrorInteractiveServiceConnect, pipeName), ex); } 61 | 62 | // Ask OpenVPN Interactive Service to start openvpn.exe for us. 63 | Trace.TraceInformation("Triggering openvpn.exe launch"); 64 | var encodingUtf16 = new UnicodeEncoding(false, false); 65 | using (var msgStream = new MemoryStream()) 66 | using (var writer = new BinaryWriter(msgStream, encodingUtf16)) 67 | { 68 | // Working folder (zero terminated) 69 | writer.Write(workingFolder.ToArray()); 70 | writer.Write((char)0); 71 | 72 | // openvpn.exe command line parameters (zero terminated) 73 | writer.Write(string.Join(" ", arguments.Select(arg => arg.IndexOfAny(new char[] { ' ', '"' }) >= 0 ? "\"" + arg.Replace("\"", "\\\"") + "\"" : arg)).ToArray()); 74 | writer.Write((char)0); 75 | 76 | // stdin (zero terminated) 77 | writer.Write(stdin.ToArray()); 78 | writer.Write((char)0); 79 | 80 | Stream.Write(msgStream.GetBuffer(), 0, (int)msgStream.Length, ct); 81 | } 82 | 83 | // Read and analyse status. 84 | var statusTask = ReadStatusAsync(); 85 | try { statusTask.Wait(ct); } 86 | catch (OperationCanceledException) { throw; } 87 | catch (AggregateException ex) { throw ex.InnerException; } 88 | ProcessId = 89 | statusTask.Result is StatusError statusErr && statusErr.Code != 0 ? throw new InteractiveServiceException(statusErr.Code, statusErr.Function, statusErr.Message) : 90 | statusTask.Result is StatusProcessId statusPid ? statusPid.ProcessId : 0; 91 | } 92 | 93 | /// 94 | /// Disconnects from OpenVPN Interactive Service 95 | /// 96 | /// Instead of calling this method, ensure that the connection is properly disposed. 97 | public void Disconnect() 98 | { 99 | if (Stream != null) 100 | { 101 | Trace.TraceInformation("Disconnecting from OpenVPN interactive service"); 102 | Stream.Close(); 103 | Stream = null; 104 | } 105 | } 106 | 107 | /// 108 | /// Reads OpenVPN Interactive reported status 109 | /// 110 | /// Status 111 | public async Task ReadStatusAsync() 112 | { 113 | var data = new byte[1048576]; // Limit to 1MiB 114 | return Status.FromResponse(new string(Encoding.Unicode.GetChars(data, 0, await Stream.ReadAsync(data, 0, data.Length)))); 115 | } 116 | 117 | #endregion 118 | 119 | #region IDisposable Support 120 | /// 121 | /// Flag to detect redundant calls. 122 | /// 123 | [DebuggerBrowsable(DebuggerBrowsableState.Never)] 124 | private bool disposedValue = false; 125 | 126 | /// 127 | /// Called to dispose the object. 128 | /// 129 | /// Dispose managed objects 130 | /// 131 | /// To release resources for inherited classes, override this method. 132 | /// Call base.Dispose(disposing) within it to release parent class resources, and release child class resources if parameter is true. 133 | /// This method can get called multiple times for the same object instance. When the child specific resources should be released only once, introduce a flag to detect redundant calls. 134 | /// 135 | protected virtual void Dispose(bool disposing) 136 | { 137 | if (!disposedValue) 138 | { 139 | if (disposing) 140 | { 141 | if (Stream != null) 142 | Stream.Dispose(); 143 | } 144 | 145 | disposedValue = true; 146 | } 147 | } 148 | 149 | /// 150 | /// Performs application-defined tasks associated with freeing, releasing, or resetting resources. 151 | /// 152 | /// 153 | /// This method calls with disposing parameter set to true. 154 | /// To implement resource releasing override the method. 155 | /// 156 | public void Dispose() 157 | { 158 | // Do not change this code. Put cleanup code in Dispose(bool disposing) above. 159 | Dispose(true); 160 | } 161 | #endregion 162 | } 163 | } 164 | -------------------------------------------------------------------------------- /eduOpenVPN/InteractiveService/Status.cs: -------------------------------------------------------------------------------- 1 | /* 2 | eduOpenVPN - OpenVPN Management Library for eduVPN (and beyond) 3 | 4 | Copyright: 2017-2023 The Commons Conservancy 5 | SPDX-License-Identifier: GPL-3.0+ 6 | */ 7 | 8 | using System.ComponentModel; 9 | 10 | namespace eduOpenVPN.InteractiveService 11 | { 12 | /// 13 | /// OpenVPN Interactive Service status message 14 | /// 15 | public class Status 16 | { 17 | #region Properties 18 | 19 | /// 20 | /// OpenVPN Interactive Service status code 21 | /// 22 | public uint Code { get; private set; } 23 | 24 | /// 25 | /// OpenVPN Interactive Service message (optional) 26 | /// 27 | public string Message { get; private set; } 28 | 29 | #endregion 30 | 31 | #region Constructors 32 | 33 | /// 34 | /// Constructs an OpenVPN Interactive Service status message 35 | /// 36 | /// Status code (0 success) 37 | /// Status description message 38 | public Status(uint code, string message) 39 | { 40 | Code = code; 41 | Message = message; 42 | } 43 | 44 | #endregion 45 | 46 | #region Methods 47 | 48 | /// 49 | public override string ToString() 50 | { 51 | return string.Format(Message != null ? "{0} (0x{1,X})" : "(0x{1,X})", Message, Code); 52 | } 53 | 54 | /// 55 | /// Parses OpenVPN Interactive Service response 56 | /// 57 | /// OpenVPN Interactive Service response 58 | /// or one of its derived class representing status 59 | public static Status FromResponse(string response) 60 | { 61 | var msg = response.Replace("\r\n", "\n").Split('\n'); 62 | var conv = new UInt32Converter(); 63 | var code = (uint)conv.ConvertFromString(msg[0]); 64 | if (code == 0 && msg[2] == "Process ID") 65 | return new StatusProcessId((int)(uint)conv.ConvertFromString(msg[1]), msg[2]); 66 | else 67 | return new StatusError(code, msg[1], msg[2] != "(null)" ? msg[2] : null); 68 | } 69 | 70 | #endregion 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /eduOpenVPN/InteractiveService/StatusError.cs: -------------------------------------------------------------------------------- 1 | /* 2 | eduOpenVPN - OpenVPN Management Library for eduVPN (and beyond) 3 | 4 | Copyright: 2017-2023 The Commons Conservancy 5 | SPDX-License-Identifier: GPL-3.0+ 6 | */ 7 | 8 | namespace eduOpenVPN.InteractiveService 9 | { 10 | /// 11 | /// OpenVPN Interactive Service error message 12 | /// 13 | public class StatusError : Status 14 | { 15 | #region Properties 16 | 17 | /// 18 | /// OpenVPN Interactive Service function 19 | /// 20 | public string Function { get; private set; } 21 | 22 | #endregion 23 | 24 | #region Constructors 25 | 26 | /// 27 | /// Constructs an OpenVPN Interactive Service error message 28 | /// 29 | /// Status code (0 success) 30 | /// The function that failed 31 | /// Additional error description (optional) 32 | public StatusError(uint code, string function, string message) : 33 | base(code, message) 34 | { 35 | Function = function; 36 | } 37 | 38 | #endregion 39 | 40 | #region Methods 41 | 42 | /// 43 | public override string ToString() 44 | { 45 | return string.Format("{0}: {1} (0x{2:X})", Function, Message, Code); 46 | } 47 | 48 | #endregion 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /eduOpenVPN/InteractiveService/StatusProcessId.cs: -------------------------------------------------------------------------------- 1 | /* 2 | eduOpenVPN - OpenVPN Management Library for eduVPN (and beyond) 3 | 4 | Copyright: 2017-2023 The Commons Conservancy 5 | SPDX-License-Identifier: GPL-3.0+ 6 | */ 7 | 8 | namespace eduOpenVPN.InteractiveService 9 | { 10 | /// 11 | /// OpenVPN Interactive Service openvpn.exe process identifier message 12 | /// 13 | public class StatusProcessId : Status 14 | { 15 | #region Properties 16 | 17 | /// 18 | /// openvpn.exe process identifier 19 | /// 20 | public int ProcessId { get; private set; } 21 | 22 | #endregion 23 | 24 | #region Constructors 25 | 26 | /// 27 | /// Constructs an OpenVPN Interactive Service openvpn.exe process identifier message 28 | /// 29 | /// openvpn.exe process identifier 30 | /// Additional error description (optional) 31 | public StatusProcessId(int pid, string message) : 32 | base(0, message) 33 | { 34 | ProcessId = pid; 35 | } 36 | 37 | #endregion 38 | 39 | #region Methods 40 | 41 | /// 42 | public override string ToString() 43 | { 44 | return string.Format("{0}: 0x{1:X}", Message, ProcessId); 45 | } 46 | 47 | #endregion 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /eduOpenVPN/Management/AuthenticationEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | eduOpenVPN - OpenVPN Management Library for eduVPN (and beyond) 3 | 4 | Copyright: 2017-2023 The Commons Conservancy 5 | SPDX-License-Identifier: GPL-3.0+ 6 | */ 7 | 8 | using System; 9 | 10 | namespace eduOpenVPN.Management 11 | { 12 | /// 13 | /// Authentication events base class 14 | /// 15 | public class AuthenticationEventArgs : EventArgs 16 | { 17 | #region Fields 18 | 19 | /// 20 | /// Realm title 21 | /// 22 | public readonly string Realm; 23 | 24 | #endregion 25 | 26 | #region Constructors 27 | 28 | /// 29 | /// Constructs an event arguments 30 | /// 31 | /// Realm title 32 | public AuthenticationEventArgs(string realm) 33 | { 34 | Realm = realm; 35 | } 36 | 37 | #endregion 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /eduOpenVPN/Management/AuthenticationTokenReportedEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | eduOpenVPN - OpenVPN Management Library for eduVPN (and beyond) 3 | 4 | Copyright: 2017-2023 The Commons Conservancy 5 | SPDX-License-Identifier: GPL-3.0+ 6 | */ 7 | 8 | using System; 9 | using System.Diagnostics; 10 | using System.Security; 11 | 12 | namespace eduOpenVPN.Management 13 | { 14 | /// 15 | /// event arguments 16 | /// 17 | public class AuthenticationTokenReportedEventArgs : EventArgs, IDisposable 18 | { 19 | #region Fields 20 | 21 | /// 22 | /// Authentication token 23 | /// 24 | public readonly SecureString Token; 25 | 26 | #endregion 27 | 28 | #region Constructors 29 | 30 | /// 31 | /// Constructs an event arguments 32 | /// 33 | /// Authentication token 34 | public AuthenticationTokenReportedEventArgs(SecureString token) 35 | { 36 | Token = token; 37 | } 38 | 39 | #endregion 40 | 41 | #region IDisposable Support 42 | /// 43 | /// Flag to detect redundant calls. 44 | /// 45 | [DebuggerBrowsable(DebuggerBrowsableState.Never)] 46 | private bool disposedValue = false; 47 | 48 | /// 49 | /// Called to dispose the object. 50 | /// 51 | /// Dispose managed objects 52 | /// 53 | /// To release resources for inherited classes, override this method. 54 | /// Call base.Dispose(disposing) within it to release parent class resources, and release child class resources if parameter is true. 55 | /// This method can get called multiple times for the same object instance. When the child specific resources should be released only once, introduce a flag to detect redundant calls. 56 | /// 57 | protected virtual void Dispose(bool disposing) 58 | { 59 | if (!disposedValue) 60 | { 61 | if (disposing) 62 | { 63 | if (Token != null) 64 | Token.Dispose(); 65 | } 66 | 67 | disposedValue = true; 68 | } 69 | } 70 | 71 | /// 72 | /// Performs application-defined tasks associated with freeing, releasing, or resetting resources. 73 | /// 74 | /// 75 | /// This method calls with disposing parameter set to true. 76 | /// To implement resource releasing override the method. 77 | /// 78 | public void Dispose() 79 | { 80 | // Do not change this code. Put cleanup code in Dispose(bool disposing) above. 81 | Dispose(true); 82 | } 83 | #endregion 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /eduOpenVPN/Management/ByteCountClientReportedEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | eduOpenVPN - OpenVPN Management Library for eduVPN (and beyond) 3 | 4 | Copyright: 2017-2023 The Commons Conservancy 5 | SPDX-License-Identifier: GPL-3.0+ 6 | */ 7 | 8 | namespace eduOpenVPN.Management 9 | { 10 | /// 11 | /// event arguments 12 | /// 13 | public class ByteCountClientReportedEventArgs : ByteCountReportedEventArgs 14 | { 15 | #region Properties 16 | 17 | /// 18 | /// Client identifier 19 | /// 20 | public uint ClientId { get; } 21 | 22 | #endregion 23 | 24 | #region Constructors 25 | 26 | /// 27 | /// Constructs an event arguments 28 | /// 29 | /// Client identifier 30 | /// Number of bytes that have been received from the server 31 | /// Number of bytes that have been sent to the server 32 | public ByteCountClientReportedEventArgs(uint clientId, ulong bytesIn, ulong bytesOut) : 33 | base(bytesIn, bytesOut) 34 | { 35 | ClientId = clientId; 36 | } 37 | 38 | #endregion 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /eduOpenVPN/Management/ByteCountReportedEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | eduOpenVPN - OpenVPN Management Library for eduVPN (and beyond) 3 | 4 | Copyright: 2017-2023 The Commons Conservancy 5 | SPDX-License-Identifier: GPL-3.0+ 6 | */ 7 | 8 | using System; 9 | 10 | namespace eduOpenVPN.Management 11 | { 12 | /// 13 | /// event arguments 14 | /// 15 | public class ByteCountReportedEventArgs : EventArgs 16 | { 17 | #region Fields 18 | 19 | /// 20 | /// Number of bytes that have been received from the server 21 | /// 22 | public readonly ulong RxBytes; 23 | 24 | /// 25 | /// Number of bytes that have been sent to the server 26 | /// 27 | public readonly ulong TxBytes; 28 | 29 | #endregion 30 | 31 | #region Constructors 32 | 33 | /// 34 | /// Constructs an event arguments 35 | /// 36 | /// Number of bytes that have been received from the server 37 | /// Number of bytes that have been sent to the server 38 | public ByteCountReportedEventArgs(ulong bytesIn, ulong bytesOut) 39 | { 40 | RxBytes = bytesIn; 41 | TxBytes = bytesOut; 42 | } 43 | 44 | #endregion 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /eduOpenVPN/Management/CertificateRequestedEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | eduOpenVPN - OpenVPN Management Library for eduVPN (and beyond) 3 | 4 | Copyright: 2017-2023 The Commons Conservancy 5 | SPDX-License-Identifier: GPL-3.0+ 6 | */ 7 | 8 | using System; 9 | using System.Security.Cryptography.X509Certificates; 10 | 11 | namespace eduOpenVPN.Management 12 | { 13 | /// 14 | /// event arguments 15 | /// 16 | public class CertificateRequestedEventArgs : EventArgs 17 | { 18 | #region Fields 19 | 20 | /// 21 | /// A hint about which certificate is required 22 | /// 23 | public readonly string Hint; 24 | 25 | /// 26 | /// Certificate 27 | /// 28 | public X509Certificate2 Certificate; 29 | 30 | #endregion 31 | 32 | #region Constructors 33 | 34 | /// 35 | /// Constructs an event arguments 36 | /// 37 | /// A hint about which certificate is required 38 | public CertificateRequestedEventArgs(string hint) 39 | { 40 | Hint = hint; 41 | } 42 | 43 | #endregion 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /eduOpenVPN/Management/CommandException.cs: -------------------------------------------------------------------------------- 1 | /* 2 | eduOpenVPN - OpenVPN Management Library for eduVPN (and beyond) 3 | 4 | Copyright: 2017-2023 The Commons Conservancy 5 | SPDX-License-Identifier: GPL-3.0+ 6 | */ 7 | 8 | using System; 9 | using System.Runtime.Serialization; 10 | 11 | namespace eduOpenVPN.Management 12 | { 13 | /// 14 | /// OpenVPN Management console error 15 | /// 16 | [Serializable] 17 | public class CommandException : Exception 18 | { 19 | #region Constructors 20 | 21 | /// 22 | /// Constructs an exception 23 | /// 24 | /// The error message that explains the reason for the exception. 25 | public CommandException(string message) : 26 | base(message) 27 | { 28 | } 29 | 30 | #endregion 31 | 32 | #region ISerializable Support 33 | 34 | /// 35 | /// Deserialize object. 36 | /// 37 | /// The populated with data. 38 | /// The source of this deserialization. 39 | protected CommandException(SerializationInfo info, StreamingContext context) 40 | : base(info, context) 41 | { } 42 | 43 | #endregion 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /eduOpenVPN/Management/EchoReceivedEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | eduOpenVPN - OpenVPN Management Library for eduVPN (and beyond) 3 | 4 | Copyright: 2017-2023 The Commons Conservancy 5 | SPDX-License-Identifier: GPL-3.0+ 6 | */ 7 | 8 | using System; 9 | 10 | namespace eduOpenVPN.Management 11 | { 12 | /// 13 | /// event arguments 14 | /// 15 | public class EchoReceivedEventArgs : TimestampedEventArgs 16 | { 17 | #region Properties 18 | 19 | /// 20 | /// Echo command 21 | /// 22 | public string Command { get; } 23 | 24 | #endregion 25 | 26 | #region Constructors 27 | 28 | /// 29 | /// Constructs an event arguments 30 | /// 31 | /// Timestamp of the command 32 | /// Echo command 33 | public EchoReceivedEventArgs(DateTimeOffset timestamp, string command) : 34 | base(timestamp) 35 | { 36 | Command = command; 37 | } 38 | 39 | #endregion 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /eduOpenVPN/Management/HoldReportedEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | eduOpenVPN - OpenVPN Management Library for eduVPN (and beyond) 3 | 4 | Copyright: 2017-2023 The Commons Conservancy 5 | SPDX-License-Identifier: GPL-3.0+ 6 | */ 7 | 8 | namespace eduOpenVPN.Management 9 | { 10 | /// 11 | /// event arguments 12 | /// 13 | public class HoldReportedEventArgs : MessageReportedEventArgs 14 | { 15 | #region Properties 16 | 17 | /// 18 | /// Indicates how long OpenVPN would wait without UI(as influenced by connect-retry exponential backoff). The UI needs to wait for releasing the hold if it wants similar behavior. 19 | /// 20 | public int WaitHint { get; } 21 | 22 | #endregion 23 | 24 | #region Constructors 25 | 26 | /// 27 | /// Constructs an event arguments 28 | /// 29 | /// Descriptive string 30 | /// Indicates how long OpenVPN would wait without UI(as influenced by connect-retry exponential backoff). The UI needs to wait for releasing the hold if it wants similar behavior. 31 | public HoldReportedEventArgs(string message, int waitHint) : 32 | base(message) 33 | { 34 | WaitHint = waitHint; 35 | } 36 | 37 | #endregion 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /eduOpenVPN/Management/LogMessageFlags.cs: -------------------------------------------------------------------------------- 1 | /* 2 | eduOpenVPN - OpenVPN Management Library for eduVPN (and beyond) 3 | 4 | Copyright: 2017-2023 The Commons Conservancy 5 | SPDX-License-Identifier: GPL-3.0+ 6 | */ 7 | 8 | using System; 9 | 10 | namespace eduOpenVPN.Management 11 | { 12 | /// 13 | /// OpenVPN log message flags 14 | /// 15 | [Flags] 16 | public enum LogMessageFlags 17 | { 18 | /// 19 | /// Informational 20 | /// 21 | Informational = 1 << 0, // 1 22 | 23 | /// 24 | /// Fatal error 25 | /// 26 | FatalError = 1 << 1, // 2 27 | 28 | /// 29 | /// Non-fatal error 30 | /// 31 | NonFatalError = 1 << 2, // 4 32 | 33 | /// 34 | /// Warning 35 | /// 36 | Warning = 1 << 3, // 8 37 | 38 | /// 39 | /// Debug 40 | /// 41 | Debug = 1 << 4, // 16 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /eduOpenVPN/Management/LogReportedEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | eduOpenVPN - OpenVPN Management Library for eduVPN (and beyond) 3 | 4 | Copyright: 2017-2023 The Commons Conservancy 5 | SPDX-License-Identifier: GPL-3.0+ 6 | */ 7 | 8 | using System; 9 | 10 | namespace eduOpenVPN.Management 11 | { 12 | /// 13 | /// event arguments 14 | /// 15 | public class LogReportedEventArgs : TimestampedEventArgs 16 | { 17 | #region Properties 18 | 19 | /// 20 | /// Log message flags 21 | /// 22 | public LogMessageFlags Flags { get; } 23 | 24 | /// 25 | /// Log message 26 | /// 27 | public string Message { get; } 28 | 29 | #endregion 30 | 31 | #region Constructors 32 | 33 | /// 34 | /// Constructs an event arguments 35 | /// 36 | /// Timestamp of the log entry 37 | /// Log message flags 38 | /// Log message 39 | public LogReportedEventArgs(DateTimeOffset timestamp, LogMessageFlags flags, string message) : 40 | base(timestamp) 41 | { 42 | Flags = flags; 43 | Message = message; 44 | } 45 | 46 | #endregion 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /eduOpenVPN/Management/MessageReportedEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | eduOpenVPN - OpenVPN Management Library for eduVPN (and beyond) 3 | 4 | Copyright: 2017-2023 The Commons Conservancy 5 | SPDX-License-Identifier: GPL-3.0+ 6 | */ 7 | 8 | using System; 9 | 10 | namespace eduOpenVPN.Management 11 | { 12 | /// 13 | /// Message event arguments base class 14 | /// 15 | public class MessageReportedEventArgs : EventArgs 16 | { 17 | #region Fields 18 | 19 | /// 20 | /// Descriptive string 21 | /// 22 | public readonly string Message; 23 | 24 | #endregion 25 | 26 | #region Constructors 27 | 28 | /// 29 | /// Constructs an event arguments 30 | /// 31 | /// Descriptive string 32 | public MessageReportedEventArgs(string message) 33 | { 34 | Message = message; 35 | } 36 | 37 | #endregion 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /eduOpenVPN/Management/MonitorConnectionException.cs: -------------------------------------------------------------------------------- 1 | /* 2 | eduOpenVPN - OpenVPN Management Library for eduVPN (and beyond) 3 | 4 | Copyright: 2017-2023 The Commons Conservancy 5 | SPDX-License-Identifier: GPL-3.0+ 6 | */ 7 | 8 | using System; 9 | using System.Runtime.Serialization; 10 | 11 | namespace eduOpenVPN.Management 12 | { 13 | /// 14 | /// OpenVPN Management connection failed 15 | /// 16 | [Serializable] 17 | public class MonitorConnectionException : AggregateException 18 | { 19 | #region Constructors 20 | 21 | /// 22 | /// Constructs an exception 23 | /// 24 | public MonitorConnectionException() : 25 | this(Resources.Strings.ErrorMonitorConnection, null) 26 | { } 27 | 28 | /// 29 | /// Constructs an exception 30 | /// 31 | /// Inner exception 32 | public MonitorConnectionException(Exception innerException) : 33 | this(Resources.Strings.ErrorMonitorConnection, innerException) 34 | { } 35 | 36 | /// 37 | /// Constructs an exception 38 | /// 39 | /// The error message that explains the reason for the exception. 40 | /// Inner exception 41 | public MonitorConnectionException(string message, Exception innerException) : 42 | base(message, innerException) 43 | { 44 | } 45 | 46 | #endregion 47 | 48 | #region ISerializable Support 49 | 50 | /// 51 | /// Deserialize object. 52 | /// 53 | /// The populated with data. 54 | /// The source of this deserialization. 55 | protected MonitorConnectionException(SerializationInfo info, StreamingContext context) 56 | : base(info, context) 57 | { } 58 | 59 | #endregion 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /eduOpenVPN/Management/MonitorTerminatedException.cs: -------------------------------------------------------------------------------- 1 | /* 2 | eduOpenVPN - OpenVPN Management Library for eduVPN (and beyond) 3 | 4 | Copyright: 2017-2023 The Commons Conservancy 5 | SPDX-License-Identifier: GPL-3.0+ 6 | */ 7 | 8 | using System; 9 | using System.Runtime.Serialization; 10 | 11 | namespace eduOpenVPN.Management 12 | { 13 | /// 14 | /// OpenVPN Management monitor terminated error 15 | /// 16 | [Serializable] 17 | public class MonitorTerminatedException : AggregateException 18 | { 19 | #region Constructors 20 | 21 | /// 22 | /// Constructs an exception 23 | /// 24 | public MonitorTerminatedException() : 25 | this(Resources.Strings.ErrorMonitorTerminated, null) 26 | { } 27 | 28 | /// 29 | /// Constructs an exception 30 | /// 31 | /// Inner exception 32 | public MonitorTerminatedException(Exception innerException) : 33 | this(Resources.Strings.ErrorMonitorTerminated, innerException) 34 | { } 35 | 36 | /// 37 | /// Constructs an exception 38 | /// 39 | /// The error message that explains the reason for the exception. 40 | /// Inner exception 41 | public MonitorTerminatedException(string message, Exception innerException) : 42 | base(message, innerException) 43 | { 44 | } 45 | 46 | #endregion 47 | 48 | #region ISerializable Support 49 | 50 | /// 51 | /// Deserialize object. 52 | /// 53 | /// The populated with data. 54 | /// The source of this deserialization. 55 | protected MonitorTerminatedException(SerializationInfo info, StreamingContext context) 56 | : base(info, context) 57 | { } 58 | 59 | #endregion 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /eduOpenVPN/Management/PasswordAuthenticationRequestedEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | eduOpenVPN - OpenVPN Management Library for eduVPN (and beyond) 3 | 4 | Copyright: 2017-2023 The Commons Conservancy 5 | SPDX-License-Identifier: GPL-3.0+ 6 | */ 7 | 8 | using System.Security; 9 | 10 | namespace eduOpenVPN.Management 11 | { 12 | /// 13 | /// Authentication events base class 14 | /// 15 | public class PasswordAuthenticationRequestedEventArgs : AuthenticationEventArgs 16 | { 17 | #region Properties 18 | 19 | /// 20 | /// Password 21 | /// 22 | public SecureString Password { get; set; } 23 | 24 | #endregion 25 | 26 | #region Constructors 27 | 28 | /// 29 | /// Constructs an event arguments 30 | /// 31 | /// Realm title 32 | public PasswordAuthenticationRequestedEventArgs(string realm) : 33 | base(realm) 34 | { 35 | } 36 | 37 | #endregion 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /eduOpenVPN/Management/ProtocolException.cs: -------------------------------------------------------------------------------- 1 | /* 2 | eduOpenVPN - OpenVPN Management Library for eduVPN (and beyond) 3 | 4 | Copyright: 2017-2023 The Commons Conservancy 5 | SPDX-License-Identifier: GPL-3.0+ 6 | */ 7 | 8 | using System; 9 | using System.Runtime.Serialization; 10 | using System.Security.Permissions; 11 | 12 | namespace eduOpenVPN.Management 13 | { 14 | /// 15 | /// OpenVPN Management protocol error. 16 | /// 17 | [Serializable] 18 | public class ProtocolException : Exception 19 | { 20 | #region Properties 21 | 22 | /// 23 | /// Gets the error message and the response, or only the error message if no response is set. 24 | /// 25 | public override string Message => Response != null ? string.Format(Resources.Strings.ErrorManagementManagementResponse, base.Message, Response) : base.Message; 26 | 27 | /// 28 | /// OpenVPN Management response that caused the problem 29 | /// 30 | public string Response { get; } 31 | 32 | #endregion 33 | 34 | #region Constructors 35 | 36 | /// 37 | /// Constructs an exception 38 | /// 39 | public ProtocolException() : 40 | base() 41 | { } 42 | 43 | /// 44 | /// Constructs an exception 45 | /// 46 | /// The error message that explains the reason for the exception. 47 | public ProtocolException(string message) : 48 | base(message) 49 | { } 50 | 51 | /// 52 | /// Constructs an exception 53 | /// 54 | /// The error message that explains the reason for the exception. 55 | /// Inner exception 56 | public ProtocolException(string message, Exception innerException) : 57 | base(message, innerException) 58 | { } 59 | 60 | /// 61 | /// Constructs an exception 62 | /// 63 | /// The error message that explains the reason for the exception. 64 | /// OpenVPN Management response 65 | /// Starting offset in 66 | public ProtocolException(string message, string response, int start = 0) : 67 | base(message) 68 | { 69 | Response = response.Length < start + 20 ? response.Substring(start) : response.Substring(start, 19) + "…"; 70 | } 71 | 72 | /// 73 | /// Constructs an exception 74 | /// 75 | /// The error message that explains the reason for the exception. 76 | /// OpenVPN Management response 77 | /// Starting offset in 78 | /// Inner exception 79 | public ProtocolException(string message, string response, int start, Exception innerException) : 80 | base(message, innerException) 81 | { 82 | Response = response.Length < start + 20 ? response.Substring(start) : response.Substring(start, 19) + "…"; 83 | } 84 | 85 | #endregion 86 | 87 | #region ISerializable Support 88 | 89 | /// 90 | /// Deserialize object. 91 | /// 92 | /// The populated with data. 93 | /// The source of this deserialization. 94 | protected ProtocolException(SerializationInfo info, StreamingContext context) 95 | : base(info, context) 96 | { 97 | Response = (string)info.GetValue("Response", typeof(string)); 98 | } 99 | 100 | /// 101 | [SecurityPermission(SecurityAction.Demand, SerializationFormatter = true)] 102 | public override void GetObjectData(SerializationInfo info, StreamingContext context) 103 | { 104 | base.GetObjectData(info, context); 105 | info.AddValue("Response", Response); 106 | } 107 | 108 | #endregion 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /eduOpenVPN/Management/RemoteAcceptAction.cs: -------------------------------------------------------------------------------- 1 | /* 2 | eduOpenVPN - OpenVPN Management Library for eduVPN (and beyond) 3 | 4 | Copyright: 2017 The Commons Conservancy 5 | SPDX-License-Identifier: GPL-3.0+ 6 | */ 7 | 8 | namespace eduOpenVPN.Management 9 | { 10 | /// 11 | /// OpenVPN Management session remote "ACCEPT" command action 12 | /// 13 | public class RemoteAcceptAction : RemoteAction 14 | { 15 | #region Methods 16 | 17 | /// 18 | public override string ToString() 19 | { 20 | return "ACCEPT"; 21 | } 22 | 23 | #endregion 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /eduOpenVPN/Management/RemoteAction.cs: -------------------------------------------------------------------------------- 1 | /* 2 | eduOpenVPN - OpenVPN Management Library for eduVPN (and beyond) 3 | 4 | Copyright: 2017 The Commons Conservancy 5 | SPDX-License-Identifier: GPL-3.0+ 6 | */ 7 | 8 | namespace eduOpenVPN.Management 9 | { 10 | /// 11 | /// OpenVPN Management session "remote" command action base class 12 | /// 13 | public class RemoteAction 14 | { 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /eduOpenVPN/Management/RemoteModAction.cs: -------------------------------------------------------------------------------- 1 | /* 2 | eduOpenVPN - OpenVPN Management Library for eduVPN (and beyond) 3 | 4 | Copyright: 2017-2023 The Commons Conservancy 5 | SPDX-License-Identifier: GPL-3.0+ 6 | */ 7 | 8 | namespace eduOpenVPN.Management 9 | { 10 | /// 11 | /// OpenVPN Management session remote "MOD" command action 12 | /// 13 | public class RemoteModAction : RemoteAction 14 | { 15 | #region Properties 16 | 17 | /// 18 | /// Hostname or IP address 19 | /// 20 | public string Host { get; } 21 | 22 | /// 23 | /// IP port 24 | /// 25 | public int Port { get; } 26 | 27 | #endregion 28 | 29 | #region Constructors 30 | 31 | /// 32 | /// Constructs a command action 33 | /// 34 | /// Hostname or IP address 35 | /// IP port 36 | public RemoteModAction(string host, int port) 37 | { 38 | Host = host; 39 | Port = port; 40 | } 41 | 42 | #endregion 43 | 44 | #region Methods 45 | 46 | /// 47 | public override string ToString() 48 | { 49 | return string.Format("MOD {0} {1:D}", Configuration.EscapeParamValue(Host), Port); 50 | } 51 | 52 | #endregion 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /eduOpenVPN/Management/RemoteReportedEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | eduOpenVPN - OpenVPN Management Library for eduVPN (and beyond) 3 | 4 | Copyright: 2017-2023 The Commons Conservancy 5 | SPDX-License-Identifier: GPL-3.0+ 6 | */ 7 | 8 | using System; 9 | 10 | namespace eduOpenVPN.Management 11 | { 12 | /// 13 | /// event arguments 14 | /// 15 | public class RemoteReportedEventArgs : EventArgs 16 | { 17 | #region Fields 18 | 19 | /// 20 | /// Hostname or IP address 21 | /// 22 | public readonly string Host; 23 | 24 | /// 25 | /// IP Port 26 | /// 27 | public readonly int Port; 28 | 29 | /// 30 | /// Protocol 31 | /// 32 | public readonly ProtoType Protocol; 33 | 34 | /// 35 | /// Required action for the given remote 36 | /// 37 | public RemoteAction Action; 38 | 39 | #endregion 40 | 41 | #region Constructors 42 | 43 | /// 44 | /// Constructs an event arguments 45 | /// 46 | /// Hostname or IP address 47 | /// IP Port 48 | /// Protocol 49 | public RemoteReportedEventArgs(string host, int port, ProtoType protocol) 50 | { 51 | Host = host; 52 | Port = port; 53 | Protocol = protocol; 54 | 55 | // Default action is accept. 56 | Action = new RemoteAcceptAction(); 57 | } 58 | 59 | #endregion 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /eduOpenVPN/Management/RemoteSkipAction.cs: -------------------------------------------------------------------------------- 1 | /* 2 | eduOpenVPN - OpenVPN Management Library for eduVPN (and beyond) 3 | 4 | Copyright: 2017 The Commons Conservancy 5 | SPDX-License-Identifier: GPL-3.0+ 6 | */ 7 | 8 | namespace eduOpenVPN.Management 9 | { 10 | /// 11 | /// OpenVPN Management session remote "SKIP" command action 12 | /// 13 | public class RemoteSkipAction : RemoteAction 14 | { 15 | #region Methods 16 | 17 | /// 18 | public override string ToString() 19 | { 20 | return "SKIP"; 21 | } 22 | 23 | #endregion 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /eduOpenVPN/Management/SessionStateException.cs: -------------------------------------------------------------------------------- 1 | /* 2 | eduOpenVPN - OpenVPN Management Library for eduVPN (and beyond) 3 | 4 | Copyright: 2017-2023 The Commons Conservancy 5 | SPDX-License-Identifier: GPL-3.0+ 6 | */ 7 | 8 | using System; 9 | using System.Runtime.Serialization; 10 | 11 | namespace eduOpenVPN.Management 12 | { 13 | /// 14 | /// OpenVPN session state error 15 | /// 16 | [Serializable] 17 | public class SessionStateException : Exception 18 | { 19 | #region Constructors 20 | 21 | /// 22 | /// Constructs an exception 23 | /// 24 | /// The error message that explains the reason for the exception. 25 | public SessionStateException(string message) : 26 | base(message) 27 | { 28 | } 29 | 30 | #endregion 31 | 32 | #region ISerializable Support 33 | 34 | /// 35 | /// Deserialize object. 36 | /// 37 | /// The populated with data. 38 | /// The source of this deserialization. 39 | protected SessionStateException(SerializationInfo info, StreamingContext context) 40 | : base(info, context) 41 | { } 42 | 43 | #endregion 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /eduOpenVPN/Management/SignRequestedEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | eduOpenVPN - OpenVPN Management Library for eduVPN (and beyond) 3 | 4 | Copyright: 2017-2023 The Commons Conservancy 5 | SPDX-License-Identifier: GPL-3.0+ 6 | */ 7 | 8 | using System; 9 | 10 | namespace eduOpenVPN.Management 11 | { 12 | /// 13 | /// event arguments 14 | /// 15 | public class SignRequestedEventArgs : EventArgs 16 | { 17 | #region Fields 18 | 19 | /// 20 | /// Data to be signed 21 | /// 22 | public readonly byte[] Data; 23 | 24 | /// 25 | /// Signing and padding algorithm 26 | /// 27 | public readonly SignAlgorithmType Algorithm; 28 | 29 | /// 30 | /// Signature of property 31 | /// 32 | public byte[] Signature; 33 | 34 | #endregion 35 | 36 | #region Constructors 37 | 38 | /// 39 | /// Constructs an event arguments 40 | /// 41 | /// Data to be signed 42 | /// Signing and padding algorithm 43 | public SignRequestedEventArgs(byte[] data, SignAlgorithmType algorithm) 44 | { 45 | Data = data; 46 | Algorithm = algorithm; 47 | } 48 | 49 | #endregion 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /eduOpenVPN/Management/StateReportedEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | eduOpenVPN - OpenVPN Management Library for eduVPN (and beyond) 3 | 4 | Copyright: 2017-2023 The Commons Conservancy 5 | SPDX-License-Identifier: GPL-3.0+ 6 | */ 7 | 8 | using System; 9 | using System.Net; 10 | 11 | namespace eduOpenVPN.Management 12 | { 13 | /// 14 | /// event arguments 15 | /// 16 | public class StateReportedEventArgs : TimestampedEventArgs 17 | { 18 | #region Properties 19 | 20 | /// 21 | /// OpenVPN state 22 | /// 23 | public OpenVPNStateType State { get; } 24 | 25 | /// 26 | /// Descriptive string (optional) 27 | /// 28 | public string Message { get; } 29 | 30 | /// 31 | /// TUN/TAP local IPv4 address (optional) 32 | /// 33 | public IPAddress Tunnel { get; } 34 | 35 | /// 36 | /// TUN/TAP local IPv6 address (optional) 37 | /// 38 | public IPAddress IPv6Tunnel { get; } 39 | 40 | /// 41 | /// Remote server address and port (optional) 42 | /// 43 | public IPEndPoint Remote { get; } 44 | 45 | /// 46 | /// Local address and port (optional) 47 | /// 48 | public IPEndPoint Local { get; } 49 | 50 | #endregion 51 | 52 | #region Constructors 53 | 54 | /// 55 | /// Constructs an event arguments 56 | /// 57 | /// Timestamp of the state 58 | /// OpenVPN state 59 | /// Descriptive string (optional) 60 | /// TUN/TAP local IPv4 address (optional) 61 | /// TUN/TAP local IPv6 address (optional) 62 | /// Remote server address and port (optional) 63 | /// Local address and port (optional) 64 | public StateReportedEventArgs(DateTimeOffset timestamp, OpenVPNStateType state, string message, IPAddress tunnel, IPAddress ipv6Tunnel, IPEndPoint remote, IPEndPoint local) : 65 | base(timestamp) 66 | { 67 | State = state; 68 | Message = message; 69 | Tunnel = tunnel; 70 | IPv6Tunnel = ipv6Tunnel; 71 | Remote = remote; 72 | Local = local; 73 | } 74 | 75 | #endregion 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /eduOpenVPN/Management/TimestampedEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | eduOpenVPN - OpenVPN Management Library for eduVPN (and beyond) 3 | 4 | Copyright: 2017-2023 The Commons Conservancy 5 | SPDX-License-Identifier: GPL-3.0+ 6 | */ 7 | 8 | using System; 9 | 10 | namespace eduOpenVPN.Management 11 | { 12 | /// 13 | /// Timestamped event arguments base class 14 | /// 15 | public class TimestampedEventArgs : EventArgs 16 | { 17 | #region Fields 18 | 19 | /// 20 | /// Timestamp of the event 21 | /// 22 | public readonly DateTimeOffset TimeStamp; 23 | 24 | #endregion 25 | 26 | #region Constructors 27 | 28 | /// 29 | /// Constructs an event arguments 30 | /// 31 | /// Timestamp of the event 32 | public TimestampedEventArgs(DateTimeOffset timestamp) 33 | { 34 | TimeStamp = timestamp; 35 | } 36 | 37 | #endregion 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /eduOpenVPN/Management/UnexpectedReplyException.cs: -------------------------------------------------------------------------------- 1 | /* 2 | eduOpenVPN - OpenVPN Management Library for eduVPN (and beyond) 3 | 4 | Copyright: 2017-2023 The Commons Conservancy 5 | SPDX-License-Identifier: GPL-3.0+ 6 | */ 7 | 8 | using System; 9 | using System.Runtime.Serialization; 10 | 11 | namespace eduOpenVPN.Management 12 | { 13 | /// 14 | /// The OpenVPN Management reply was not expected. 15 | /// 16 | [Serializable] 17 | public class UnexpectedReplyException : ProtocolException 18 | { 19 | #region Constructors 20 | 21 | /// 22 | /// Constructs an exception 23 | /// 24 | public UnexpectedReplyException(string response, int start = 0) : 25 | this(Resources.Strings.ErrorUnexpectedReply, response, start) 26 | { } 27 | 28 | /// 29 | /// Constructs an exception 30 | /// 31 | /// The error message that explains the reason for the exception. 32 | /// OpenVPN Management response 33 | /// Starting offset in 34 | public UnexpectedReplyException(string message, string response, int start = 0) : 35 | base(message, response, start) 36 | { 37 | } 38 | 39 | #endregion 40 | 41 | #region ISerializable Support 42 | 43 | /// 44 | /// Deserialize object. 45 | /// 46 | /// The populated with data. 47 | /// The source of this deserialization. 48 | protected UnexpectedReplyException(SerializationInfo info, StreamingContext context) 49 | : base(info, context) 50 | { 51 | } 52 | 53 | #endregion 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /eduOpenVPN/Management/UsernamePasswordAuthenticationRequestedEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | eduOpenVPN - OpenVPN Management Library for eduVPN (and beyond) 3 | 4 | Copyright: 2017-2023 The Commons Conservancy 5 | SPDX-License-Identifier: GPL-3.0+ 6 | */ 7 | 8 | namespace eduOpenVPN.Management 9 | { 10 | /// 11 | /// Username and password authentication request event arguments 12 | /// 13 | public class UsernamePasswordAuthenticationRequestedEventArgs : PasswordAuthenticationRequestedEventArgs 14 | { 15 | #region Properties 16 | 17 | /// 18 | /// Username 19 | /// 20 | public string Username { get; set; } 21 | 22 | #endregion 23 | 24 | #region Constructors 25 | 26 | /// 27 | /// Constructs an event arguments 28 | /// 29 | /// Realm title 30 | public UsernamePasswordAuthenticationRequestedEventArgs(string realm) : 31 | base(realm) 32 | { 33 | } 34 | 35 | #endregion 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /eduOpenVPN/OpenVPNStateType.cs: -------------------------------------------------------------------------------- 1 | /* 2 | eduOpenVPN - OpenVPN Management Library for eduVPN (and beyond) 3 | 4 | Copyright: 2017-2023 The Commons Conservancy 5 | SPDX-License-Identifier: GPL-3.0+ 6 | */ 7 | 8 | namespace eduOpenVPN 9 | { 10 | /// 11 | /// OpenVPN state type 12 | /// 13 | public enum OpenVPNStateType 14 | { 15 | /// 16 | /// Initial, undefined state (default) 17 | /// 18 | [ParameterValue("INITIAL")] 19 | Initial = 0, 20 | 21 | /// 22 | /// Management interface has been initialized 23 | /// 24 | [ParameterValue("CONNECTING")] 25 | Connecting = 1, 26 | 27 | /// 28 | /// Assigning IP address to virtual network interface 29 | /// 30 | [ParameterValue("ASSIGN_IP")] 31 | AssigningIP = 2, 32 | 33 | /// 34 | /// Adding routes to system 35 | /// 36 | [ParameterValue("ADD_ROUTES")] 37 | AddingRoutes = 3, 38 | 39 | /// 40 | /// Initialization Sequence Completed 41 | /// 42 | [ParameterValue("CONNECTED")] 43 | Connected = 4, 44 | 45 | /// 46 | /// A restart has occurred 47 | /// 48 | [ParameterValue("RECONNECTING")] 49 | Reconnecting = 5, 50 | 51 | /// 52 | /// A graceful exit is in progress 53 | /// 54 | [ParameterValue("EXITING")] 55 | Exiting = 6, 56 | 57 | /// 58 | /// Waiting for initial response from server (Client only) 59 | /// 60 | [ParameterValue("WAIT")] 61 | Waiting = 7, 62 | 63 | /// 64 | /// Authenticating with server (Client only) 65 | /// 66 | [ParameterValue("AUTH")] 67 | Authenticating = 8, 68 | 69 | /// 70 | /// Downloading configuration options from server (Client only) 71 | /// 72 | [ParameterValue("GET_CONFIG")] 73 | GettingConfiguration = 9, 74 | 75 | /// 76 | /// DNS lookup (Client only) 77 | /// 78 | [ParameterValue("RESOLVE")] 79 | Resolving = 10, 80 | 81 | /// 82 | /// Connecting to TCP server (Client only) 83 | /// 84 | [ParameterValue("TCP_CONNECT")] 85 | TcpConnecting = 11, 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /eduOpenVPN/ParameterValueAttribute.cs: -------------------------------------------------------------------------------- 1 | /* 2 | eduOpenVPN - OpenVPN Management Library for eduVPN (and beyond) 3 | 4 | Copyright: 2017-2023 The Commons Conservancy 5 | SPDX-License-Identifier: GPL-3.0+ 6 | */ 7 | 8 | using System; 9 | using System.Linq; 10 | 11 | namespace eduOpenVPN 12 | { 13 | /// 14 | /// OpenVPN parameter string value (to apply to enum constants) 15 | /// 16 | public sealed class ParameterValueAttribute : Attribute 17 | { 18 | #region Properties 19 | 20 | /// 21 | /// Attribute value 22 | /// 23 | public string Value { get; private set; } 24 | 25 | #endregion 26 | 27 | #region Constructors 28 | 29 | /// 30 | /// Constructs an attribute 31 | /// 32 | /// Value of the attribute 33 | public ParameterValueAttribute(string value) 34 | { 35 | Value = value; 36 | } 37 | 38 | #endregion 39 | 40 | #region Methods 41 | 42 | /// 43 | /// Looks-up enum by value 44 | /// 45 | /// Enum type 46 | /// value 47 | /// Resulting enum 48 | /// true if enum found; false otherwise 49 | public static bool TryGetEnumByParameterValueAttribute(string value, out T result) 50 | { 51 | var enumType = typeof(T); 52 | foreach (T val in Enum.GetValues(enumType)) 53 | { 54 | var fi = enumType.GetField(val.ToString()); 55 | if (fi.GetCustomAttributes(typeof(ParameterValueAttribute), false).SingleOrDefault() is ParameterValueAttribute attr && attr.Value == value) 56 | { 57 | result = val; 58 | return true; 59 | } 60 | } 61 | 62 | result = default; 63 | return false; 64 | } 65 | 66 | /// 67 | /// Looks-up enum by value 68 | /// 69 | /// Enum type 70 | /// value 71 | /// Resulting enum 72 | /// No enum with as found 73 | public static T GetEnumByParameterValueAttribute(string value) 74 | { 75 | if (TryGetEnumByParameterValueAttribute(value, out var result)) 76 | return result; 77 | 78 | throw new ArgumentException(string.Format(Resources.Strings.ErrorParameterValueNotFound, value, typeof(T).ToString()), nameof(value)); 79 | } 80 | 81 | #endregion 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /eduOpenVPN/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | /* 2 | eduOpenVPN - OpenVPN Management Library for eduVPN (and beyond) 3 | 4 | Copyright: 2017-2023 The Commons Conservancy 5 | SPDX-License-Identifier: GPL-3.0+ 6 | */ 7 | 8 | using System.Reflection; 9 | using System.Resources; 10 | using System.Runtime.InteropServices; 11 | 12 | // General Information about an assembly is controlled through the following 13 | // set of attributes. Change these attribute values to modify the information 14 | // associated with an assembly. 15 | [assembly: AssemblyTitle("OpenVPN Management Library")] 16 | [assembly: AssemblyCompany("SURF")] 17 | [assembly: AssemblyProduct("eduOpenVPN")] 18 | [assembly: AssemblyCopyright("Copyright © 2017-2023 The Commons Conservancy")] 19 | [assembly: NeutralResourcesLanguage("en-US")] 20 | 21 | // Setting ComVisible to false makes the types in this assembly not visible 22 | // to COM components. If you need to access a type in this assembly from 23 | // COM, set the ComVisible attribute to true on that type. 24 | [assembly: ComVisible(false)] 25 | 26 | // The following GUID is for the identifier of the typelib if this project is exposed to COM 27 | [assembly: Guid("ddf40a25-1180-40b1-9bf1-8d3d66d734ad")] 28 | 29 | // Version information for an assembly consists of the following four values: 30 | // 31 | // Major Version 32 | // Minor Version 33 | // Build Number 34 | // Revision 35 | [assembly: AssemblyVersion("1.14.*")] 36 | -------------------------------------------------------------------------------- /eduOpenVPN/ProtoType.cs: -------------------------------------------------------------------------------- 1 | /* 2 | eduOpenVPN - OpenVPN Management Library for eduVPN (and beyond) 3 | 4 | Copyright: 2017-2023 The Commons Conservancy 5 | SPDX-License-Identifier: GPL-3.0+ 6 | */ 7 | 8 | namespace eduOpenVPN 9 | { 10 | /// 11 | /// OpenVPN protocol 12 | /// 13 | public enum ProtoType 14 | { 15 | /// 16 | /// UDP 17 | /// 18 | [ParameterValue("udp")] 19 | UDP = 0, 20 | 21 | /// 22 | /// TCP client 23 | /// 24 | [ParameterValue("tcp-client")] 25 | TCPClient, 26 | 27 | /// 28 | /// TCP server 29 | /// 30 | [ParameterValue("tcp-server")] 31 | TCPServer, 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /eduOpenVPN/Resources/Strings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace eduOpenVPN.Resources { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Strings { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Strings() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("eduOpenVPN.Resources.Strings", typeof(Strings).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Looks up a localized string similar to Bad backslash (\) usage: remember that backslashes are treated as shell-escapes and if you need to pass backslash characters as part of a Windows filename, you should use double backslashes such as "c:\\openvpn\\static.key".. 65 | /// 66 | internal static string ErrorBadBackslash { 67 | get { 68 | return ResourceManager.GetString("ErrorBadBackslash", resourceCulture); 69 | } 70 | } 71 | 72 | /// 73 | /// Looks up a localized string similar to {1} (Error {0}). 74 | /// 75 | internal static string ErrorInteractiveService { 76 | get { 77 | return ResourceManager.GetString("ErrorInteractiveService", resourceCulture); 78 | } 79 | } 80 | 81 | /// 82 | /// Looks up a localized string similar to Connecting to the {0} interactive service failed. Please, make sure the service is started.. 83 | /// 84 | internal static string ErrorInteractiveServiceConnect { 85 | get { 86 | return ResourceManager.GetString("ErrorInteractiveServiceConnect", resourceCulture); 87 | } 88 | } 89 | 90 | /// 91 | /// Looks up a localized string similar to {0} Response: {1}. 92 | /// 93 | internal static string ErrorManagementManagementResponse { 94 | get { 95 | return ResourceManager.GetString("ErrorManagementManagementResponse", resourceCulture); 96 | } 97 | } 98 | 99 | /// 100 | /// Looks up a localized string similar to The OpenVPN Management connection failed.. 101 | /// 102 | internal static string ErrorMonitorConnection { 103 | get { 104 | return ResourceManager.GetString("ErrorMonitorConnection", resourceCulture); 105 | } 106 | } 107 | 108 | /// 109 | /// Looks up a localized string similar to The OpenVPN Management monitor is not running.. 110 | /// 111 | internal static string ErrorMonitorTerminated { 112 | get { 113 | return ResourceManager.GetString("ErrorMonitorTerminated", resourceCulture); 114 | } 115 | } 116 | 117 | /// 118 | /// Looks up a localized string similar to No closing quotation (").. 119 | /// 120 | internal static string ErrorNoClosingQuotation { 121 | get { 122 | return ResourceManager.GetString("ErrorNoClosingQuotation", resourceCulture); 123 | } 124 | } 125 | 126 | /// 127 | /// Looks up a localized string similar to No closing single quotation (').. 128 | /// 129 | internal static string ErrorNoClosingSingleQuotation { 130 | get { 131 | return ResourceManager.GetString("ErrorNoClosingSingleQuotation", resourceCulture); 132 | } 133 | } 134 | 135 | /// 136 | /// Looks up a localized string similar to {0} parameter value not found in {1} enum.. 137 | /// 138 | internal static string ErrorParameterValueNotFound { 139 | get { 140 | return ResourceManager.GetString("ErrorParameterValueNotFound", resourceCulture); 141 | } 142 | } 143 | 144 | /// 145 | /// Looks up a localized string similar to Residual parse state ({0}).. 146 | /// 147 | internal static string ErrorResidualParseState { 148 | get { 149 | return ResourceManager.GetString("ErrorResidualParseState", resourceCulture); 150 | } 151 | } 152 | 153 | /// 154 | /// Looks up a localized string similar to The OpenVPN session is in a state of error.. 155 | /// 156 | internal static string ErrorSessionState { 157 | get { 158 | return ResourceManager.GetString("ErrorSessionState", resourceCulture); 159 | } 160 | } 161 | 162 | /// 163 | /// Looks up a localized string similar to The OpenVPN Management reply was not expected.. 164 | /// 165 | internal static string ErrorUnexpectedReply { 166 | get { 167 | return ResourceManager.GetString("ErrorUnexpectedReply", resourceCulture); 168 | } 169 | } 170 | } 171 | } 172 | -------------------------------------------------------------------------------- /eduOpenVPN/Resources/Strings.ar.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | استخدام خاطئ للخط المائل العكسي (\): تذكر أن الخطوط المائلة العكسية يتم التعامل معها على أنها هروب من "ويندوز شل" ، وإذا كنت بحاجة إلى تمرير أحرف الخط المائل العكسي كجزء من اسم ملف ويندوز ، فيجب استخدام خطوط مائلة عكسية مزدوجة مثل "c:\\openvpn\\static.key". 122 | 123 | 124 | {1} (خطأ {0}) 125 | {0} = Error number, {1} = The name of the function 126 | 127 | 128 | فشل الاتصال بالخدمة التفاعلية {0}. رجاءا التأكد من بدء الخدمة. 129 | {0} = Name of the pipe to connect to 130 | 131 | 132 | {0} استجابة: {1} 133 | {0} = A sentence explaining an error, {1} = Response source code 134 | 135 | 136 | فشل اتصال إدارة OpenVPN. 137 | 138 | 139 | شاشة إدارة OpenVPN لا تعمل. 140 | 141 | 142 | لا اقتباس إغلاق ("). 143 | 144 | 145 | لا إغلاق اقتباس مفرد ('). 146 | 147 | 148 | لا قيمة معلمة {0} في تعداد {1}. 149 | {0} = Parameter value name, {1} = Enum data type 150 | 151 | 152 | حالة التحليل المتبقية ({0}). 153 | 154 | 155 | جلسة OpenVPN في حالة خطأ. 156 | 157 | 158 | لم يكن رد إدارة OpenVPN متوقعًا. 159 | 160 | 161 | -------------------------------------------------------------------------------- /eduOpenVPN/Resources/Strings.de.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | Fehlerhafte Verwendung von Backslashes (\): Beachten Sie, dass Backslashes als Shell-Escapezeichen behandelt werden. Wenn Sie Backslash-Zeichen als Teil eines Windows-Dateinamens übergeben, sollten Sie doppelte Backslashes wie zum Beispiel "c:\\openvpn\\static.key" verwenden. 122 | 123 | 124 | {1} (Fehler {0}) 125 | {0} = Error number, {1} = The name of the function 126 | 127 | 128 | Die Verbindung zum interaktiven Dienst {0} ist fehlgeschlagen. Vergewissern Sie sich bitte, dass der Dienst gestartet ist. 129 | {0} = Name of the pipe to connect to 130 | 131 | 132 | {0} Antwort: {1} 133 | {0} = A sentence explaining an error, {1} = Response source code 134 | 135 | 136 | Die OpenVPN-Verwaltungsverbindung ist fehlgeschlagen. 137 | 138 | 139 | Der OpenVPN-Verwaltungsmonitor läuft nicht. 140 | 141 | 142 | Schließende doppelte Anführungszeichen fehlen ("). 143 | 144 | 145 | Schießende einfache Anführungszeichen fehlen ('). 146 | 147 | 148 | Kein Parameterwert {0} in enum {1}. 149 | {0} = Parameter value name, {1} = Enum data type 150 | 151 | 152 | Restlicher Parse-Zustand ({0}). 153 | 154 | 155 | Die OpenVPN-Sitzung befindet sich in einem Fehlerzustand. 156 | 157 | 158 | Die Antwort der OpenVPN-Verwaltung wurde nicht erwartet. 159 | 160 | 161 | -------------------------------------------------------------------------------- /eduOpenVPN/Resources/Strings.es-ES.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | Bad backslash (\) usage: remember that backslashes are treated as shell-escapes and if you need to pass backslash characters as part of a Windows filename, you should use double backslashes such as "c:\\openvpn\\static.key". 122 | 123 | 124 | {1} (Error {0}) 125 | {0} = Error number, {1} = The name of the function 126 | 127 | 128 | Connecting to the {0} interactive service failed. Please, make sure the service is started. 129 | {0} = Name of the pipe to connect to 130 | 131 | 132 | {0} Response: {1} 133 | {0} = A sentence explaining an error, {1} = Response source code 134 | 135 | 136 | The OpenVPN Management connection failed. 137 | 138 | 139 | The OpenVPN Management monitor is not running. 140 | 141 | 142 | No closing quotation ("). 143 | 144 | 145 | No closing single quotation ('). 146 | 147 | 148 | {0} parameter value not found in {1} enum. 149 | {0} = Parameter value name, {1} = Enum data type 150 | 151 | 152 | Residual parse state ({0}). 153 | 154 | 155 | The OpenVPN session is in a state of error. 156 | 157 | 158 | The OpenVPN Management reply was not expected. 159 | 160 | 161 | -------------------------------------------------------------------------------- /eduOpenVPN/Resources/Strings.es.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | Mal uso de barra invertida (\): recuerde que las barras invertidas se tratan como escapes de shell y si necesita pasar caracteres de barra invertida como parte de un nombre de archivo de Windows, debe usar barras invertidas dobles como "c:\\openvpn\\static.key". 122 | 123 | 124 | {1} (Error {0}) 125 | {0} = Error number, {1} = The name of the function 126 | 127 | 128 | Falló la conexión con el servicio interactivo {0}. For favor, asegúrese que el servicio esta iniciado. 129 | {0} = Name of the pipe to connect to 130 | 131 | 132 | {0} Respuesta: {1} 133 | {0} = A sentence explaining an error, {1} = Response source code 134 | 135 | 136 | The OpenVPN Management connection failed. 137 | 138 | 139 | El monitor de Administración OpenVPN no esta ejecutándose. 140 | 141 | 142 | No hay comillas de cierre ("). 143 | 144 | 145 | No hay comillas simples de cierre ('); 146 | 147 | 148 | {0} valor del parámetro no encontrado en posición {1}. 149 | {0} = Parameter value name, {1} = Enum data type 150 | 151 | 152 | Estado de análisis residual ({0}). 153 | 154 | 155 | La sesión de OpenVPN esta un un estado de error. 156 | 157 | 158 | No se esperaba la respuesta de Administración OpenVPN. 159 | 160 | 161 | -------------------------------------------------------------------------------- /eduOpenVPN/Resources/Strings.fr.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | Mauvaise utilisation de l'antislash (\) : rappelez-vous que les antislashes sont traitées comme des échappements de shell, si vous voulez utiliser les antislashes dans le nom de fichier Windows, vous devez utiliser des antislashes doubles, telles que "c:\\openvpn\\static.key". 122 | 123 | 124 | {1}(Erreur {0}) 125 | {0} = Error number, {1} = The name of the function 126 | 127 | 128 | La connexion à {0} Service Interactif a échoué. Assurez-vous que le service est démarré. 129 | {0} = Name of the pipe to connect to 130 | 131 | 132 | {0} Réponse: {1} 133 | {0} = A sentence explaining an error, {1} = Response source code 134 | 135 | 136 | The OpenVPN Management connection failed. 137 | 138 | 139 | Le moniteur de gestion d'OpenVPN n'est pas en cours d'exécution. 140 | 141 | 142 | Aucune double apostrophe de fermeture ("). 143 | 144 | 145 | Aucune apostrophe simple de fermeture ("). 146 | 147 | 148 | {0} valeur du paramètre introuvable dans {1} enum. 149 | {0} = Parameter value name, {1} = Enum data type 150 | 151 | 152 | État d'analyse résiduelle ({0}). 153 | 154 | 155 | La session OpenVPN est en erreur. 156 | 157 | 158 | La réponse de l'interface de Gestion d'OpenVPN est inattendue. 159 | 160 | 161 | -------------------------------------------------------------------------------- /eduOpenVPN/Resources/Strings.nb.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | Feil bruk av backslash (\): husk at backslash blir brukt som shell-escape og hvis du trenger disse som del av et filnavn må du skrive dobbel backslash som f.eks "c:\\openvpn\\static.key". 122 | 123 | 124 | {0} (Feil {1}) 125 | {0} = Error number, {1} = The name of the function 126 | 127 | 128 | Kobling til {0} Interaktiv tjeneste feilet. Vennligst bekreft at tjenesten er startet. 129 | {0} = Name of the pipe to connect to 130 | 131 | 132 | {0} Svar: {1} 133 | {0} = A sentence explaining an error, {1} = Response source code 134 | 135 | 136 | The OpenVPN Management connection failed. 137 | 138 | 139 | OpenVPN Management monitor kjører ikke. 140 | 141 | 142 | Mangler avsluttende anførselstegn ("). 143 | 144 | 145 | Mangler avsluttende anførselstegn ('). 146 | 147 | 148 | {0} parameterverdi ikke oppført i {1} enum. 149 | {0} = Parameter value name, {1} = Enum data type 150 | 151 | 152 | Resterende parse status ({0}). 153 | 154 | 155 | OpenVPN-sesjonen er i feiltilstand. 156 | 157 | 158 | OpenVPN Management svarte på en uforventet måte. 159 | 160 | 161 | -------------------------------------------------------------------------------- /eduOpenVPN/Resources/Strings.nl.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | Verkeerd backslash (\) gebruik: vergeet niet dat backslashes worden behandeld als shell-escapes en als je backslash karakters moet doorgeven als onderdeel van een Windows bestandsnaam, moet je dubbele backslash gebruiken zoals "c:\\openvpn\\static.key". 122 | 123 | 124 | {1} (Fout {0}) 125 | {0} = Error number, {1} = The name of the function 126 | 127 | 128 | Verbinding met de {0} interactieve service mislukt. Zorg er a.u.b. voor dat de service gestart is. 129 | {0} = Name of the pipe to connect to 130 | 131 | 132 | {0} Antwoord: {1} 133 | {0} = A sentence explaining an error, {1} = Response source code 134 | 135 | 136 | The OpenVPN Management connection failed. 137 | 138 | 139 | De OpenVPN Management monitor draait niet. 140 | 141 | 142 | Geen afsluitend aanhalingsteken ("). 143 | 144 | 145 | Geen afsluitend enkel aanhalingsteken ('). 146 | 147 | 148 | {0} parameter waarde niet gevonden in {1} enum. 149 | {0} = Parameter value name, {1} = Enum data type 150 | 151 | 152 | Resterende parse status ({0}). 153 | 154 | 155 | De OpenVPN-sessie is in een fouttoestand. 156 | 157 | 158 | Het OpenVPN Management antwoord was niet verwacht. 159 | 160 | 161 | -------------------------------------------------------------------------------- /eduOpenVPN/Resources/Strings.pt-PT.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | Mau uso do caracter (\): lembre-se que as barras invertidas são tratadas como saídas da sessão remota e se tiver necessidade de passar esses caracteres como parte de um nome de ficheiro Windows, deverá usar duplamente a barra invertida, da seguinte forma "c:\\openvpn\\static.key". 122 | 123 | 124 | {1} (Erro {0}) 125 | {0} = Error number, {1} = The name of the function 126 | 127 | 128 | A ligação ao serviço interactivo {0} falhou. Por favor, certifique-se que o serviço foi iniciado. 129 | {0} = Name of the pipe to connect to 130 | 131 | 132 | {0} Resposta: {1} 133 | {0} = A sentence explaining an error, {1} = Response source code 134 | 135 | 136 | The OpenVPN Management connection failed. 137 | 138 | 139 | O monitor da consola de gestão do OpenVPN não está a correr. 140 | 141 | 142 | Sem fecho de plica ("). 143 | 144 | 145 | Sem fecho de plica única ('). 146 | 147 | 148 | {0} valor do parâmetro não encontrado em {1} enum. 149 | {0} = Parameter value name, {1} = Enum data type 150 | 151 | 152 | Estado de processamento residual ({0}). 153 | 154 | 155 | A sessão OpenVPN está num estado de erro. 156 | 157 | 158 | A resposta da gestão do OpenVPN não foi a esperada. 159 | 160 | 161 | -------------------------------------------------------------------------------- /eduOpenVPN/Resources/Strings.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | Bad backslash (\) usage: remember that backslashes are treated as shell-escapes and if you need to pass backslash characters as part of a Windows filename, you should use double backslashes such as "c:\\openvpn\\static.key". 122 | 123 | 124 | {1} (Error {0}) 125 | {0} = Error number, {1} = The name of the function 126 | 127 | 128 | Connecting to the {0} interactive service failed. Please, make sure the service is started. 129 | {0} = Name of the pipe to connect to 130 | 131 | 132 | {0} Response: {1} 133 | {0} = A sentence explaining an error, {1} = Response source code 134 | 135 | 136 | The OpenVPN Management connection failed. 137 | 138 | 139 | The OpenVPN Management monitor is not running. 140 | 141 | 142 | No closing quotation ("). 143 | 144 | 145 | No closing single quotation ('). 146 | 147 | 148 | {0} parameter value not found in {1} enum. 149 | {0} = Parameter value name, {1} = Enum data type 150 | 151 | 152 | Residual parse state ({0}). 153 | 154 | 155 | The OpenVPN session is in a state of error. 156 | 157 | 158 | The OpenVPN Management reply was not expected. 159 | 160 | 161 | -------------------------------------------------------------------------------- /eduOpenVPN/Resources/Strings.sl.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | Napačna uporaba poševnice nazaj (\): Pomnite, da se poševnice nazaj uporabljajo kot ubežnice lupine in kadar morate ubežnico nazaj podati kot del imena datoteke Windows, uporabite dvojne ubežnice nazaj, kot na primer "c:\\openvpn\\static.key". 122 | 123 | 124 | {1} (napaka {0}) 125 | {0} = Error number, {1} = The name of the function 126 | 127 | 128 | Povezovanje na interaktivno storitev {0} ni uspelo. Preverite, ali je storitev zagnana. 129 | {0} = Name of the pipe to connect to 130 | 131 | 132 | {0} Odziv: {1} 133 | {0} = A sentence explaining an error, {1} = Response source code 134 | 135 | 136 | Povezava OpenVPN Management je spodletela. 137 | 138 | 139 | Monitor OpenVPN Management ni zagnan. 140 | 141 | 142 | Manjka zaključni dvojni narekovaj ("). 143 | 144 | 145 | Manjka zaključni enojni narekovaj ('). 146 | 147 | 148 | Vrednost parametra {0} ni najdena v oštevilčenju {1}. 149 | {0} = Parameter value name, {1} = Enum data type 150 | 151 | 152 | Odvečno stanje razčlenjevalnika ({0}). 153 | 154 | 155 | Seja OpenVPN je v stanju napake. 156 | 157 | 158 | Nepričakovan odgovor OpenVPN Management. 159 | 160 | 161 | -------------------------------------------------------------------------------- /eduOpenVPN/Resources/Strings.tr.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | Hatalı ters eğik çizgi (\) kullanımı: ters eğik çizgilerin kabuk kaçışları olarak değerlendirildiğini ve bir Windows dosya adının bir parçası olarak ters eğik çizgi karakterlerini geçirmeniz gerekiyorsa, "c:\\openvpn\\static.key" gibi çift ters eğik çizgi kullanmalısınız. 122 | 123 | 124 | {1}(Hata {0}) 125 | {0} = Error number, {1} = The name of the function 126 | 127 | 128 | Etkileşimli hizmete bağlanma {0} başarısız oldu. Lütfen hizmetin başlatıldığından emin olun. 129 | {0} = Name of the pipe to connect to 130 | 131 | 132 | {0}Cevap: {1} 133 | {0} = A sentence explaining an error, {1} = Response source code 134 | 135 | 136 | The OpenVPN Management connection failed. 137 | 138 | 139 | OpenVPN Yönetim monitörü çalışmıyor. 140 | 141 | 142 | Kapanış teklifi yok ("). 143 | 144 | 145 | Kapanış tek tırnak (') yok. 146 | 147 | 148 | {0}enum'da {1} parametre değeri bulunamadı. 149 | {0} = Parameter value name, {1} = Enum data type 150 | 151 | 152 | Artık ayrıştırma durumu ({0}) 153 | 154 | 155 | OpenVPN oturumu bir hata ile karşılaştı. 156 | 157 | 158 | OpenVPN Yönetimi beklenmeyen yanıt ile karşılaşıldı. 159 | 160 | 161 | -------------------------------------------------------------------------------- /eduOpenVPN/Resources/Strings.uk.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | Використання зворотної похилої риски (\): пам'ятайте, що зворотні риски використовуються для екранування символів що слідують за ними і утворюють спеціальне призначення. Якщо вам потрібно передати символи зворотної риски як частину імені файлу Windows, слід використовувати подвійні зворотні риски, такі як "c:\\openvpn\\static.key". 122 | 123 | 124 | {1} (Помилка {0}) 125 | {0} = Error number, {1} = The name of the function 126 | 127 | 128 | Помилка підключення до {0} інтерактивної служби. Будь ласка, переконайтеся, що послуга запущена. 129 | {0} = Name of the pipe to connect to 130 | 131 | 132 | {0} Відповідь: {1} 133 | {0} = A sentence explaining an error, {1} = Response source code 134 | 135 | 136 | The OpenVPN Management connection failed. 137 | 138 | 139 | Монітор OpenVPN Management не запущено. 140 | 141 | 142 | Відсутні закриваючи лапки ("). 143 | 144 | 145 | Відсутні одинарні закриваючи лапки ('). 146 | 147 | 148 | {0} значення параметра не знайдено у {1} списку. 149 | {0} = Parameter value name, {1} = Enum data type 150 | 151 | 152 | Залишковий стан розбору ({0}). 153 | 154 | 155 | Сеанс OpenVPN знаходиться в стані помилки. 156 | 157 | 158 | Відповідь OpenVPN Management була неочікувана 159 | 160 | 161 | -------------------------------------------------------------------------------- /eduOpenVPN/SignAlgorithmType.cs: -------------------------------------------------------------------------------- 1 | /* 2 | eduOpenVPN - OpenVPN Management Library for eduVPN (and beyond) 3 | 4 | Copyright: 2017-2023 The Commons Conservancy 5 | SPDX-License-Identifier: GPL-3.0+ 6 | */ 7 | 8 | namespace eduOpenVPN 9 | { 10 | /// 11 | /// Signature and padding algorithm type 12 | /// 13 | public enum SignAlgorithmType 14 | { 15 | /// 16 | /// Undefined signature and padding (default) 17 | /// 18 | [ParameterValue("UNDEFINED")] 19 | Undefined = 0, 20 | 21 | /// 22 | /// RSA signature with PKCS1 padding 23 | /// 24 | [ParameterValue("RSA_PKCS1_PADDING")] 25 | RSASignaturePKCS1Padding = 1, 26 | 27 | /// 28 | /// RSA signature with no padding 29 | /// 30 | [ParameterValue("RSA_NO_PADDING")] 31 | RSASignatureNoPadding = 2, 32 | 33 | /// 34 | /// EC signature 35 | /// 36 | [ParameterValue("ECDSA")] 37 | ECDSA = 3, 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /eduOpenVPN/SignalType.cs: -------------------------------------------------------------------------------- 1 | /* 2 | eduOpenVPN - OpenVPN Management Library for eduVPN (and beyond) 3 | 4 | Copyright: 2017-2023 The Commons Conservancy 5 | SPDX-License-Identifier: GPL-3.0+ 6 | */ 7 | 8 | namespace eduOpenVPN 9 | { 10 | /// 11 | /// Unix signals used by OpenVPN 12 | /// 13 | public enum SignalType 14 | { 15 | /// 16 | /// Cause OpenVPN to close all TUN/TAP and network connections, restart, re-read the configuration file (if any), and reopen TUN/TAP and network connections. 17 | /// 18 | SIGHUP = 1, 19 | 20 | /// 21 | /// Causes OpenVPN to exit gracefully. 22 | /// 23 | SIGTERM = 15, 24 | 25 | /// 26 | /// Like , except don't re-read configuration file, and possibly don't close and reopen TUN/TAP device, 27 | /// re-read key files, preserve local IP address/port, or preserve most recently authenticated remote IP address/port 28 | /// based on --persist-tun, --persist-key, --persist-local-ip, and --persist-remote-ip options 29 | /// respectively (see above). 30 | /// 31 | /// This signal may also be internally generated by a timeout condition, governed by the --ping-restart 32 | /// option. 33 | /// 34 | /// This signal, when combined with --persist-remote-ip, may be sent when the underlying parameters of the 35 | /// host's network interface change such as when the host is a DHCP client and is assigned a new IP address. 36 | /// See --ipchange for more information. 37 | /// 38 | SIGUSR1, 39 | 40 | /// 41 | /// Causes OpenVPN to display its current statistics (to the syslog file if --daemon is used, or stdout otherwise). 42 | /// 43 | SIGUSR2, 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /eduOpenVPN/eduOpenVPN.csproj: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | 10 | 11 | Release 12 | AnyCPU 13 | {DDF40A25-1180-40B1-9BF1-8D3D66D734AD} 14 | Library 15 | Properties 16 | eduOpenVPN 17 | eduOpenVPN 18 | v4.8 19 | 512 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 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | True 76 | True 77 | Strings.resx 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | ResXFileCodeGenerator 89 | Strings.Designer.cs 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | {0e2c74ac-c81c-4cc6-b88d-81192623a66d} 101 | eduEx 102 | 103 | 104 | 105 | 106 | --------------------------------------------------------------------------------